-
Hello, |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 7 replies
-
I believe it should be possible, but I admit I haven't given this much thought. Try including a from simpinkscr import * in the other extension code and seeing if that provides access to the Simple Inkscape Scripting functions you'd like to use. Does that work? |
Beta Was this translation helpful? Give feedback.
-
Hello, thank you for your answer, I did a try but get this error : xxxx/extensions/hello/Hello.py",` line 25, in effect |
Beta Was this translation helpful? Give feedback.
-
Thank you very much for your response and research! It works very well. I hadn't noticed that you added the "derived extensions" page following the question I had deleted. I removed the question because it seemed like it was covering two somewhat different topics in the same discussion. Thank you for responding to it; the solution is also interesting. Perhaps it would be helpful, for the direct use of simpIncScr in extension code, to have a special version with only the useful functions (circle, rect, bounding_box, all_shapes...) and without the unnecessary ones (svg_root, extension...) and problems of initialisation. Essentially a simple library rather than an extension. But this is just a idea, not a request, as it would certainly involve a lot of work. Thank you again for your attention, and have a good day! |
Beta Was this translation helpful? Give feedback.
-
As of d4aa42f, Simple Inkscape Scripting provides more explicit support for exposing its functions to other extensions. See Leveraging Simple Inkscape Scripting in extensions in the wiki for documentation. |
Beta Was this translation helpful? Give feedback.
Thanks for the code sample. I was able to use it to reproduce the problem.
What's happening is that Simple Inkscape Scripting initializes its data structures during execution of its
effect
method. But Simple Inkscape Scripting'seffect
method is never called; only Hello'seffect
method is called. Unfortunately, the solution is not as simple as explicitly invoking Simple Inkscape Scripting'seffect
method becauseeffect
relies on variables that inkex initializes when invoking the extension. But inkex isn't invoking the Simple Inkscape Scripting extension; it's invoking the Hello extension. Ugh.As a horribly ugly solution, you can manually initialize just enough of Simple Inkscape Scriptin…