python: Update suggestion for GimpCoreObjectArray parameters

Resolves #12973
Since the standard 'drawables' argument for procedures
is now a GimpCoreObjectArray, the suggested syntax for
setting it in a Python call was incorrect. This impacts other
parameters as well, so we add a check for the argument type
being Gimp.ParamCoreObjectArray and then provide the
correct Python code to set them.
This commit is contained in:
Alx Sa 2025-02-22 03:45:55 +00:00
parent 6076c4d4a6
commit ca6ea27c3e

View file

@ -176,6 +176,9 @@ def run(procedure, config, data):
if arg.name == 'run-mode':
# Special handling for run mode.
cmd += "config.set_property('" + arg.name + "', Gimp.RunMode.INTERACTIVE); "
elif type(arg) == Gimp.ParamCoreObjectArray:
# Special handling for GimpCoreObjectArray parameters
cmd += "config.set_core_object_array('" + arg.name + "', " + arg.name.replace('-', '_') + "); "
else:
cmd += "config.set_property('" + arg.name + "', " + arg.name.replace('-', '_') + "); "