Area :: Header
New tools, templates and workflows
Announcing Extension 2 for 3ds Max 2015 and 3ds Max Design 2015
Discussion Groups

Python

Reply
Active Contributor
31 Posts
0 Kudos
Registered: ‎01-15-2009

How to change light type from Point to Infinite

39 Views, 3 Replies
04-30-2012 01:55 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.
Contributor
21 Posts
0 Kudos
Registered: ‎04-30-2012

Re: How to change light type from Point to Infinite

05-02-2012 01:10 AM 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. :smileyhappy:

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
Active Contributor
31 Posts
0 Kudos
Registered: ‎01-15-2009

Re: How to change light type from Point to Infinite

05-08-2012 07:23 AM 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"?
Contributor
21 Posts
0 Kudos
Registered: ‎04-30-2012

Re: How to change light type from Point to Infinite

05-16-2012 09:18 PM 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...