Pause for clothing fit before render - found solution
Note: I found a solution that works for me on this issue. I've included it for other people's reference below...
Hello, I've written a script using the IDE in Daz 4.5 rc2. I've generally got it doing what I want. I load some lights and then a character, load a pose, then I render the scene. The problem I'm running into that I haven't been able to figure out (and not really sure where to explore further at this point) is that when the character is posed, the clothing starts to adjust, but before it can finish adjusting the render starts, so my output png has the clothing messed up.
I need to do one of the following
1. pause the script for X seconds before rendering, to give it time to adjust
2. detect when the clothing is finished adjusting and then trigger a render
3. set a renderer preference to not render until the scene is stable and all the clothing has properly adjusted
4. something else I haven't thought of
I appreciate how busy folks at Daz are right now, so very much appreciate any help I can get on this. Any approach I can make work.
Thanks!
Tom
Solution: I found the Progress example. I put in a progress bar that is long enough for character's clothes to autofit, which worked for me
Also, I have a couple other related things to mention for reference (not complaining, but thought I would mention so folks like myself can do more to figure things out)...
For reference, I wanted to look through the examples at
http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/samples/start#rendering
to see if I could find anything to help (and with other issues I run into) but when I click on many of the links I get
Page Not Found
perhaps some links have been broken
Also, I went to the old forums to search there, figuring I might find a clue or answer, and when I try to search on the old forums
http://forumarchive.daz3d.com/viewforum.php?f=60
I can't search there, though - when I try to search I get an error
Could not delete old search id sessions
DEBUG MODE
SQL Error : 1142 DELETE command denied to user 'forumdml'@'10.4.1.247' for table 'phpbb_search_results'...
relevant code I'm using...
var cbContentManager = App.getContentMgr();
// clear the scene
Scene.clear();
// load the lighting and shadow base
cbContentManager.openFile (cbLightScene,true);
// nodes for the shadow plane and the light
var cbPlane = Scene.findNodeByLabel( "Plane" );
var cbLight = Scene.findNodeByLabel( "Light" );
// turn plane and light off
cbPlane.setVisible(false);
cbLight.setVisible(false);
// set camera
cbCamera = Scene.findNodeByLabel( "CB Camera" );
cbCamera.setWSPos (cbCameraPos);
cbCamera.setWSRot (cbCameraRot);
// load the character
cbContentManager.openFile (charPath,true);
// find the main character node
var cbCharacter = Scene.findNodeByLabel("alien");
// make sure character is selected
cbCharacter.select(true);
// load the pose
cbContentManager.openFile (posePath,true);
// Set file name to render options
var cbRenderMgr = App.getRenderMgr();
var cbSettings = cbRenderMgr.getRenderOptions();
cbSettings.renderImgFilename = cbOutFolder+cbSuffix+".png";
// need to pause here - add progress example for a pause
// Declare the total number of cycles
var nCycles = 100000;
// Declare how frequently you want to update the progress
var nFrequency = 100;
// Start the progress
startProgress( "This is a simple progress test.", nCycles/nFrequency, true, true );
// Iterate over the total number of cycles
for( var i = 0; i < nCycles; i += 1 ){
// If the iteration is divisible by the frequency, with no remainder
if( i%nFrequency == 0 ){
// Step the progress by 1
stepProgress( 1 );
}
}
// Finish the progress
finishProgress();
// Render
cbRenderMgr.doRender();