How to set a Falloff light for a plugin? [SOLVED]
-
On 25/10/2014 at 17:06, xxxxxxxx wrote:
Please forgive for such a newbie question, but I'm trying to set a light with the 'detail' parameter of 'LIGHT_DETAILS_FALLOFF_INVERSESQUARE CLAMPED ' but with no luck, please, can some one help me with this issue?
This is part of my code...> myLight = c4d.BaseObject(5102)
>
> doc.InsertObject(myLight)
>
> myLight[c4d.ID_BASEOBJECT_VISIBILITY_EDITOR] = 0
>
> myLight[c4d.LIGHT_BRIGHTNESS] = 0.7
>
> myLight[c4d.LIGHT_TYPE] = 8
>
> .......
>
> .......
>
> _
>
> _
>
> myLight[c4d.LIGHT_DETAILS_FALLOFF] = 3
>
> _
>
> _
>
> myLight[c4d.LIGHT_DETAILS_OUTERDISTANCE] = 800
>
> _
>
> _
>
>
>
>
> _
>
> _
I always get "SyntaxError: invalid syntax".Thanks for all your help guys!
-
On 26/10/2014 at 07:23, xxxxxxxx wrote:
Are you on Mac? Alt + Space inserts some other space character that
Python can not interpret. Try deleting the whitespace after the ] and
add a new one. -
On 26/10/2014 at 11:17, xxxxxxxx wrote:
Yes, I'm on a Mac. I'm using PyChar IDE, no wrong spaces, I've already deleted the white spaces but same error.
> myLight[c4d.LIGHT_DETAILS_FALLOFF]=3
I've really frustrated! Hope there is one solution for this. I appreciate your help, many thanks!
-
On 27/10/2014 at 03:38, xxxxxxxx wrote:
Hello,
When you look at the Olight.h header file you will see that LIGHT_DETAILS_FALLOFF_INVERSESQUARE_CLAMPED has the value of 7. But I suggest to not use such magic numbers but to use the actual symbol:
op[c4d.LIGHT_DETAILS_FALLOFF] = c4d.LIGHT_DETAILS_FALLOFF_INVERSESQUARE_CLAMPED
best wishes,
Sebastian -
On 28/10/2014 at 18:49, xxxxxxxx wrote:
Once again sr. it works like a charm!! I have no word to thank you!
Cheers!!!