Diogo,

> On Mar 4, 2017, at 9:45 AM, Diogo Girondi <diogogiro...@gmail.com> wrote:
> 
> Hi Rich,
> 
> 
> The fundamental difference between a gizmo and a group is that a gizmo is 
> kept as a reference to the external file (.gizmo) with only the values for 
> the parameters (knobs) that were exposed when authoring being stored on the 
> nuke script (comp). So basically you can only hide/show/change what is 
> already exposed there. Any new addition to it will be set as a "User knob" in 
> order to allow it to be saved with and recalled by the script.

OK, that makes sense. So, Gizmo knobs are, in essence, fixed. Although I 
understand that you *can* add knobs, it’s just that they will always be placed 
in a new User tab.

> 
> If you need to regenerate the internals or dynamically create knobs from 
> scratch in a gizmo -- to keep things simple -- you are better off with groups 
> which when added to a script are embedded in full in the script.

Yes, after not being able to get around the problem, and prior to your reply, I 
gave up and just made it a Group.  ;^)

> 
> And case you want to keep the behavior of a group but wants to distribute it 
> as a gizmo, just export is as a gizmo and then edit the .gizmo file on a text 
> editor by replacing the "Gizmo {" bit for "Group {". This will effectively 
> make it a group, so any updates on the original gizmo file won't reflect on 
> any scripts where that pseudo-gizmo was added already.
> 
> As for the duplication of knobs one way tackle it would be to implement a 
> routine that checks for the presence of knob "x" on nuke.thisNode().knobs() 
> before creating any new ones.

Yes, I have a routine that checks for a collection of knobs that I remove and 
then generate new ones. In this case, I am making a list of checkboxes, one for 
every layer in an EXR. When the connected EXR is changed, an Update button 
rescans the EXR and makes new checkboxes, after removing the existing ones…

Thanks for the clarification. I didn’t see anything in the docs that make it 
clear that adding new knobs on a Gizmo would *always* create a new User tab. I 
can see by your explanation, though, that a Gizmo allows for some fixed 
mechanics, along with the possibility of additional user info being saved, if 
needed. That wasn’t quite clear to me - ’til now.  8^)

Thanks!
Rich


> 
> 
> Cheers,
> Diogo
> 
> On Fri, Mar 3, 2017 at 9:46 PM, Rich Bobo <richb...@mac.com 
> <mailto:richb...@mac.com>> wrote:
> Hi all,
> 
> I have a Group node that removes and adds knobs when a PyScript_Knob button 
> is clicked. It works well. If I export the Group as a Gizmo, when the button 
> is clicked, a new “User” tab gets created, putting the new knobs on the new 
> tab. Not good. This happens even if I already have a tab named “User”. So, 
> then I get User/User and my knobs go on the new User tab! Very frustrating! 
> Is this a bug or a “feature”? Is there any way around this - other than 
> leaving my Group as it is and giving up on the idea of ever making it a 
> Gizmo…?
> 
> Thanks for any help,
> Rich
> 
> 
> Rich Bobo
> Senior VFX Compositor
> Armstrong White
> Email:  rich.b...@armstrong-white.com <mailto:rich.b...@armstrong-white.com>
> http://armstrong-white.com/ <http://armstrong-white.com/>
> 
> Email:  richb...@mac.com <mailto:richb...@mac.com>
> Mobile:  (248) 840-2665
> Web:  http://richbobo.com/ <http://richbobo.com/>
> 
> "What lies behind us and what lies before us are tiny matters compared to 
> what lies within us."
> - William Morrow
> 
> 
> 
> 
> 
> 
> 
> 
> _______________________________________________
> Nuke-python mailing list
> Nuke-python@support.thefoundry.co.uk 
> <mailto:Nuke-python@support.thefoundry.co.uk>, 
> http://forums.thefoundry.co.uk/ <http://forums.thefoundry.co.uk/>
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python 
> <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

Reply via email to