I am trying to start using python to some degree and I thought I would start by using it inside expressions instead of hscript.
So, I read a bunch of the docs, and tried to make an if statement but completely failed.
Here is what I am trying to do.
I have an arch that is made from an open circle. This arch creates a polygon that is then cookied out of a rectangle.
So it creates an archway. At the end of it I have a polyreduce that triangulates the end result.
Where I want to use the if statement is.. if the arch becomes just 2 points, making a line, I want to switch the cookie node off by bypassing it all together and keeping the original rectangle only.
So. the if statement if written in English, would go like:
( inside the switch input )
if circle division == 1 then
make the value of the switch node = 0
else
make the value of the switch node = 1
There is an example of an if statement in the docs, but my main problem is, how do I make a relative channel reference within python.
I tried it also in Hscript and I cant really get the relative references to work in there either.
I use them all the time to grab values from one node and pipe them into another and then put that all within brackets and do some math to it.. but never inside if statements.. Only if statement I have done that works is within the OTL when turning on or off UI elements based on a local variable.
Back to topic. My current Hscript looks like this.
if ('ch("../circle1/divs")' == 1 ) then
return 0
else
return 1
endif
So, where am I going wrong here, and then… how would it look in python.
I'd love to know
Cheers
( EDIT:
if (ch("../circle1/divs") == 1,0,1)
works. so now I am wondering about the python version.