It is currently Sat Jul 06, 2024 8:45 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: use of Lighting in Python [solved, thanks to FluffyBunny!]
PostPosted: Thu Mar 28, 2013 1:57 am  (#1) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14816
Location: roma, italy
GIMP Version: 2.8.4
Operating System: Windows
OS Version: Win 7 - 32 bits
GIMP Experience: Beginner Level

List any relevant plug-ins or scripts:
plug-in-lighting

List any ERROR messages you received:
Plug-In 'TestLighting' left image undo in inconsistent state, closing open undo groups.



First of all: Happy Easter to everybody!
But - just not to leave all the experts in total vacation - I have a problem on the use in python of plug-in-lighting.
When I tried to insert this plug-in in a python script, I always got a message indicating that the last parameter (False) was of a wrong type (?); so, because I didn't sort out ot that problem irrespective of any change made to that parameter (by putting True, 0, 1 or whatever...), I decided to write a small script which does nothing except trying to perform a lighting.
But, the result is what indicated above.
What is wrong in my use of the plug-in? I guess I copied the default parameters when experimented on-line (Light and Shadow), maybe some is wrong, but some result should come out anywhere...
I attach my test script.
Thanks to everybody!


Attachments:
TestLighting.py.txt.zip [1.08 KiB]
Downloaded 79 times

_________________
"Where am I ?"


Last edited by dinasset on Thu Mar 28, 2013 5:16 am, edited 1 time in total.
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: use of Lighting in Python
PostPosted: Thu Mar 28, 2013 2:59 am  (#2) 
Offline
Global Moderator
User avatar

Joined: Apr 07, 2010
Posts: 14182
shouldn't you delete the txt on the end of the script. should be TextLighting.py

_________________
Image


Top
 Post subject: Re: use of Lighting in Python
PostPosted: Thu Mar 28, 2013 3:23 am  (#3) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4756
For True/False, try integers (1/0) instead...

_________________
Image


Top
 Post subject: Re: use of Lighting in Python
PostPosted: Thu Mar 28, 2013 3:42 am  (#4) 
Hi dinasset,
I am no python guru.
I think the third parameter (Bump Map) is a drawable when used and should be set to 0 (zero) if not used.
So you might try replacing your False with 0.
Also, the fourth parameter (Environment Map), is also a drawable, so maybe set that to 0 (zero) rather than None too, or maybe None for both...
I think that should help.


Top
 Post subject: Re: use of Lighting in Python
PostPosted: Thu Mar 28, 2013 4:17 am  (#5) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14816
Location: roma, italy
Thanks to all of you.
to Molly: the .txt was there in my trial to attach the file(.py not accepted), it's not in in the originale script
to ofnuts: changed everything to 0 or 1; same result
fo fb: changed eveything to 0 or 1; same result
sigh!


Attachments:
TestLighting.zip [1.06 KiB]
Downloaded 69 times

_________________
"Where am I ?"
Top
 Post subject: Re: use of Lighting in Python
PostPosted: Thu Mar 28, 2013 4:31 am  (#6) 
did you try 'none'?, and not everything just as below...
   pdb.plug_in_lighting(
        inImage,           # IMAGE
        inDrawable,        # DRAWABLE
        None,              # BUMP MAP
        None,              # ENVIRONMENT MAP
        True,              # ENABLE BUMPMAPPING
        False,             # DISABLE ENVMAPPING
        0,                 # LINEAR BUMPMAP
        1,                 # DIRECTIONAL LIGHT SOURCE
...



Top
 Post subject: Re: use of Lighting in Python
PostPosted: Thu Mar 28, 2013 4:39 am  (#7) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14816
Location: roma, italy
Thanks, fluffybunny!!!
with both parameters to "None" it works!!!

_________________
"Where am I ?"


Top
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts use in python of plug-in lighting

4

No new posts Convert GIMP plugin from Python 2 to Python 3

4

No new posts Attachment(s) Salvaging color and lighting

17

No new posts Attachment(s) Lighting Effects - Big Preview for Gimp-2.10.20

7

No new posts Attachment(s) Gimp Filter Light and Shadow Lighting Effects

42



* Login  



Powered by phpBB3 © phpBB Group