Efficiently updating preview on changed input
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi everyone,
I am currently running into the following problem:
I am working on an addin where I am building up a model "incrementally" based on the state of the inputs.
However, based on the way the executePreview handler is working, I have to rebuild the whole model even if there is only a minor change due to changed input.
As parts of my model can have significantly complexity the executePreview event takes too much time to use the addin in a pleasant way since the whole model needs to be recreated every time.
To give an example which might make my problem a bit more understandable:
Assume an addin with N checkboxes, where each checkbox corresponds to a different and highly complex body being created.
If I now check one more checkbox I have to rebuild all the bodies of the previously selected checkboxes, although actually I would have to build only one more body.
I am wondering if there is a more efficient way to preview the current state of the model without deleting it on every update.
Until now I only found a workaround calling the
command.doExecute(False)
method from the input changed handler which, I guess, is not the intended use case for this method. The problem with this workaround is that it apparently crashes Fusion from time to time (due to different handlers being active on the same time ?).
It would be nice to hear if anyone has a solution to this or if this can be seen as a limitation of the Fusion API.
Thanks 🙂