I have a plugin that creates instances in a vrscene via VRaySceneModifierInterface, The instances reference shaders that where present in the scene BEFORE preRenderBegin (in maya scene). It works fine with “standard” render, however when i use IPR, it crashes as soon as i change any value (diffuse amount., etc..) in the referenced shaders.
I suspect that changing shader values cause the shader to ‘recompile’ to another memory location (that’s the case in my tests).
I use DefPluginParam to store plugin pointers. Am i doing something wrong or Is there any mechanism that i could use to update my references when they become obsolete, like it’s the case for ‘standard’ geometry in maya ?
I still don’t have a solution to my problem… If anyone can give me some clues… We’re in production right now so i need to know if there’s something i can do or if i have to find other solutions…
Your suspicion is correct. In IPR, when some plugin parameter changes, the affected plugins are re-exported again, possibly to a new memory location.
Have you looked in the installation folder, there is a scenemodifier_test.cpp file (samples/vray_plugins/scenemodifiers/vray_scenemodifiertest/scenemodifier_test.cpp). Maybe you will find some examples there. If not, let us know.
Hi !
Yes i also tested VRayRunTimePluginCreatorInterface as in ‘scenemodifier_test.cpp’, but it didn’t help… The setFactory method was called as expected, but the getCreatedPluginsList was never called, could it explain why it didn’t work (i suppose this list gives VRay a way to update pointer parameters on created objects) ?
Thanks!