Post Reply 

Script-Fu and Drawable error - plug-in-lighting function

Sep 7, 2013, 23:48
Post: #1
Script-Fu and Drawable error - plug-in-lighting function
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 :

[color=#0000CD]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:


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. I would appreciate any help anyone can give me.

Find all posts by this user
Quote this message in a reply
Sep 8, 2013, 01:05
Post: #2
RE: Script-Fu and Drawable error - plug-in-lighting function
saulgoode at Gimpchat forums found the answer for me. The bumpdrawable and envdrawable need to be set to -1 instead of 0 as documented. My guess is that the documentation for this function did not get updated as GIMP was updated.

Thanks to saulgoode!
Find all posts by this user
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Script-fu ordered file list vnicent 1 35 Yesterday 17:33
Last Post: paynekj
  script-fu argument/parameter formats dhugg 2 183 Mar 13, 2018 00:50
Last Post: dhugg
  PDN Plug-in for GIMP? snoopy55 9 8,862 Jan 29, 2018 08:23
Last Post: jandd661
  Request for script chlebna 1 337 Sep 13, 2017 09:35
Last Post: ythgilb
  Request for script - Guillotine + Watermark sunslick 1 420 Sep 4, 2017 08:51
Last Post: ythgilb

Forum Jump:

GIMP ForumPortalArchiveContactTermsRSS