Call for Submission
NAB 2012 Best of the Best Show Reel
Submit your work today!
  • 1/3
You are here: Forum Home / Autodesk® Maya® / Python / Dropping object onto another surface?
  RSS 2.0 ATOM  

Dropping object onto another surface?
Rate this thread
 
34780
 
Permlink of this thread   Subscribe to this thread
avatar
  • Echo7
  • Posted: 23 September 2009 06:00 AM
  • Total Posts: 19
  • Joined: 13 June 2007 06:22 AM

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!!



Replies: 0




   
  Settings Choose Theme color: