Congratulations! You are a March Madness BONUS BUYER!

Enjoy 10% OFF* ALL PURCHASES STOREWIDE or enjoy 30% OFF items with a SKU number lower than 16000 & 30% OFF items from Runtime DNA.

Offer valid for intended recipient only
* 10% discount DOES apply to Gift Cards and Memberships. **Items must be in cart simultaneously for discount to apply.
[ collapse ]

How to get DZMaterials in script to automatically change opacity?

edited December 1969 in New Users

I'm trying to write a script that will automatically make the red DAZ Skeleton helper materials invisible during a render and then visible again after the render.

How do I do this? I'm unable to get the DZMaterials because the static DzMaterial.getMaterial() function does not appear to exist?

 for(n=0; n

TypeError: Result of expression 'DzMaterial.getNumMaterials' [undefined] is not a function
TypeError: Result of expression 'DzMaterial.getMaterial' [undefined] is not a function

How should this be done?


  • edited June 2013

    It looks like the docs are wrong and there is no static DzMaterial.getMaterial() but you can get it using a dummy object:

     var mat=new DzShaderMaterial(); 
     for(var n=0; n

    However, I still can't find the 'Helpers' material in that list. Here's what it prints for my scene, I can't tell which are the skeleton helpers and which are not:

    0 material=DAZ Studio Default
    1 material=Brick Material
    2 material=AoA_Subsurface
    3 material=DAZ Default Material
    4 material=AoA_Subsurface
    5 material=AoA_Subsurface
    6 material=AoA_Subsurface
    7 material=AoA_Subsurface
    8 material=AoA_Subsurface
    9 material=AoA_Subsurface
    10 material=AoA_Subsurface
    11 material=AoA_Subsurface
    12 material=AoA_Subsurface
    13 material=AoA_Subsurface
    14 material=AoA_Subsurface
    15 material=AoA_Subsurface
    16 material=AoA_Subsurface
    17 material=Custom
    18 material=Custom
    19 material=Custom
    20 material=Custom
    21 material=Custom
    22 material=Custom
    23 material=Custom
    null material

    How can I sort out which is the right material?

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