after digging through my code over and over again, i am desperate enough to ask online, hoping that someone can help me. i am trying to develop a python-fu script, and one of it's essential parts is mapping the image to an object. But whenever i try to call pdb.plug_in_map_object()
, the console says
File "<input>", line 29, in <module> TypeError: wrong parameter type
.
My current code looks like this:
pdb.plug_in_map_object(
#image, drawable, maptype=sphere
gimp.Image,gimp.Layer,1,
#viewpoint x, y, z
0.5,0.5,1,
#position x, y, z
0.5,0.5,0,
#first-axis x, y, z
1,0,0,
#second-axis x, y, z
0,1,0,
#rotation-angle x, y, z
0,0,0,
#lighttype=none
2,
#light color (r,g,b)
(0,0,0),
#light position x, y, z
-0.5,-0.5,2,
#light direction x, y, z
-1,-1,1,
#ambientintesity, diffuseintesity, dissufereflectivity, specularreflectivity
0.3,1,0.5,0.5,
#highlight, antialiasing, tiled, newimage, traparentbackground, radius
27,1,0,0,1,0.25,
#scale x, y, z
0.5,0.5,0.5,
#cylinderlegth, 8 drawables for cylinders & boxes
0,gimp.Layer,gimp.Layer,gimp.Layer,gimp.Layer,gimp.Layer,gimp.Layer,gimp.Layer,gimp.Layer
);
(note that this is not the code i use in my script, i use these ugly and senseless gimp.Layer
's to make the python console accept it. i want to be able to call the function correctly before filling in the right values.)
line 29, that is mentioned in the error, is the last one, containing nothing but one PF_INT32
and eight PF_DRAWABLE
. this is exactly the way those parameters are mentioned in the oldest as well as in the latest (GIMP git) source code i found (if you don't want to download the latest gimp code, i uploaded the relevant file here).
can someone please tell me what i am doing wrong?
it works now, and the only thing that changed was that i used some random (existing) layer instead of calling gimp.Layer
. so in my case, i just use the currently active layer via image.activelayer. it doesn't matter when mapping to a sphere anyways, these layers are only used when mapping to a cube or sphere