I want to use plugin-curve bend in a python script.
How do I specify the GIMPDoubleArrays for the points?
What I have is this:
procedure = Gimp.get_pdb().lookup_procedure('plug-in-curve-bend')
config = procedure.create_config()
config.set_property('run-mode', Gimp.RunMode.NONINTERACTIVE)
config.set_property('image', image)
config.set_core_object_array('drawables', [the_layer])
config.set_property('rotation', 0.0)
config.set_property('smoothing', True)
config.set_property('antialias', True)
config.set_property('work-on-copy', False)
config.set_property('curve-type', "smooth")
# config.set_property('curve-border', ["upper", "lower"]) # ?
config.set_property('upper-point-x', [0, 0.14, 0.5, 0.84, 1]) # GimpDoubleArray ?
config.set_property('upper-point-y', [0.5, 0.38, 0.31, 0.38, 0.5])
config.set_property('lower-point-x', [0, 0.14, 0.5, 0.84, 1])
config.set_property('lower-point-y', [0.5, 0.38, 0.31, 0.38, 0.5])
config.set_property('upper-val-y', 256)
config.set_property('lower-val-y', 256)
result = procedure.run(config)
success = result.index(0)
bent_layer = result.index(1)
And I get this:
TypeError: could not convert [0, 0.14, 0.5, 0.84, 1] to type ‘GimpDoubleArray’ when setting property GimpProcedureConfig-plug-in-curve-bend.upper-point-x
So how to do this? Have tried to find an example, without success.
Please help.