No, its not a bug. The code is just run in the context of the
group. Go inside the group in the DAG and you will see that the
viewer will zoom in the group's viewer. So, if you want to add
this button on a node, put the following code:
parent = nuke.thisNode()
xP = parent.xpos()
yP = parent.ypos()
nuke.zoom(1.35, [xP, yP])
On a group:
parent = nuke.thisGroup()
nuke.root().begin()
xP = parent.xpos()
yP = parent.ypos()
nuke.zoom(1.35, [xP, yP])
hope this help
On Thu, Jul 12, 2012, at 11:27, jaden wrote:
Hey,
I am creating a PyScript_Knob on some nodes. If the button is
pressed the viewer zooms to a specific node on tha DAG using the
nuke.zoom() function.
This is the script:
Code:
-->
--> def jumper():
parent =
nuke.toNode(nuke.thisNode().name().split("_test_")[0])
xP = parent.xpos()
yP = parent.ypos()
nuke.zoom(1.35, [xP, yP])
jumper()
-->
this works fine for standard nuke nodes, but it doesnt do
anything on gizmos and groups?! It prints the right arguments but
it does not run the nuke.zoom() function...
Do I miss something here? Does anyone know "why" ? or is it a
BUG?
jaden
_______________________________________________
Nuke-python mailing list
[1][email protected],
[2]http://forums.thefoundry.co.uk/
[3]http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-
python
References
1. mailto:[email protected]
2. http://forums.thefoundry.co.uk/
3. http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
--
Hugo Léveillé
TD Compositing, Vision Globale
[email protected]
_______________________________________________
Nuke-python mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python