Operation 'Equal' is not defined for types 'Object' and 'Boolean'
m4u
29 Dec 2014, 16:19Why Equal works with a boolean when using the if text comand but it's not working when using the script function if?
This works: {if piano.b = True: [B]}
This doesn't work: if (piano.b=True)
This works: {if piano.b = True: [B]}
This doesn't work: if (piano.b=True)

jaynabonne
29 Dec 2014, 16:28Because the text processor internally calls GetBoolean, which returns false if an attribute is not defined. When you reference an attribute directly, it must be defined. You can do the same:
though I would just do:
if (GetBoolean(piano, "b")=True)
though I would just do:
if (GetBoolean(piano, "b"))