My goal here is to render out a multi part exr with layers in a roto node as layers in the exr output file.
Is this possible with the approach i mentioned?
Have you looked in resources/scripts/tools/renderer.py? That contains the entire rendering loop for a typical Silhouette render, including managing of Multi-Part output nodes.
Basically you create an EXR output module, create the file, and call module.putImage() multiple times, each with a different “part” name.
Look for “for part in output.parts:” in renderer.py to see how Silhouette does it.
Thanks! I have now managed to create the multi part node and managed to add some inputs but looks like i am doing something wrong when i try to add the code to actions.
I am referring to the actions “LayersToSeparateFiles” and similar ones for help but even when i create a new class inheriting actions, and have the execution code in the execute function, i can see the option being added to the actions but cant seem to launch a ui from there.
The code executes but does not launch a new custom gui .
I am using a QMainWindow instance, maybe this is causing issues?
I was actually trying to avoid that since i may have to modify how we are using some similar tools in different DCCs.
Will try a few different things and see if i can get it working without having to use QDialog.
Would dock serve better if i just happen to attach a custom widget into a new dock?
I am trying to avoid that way as of now but maybe a valid other option instead of popping new window.
Its just that i will have to destroy the dock when i am done with the tool since its possible for someone to click multiple times by mistake and trigger multiple jobs.
Okay so here is what I found to be a good middle way.
Dock worked fine but most of the team didnt like that method. so i went with the QDialog.
And actually sticking in a QMainWindow instance inside a QDialog worked fine and was exactly what i was look for.
For someone trying to find another way, here is what i did -
Created action menu which triggers a QDialog instance.
In this QDialog, i used my QMainWindow instance which worked out very well.
Just that it disables the main silhouette window while using the tool which is fine, in fact its even better for me.