Is there a way to export data about objects during rendering


I am creating a videogame and was looking for a tool to help streamline the creation and animation of 2D graphics. So far Synfig seems like a pretty good fit for what I want to do. (Though it did crash on me twice :smiling_imp: after opening the children panel and refused to start after that if I don’t allow it to ignore the autorecovery file. So I guess that’s a warning to save often. :slight_smile: )

Anyway, there’s something that’d be very nice but I’m not sure if there’s a way to do it. Let’s say there’s a googly-eyed snail-like monster whose eyes are its weak-point that the player needs to hit. The eyes are animated to move in a certain pattern and I generate a sequence of bitmaps during rendering which I eventually merge into a sprite-sheet. For collision detection, I need to know where the eyes are within the image for each frame that I rendered using Synfig. That’d simply be the positions of the layers that represent the eyes.

Now, if I pick which timepoints I’m going to render I could use the GUI to manually read off the positions of the eyes at those points and copy into a file. But, I was hoping the command-line synfig had an option to tell you where certain things are when it’s rendering a frame. Like, for example, a switch to output the parameters of layers named “leftEye” and “rightEye” when it’s rendering as frame. If it does, then I could just capture that output and generate the file automatically. I saw some promising options in synfig --help but they output descriptions of valuenodes and layers rather than computed data.

Is there any automatic way to do this?
Thanks a lot!

Currently there is not other way than code it and generate the output from Synfig itself.
Since the amount of information that Synfig generates is huge, my idea of implement your request maybe this:

  1. Create a new target type. Maybe render to txt file.
  2. The target output may be:
    a) A header with the important information to consider to read the data of the file: frame rate, number of frames, number of values to read and the labels of the values. Mayeb the data separator (TAB, space or whatever).
    b) A list of:
    Frame1, value1, value2, …, valuen
    Frame2, value1, value2, …, valuen

Those values would be the exported value nodes and the label would be exactly the exported id.

This target wouldn’t use the layers itself but only the canvas since the layers aren’t needed.

Also it might be interesting to research if there is any standard output format for that kind of information (maybe one blender format) to use the formatting library if there is any.

Currently I can’t dedicate to this task because I’m fully concentrated on Cairo rendering, but It might be interesting to someone that want to start digging in coding Synfig.

Also, this feature request might be interesting for you:


Thanks Genete. Just wanted to make sure I wasn’t missing something.
The task you suggested sounds like it could be implemented by someone new to the Synfig codebase.
I may take a look if it’s still pending after I’m finished.