Macros and scripting.

A scripting interface for Synfig has been discussed here before.
This is no doubt a very good feature but as an artist rather than a programmer I feel scripting is too complicated. I’m thinking of Gimp etc. where you can do scripts. I’ve never succeded in doing the scripts I want there. For my part it’s mostly try and fail kind of approach.

Scripts is very good for plugins. For more basic tasks there are easier methods.

In addition to scripts I would like to see a macro interface, kind of a terminal within Synfig you can feed with commands:

[code]*Encapsule current layer
*Create translate layer, set origin to 05.5x08.004
*Create zoom-layer

  • etc.[/code]
    You could then save this batch of commands with a descriptive name, setup-anim-layer, and run it on other layers.
    Fast and easy for doing repetitive tasks. It would speed up workflow of Synfig considerably.

What do you think?

It is like a high level scripting language?
There must be some rules to agree before it can be achieved. Some time ago I worked with a calculator that has RPN language. It needs that the action were done to the stack heap. In this case the “stack heap” is not so easy to define. In Synfig, all the undoable commands from the GUI are produced by Actions. Actions has some rules.
Actions needs to have a Action Parameter list (it can be layers, canvas, valuenodes, keyframes, etc). When the parameter list is available then the Action System looks for all the actions candidates (the ones that have the list of parameters compatible) and marks them candidate to the action. That’s how the right click works over each context. Only the actions that are available are collected in the contextual menu (i.e. “Link”)
For a high level script language similar to the one that you propose the problem is to define the context. Maybe, it can be defined too by some commands, for example:
Layers:
Select first
Select Down
Select Down
Open
Select Down
Select Down Add
Select Down
Select Down Add
Increase Amount +0.3
(Those commands would select two separated layers in a sub canvas and increase its amount into 0.3)
Later the user can change the context:
Keyframes:
Jump First
Jump Next
Edit “Close eye”
Copy
Time 2s
Paste

(Those commands would edit the second keyframe’s description and copy it and paste in the 2s frame.)

In general it is a good idea to have such language always that the commands respond to the Actions that are written now or in the future. It is an interesting feature yeah!


That idea reminds me the importance to be able to save and load the action history. It is extremly important that all the things that can be done in Synfig Studio were done using actions. But unfortunately not always is possible to undo an action, specially when historical actions can be deactivated fro mthe history list and it can cause unexpected results to the surrounding actions.
-G

Never though of the problems involved in this. That’s what the coders are for, right? :wink:

But we’re basically saying the same thing. The commands I propose would just be another way of triggering tools, changes etc. Instead of clicking with your mouse you invoke the command by typing it. These can then be stacked and re-used.
Pretty much same as macros is done in word-processors or actions in Photoshop. I could ask for a macro-recorder but I guess that would complicate things a bit too much. Writing scripts on the fly would suffice for me.

Actually it’d be much easier to have a set of commands which invoke the tasks in Synfig, exported in XML or something to be used later. Sort of like a user-based plugin. A separate icon for “command builder” where the user can specify a session with sequences of commands, then save them for future use where he just needs to “activate” the session with one click or combo-buttons.