ungroup to avoid transform/translate
-
- Posts: 4
- Joined: Thu Oct 09, 2014 4:24 am
ungroup to avoid transform/translate
I've read some discussions but haven't been able to figure this out. I want to save my SVG files without any tranforms or translates. The discussions said to remove any groups. But it does not appear to be possible to ungroup objects. I can select individual shapes but when I view the XML I still see all my path elements are contained in a g element. Perhaps I am going about this the wrong way. My goal as I stated is to "flatten" my drawing - meaning remove any transform/translate statements by having the underlying coordinate points changed to reflect the transform.
-
- Posts: 2344
- Joined: Sun Apr 14, 2013 12:04 pm
- Location: Michigan, USA
Re: ungroup to avoid transform/translate
Try:
Edit: Preferences>Transforms>Store transformation>Optimized
Edit: Preferences>Transforms>Store transformation>Optimized
Have a nice day.
I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1
The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/
I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1
The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/
-
- Posts: 4
- Joined: Thu Oct 09, 2014 4:24 am
Re: ungroup to avoid transform/translate
That's already set. So how does one make it do its thing?
-
- Posts: 4
- Joined: Thu Oct 09, 2014 4:24 am
Re: ungroup to avoid transform/translate
I did find that I can remove the transform on the parent g element by going into the xml editor and dragging the shapes out of the g and then deleting it. But I assume there is a more direct way that doesn't involve using the xml editor and removing the g element.
Re: ungroup to avoid transform/translate
Inkscape implements layers as groups.
If there is just one layer in use, it will appear as a group in the codes.
Eventually there has to be somekind of transformation -at least if saved as inkscape svg-, because the coordinate system is flipped vertically compared to the specs.
What do you mean you cannot ungroup all objects?
Are you inside one?
Press Ctrl+Backspace to move out of it.
Other objects, like rectangles also can have transformations, so you may need to convert all objects to paths, too.
If there is just one layer in use, it will appear as a group in the codes.
Eventually there has to be somekind of transformation -at least if saved as inkscape svg-, because the coordinate system is flipped vertically compared to the specs.
What do you mean you cannot ungroup all objects?
Are you inside one?
Press Ctrl+Backspace to move out of it.
Other objects, like rectangles also can have transformations, so you may need to convert all objects to paths, too.
Off topic:
Remembered a similar topic, but now that I found it, it seems less related:http://www.inkscapeforum.com/viewtopic.php?f=5&t=16728.-
- Posts: 2344
- Joined: Sun Apr 14, 2013 12:04 pm
- Location: Michigan, USA
Re: ungroup to avoid transform/translate
@ charrington:
You might want to upload an example.
When I test the individual or group transforms, they are removed and reflected in the path coordinates. The only group I have remaining is the Inkscape layer group(s)
Maybe you have seen this post/topic?
viewtopic.php?f=22&t=8838
Since then, it seems that dragging and spinbox-entry will not interfere with optimized transforms. Not on the recent pre-release anyway, so nudging is not the only way to locate objects.
You might want to upload an example.
When I test the individual or group transforms, they are removed and reflected in the path coordinates. The only group I have remaining is the Inkscape layer group(s)
Maybe you have seen this post/topic?
~suv wrote:Not all objects can use optimized transforms:
- groups will keep them -> ungroup, nudge and group again (watch out for nested transformed groups)
- shapes (except rectangles) always use preserved transforms (workaround: convert to path and nudge)
- clones (workaround - unlink - not very useful)
- any object with a filter effect applied will use preserved transforms
- possibly others…
viewtopic.php?f=22&t=8838
Since then, it seems that dragging and spinbox-entry will not interfere with optimized transforms. Not on the recent pre-release anyway, so nudging is not the only way to locate objects.
Have a nice day.
I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1
The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/
I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1
The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/
-
- Posts: 4
- Joined: Thu Oct 09, 2014 4:24 am
Re: ungroup to avoid transform/translate
First, thanks everyone who's responding. It's great to see such an active community.
See two attachments. For ship1.svg, I created a 32x32 drawing, pasted in a collection of shapes, then resized with all selected to fit into the doc. Note that there is a g element which parents all shapes. No transformation present.
In ship2.svg I changed the document to be 22x22 and then resized with all selected to make fit in doc. Now the g element has a transform.
Q1: why was transform added?
Q2: any way to remove transform (besides what I did - drag all shapes out of g in xml editor then resize)
Q3: why is there a g element? Does this represent a default layer which is always created?
I just did this test. Before pasting shapes into new doc, I removed the g element which had been present by default. Now after all my above manipulations I am left with shapes without any g or transform. So I think I found a way to achieve what I want. But I'm here to learn (just started using InkScape).
See two attachments. For ship1.svg, I created a 32x32 drawing, pasted in a collection of shapes, then resized with all selected to fit into the doc. Note that there is a g element which parents all shapes. No transformation present.
In ship2.svg I changed the document to be 22x22 and then resized with all selected to make fit in doc. Now the g element has a transform.
Q1: why was transform added?
Q2: any way to remove transform (besides what I did - drag all shapes out of g in xml editor then resize)
Q3: why is there a g element? Does this represent a default layer which is always created?
I just did this test. Before pasting shapes into new doc, I removed the g element which had been present by default. Now after all my above manipulations I am left with shapes without any g or transform. So I think I found a way to achieve what I want. But I'm here to learn (just started using InkScape).
Re: ungroup to avoid transform/translate
I suggest to combine the paths together first.
If not satisfied with scaling results, you could try digging into the specs and add right viewbox parts into the codes with a notepad, and try how that response for icons.
If not satisfied with scaling results, you could try digging into the specs and add right viewbox parts into the codes with a notepad, and try how that response for icons.
-
- Posts: 2344
- Joined: Sun Apr 14, 2013 12:04 pm
- Location: Michigan, USA
Re: ungroup to avoid transform/translate
This seems an interesting example of Inkscape coordinates vs SVG coordiates.
When you resize the page, Inkscape will place transforms on the existing layers to maintain Internal coordinates.
However, after resizing the page, a newly added layer will not have the transforms and the existing objects can be grouped (if not already), scaled, cut and pasted-in-place into the new layer. (Very similar to pasting into a new document.) Thereafter, the empty original layer(s) that have the transforms can be deleted.
I presume this "flattening" issue is related somehow to using the SVG in other software?
When you resize the page, Inkscape will place transforms on the existing layers to maintain Internal coordinates.
However, after resizing the page, a newly added layer will not have the transforms and the existing objects can be grouped (if not already), scaled, cut and pasted-in-place into the new layer. (Very similar to pasting into a new document.) Thereafter, the empty original layer(s) that have the transforms can be deleted.
I presume this "flattening" issue is related somehow to using the SVG in other software?
Have a nice day.
I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1
The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/
I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1
The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/