It is currently Sat Aug 15, 2026 12:10 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Script-Fu and Drawable error - plug-in-lighting function
PostPosted: Sat Sep 07, 2013 6:56 pm  (#1) 
Offline
New Member

Joined: Sep 07, 2013
Posts: 2
I'm hoping that someone can answer this question for me or tell me what mistake I'm making. I'm posting this to a few message boards so I will post any answers I get to all the boards.

I'm using GIMP 2.8.6 in Windows 7 (64 bit). I have a two layer image, one of which has ID=2. When I enter the following command in the Script-fu console:

(plug-in-lighting 1 1 2 0 0 FALSE FALSE 0 0 '(255, 255, 255) 57 0 10 0 0 0 0.5 0.5 0 0 0 TRUE FALSE FALSE)

I get the following error message :

Calling error for procedure 'gimp-drawable-bpp':

Procedure 'gimp-drawable-bpp' has been called with an invalid ID for argument 'drawable'. Most likely a plug-in is trying to work on a layer that doesn't exist any longer.

It's pretty clear that this is related to the 'drawable' argument. But if it's not looking for a item number (2 in this case. confirmed to be my main layer), what is it looking for? I ran this in the console right afterwards to confirm:

(gimp-item-get-name 2)

and got this response as expected:

("Main")

I also tried this command to confirm that item 2 is drawable and I got a 1 in response:

(gimp-item-is-drawable 2)

Here are the parameters so that it's easier to read:

run-mode 1 INT32 The run mode( RUN-INTERACTIVE (0), RUN-NONINTERACTIVE(1))
image 1 IMAGE input image
drawable 2 DRAWABLE Input drawable
bumpdrawable 0 DRAWABLE Sumpmap drawable (set to 0 if disabled)
envdrawable 0 DRAWABLE Environmentmap drawable (set to 0 if disabled)
dobumpmap FALSE INT32 Enable bumpmapping (TRUE/FALSE)
doenvmap FALSE INT32 Enable envmapping (TRUE/FALSE)
bumpmaptype 0 INT32 Type of mapping (0=linear,1=log, 2=sinusoidal, 3=spherical)
lighttype 0 INT32 Type of lightsource (0=point,1=directional,3=spot,4=none)
lightcolor (255, 255, 255) COLOR Lightsource color (r,g,b)
lightposition-x 57 FLOAT Lightsource position (x,y,z)
lightposition-y 0 FLOAT Lightsource position (x,y,z)
lightposition-z 10 FLOAT Lightsource position (x,y,z)
lightdirection-x 0 FLOAT Lightsource direction (x,y,z)
lightdirection-y 0 FLOAT Lightsource direction (x,y,z)
lightdirection-z 0 FLOAT Lightsource direction (x,y,z)
ambient-intensity 0.5 FLOAT Material ambient intensity (0..1)
diffuse-intensity 0.5 FLOAT Material diffuse intensity (0..1)
diffuse-reflectivity 0 FLOAT Material diffuse reflectivity (0..1)
specular-reflectivity 0 FLOAT Material specular reflectivity (0..1)
highlight 0 FLOAT Material (0..-›), note: its expotential
antialiasing TRUE INT32 Apply (TRUE/FALSE)
newimage FALSE INT32 Create a new image (TRUE/FALSE)
transparentbackground FALSE INT32 Make background transparent (TRUE/FALSE)


I'm not really wedded to the parameters I'm using here, they're just the first values I'm starting with to try to get the lighting effect that I want.

Once I get this command fixed, it's the final step in my project to script for icon creation for the DCikonZ app [link deleted cause the editor thinks this is spammy]. I would appreciate any help anyone can give me.

Thanks
Peter


Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: Script-Fu and Drawable error - plug-in-lighting function
PostPosted: Sat Sep 07, 2013 7:29 pm  (#2) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
Use -1 for the environment and bumpmap drawables (instead of "0").

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: Script-Fu and Drawable error - plug-in-lighting function
PostPosted: Sat Sep 07, 2013 8:01 pm  (#3) 
Offline
New Member

Joined: Sep 07, 2013
Posts: 2
Thanks for the quick response, and that did it! I need to mess around with the settings now, but I can take it from here! It's pretty clear that the documentation for this plugin needs to be updated.

saulgoode rocks!

Thanks again,
Peter


Top
 Post subject: Re: Script-Fu and Drawable error - plug-in-lighting function
PostPosted: Sat Sep 07, 2013 8:25 pm  (#4) 
Offline
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 16158
Quote:
saulgoode rocks!


Agreed. :)

_________________
Image


Top
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group