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 );
}
}
}
}
}
}