Community
Maya Animation and Rigging
Welcome to Autodesk’s Maya Forums. Share your knowledge, ask questions, and explore popular Maya animation topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

export deformer weights

3 REPLIES 3
Reply
Message 1 of 4
adamaka
389 Views, 3 Replies

export deformer weights

Hi everyone,
I’m trying to export deformer weights(via the menu: deform-export weights, and also the python command deformerWeights(). This works fine for deformers that are effecting only one object, however if I want to export the deformer weights of a lattice which is effecting for example sphere1 and cube1 (see image below) the data exported for both objects is from sphere1. This appears to be determined by whichever object is at index 0 in the deformer attributes table.
I've even tried a convoluted script which temporarily detaches all other objects from the deformer, which allow most data to be exported(mesh name, attributes etc) however there's still no way of exporting the actual weights, as if I re-order the connections in the node editor (disconnect from index 1 and connect to index 0) all weights are reset to a value of 1.0.
I'd really appreciated if anyone has advice on an elegant solution as I'm struggling to have a fully procedural rig system without being able to successfully export the deformer weights data.
many thanks,

Adam.

3 REPLIES 3
Message 2 of 4
mcw0
in reply to: adamaka

If all you care about is exporting the weights.  And obviously reimporting the weights at another time.  Then why not write your own export/import script?  I did this years ago before knowing much about scripting.  And it still works to this day.  Just use the "percent" command to query the weights and write it to a file constructing the "percent" command to execute on import.  That's what I did.  I'm sure there are more elegant ways to do this now with Python/json.  But it was only Mel and that was the extent of my knowledge at the time.

PS.  This is relative slow compared to the aforementioned Python/json approaches.  But there's a fascination for me at least in watching commandlines scroll across the screen "Hollywood Hacker-style" that I like.  I use "evalEcho" for that very purpose.  LOL

Message 3 of 4
adamaka
in reply to: adamaka

Hi @mcw0 many thanks for your reply, yes  this is the conclusion I came to also, I was just wanting to check I wasn't missing something using the deformerWeights() command. Maybe autodesk will update the command at some point!
The "percent" command is indeed available through python and as with lattices I want to store which vertexes are effected, lattice resolution, position, attributes etc along with the weights it makes sense to write a tool instead of appending to the deformerweights() xml file Ias I was attempting. Thanks for the speedy reply 🙂

 

Message 4 of 4
adamaka
in reply to: adamaka

The temporary solution I've gone with is exporting deformer weights with the percent command using the same xml formatting that is used for the deformerWeights export. I then use deformerWeights for import as I found on high resolution geo looping through each vertex using the percent command to be incredibly slow. This works fine but seems quite convoluted so will be happy if there's a more elegant solution out there that I'm missing 🙂

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report