seithWeightTools

January 18th, 2013 Leave a comment Go to comments

DOWNLOAD:

Version: 5.1 (for Maya 2011 and 2012)

Info:

This script will save and load weights on a smooth-skinned geometry. At one point it was heavily based on a script © by Big Idea Productions (to be honest I don’t know anymore if it still is), so hats down to them!

The concept of this script is that you do not actually choose the name of the weight file to load or save. Instead, the file name is automatically inferred by the name of the skinned geometry itself. You only need to choose the folder where the weight files are saved.

Therefore it is recommended to properly name your geometries with unique names. Anyway, the script will ask for your permission before overwriting any existing file, so you should be pretty safe.

Features:

  • Load and Save weights by point number.
  • Load and Save weights by point position.
  • Works on multiple objects at the same time.
  • Summary window at the end of the process.

Installation:

Copy seithWeightTools.mel and seithWeightTools.py to your Maya scripts directory. Of course make sure you’ve added your Maya scripts directory to your Python environment variable. Which means opening your …/[Documents]/maya/2013/maya.env file and making sure that the path to the folder is present, like so:

PYTHONPATH = C:/the/path/to/my/default/maya/2013/scripts;

Then launch Maya and run:

source “seithWeightTools.mel”;

seithWeightTools;

1: The folder path frame. This is where you can see the current path (where the weight files are saved and from which they are loaded). The text field on the right allows you to quickly create a sub-directory within the current folder. At the top you’ll find a list of quick access paths that you can bookmark by right-clicking on the current path.

2: The threshold value is the spatial precision used when loading weights by point position (inactive when when loading weights by point number).

3: Save and Load weights. It’s safer to save weights using both methods, but to load weights, you need to choose either one or the other. the point number method looks at the vertex (or cv) numbers, whereas the position method looks at the position of the points in order to determine which weights make more sense.

WORKFLOW:

Again, it is good etiquette to correctly name your geometry with unique relevant names. A good method to follow would be to regularly create back-up directories by date. That way, you can keep previous sets of weight files (which is always safer than constantly overwriting them).

1- Saving Weights:

  1. Select the skinned object(s) for which you want to save the weights.
  2. Make sure the path at the top of the window points toward the correct directory.
  3. Choose the method to save the weights (probably best to always leave both boxes checked).
  4. Click the “Save Weights” button.

The weights files will be saved in the specified directory, and named with the same name as the geometry.

Again, please note that the path at the top of the window should point toward a directory (the one in which the weight files are going to be saved or from which they are going to be loaded), and not a file

2- Loading Weights:

  1. Select the skinned object(s) for which you want to load the weights.
  2. Make sure the path at the top of the window points toward the correct directory.
  3. Choose the method to load the weights.
  4. Click the “Load Weights” button.

The weights will be loaded onto the selected skins.

Don’t hesitate to drop me a mail to tell me if something’s weird with this script…
seith[at]seithcg[dot]com

  1. Nestor
    May 23rd, 2012 at 01:19 | #1

    Please could you make this for OSX?

  2. Seith
    May 30th, 2012 at 10:54 | #2

    Not having access to a Mac computer, I’ll have to answer “unfortunately, no”… :(

  3. Mark
    June 12th, 2012 at 00:09 | #3

    Hi could you give more specific instructions on how to use this script? I put the scripts in
    C:\Users\myaccount\Documents\maya\2011-x64\scripts

    Then I run Maya 2011 and typed in mel script button area seithWeightTools.mel;

    I get an error can’t find procedure I must be doing something wrong.

  4. Seith
    June 12th, 2012 at 14:22 | #4

    Hello Neo. In Maya, before you can use any MEL script you first have to source it. So you have to type “source seithWeightTools.mel; seithWeightTools;” (without the quotes of course). It sources the MEL script and then calls the main command (usually the name of the script)… :)

  5. Scott Baker
    June 30th, 2012 at 23:31 | #5

    thanks so much for doing this – it’s exactly what I need! only – tinsy little problem… I’m getting all zero byte files when I try and save the weights (Maya 2012) Because I’m working to creat something for Second Life I’m in Z-Up could that be affecting it?

  6. Scott Baker
    July 1st, 2012 at 00:02 | #6

    @Scott Baker
    nevermind I found the problem – filename too long (it gives no warning – might be nice for others to know that little gotcha)

  7. Seith
    July 6th, 2012 at 18:01 | #7

    Hey Scott, just so that I know, how long was the name?

  8. Scott Baker
    July 12th, 2012 at 16:40 | #8

    @Seith

    The Path to the weight save folder was 30 characters and the mesh names ragned between 40 and 45. I renamed the meshes to be < 10 character names and then it worked.

  9. Wilfred Greyling
    July 12th, 2012 at 20:21 | #9

    Hey Seith,
    You are a life saver. Your script works like a charm.
    Thanks!

  10. Wilford
    December 25th, 2012 at 02:28 | #10

    Seith.
    You’re the man.
    Just saved me hours and hours of work with your glorious script. Keep up the excellent work!

  11. Seith
    December 27th, 2012 at 16:02 | #11

    He he. You’re welcome.

  12. Les
    January 7th, 2013 at 00:23 | #12

    Hey Seith. I am following a gnomon tutorial on rigging and the author heavily relies on the comet tool for maya 2011. I do not believe it is supported for maya 2013. Does your tool support Maya 2013?

  13. Seith
    January 7th, 2013 at 08:43 | #13

    Hi Les. Yes, I use it with Maya 2013. Just let me know if you encounter any issue.

  14. Anonymous
    January 7th, 2013 at 18:57 | #14

    Seith. Thanks for the quick response. I am going to give it a try tonight. Ill let you know.

  15. Les
    January 7th, 2013 at 19:10 | #15

    Thanks Seith. I am going to try it tonight!

  16. Les
    January 8th, 2013 at 01:01 | #16

    Okay, I am getting an error when trying to save weights. I sent you an email and attached my screenshots. Thanks for any help you can provide.

    # Error: NameError: name ‘seithWeightTools’ is not defined

  17. michael
    January 29th, 2013 at 09:15 | #17

    # Error: NameError: name ‘seithWeightTools’ is not defined

    so do i ….what’s wrong?

  18. michael
    February 23rd, 2013 at 10:29 | #18

    coulde you make this scripts just by mel?…

  19. Seith
    February 24th, 2013 at 14:30 | #19

    @michael
    A MEL-only version would be possible but extremely slow. Therefore it wouldn’t make sense for me to try and implement that. Python is much faster. And binary C++ would be even faster of course…

  20. Arnold
    March 4th, 2013 at 19:56 | #20

    Hi Seith,
    I was just looking for the exact MEL script.
    Running into the same error:

    source seithWeightTools.mel; seithWeightTools;

    is there a step i’m missing?

  21. Arnold
    March 4th, 2013 at 19:58 | #21

    Sorry —
    the error was

    # Error: NameError: name ‘seithWeightTools’ is not defined

    pasted the wrong text.

  22. Collin Bishop
    March 23rd, 2013 at 17:45 | #22

    This tool worked great on my fp_arms when I needed to rid myself of a transform. Was able to store the value on the combined arms and delete history on the new set. You are the man…

  23. bill
    April 4th, 2013 at 01:40 | #23

    Hi Seith,

    I’ve been using your script successfully for a while now… but just today, I ran into this error while trying to save my skin weights:

    Could not save weights for “torso” –> Not a skin!

    But the “torso” geometry is definitely a smooth skin, and I can see the weights in the component editor. Can you please kindly advise?

    btw, thanks for this great tool!

  24. May 6th, 2013 at 06:45 | #24

    Hell yes! This sort of thing really should be stock, so much better than weight maps!

  25. Evan
    October 2nd, 2013 at 05:10 | #25

    I love this script. It is really fast and easy but I think it might be causing a problem when I export my rigs. Our studio has a custom tool to export rigs into our game engine and I think it is picking up an extra node in the export process. Does your script create and store any nodes in the scene? If so what is it called? Thanks.

  26. Seith
    October 2nd, 2013 at 08:26 | #26

    Hi Evan. This script does not create any node. It simply reads the weights, writes them to an external file and reads the weights back. During and after this process the scene is and remains absolutely unchanged. I’m glad you find the script useful!

  27. October 8th, 2013 at 04:53 | #27

    I am getting the same Issue as Bill. I have a mesh with a smooth skin on it but when I select the object and go to save it using your tool i get the “Could not save weights for “CatModel” –> Not a skin!” error.

    I am not sure if im doing something wrong or if i just broke it. Cause i do that. Being a character rigger i break scripts A LOT! lol.

  28. Seith
    October 8th, 2013 at 07:52 | #28

    Hi Misty. What probably happened is that you somehow renamed the shape node of transform “CatModel”, and that shape name is probably not unique in your scene. It is always preferable to let Maya automatically name the shape nodes (based on their parent transform node). And skin names need to be unique for the script to work. Please let me know if that fixes your problem or if I have overlooked something…

  29. October 8th, 2013 at 09:49 | #29

    @Seith
    Hay thanks for the reply I will defiantly check that out.

  30. Dan
    October 9th, 2013 at 09:49 | #30

    Hi,
    Thanks for posting this, couldn’t use it as I get the error # Error: IOError: 22 # when trying to save weights. Do you know what causes that? I’m using Maya 2012 64bit.
    Cheers
    Dan

  31. Dan
    October 9th, 2013 at 10:12 | #31

    It’s ok I managed to save the file. I think it was to do with the skinned object being within nested name spaces, or maybe the resulting string was too long because of that.

  32. Jimmy
    December 11th, 2013 at 19:22 | #32

    Hey Seith,

    I am hearing such great things about your tool. However, I am having some issues using it. It seems pretty straight forward, but for some reason the weights are not being transfered to the destination mesh.
    Here is my setup:
    -I have a head mesh that is skinned and weighted
    -I have a second head mesh that is skinned to the same skeleton
    -I pick the source head, make sure my path is correct, click ‘save weights’ (2 files are successfully written to the designated folder)
    -I pick the destination mesh and click Load Weights and …nothing.

    Thoughts?

    Thanks in advance!

  33. Seith
    December 11th, 2013 at 20:21 | #33

    Hi Jimmy. It’s a little difficult to say without seeing the scene itself but are you sure that the files created are valid (with real data, not empty)? And most importantly are the two head meshes named differently? SeithWeightTools only works with uniquely named meshes. It gets confused otherwise.

    In other words you should first save the weights for the properly weighted mesh, then delete it (or simply rename it) and then select the new mesh (with the same name as the files that have been saved) and click “Load Weights”.

  34. Jimmy
    December 11th, 2013 at 22:53 | #34

    Hey Seith,
    Thanks for getting back to me. Everything has a unique name…so I dont think that is the problem. It is on the same skel, so I tried saving out the weights on the one that I want, then deleting that head mesh and bind pose, then importing the new head, skinning it and apply the ‘Load Weights’ and I still got nothing.
    Would it be possible to send you my file? It is extremely simple and less than a MB.

    Thanks,
    Jimmy

  35. Seith
    December 11th, 2013 at 23:01 | #35

    @Jimmy (email sent)

  36. Jimmy
    December 12th, 2013 at 20:50 | #36

    FANTASTIC TOOL! Thanks for ALL your help Seith!

  37. Seith
    December 12th, 2013 at 22:13 | #37

    @Jimmy
    You’re welcome Jimmy!

  38. julien
    December 13th, 2013 at 17:12 | #38

    hi seith,
    first of all thanks for your tool.
    i have trouble using it with namespace…
    as it is taking the name of the object to record the weights on a file named by the obejcts name, the file is not proprely saved in windows because of the ” : ” causes by the namespace separator.
    because of that , i got 0 Ko files that are been recorded on the disk.
    i must use an spear copy of the mesh without the name space, copy skin , and then save theme to be able to make your tool work… same procedure when i have to bring back weights…
    do you have any clue to bypass this windows limitation ( not alowing to name a file with ” : ” in it ) and still be able to use your tool

    also as a new feature proposition, could be great to be able to pick another file when re importing weight… so that we are not limited to import the exact same named file as the object you want to past your weight on …

    thanks for your help and time…

    Julien

  39. Seith
    December 16th, 2013 at 13:48 | #39

    Hi Julien,
    Yes, I believe there could be a way of removing that namespace limitation. It’s there because a long time ago it was unthinkable to try and mess with weights on a referenced/namespaced mesh. But I have a very simple idea that could work…

    Picking a different weight file for importing (instead of the default same-name one) could also be done. I’ll think about it!

    Cheers,
    Seith

  40. julien
    December 16th, 2013 at 15:35 | #40

    thanks very much for your answer seith.

    looking forward for a new update so .. 😉

    cheers

    julien

  41. September 25th, 2014 at 07:24 | #41

    Hey Seith this tools awesome i use it a ton at work. thanks for your diligence.

    i tried recently to bring it home for use there and seemly went through the install correctly but i wind up getting this error

    # Error: NameError: name ‘seithWeightTools’ is not defined #

    when i try and load the weights back in. help!

    thanks

  42. Seith
    September 25th, 2014 at 07:33 | #42

    Mmh. That would seem to indicate a problem in your Python environment variable. Maya does not know where it has to look to find the seithWeightTools Python module. So you need to tweak your Maya.env file (in your Documents/Maya/20xx folder) so that it reads something like:

    PYTHONPATH = C:/my/path/folderWhereYouInstalledSeithWeightTools

  43. Angela
    November 5th, 2015 at 06:36 | #43

    Hey there,

    The script exported my weights fine, but when I tried importing them and applying them to the rig in a different file, it did nothing. It said it loaded successfully, but my character’s weights look the same as it did before weights were applied (it’s an updated file, so I’m trying to carry over my old weights to the new, re-rigged file). Looks like nothing happened. What can I do to resolve this?

    Thanks a lot!

    Ang

  44. Cesar
    November 12th, 2015 at 18:35 | #44

    Hey I am having issues getting this to work with 2016. I cannot set the quickpath and neither can I save out weights. This is the errors I am getting:

    // Error: file: c:/maya_profiles/scripts/seithWeightTools.mel line 117: menuItem: Object ‘swt_quickPath1MI’ not found. //

    # Error: line 1: NameError: file line 1: name ‘seithWeightTools’ is not defined #

    Since I have multiple versions of maya installed, I have a main “scripts” folder to reference from.

    I have also set the .env file to:

    PYTHONPATH = C:\maya_profiles\scripts;

    and I still get the same error.

  45. Cesar
    April 5th, 2016 at 19:02 | #45

    Hey I was wondering why does it take over 50 mins to save out weights in a somewhat dense human character? Is that a normal thing or something is wrong with the script?
    I am using the script in Maya 2016 for OS X

  46. deepak Adhav
    August 12th, 2016 at 04:41 | #46

    Hello

    i have run your script and when i select the skin mesh and say save weight it says

    # Error: line 1: NameError: file line 1: name ‘seithWeightTools’ is not defined

    what si missing from me ?

    mel is also properly installed becaus ei can load your seithWeightTool V5 window.

    can you reply me please
    thank you so much

  47. deepak Adhav
    August 18th, 2016 at 11:54 | #47

    Hello

    can we use this script in maya 2014?

  48. Stef
    November 22nd, 2016 at 23:31 | #48

    Hi Seith,

    awesome tools!
    I have an issue with my scene, so I decided to test your tool in a very simple scene: cylinder, 3 joints, simple. I skin the cylinder with the 3 joints and I paint weight a bit so that I can obviously see a different between the default skinning and mine. I save mine with your tool.

    Then, I delete history of the cylinder, therefore kill the skinCluster, duplicate my 3 joints chain (put both chain under a locator named differently, so that the 2 joint chains keep the same names (joint1, joint2, joint3))

    I put a skin on the cylinder but now I choose the second joint chain I duplicated, load the weight with your tool, progress bar goes to 100% and it says seithWeightsLoad ended successfully!

    BUT the skinning didn’t load because when I rotate the joints, I can see that the skinning looks like the default one. When I do all this again back with the first joint chain and load the weight, it’s all good.

    Is what I’m trying to do possible? (that is, use different bones, but all same names as the originals)

    Thanx!

  49. Seith
    November 27th, 2016 at 08:24 | #49

    Hi Stef, you stumbled upon a limitation of the tool: joint names must be unique in the entire scene. So in your case you would have to add a suffix/prefix to the joints in the first (old) group before loading the weights on the meshes in the second (new) group. Hope that makes sense! I might have a look at removing this limitation in the future (if that’s at all possible)…

  50. Anonymous
    November 27th, 2016 at 17:46 | #50

    @Seith
    Oh my god, why didn’t I tried that before! O_O
    Thanx a lot, will try this Monday!

    Cheers!

    Stephane

  1. April 2nd, 2011 at 15:14 | #1