[PYTHON] A note about checking modifiers with Max Plus

What is this?

This is a memo I wrote while trying to get a modifier with 3ds Max's Python API, ** Max Plus **.

trial and error

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.

Summary

This selection object, "Turbo Smooth", "Skin" and ** "Morfer" are also assigned **!

That's all for today.

reference

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

A note about checking modifiers with Max Plus
A note about mprotect (2)
A note about KornShell (ksh)
A note about TensorFlow Introduction
A note about [python] __debug__
A note about hitting the Facebook API with the Python SDK
A note about get_scorer in sklearn
A note about mock (Python mock library)
A note on enabling PostgreSQL with Django
A note about doing the Pyramid tutorial
[Note] A story about not being able to break through a proxy with pip
[Note] Create a one-line timezone class with python
A note about the python version of python virtualenv
Data analysis in Python: A note about line_profiler
A story about implementing a login screen with django
A note about the new style base class
Notes about with
Just a note
A story about making 3D space recognition with Python
A story about using Resona's software token with 1Password
A story about predicting exchange rates with Deep Learning
Repairing a broken development environment with mavericks migration (Note)
A story about making Hanon-like sheet music with Python
A story about trying a (Golang +) Python monorepo with Bazel
A story about how theano was moved with TSUBAME 2.0
A note on speeding up Python code with Numba
A memo about building a Django (Python) application with Docker
Note that there was a version problem with networkx
[Note] A story about trying to override a class method with two underscores in Python 3 series.