I have been looking for hours how to perform a very simple script in Python for 3DS Max (v2017), but the APIs are terrible - to say the least.
I can't even get how to select an existing object in the scene.. Plus I do not understand if I should use pymxs wrapper or MaxPlus.
What I need to do is simply tell to 3ds Max to change a Rendering Effect Attribute when a certain scene camera is selected - or the view is switched to that camera.
I will write you down the script in pseudo code so you can - hopefully - better understand the topic:
camera_1 = MaxPlus.Factory.SelectCameraObject("36x24_MoreDof")
# camera name is 36x24_MoreDof
camera_2 = MaxPlus.Factory.SelectCameraObject("36x24_LessDof")
# camera name is 36x24_LessDof
effect1 = RenderingTab.EnvironmentAndEffects.Effects.Attribute1
effect2 = RenderingTab.EnvironmentAndEffects.Effects.Attribute2
effect1.active = False
effect2.active = False
while True:
if camera_1.isSelected == True:
effect1.active = True
effect2.active = False
elif camera_2.isSelected == True:
effect1.active = False
effect2.active = True
I hope it is clear enough.. Do you have any idea how to translate this in actual Python code for 3DS Max?
Thanks you all in advance,
Riccardo