0
$\begingroup$

I want to add this expression in my driver panel but I dunno where to place a conditional equation. Emphasis on WHERE. When I place it different boxes I get an error.

var=0 if var > 1

For now I'm using floor as a makeshift conditional statement.

floor(sin(var*2)+.1)

$\endgroup$
8
  • 2
    $\begingroup$ Possible duplicate of Is it possible to put an if statement into the scripted expression of a driver? $\endgroup$ Nov 14, 2017 at 11:39
  • $\begingroup$ @RichSedman Not duplicate, the duplicates talk about how to make a statement or if it can be done, I want to know where to put it in the drivers panel. $\endgroup$ Nov 14, 2017 at 12:16
  • 1
    $\begingroup$ Ah. You just set it to Scripted Expression and put the text into the expression field. $\endgroup$ Nov 14, 2017 at 12:19
  • $\begingroup$ @RichSedman Doesn't work Type: Scripted Expression Expr: var=0 if var>1 ERROR: Invalid Python expression. $\endgroup$ Nov 14, 2017 at 12:23
  • 1
    $\begingroup$ Try “0 if var < 1 else sin(var*2)” $\endgroup$ Nov 14, 2017 at 12:58

0

You must log in to answer this question.

Browse other questions tagged .