Area :: Header
3ds Max 2015 Extension 1 is here

With new tools to power your pipeline
Discussion Groups

Python

Reply
Contributor jps
Contributor
jps
Posts: 19
Registered: ‎01-15-2009

How to change light type from Point to Infinite

26 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.
Please use plain text.
Contributor
siml_1
Posts: 21
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
Please use plain text.
Contributor jps
Contributor
jps
Posts: 19
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"?
Please use plain text.
Contributor
siml_1
Posts: 21
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...

Please use plain text.