Heya Mental,
Gerrit is working on a layer-flipping based animation feature - Ted and I gave a little advice, but perhaps you could addressg some of his questions relating to the layers code?
Thanks, Bryce
On Tue, May 08, 2007 at 01:30:58PM +0000, Gerrit . wrote:
You just need to subclass the Inkscape::Extension::Implementation::Implementation object and implement the functions you're interested in (probably effect). You should look at blur and grid for examples.
Alright, the effect method is passed an Inkscape::UI::View::View as a "document" parameter. How do I get the current active layer from here? In the docs, I found these two layer functions:
((SPDesktop*)document)->selection->activeContext() ((SPDesktop*)document)->currentLayer()
"currentLayer" looks better to me, but the Doxygen comment says it's actually the top layer???
And once I got the layer, how do I set it to visible/invisible? At first glance, the method SPItem::setExplicitlyHidden(bool const) looks like it'd do the job. Can I safely cast the SPObject pointers to SPItem? What is the actual class of the layer nodes?
Thanks a lot for your advice! Gerrit