Image saved as "r"

Hey,

does somebody know why this script saves the image in my temp dir with the name "r" instead of "mytest.png"? cool

 

    (function(){    	var renderManager = App.getRenderMgr();         	var renderOptions = renderManager.getRenderOptions();		renderOptions.RenderImgTarget = renderOptions.DirectToFile;		renderOptions.renderImgFilename = "mytest.png";		renderOptions.applyChanges();		renderManager.doRender()    })();

 

Comments

  • SimonJMSimonJM Posts: 5,982

    I seem to recall that the temporary file saved by DS is called r.png, so until you actually do a 'save as' your save name wil lnot be applied.

  • jag11jag11 Posts: 885
    edited March 2018

     

    This line:
    
    renderOptions.RenderImgTarget = renderOptions.DirectToFile;
    
    ​should be:
    
    renderOptions.renderImgToId = renderOptions.DirectToFile;
    
    because the doc states:

     

    RenderImgTarget renderImgToId

    RenderImgTarget is an number with three possible values.

     

    Post edited by jag11 on
  • Hurdy3DHurdy3D Posts: 1,047
    edited March 2018

    Hey nice, this did the trick....

    so everything which is under Enumerations is a number.

    renderOptions.RenderImgTarget  = 3;

    worked and

    renderOptions.renderImgToId = renderOptions.DirectToFile;

    worked, too.

    Thank you for your help.

    But the scripts complains now about:

     

    Executing Script...QMetaObject::invokeMethod: No such method DzImageRenderHandler::getViewRenderHandler()Result: Script executed in 61 secs 321 msecs.

     

    Can I ignore this error?

    Post edited by Hurdy3D on
  • jag11jag11 Posts: 885

    No error or warning should be ignored, something might be missing, maybe if you post a streamlined version of the code could give us an idea.

  • Hurdy3DHurdy3D Posts: 1,047
    edited March 2018

    The complete code is

     

        (function(){    	var renderManager = App.getRenderMgr();         	var renderOptions = renderManager.getRenderOptions();		renderOptions.renderImgToId = renderOptions.DirectToFile;		renderOptions.renderImgFilename = "D:/render.png";		renderOptions.applyChanges();		renderManager.doRender()    })();

    It is not very complex, this are my first steps in daz scripting wink

    Post edited by Hurdy3D on
Sign In or Register to comment.