snapping ducks

I’ll give you a quick overview of what’s behind. In Synfig, most of objects are derived from Node class. Layer’s Parameters are all them derived from ValueNode class. There are three types of ValueNode child classes: Constant, Animated and Linkable. There is a fourth (PlaceHloder) but it is used only internally. Parameters can be linked if the hold value is compatible. Two linked parameters uses the same value node. Value nodes can be exported (given a name) so it can be used in any layer/canvas/document that references it.

On the other hand there are ducks. Ducks are graphical representation of value nodes. Ducks life is too short. Every time you move the time cursor, the set of ducks is discarded and a new set is created. Ducks are inserted in a list of ducks by a routine that examines the selected layers and the selected exported value nodes. There is not current way to know which duck is inserted first. Ducks in the list can be selected or not. It depends on user interaction. Selected ducks are in a list too as a sub group of all the ducks. Currently there is not way to know which duck was selected first by the user (it doesn’t mean there won’t be a way to know that if it is coded).

On the other hand there are Actions. Actions receive parameters (time, layers, value nodes, etc.) and depending on what parameters are passed, some actions are available others not available. Right click creates the candidate action list and shows it to the user as a context menu. There are not so many actions created for multiple ducks selection. One of them is the “Link” action. If all the ducks are value type compatible, they are linked, if not a message of error is shown. At link preparation time, there is a value node selected from the selected value nodes who will be the value node where all the other value nodes will link to. As each value node as a parameter associated (the duck knows both), when a value node is selected to be the link target, the other parameters are disconnected from its own value node and connected to the target link value node, so finally all them (the parameters) share the same value node.

To be able to create actions for multiple ducks selection (and then for multiple value node selection) it is needed to write the code to check all the selected value nodes and take decision then. Also, at selection time (inside the tool code) there must be new code to mark the first selected duck (value node) and use it as “target” for further collective actions.

You can read the history of Synfig here. Currently there are two working coders (nikitakit and me) one administrator and infrastructure worker (zelgadis) a windows packager (pixelgeek) basically. I have also full administration rights but I’m focused more on code. There are also very valuable people contributing with code, artwork, translation, etc. who won’t be listed to not miss anyone. All we are volunteers.

Aaah! the Warp Layer! Yes, it may be interesting but then it maybe difficult to select the target box instead of the source box. It is due to the fact that the ducks are not inserted in an ordered way. They are just inserted. I understand better the first request.

As an alternative to that tedious task of align the source and target boxes at the start of the animation, you can use the grid for that and once aligned you can scale, and translate to the original place.

Thanks for your feedback input.
Greetings
-G