import_curve.svg() ValueError: matrix does not have an inverse #102396

Closed
opened 2022-11-10 06:16:12 +01:00 by Adam Krebs · 9 comments

System Information
Operating system: Windows 10 / 20H2 OS Build 19042.1083
Graphics card: RTX 3060 Mobile

Blender Version
Broken: 3.3.1
Worked: (n/a)

Short description of error

Importing an SVG with bpy.ops.import_curve.svg results in an error

# ... snip
  File "C:\Program Files\Blender Foundation\Blender 3.3\3.3\scripts\addons\io_curve_svg\import_svg.py", line 965, in _popMatrix
    self._context['matrix'] = self._context['matrix'] @ matrix.inverted()
ValueError: Matrix.invert(ed): matrix does not have an inverse

Exact steps for others to reproduce the error

Using this file:
File: geo-eye-0.svg

Run this line in the Python console:

bpy.ops.import_curve.svg(filepath=r'geo-eye-0.svg')

Could this use inverted_safe instead?

**System Information** Operating system: Windows 10 / 20H2 OS Build 19042.1083 Graphics card: RTX 3060 Mobile **Blender Version** Broken: 3.3.1 Worked: (n/a) **Short description of error** Importing an SVG with `bpy.ops.import_curve.svg` results in an error ``` # ... snip File "C:\Program Files\Blender Foundation\Blender 3.3\3.3\scripts\addons\io_curve_svg\import_svg.py", line 965, in _popMatrix self._context['matrix'] = self._context['matrix'] @ matrix.inverted() ValueError: Matrix.invert(ed): matrix does not have an inverse ``` **Exact steps for others to reproduce the error** Using this file: File: ![geo-eye-0.svg](https://archive.blender.org/developer/F13881529/geo-eye-0.svg) Run this line in the Python console: ``` bpy.ops.import_curve.svg(filepath=r'geo-eye-0.svg') ``` Could this use [inverted_safe ](https://docs.blender.org/api/current/mathutils.html#mathutils.Matrix.inverted_safe) instead?
Author

Added subscriber: @Krebs

Added subscriber: @Krebs
Author

Confirmed that this also fails in the File > Import > SVG path too.

Confirmed that this also fails in the File > Import > SVG path too.
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Member

Added subscriber: @PratikPB2123

Added subscriber: @PratikPB2123

Added subscriber: @Sergey

Added subscriber: @Sergey
Sergey Sharybin self-assigned this 2022-11-10 10:48:06 +01:00

Unfortunately, it is not as simple as simple use of inverted_safe. Using it will make it pushing degenerated matrix and poping it from the stack will not properly restore the state of the transformation stack.

I am currently testing a different approach to the matrix stack which does not require inversion and multiplication in pop.

Unfortunately, it is not as simple as simple use of `inverted_safe`. Using it will make it pushing degenerated matrix and poping it from the stack will not properly restore the state of the transformation stack. I am currently testing a different approach to the matrix stack which does not require inversion and multiplication in pop.

This issue was referenced by a28c3f9cc0

This issue was referenced by a28c3f9cc009958695e33c929a4524d10e0d31e0

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Author

Thanks for the quick fix! Looking forward to testing it out

Thanks for the quick fix! Looking forward to testing it out
Sign in to join this conversation.
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#102396
No description provided.