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.

  • chris the strangerchris the stranger Posts: 132
    edited December 2019

    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:

    objTextField_SpriteName,objTextField_Action, objRadioButton_FaceDirectionLeft, objRadioButton_FaceDirectionRight - All of these are for creating the output file name.

    objRadioButton_Animation, objRadioButton_SingleFrame - Single render or series?

    objTextField_StartFrame, objTextField_EndFrame - Frame to start on and end on.

    objDropDownList_Camera - Dropdown list of all cameras found in scene (Populated when script is launched)

    objCheckBox_RenderOppositeDiection - If this is checked, the procedure will run a second time, with a few variations.

    objLightingTab - Collection of GUI elements that provide instruction for each render.

    • objCheckBox_Bypass - If checked, this render is skipped.
    • objCheckBox_Greyscale - Makes output image a greyscale image...somehow.
    • objDropDownList_Light - Selects scene light to use for this render.
    • objCheckBox_UseAlternateMaterials - enables objDropDownList_Materials, which then...
    • objDropDownList_Materials - A collection of base figures from scene (Typically Genesis people).

    objButton_TargetOutputDirectory - Save path.

    objButton_SaveSettings, objButtonLoadSettings - Not too concerned about these for the time ebing, but I'll probably store GUI data as JSON.

    objButton_Execute - Begin rendering!

    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.

    GUI_Mockup.png
    720 x 640 - 14K
    Post edited by chris the stranger on
  • 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.

Sign In or Register to comment.