seithWeightTools
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:
- Select the skinned object(s) for which you want to save the weights.
- Make sure the path at the top of the window points toward the correct directory.
- Choose the method to save the weights (probably best to always leave both boxes checked).
- 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:
- Select the skinned object(s) for which you want to load the weights.
- Make sure the path at the top of the window points toward the correct directory.
- Choose the method to load the weights.
- 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
Please could you make this for OSX?
Not having access to a Mac computer, I’ll have to answer “unfortunately, no”…
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.
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)…
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?
@Scott Baker
nevermind I found the problem – filename too long (it gives no warning – might be nice for others to know that little gotcha)
Hey Scott, just so that I know, how long was the name?
@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.
Hey Seith,
You are a life saver. Your script works like a charm.
Thanks!
Seith.
You’re the man.
Just saved me hours and hours of work with your glorious script. Keep up the excellent work!
He he. You’re welcome.
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?
Hi Les. Yes, I use it with Maya 2013. Just let me know if you encounter any issue.
Seith. Thanks for the quick response. I am going to give it a try tonight. Ill let you know.
Thanks Seith. I am going to try it tonight!
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
# Error: NameError: name ‘seithWeightTools’ is not defined
so do i ….what’s wrong?
coulde you make this scripts just by mel?…
@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…
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?
Sorry —
the error was
# Error: NameError: name ‘seithWeightTools’ is not defined
pasted the wrong text.
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…
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!
Hell yes! This sort of thing really should be stock, so much better than weight maps!
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.
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!
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.
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…
@Seith
Hay thanks for the reply I will defiantly check that out.
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
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.
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!
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”.
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
@Jimmy (email sent)
FANTASTIC TOOL! Thanks for ALL your help Seith!
@Jimmy
You’re welcome Jimmy!
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
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
thanks very much for your answer seith.
looking forward for a new update so .. 😉
cheers
julien
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
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
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
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.
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
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
Hello
can we use this script in maya 2014?
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!
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)…
@Seith
Oh my god, why didn’t I tried that before! O_O
Thanx a lot, will try this Monday!
Cheers!
Stephane