This is a memo I wrote while trying to get a modifier with 3ds Max's Python API, ** Max Plus **.
python
python.execute "print dir()"
['MaxPlus', '_ToListener', '__builtins__', '__doc__', '__name__', '__package__', '_old_stderr', '_old_stdout', '_redirected_stdout', 'sys']
#success
↑ Max Plus is loaded when Max is opened
You can get the selected object with MaxPlus.SelectionManager.Nodes
.
So, let's start by grasping the geometry.
python
python.execute "print MaxPlus.SelectionManager.Nodes"
<generator object <genexpr> at 0x00000000FBB2ABD0>
#success
↑ Will it be returned by the generator?
You can get the modifiers applied to the obtained node with **. Modifiers **. You can also get the name of a modifier with **. GetClassName () **. I wore it sideways (?) And tried to double the list comprehension ↓
python
python.execute "print [ mod.GetClassName() for node in MaxPlus.SelectionManager.Nodes for mod in node.Modifiers]"
[u'\u30bf\u30fc\u30dc\u30b9\u30e0\u30fc\u30ba', u'\u30b9\u30ad\u30f3']
#success
desuyone〜〜
python
python.execute "modList = [ mod.GetClassName() for node in MaxPlus.SelectionManager.Nodes for mod in node.Modifiers]"
#success
python.execute "for i in modList:print i"
Turbo smooth
skin
#success
The modifier names "Turbo Smooth" and "Skin" have been taken.
This selection object, "Turbo Smooth", "Skin" and ** "Morfer" are also assigned **!
That's all for today.
MaxPlus and Setting Slice_Modifier Position/Rotation/Scale & "Animatable" http://tech-artists.org/forum/showthread.php?4697-MaxPlus-and-Setting-Slice_Modifier-Position-Rotation-Scale-amp-quot-Animatable-quot
MaxPlus.SelectionManager.Nodes http://help.autodesk.com/view/3DSMAX/2015/ENU/?guid=__files_GUID_B8C79798_1908_4FBA_A936_8A383F8494F7_htm
Adding modifiers in the Python API http://help.autodesk.com/cloudhelp/2015/ENU/Max-Python-API/files/GUID-1AC35645-91D7-4DBE-9714-681C8CC8700F.htm
Modifier Class Reference http://help.autodesk.com/view/3DSMAX/2015/ENU/?guid=__py_ref_class_max_plus_1_1_modifier_html
help(mod)
python
python.execute "help(mod)"
Help on Modifier in module MaxPlus object:
class Modifier(BaseObject)
| The base class for Object Space and Space Warp (World Space) Modifier plug-ins
|
| Method resolution order:
| Modifier
| BaseObject
| ReferenceTarget
| ReferenceMaker
| Animatable
| InterfaceServer
| Wrapper
| __builtin__.object
|
| Methods defined here:
(Omitted)
| ----------------------------------------------------------------------
| Methods inherited from InterfaceServer:
|
| GetInterface(self, *args)
| GetInterface(InterfaceServer self, Interface_ID id) -> BaseInterface
|
| ----------------------------------------------------------------------
| Methods inherited from Wrapper:
|
| GetUnwrappedPtr(self)
| GetUnwrappedPtr(Wrapper self) -> void *
|
| __nonzero__(self)
| __nonzero__(Wrapper self) -> bool
|
| __str__(self)
| __str__(Wrapper self) -> char const *
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Wrapper:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
#success
Recommended Posts