|
Hi
So I am kinda new to the whole python thing, and I’m writing a tool for dropping objects down -Y until they stop on another mesh (basically the ‘Glue’ tool in Max). So far I have:
import maya.cmds as cmds
mesh = cmds.ls(selection=True)
counter = 0
num = len ( mesh ) - 1
while counter < num:
cmds.geometryConstraint( mesh[num], mesh[counter] )
cmds.normalConstraint( mesh[num], mesh[counter], aimVector = (0,1,0) )
counter = counter + 1
Select all the objects and then choose the surface they’re going to rest on.
The problem is the cmds.geometryConstraint doesn’t restrict the objects to only moving in Y. Does anyone know how I can do this?
Thanks!!
|
|
|