2011/3/4 Bart Kelsey <elbarto@...400...>:
At any rate, I thought I'd poke around the 0.48 code and see if I could implement this feature myself, but I ran into an issue. Specifically, it appears that the code for drawing a curve initially adds points directly into the underlying curve data structure, whereas the code that distinguishes between normal curve points and auto-smoothed points is actually part of the user interface, and not part of the curve itself. Thus, when you add a point onto a curve, there doesn't appear (at least not at first glance) to be a way to easily get hold of the Node object and set it to auto-smooth mode.
That's correct. Nodes only exist in the node tool. The node type information is stored in the XML attribute sodipodi:nodetypes. See PathManipulator::_createControlPointsFromGeometry() to see its format. You would have to store information in this attribute when drawing with the node tool. But that's not all; the code that determines the positions of handles of an auto node is also present only in the node tool. You would have to move it to a common location and use it in the Bezier tool to set handle positions, so that they match the node type information.
A better possible implementation involves improving SPPath, more specifically adding a method for setting node types that would fix the handles automatically. Currently we directly put values in the XML, which is not good.
Regards, Krzysztof