Hi!
maybe you've already seen my commits on the genete_advanced_outline branch.
I want to explain you what I've done to implement the behavior of standard
widthpoint position but with homogeneous movement.

1) I've removed the homogeneous parameter from the layer. For new layers the
behavior of widthpoints will be always standrard but with homogeneous
movement. It wont' never be user optional.
2) A Value Node is "bline linked" when it has a bline value node reference
not null stored. That bline reference is stored at ValueNode class (the
ancestor of all value nodes).
3) There are two members to get/set the bline defined at Value Node class.
4) The set_bline at ValueNode class is virtual what means that any inherited
value node can override it. In particular, the LinkableValueNode class
overrides it with a member class that spread the bline along its children
only if the children is "bline_linked" by its parameter vocabulary. For the
moment the only Linkable Value Node sub-parameters that are "bline linked"
are: Dynamic List Items, Composite_ValueNode::position when type is
WidthPoint. Notice that all ValueNode_Constant that are children of a "bline
linked" Linakble Value Node, are set as "bline linked" too by this member
function.
5) The responsible of start the set_bline calling is the class Layer (the
ancestor of any layer). The parameters of a layer can be regular parameters
(like radius, amount, etc) or "dynamic parameters" which are all the
linkable value node parameters and all the regular ones that are animated.
So, when the layer is called to connect a dynamic parameter it does two
things:
5.1) If the parameter to connect is a bline, then looks its parameter
vocabulary and try to find any parameter that is "bline_linked". Then it
calls the set_bline for that parameter.
5.2) If the parameter is not a bline then it look to its vocabulary to check
if the passed parameter is "bline linked" and then look for the bline and
link it to the passed one.
This way, the responsible of set the bline is the layer's parameters
vocabulary.
6) There is one new private member for ValueNodes: homogeneous. If true the
Value Node will act like homogeneous. So a Value Node can be bline linked
but not homogeneous what assure backward compatibility. It is not possible
to set the homogeneous variable if it is not calling the set_bline member.
By default all the value nodes are homogeneous = true.
7) And now the magic: When a Value Node is turned into animated then it
takes the bline reference and the homogeneous boolean and sets it to the
ValueNode_Animated created.
8) When a ValueNode_Animated is "bline linked" and it is homogeneous, it
happens the following:
8.1) All its waypoints (which must be real type what is checked to be like
that) are transformed to the homogeneous world based on the bline at the
waypoint time. A copy of the original waypoints is kept.
8.2) The calculations of the curves between waypoints is done in the
homogeneous world. It is done everything a waypoint is changed/inserted and
everytime the bline is modified. That must be this way because now, the
aniamted value node is bline dependant and its changes affects the value
node.
8.3) When someone wants a interpolated value between two waypoints the value
is taken from the homogeneous curves and then untransformed to standard
world before been returned.

So, I think that it is implemented for animated value nodes at the moment. I
have to think a little bit more the strategy for the rest of linkable value
nodes that can be a "bline linked" parameter converted to.

There is one drawback with this behavior. When the bline dissapears the
"bline linked" value node gets orphan. I've not decided what to do to solve
this: I can force to export the bline when it is used as linked or I can
load/save as part of the value node. Same problem happen with current
0.63.00 widthpoint list.

Also I need to think what to do with current BLineLinked Value Nodes. I
don't know if it is a good idea to use the same approaching.

It is interesting to see how the curve of the parameter between the
waypoints follows a shape "bline dependant" like you predicted ^___^.

Please, when you have time test the current development point to see if
there is any introduced bug I've not seen. If you have some ideas about my
last comments, please let me know.

Cheers!
Carlos
http://synfig.org
------------------------------------------------------------------------------
EMC VNX: the world's simplest storage, starting under $10K
The only unified storage solution that offers unified management 
Up to 160% more powerful than alternatives and 25% more efficient. 
Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev
_______________________________________________
Synfig-devl mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/synfig-devl

Reply via email to