Python is often used as an extension language for DCC tools and the like. (Other than those listed in the title, Softimage, 3dsMax, Cinema4D, LightWave, modo, 3D-Coat, Motionbuilder, Metasequoia, Vue, etc. Adobe is stubbornly jsx)
These Python environments do not require launching the application itself (GUI) It can be used in interactive mode. I checked with the four listed in the title.
Maya Use ** mayapy.exe ** in the bin of your Maya installation folder.
Example:
C:\Program Files\Autodesk\Maya2016\bin\mayapy.exe
Official document: http://help.autodesk.com/view/MAYAUL/2016/JPN/?guid=GUID-83799297-C629-48A8-BCE4-061D3F275215
There are currently two types of modules for using Maya features.
--Maya Python (or just cmds)
In many cases, the former is ʻimport maya.cmds as cmds (or
~~ as mc), The latter is used as ʻimport pymel.core as pm
(or ~~ as pmc
).
The latter is an objective wrap of the former (roughly)
Originally developed externally, it has been installed as standard equipment since Maya 2011.
It is published on github.
https://github.com/LumaPictures/pymel
Maya Python maya.cmds can be read, but
import maya.cmds as mc
Even if you look inside, it doesn't feel like it can be used
>>> dir(mc)
['__builtins__', '__doc__', '__file__', '__name__', '__package__', '__path__']
You can use it by ** initialize **. The following is an example sentence (▼) that was in the document
initialize
try:
import maya.standalone
maya.standalone.initialize()
except:
pass
Like.
PyMEL PyMEL can also be read. As soon as you read it, a log similar to the one that appears in the script editor when Maya starts up is printed.
import pymel.core as pm
When I initialized cmds, the memory was about 109MB, but with PyMEL it went about 475MB. About 677MB for normal Maya startup including GUI.
By the way, initialize is also included in the process of reading PyMEL. It is also written in Kojiki. https://github.com/LumaPictures/pymel/blob/master/pymel/internal/startup.py
Houdini Use ** hython.exe ** in your Houdini installation folder.
Example: C:\Program Files\Side Effects Software\Houdini 15.0.244.16\bin\hython.exe
Somehow sys.argv
>>> sys.argv
['C:\\PROGRA~1\\SIDEEF~1\\HOUDIN~1.16\\houdini\\python2.7libs\\houdiniInterpreter.py']
I see.
The module for using Houdini's features is the "** hou **" module. It is loaded when hython.exe is started.
>>> dir()
['__builtins__', '__doc__', '__name__', 'hou']
There are various things inside.
Official document: http://www.sidefx.com/docs/houdini15.0/hom/commandline
If you simply search for "hython", Haskell implementation Python will also appear, so be careful.
numpy In the hython environment, numpy can be loaded by default. Thank you Thank you (
blender Start blender with the option "**-python-console **".
Example:
"C:\Program Files\Blender Foundation\Blender\blender.exe" --python-console
Above all, it is impressive that the silent blender window pops up (it pops up, but it is a window that I do not use in particular).
Somehow sys.argv
>>> sys.argv
['blender-app.exe', '--python-console']
I see.
The module for using the blender function is the "** bpy **" module. Read.
import bpy
contents. It is summarized to some extent.
>>> dir(bpy)
['__all__', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', 'app', 'context', 'data', 'ops', 'path', 'props', 'types', 'utils']
... I haven't used it carefully, so I'm not sure if it's ready for use (laughs) (It seems that the class being read is different from the Python Console on blender (GUI).)
Official document: http://wiki.blender.org/index.php/Doc:JA/2.6/Manual/Render/Command_Line
Python Console : http://www.blender.org/manual/editors/python_console.html Blender Python API : http://www.blender.org/api/blender_python_api_2_76_2/ Scripting & Extending Blender » Introduction : http://www.blender.org/manual/advanced/scripting/introduction.html
numpy Like Houdini, blender can read numpy without doing anything.
You will be warned if you have a blender window that doesn't respond behind you, or if you try to close the window loosely.
Let's finish it properly with quit ()
or ʻexit ()`.
(... I got an error for a moment at the end, it seems like not found, but well ...)
Nuke Start Nuke with the option "**-t **". t of terminal.
Example:
"C:\Program Files\Nuke9.0v8\Nuke9.0.exe" -t
… Then it seems to start as a Python interpreter, The free trial version didn't seem to be licensed and I couldn't try it. …。 Rendering from the command line is also restricted, so that's right. is. So, I tried to say it on Nuke as usual.
※
Also, if you give a Python script file after -t, it seems to execute it.
"C:\Program Files\Nuke9.0v8\Nuke9.0.exe" -t path\to\your\script.py
The module for using Nuke's features is the "** nuke **" module.
Even so, when you just dir ()
, you already have a lot of things globally. .. ..
Official document: https://www.thefoundry.co.uk/products/nuke/developers/90/pythondevguide/command_line.html
NUKE Python Developer's Guide v9.0v8 documentation : http://docs.thefoundry.co.uk/nuke/90/pythondevguide/index.html
Houdini, Nuke, the module is loaded from the beginning, Maya, blender can be read arbitrarily, was.
Also, Maya and Houdini have an exe that launches the Python interpreter as it is. Blender and Nuke are patterns that can also be interpreted by adding options.
sys.argv was in Houdini and blender, but
Maya and Nuke not mentioned were ['']
(empty).
Maya is enthusiastic about Japaneseizing documents around development. Whether it is excellent as a document or whether there is a mistranslation is another frame, but I am grateful.
I would like to see if other Python working tools also have an interactive mode.
3dsMax The Python API is now included as standard in Max, but it can be used on Max that is started instead of the interactive mode described above. The rest is ** 3dsmaxcmd.exe **. But isn't there an interactive mode? Is there? Basically, it's for batch rendering. I'm sorry I don't understand (laughs)
Executing Python scripts from the command line: http://docs.autodesk.com/3DSMAX/16/ENU/3ds-Max-Python-API-Documentation/files/GUID-379E0B39-7F56-4764-88B6-B26090948800.htm
ConEmu It is convenient to register
ConEmu Project Japanese Top Page --joSdo: https://osdn.jp/projects/conemu/
Recommended Posts