My company, MousePaw Games, has just abandoned Adobe Flash as a platform for our upcoming educational software game, and after some research, I decided that it would be best if we adoped Synfig Studio as our animation software in its place.
With the CLI you can read one file and produce the animation output for that file (with specific options)
With Synfig Studio you can create synfig documents and also invoke the core renderer and produce the animation within the GUI.
First option that comes to mind is to simply render animations to PNG sequences or spritesheets and then use the script engine to display the sprites with the right timing, like so (not done by me):
skias.free.fr/bestiole/
skias.free.fr/bestiole/oreille1.png
skias.free.fr/bestiole/oeil.png
skias.free.fr/bestiole/bouche.png
If Ratscript has programmatic access to the various other layers, it could be used to directly modify their properties. The main purpose of this is to change the vectors based on various conditions. Another role of Ratscript would be to change the flow of the timeline - stopping playback, jumping to a particular frame, etc. (Yoyobuae outlined both of these quite well, thank you.)
Runtime interactivity is a crucial aspect, otherwise we still only have a movie. GTK is almost entirely useless in this respect, as we actually need to be able to click, drag, and drop animatable objects, and have them respond based on that action. We also need the game to respond to keyboard events.
Now, all that said, one other option (and probably an easier one) is to actually write a piece of software that renders synfig XML data, in the same manner that Synfig Studio does. Basically, we just need to give it the same specs that Synfig Studio has hard-coded in. This piece of software would essentially be to this as Flash Player is to Adobe Flash - it unpacks the file format and displays everything in the proper order.
Some kind of player would be needed to implement interactive functionality anyway. The GUI would also need a way to test the animation before exporting it (ie. check if button response to clicks, etc).
Ratscript is rather unique in that it is interacted with purely as a (hidden) command-line application, so all I/O takes place as if there is a human user typing into the interpreter. That gives us the benefit of automatically routing all output and errors back to the Synfig Studio, for initial error checking. Some of this same functionality can be duplicated in the player.
We might want to limit what all is tested, however. In Adobe Flash, event listeners are hooked up with responses to event handlers. A lack of an event listener would not be mentioned, for obvious reasons. However, a lack of an event handler would become apparent because of an invalid function call from the event listener. That should simply what we actually have to test.
Git is even easier than subversion. Just start a new branch and add code there. Once ready it can be merged or rebased with master again if it has evolved quicker. In most cases there could be conflicts that should be solved by the one that is requesting the pull.
I am happy to see your interest about implementing the game platform features for Synfig. A long time ago I had an experience with programming for Flash 4 and Flash 5 (MX). I think maybe the best approach here would be to try to mimic the same architecture as it was in Flash.
Also, we will need buttons and other interactive controls. As a low-level solution we can add possibility to assign event handlers for any layer. For example, add onClick() event handler to some layer would make it act as a button. Such low-level elements could construct complex widgets, including text entry and others.
Later, the playback functionality could be stripped into separate application (player). This will be similar to Synfig Studio editor, but without editing functionality. I guess the execution framework will be a separate library at the end.
If we wiling to have realtime playback, then it comes to rendering speed problem. The current rendering is slow. We have prepared the framework for OpenGL-optimized rendering, but it is still a lot of work to do. In any case, this problem should be resolved to get the interactivity features.
Also proper playback control from the scripts should also be possible. If the animation needs to pause in order to wait for user to press a button or something it should really pause, not fake it with an infinite loop over a frame. Of course that means that non-frame triggered scripts need to be able to run even when animation is paused at some frame.
This is starting to mirror the age-old debate in the ActionScript 3 world about whether code should ever be put on the timeline at all. The strongest argument for it is that it is pretty easy to figure out where you parked something, so long as you have a system.
My team always put the bulk of the script on Frame 1 of its own layer, time-specific code on the appropriate frame in that layer, and object-related code on the layer (group) that held the object. Obviously, that convention does not hold true for Synfig, but it goes to show that things can be organized logically.
I am new to Synfig. Before I used Synfig I used Pencil but since Pencil could not import vector images (SVG) I decided to switch to Synfig because I was told that it would have no problem with importing SVG images (images that I had originally made in Pencil then vectorized in Inkscape and then was trying to import into Synfig). But after all of this I find that I am having the same problem with Synfig that I had with Pencil. I cannot import or open svg images, jpg images or anything really into Synfig. On the Inkscape forums I read that the problem might be do to formatting. So Synfig can open SVG images from Inkscape if they are SVG 1.0 but in the Inkscape formatting selector I am not finding this option there are only plain SVG and Inkcape SVG.
Has anyone else experienced this problem and resolved it?
I followed your instructions and saved the images in Inkscape as plain SVG. I then imported them into Synfig via the caret menu. I have attached a screenshot so you can see what it looks like after I have imported the image. As you can see there is not much image there except for the border and what I believe is a duck (which is what you call those toggling thingies here at synfig). I get the same results if I try importing in just regular Inkscape formatting and also in PNG.
Since even PNG import is nonfunctional, I suspect you are having some issues relating to importing in general. For example, the fact that you see the ducks suggests that import should have happened. Some other users may have a better idea as to what is occurring.
Have you noticed that you have the default blend method set to Hue in the Toolbox? That might cause to every new layer created or imported to be invisible because the background is transparent. Set it to Composite and try again.
-G
Have you noticed that you have the default blend method set to Hue in the Toolbox? That might cause to every new layer created or imported to be invisible because the background is transparent. Set it to Composite and try again.
-G
I created svg file using Clip Studio Paint, but am unable to import it to Synfig. The canvas in Synfig remains blank. I dont know if the problem is with export from CSP or import into Synfig. Any suggestions?
zoom out as much as you can and try to find out where is the square bounding box is being created. Once found, just move the origin to that square and using transform widget, bring artwork to the centre of the canvas. [it could be possible that the origin of the canvas of your artwork is not the same as the origin of canvas in synfig.]
To get working with it,
You can use Inkscape, (for exporting in .sif file format). Open any SVG in Inkscape and then save as .sif file from Inkscape. (this might not work sometimes, but having something is better than nothing, in the above case the width stroke of the triangle is lost, but if I just put the same value for stroke width within Inkscape, then only it will take that into action)