Re: [Nuke-users] create a node outside a grouped gimzo

2016-11-23 Thread Carlos Trijueque
Thanks for the explanation. 

I had some misconceptions about group.begin()/group.end()
___
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


Re: AW: Re: [Nuke-users] create a node outside a grouped gimzo

2016-11-22 Thread Ben Dickson

The with statement is basically the same as doing:

def button_a():
mygroup = nuke.toNode("Group1")
try:
mygroup.begin()
nuke.nodes.Blur()
some_func_which_errors_sometimes()
finally:
mygroup.end()

That is, always calling ".end()" even if an error occurs. I.e it "cleans 
up" after itself.


For example, say you have two unrelated menu commands - one makes a blur 
in a group, the other just makes a grade node (nothing at all to do with 
the group)


def button_a():
mygroup = nuke.toNode("Group1")
mygroup.begin()
nuke.nodes.Blur()
some_func_which_errors_sometimes()
mygroup.end()

def button_b():
nuke.nodes.Grade()

button_b() # makes Grade node in root, good
button_a() # makes Blur node in group, good, but then errors
button_b() # now makes Grade in group, bad

This happens because "mygroup.end()" never got called, whereas the 
"with" statement ensures this happens:


def button_a():
mygroup = nuke.toNode("Group1")
with mygroup:
nuke.nodes.Blur()
some_func_which_errors_sometimes()

On 23/11/16 04:27, Igor Majdandzic wrote:

Hows the with statement working here? I was always defining group.begin
and end. This looks much more elegant



Von Samsung Mobile gesendet



 Ursprüngliche Nachricht 
Von: Ben Dickson <ben.dick...@rsp.com.au>
Datum: 22.11.2016 3:44 (GMT+01:00)
An: Nuke user discussion <nuke-users@support.thefoundry.co.uk>
Betreff: Re: [Nuke-users] create a node outside a grouped gimzo


"with nuke.thisParent():" would be the other way, which would also work
in the (uncommon) case of working inside nested group nodes

On 22/11/16 08:06, Gabor Hovanyi wrote:
 > with nuke.root():
 >  nuke.createNode('Reformat')
 >
 > => http://community.thefoundry.co.uk/discussion/topic.aspx?f=190=102206
 >
 > On Mon, Nov 21, 2016 at 1:24 PM, Darren Coombes <darren.coom...@me.com
 > <mailto:darren.coom...@me.com>> wrote:
 >
 > I’ve got a grouped gizmo, and i want to create a reformat node.
 > I’ve got it to create a reformat node, but it makes the node inside
 > the group.
 > Any idea how you’d get it to work so it creates it outside the group?
 >
 > Thanks.
 >
 > Check out some of my work...
 > *
 > *www.vimeo.com/darrencoombes/reel2015
 > <http://www.vimeo.com/darrencoombes/reel2015>*
 > *
 > *
 > *
 > *
 > *
 > *
 > *Mob: +61 418 631 079 <tel:+61%20418%20631%20079>*
 > *
 > IMDB: www.imdb.com/name/nm3719099/
<http://www.imdb.com/name/nm3719099/>
 > *
 > *Instagram: @7secondstoblack*
 > *Instagram: @durwood0781*
 > *Skype:  darren.coombes81*
 > *Twitter:  @durwood81*
 > *
 >
 >
 > ___
 > Nuke-users mailing list
 > Nuke-users@support.thefoundry.co.uk
 > <mailto:Nuke-users@support.thefoundry.co.uk>,
 > http://forums.thefoundry.co.uk/ <http://forums.thefoundry.co.uk/>
 > http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users
 > <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
 >

--
ben dickson
2D TD | ben.dick...@rsp.com.au
rising sun pictures | www.rsp.com.au
___
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



--
ben dickson
2D TD | ben.dick...@rsp.com.au
rising sun pictures | www.rsp.com.au
___
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


Re: [Nuke-users] create a node outside a grouped gimzo

2016-11-22 Thread Carlos Trijueque
As far as I know they are equivalent but using the 'with' statement is
more pythonic.

On Tue, Nov 22, 2016, at 18:57, Igor Majdandzic wrote:
> Hows the with statement working here? I was always defining group.begin
> and end. This looks much more elegant
___
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


AW: Re: [Nuke-users] create a node outside a grouped gimzo

2016-11-22 Thread Igor Majdandzic
Hows the with statement working here? I was always defining group.begin and 
end. This looks much more elegant



Von Samsung Mobile gesendet

 Ursprüngliche Nachricht 
Von: Ben Dickson <ben.dick...@rsp.com.au> 
Datum: 22.11.2016  3:44  (GMT+01:00) 
An: Nuke user discussion <nuke-users@support.thefoundry.co.uk> 
Betreff: Re: [Nuke-users] create a node outside a grouped gimzo 
 
"with nuke.thisParent():" would be the other way, which would also work 
in the (uncommon) case of working inside nested group nodes

On 22/11/16 08:06, Gabor Hovanyi wrote:
> with nuke.root():
>  nuke.createNode('Reformat')
>
> => http://community.thefoundry.co.uk/discussion/topic.aspx?f=190=102206
>
> On Mon, Nov 21, 2016 at 1:24 PM, Darren Coombes <darren.coom...@me.com
> <mailto:darren.coom...@me.com>> wrote:
>
> I’ve got a grouped gizmo, and i want to create a reformat node.
> I’ve got it to create a reformat node, but it makes the node inside
> the group.
> Any idea how you’d get it to work so it creates it outside the group?
>
> Thanks.
>
> Check out some of my work...
> *
> *www.vimeo.com/darrencoombes/reel2015
> <http://www.vimeo.com/darrencoombes/reel2015>*
> *
> *
> *
> *
> *
> *
> *Mob: +61 418 631 079 <tel:+61%20418%20631%20079>*
> *
> IMDB: www.imdb.com/name/nm3719099/ <http://www.imdb.com/name/nm3719099/>
> *
> *Instagram: @7secondstoblack*
> *Instagram: @durwood0781*
> *Skype:  darren.coombes81*
> *Twitter:  @durwood81*
> *
>
>
> ___
> Nuke-users mailing list
> Nuke-users@support.thefoundry.co.uk
> <mailto:Nuke-users@support.thefoundry.co.uk>,
> http://forums.thefoundry.co.uk/ <http://forums.thefoundry.co.uk/>
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users
> <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
>

-- 
ben dickson
2D TD | ben.dick...@rsp.com.au
rising sun pictures | www.rsp.com.au
___
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

Re: [Nuke-users] create a node outside a grouped gimzo

2016-11-21 Thread Ben Dickson
"with nuke.thisParent():" would be the other way, which would also work 
in the (uncommon) case of working inside nested group nodes


On 22/11/16 08:06, Gabor Hovanyi wrote:

with nuke.root():
 nuke.createNode('Reformat')

=> http://community.thefoundry.co.uk/discussion/topic.aspx?f=190=102206

On Mon, Nov 21, 2016 at 1:24 PM, Darren Coombes > wrote:

I’ve got a grouped gizmo, and i want to create a reformat node.
I’ve got it to create a reformat node, but it makes the node inside
the group.
Any idea how you’d get it to work so it creates it outside the group?

Thanks.

Check out some of my work...
*
*www.vimeo.com/darrencoombes/reel2015
*
*
*
*
*
*
*
*Mob: +61 418 631 079 *
*
IMDB: www.imdb.com/name/nm3719099/ 
*
*Instagram: @7secondstoblack*
*Instagram: @durwood0781*
*Skype:  darren.coombes81*
*Twitter:  @durwood81*
*


___
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



--
ben dickson
2D TD | ben.dick...@rsp.com.au
rising sun pictures | www.rsp.com.au
___
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


Re: [Nuke-users] create a node outside a grouped gimzo

2016-11-21 Thread Gabor Hovanyi
with nuke.root():
nuke.nodes.Reformat(resize='none')

On Mon, Nov 21, 2016 at 2:06 PM, Darren Coombes 
wrote:

> Thanks Gabor.
>
> Do you know how i’d also set the resize to none on creation?
> I’m trying this, and it’s not working..
>
> with nuke.root():
> nuke.nodes.Reformat(resize=none)
>
> Check out some of my work...
> *www.vimeo.com/darrencoombes/reel2015
> *
>
> *Mob:  +61 418 631 079 <+61%20418%20631%20079>*
> IMDB: www.imdb.com/name/nm3719099/
> *Instagram: @7secondstoblackInstagram: @durwood0781Skype:
>  darren.coombes81Twitter:  @durwood81*
>
> On 22 Nov 2016, at 8:36 am, Gabor Hovanyi  wrote:
>
> with nuke.root():
> nuke.createNode('Reformat')
>
> => http://community.thefoundry.co.uk/discussion/topic.aspx?f=190=102206
>
> On Mon, Nov 21, 2016 at 1:24 PM, Darren Coombes 
> wrote:
>
>> I’ve got a grouped gizmo, and i want to create a reformat node.
>> I’ve got it to create a reformat node, but it makes the node inside the
>> group.
>> Any idea how you’d get it to work so it creates it outside the group?
>>
>> Thanks.
>>
>> Check out some of my work...
>> *www.vimeo.com/darrencoombes/reel2015
>> *
>>
>> *Mob:  +61 418 631 079 <+61%20418%20631%20079>*
>> IMDB: www.imdb.com/name/nm3719099/
>> *Instagram: @7secondstoblackInstagram: @durwood0781Skype:
>>  darren.coombes81Twitter:  @durwood81*
>>
>>
>> ___
>> 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
>
>
>
> ___
> 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

Re: [Nuke-users] create a node outside a grouped gimzo

2016-11-21 Thread Darren Coombes
Thanks Gabor.

Do you know how i’d also set the resize to none on creation?
I’m trying this, and it’s not working..

with nuke.root():
nuke.nodes.Reformat(resize=none)

Check out some of my work...
www.vimeo.com/darrencoombes/reel2015 


Mob:  +61 418 631 079 
IMDB: www.imdb.com/name/nm3719099/
Instagram: @7secondstoblack
Instagram: @durwood0781
Skype:  darren.coombes81
Twitter:  @durwood81

> On 22 Nov 2016, at 8:36 am, Gabor Hovanyi  wrote:
> 
> with nuke.root():
> nuke.createNode('Reformat')
> 
> => http://community.thefoundry.co.uk/discussion/topic.aspx?f=190=102206 
> 
> 
> On Mon, Nov 21, 2016 at 1:24 PM, Darren Coombes  > wrote:
> I’ve got a grouped gizmo, and i want to create a reformat node.
> I’ve got it to create a reformat node, but it makes the node inside the group.
> Any idea how you’d get it to work so it creates it outside the group?
> 
> Thanks.
> 
> Check out some of my work...
> www.vimeo.com/darrencoombes/reel2015 
> 
> 
> Mob:  +61 418 631 079 
> IMDB: www.imdb.com/name/nm3719099/ 
> Instagram: @7secondstoblack
> Instagram: @durwood0781
> Skype:  darren.coombes81
> Twitter:  @durwood81
> 
> 
> ___
> 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

___
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

Re: [Nuke-users] create a node outside a grouped gimzo

2016-11-21 Thread Gabor Hovanyi
with nuke.root():
nuke.createNode('Reformat')

=> http://community.thefoundry.co.uk/discussion/topic.aspx?f=190=102206

On Mon, Nov 21, 2016 at 1:24 PM, Darren Coombes 
wrote:

> I’ve got a grouped gizmo, and i want to create a reformat node.
> I’ve got it to create a reformat node, but it makes the node inside the
> group.
> Any idea how you’d get it to work so it creates it outside the group?
>
> Thanks.
>
> Check out some of my work...
> *www.vimeo.com/darrencoombes/reel2015
> *
>
> *Mob:  +61 418 631 079 <+61%20418%20631%20079>*
> IMDB: www.imdb.com/name/nm3719099/
> *Instagram: @7secondstoblackInstagram: @durwood0781Skype:
>  darren.coombes81Twitter:  @durwood81*
>
>
> ___
> 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