Home Dota 2

The dreaded 'lockInfluenceWeights'

polycounter lvl 11
Offline / Send Message
Spudnik polycounter lvl 11
If you've rigged something from the Dota2 files, you've undoubtedly come across this spawn of Satan. If you don't know what I mean, here's the skinny (from here):
The problem:
When painting skinweights in maya you sometimes get a big red X and you cant select influences nor paint them. Additionally you get an error that looks something like this
// Error: file: C:/Program Files/Autodesk/Maya2012/scripts/others/skinClusterInflMenu.mel line 568: No object matches name: Hips.liw //

Why is this happening?
Maya has an internal attribute called "liw" that indicates if influences are locked or not. When exporting the mesh it is exporting this attribute as a custom attribute but on import it doesnt recognize it as its own and trys to create it again. But because the name is already taken it will just give you an error.

From my experience most of the meshes in the Maya files that we get from Valve have this. Some people suggest updating your .fbx plugin to stop this behavior but even after updating to 2013.3 and importing all the .fbx files from the zip into a clean scene, I'm still given meshes with 'lockedInfluenceWeights'. "This isn't that bad", I hear you say, "you don't have to edit the weights on those meshes". Ah, but the problem comes in when we try to copy weights from a default item to a custom one, which works perfectly fine but unfortunately the 'lockInfluenceWeights' attribute hitches a ride and makes editing those weights impossible.

RIOT, FIX PLEASE:
{
// selects hierarchy //
select -hi;

// select only the joints in the hierarchy //   
$sel = `ls -sl -typ "joint"`; 
select -r $sel;

// run once for each joint //
for($obj in $sel)
    {
    // check if attribute exists, coded this way for readability
    $exists = `attributeExists "lockInfluenceWeights" $obj`;

    if($exists == 1)
        {
            // delete attribute
            deleteAttr -at "lockInfluenceWeights" $obj;
        }
    }
}

This goes through all the objects in the hierarchy of your selected objects, finds and deletes that pesky attributes, but alas, this only works very unreliably... at least for me.

So, how do you guys and gals deal with this ? not copy weights at all? Or is there some ritual or set of things I must do to get the script to work 100% of the time?! Ain't nothing more frustrating that being stuck on the last step of the process :/

Replies

  • mrpresident
    Options
    Offline / Send Message
    mrpresident polycounter lvl 10
    Oh god, I remember this.

    Tried a whole bunch of methods but lately I've been doing this and it hasn't failed me yet:

    First, instead import the .ma file instead of the .fbx's. Then go to File < Optimize Scene Size Options and there should be a Remove: Unknown Nodes option. Press optimize now next to it, save the scene.

    Since I've started doing this I've had no rigging problems whatsoever. But I also do this before I start a project, not at the end. You might want to try doing this in a new scene and then import your model after.
  • Spudnik
    Options
    Offline / Send Message
    Spudnik polycounter lvl 11
    Hmm, seems to work on all but the helmet slot for Nyx at least. Needs more testing! Good call though, does it work 100% of the time for you?
  • mrpresident
    Options
    Offline / Send Message
    mrpresident polycounter lvl 10
    Spudnik wrote: »
    Hmm, seems to work on all but the helmet slot for Nyx at least. Needs more testing! Good call though, does it work 100% of the time for you?

    Yep, 100% so far, did it with several heroes but not all.
  • 7thBattery
    Options
    Offline / Send Message
    I've never had this specific problem. I've always worked straight from the supplied Maya files, but they are, sadly, riddled with unknown nodes.

    But I just wanted to post that doing this:
    Then go to File < Optimize Scene Size Options and there should be a Remove: Unknown Nodes option. Press optimize now next to it, save the scene.
    Can be done a little more simply by typing this:
    delete `ls -type unknown`;
    
    ...into the command line or dropping it on the shelf as a button.

    Hope that helps!
  • Spudnik
    Options
    Offline / Send Message
    Spudnik polycounter lvl 11
    But I just wanted to post that doing this:Can be done a little more simply by typing this:
    delete `ls -type unknown`;
    
    ...into the command line or dropping it on the shelf as a button.
    This doesn't work for me at all, tells me nothing is selected

    The only way I've gotten it to work so far is to have Maya create a clean .../My Documents/maya/... then do what you suggested, mrpresident, and save it. Then I can switch back to my .../My Documents/maya/... with all my plugins etc and it works, even with the root joint still having the lockInfluenceWeight attribute... WTF?!

    The exact same steps don't work if I have the .../My Documents/maya/... with my plugins... ayayay

    P.S.: mrpresident, can you go into a scene that works for you and select all the meshes and the skeleton, go to Modify->Delete Attribute.. and tell me if you also have the lockInfluenceWeight still there?
  • mrpresident
    Options
    Offline / Send Message
    mrpresident polycounter lvl 10
    Just checked, there actually is still lockInfluenceWeight on all the skeletons, but it's not affecting anything and I can duplicate weights, export etc. just fine. I guess it doesn't come into effect unless one of valve's nodes is using it?

    If it works with a new maya settings folder, but not with your old one, there's probably a script or plugin that's screwing it up. I'd try removing them one by one temporarily until you figure out what's causing the issue.
  • Spudnik
    Options
    Offline / Send Message
    Spudnik polycounter lvl 11
    If it works with a new maya settings folder, but not with your old one, there's probably a script or plugin that's screwing it up. I'd try removing them one by one temporarily until you figure out what's causing the issue.

    Yep, that's the plan. Or keep a 'clean' version handy that I can switch to when I start up on a new hero. ^^
  • 7thBattery
    Options
    Offline / Send Message
    Spudnik wrote: »
    This doesn't work for me at all, tells me nothing is selected
    I feel like I'm jumping into the middle of your conversation and doing little good, but I'm just trying to help :)

    To be clear that code I posted should resolve the error you get when you first load one of Valve's Maya files that looks something like this:

    mayaerror.jpg

    This is caused by Valve using certain proprietary formats we are not privy to and not taking the time to remove them from their scenes before they publish them.

    If you load up any of their scenes and type:
    ls -type unknown
    
    You will probably see something like the highlighted text:

    unknownnodes.jpg

    'ls -type unknown` lists out all of these unknown nodes, so by entering "delete `ls -type unknown`" you're simply skipping a step and saying, first list them out, then delete whatever you find.

    If it's telling you nothing is selected, then you don't have any unknown nodes in your scene and they are not your problem. In fact, the unknown nodes shouldn't cause any problems other than the annoying warning from Maya whenever you load the scene, which is probably why Valve doesn't bother to remove them. I'm not sure if that clears anything up or makes it worse :)

    As for your specific problem again Spudnik, I have never run into it personally. And I went through some of my scenes trying to find if anything had a '.liw' attribute and couldn't find anything.

    But after googling that to try to find out some more about it, I found this on Autodesk's site.

    http://area.autodesk.com/forum/autodesk-fbx/fbx-plug-ins-import-export-discussions/shortname-of-liw-being-lost-in-fbx-export/

    It sounds like your issue? Have you downloaded the latest plugin?
  • Spudnik
    Options
    Offline / Send Message
    Spudnik polycounter lvl 11
    7thBattery wrote: »
    It sounds like your issue? Have you downloaded the latest plugin?
    Yep, though I have had the latest FBX version for a while now. That's why it was so frustrating for me, I did all the thing that I found on Autodesk's Area etc to resolve this and none of worked. Seems it was just some random plugin I have is interfering because, as stated above, if I do it with a clean .../MyDocuments/maya/.. folder, everything works as it's supposed to. Oh well... Thanks for clarifying that bit of code you posted, now it makes sense ^^
  • Spudnik
    Options
    Offline / Send Message
    Spudnik polycounter lvl 11
    Welp, seems like the exact thing that I described above that worked for KotL doesn't work for Slark... Could you do me a favor and try it on your side and see if it works for you?
  • mrpresident
    Options
    Offline / Send Message
    mrpresident polycounter lvl 10
    Worked fine for me with slark.

    File < New Scene
    File < Import < Slark_model.ma
    File < Optimize Scene Size Options < Unknown Nodes : Optimize Now Button < Close Window
    File < Save Scene < slarktest.mb

    From here I can paint weights/copy weights of anything default, or anything I add and smooth bind.

    Here's the file with a random sphere that had its weights copied from the default bracer: https://dl.dropboxusercontent.com/u/2111872/slarktest.mb

    If that file isn't working for you then something funky is going on.
Sign In or Register to comment.