If there isn’t functionality for this natively, which I’d think not due to how it probably wouldn’t work that well with playback, then there is at least two things that I’d try.
1. Add a live boolean to your node. When False, then you could bypass updating of the plug. That way, it’d be up to the user to decide whether to recieve updates directly, or on demand. It isn’t quite as nice as an update *button*, but nearly. And with a little logic, you could possibly set it up to automatically False itself when turned into True. 2. On update, start or reset a timer. A timer of e.g. 1 second could, once triggered, cause the plug to update. That way, during playback or general interaction, the only overhead is that of creating or restarting an existing timer. Then, once the user has let go or Maya is idle, the timer would trigger, causing your mesh to update. (2) wouldn’t play nicely with playback, as it would just constantly keep resetting itself. However, again with a little logic, it’s possible you could have the timer not reset when the change is coming from playback, as opposed to an attribute change or something from any context. (1) I’ve worked with before on the artist side and has worked well, though it’s been for e.g. whether or not to use multi-threading or whether to enable some effect like vertex colors. I’d expect it would work similarly with what you’ve got in mind. On 4 March 2018 at 00:02, justin hidair <[email protected]> wrote: > > Let's say I have a Node which has an input mesh and an output mesh , > everytime I move the input mesh , while I move it, compute() is called > probably 15 times and the output is updated also 15 times, > That's great and all but what If I don't want continuous update ? > > what if I want to move the input mesh from A to B , and only when it's at > B, and I stop moving it, output will update ( so 1 call to compute() ) > is there a way to do that ? > is the time between the total change of the input and the call to > compute() as a name or a concept in the API ? > See this is important , because it allows to reduce overhead significantly > , increase performance on complex calculations ...Etc. > > -- > 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 on the web visit https://groups.google.com/d/ > msgid/python_inside_maya/234585c5-6c53-45d6-bb7d- > 9909ae263cd0%40googlegroups.com > <https://groups.google.com/d/msgid/python_inside_maya/234585c5-6c53-45d6-bb7d-9909ae263cd0%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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 on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFRtmODXczpxYCBxvSrs8OU6hfCYh5kig2fjZ-PCj0mSZSb5Wg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
