though interestingly if I set it with '' it defaults to the 2nd in the list,
but I can get round this with a test
Howard
>________________________________
> From: Howard Jones <mrhowardjo...@yahoo.com>
>To: Nuke Python discussion <nuke-python@support.thefoundry.co.uk>
>Sent: Friday, 4 May 2012, 9:32
>Subject: Re: [Nuke-python] preset Enumeration knob
>
>
>Thanks Guys
>
>
>That is indeed what I was after! Easy when you know how ;)
>
>Howard
>
>
>
>>________________________________
>> From: Hugo Leveille <hu...@fastmail.net>
>>To: Nuke Python discussion <nuke-python@support.thefoundry.co.uk>
>>Sent: Friday, 4 May 2012, 2:06
>>Subject: Re: [Nuke-python] preset Enumeration knob
>>
>>
>>setValue("") select the menu item
>>setValues([]) build the menu with the passed list argument
>>
>>
>>setvalues() will erase any values currently in the menu with the new ones
>>
>>Sent from my iPhone
>>
>>On 2012-05-03, at 6:32 PM, "Howard Jones" <mrhowardjo...@yahoo.com> wrote:
>>
>>
>>Ooh, That is exactly what I want to do by the looks of it, so why does this
>>not replace the other values then?
>>>
>>>(I'm missing something
important)
>>>
>>>I can't test this til tomorrow.
>>>
>>>H
>>>
>>>
>>>
>>>________________________________
>>> From: Nathan Rusch <nathan_ru...@hotmail.com>;
>>>To: Howard Jones <mrhowardjo...@yahoo.com>; Nuke Python discussion
>>><nuke-python@support.thefoundry.co.uk>;
>>>Subject: Re: [Nuke-python] preset Enumeration knob
>>>Sent: Thu, May 3, 2012 8:49:10 PM
>>>
>>>
>>>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 <nathan_ru...@hotmail.com>
>>>>To: Howard Jones <mrhowardjo...@yahoo.com>; Nuke Python discussion
>>>><nuke-python@support.thefoundry.co.uk>
>>>>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 <diogogiro...@gmail.com>
>>>>>To: Howard Jones <mrhowardjo...@yahoo.com>; Nuke Python discussion
>>>>><nuke-python@support.thefoundry.co.uk>
>>>>>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 <mrhowardjo...@yahoo.com>
>>>>>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?
>>>>>>
>>>>>>
>>>>>>
>>>>>>ThanksHoward
>>>>>>
>>>>>>_______________________________________________
>>>>>>Nuke-python
mailing list
>>>>>>Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
>>>>>>http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>________________________________
>>>> _______________________________________________
>>>>Nuke-python mailing
list
>>>>Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
>>>>http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
>>>>
>>>>
>>>>
>>>________________________________
>>> _______________________________________________
>>>Nuke-python mailing
list
>>>Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
>>>http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
>>>
>>_______________________________________________
>>>Nuke-python mailing list
>>>Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
>>>http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
>>>
>>_______________________________________________
>>Nuke-python mailing list
>>Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
>>http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
>>
>>
>>
>
>
_______________________________________________
Nuke-python mailing list
Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python