Page 1 of 1

Setting r2 values (setfresnelcustom) - python

Posted: Sat Apr 13, 2013 1:51 pm
by garyswindell
Trying to assign r2 values in a layer. Found the function setFresnelCustom but I get a script error when trying to use it.

My code is

# Add new layer to material.
layer = material1.addLayer();
# Add new BSDF to layer.
bsdf = layer.addBSDF();
#set r2 values
bsdf.setFresnelCustom(75.00, 40.00, True );

but I get the error:

AttributeError: 'Cbsdf' object has no attribute 'setFresnelCustom'

What is the correct way to set r2 values?

Re: Setting r2 values (setfresnelcustom) - python

Posted: Sat Apr 13, 2013 5:01 pm
by JDHill
setFresnelCustom is a method on Creflectance, which you get using bsdf.getReflectance(). It is the same with Ccoating, by the way.

Re: Setting r2 values (setfresnelcustom) - python

Posted: Mon Apr 15, 2013 7:19 pm
by garyswindell
Thank you.