That's what you should do. Or create a hidden intermediary knob at the
gizmo panel from which the actual node inside that gizmo get it's values.

Any knob (hidden or not) exposed at the Gizmo panel level will have it's
values saved within the script.

On Mon, Sep 24, 2012 at 6:52 AM, Luca Fiorentini
<luca.fiorent...@gmail.com>wrote:

> Thanks Howard, that was fast!!
>
> What if I expose it and make it hidden?
>
>
> On Mon, Sep 24, 2012 at 11:48 AM, Howard Jones <mrhowardjo...@yahoo.com>wrote:
>
>> If you are just changing the internals of the gizmo then this will be
>> reloaded from the source code and reset each time you reload the script.
>> You need to expose a top layer knob and set the internal constant to use
>> that. The top level parameters will be saved and used when you reload the
>> script.
>>
>> Groups write the internals to the script, Gizmos dont.
>>
>>
>> Howard
>>
>>   ------------------------------
>> *From:* Luca Fiorentini <luca.fiorent...@gmail.com>
>> *To:* Nuke Python discussion <nuke-python@support.thefoundry.co.uk>
>> *Sent:* Monday, 24 September 2012, 10:29
>> *Subject:* [Nuke-python] Gizmo resetting to default
>>
>> Hello!
>>
>> I did a python script button on a group to change the color of a constant
>> that is inside the same group. Let's say that the constant is blue and with
>> the color it gets red.
>> Everything works fine.
>> I exported the group as a gizmo and reimported to a new scene. The color
>> when I import it is blue. I use the button to set the constant to red and
>> save the scene.
>> When I reopen the scene the constant is blue again.
>> If I do the same with the group everything is working perfectly.
>> This is the code for when I press the button (the same happens with tcl
>> code):
>>
>> [CODE]g = nuke.thisNode()
>> g.begin()
>> nuke.toNode('Constant').knob('color').setValue([1, 0, 0, 1])
>> g.end()
>> [/CODE]
>>
>> Any idea?
>>
>> Thanks
>> --
>> *Luca Fiorentini - 3D Lighting Artist*
>> My Showreel <http://www.vimeo.com/lucafiorentini/reel> - My 
>> blog<http://lucafiorentini.wordpress.com/>- My
>> Flickr <http://www.flickr.com/photos/lucafiorentini>
>>
>>
>> _______________________________________________
>> 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
>>
>>
>
>
> --
> *Luca Fiorentini - 3D Lighting Artist*
> My Showreel <http://www.vimeo.com/lucafiorentini/reel> - My 
> blog<http://lucafiorentini.wordpress.com>- My
> Flickr <http://www.flickr.com/photos/lucafiorentini>
>
>
> _______________________________________________
> 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

Reply via email to