I must be confused about what you’re trying to do... What I’m envisioning is
that you have a list of directories, you want to populate an enumeration knob
with that list, but you want the knob’s value to default to a value that isn’t
necessarily the first value in the list.
If that’s the case, you can just do:
enum.setValues(['A', 'B', 'C', 'D', 'E'])
enum.setValue('D')
Am I missing something important?
-Nathan
From: Howard Jones
Sent: Thursday, May 03, 2012 1:27 PM
To: Nuke Python discussion
Subject: Re: [Nuke-python] preset Enumeration knob
The value is a list of directories, so if I set it I'll lose the list won't I?
this needs to still remain a list. I just want the default to be up one
directory from where the user is starting from.
Howard
------------------------------------------------------------------------------
From: Nathan Rusch <[email protected]>
To: Howard Jones <[email protected]>; Nuke Python discussion
<[email protected]>
Sent: Thursday, 3 May 2012, 20:43
Subject: Re: [Nuke-python] preset Enumeration knob
Is there a reason you can’t just .setValue() the knob after creation?
-Nathan
From: Howard Jones
Sent: Thursday, May 03, 2012 12:33 PM
To: Nuke Python discussion
Subject: Re: [Nuke-python] preset Enumeration knob
Thanks Diogo!
Yes that should do it, I'd rather have not re-ordered the list but if its the
only way...
CheersHoward
Howard
----------------------------------------------------------------------------
From: Diogo Girondi <[email protected]>
To: Howard Jones <[email protected]>; Nuke Python discussion
<[email protected]>
Sent: Thursday, 3 May 2012, 20:09
Subject: Re: [Nuke-python] preset Enumeration knob
Hi Howard,
You could do something like:
original_list = ['A','B','C','D','E']
for i,v in enumerate( original_list ):
if v == 'D':
first = list( original_list.pop( i ) )
print first+original_list
>>> ['D', 'A', 'B', 'C', 'E']
Id that what you want?
cheers,
diogo
On Thu, May 3, 2012 at 1:58 PM, Howard Jones <[email protected]>
wrote:
Hi
I'm populating an enumeration knob with the contents of a directory.
In some instances though I would like to do this but have the knob
display a specific value first.
That is
list=[A,B,C]
enumeration knob displays
A
B
C
but I'd like it to start at *
A
B*
C
On the simple panel I would set this by
B
A
B
C
which is a bit clunky. However this is know with python panel and I would
rather do it neater if poss.
Is this possible?
Thanks
Howard
_______________________________________________
Nuke-python mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
------------------------------------------------------------------------------
_______________________________________________
Nuke-python mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
--------------------------------------------------------------------------------
_______________________________________________
Nuke-python mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
_______________________________________________
Nuke-python mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python