Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
python_fu_ofn_export_layers question
#1
Hi

I call python_fu_ofn_export_layers in my plugin (after some other plugins) and I would like this window not to appear. It can use the default settings.
Is this possible?

I ask this because I run my plugin on many files and they use the standard settings anyway. I don't want to click Export each time again for each file.


Attached Files Image(s)
   
Reply
#2
For the time being, replace this line in the script (line 123):
Code:
       pdb.gimp_file_save(exportImage,exportLayer,filePath,filePath,run_mode=RUN_INTERACTIVE if self.layerImageIndex==0 else RUN_WITH_LAST_VALS)
by:
Code:
       pdb.gimp_file_save(exportImage,exportLayer,filePath,filePath)

Warning: untested Angel
Reply
#3
(02-29-2024, 02:03 PM)Ofnuts Wrote: For the time being, replace this line in the script (line 123):
Code:
       pdb.gimp_file_save(exportImage,exportLayer,filePath,filePath,run_mode=RUN_INTERACTIVE if self.layerImageIndex==0 else RUN_WITH_LAST_VALS)
by:
Code:
       pdb.gimp_file_save(exportImage,exportLayer,filePath,filePath)

Warning: untested Angel

works!
You want to change it in the plugin or keep the old way? Because the old way, see below, is not working here Sad

Code:
RUN_WITH_LAST_VALS

Does this mean it would run with the same parameters when you run it for the 2nd time? This is not working here. When I run the plugin the 2nd time from my script, the "save as" dialog is shown again. Can you change it to "run with save as dialog the first time, but the next time run it with last used parameters"?


What does this line below mean exactly?


Code:
run_mode=RUN_INTERACTIVE if self.layerImageIndex==0 else RUN_WITH_LAST_VALS
Reply
#4
I won't change my plugin (or at least the change needed is a bit more complicated, and will require some testing...).

run_mode=RUN_INTERACTIVE if self.layerImageIndex==0 else RUN_WITH_LAST_VALS: on the first layer (for a given execution of the script) the export plugin is called with RUN_INTERACTIVE to pop out a dialog, and for all other layers it is called with RUN_WITH_LAST_VALS so it doesn't pop out the dialog and uses the values from the first dialog.
Reply


Forum Jump: