I'm such a retard. Of course I'm on Nuke 7 and I have been using the DepthToPosition node.
Just had a complete brain freeze, hahaha.

Sorted, thanks Michael! :-D

On 20/11/12 4:59 PM, Michael Garrett wrote:
I assuming you're not using the Nuke 7 public beta for this, because there is a "DepthToPosition" node in there! Otherwise, try this. I'm using Topnode for the camera input to grab the projection knobs.


Group {
 inputs 2
 name ZtoPworld
help "Creates Pworld point data from a raw depth channel and an input camera."
 selected true
 xpos -201
 ypos 45
 addUserKnob {20 User}
 addUserKnob {41 from0 l "input z channel" T Copy1.from0}
}
 Input {
  inputs 0
  name Input
  xpos 715
  ypos -750
 }
set N219b4e80 [stack 0]
push $N219b4e80
 Copy {
  inputs 2
  from0 depth.Z
  to0 rgba.blue
  name Copy1
  selected true
  xpos 715
  ypos -715
 }
 Expression {
  expr0 cx
  expr1 cy*(input.width/input.height)*input.pixel_aspect
  name Expression7
  label NDC
  xpos 715
  ypos -660
 }
 Expression {
  temp_name0 h_tan
  temp_expr0 (haperture/2)/focal
  temp_name1 v_tan
  temp_expr1 (vaperture/2)/focal
  expr0 b*(r*h_tan)
  expr1 b*(g*v_tan)
  name Expression8
  label "NDC to Pcam"
  xpos 715
  ypos -607
  addUserKnob {20 User}
  addUserKnob {7 focal}
  focal {{"\[topnode parent.input1].focal"}}
  addUserKnob {7 haperture}
  haperture {{"\[topnode parent.input1].haperture"}}
  addUserKnob {7 vaperture}
  vaperture {{"\[topnode parent.input1].vaperture"}}
 }
 Multiply {
  channels {-rgba.red -rgba.green rgba.blue}
  value -1
  name Multiply3
  xpos 715
  ypos -530
 }
 ColorMatrix {
  matrix {
{{Axis1.world_matrix.0 i} {Axis1.world_matrix.1 i} {Axis1.world_matrix.2 i}} {{Axis1.world_matrix.4 i} {Axis1.world_matrix.5 i} {Axis1.world_matrix.6 i}} {{Axis1.world_matrix.8 i} {Axis1.world_matrix.9 i} {Axis1.world_matrix.10 i}}
    }
  name ColorMatrix3
  label "Inverse Cam rotation"
  xpos 715
  ypos -492
 }
 Add {
  channels rgb
value {{Axis1.world_matrix.3 i} {Axis1.world_matrix.7 i} {Axis1.world_matrix.11 i} {curve i}}
  name Add3
  label "World minus Camera pos"
  xpos 715
  ypos -441
 }
set N525d9a0 [stack 0]
 Output {
  name Output1
  xpos 715
  ypos -346
 }
 Input {
  inputs 0
  name cam
  xpos 498
  ypos -684
  number 1
 }
 Axis2 {
  display off
  selectable false
  name Axis1
  xpos 508
  ypos -637
 }
push $N525d9a0
 Viewer {
  frame 10
  input_process false
  name Viewer1
  xpos 959
  ypos -619
 }
end_group



On 19 November 2012 19:45, Frank Rueter <fr...@beingfrank.info <mailto:fr...@beingfrank.info>> wrote:

    yes, that's how I can do it and probably will (happy to use your
    setup in stead of reinventing the wheel).
    I did send in a feature request to have a DeepToPosition node
    though (though it should probably be a "DepthToPosition" node
    seeing you don't need deep for this)



    On 20/11/12 4:39 PM, Michael Garrett wrote:
    If you're just trying to create a regular "flat" position pass,
    can't you just flatten deep.front and then use a regular Nuke
    Expression node plus the Camera matrix to convert that to
    position? I can send you the setup if you need it.

    I've gone over the expressions required to convert a deep opacity
    file to deep position (position render as deep data) and as we
    know, the DeepExpression node doesn't support some things yet.


    On 19 November 2012 01:27, Patrick Heinen
    <mailingli...@patrickheinen.com
    <mailto:mailingli...@patrickheinen.com>> wrote:

        Ok, i thought you wanted to use the DeepExpression node to
        calculate those xyz coordinates, which as you say would be
        possible, but not comfortable. Yes Deep is always camera
        relative, that's the drawback with it. But as the
        DeepToPoints node exists, you're right that it shouldn't be
        to complicated to write a deep  to point position node.
        +1 for the feature request, maybe it makes it into the releas
        *hope* ;)

        cheers,
        Patrick

        ----- Original Message -----
        From: fr...@beingfrank.info <mailto:fr...@beingfrank.info>
        To: nuke-users@support.thefoundry.co.uk
        <mailto:nuke-users@support.thefoundry.co.uk>
        Date: 19.11.2012 02:42:30
        Subject: Re: [Nuke-users] deep position in DeepExpression?


        > Hi Patrick,
        >
        > x and y only give you screen space positions, not world
        positions.
        > With the camera and depth available obviously this can be
        converted to
        > world position, but I'd really like to see a built in solution.
        > Basically like the DeepToPoints but a DeepToPosition.
        >
        > The brute force way would be to render a full resolution
        DeepToPoint
        > through the ScanlineRender node and generate positon
        vectors in it. But
        > that is stupidly slow and really shouldn't be necessary.
        >
        > Will send in a feature request.
        >
        > Cheers,
        > frank
        >
        > On 19/11/12 11:41 AM, Patrick Heinen wrote:
        >> Hi Frank,
        >>
        >> you should be able to acces x and y with x and y. I was at
        least able to produce a uv map, if that's the kind of
        funcionality you're somehow looking for. However the Deep
        Expression Node is not working exactly as the Expression
        Node. This came up on the mailinglist and there is a feature
        request logged for expanding the deep expression node to
        match the functionality of the expression node #27372.
        >> Tell me if you succeed in your attempt of creating a world
        position pass, I would really be interested in that.
        >>
        >> cheers
        >> Patrick
        >> Am 18.11.2012 um 21:58 schrieb Frank Rueter:
        >>
        >>> Is it possible to get a pixel's position in a
        DeepExrpression node? I am trying to create a world position
        pass from the image and the associated camera.
        >>>
        >>> Cheers,
        >>> frank
        >>> _______________________________________________
        >>> Nuke-users mailing list
        >>> Nuke-users@support.thefoundry.co.uk
        <mailto: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
        <mailto: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
        <mailto: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
        <mailto: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  
<mailto: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
    <mailto: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

Reply via email to