I am currently developing a script which shuffle's out AOV's from a read
node, then user input appears which asks user, Create OCIO ColorSpace or
not ?  If user click Cancel script will end here and if user click Ok OCIO
ColorSpace nodes will be created after every shuffle node and a python
panel will appear which will have same controls as OCIO ColorSpace nodes
and user will be able to change all controls of all OCIO ColorSpace nodes
via this python panel. But I am stuck to link OCIO ColorSpace nodes
controls with python panel controls. I am a python beginner though.

As a experiment I have written this bit of code which will call, In and Out
Colorspace values of single OCIO ColorSpace node into python panel's
Enumeration Knob, I am able to call values and get values but I don't know
how to control OCIO ColorSpace node from python panel (getting error after
running this code).


*class ocioPanel(nukescripts.PythonPanel):*
*    def __init__(self, node):*
*        nukescripts.PythonPanel.__init__(self, 'OCIO ColorSpace')*
*        self.csNode = node*
*        csin = node['in_colorspace'].values()*
*        csout = node['out_colorspace'].values()*
*        self.inKnob = nuke.Enumeration_Knob( 'in_space', 'In Space ',
csin)*
*        self.outKnob = nuke.Enumeration_Knob('out_spcae', 'Out Space',
csout)*

*        for k in[self.inKnob, self.outKnob]:*
*            self.addKnob(k)*

* inValue = self.inKnob.value()*
* outValue = self.outKnob.value()*
* for n in node:*
* n.knob('in_colorspace').setValue( inValue )*
* n.knob('out_colorspace').setValue( outValue )  -- *is it right or not?
*n = ocioPanel(node)*
*if n.showModalDialog():*
*    print n.inKnob.value(), n.outKnob.value()*



Any help is highly appreciated.
_______________________________________________
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

Reply via email to