So, do you want the index value of that enumeration, or the string?

In the "if" stetements you're trying below, you're not comparing the value
to anything. That would make the "if" test false when the first item (0) in
the enumeration is selected, and true for any other value selected. Is that
what you want?

Try these:

tcl:

[if {[numvalue parent.asdf] == 0} {return "hi"} else {return "bye"}]


python:

[python -eval {"hi" if nuke.thisParent()['asdf'].array()[0] else "bye"}]


On Thu, Mar 3, 2011 at 1:53 PM, Jordan Olson <[email protected]> wrote:

> Hi fellow TDs,
> I'm attempting at the moment, without luck- to try and create an IF
> statement based on a parent's pulldown choice knob.
>
> e.g.
>
> This is how I'm querying it as I can't find the TCL equivalent of .array()
> [python -eval {nuke.thisParent()['asdf'].array()[0]}]
>
> However I'm not sure in python or TCL to return a different string
> based on the result of that array. (in this particular scenario I need
> a work around for using the parent's knob's value directly)
>
> Attempting (without success)
>
> [value [parent.asdf ? "return this string" : "else return this string"]]
> or in python:
> [python -eval {if nuke.thisParent()['asdf'].array()[0]:return 'hi'}]
>
> Hm...
> Any ideas would be appreciated!
> Cheers,
> Jordan
> _______________________________________________
> Nuke-python mailing list
> [email protected]
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
>
_______________________________________________
Nuke-python mailing list
[email protected]
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python

Reply via email to