Quote:
What are your thoughts on this? Is there an easier way to do it?
The only thing I don't see clear on the approaching is:
Quote:
Make the track_point's render code find the pixel in raster space, and save it somewhere in the render stack
To be able to do that you shouldn't go the raster way (examine the pixels) but do the reverse operations of the transformations layers that affect the current layer.
Each layer has a hit_check() function that takes a point in the 2D space and ask the layer if that point lies on a non transparent part of the layer or not. You can see that the virtual function is implemented on all the geometry layers. They return itself when the color generated by the layer at the given point is not transparent. Otherwise, it passes the hit_check call to its context to see if there is other layer below that could be hit by the point.
Something similar to that can be done but in a reverse way. I don't know how yet but each layer should be able to ask to its immediately above layer what's the returned value for a given point. This way the recursive call would end up to the top layer which would return the calculated point to the asking layer.
Then once the layer knows how to obtain the global coordinates of a local value, you can expand the target class to another target type to only retrieve the specially marked data from the layers (each parameter can have a status that could make them able to be exported as data to a file).
This way the user would only need to mark which parameters want to export to file and the target ask each layer to retrieve the global coordinates of the parameter and write it down to the output file. Of course, non space transformation parameters (color) can also be exported.
I hope it helps.
-G
_________________
Synfig needs your help!
Developers, packagers, bug testers, translators, artists, web developers, wiki writers... you
can contribute!
