Hi David, I've made some rough code about copying the usual attributes you can tweak about a skin cluster (hope i didn't forget something!)
http://pastebin.com/z4r9YPwt you can try that function in your code, and let me know how it goes! Cheers! Eduardo On Tue, Feb 25, 2014 at 10:31 AM, David Martinez < [email protected]> wrote: > Hi again, > > Would it be possible to retrieve the information from a skin cluster so I > can mimic the same settings when creating the new one? > > > -- > David Martinez - Technical Animator > > Email: [email protected] > Website: http://www.elusiveideas.com > > > > > On Tue, Feb 25, 2014 at 1:24 PM, Eduardo Grana <[email protected]>wrote: > >> Ok. >> Remeber that you not only should match the skin weights, but the settings >> in the skin cluster. >> Also be aware that there may be weighting between the different skinning >> methods (if weight blended is used) >> Cheers! >> Eduardo >> >> >> On Tue, Feb 25, 2014 at 10:11 AM, David Martinez < >> [email protected]> wrote: >> >>> Hi Eduardo, >>> >>> Yes, I did try with that and I get results that are closer but still not >>> quite what I was looking for. >>> >>> I will try to repro the issue in a free rig or something as the scenes >>> that I'm dealing with at the moment are not in the public domain. >>> Thanks, >>> >>> >>> >>> >>> -- >>> David Martinez - Technical Animator >>> >>> Email: [email protected] >>> Website: http://www.elusiveideas.com >>> >>> >>> >>> >>> On Tue, Feb 25, 2014 at 1:09 PM, Eduardo Grana >>> <[email protected]>wrote: >>> >>>> Hi David, >>>> I've tried with a sphere and 3 joints, maybe not the best test case, >>>> i'm wondering if you could send me a test case to figure it out better. >>>> Have you tried with influenceAssociation="closestJoint"? >>>> Cheers, >>>> Eduardo >>>> >>>> >>>> On Tue, Feb 25, 2014 at 9:55 AM, David Martinez < >>>> [email protected]> wrote: >>>> >>>>> Hi Eduardo, >>>>> >>>>> I tried what you suggested but there are still a few vertices that >>>>> decide to get skinned to other joints and do not respect the old skinning >>>>> information. I'm not sure what's causing the issue though. Or why it >>>>> happens when I do it using code but not when using the interface... >>>>> >>>>> >>>>> -- >>>>> David Martinez - Technical Animator >>>>> >>>>> Email: [email protected] >>>>> Website: http://www.elusiveideas.com >>>>> >>>>> >>>>> >>>>> >>>>> On Tue, Feb 25, 2014 at 12:38 PM, Eduardo Grana < >>>>> [email protected]> wrote: >>>>> >>>>>> Hello David, >>>>>> >>>>>> Maybe you can try adding the noMirror=True flag on >>>>>> thecopySkinWeightscommand in line 20... >>>>>> Something like >>>>>> cmds.copySkinWeights(sourceSkin=currentSkinCluster, >>>>>> destinationSkin=newSkinCluster, >>>>>> surfaceAssociation="closestPoint", >>>>>> influenceAssociation=("name", "label", "oneToOne"), >>>>>> normalize = True, noMirror=True) >>>>>> I would also change the influenceAssociation to "closestJoint", but >>>>>> it seems to work with out it too... >>>>>> >>>>>> Cheers! >>>>>> >>>>>> Eduardo >>>>>> >>>>>> >>>>>> >>>>>> On Mon, Feb 24, 2014 at 7:20 PM, David Martinez < >>>>>> [email protected]> wrote: >>>>>> >>>>>>> Hi, >>>>>>> >>>>>>> I'm working on a really simple script and yet I'm having trouble >>>>>>> getting the script to do what I want. >>>>>>> Here is a description of what I'm trying to do: >>>>>>> >>>>>>> Get selection >>>>>>> Duplicate the object >>>>>>> For any skin Clusters that the object may have >>>>>>> | Get joints skinned to the skin cluster >>>>>>> | Replace the selection with the duplicated object >>>>>>> | Adds the joints connected to the skin Cluster to the selection >>>>>>> | Skin the new object >>>>>>> | Copy weights from one object to the other >>>>>>> >>>>>>> Here is the code that I have so far: >>>>>>> https://gist.github.com/davidmartinezanim/9198402 >>>>>>> >>>>>>> I've tried to get the code to have the same settings as I have in >>>>>>> Maya: >>>>>>> >>>>>>> - http://www.elusiveideas.com/smoothBindOptions.PNG >>>>>>> - http://www.elusiveideas.com/copySkinWeightOptions.PNG >>>>>>> >>>>>>> And yet, when I do it in Maya, it works, but when I run the code, >>>>>>> the original and duplicate objects are different. (When I move one of >>>>>>> the >>>>>>> joints, the skinning is not quite the same) >>>>>>> >>>>>>> Any ideas about what could be causing the issue? >>>>>>> >>>>>>> -- >>>>>>> David Martinez - Technical Animator >>>>>>> >>>>>>> Email: [email protected] >>>>>>> Website: http://www.elusiveideas.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 [email protected]. >>>>>>> To view this discussion on the web visit >>>>>>> https://groups.google.com/d/msgid/python_inside_maya/CAMLeNpyWbqvJkp7bFyh7jNZg3zJFV_iV902CjKd7xpoOL5dpbw%40mail.gmail.com >>>>>>> . >>>>>>> For more options, visit https://groups.google.com/groups/opt_out. >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> Eduardo Graña >>>>>> www.eduardograna.com.ar >>>>>> >>>>>> -- >>>>>> 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 [email protected]. >>>>>> To view this discussion on the web visit >>>>>> https://groups.google.com/d/msgid/python_inside_maya/CACt6Gr%3DsueS9ujBK%2BNCTQW8AtVpi-EpG-gbLK%3D5P7t0Qk%2BN9qw%40mail.gmail.com >>>>>> . >>>>>> >>>>>> For more options, visit https://groups.google.com/groups/opt_out. >>>>>> >>>>> >>>>> -- >>>>> 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 [email protected]. >>>>> To view this discussion on the web visit >>>>> https://groups.google.com/d/msgid/python_inside_maya/CAMLeNpyP3bGdTEvz%2BNgZcbFXb6U1ROLEYbSPEycP0inW41-Jgw%40mail.gmail.com >>>>> . >>>>> >>>>> For more options, visit https://groups.google.com/groups/opt_out. >>>>> >>>> >>>> >>>> >>>> -- >>>> Eduardo Graña >>>> www.eduardograna.com.ar >>>> >>>> -- >>>> 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 [email protected]. >>>> To view this discussion on the web visit >>>> https://groups.google.com/d/msgid/python_inside_maya/CACt6GrkM8nfOH947uSLLgUPpZq1pcPPt969gujMneJ8ypFvzdw%40mail.gmail.com >>>> . >>>> >>>> For more options, visit https://groups.google.com/groups/opt_out. >>>> >>> >>> -- >>> 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 [email protected]. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/python_inside_maya/CAMLeNpwzF4%3DuhVyCPqwsGSbVBsADd8p_f4ZRuWKfNzxT1-vzCA%40mail.gmail.com >>> . >>> >>> For more options, visit https://groups.google.com/groups/opt_out. >>> >> >> >> >> -- >> Eduardo Graña >> www.eduardograna.com.ar >> >> -- >> 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 [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/python_inside_maya/CACt6GrnKC0QMuTQ7mhmzLbOuNcM-imKU6OvvHtL7iZ4upJwgDg%40mail.gmail.com >> . >> >> For more options, visit https://groups.google.com/groups/opt_out. >> > > -- > 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 [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/python_inside_maya/CAMLeNpwbrrvCVnShLLSY_y4PY3-bav%2BqGGxWD94G0PheVVvAbA%40mail.gmail.com > . > > For more options, visit https://groups.google.com/groups/opt_out. > -- Eduardo Graña www.eduardograna.com.ar -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CACt6Grmh2yZVMKR0qsp7%2BbCrvv4%3DioiO1NYe67vbKMfp-9FENA%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
