Quantcast
Channel: mel wiki
Viewing all articles
Browse latest Browse all 610

API: How can I make a transform?

$
0
0
(Referenced from 'Complete Maya Programming') Waaaay exciting!
It should be noted that any time you use API calls outside of a plugin to modify the DG, you can't undo the operation.
# Python code
import maya.OpenMaya as om
# optionA:
transFn = om.MFnTransform()
transObj = transFn.create()
name = transFn.name()
# optionB:
transFn = om.MFnTransform()
transObj = transFn.create()
# Illustrating inheritance: 
dagFn = om.MFnDagNode(transObj)
name = dagFn.name()
print name
# transform1
Class hierarchy:
  • MFnBase
    • MFnDependencyNode
      • MFnDagNode
        • MFnTransform


Viewing all articles
Browse latest Browse all 610

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>