AREA forums upgrade
Read more about the planned upgrade of our forums
  • 1/3
You are here: Forum Home / Autodesk® MotionBuilder® / Python / How to change light type from Point to Infinite
IMPORTANT ANNOUNCEMENT ABOUT AREA FORUMS
  RSS 2.0 ATOM  

How to change light type from Point to Infinite
Rate this thread
 
66663
 
Permlink of this thread  
avatar
  • Total Posts: 18
  • Joined: 15 January 2009 04:34 PM

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.



Replies: 1
/img/forum/light/default_avatar.png

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

Author: siml

Replied: 01 May 2012 09:10 PM  
avatar

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”?



Replies: 0
avatar
  • siml
  • Posted: 16 May 2012 05:18 PM

Hi Newt,

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

FBPropertyList class
http://docs.autodesk.com/MB/MB20..._1_f_b_property_list.html



Attachment Attachment
Replies: 0