{"id":264,"date":"2009-12-03T18:47:00","date_gmt":"2009-12-03T18:47:00","guid":{"rendered":"http:\/\/www.kurianos.com\/wordpress\/?p=264"},"modified":"2010-12-23T03:32:50","modified_gmt":"2010-12-23T03:32:50","slug":"face-center-value","status":"publish","type":"post","link":"https:\/\/www.kurianos.com\/wordpress\/?p=264","title":{"rendered":"..:: Face Center Value ::.."},"content":{"rendered":"<p>for Maya developers &#8230; if any one want to find out the center value of a face then use this API method to get it . <\/p>\n<p>for eg : if you want to constrain some object to the center of a face then its easy now to do check this<\/p>\n<p>for better view <a href=\"http:\/\/paste.ubuntu.com\/334036\/\">click<\/a><\/p>\n<p>def getFaceCenter(obj):<br \/> objList = OM.MSelectionList()<br \/> node = OM.MObject()<br \/> dgPath = OM.MDagPath()<br \/> objList.clear()<br \/> objList.add(obj)<br \/> objList.getDagPath(0, dgPath)<br \/> mmtrix = dgPath.inclusiveMatrix()<br \/> dgPath.extendToShape()<br \/> mobj = dgPath.node()<br \/> meshPoly = OM.MItMeshPolygon(mobj)<br \/> meshPoly.reset()<br \/> ctr = 0<br \/> faceNormalValue=[]<br \/> while not meshPoly.isDone():<br \/>  mpoint = meshPoly.center()<br \/>  mPointToMatrix = mpoint * mmtrix<br \/>  currentFaceNormal=[mPointToMatrix.x,mPointToMatrix.y,mPointToMatrix.z]<br \/>  faceNormalValue.append(currentFaceNormal)<br \/>  meshPoly.next()<br \/> return(faceNormalValue)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>for Maya developers &#8230; 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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[15,11],"tags":[],"class_list":["post-264","post","type-post","status-publish","format-standard","hentry","category-linux","category-maya"],"_links":{"self":[{"href":"https:\/\/www.kurianos.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/264","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kurianos.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kurianos.com\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kurianos.com\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kurianos.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=264"}],"version-history":[{"count":1,"href":"https:\/\/www.kurianos.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/264\/revisions"}],"predecessor-version":[{"id":396,"href":"https:\/\/www.kurianos.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/264\/revisions\/396"}],"wp:attachment":[{"href":"https:\/\/www.kurianos.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=264"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kurianos.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=264"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kurianos.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=264"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}