for Maya developers ... if any one want to find out the center value of a face then use this API method to get it . 
for eg : if you want to constrain some object to the center of a face then its easy now to do check this
for better view click
def getFaceCenter(obj):
 objList = OM.MSelectionList()
 node = OM.MObject()
 dgPath = OM.MDagPath()
 objList.clear()
 objList.add(obj)
 objList.getDagPath(0, dgPath)
 mmtrix = dgPath.inclusiveMatrix()
 dgPath.extendToShape()
 mobj = dgPath.node()
 meshPoly = OM.MItMeshPolygon(mobj)
 meshPoly.reset()
 ctr = 0
 faceNormalValue=[]
 while not meshPoly.isDone():
  mpoint = meshPoly.center()
  mPointToMatrix = mpoint * mmtrix
  currentFaceNormal=[mPointToMatrix.x,mPointToMatrix.y,mPointToMatrix.z]
  faceNormalValue.append(currentFaceNormal)
  meshPoly.next()
 return(faceNormalValue)
എന്റെ ബാല്യകാലസ്മരണകള്
                      -
                    
 അ അമ്മ ആന, തറ പറ പത
ക്ലാ ക്ലാ ക്ലീ, ക്ലീ ക്ലീ ക്ലൂ, സുരേഷ് തിരിഞ്ഞു നോക്കി, അതാ മുറ്റത്തൊരു മൈന,
മേരിക്കുണ്ടൊരു കുഞ്ഞാട്, മേനി കൊഴുത്തൊരു കുഞ്ഞാട്, പാല്ന...
10 years ago
 

 
 
 
0 comments:
Post a Comment