Membership Deformer Set

297 views
Skip to first unread message

Dilen Shah

unread,
Mar 12, 2015, 1:06:22 PM3/12/15
to python_in...@googlegroups.com
Hey guys,

I am writing a node in maya API in which I am getting the weights of any deformer on it and getting its weights. But when I remove few vertices from the membership or deformer set and do the same, the weights of those vertices are still existing instead of giving me 0.

Anyone know a way in API or even other way to get weights properly and only for the vertices that exist in membership or set.

Thank you.

D.

Chad Vernon

unread,
Mar 12, 2015, 6:18:04 PM3/12/15
to python_in...@googlegroups.com
The weights will still exist.  You should use the MItGeometry iterator that's passed into deform.  It will only iterate of members in the deformer set.

Dilen Shah

unread,
Mar 13, 2015, 4:39:41 AM3/13/15
to python_in...@googlegroups.com
Hey Chad,

Thanks for the reply, just for example lets say I am getting the weights of a cluster on my mesh, at the moment I am using the weightList attribute to get the weights but it has all the weights even the ones that are not in the deformer set so what woul dbe the best way to approach this?

Thanks.

D.

Chad Vernon

unread,
Mar 13, 2015, 11:37:17 AM3/13/15
to python_in...@googlegroups.com
If you are writing your own deformer you should use the MItGeometry iterator, get the indices out of there and call the MPxDeformerNode::weightValue method with the indices.  If you are querying an existing deformer like a cluster, you'll need to query the set membership and then only iterate over those weight values using getattr or the MPlug if you are using the API.

--
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/VQyTsx4ZOz8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/e413b840-02d6-4467-8d3e-b5f4b28f54f0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dilen Shah

unread,
Mar 16, 2015, 3:35:31 AM3/16/15
to python_in...@googlegroups.com
Hey Chad,

Thanks, as I am doing exactly what you mentioned so its all good.

D.


On Friday, March 13, 2015 at 4:37:17 PM UTC+1, Chad Vernon wrote:
If you are writing your own deformer you should use the MItGeometry iterator, get the indices out of there and call the MPxDeformerNode::weightValue method with the indices.  If you are querying an existing deformer like a cluster, you'll need to query the set membership and then only iterate over those weight values using getattr or the MPlug if you are using the API.
On Fri, Mar 13, 2015 at 1:39 AM, Dilen Shah <dilen...@gmail.com> wrote:
Hey Chad,

Thanks for the reply, just for example lets say I am getting the weights of a cluster on my mesh, at the moment I am using the weightList attribute to get the weights but it has all the weights even the ones that are not in the deformer set so what woul dbe the best way to approach this?

Thanks.

D.

On Thursday, March 12, 2015 at 11:18:04 PM UTC+1, Chad Vernon wrote:
The weights will still exist.  You should use the MItGeometry iterator that's passed into deform.  It will only iterate of members in the deformer set.

On Thursday, March 12, 2015 at 10:06:22 AM UTC-7, Dilen Shah wrote:
Hey guys,

I am writing a node in maya API in which I am getting the weights of any deformer on it and getting its weights. But when I remove few vertices from the membership or deformer set and do the same, the weights of those vertices are still existing instead of giving me 0.

Anyone know a way in API or even other way to get weights properly and only for the vertices that exist in membership or set.

Thank you.

D.

--
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/VQyTsx4ZOz8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python_inside_maya+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages