Quantcast
Channel: Daz Script Developer Discussion - Daz 3D Forums
Viewing all articles
Browse latest Browse all 1036

Setting Simulation Properties Under the Surfaces Tab Via Script

$
0
0

The following code is an old snippet that I've used in the past to set material properties. In this case, it never enters if( prop ), but works fine if I change "Dynamics Strength" to "Opacity Strength".

Anybody know if simulation properties under the surface tab need to be set a different way than normal material properties?

Thanks in advance if anybody knows.

- Greg

 

var nodes = Scene.getSelectedNodeList();
var n = nodes.length;

for( var i = 0; i < n; i++ )
{
    var obj = nodes[i].getObject();
    if( obj )
    {
        var nShapes = obj.getNumShapes();
        for( var j = 0; j < nShapes; j++ )
        {
            var shape = obj.getShape( j );
            var nMats = shape.getNumMaterials();
            for( k = 0; k < nMats; k++ )
            {
                var mat = shape.getMaterial( k );
                if (mat.getLabel()=="1")
                {
                    var prop = mat.findPropertyByLabel( "Dynamics Strength" );
                    if( prop )
                    {
                        prop.setValue( .99 );
                    }
                }
            }
        }
    }
}


Viewing all articles
Browse latest Browse all 1036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>