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

How to read or set the Ambient Strength of a Material

$
0
0

This is where I got...but missing the way to read or set the value (like 0.1 or 10%)


if(!(node = Scene.getPrimarySelection())){
	 return;
};
print ("node= "+node.name);
shellObject = node.getObject();
print ("Object= "+shellObject.name);
shape = shellObject.getCurrentShape();
print ("Shape= "+shape.name);
var iMat = shape.getNumMaterials();
	for( j = 0; j < iMat; j++){
		mMaterial = shape.getMaterial ( j);
		print ("Material= "+mMaterial.name);
		oProperty = mMaterial.findProperty( "Ambient Strength" );
		print ("Property= "+oProperty.name);
		oProperty.setValue = ( 0.12 );
		print("Value= " + oProperty.value);
	};

...but oProperty.value appears to be the wrong thing.  Tried name, getValue , as well...the last two lines to read or set the value don't seem to work.

What am I missing, or where in the docs am I missing it?  :)


Viewing all articles
Browse latest Browse all 1036

Trending Articles



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