skinCluster Geometry Influence

285 views
Skip to first unread message

Dilen Shah

unread,
Mar 24, 2015, 7:01:27 AM3/24/15
to python_in...@googlegroups.com
hey guys,

I am trying a test in API to get the weights of a skinCluster. So i get the influence objects from the skinCluster but how can i get geometry influences from that skincluster and its weights so i can save it separately?

import maya.OpenMaya as OpenMaya
import maya.OpenMayaAnim as OpenMayaAnim

skinCls = "skinCluster"
selList = OpenMaya.MSelectionList()
selList.add(skinCls)

mObj = OpenMaya.MObject()
selList.getDependNode(0, mObj)

skinFn = OpenMayaAnim.MFnSkinCluster(mObj)
infs = OpenMaya.MDagPathArray()
nInfs = skinFn.influenceObjects(infs)

So from this how can i get the geometry influences.

Thanks.

D.

Eduardo Grana

unread,
Mar 24, 2015, 7:22:02 AM3/24/15
to python_in...@googlegroups.com
Hello Dilen,

You can do soemthing like this afterwards...

for i in range(nInfs):
    print infs[i] #maya.OpenMaya.MDagPath to use it with other MFn s
    print infs[i].fullPathName() # |jnt_grp|skin_C_001__SKN to go with maya.cmds

Cheers,
Eduardo


D.

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, 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/e99fe8b0-36e2-494b-8cbb-f4165ad262b1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Dilen Shah

unread,
Mar 24, 2015, 8:55:43 AM3/24/15
to python_in...@googlegroups.com
Hey Eduardo,

Thanks, well i already kinda did that, i was wondering something in maya api that can give me automatically joints and geometry separately as I couldnt find anything from MFnSkinCluster.

D.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.



--

Eduardo Grana

unread,
Mar 24, 2015, 9:51:16 AM3/24/15
to python_in...@googlegroups.com
Hey Dilen,

I don't know if there is such thing, although it wouldnt be to many lines to filter things out...
but maybe the wiser guys in the group can help you out :)

Cheers!
Eduardo

To unsubscribe from this group and stop receiving emails from it, 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/03cd40be-c7a4-4ac4-a8dd-7bd386456970%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

Joe Weidenbach

unread,
Mar 24, 2015, 11:48:27 AM3/24/15
to python_in...@googlegroups.com
As far as automatic, I don't know about that, but you can always run this on the returned MDagPaths:

geoInfs = []
for i in range(nInfs):
    inf = infs[i]
    if inf.hasFn(om.MFn.kMesh) or inf.hasFn(om.MFn.kNurbsSurface):
        geoInfs.append(inf)

That *should* get the geometry objects, although I haven't had the chance to test it.
To unsubscribe from this group and stop receiving emails from it, 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/e99fe8b0-36e2-494b-8cbb-f4165ad262b1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, 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/03cd40be-c7a4-4ac4-a8dd-7bd386456970%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.




This email is free from viruses and malware because avast! Antivirus protection is active.


Dilen Shah

unread,
Mar 24, 2015, 12:23:56 PM3/24/15
to python_in...@googlegroups.com
Hey joe,

thanks for the reply, but i have already tried that and it works but the thing is lets say i add a mesh as influence but not as a geometry influence, it will give me the that object also as geometry influence.

I think i will work around this and get a better result and will post something once i get something solid.

thanks

D.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.



--
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.



--
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.

Joe Weidenbach

unread,
Mar 24, 2015, 6:27:33 PM3/24/15
to python_in...@googlegroups.com
Hmm...I wasn't aware that you could have both mesh influences and mesh Transform influences at the same time in one skinCluster.  I thought it was "Use Components" or not, but for the entire cluster, not object by object.  If I'm wrong on that, let me know--I'd love to see how to set that up!  

To unsubscribe from this group and stop receiving emails from it, 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/c81f44d4-16b9-4893-8361-4dac93bd5d94%40googlegroups.com.

Dilen Shah

unread,
Mar 25, 2015, 5:27:06 AM3/25/15
to python_in...@googlegroups.com
Hey Joe,

Well the thing is, may be some instances you have a joint with a geometry as its shape and added to skinCluster as geometry influence, the main way to know if its added as geometry infleunce is to check the driver/base points attribute in skincluster and check which outMesh is connected into it.

So thats why i am trying to find a way to get all situations in one go which is proving a little difficult but could be possible. will keep posting my progress here once i get some substantial results.

D.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscribe@googlegroups.com.



--
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscribe@googlegroups.com.



--
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscribe@googlegroups.com.




This email is free from viruses and malware because avast! Antivirus protection is active.


--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.

Joe Weidenbach

unread,
Mar 25, 2015, 11:20:15 AM3/25/15
to python_in...@googlegroups.com
Ah, I gotcha there.  I've actually done that too, wasn't thinking of those :)
To unsubscribe from this group and stop receiving emails from it, 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/f90948de-2b2c-48fb-a277-3fac1136d896%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages