The locations of the Synfig layer parameter names, value lists, and convert lists in the Synfig source code


#1

I’m working on developing a Synfig Studio plugin that requires a list of all the Synfig layer parameter names, parameter value lists, and parameter convert lists, for automatically adding certain types of animation to a Synfig project file.

The parameter names of a Synfig layer is shown in the ‘Parameters’ panel when a Synfig layer is selected in the ‘Layers’ panel.

A Synfig layer parameter value list is shown in the ‘Parameters’ panel for some Synfig layer parameters, such as ‘Type’ parameter of the Blur layer.

A convert list of a Synfig layer parameter can be brought up by right clicking on a Synfig layer parameter and selecting ‘Convert’ in the pop-up menu.

Instead of building a list of all the Synfig layer parameter names, value lists, and convert lists manually by transcribing what shows up on the Synfig Studio GUI, I’m thinking about writing a Python script that processes the Synfig source code and automatically extracts everything I need.

Where are the Synfig layer parameter names, value lists, and convert lists, in the Synfig source code? Specific file paths, please.

UPDATE:
I have been rummaging through the Synfig source code, and I’ve found that the following directories contain the Synfig layer parameter definitions and initializations. I still don’t know where the convert lists are either defined, created, or both.

\synfig-1.0.x\synfig-core\src\synfig\layers
\synfig-1.0.x\synfig-core\src\modules\mod_filter
\synfig-1.0.x\synfig-core\src\modules\mod_geometry
\synfig-1.0.x\synfig-core\src\modules\mod_gradient


#2

convert list of a Synfig layer parameter: check synfig/valuenodes directory and valuenode.h
parameter names of a Synfig layer: see EXPORT_VALUE in layers files
synfig layer parameter value list: see “.add_enum_value” in get_param_vocab() in layer files

Everything is about “vocab”, dynamically created in c++ code, so you can’t access directly such lists due to the current (very basic) implementation of python plugin system.
So…It works directly manipulating closed sif files and nothing from the program code in memory.
Good luck :stuck_out_tongue:


#3

@BobSynfig

Ok, I see where the convert lists are created now: in the ValueNode_Add() functions of the valuenode_*.cpp files.

Now I can write a separate Python script (not a Synfig Studio plugin script) that processes the relevant Synfig source code files and automatically builds convert lists for different Synfig layer parameter value types.

Thanks a bunch!