MotionBuilder Forum
Welcome to Autodesk’s MotionBuilder Forums. Share your knowledge, ask questions, and explore popular MotionBuilder topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to change light type from Point to Infinite

3 REPLIES 3
Reply
Message 1 of 4
jps
Advocate
243 Views, 3 Replies

How to change light type from Point to Infinite

I have many lights I need to change from Point to Infinite in each of my scene and keep all other parameters the same (color, intensity, position, rotation, parent...).
Is it possible to get this done in Python simply?
Thanks.
3 REPLIES 3
Message 2 of 4
siml_1
in reply to: jps

Hi Newt,

You can do it in Python. Simply query the scene for all the lights, change the attribute LightType to kFBLightTypeInfinite.
See script below.
Hope that helps. 🙂

from pyfbsdk import *

lLightList = FBSystem().Scene.Lights

for i in range(0, lLightList.__len__()):
print lLightList.__getitem__(i).Name
lLightList.__getitem__(i).LightType = FBLightType.kFBLightTypeInfinite
Message 3 of 4
jps
Advocate
in reply to: jps

Thanks a lot.
This is working great.

I'm new to python and not used to this way of writing:
lLightList.__len__()

but more:
len(lLightList)

What is the main difference? Is it the use of "Class"?
Message 4 of 4
siml_1
in reply to: jps

Hi Newt,

They are probably the same. See the 2013 online docs below.

FBPropertyList class
http://docs.autodesk.com/MB/MB2013/ENU/MotionBuilder-SDK-Documentation/py_ref/classpyfbsdk_1_1_f_b_p...

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report