With new wave of deprecations coming with gimp-2.7, I thought to port
a part of a gimp-using project to the new API, but I've encountered an
issue with "pdb.gimp_image_insert_vectors()" function.
pdb.gimp_image_insert_vectors() takes "image", "vectors", "parent
vectors" and "position" as a parameters, which differs from
pdb.gimp_image_add_vectors() in "parent vectors" parameter.
Function doc says "Since vectors groups are not currently supported,
the parent argument must always be 0".
Problem (maybe python-fu specific) is that you must pass the instance
of gimp.Vectors class (passing "int" 0 just gives "wrong type" error)
to "parent vectors" argument, and there doesn't seem to be a way to get
gimp.Vectors with ID=0.
Passing random other Vectors objects there fails.
gimp.Vectors.ID (for some arbitrary Vectors object) can't be set via
conventional means in python, as it's read-only attribute.
gimp.Vectors.from_id(0) returns None, and passing None object also
raises "wrong type" error.
Is this a bug or is there some way to make this function happy that
Maybe some general convention on how to pass id=0 objects?
from gimpfu import *
image = pdb.gimp_file_load(path, path)
vectors = gimp.Vectors(image, "vectors")
pdb.gimp_image_insert_vectors(image, vectors, None, -1)
'test', '', '', '', '',
'', 'problem_demo', 'RGB*',
[(PF_FILE, 'file_name', 'src', '')], ,
chmod +x ~/.gimp-2.7/plug-ins/test.py,
gimp -ib '(python-fu-test RUN-NONINTERACTIVE
"None" is passed as a "parent vectors" here.
Mike Kazantsev // fraggod.net
gimp-user-list mailing list