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][email protected],
[2]http://forums.thefoundry.co.uk/
[3]http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-
users
References
1. mailto:[email protected]
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
[email protected]
_______________________________________________
Nuke-users mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users