Hey all,
Sorry, I've been effectively offline for over a week, so I'm catching up. I feel like I'm spamming the mailing lists :)
Anyway, Aaron, I noticed that you made a branch for live effects. I've thought I little about this -- I was thinking perhaps we can all have a big friendly discussion about some of the ideas/features that would be required. (if there are any Xara developers on the list we'd love your comments on what worked and what didn't) If nothing else, so we don't overlap on any work.
Here are some thoughts that I've had, feel free to destroy at will :)
- Live Effects need to work with opening and saving a file, so they need to be stored somewhere. I was thinking we could add a "inkscape:live-effect" node in the defs section to define each live effect and read them when the file is opened.
- Live Effects should be triggered when the original objects are edited, so we need to mark who those are. Probably by node ID.
- If one of those nodes is deleted in the process of running the effect, then it should be stored in the live-effect node so that when re-running the effect it can be placed back on the canvas temporarily.
- We need to keep track of the objects that are created by the effect, so we can delete them before rerunning the effect. I think this could also be accomplished through a node ID.
- If any of the objects created by the live-effect are modified (ie moved) the live-effect is broken. I'm not sure if there should be some warning, or atleast a status bar message for this. I think it is simply to difficult to track the changes.
- We need a way for the effects themselves to mark which nodes they created or deleted in their execution. I'm thinking that we can just add a inkscape namespace attribute for the nodes. When we reparse the file, we'll look for those. Then, in the inx file, we can mark whether an effect is "live effects aware" to keep the basic case simple. We may be able to accomplish this through comparing the before and after documents, but that seems likely to cause error (perhaps Mental has some ideas on this?)
- I think that live effects should work for output and input extensions too. That way you could have an SVG document that you're working on constantly update the Postscript output copy that you want to have. Of course, this might be slow, but people will find it useful when they have 64-core computers :)
- To make the performance reasonable, I think that we'll need to keep parsed copies of the scripts cached. I think I know how to do this with the python libraries. There is already the load/unload mechanism in the extensions to facilitate this. After I finish the extensions dialog, I'll start working on this. (unless someone really knows how to do it, I'd be happy to let someone who knows what they're doing go ahead :)
Those are the things that I can think of right now. Comments and ideas are welcome!
--Ted