SVG Import scaling is wrong on some files #50048
Labels
No Label
Interest
Animation & Rigging
Interest
Blender Cloud
Interest
Collada
Interest
Core
Interest
Documentation
Interest
Eevee & Viewport
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
Import and Export
Interest
Modeling
Interest
Modifiers
Interest
Nodes & Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds, Tests & Devices
Interest
Python API
Interest
Rendering & Cycles
Interest
Sculpt, Paint & Texture
Interest
Translations
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Meta
Good First Issue
Meta
Papercut
Module
Add-ons (BF-Blender)
Module
Add-ons (Community)
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
5 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#50048
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Blender Version
2.78a, e8299c8
Short description of error
SVG files with
viewBox
attribute that differ from with/height attributes are scaled wrong.Exact steps for others to reproduce the error
Cteate SVG file with content below:
And then import it with
File -> Import -> Scalable Vector Graphics (.svg)
. It is expected that the square will be 1x1 Blender units, but it's 3543x3543 Blender units.That is because scaling is performed twice in
SVGMatrixFromNode()
function inimport_svg.py
file.I don't quite understand what's happening during the function and why first scaling is needed, but I've made a "patch" that, I believe, kinda solves the issue. I may be totally wrong with this solution =)
import_svg.diff
Changed status to: 'Open'
Added subscriber: @uvx3
Added subscribers: @Sergey, @VukGardasevic
I did an import on the generated SVG file with the code from the example and the scale seems off.
@Sergey when you have time, can you look into it. Thanks. :)
@uvx3, can you submit diff in an unified format (o even better, diff generated by
git diff
) ?Sorry for the wrong diff format.
Here's an output of
diff -u
.import_svg.diff
It's strange, but I cant attach the python file. Here's a link to the file I've uploaded to github.
Added subscribers: @howardt, @BrendonMurphy
@howardt anything to do here?
@BrendonMurphy, not sure why Howard is involved here. If this is still an issue the patch needs to be updated against latest sources.
@Sergey my mistake, I was looking at his addon in contrib
Removed subscriber: @howardt
@Sergey was this fixed by
c2aef4a98f
: SVG: Fix wrong closed path with quadratic segments?@BrendonMurphy, that sounds as an unrelated change, but there were other fixes related to this one, i.e.
b302fdf053
.I've tried to import the demo SVN from this task and it shows as 1x1 plane, which is what the task description says is expected.
So my guess is that everything is working fine now.
Added subscriber: @iss
Changed status from 'Confirmed' to: 'Resolved'
SVG file is imported as 1x1 plane now so I will assume this has been resolved.
If there are still any issues with scalig, please file new report