A script to render many - unrelated - scenes (not animation)

As I guess many of you experience, DAZ iRay renders take a long time. I am VERY knew to DAZ scripting, but very experienced in coding.

What I would like to create is a script, which takes as input a set of scenes - from a folder or pop-up window, whichever is simpler - and opens each one, renders, saves, goes to next and repeat, until all images are done.

This basically saves time for rendering. This is not for an animation. the images could be completely unrelated.

Is there something ready I can use ? Or any hints on how I should start ? Or any other method I am overlooking that already exists in DAZ ?

Comments

  • djigneodjigneo Posts: 283
    edited September 2015

    I suggest starting with the excellent Multi-pass rendering script freebie, because that has the logic to kick off a render from code. 

    To open files, check the Load a DUF preset thread.

    To get a list of files in a directory (this code snippet was snagged verbatim from somebody else, so don't credit me):

    // returns Array object of filenames in specified directoryfunction GetFilesInDirectory(sDirectory) {	 	var myDir = new DzDir( sDirectory ); 	var aFiles = new Array;	if ( myDir ) {		 		 // get the list of .duf files it holds using 		 // the entryList function to look for .duf files (not folders etc.) 		 aFiles = myDir.entryList( "*.duf" , DzDir.Files ); 	} 	for (var i = 0; i < aFiles.length; i++)	{		aFiles[i] = String("%1/%2").arg(sDirectory).arg(aFiles[i]);	}	return aFiles;}

    That should give you all the big pieces. I should be able to help further if you get stuck anywhere. Interested to see / hear what you come up with!

     

    Edit: The other path you could take is looking into rendering out to RIB files and using a standalone rendering engine for the actual image creation. That would also open up opportunities to distribute the workload among multiple computers and other things, depending on the renderer. May be worth investigating if you have hardware.

    Post edited by djigneo on
  • Thanks djigneo for the reply. You set me in the right path I get. Will also investigate standalone rendering :)

  • Thanks to some nice people around and the guidance I got, here is the final version of the script in GITHub, which includes the original multi-renderer (commented out).

    https://github.com/misterg123/DAZ3D-Scripts

  • jag11jag11 Posts: 885

    Nice. Thx.

  • djigneodjigneo Posts: 283

    Nice. Looks good! Glad you got it working.

Sign In or Register to comment.