Thanks to everyone for responses! My summary:
I was _not_ proposing to remove support for transform=, of course. I just want to make it more consistent and less confusing for new users. So here's a more detailed proposal:
There's a switch in "tool options" for selector between "optimize" and "preserve" transformations. The "preserve" option causes all manual scales and drags in selector to add transform=, while "optimize" (the default) writes transformations to the object coordinates. I suspect that the "preserve" mode is buggy simply because it's not the default, and anyway it seems to apply only to manual operations in selector. What I want to do instead:
- Make this switch truly global, affecting all transform operations no matter what caused them.
- Make sure the "optimize" mode is as complete as possible, i.e. all commands write as much as possible to the object attributes in this mode (absolute "optimization" is not possible, as some transforms cannot be native for some objects and require a transform= anyway).
- Make sure the "preserve" mode is equally global and complete, and thoroughly test it.
- Add "apply transform" command for those switching between these two modes. Perhaps it might be combined with some other cleanup operations and called simply "cleanup" or "optimize", because "apply transform" is too confusing (I would expect it to call something like the Transformation dialog, not make some invisible change to XML).
- Remove the "remove transform" command - it's really just confusing, and in any case it's easy to do the same by removing the transform= attribute in the XML editor, if anyone ever needs this.
Jon:
The transformations might be nice if we have a library of objects and make instances of the object, and rather than changing the original, transform the instance.
That's what SVG use element is for. There is some support for it but it is incomplete. I'm seriously considering adding some simple UI for it in the next version because having a "Clone" and "Define symbol" command would be really cool and seems to not be excessively difficult to add. And yes, of course svg:use requires transform=, and it should still work in both modes - the "optimize" mode would just not optimize an svg:use object, leaving its transform= in place.
saving each transformation and having a dialogue/palette with transformations or all transoforms: shape scaling, rotating, twisting, and so forth, would be useful, to go back in time to an earlier state on a shape.
Unfortunately no, transform= as currently implemented does not give you a "history" of transformaions. It's always a single matrix and you can just remove _all_ transformations if you remove it. SVG allows you to write each transformation as a separate command to this attribute, but I think Inkscape does not support this.
Robert:
I actually have a need for both "transform = " and "apply transform" (I see no need for "remove transform"). I would prefer that when I transform an object, I get a "transform = " and then have the ability to apply that transform.
OK, you can just work in the "preserve" mode.
Lets say I want to draw a regular hexagon. I will draw 3 identical lines, rotate one 60, another -60, then apply the transformations. The endpoints of these paths will give me the control points to draw the hexagon.
From this example, however, I don't see why you need preserving
transformations - if you apply them at once! This means you just want the rotate command (in the Transformation dialog, I suppose) to work in the "optimize" mode, i.e. apply the transformations for you. Or am I missing something?
In inkscape, currently, I combine paths to apply a transformation. I'd really like to see an apply transform button.
It's not difficult to add, however I think the first priority is to make sure that _all_ transformation commands work correctly in both optimize and preserve modes.
Bob:
But if we ever get into the DOM scripting part of the SVG spec, we would likely want to keep the original object + each of its transformations. Like, say an object is rotated by angle theta, then translated to a point x,y. Say we want to to animate it by changing theta, thus rotating it, but leaving the translation alone.
Sure, this is where the preserve mode will be used. When we have animation, it will be necessary indeed.
Herve:
Well, in fact, i think that te transform= attribute dedicate to a group object or an object (instead of directly transforming the d=) may (my opinion) want to act like proto in vrml (3D xml) you import a proto from another file and transform it : that way when you change the original proto-file, all transformation will apply to that imported-proto-file-object. that transform possibility may add a 'abstrac-implemented-object-stuff' as 'new' in POO
It is (i supposed) the way "use" should be implemented.
Yes, when you reference an external object as in svg:use, you can't do without a transform=, and this cannot be optimized (see above). Groups however are another matter. Currently Inkscape always adds transform= to a group when you move it. I want it instead to write it to each group member recursively (in optimize mode only, of course). Any comments on this particular change?
_________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus&pgmarket=en-ca&RU=http%3a%2...