Re: [Nuke-users] Assigning hotkeys messing with createNode position

2012-04-23 Thread Woei Lee



Woei Lee
Pardon the iPhone spelling. 

On 2012/04/23, at 17:28, Adam Hazard  wrote:

> Ok, another question.
> 
> I have some nodes that I am just adding hotkeys to in my menu.py. replacing 
> the default menu item using lambda:
> 
> like this example from the official nuke python docs.
> 
> nuke.menu( 'Nodes' ).addCommand( '3D/Axis', lambda: nuke.createNode( 'Axis2' 
> ), 'a')
> 
> 
> However, if I create this node using the new assigned hotkey, it either 
> places the new created node to the right side of the selected node, oand with 
> other nodes diagonally down and to the right. If I create the node, manually, 
> through the tab search or selecting it in node menu, it creates the node 
> directly under the node I had selected, as I would expect. 
> 
> 
> Also, related. I have a node that I am redefining, related to my 
> topnode.tile_color question earlier. I am using a line like this
> 
> nuke.menu("Nodes").addCommand("3D/Axis", "newaxis()", "+a")
> 
> This is even odder behavior. If I use the hotkey it creates the node 
> diagonally down to the side of the selected node, like the others. But, if I 
> create the node manually, it spawns the node in the top Left corner of my 
> node graph viewer, no matter how zoomed in or out my node graph is.
> 
> There is nothing in my code as far as I can tell that should be affecting 
> position. How do I get it to place my new node directly under the selected 
> node when using a hotkey. or why does it create it differently when I try to 
> assign a new hotkey? I have done some searching and I could try to assign the 
> x and y pos based off the selected node, but I dont get why it is spawning in 
> a different position in the first place. A bug perhaps?
> 
> Thanks,
> Adam
> ___
> 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] Assigning hotkeys messing with createNode position

2012-04-23 Thread Hugo Léveillé
Just tested it and its working as expected. The node only goes on
the side if there is already another node under and that here is
no place to create it. Even if your code is working, what I
usually do is :

ex:

nuke.menu( 'Nodes' ).addCommand( '3D/Axis', "nuke.createNode(
'Axis2' )", 'a')

is that making any difference for you ? What OS and nuke version
? I have been using this code for ages on various OS so Its weird

-hugo

On Mon, Apr 23, 2012, at 17:28, Adam Hazard wrote:

Ok, another question.
I have some nodes that I am just adding hotkeys to in my menu.py.
replacing the default menu item using lambda:
like this example from the official nuke python docs.
nuke.menu( 'Nodes' ).addCommand( '3D/Axis', lambda:
nuke.createNode( 'Axis2' ), 'a')
However, if I create this node using the new assigned hotkey, it
either places the new created node to the right side of the
selected node, oand with other nodes diagonally down and to the
right. If I create the node, manually, through the tab search or
selecting it in node menu, it creates the node directly under the
node I had selected, as I would expect.
Also, related. I have a node that I am redefining, related to my
topnode.tile_color question earlier. I am using a line like this
nuke.menu("Nodes").addCommand("3D/Axis", "newaxis()", "+a")
This is even odder behavior. If I use the hotkey it creates the
node diagonally down to the side of the selected node, like the
others. But, if I create the node manually, it spawns the node in
the top Left corner of my node graph viewer, no matter how zoomed
in or out my node graph is.
There is nothing in my code as far as I can tell that should be
affecting position. How do I get it to place my new node directly
under the selected node when using a hotkey. or why does it
create it differently when I try to assign a new hotkey? I have
done some searching and I could try to assign the x and y pos
based off the selected node, but I dont get why it is spawning in
a different position in the first place. A bug perhaps?
Thanks,
Adam
___
Nuke-users mailing list
[1]Nuke-users@support.thefoundry.co.uk,
[2]http://forums.thefoundry.co.uk/
[3]http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-
users

References

1. mailto:Nuke-users@support.thefoundry.co.uk
2. http://forums.thefoundry.co.uk/
3. http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users


-- 
  Hugo Léveillé
  TD Compositing, Vision Globale
  hu...@fastmail.net

___
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] Assigning hotkeys messing with createNode position

2012-04-23 Thread Adam Hazard

Ok, another question.

I have some nodes that I am just adding hotkeys to in my menu.py. 
replacing the default menu item using lambda:


like this example from the official nuke python docs.

nuke.menu( 'Nodes' ).addCommand( '3D/Axis', lambda: nuke.createNode( 
'Axis2' ), 'a')



However, if I create this node using the new assigned hotkey, it either 
places the new created node to the right side of the selected node, oand 
with other nodes diagonally down and to the right. If I create the node, 
manually, through the tab search or selecting it in node menu, it 
creates the node directly under the node I had selected, as I would expect.



Also, related. I have a node that I am redefining, related to my 
topnode.tile_color question earlier. I am using a line like this


nuke.menu("Nodes").addCommand("3D/Axis", "newaxis()", "+a")

This is even odder behavior. If I use the hotkey it creates the node 
diagonally down to the side of the selected node, like the others. But, 
if I create the node manually, it spawns the node in the top Left corner 
of my node graph viewer, no matter how zoomed in or out my node graph is.


There is nothing in my code as far as I can tell that should be 
affecting position. How do I get it to place my new node directly under 
the selected node when using a hotkey. or why does it create it 
differently when I try to assign a new hotkey? I have done some 
searching and I could try to assign the x and y pos based off the 
selected node, but I dont get why it is spawning in a different position 
in the first place. A bug perhaps?


Thanks,
Adam
___
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] Re: Renderman in Nuke, Maximum particle count?

2012-04-23 Thread Alex -
False alarm.
For future reference...

Turns out this was actually something else..
Seems like using multiple scene nodes in sequence was causing the points to
be culled..

If you refer to the DAG screen shot there are 2 setups, one with a series
of transformGeo nodes and scene nodes being used in sequence to double the
point coulds, 2,4,8 etc, and another with many Transform Geo nodes and a
single Scene node 1,2,3,4 etc.

DAG screenshot:
http://dl.dropbox.com/u/3656251/rendermanCullExample_v001.jpg

Both layouts produce identical output, and render the identically in the
ScanlineRenderer, but via Renderman each additional Scene node causes more
points to be culled..

-Alex


On Mon, Apr 23, 2012 at 12:38 PM, Alex -  wrote:

> Hey guys...
>
> I'm having some issues rendering point clouds using the PrmanRender node.
>
> Basically im using the PositionToPoints -> ParticleEmitter hack to render
> a bunch of little objects that I dont want to use real geo for..
> Using the PrmanRender node I can render 1 or 2 instances perfectly, but
> once I jump to 3 or more Renderman starts to randomly cull points from my
> scene, the Scanline renderer will keep rendering all the points no matter
> how many I throw at it, but Renderman culls more and more as I throw more
> at it..
>
> Does anyone know if the Nuke to Renderman exporter being used by the
> PrmanRender node has some sort of preset upper limit or particle count?
> If so can it being modified anywhere vaugely accessable?and
>
> Regards
> Alex
>
___
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] python [topnode] equivalent

2012-04-23 Thread Adam Hazard

great, thanks for all the info. I'll have to give this stuff a good read.

-Adam

On 04/23/2012 12:16 PM, Ivan Busquets wrote:

What Hugo said.
You can find more info here:

http://docs.python.org/library/stdtypes.html#string-formatting

As for the "16" in the int() command (or "0" in the example I sent), 
that is the base for the string-to-integer conversion. If the argument 
is not given, it uses a base of 10 by default. You can pass it a value 
of 16 so it will interpret hex characters correctly, or 0 to let 
python guess the best base to use for the given string. In this case, 
this works because the string will always start with '0x', which 
Python will interpret as an hexadecimal.


More info:
http://docs.python.org/library/functions.html#int

Hope that clarifies it a bit.

Cheers,
Ivan

On Mon, Apr 23, 2012 at 12:12 PM, Hugo Léveillé > wrote:


Its called string formatting
ex:
age = '16'
print "Hi, I am " + age + " years old"
is the same as:
print "Hi, I am %s years old" % age
It has the advantage of making clearer string writing as well as
converting int and floats to string as well
ex:
"I am %s years old and I have %s dollars" % (10 , 3.5)
On Mon, Apr 23, 2012, at 12:00, Adam Hazard wrote:

ok, cool, I think I understand it better now. Thanks, guys. Also,
if you don't mind, another question, what exactly is the '%'
doing in this code. And I have used 'int' before, and seen the
'16' posted around, what exactly are those doing, I am guessing
that is what converts the value from string to integer?

-Adam

On 04/23/2012 10:48 AM, Nathan Rusch wrote:

The problem isn't hex vs. int; the value you're getting back
from the Python knob is identical to the hex value returned by
the nuke.tcl call. The issue you're running into is that the
nuke.tcl call is returning the hex value as a string, so you
need to cast it to a numeric type before you can actually use it.
n = nuke.selectedNode()
tile_color = int(nuke.tcl('value [topnode %s].tile_color' %
n.name ()), 16)
-Nathan
From: Adam Hazard 
Sent: Monday, April 23, 2012 10:12 AM
To: Nuke user discussion

Subject: Re: [Nuke-users] python [topnode] equivalent
Thanks Ivan.
This was pretty much exactly what I was looking for. However I
had to change it a little bit because this was returning the
tile color hex value, if I understand all this correctly, and my
function needs just the integer value. As I can't assign or set
a tile_color using hex, or I haven't been able to figure it out.

Anyways, for whatever reason this does the trick, kinda mixing
your code with what I had before. I am still not very sure why
the tile_color has 2 different value formats.

n = nuke.selectedNode()
topnode_name = nuke.tcl("full_name [topnode %s]" % n.name
())
topnode = nuke.toNode(topnode_name)
tile_col = topnode['tile_color'].value()

Thanks again and much appreciated.
Adam


On 04/20/2012 06:47 PM, Ivan Busquets wrote: Or if you just want
the tile_color of the top node, you could of course do:

n = nuke.selectedNode()

tile_color = nuke.tcl("value [topnode %s].tile_color" % n.name
())


Hope that helps


On Fri, Apr 20, 2012 at 6:41 PM, Ivan Busquets
mailto:ivanbusqu...@gmail.com>> wrote:
You can use nuke.tcl() within python to execute a tcl command.

So, in your case, something like this should work:

n = nuke.selectedNode()

topnode_name = nuke.tcl("full_name [topnode %s]" % n.name
())

topnode = nuke.toNode(topnode_name)




On Fri, Apr 20, 2012 at 6:30 PM, Adam Hazard
mailto:ahaz...@tippett.com>> wrote:
Hopefully a quick question,

If I currently have a node selected somewhere in a tree, and I
want to access the topnodes tile color using python, how would I
do so? Using [[topnode].tile_color] doesn't seem to work as it
is tcl? Looking around it seems you need to check dependecies of
all the nodes or something, but I haven't been able to get
anything to work.  Is there no way to convert the tcl function
to work in python?

Thanks in advance for any help,
Adam
___
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] python [topnode] equivalent

2012-04-23 Thread Ivan Busquets
What Hugo said.
You can find more info here:

http://docs.python.org/library/stdtypes.html#string-formatting

As for the "16" in the int() command (or "0" in the example I sent), that
is the base for the string-to-integer conversion. If the argument is not
given, it uses a base of 10 by default. You can pass it a value of 16 so it
will interpret hex characters correctly, or 0 to let python guess the best
base to use for the given string. In this case, this works because the
string will always start with '0x', which Python will interpret as an
hexadecimal.

More info:
http://docs.python.org/library/functions.html#int

Hope that clarifies it a bit.

Cheers,
Ivan

On Mon, Apr 23, 2012 at 12:12 PM, Hugo Léveillé  wrote:

>   Its called string formatting
>
>  ex:
>  age = '16'
> print "Hi, I am " + age + " years old"
>
>  is the same as:
>
>  print "Hi, I am %s years old" % age
>
>  It has the advantage of making clearer string writing as well as
> converting int and floats to string as well
>
>  ex:
>
>  "I am %s years old and I have %s dollars" % (10 , 3.5)
>
>
>
>
>On Mon, Apr 23, 2012, at 12:00, Adam Hazard wrote:
>
>  ok, cool, I think I understand it better now. Thanks, guys. Also, if you
> don't mind, another question, what exactly is the '%' doing in this code.
> And I have used 'int' before, and seen the '16' posted around, what exactly
> are those doing, I am guessing that is what converts the value from string
> to integer?
>
> -Adam
>
> On 04/23/2012 10:48 AM, Nathan Rusch wrote:
>
>   The problem isn’t hex vs. int; the value you’re getting back from the
> Python knob is identical to the hex value returned by the nuke.tcl call.
> The issue you’re running into is that the nuke.tcl call is returning the
> hex value as a string, so you need to cast it to a numeric type before you
> can actually use it.
>
>  n = nuke.selectedNode()
>  tile_color = int(nuke.tcl('value [topnode %s].tile_color' % n.name()),
> 16)
>
>
>  -Nathan
>
>
>  From: Adam Hazard 
>  Sent: Monday, April 23, 2012 10:12 AM
>  To: Nuke user discussion 
>  Subject: Re: [Nuke-users] python [topnode] equivalent
>
>  Thanks Ivan.
> This was pretty much exactly what I was looking for. However I had to
> change it a little bit because this was returning the tile color hex value,
> if I understand all this correctly, and my function needs just the integer
> value. As I can't assign or set a tile_color using hex, or I haven't been
> able to figure it out.
>
> Anyways, for whatever reason this does the trick, kinda mixing your code
> with what I had before. I am still not very sure why the tile_color has 2
> different value formats.
>
> n = nuke.selectedNode()
> topnode_name = nuke.tcl("full_name [topnode %s]" % n.name())
> topnode = nuke.toNode(topnode_name)
> tile_col = topnode['tile_color'].value()
>
> Thanks again and much appreciated.
> Adam
>
>
> On 04/20/2012 06:47 PM, Ivan Busquets wrote: Or if you just want the
> tile_color of the top node, you could of course do:
>
> n = nuke.selectedNode()
>
> tile_color = nuke.tcl("value [topnode %s].tile_color" % n.name())
>
> Hope that helps
>
>
>  On Fri, Apr 20, 2012 at 6:41 PM, Ivan Busquets wrote:
> You can use nuke.tcl() within python to execute a tcl command.
>
> So, in your case, something like this should work:
>
>n = nuke.selectedNode()
>
> topnode_name = nuke.tcl("full_name [topnode %s]" % n.name())
>
> topnode = nuke.toNode(topnode_name)
>
>
>
>  On Fri, Apr 20, 2012 at 6:30 PM, Adam Hazard  wrote:
> Hopefully a quick question,
>
> If I currently have a node selected somewhere in a tree, and I want to
> access the topnodes tile color using python, how would I do so? Using
> [[topnode].tile_color] doesn't seem to work as it is tcl? Looking around it
> seems you need to check dependecies of all the nodes or something, but I
> haven't been able to get anything to work.  Is there no way to convert the
> tcl function to work in python?
>
> Thanks in advance for any help,
> Adam
> ___
> 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 listnuke-us...@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 listnuke-us...@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.the

Re: [Nuke-users] python [topnode] equivalent

2012-04-23 Thread Hugo Léveillé
Its called string formatting

ex:
age = '16'
print "Hi, I am " + age + " years old"

is the same as:

print "Hi, I am %s years old" % age

It has the advantage of making clearer string writing as well as
converting int and floats to string as well

ex:

"I am %s years old and I have %s dollars" % (10 , 3.5)




On Mon, Apr 23, 2012, at 12:00, Adam Hazard wrote:

ok, cool, I think I understand it better now. Thanks, guys. Also,
if you don't mind, another question, what exactly is the '%'
doing in this code. And I have used 'int' before, and seen the
'16' posted around, what exactly are those doing, I am guessing
that is what converts the value from string to integer?
-Adam
On 04/23/2012 10:48 AM, Nathan Rusch wrote:

The problem isn’t hex vs. int; the value you’re getting back from
the Python knob is identical to the hex value returned by the
nuke.tcl call. The issue you’re running into is that the nuke.tcl
call is returning the hex value as a string, so you need to cast
it to a numeric type before you can actually use it.

n = nuke.selectedNode()
tile_color = int(nuke.tcl('value [topnode %s].tile_color' %
n.name()), 16)


-Nathan


From: [1]Adam Hazard
Sent: Monday, April 23, 2012 10:12 AM
To: [2]Nuke user discussion
Subject: Re: [Nuke-users] python [topnode] equivalent

Thanks Ivan.
This was pretty much exactly what I was looking for. However I
had to change it a little bit because this was returning the tile
color hex value, if I understand all this correctly, and my
function needs just the integer value. As I can't assign or set a
tile_color using hex, or I haven't been able to figure it out.
Anyways, for whatever reason this does the trick, kinda mixing
your code with what I had before. I am still not very sure why
the tile_color has 2 different value formats.
n = nuke.selectedNode()
topnode_name = nuke.tcl("full_name [topnode %s]" % n.name())
topnode = nuke.toNode(topnode_name)
tile_col = topnode['tile_color'].value()
Thanks again and much appreciated.
Adam
On 04/20/2012 06:47 PM, Ivan Busquets wrote: Or if you just want
the tile_color of the top node, you could of course do:

n = nuke.selectedNode()

tile_color = nuke.tcl("value [topnode %s].tile_color" %
[3]n.name())
Hope that helps
On Fri, Apr 20, 2012 at 6:41 PM, Ivan Busquets
<[4]ivanbusqu...@gmail.com> wrote:
You can use nuke.tcl() within python to execute a tcl command.
So, in your case, something like this should work:

n = nuke.selectedNode()

topnode_name = nuke.tcl("full_name [topnode %s]" % [5]n.name())

topnode = nuke.toNode(topnode_name)
On Fri, Apr 20, 2012 at 6:30 PM, Adam Hazard
<[6]ahaz...@tippett.com> wrote:
Hopefully a quick question,
If I currently have a node selected somewhere in a tree, and I
want to access the topnodes tile color using python, how would I
do so? Using [[topnode].tile_color] doesn't seem to work as it is
tcl? Looking around it seems you need to check dependecies of all
the nodes or something, but I haven't been able to get anything
to work.  Is there no way to convert the tcl function to work in
python?
Thanks in advance for any help,
Adam
___
Nuke-users mailing list
[7]Nuke-users@support.thefoundry.co.uk,
[8]http://forums.thefoundry.co.uk/
[9]http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-
users



___
Nuke-users mailing list
[10]Nuke-users@support.thefoundry.co.uk, [11]http://forums.thefoundry.co.u
k/
[12]http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users

  

___
Nuke-users mailing list
[13]Nuke-users@support.thefoundry.co.uk,
[14]http://forums.thefoundry.co.uk/
[15]http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke
-users



___
Nuke-users mailing list
[16]Nuke-users@support.thefoundry.co.uk, [17]http://forums.thefoundry.co.u
k/
[18]http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users

___
Nuke-users mailing list
[19]Nuke-users@support.thefoundry.co.uk,
[20]http://forums.thefoundry.co.uk/
[21]http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke
-users

References

1. mailto:ahaz...@tippett.com
2. mailto:nuke-users@support.thefoundry.co.uk
3. http://n.name/
4. mailto:ivanbusqu...@gmail.com
5. http://n.name/
6. mailto:ahaz...@tippett.com
7. mailto:Nuke-users@support.thefoundry.co.uk
8. http://forums.thefoundry.co.uk/
9. http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users
  10. mailto:Nuke-users@support.thefoundry.co.uk
  11. http://forums.thefoundry.co.uk/
  12. http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users
  13. mailto:Nuke-users@support.thefoundry.co.uk
  14. http://forums.thefoundry.co.uk/
  15. http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users
  16. mailto:Nuke-users@support.thefoundry.co.uk
  17. http://forum

Re: [Nuke-users] python [topnode] equivalent

2012-04-23 Thread Adam Hazard
ok, cool, I think I understand it better now. Thanks, guys. Also, if you 
don't mind, another question, what exactly is the '%' doing in this 
code. And I have used 'int' before, and seen the '16' posted around, 
what exactly are those doing, I am guessing that is what converts the 
value from string to integer?


-Adam

On 04/23/2012 10:48 AM, Nathan Rusch wrote:
The problem isn't hex vs. int; the value you're getting back from the 
Python knob is identical to the hex value returned by the nuke.tcl 
call. The issue you're running into is that the nuke.tcl call is 
returning the hex value as a string, so you need to cast it to a 
numeric type before you can actually use it.

n = nuke.selectedNode()
tile_color = int(nuke.tcl('value [topnode %s].tile_color' % n.name()), 16)
-Nathan

*From:* Adam Hazard 
*Sent:* Monday, April 23, 2012 10:12 AM
*To:* Nuke user discussion 
*Subject:* Re: [Nuke-users] python [topnode] equivalent
Thanks Ivan.
This was pretty much exactly what I was looking for. However I had to 
change it a little bit because this was returning the tile color hex 
value, if I understand all this correctly, and my function needs just 
the integer value. As I can't assign or set a tile_color using hex, or 
I haven't been able to figure it out.


Anyways, for whatever reason this does the trick, kinda mixing your 
code with what I had before. I am still not very sure why the 
tile_color has 2 different value formats.


n = nuke.selectedNode()
topnode_name = nuke.tcl("full_name [topnode %s]" % n.name())
topnode = nuke.toNode(topnode_name)
tile_col = topnode['tile_color'].value()

Thanks again and much appreciated.
Adam


On 04/20/2012 06:47 PM, Ivan Busquets wrote: Or if you just want the 
tile_color of the top node, you could of course do:


n = nuke.selectedNode()

tile_color = nuke.tcl("value [topnode %s].tile_color" % n.name 
())



Hope that helps


On Fri, Apr 20, 2012 at 6:41 PM, Ivan Busquets > wrote:

You can use nuke.tcl() within python to execute a tcl command.

So, in your case, something like this should work:

n = nuke.selectedNode()

topnode_name = nuke.tcl("full_name [topnode %s]" % n.name 
())


topnode = nuke.toNode(topnode_name)




On Fri, Apr 20, 2012 at 6:30 PM, Adam Hazard > wrote:

Hopefully a quick question,

If I currently have a node selected somewhere in a tree, and I want to 
access the topnodes tile color using python, how would I do so? Using 
[[topnode].tile_color] doesn't seem to work as it is tcl? Looking 
around it seems you need to check dependecies of all the nodes or 
something, but I haven't been able to get anything to work.  Is there 
no way to convert the tcl function to work in python?


Thanks in advance for any help,
Adam
___
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


___
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] Expressions causing slow-down.

2012-04-23 Thread Nick Guth
I'm using a simple sin expression several times on different mattes and it's 
causing my render times to increase 3-4x's normal.

(sin(frame/10)/2)+.5)

Is this normal behavior? Anything I can do to speed up the render? Thanks!

Sent from my iPad___
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] python [topnode] equivalent

2012-04-23 Thread Nathan Rusch
The problem isn’t hex vs. int; the value you’re getting back from the Python 
knob is identical to the hex value returned by the nuke.tcl call. The issue 
you’re running into is that the nuke.tcl call is returning the hex value as a 
string, so you need to cast it to a numeric type before you can actually use it.

n = nuke.selectedNode()
tile_color = int(nuke.tcl('value [topnode %s].tile_color' % n.name()), 16)


-Nathan



From: Adam Hazard 
Sent: Monday, April 23, 2012 10:12 AM
To: Nuke user discussion 
Subject: Re: [Nuke-users] python [topnode] equivalent

Thanks Ivan.
This was pretty much exactly what I was looking for. However I had to change it 
a little bit because this was returning the tile color hex value, if I 
understand all this correctly, and my function needs just the integer value. As 
I can't assign or set a tile_color using hex, or I haven't been able to figure 
it out.

Anyways, for whatever reason this does the trick, kinda mixing your code with 
what I had before. I am still not very sure why the tile_color has 2 different 
value formats. 

n = nuke.selectedNode()
topnode_name = nuke.tcl("full_name [topnode %s]" % n.name())
topnode = nuke.toNode(topnode_name)
tile_col = topnode['tile_color'].value()

Thanks again and much appreciated.
Adam


On 04/20/2012 06:47 PM, Ivan Busquets wrote: Or if you just want the tile_color 
of the top node, you could of course do:
  n = nuke.selectedNode()

  tile_color = nuke.tcl("value [topnode %s].tile_color" % n.name())
 

Hope that helps



On Fri, Apr 20, 2012 at 6:41 PM, Ivan Busquets  wrote:
You can use nuke.tcl() within python to execute a tcl command.

So, in your case, something like this should work:

  n = nuke.selectedNode()

  topnode_name = nuke.tcl("full_name [topnode %s]" % n.name())

  topnode = nuke.toNode(topnode_name)
 





On Fri, Apr 20, 2012 at 6:30 PM, Adam Hazard  wrote:
Hopefully a quick question,

If I currently have a node selected somewhere in a tree, and I want to access 
the topnodes tile color using python, how would I do so? Using 
[[topnode].tile_color] doesn't seem to work as it is tcl? Looking around it 
seems you need to check dependecies of all the nodes or something, but I 
haven't been able to get anything to work.  Is there no way to convert the tcl 
function to work in python?

Thanks in advance for any help,
Adam
___
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] python [topnode] equivalent

2012-04-23 Thread Adam Hazard

Thanks Ivan.
 This was pretty much exactly what I was looking for. However I had to 
change it a little bit because this was returning the tile color hex 
value, if I understand all this correctly, and my function needs just 
the integer value. As I can't assign or set a tile_color using hex, or I 
haven't been able to figure it out.


Anyways, for whatever reason this does the trick, kinda mixing your code 
with what I had before. I am still not very sure why the tile_color has 
2 different value formats.


n = nuke.selectedNode()
topnode_name = nuke.tcl("full_name [topnode %s]" % n.name())
topnode = nuke.toNode(topnode_name)
tile_col = topnode['tile_color'].value()

Thanks again and much appreciated.
Adam


On 04/20/2012 06:47 PM, Ivan Busquets wrote:
Or if you just want the tile_color of the top node, you could of 
course do:


n = nuke.selectedNode()

tile_color = nuke.tcl("value [topnode %s].tile_color" % n.name 
())



Hope that helps


On Fri, Apr 20, 2012 at 6:41 PM, Ivan Busquets > wrote:


You can use nuke.tcl() within python to execute a tcl command.

So, in your case, something like this should work:

n = nuke.selectedNode()

topnode_name = nuke.tcl("full_name [topnode %s]" % n.name
())

topnode = nuke.toNode(topnode_name)




On Fri, Apr 20, 2012 at 6:30 PM, Adam Hazard mailto:ahaz...@tippett.com>> wrote:

Hopefully a quick question,

If I currently have a node selected somewhere in a tree, and I
want to access the topnodes tile color using python, how would
I do so? Using [[topnode].tile_color] doesn't seem to work as
it is tcl? Looking around it seems you need to check
dependecies of all the nodes or something, but I haven't been
able to get anything to work.  Is there no way to convert the
tcl function to work in python?

Thanks in advance for any help,
Adam
___
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