Apply uber shader to a surface by script [Solved]

Hi,
I was wondering if there is a way to convert a surface to an IRAY Uber shader by script...
Post edited by meipe on
You currently have no notifications.
Hi,
I was wondering if there is a way to convert a surface to an IRAY Uber shader by script...
Licensing Agreement | Terms of Service | Privacy Policy | EULA
© 2025 Daz Productions Inc. All Rights Reserved.
Comments
DzMaterial supports .select( Bool ) so that should enable you to seelct materials on seelcted nodes to target with a Shader preset. You might want to look at http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/samples/material/select_by_tag/start since there seem to be a number of wrinkles to allow for (remembering the CC3.0 by attribution licnese if you use it to develop something you will distribute).
Thank you! So I would either have to select the materials by script as you suggest and manually load a shader preset on them, or iterate on the materials and make the script load a shader preset I guess.
Yes, I would assume use the script to load a preset (DzContentMgr). It is possible to apply a shader through script - before DS 3 presets were scripts, though more and more of their function was integrated into the application to simplify the actual code as I recall (and to improve prformance and separate data and code - which was explained at the time - so that the data became independent of Daz Studio to an extent - which then led to the DSON format which is documented so that other applications can be enabled to read it).
It works, thanks. I made the script select the materials on the active figure, then I injected the shaders:
var aDUF = getPath("/Scripts/MyShader.duf");
if ( aDUF )
return App.getContentMgr().openNativeFile( aDUF, true );
I assume that is just a test path - ideally the presets would go in a product folder under Shaders or the like (or whatever suits your product arangement) - especially if there might be occasions for users to apply them directly.