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

On Saturday, 23 August 2025 at 18:25:44 UTC+2 Matin Falahmanesh wrote:

> 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!

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/python_inside_maya/2d64eaa7-345f-4182-91e0-0a484d195134n%40googlegroups.com.

Reply via email to