Hiya, sorry for the late answer i have been too busy to get my nose in python
Yes you were very helpful,  thanks !!!
the part were you convert a single value to a list (listVal) was exactly what i was missing
Then i just had to re check this new value in a new variable

that was the missing part :

if sel ['multiply'].singleValue():
  listVal=[tt, tt, tt, tt]
  sel.knob('multiply').setValue(listVal)
  ttt=sel.knob('multiply').getValue()
  sel.knob('multiply').setValue(map(lambda x,y: x+y, ttt, colorval))


thanks a lot
Olivier

Michael Havart wrote:
Hi

node = nuke.Node('Add')

valueType = node['value'].value().__class__.__name__

floatVal = 1.45
listVal = [floatVal, floatVal, floatVal, floatVal]

if valueType  == 'list':
    node['value'].setValue(listVal)
if valueType == 'float':
    node['value'].setValue(floatVal)


is that helping ?

Michael


2011/4/2 Olivier Jezequel <[email protected] <mailto:[email protected]>>

    No ? Nobody  ?


    Olivier Jezequel wrote:

        Hiya,

        I am getting stuck on one part of a script i am creating. It
        suppose to add values to a bunch of nodes in the same time
        let say i want to add 0.2 in the multiply red channel of my
        selected grade nodes

        If i am sending an overall value on all channels it is fine
        what everthe format are, my only remaining issue is when some
        of my target nodes are in a single value and i am sending a
        separate channels value ( target multiply is 1, adding 0.2 0 0
        0. so it will become 1.2 1 1 1)
        I am been returned an error saying my argument to map must
        support iteration.

        here is the part that gives trouble :
        --------------------------------------------------------------
        coloradd=nuke.AColor_Knob('values', 'values')
        def addButton():
               for sel in nuke.selectedNodes():
                   tt=sel.knob('multiply').getValue()
                   colorval = coloradd.value()
                       if coloradd.singleValue():
                           #....... a long part that works
                       else:
                          sel.knob('multiply').setValue(map(lambda
        x,y: x+y, tt, colorval))
        ------------------------------------------------------------
        i probably need to convert first my value of 1 to a format 1 1 1 1

        any idea ?

        cheers
        Olivier


        _______________________________________________
        Nuke-python mailing list
        [email protected]
        <mailto:[email protected]>
        http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python


    _______________________________________________
    Nuke-python mailing list
    [email protected]
    <mailto:[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