Forum

  • Index
  •  » Scripting
  •  » setting low quality values to attributes using expressions

#1 2017-02-06 17:39:20

bonovasitch
Member

setting low quality values to attributes using expressions

I'd like to toggle other attributes, namely, fur density when switching between low/high quality rendering.   I'm trying to do this with an expression but I seem to only be able to get it to evaluate once (upon ctrl+s).  It evaluates correctly setting "Out" to the value I would expect but after that the expression doesn't evaluate again.  So, toggling the HQ button has no effect. 

Here is what I have so far,

Code:

local is_low_enabled = _"Preferences.LowEnable":get ()

if is_low_enabled == true then
    -- 10% density
    Out = 0.1
else 
    -- 100% density
    Out = 1
end

btw, I did not set any "Inputs".  Is this necessary?

Offline

 

#2 2017-02-07 12:17:48

Ben
Guerilla dev, the guy to hug

Re: setting low quality values to attributes using expressions

Hi,

The Expression is reevaluated if any of its inputs is modified. So, you must expose an input, and then connect Preferences.LowEnable into it. This way, the modification will be properly transferred to the Expression.

Ben


Benjamin 'Ben' Legros
Guerilla developer
http://www.guerillarender.com

Offline

 
  • Index
  •  » Scripting
  •  » setting low quality values to attributes using expressions

Board footer

Powered by PunBB
© Copyright 2002–2008 PunBB