Render to RIB via script

Hello all,

I had originally posted this in the "old" forum, (I've been away for a bit so I guess I've missed the opening of the "new" forum).

Judging by the fact that I can't see that post on the new forum, I'm not sure how long it'll be there.


* Daz3D
* Windows Vista

I've been able to write scripts that create Lights, move cameras, render to an image file after moving a camera, etc etc.

But I haven't been able to figure out how to render to a RIB file via a Script.

I have seen the "RenderToRib" file that comes with the DEV Kit, but am thinking it's from an older API. (It generates errors when trying to tweak it.)

Anyone know how to programmaticaly render to RIB via Script?



Post edited by 3DRenderMonkey on


  • 3DRenderMonkey3DRenderMonkey Posts: 6
    edited June 2012

    Anyone from the DAZ3D Staff help me out here?

    The answer could mean life or death for billions of Z'aarthians waiting for a response.


    Think of the Z'aarthians.

    Post edited by 3DRenderMonkey on
  • 3DRenderMonkey3DRenderMonkey Posts: 6
    edited December 1969

    Thanks Richard.

    That looks like the "RenderToRib" file I was mentioning, but I'm going to have a look anyway as I'm not 100% on that...

    I'll update this Thread with what I find.


  • rbtwhizrbtwhiz Posts: 1,394
    edited December 1969

    If I don't respond... its usually because I'm swamped.

    The names of the application settings used by the Render To RIB example for DAZ Studio 4.5...

    var g_sRenderRibKey = "RenderToRIB";
    var g_sRibPathKey = "RIBFilename";
    var g_sKeepShadowsKey = "RIBKeepShadows";
    var g_sCollectAssetsKey = "RIBCollectAll";
    var g_sProgressiveRenderKey = "ProgressiveRender";

    ... differ from those used by the renderToRIB sample included with the DAZ Studio 3 Script Development Kit documentation...

    const g_sRIB_PATH_KEY = 'ribPath';
    const g_sKEEP_SHADOWS_KEY = 'keepShadows';
    const g_sCOLLECT_ASSETS_KEY = 'collectAssets';

    ...which is actually a DAZ Studio 2 script that is converted upon load (because the sample is still a .ds using DAZ Script 1 syntax) to...

    var g_sRIB_PATH_KEY = "ribPath";
    var g_sKEEP_SHADOWS_KEY = "keepShadows";
    var g_sCOLLECT_ASSETS_KEY = "collectAssets";

    The DAZ Studio 2 version also uses a boolean toRib application setting that isn't defined with the globals where the DAZ Studio 4.5 version uses g_sRenderRibKey (RenderToRIB).

    A string dump of the dzdelightrenderer plugin included with DAZ Studio reveals that it is using the same setting names used by the DAZ Studio 4.5 example. Unfortunately, replacing the DAZ Studio 2 sample names with the DAZ Studio 4.5 example names doesn't cause it to suddenly work. I don't have the DAZ Studio 3 source handy to investigate why or when it might have changed.

    I noticed it wasn't working in DAZ Studio 4.0, back in April while I was working on something else, so I fixed it in DAZ Studio 4.5. I posted the updated example just the other night while posting some other rendering related samples.


  • 3DRenderMonkey3DRenderMonkey Posts: 6
    edited December 1969

    Thanks for the input, Rob.

    I've managed to make some good progress, but will be calling it a night. All reverse-engineering and no sleep makes Jon a dull boy.

    After I got past the 3.0 issue with the "class" code, (the issue I was having in Jan 2012, old forum post):

    class DsSettings{... etc etc
    class DsInterface{... etc etc

    I guess my IDE doesn't like "class" as it was throwing errors, so I converted each "class" to:

    function DsSettings() {... etc etc
    function DsInterface() {... etc etc

    With a few other tweaks I was able to get the script to render to file, (no errors in the IDE this time), but it kept churning out JPG files in my:

    C:\Users\jondcruz\AppData\Roaming\DAZ 3D\Studio3\temp\RenderAlbumTmp


    Looking at the script, that's the default directory that is setup from the "App.getTempPath()" value.

    I had a look at the Version 4.0 script that you posted and found it pretty much does the same thing as my 3.0 alterations, but following "better practices".

    So I started to use that script and came to the same result, successful renders to the

    C:\Users\jondcruz\AppData\Roaming\DAZ 3D\Studio3\temp\RenderAlbumTmp

    directory, but this time of PNG type.

    Where I left off tonight is on/around Line 416 of the Version 4.5 file:

     // Adjust the render options
     oRenderOptions.renderType = oRenderOptions.Software;
     oRenderOptions.renderImgToId = oRenderOptions.DirectToFile;
     oRenderOptions.renderImgFilename = sRibPath + ".png";
     oRenderOptions.showPreview = false;

    I see that "PNG" is being set there.

    Taking it out and I get the attached screenshot.

    I'll be continuing my work tomorrow. Thanks again for the help.


    481 x 137 - 16K
Sign In or Register to comment.