preview in filter extension
hi list,
i am trying to program a python filter extension and i need to know if the script is called for preview or for the live run. i already found out that the script is called when the preview checkbox is checked and when the apply button is pressed, but i found no differences in the data delivered to the script when called.
in the c++ code both calls are different, but from the python side they seem to have the same effect.
are there any differences? or is there any other way to determine what was clicked?
thanks in advance, TimeWaster
I am not very familiar with the use of the Live Preview button, don't normally use it, but I believe that it means that the Python script will be called whenever there is a change in any of the input controls, so for example a textbox would trigger a refresh every time the keypress event occurred, or a spin box would trigger a refresh every time the mouse click event occurred.
Alvin Penner
-- View this message in context: http://inkscape.13.n6.nabble.com/preview-in-filter-extension-tp4966524p49665... Sent from the Inkscape - Dev mailing list archive at Nabble.com.
ok, since i got no responses in regards of differentiating both cases in python i assume that there is no way to do it with the code there is.
what i want to do: use the extension menu to send vector data to a plotter.
this is a special case where the extension menu should be the appropriate place for the extension, but this type of extension always assumes that it is a filter, and therefore tries to keep preview data as the final drawing.
therefore i can write an extension that previews the hpgl data sent to the plotter (including the movements between the paths for instance), but after clicking the apply button and sending the data to the plotter inkscape keeps the preview replacing the original drawing, which is unwanted.
now the question: is it possible to expand the inx format with a flag that tells inkscape not to keep the preview data after clicking apply? (thus reverting it) also it would be great if one could define the text on the "apply" button, because in this case a "Send" button would be more appropriate. and if the call to the python script could add a parameter telling the script if this is a preview or live run alongside with the parameters from the inx file, it would help optimize the script a lot (and im sure it is of help for other extensions as well, since this allows for low quality preview and high quality final rendering, thus reducing runtime which is for some filter extensions really long, even on my high end pc).
i have no c++ experience and i cannot write this changes (i took a look at the code but didn't understand much), so it would be nice if someone could do it for me?
how it could look in .inx:
<effect needs-live-preview="true" discardChangesOnApply="true"> <object-type>path</object-type> <apply-button-label>Send</apply-button-label> <effects-menu> <submenu _name="Plotter"/> </effects-menu> </effect>
i know it's asked a lot, but it would definitely allow to do much more different things with the extensions than today.
regards, TimeWaster
--- Save a printer manufacturer. Print this e-mail unless it's really necessary not to do so.
On 6.4.2013 18:57, TimeWaster wrote:
hi list,
i am trying to program a python filter extension and i need to know if the script is called for preview or for the live run. i already found out that the script is called when the preview checkbox is checked and when the apply button is pressed, but i found no differences in the data delivered to the script when called.
in the c++ code both calls are different, but from the python side they seem to have the same effect.
are there any differences? or is there any other way to determine what was clicked?
thanks in advance, TimeWaster
participants (2)
-
alvinpenner
-
TimeWaster