Hi Terell,
I once built a gizmo that lets you do that. you can download it at Nukepedia:
http://www.nukepedia.com/gizmos/3d/distance3d_v02_fp
What it does, is actually calculating the distance between two objects.
Just plugin in your camera and the axis you want to use as the focal
point and link the output expression of the gizmo to your
Zdefocus.center.
Hope thats what you searching for.
Falko
Zitat von Terell Seitz <[email protected]>:
Hello All,
I am trying to setup a script that would let you drive the ZDefocus knob
"focal length (C)" with an axis node. The issue that I am running into is
that this value only updates when the users moves the "focal point" widget.
But the "focal point" can not be driven with a curve. To get around this I
am using a camera and axis plugged into a Reconcile3D node. Then that XY is
plugged into a CurveTool with its area set to 1 pixel by 1 pixel which I
then generate the average intensities of that tracked pixel to get me a
curve which I can plug into "focal length (C)". Is there anyway to cut the
CurveTool out of this, so that I don't have to generate keys every time I
move the axis? Maybe using callbacks? Thank you.
-Terell
example:
set cut_paste_input [stack 0]
version 8.0 v3
Axis2 {
inputs 0
translate {{curve x1 -5.25 x11 2.600000143 x19 8.880000114} {curve x1 0
x11 3.6500001 x19 0} {curve x1 -17.35000038 x11 -35.29999924 x19
-26.60000038}}
name Axis1
selected true
xpos -655
ypos 82
}
push $cut_paste_input
Camera2 {
name Camera1
selected true
xpos -827
ypos 138
}
push 0
Reconcile3D {
inputs 3
output {{curve x1 -222.0028629 89.38903046 325.711853 510.9821472
660.7803345 785.6762695 893.1765747 988.8966675 1077.319214 1162.33728
1247.712524 1336.664551 1431.431519 1534.44458 1648.183472 1775.250488
1918.386841 2080.411377 2264.04126 2264.04126} {curve x1 540 617.2484131
675.1998901 719.4093628 753.4528809 779.6951904 799.7203979 814.5803833
824.9375 831.1399536 833.2454224 828.2545166 813.8446655 790.5167847
758.4293213 717.5124512 667.5725708 608.413208 540 540}}
outputxyz {{curve x1 -5.25 -4.465000153 -3.680000067 -2.894999981
-2.109999895 -1.324999928 -0.5399999022 0.2450000942 1.030000091
1.815000176 2.600000143 3.385000229 4.170000076 4.955000401 5.740000248
6.525000095 7.309999943 8.095000267 8.880000114 8.880000114} {curve x1 0
0.3961749971 0.7844000459 1.156725049 1.505200028 1.821875095 2.098800182
2.328025103 2.501600027 2.611575127 2.650000095 2.590478659 2.422265768
2.160888672 1.821875095 1.420752048 0.9730468988 0.4942871332 0 0} {curve
x1 -17.35000038 -20.03352547 -22.66320038 -25.18517494 -27.54559898
-29.69062424 -31.56639862 -33.11907578 -34.2947998 -35.03972244
-35.29999924 -35.10458755 -34.55234146 -33.69423676 -32.58124924
-31.26435471 -29.79453087 -28.22275352 -26.60000038 -26.60000038}}
name Reconcile3D1
selected true
xpos -665
ypos 226
}
Ramp {
inputs 0
p0 {918 290}
p1 {918 694}
name Ramp1
selected true
xpos -503
ypos -25
}
set N19369690 [stack 0]
Shuffle {
out depth
name Shuffle1
selected true
xpos -422
ypos 30
}
CheckerBoard2 {
inputs 0
name CheckerBoard1
selected true
xpos -302
ypos -105
}
Copy {
inputs 2
from0 -rgba.alpha
to0 -rgba.alpha
channels depth
name Copy1
selected true
xpos -302
ypos 18
}
ZDefocus2 {
math far=1
center {{parent.CurveTool1.intensitydata}}
name ZDefocus1
selected true
xpos -302
ypos 239
}
push $N19369690
CurveTool {
ROI {{parent.Reconcile3D1.output} {parent.Reconcile3D1.output}
{parent.Reconcile3D1.output.x+1} {parent.Reconcile3D1.output.y+1}}
autocropdata {480 270 1440 810}
intensitydata {{curve x1 0.6188119054 0.8094059229 0.9529703259 1 1 1 1 1
1 1 1 1 1 1 1 1 0.933168292 0.7871286869 0.6188119054 0.6188119054} {curve
x1 0.6188119054 0.8094059229 0.9529703259 1 1 1 1 1 1 1 1 1 1 1 1 1
0.933168292 0.7871286869 0.6188119054 0.6188119054} {curve x1 0.6188119054
0.8094059229 0.9529703259 1 1 1 1 1 1 1 1 1 1 1 1 1 0.933168292
0.7871286869 0.6188119054 0.6188119054} {curve x1 0.6188119054}}
name CurveTool1
selected true
xpos -503
ypos 244
}
__________________________________________________
Falko Paeper
Tel. 0173 74 84 449
[email protected] | [email protected]
Skype: fpaeper
Karlsplatz 1 | 71638-Ludwigsburg
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
_______________________________________________
Nuke-users mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users