Last active
September 5, 2017 15:03
-
-
Save SEVEZ/8b4f2391ce83c9973d590c281c5ab89c to your computer and use it in GitHub Desktop.
Copy polymesh shape to locator #misc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import maya.OpenMaya as OpenMaya | |
| import maya.cmds as cmds | |
| cmds.polySphere() | |
| cmds.spaceLocator()[0] | |
| selection_list = OpenMaya.MSelectionList() | |
| selection_list.add('pSphereShape1') | |
| shape = OpenMaya.MObject() | |
| selection_list.getDependNode(0, shape) | |
| selection_list = OpenMaya.MSelectionList() | |
| selection_list.add('locator1') | |
| transform = OpenMaya.MObject() | |
| selection_list.getDependNode(0, transform) | |
| mesh_fn = OpenMaya.MFnMesh() | |
| mesh_fn.copy(shape, transform) |
Author
SEVEZ
commented
May 19, 2016

Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment