set cut_paste_input [stack 0] version 12.2 v8 push $cut_paste_input add_layer {P P.x P.y P.z} add_layer {N N.red N.green N.blue N.x N.y N.z N.alpha} Group { name SPACE_PROJECTOR6 selected true xpos 240 ypos -109 addUserKnob {20 User} addUserKnob {4 out_put l OUTPUT M {IMG PREF "CAM MASK" "" ""}} addUserKnob {4 projectmode l "PROJECTION MODE" M {"MOVING OBJECT" "FIXED OBJECT" "" "" ""}} projectmode "FIXED OBJECT" addUserKnob {41 in l "POSITION PASS" T POSITION.in} addUserKnob {41 in_1 l "NORMAL PASS" T NORMALS.in} addUserKnob {26 ""} addUserKnob {41 referenceframe l "REF FRAME" t "projection frame" T Axis2.referenceframe} addUserKnob {26 ""} addUserKnob {4 switch_operator l MERGE M {PLUS OVER "" "" ""}} addUserKnob {41 mix l "CAM SHADOWS" t "cam normals multiplication" T ADD_NORMALS.mix} addUserKnob {41 operator l "CAM MASK" t "cam mask operator" T Expression2.operator} addUserKnob {26 ""} addUserKnob {41 mix_1 l "PRECISION SLIDER" t "set lower value when artifacts appear" T Merge5.mix} addUserKnob {26 ""} addUserKnob {41 translate l "Texture translate" T Transform1.translate} addUserKnob {41 scale l "Texture scale" T Transform1.scale} addUserKnob {41 rotate l "Texture rotate" T Transform1.rotate} addUserKnob {41 filter T STMap1.filter} addUserKnob {26 ""} addUserKnob {26 text l "" -STARTLINE T "Space projector V1.1 by Peter Mercell 2022 | Special thanks go to Pedro Andrade @ COMP LAIR"} addUserKnob {26 site l "" +STARTLINE T "www.petermercell.com"} } Axis2 { inputs 0 translate {{-1*parent.Axis1.translate(referenceframe)} {-1*parent.Axis1.translate(referenceframe)} {-1*parent.Axis1.translate(referenceframe)}} rotate {{-1*parent.Axis1.rotate(referenceframe)} {-1*parent.Axis1.rotate(referenceframe)} {-1*parent.Axis1.rotate(referenceframe)}} scaling {{parent.Axis1.scaling(referenceframe)} {parent.Axis1.scaling(referenceframe)} {parent.Axis1.scaling(referenceframe)}} skew {{-1*parent.Axis1.skew(referenceframe)} {-1*parent.Axis1.skew(referenceframe)} {-1*parent.Axis1.skew(referenceframe)}} pivot {{-1*parent.Axis1.pivot(referenceframe)} {-1*parent.Axis1.pivot(referenceframe)} {-1*parent.Axis1.pivot(referenceframe)}} name Axis2 xpos 1366 ypos -727 addUserKnob {20 User} addUserKnob {3 referenceframe} referenceframe 9 } Axis2 { inputs 0 translate {{"\[topnode parent.input3].translate" x15 10.91281796} {"\[topnode parent.input3].translate"} {"\[topnode parent.input3].translate"}} rotate {{"\[topnode parent.input3].rotate" x21 0} {"\[topnode parent.input3].rotate"} {"\[topnode parent.input3].rotate"}} scaling {{"\[topnode parent.input3].scaling"} {"\[topnode parent.input3].scaling"} {"\[topnode parent.input3].scaling"}} skew {{"\[topnode parent.input3].skew"} {"\[topnode parent.input3].skew"} {"\[topnode parent.input3].skew"}} pivot {{"\[topnode parent.input3].pivot"} {"\[topnode parent.input3].pivot"} {"\[topnode parent.input3].pivot"}} name Axis1 xpos 1368 ypos -992 } Input { inputs 0 name CAM xpos 1629 ypos -398 number 2 } Constant { inputs 0 channels rgb color {{parent.Camera3.world_matrix.2} {parent.Camera3.world_matrix.6} {parent.Camera3.world_matrix.10} 0} name Constant1 xpos 1973 ypos -1064 } Input { inputs 0 name IMG xpos 1111 ypos -1276 } set N74b87000 [stack 0] Unpremult { channels all name Unpremult1 xpos 1111 ypos -1220 } Dot { name Dot8 xpos 1145 ypos -1154 } set N74b86800 [stack 0] Dot { name Dot11 xpos 1819 ypos -1154 } Shuffle { in N name NORMALS label "\[value in]" xpos 1785 ypos -1095 } set N74b86000 [stack 0] Dot { name Dot13 xpos 2117 ypos -1086 } Merge2 { inputs 2 operation multiply name Merge9 xpos 2083 ypos -1040 } Saturation { saturation 0.001 name Saturation1 xpos 2083 ypos -481 } add_layer {CamMask CamMask.red CamMask.green CamMask.blue CamMask.alpha} Shuffle { in rgb in2 CamMask green red blue red alpha red name POSITION2 label "\[value in2]" xpos 2083 ypos -410 } Expression { expr0 r>operator expr1 g>operator expr2 b>operator expr3 a>operator name Expression2 xpos 2083 ypos -339 addUserKnob {20 User} addUserKnob {7 operator R 0 0.1} operator 0.1 } Dot { name Dot12 xpos 2117 ypos 782 } push $N74b86800 Shuffle { in P name POSITION label "\[value in]" xpos 1111 ypos -1098 } set N74b84400 [stack 0] Add { value {{-1*parent.Axis1.world_matrix.3} {-1*parent.Axis1.world_matrix.7} {-1*parent.Axis1.world_matrix.11} 0} name Add1 xpos 1111 ypos -1001 } ColorMatrix { matrix { {{"parent.Axis1.world_matrix.0 ? parent.Axis1.world_matrix.0 : 1"} {parent.Axis1.world_matrix.1} {parent.Axis1.world_matrix.2}} {{parent.Axis1.world_matrix.4} {"parent.Axis1.world_matrix.5 ? parent.Axis1.world_matrix.5 : 1"} {parent.Axis1.world_matrix.6}} {{parent.Axis1.world_matrix.8} {parent.Axis1.world_matrix.9} {"parent.Axis1.world_matrix.10 ? parent.Axis1.world_matrix.10 : 1"}} } invert true name ColorMatrix1 xpos 1111 ypos -908 } set N7487f800 [stack 0] Dot { name Dot10 xpos -78 ypos -905 } Dot { name Dot9 xpos -78 ypos 774 } add_layer {Pref Pref.red Pref.green Pref.blue} Shuffle { in rgb in2 Pref out Pref name POSITION1 label "\[value in2]" xpos -6 ypos 765 } Input { inputs 0 name MASK xpos 1402 ypos 379 number 4 } Invert { channels alpha name Invert2 xpos 1402 ypos 426 } push $N74b84400 Dot { name Dot7 xpos 252 ypos -1089 } Dot { name Dot6 xpos 252 ypos -501 } push $N7487f800 ColorMatrix { matrix { {{"parent.Axis2.world_matrix.0 ? parent.Axis2.world_matrix.0 : 1"} {parent.Axis2.world_matrix.1} {parent.Axis2.world_matrix.2}} {{parent.Axis2.world_matrix.4} {"parent.Axis2.world_matrix.5 ? parent.Axis2.world_matrix.5 : 1"} {parent.Axis2.world_matrix.6}} {{parent.Axis2.world_matrix.8} {parent.Axis2.world_matrix.9} {"parent.Axis2.world_matrix.10 ? parent.Axis2.world_matrix.10 : 1"}} } invert true name ColorMatrix2 xpos 1111 ypos -739 } Add { value {{-1*parent.Axis2.world_matrix.3} {-1*parent.Axis2.world_matrix.7} {-1*parent.Axis2.world_matrix.11} 0} name Add2 xpos 1111 ypos -609 } Switch { inputs 2 which {{projectmode}} name PROJECT_MODE xpos 1111 ypos -504 } Add { value {{-1*parent.Camera3.world_matrix.3} {-1*parent.Camera3.world_matrix.7} {-1*parent.Camera3.world_matrix.11} 0} name Add7 xpos 1111 ypos -432 } ColorMatrix { matrix { {{"parent.Camera3.world_matrix.0 ? parent.Camera3.world_matrix.0 : 1"} {parent.Camera3.world_matrix.1} {parent.Camera3.world_matrix.2}} {{parent.Camera3.world_matrix.4} {"parent.Camera3.world_matrix.5 ? parent.Camera3.world_matrix.5 : 1"} {parent.Camera3.world_matrix.6}} {{parent.Camera3.world_matrix.8} {parent.Camera3.world_matrix.9} {"parent.Camera3.world_matrix.10 ? parent.Camera3.world_matrix.10 : 1"}} } invert true name ColorMatrix7 xpos 1111 ypos -308 } ColorMatrix { matrix { {{1/tan(parent.FOV_PM2.h_FOV)} 0 0} {0 {1/tan(parent.FOV_PM2.v_FOV)} 0} {0 0 {-1*((parent.Camera3.far+parent.Camera3.near)/(parent.Camera3.far-parent.Camera3.near))}} } name ColorMatrix8 xpos 1111 ypos -198 } Add { value {0 0 {-1*(2*(parent.Camera3.far*parent.Camera3.near))/(parent.Camera3.far-parent.Camera3.near)} 0} name Add8 xpos 1111 ypos -158 } Expression { expr0 (r/b) expr1 (g/b) name FINDING_2_GOOD_CHANNEL_FOR_STMAP2 xpos 1111 ypos -48 } Expression { expr0 (r+1)/2 expr1 (g+1)/2 expr2 0 name NORMAL_TO_STMAP2 xpos 1111 ypos 47 } set N7457f400 [stack 0] Remove { name Remove1 xpos 775 ypos 41 } Expression { expr0 (x+0.5)/width expr1 (y+0.5)/height name Expression1 xpos 775 ypos 77 } set N7457ec00 [stack 0] push $N7457f400 Merge2 { inputs 2 operation minus name Merge6 xpos 775 ypos 206 } FrameHold { first_frame {{parent.Axis2.referenceframe}} name FrameHold2 xpos 985 ypos 200 } push $N7457ec00 push $N7457f400 Merge2 { inputs 2 operation divide name Merge3 xpos 775 ypos 132 } FrameHold { first_frame {{parent.Axis2.referenceframe}} name FrameHold1 xpos 979 ypos 126 } push $N7457f400 Merge2 { inputs 2 operation multiply mix {{parent.Merge5.mix}} name Merge7 xpos 1111 ypos 132 disable {{projectmode}} } Merge2 { inputs 2 operation plus name Merge5 xpos 1111 ypos 206 disable {{1-projectmode}} } Input { inputs 0 name TEXTURE xpos 1619 ypos 267 number 1 } Unpremult { channels all name Unpremult2 xpos 1493 ypos 261 } Transform { center {{input.width/2 x1 0} {input.height/2 x1 0}} name Transform1 xpos 1376 ypos 267 } BlackOutside { name BlackOutside2 xpos 1275 ypos 267 } STMap { inputs 2 uv rgb name STMap1 xpos 1111 ypos 261 } Dot { name Dot5 xpos 1145 ypos 354 } set N7457c400 [stack 0] Dot { name Dot4 xpos 1751 ypos 354 } Dot { name Dot3 xpos 1751 ypos 488 } ChannelMerge { inputs 2 operation stencil name ChannelMerge1 xpos 1402 ypos 473 } Constant { inputs 0 channels rgb color {{parent.Camera3.world_matrix.2} {parent.Camera3.world_matrix.6} {parent.Camera3.world_matrix.10} 0} name Constant2 xpos 1631 ypos -492 } push $N74b86000 Merge2 { inputs 2 operation multiply name Merge4 xpos 1785 ypos -468 } Saturation { saturation 0.001 name Saturation2 xpos 1785 ypos -416 } Dot { name Dot14 xpos 1817 ypos 414 } push $N7457c400 Merge2 { inputs 2 operation multiply name ADD_NORMALS xpos 1111 ypos 411 } Copy { inputs 2 from0 rgba.alpha to0 rgba.alpha name Copy1 xpos 1111 ypos 479 } Premult { name Premult1 xpos 1111 ypos 570 } set N75055800 [stack 0] push $N74b87000 Dot { name Dot2 xpos 83 ypos -1273 } Dot { name Dot1 xpos 83 ypos 573 } set N75055000 [stack 0] Dot { name Dot15 xpos 229 ypos 622 } Merge2 { inputs 2 name Merge2 xpos 1111 ypos 626 } push $N75055800 push $N75055000 Merge2 { inputs 2 operation plus name Merge1 xpos 964 ypos 570 } Switch { inputs 2 which {{switch_operator}} name Switch1 xpos 964 ypos 689 } Switch { inputs 3 which {{out_put}} name Switch2 xpos 964 ypos 779 } Crop { box {0 0 {input.width} {input.height}} reformat true crop false name Crop1 xpos 964 ypos 842 } Output { name Output1 xpos 964 ypos 906 } Input { inputs 0 name AXIS xpos 1359 ypos -1064 number 3 } NoOp { inputs 0 name FOV_PM2 xpos 823 ypos -252 addUserKnob {20 User} addUserKnob {7 vaperture} vaperture {{parent.Camera3.vaperture}} addUserKnob {7 haperture} haperture {{parent.Camera3.haperture}} addUserKnob {7 focal} focal {{parent.Camera3.focal}} addUserKnob {26 ""} addUserKnob {7 v_FOV} v_FOV {{atan(vaperture/(2*focal))}} addUserKnob {7 v_ad R -1 1} addUserKnob {7 h_FOV} h_FOV {{atan(haperture/(2*focal))}} addUserKnob {7 h_ad R -1 1} } Camera2 { inputs 0 translate {{"\[topnode parent.input2].translate(referenceframe)"} {"\[topnode parent.input2].translate(referenceframe)"} {"\[topnode parent.input2].translate(referenceframe)"}} rotate {{"\[topnode parent.input2].rotate(referenceframe)"} {"\[topnode parent.input2].rotate(referenceframe)"} {"\[topnode parent.input2].rotate(referenceframe)"}} scaling {{"\[topnode parent.input2].scaling(referenceframe)"} {"\[topnode parent.input2].scaling(referenceframe)"} {"\[topnode parent.input2].scaling(referenceframe)"}} uniform_scale {{"\[topnode parent.input2].uniform_scale(referenceframe)"}} skew {{"\[topnode parent.input2].skew(referenceframe)"} {"\[topnode parent.input2].skew(referenceframe)"} {"\[topnode parent.input2].skew(referenceframe)"}} pivot {{"\[topnode parent.input2].pivot(referenceframe)"} {"\[topnode parent.input2].pivot(referenceframe)"} {"\[topnode parent.input2].pivot(referenceframe)"}} focal {{"\[topnode parent.input2].focal(referenceframe)"}} haperture {{"\[topnode parent.input2].haperture(referenceframe)"}} vaperture {{"\[topnode parent.input2].vaperture(referenceframe)"}} near {{"\[topnode parent.input2].near(referenceframe)"}} far {{"\[topnode parent.input2].far(referenceframe)"}} win_translate {{"\[topnode parent.input2].win_translate(referenceframe)"} {"\[topnode parent.input2].win_translate(referenceframe)"}} win_scale {{"\[topnode parent.input2].win_scale(referenceframe)"} {"\[topnode parent.input2].win_scale(referenceframe)"}} winroll {{"\[topnode parent.input2].winroll(referenceframe)"}} focal_point {{"\[topnode parent.input2].focal_point(referenceframe)"}} fstop {{"\[topnode parent.input2].fstop(referenceframe)"}} name Camera3 xpos 1638 ypos -337 addUserKnob {20 User} addUserKnob {3 referenceframe} referenceframe {{parent.Axis2.referenceframe}} } StickyNote { inputs 0 name StickyNote1 label "V1.2:\nmyMatrix = nukescripts.snap3d.cameraProjectionMatrix(nuke.selectedNode())" note_font_size 20 xpos 1141 ypos 868 } end_group