Sorry what I gave was just an example, not my actually code. I knew that
would cause problems, ha. Anyways as Woei pointed out in a personal
message, having 'shift' in a hotkey will automatically break off the
node from the tree. Thus putting it off to the side. So it is using the
shift key behaviour when I use my hotkeys. Both of the hotkeys I had
reassigned used the shift key. So I was able to fix it by using 'alt'
instead.
However the node I was redefining still spawned in odd locations no
matter what, and seems to be another issue entirely. if you set the knob
default of a node to have hide input on , then it spawns the node in the
top left corner. I tested these with multiple nodes. That seems like a
bug. but I don't know.
You could test this line, spawned the node in the corner with every node
I tested this on. Not sure if that is normal behavior.
nuke.knobDefault("Blur.hide_input","1")
For now I am fixing this issue by setting the node position based off
the selected node.
Thanks,
Adam
On 04/23/2012 07:39 PM, Hugo Léveillé wrote:
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
[email protected]
<mailto:[email protected]>,
http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users
--
Hugo Léveillé
TD Compositing, Vision Globale
[email protected] <mailto:[email protected]>
_______________________________________________
Nuke-users mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users
_______________________________________________
Nuke-users mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users