Automating multiple renders
I'm just getting started with daz scripting; as in, looking at the available documentation and wishing there were more resources out there that could help. I may be able to develop this myself, if I dedicate a lot of time learning the ins and outs, but that would be quite the deviation for me. I'm willing to pay for assistance with this aspect of the project, but be warned, I'm pretty poor.
What I'm ultimately trying to accomplish, is a script that will render a scene with a single animated character into a series of images, but multiple times under different lighting setups and material properties. Here's a condensed description of the procedure:
This process uses Scripted 3Delight, LineRender9000, and AgeOfArmour Directional and Ambient Lights, and Visual Style Shaders
- Every frame of animation needs to be rendered seven times.
- The first five renders use a single, unique AoA directional light for Right, Top, Left, Bottom, and Front.
- The final two renders use an AoA ambient light; one with Diffuse Only set in Illumination, one with Specular Only.
- As an aside, it would save more time if I could render these directly to greyscale images, or run a post-processing script that does that.
- When performing the renders for directional lighting, the main model uses what materials are loaded into the scene.
- The ambient lighting render should use a set of Visual Style Shaders in place of the original materials. These will be stored on a duplicate, hidden version of the figure.
There may be methods of condensing this process. If there is a way to perform Normal and Depth renders using Scripted 3Delight, that would eliminate the need for the first five directional lighting renders (would potentially add more materials to swap through).
I know it's possible to create different scenes for each lighting/material condition, and then render them separately. I'm inclined to avoid doing this as a long-term solution due to the additional time, effort, and potential for minor inconsistencies that could arise from maintaining seven separate scenes. Some have recomended products for rendering queues or batch rendering. Of the two I looked at in the Daz store, one said it did not support animation/series renders, the other said it only worked for Iray.
I'll have a more detailed view of the project in the next post.
Comments
Are you wanting hekp in writing this yourself, or are you looking to commission someone to write it for you? For the latter this sub-forum would not be the correct place.
I'm no stranger to GUI development, and since it helps greatly in the planning process, I decided to create a mockup for the system:
Pseudo-nomenclature:
Intended output:
Seven image files for each animation frame, stored in "PATH" and following the specific naming convention: SpriteName + '-' + Action + '-Facing' + FacingDirection + '-' + FrameNumber + '_' + LightProfileString.
SpriteName and Action come from the two top text fields' vaule. FacingDirection is set based on which of the two radio buttons is selected (Or maybe I pull it directly from their name). FrameNumber is an int eger that counts each iteration starting at 1 (So that if my starting frame for a particular animation is 30, it doesn't save as "BLAH-BLAH-BLAH-30_BLAH.png"). LightProfileString designates whether it's the left, right, top, bottom, front, diffuse or specular render.
That Opposite Direction Checkbox
When the process finishes, FacingDirection will change, and the process will repeat to render the other side of the figure. The easiest way to do this might be to rotate the model by 180 degrees, though I suspect that a mere rotation of the base figure is going to carry through for the rest of the animation. I either have to rotate every single frame, or find what controls the orientation of the figure in the animation and change that value. Still, I think I'd rather do this, than rotating the camera in use 180 degrees (and the front light), and then swapping the designation for Right and Left.
Greyscale
Hmm....
Use Alternate Materials
If I have a separate, identical but hidden model of the character with all of the appropriate materials...perhaps I shouldn't worry so much about 'How to copy and apply every shader and texture from Model B to A,' and instead just hide model A and amke Model B visible. The only problem being, I'd have to make sure that Model B has identical animations for every single frame, which could be inefficient. If there is a (convenient) way to copy and apply every shader and texture from Model B to A, it might be better to go that route.
Execution
The meat of the application, and perhaps a good place to start at. What I ultimately need, in order to get this to work, is a function that tells Daz Studio:
Render this scene, on this frame, using Scripted 3Delight and LineRender9000, and name it this very specific way.
Then I loop it a whole bunch.
Using the default Image Series render option isn't viable, since it tacks the frame number onto the end of the file, but in order for this to work the order absolutely matters. The _Left, _Right, _Etc has to be at the end.
Closing
I do intend to take this on myself, but with no Daz scripting familiarity, I will undoubtedly have a lot of questions along the lines of "How do I do this, but in Daz Script?" But I've made GUIs in MATLAB, so this may not be the most masochistic task I've taken. Would definitely appreciate help along the way, and of course...
@Richard Haseltine - Noted. Please point me to the appropriate venue if I don't find sufficient help here, or find the task too overwhelming.
Think I found a good script that'll help get the ball rolling: https://www.daz3d.com/forums/discussion/38514/multi-pass-rendering-script-freebie-for-daz-studio
It's remarkably legible, and gives me a good picture of how the 'Getters' work. I think the material swapping will be the most pain-inducing part.
Just a brief update: I've managed to hardcode what I need for this very specific process. If I ever make changes to the procedure, I'll have to change the script - I can live with that.
However, I've been thinking about extending the scope of this into a broader application. Sort of an all-purpose, multi-pass rendering management system, It'd still be usable in the spritification process, but would also provide a lot of control for users interested in doing image compositional work. I'll likely start a new thread for this once I've made enough progress in programmatically generating the UI, and also come up with a more clever acronym.