Call for Submission
NAB 2012 Best of the Best Show Reel
Submit your work today!
  • 1/3
You are here: Forum Home / Autodesk® Maya® / SDK / MRichSelection soft selection weight values?
  RSS 2.0 ATOM  

MRichSelection soft selection weight values?
Rate this thread
 
36084
 
Permlink of this thread   Subscribe to this thread
avatar
  • chadmv
  • Posted: 28 October 2009 07:40 AM
  • Location: California
  • Total Posts: 20
  • Joined: 24 August 2006 03:30 AM

The documentation for MRichSelection says “Components on both sides can include weight data which is used to specify both the amount of influence and the proximity to the centre of symmetry.”

How do I go about accessing this weight data?  There are no such functions in MRichSelection and MSelectionList only returns the component ids in the soft selection.  I can compute these myself, but since the documentation explicitly says it includes weight data, I’m assuming there must be some function to access this weight data.

On another note, is there a forum where actual Autodesk employees respond to these types of questions?  Most the the threads in this forum have less than 10 views and 0 replies.  It’s pretty silly since this is the official Autodesk/Maya user forum.



Replies: 1
/img/forum/dark/default_avatar.png

Found the weight data is accessible either in MFnComponent or MItGeometry

selection = OpenMaya.MSelectionList()
softSelection = OpenMaya.MRichSelection()
OpenMaya.MGlobal.getRichSelection(softSelection)
softSelection.getSelection(selection)
pathDag = OpenMaya.MDagPath()
oComp = OpenMaya.MObject()
selection.getDagPath(0, pathDag, oComp)
fnComp = OpenMaya.MFnSingleIndexedComponent(oComp)
for i in range(fnComp.elementCount()):
print fnComp.element(i), fnComp.weight(i).influence()

Author: chadmv

Replied: 18 November 2009 08:32 AM  




   
  Settings Choose Theme color: