|
|
> function(py,pz) {
> #if ((py>0.8) & (pz>1-0.1))
> 1
> #else
> 0
> #end
> };
Anything that starts with a # is run at parse-time, not during the render.
Functions are evaluated during the render.
If that actually parsed without a syntax error, then you essentially defined
the function
function(py,pz) {0}
because the #if was parsed through during the function's *definition*, not
while it runs.
If you want to use logical branching in a function, you must use the
select() function (check the documentation for details):
function(py,pz) {
select(py-.8,
0,
select(py-.9,
0,
1
)
}
- Slime
[ http://www.slimeland.com/ ]
Post a reply to this message
|
|