Setting OpenGL render engine in a script

Hi, I'm new for DAZ. I found that the rendererList doesn't contain OpenGL. And I want to render a image by OpenGL and Iray.  Because of the lack of OpenGL, now I must save two Scene files, one for Iray and another for opengl. Is there a simple way to change Iray to OpenGL in a scene using script?

var oRenderMgr = App.getRenderMgr();var oRenderList = oRenderMgr.getRendererList()for(i=0;i<oRenderList.length;i++){	print(oRenderList[i].getName())}/* outputNVIDIA Iray3DelightScripted 3Delight*/

 

Comments

  • algovincianalgovincian Posts: 2,576
    Xiaojing said:

    Hi, I'm new for DAZ. I found that the rendererList doesn't contain OpenGL. And I want to render a image by OpenGL and Iray.  Because of the lack of OpenGL, now I must save two Scene files, one for Iray and another for opengl. Is there a simple way to change Iray to OpenGL in a scene using script?

    var oRenderMgr = App.getRenderMgr();var oRenderList = oRenderMgr.getRendererList()for(i=0;i<oRenderList.length;i++){	print(oRenderList[i].getName())}/* outputNVIDIA Iray3DelightScripted 3Delight*/

    You could Save As a Render Settings Preset, and then merge that preset into the scene via your script:

    var oContentMgr = App.getContentMgr();
    oContentMgr.openFile("your-render-settings-preset.duf", true);

    HTH.

    - Greg

  • XiaojingXiaojing Posts: 14

    Thank you!

    I found the code 

    	// Set the render type to 'Basic OpenGL'; aka 'ScreenShot'	oRenderOptions.renderType = DzRenderOptions.ScreenShot;

    You helped me again!  I truly appreciate your timely help.

  • XiaojingXiaojing Posts: 14
    Xiaojing said:

    Hi, I'm new for DAZ. I found that the rendererList doesn't contain OpenGL. And I want to render a image by OpenGL and Iray.  Because of the lack of OpenGL, now I must save two Scene files, one for Iray and another for opengl. Is there a simple way to change Iray to OpenGL in a scene using script?

    var oRenderMgr = App.getRenderMgr();var oRenderList = oRenderMgr.getRendererList()for(i=0;i<oRenderList.length;i++){	print(oRenderList[i].getName())}/* outputNVIDIA Iray3DelightScripted 3Delight*/

    You could Save As a Render Settings Preset, and then merge that preset into the scene via your script:

    var oContentMgr = App.getContentMgr();
    oContentMgr.openFile("your-render-settings-preset.duf", true);

    HTH.

    - Greg

    Thank you for your answer! You provided another soultion for me. 

Sign In or Register to comment.