RenderPlugin, changing its parameters from another plugin, do I need to use Lock?

alexisDVJML
Collaborator Collaborator
272 Views
2 Replies
Message 1 of 3

RenderPlugin, changing its parameters from another plugin, do I need to use Lock?

alexisDVJML
Collaborator
Collaborator

I have a RenderPlugin that use settings that are changed by my main plugin.

Wondering if I need to put in place some mechanism (aka lock pLockObject) to ensure I'm not rendering while the settings are ongoing changes?

 

Having to put lock is feasible but make the code more complex + slow down the rendering if I need to lock on Render/Overlay method entry.

 

So, provided the changes are done in my main plugin in response to a command, could I safely assume the Renderer Overlay/Render methods will not be called during that time?

 

Thanks in advance.

Main Scientist, Full Stack Developer & When Time Permits Director of IDIGO ► On your marks, Set, Go
0 Likes
273 Views
2 Replies
Replies (2)
Message 2 of 3

tetsuya_miwa
Advocate
Advocate

Add one bool variable to control render plugin to work or stop.
Adding simple if condition does not cause slow down issue.
https://forums.autodesk.com/t5/navisworks-api/call-render-plugin-through-addinplugin/td-p/9430718

0 Likes
Message 3 of 3

alexisDVJML
Collaborator
Collaborator
That's actually what I did, but using Interlocked.XXX just in case 😉
Thanks for the suggestion and the link.
Main Scientist, Full Stack Developer & When Time Permits Director of IDIGO ► On your marks, Set, Go
0 Likes