File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
GETOOLS_SOURCE/_prototypes Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ import maya .cmds as cmds
2+
3+ ### Names
4+ nameLocatorOriginal = "locOriginal"
5+ nameLocatorProjected = "locProjected"
6+
7+
8+ ### TODO Get objects
9+ selectedMesh = "pPlane1"
10+ selectedMeshShape = cmds .listRelatives (selectedMesh , shapes = True , fullPath = False )[0 ]
11+
12+
13+ ### Create locators
14+ locatorOriginal = cmds .spaceLocator (name = nameLocatorOriginal )[0 ]
15+ locatorProjected = cmds .spaceLocator (name = nameLocatorProjected )[0 ]
16+
17+ ### Create closestPointOnMesh node
18+ closestPointOnMeshNode = cmds .createNode ("closestPointOnMesh" )
19+
20+ ### Connect locators to closestPointOnMesh node
21+ cmds .connectAttr (selectedMeshShape + ".worldMesh[0]" , closestPointOnMeshNode + ".inMesh" )
22+ cmds .connectAttr (selectedMeshShape + ".worldMatrix[0]" , closestPointOnMeshNode + ".inputMatrix" )
23+ cmds .connectAttr (locatorOriginal + ".translate" , closestPointOnMeshNode + ".inPosition" )
24+ cmds .connectAttr (closestPointOnMeshNode + ".position" , locatorProjected + ".translate" )
25+
26+ ### Create inside/outside logic
27+ # floatConstantNode = cmds.createNode("floatConstant")
28+ # floatMathNode = cmds.createNode("floatMath")
29+ # floatLogicNode = cmds.createNode("floatLogic")
30+ # colorConditionNode = cmds.createNode("colorCondition")
31+
You can’t perform that action at this time.
0 commit comments