I found out what was causing the problem.

The enum list was being dynamically generated when the gizmo was created. If 
the user selected something from the list and saved it, fine - as long as the 
same list that was dynamically generated at the next creation was the same as 
the first time it was created. In other words, the user gets this list the 
first time:

addUserKnob {4 soloToRGBA l "solo layer to rgba" M {none rgbaz depth _ambient 
_diff _environment _index _lambert _light_all_bounce _light_all_contre 
_light_all_debouche _light_all_sun _light_all_tube _refl _spec _trsp _uniform 
_vnorm _wnorm}}

and they picked this from the list:
soloToRGBA _light_all_bounce

They saved, quit, and relaunched nuke, but this time, because some layers 
changed on disk, the list dynamically rebuilt according to the updated layers 
and became:
addUserKnob {4 soloToRGBA l "solo layer to rgba" M {none rgbaz 
_light_all_bounce}}

even though _light_all_bounce existed in the list, when the node was re-created 
it found the text and index from the script, but when the enum list was 
regenerated and the list text didn't match the value of the knob anymore, the 
knob value became the index number. The script then saved the index number with 
the second save, which then broke the script the third time it opened because 
the enum was looking for text that didn't exist.

jrab

On Jun 6, 2011, at 9:57 AM, Wouter Klouwen wrote:

> Can you tell us what version of Nuke you're using? 
> 
> Thanks.
> 
> On Thu, 2 Jun 2011 13:07:00 +0200, John RA Benson
> <john.benson.macg...@gmail.com> wrote:
>> Has anyone had the problem where an enumeration knob is returning the
>> index instead of the txt? Is there a fix for this, as some shots get it,
>> but most of the time the knob will be correct. I don't know what would
>> cause it to save txt in some cases and the index in others.
>> 
>> for instance, this is the knob and a correct save:
>> addUserKnob {4 soloToRGBA l "solo layer to rgba" t "Disables checkboxes
>> and forces this layer only into the RGB" M {none rgbaz depth _ambient
>> _diff _environment _index _lambert _light_all_bounce _light_all_contre
>> _light_all_debouche _light_all_sun _light_all_tube _refl _spec _trsp
>> _uniform _vnorm _wnorm}}
>> soloToRGBA _light_all_bounce
>> 
>> but sometimes, i don't know how or why, a script will look like this:
>> addUserKnob {4 soloToRGBA l "solo layer to rgba" t "Disables checkboxes
>> and forces this layer only into the RGB" M {none rgbaz depth _ambient
>> _diff _environment _index _lambert _light_all_bounce _light_all_contre
>> _light_all_debouche _light_all_sun _light_all_tube _refl _spec _trsp
>> _uniform _vnorm _wnorm}}
>> soloToRGBA 8
>> 
>> In the latter case, the script will open with the totally frustrating
>> error:
>> 
>> 'nothing is named "/path/to/my/messed/up/script"' (without the .nk
>> extension)
>> 
>> And it's botched. Dead at that node.
>> 
>> Any ideas?
>> 
>> Thanks
>> JRAB
>> 
>> 
>> _______________________________________________
>> Nuke-python mailing list
>> nuke-pyt...@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
>> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
> _______________________________________________
> Nuke-users mailing list
> Nuke-users@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users

_______________________________________________
Nuke-users mailing list
Nuke-users@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users

Reply via email to