Hello,
As group is available since gimp 2.8, I am trying to manipulate them.
I write a script just to create a new group in a psd file :
def kujjuk(inImage,layerToAdd):
inImage=gimp.pdb.gimp_file_load(inImage,inImage)
layer=gimp.pdb.gimp_image_get_active_layer(inImage)
if gimp.pdb.gimp_item_is_group(layer) is not True:
group1=gimp.pdb.gimp_layer_group_new(inImage)
gimp.pdb.gimp_image_set_active_layer(inImage,layer)
gimp.pdb.gimp_item_set_name(group1,"shooting")
gimp.pdb.gimp_image_insert_layer(inImage,group1,0,-1)
pdb.gimp_file_save(inImage,gimp.pdb.gimp_image_get_active_layer(inImage),"group.psd","group.psd")
gimp.pdb.gimp_image_delete(inImage)
I get the following error :
gimp.pdb.gimp_image_insert_layer(inImage,group1,0,-1)
TypeError: wrong parameter type
batch command experienced an execution error
Could you indicate me where is the mistake ?
I have looked at the docs but found nothing
thakns ni advance
sabativi
Page 1 of 1
script gimp python for groups
#2
Posted 10 August 2012 - 02:25 PM
Looks like the doc is a bit wrong, if you want to add a parentless group, use:
Btw, you don't need to prefix everything with 'gimp.'.
You can also use:
pdb.gimp_image_insert_layer(inImage,group1,None,-1)
Btw, you don't need to prefix everything with 'gimp.'.
You can also use:
inImage.add_layer(group1)
This post has been edited by ofnuts: 10 August 2012 - 02:26 PM
010011110110011001101110011101010111010001110011
Share this topic:
Page 1 of 1

Help












