Precomputation in a custom Node/Deformer

46 views
Skip to first unread message
Assigned to matiinfa...@gmail.com by me

Matin Falahmanesh

unread,
Aug 23, 2025, 12:25:44 PMAug 23
to Python Programming for Autodesk Maya
Hi guys!
I’ve been developing a deformer in C++, and I have a workflow question before moving forward. i need to precompute a very large matrix (a Beltrami Laplacian) and some additional custom attribute data, but this should only happen once when the user clicks on something like "compute" in the deformer’s attribute editor.

I’m not sure about the best way to do this. I was thinking about using a custom attribute (I already have quite a few) and store the Eigen matrix there along with the other data, though I’m not sure how I’d handle readASCII readBinary in that case with Eigen.

Another option is to save it as a file alongside the Maya scene file, like xgen legacy does, but I feel like there might be a more Mayaish way to handle this.

Keep in mind, it’s not just the large matrix, there are multiple custom attributes as well.
If you guys have any suggestions or ideas, I’d really appreciate your input.
Thanks!

justin hidair

unread,
Nov 27, 2025, 9:38:10 AM (9 days ago) Nov 27
to Python Programming for Autodesk Maya
you make a keyable attribute, you expose it as a button with attribute editor templates, 
once the user click, the node's compute() is called, you check that the call comes from this attribute, you make a boolean member variable on your class, set to false at first 
and if it's false you make your matrix and set it to true in the same if block
otherwhise if it's true, you dont redo the matrix,  it's just simple caching

Reply all
Reply to author
Forward
0 new messages