Static parameters. Question about Linkable Value Nodes.

Hi there.
I’m having a break from core review and reorganizing and in the middle I’m working on a new feature in Synfig.
I’m sure that if you have worked in a complex composition and animation, you have made use of the “Children Lock” parameter of the Paste Canvas Layer. It prevents from click on child layers of a paste canvas and just select the paste canvas itself. It is very useful when you just work with the paste canvas content in a cutout style. But during animation development you realize that need some modification of any of the children of the involved Paste Canvas layer and then un-check the “Children Lock” parameter. If you do it in animation mode you end up with a mess…
Same happen for other parameters like the type of feather of a shape or the blend method.
Zelgadis suggested that it would be possible to turn a constant parameter to “static” and that its modification doesn’t produce never a waypoint regardless if you’re on animation mode or not.
So I decided to work on it.
I added a static option for the layers parameters and to the Constant exported value nodes.
When a parameter or constant value node is right clicked it offers an action in the context menu that depending on the current static option it offers the “Set Static” or the “Unset Static” actions. (Actions names can be changed later).

The problem comes with the Linkable Value Nodes. Any Value that depends on others (via Convert or just by its nature like the BLine) is a Linkable Value Node (LVN).
So there comes some questions:
I’ve assumed that:

  1. A LVN is static if all its sub-parameter are static. And vice-versa.
  2. A LVN is full non static if any of its sub-parameters is non static.
    I think that all people agree here. The problem comes with the actions.
    If I right click on a LVN it can happen two things:
    a) It is in case 1). So it will offer Set Static or Unset Static. Then the code will spread the static option to all the sub-parameters recursively.
    b) To be in case 2). What do you think it should offer? Set Static? Unset Static? Both?

Thanks for your reading.

I haven’t looked at the synfig code in a long time, but the static values feature is a really good idea and I’ll try to comment. IIRC an LVN stores no data other than its children. Hence, would it not be possible to give LVNs two actions: “make children static” and “make children un-static”, which act recursively if any children are LVNs. The reverse manipulation code propagates all changes to children, is if they are all static then the change shouldn’t produce any waypoints. (i.e. no need to make a bline static because if all the points are static, no duck manipulation can possibly add waypoints). Is this valid reasoning or have I forgotten some of the valuenode mechanics?

Yes that’s basiclly the idea.
Only ValueBase holds the static option. As the static values cannot be animated, any Value Node (LVN or not) stores its static option in a ValueBase where the set get static memberes are written. So a LVN stands its static status on its deep ValueBase children that are not animated or LVN aswell.
Currently I have two set of actions to set/unset the static option to Constant Value Nodes and to Layer parameters. It is pending the pair of actions to set/unset the static status of LVN. Obviously that set of actions would parse as well on LVN’s children, allowing do right click on the children parameters and then set/unset them individually.
Once I would have managed to allow the user to set/unset static a subparameter that is not a LVN as well, it won’t produce any waypoint when it is modified. So for example, a BlinePoint (from the point of static option it depends on its children) can have set its tangent to static and then when the user modify it in animation mode it doesn’t produce any waypoint. But the Vertice will produce a waypoint (and become an Animated Value Node) if changed in animation mode.
So this BlinePoint is fuzzy from the point of view of static option if that happen: Some of its children are static and some not.

During static option I modified the code to write the word “(Static)” close to the type string in the Type colum of the parameter panel. Also I added the “(Animated)” string when the parameter is a Value Node Animated. When it is constant (the remaining case) it doesn’t add any additional string to the type string.

But in case of LVN where the static status depends on all thie children status I have problems with that mark in the Type column. Continuing with the BLine Point example the type column will show the BLinePoint string plus “something else”. That something else is difficult to decide, because the children can be static, non static and even animated.

So additionally to my first post, the cases on a LVN are the followings:
a) All children are non static values (and all are constant).
b) All children are static values.
c) All children are Animated Value Nodes
d) Some children are static and some not (mixed a) and b))
e) Some children are animated and the rest are static or not (mixed c) with a) or b))

What’s the string to add to the type string in the Type column for each case?
What should be offered to the user in the right click context menu relative to “Set/Unset Children Static” for each case?