Skip to content

Instantly share code, notes, and snippets.

@p2or
p2or / CornerPinOffset
Created June 12, 2022 18:58 — forked from jedypod/CornerPinOffset
CornerPin node with offset controls for each corner. Useful for tweaking cornerpin after all keyframes are baked (e.g. , from a tracker), in case you need to cheat the perspective or something else #Nuke
set cut_paste_input [stack 0]
push $cut_paste_input
Group {
name CornerPinOffset
tile_color 0x9073adff
addUserKnob {20 PinControl}
addUserKnob {26 CornerPinControls l "" +STARTLINE T "<font size=5><b>Corner Pin Data</b></font>"}
addUserKnob {20 CornerPinData l "" +STARTLINE n 1}
addUserKnob {41 to1 T cpMaster.to1}
addUserKnob {41 enable1 -STARTLINE T cpMaster.enable1}
@p2or
p2or / metabox-multiple.php
Created March 26, 2021 13:40 — forked from cferdinandi/metabox-multiple.php
Create a metabox with multiple fields #WP
<?php
/**
* Create a metabox with multiple fields.
* Replace `_namespace` with some namespace for your project to avoid conflicts with other items
*/
//
// Create Metabox
//
@p2or
p2or / MobileARShadow.shader
Created January 2, 2021 16:24 — forked from DanMillerDev/MobileARShadow.shader
Shadows on transparent geometry shader #Unity
//This is based on a shader from https://alastaira.wordpress.com/2014/12/30/adding-shadows-to-a-unity-vertexfragment-shader-in-7-easy-steps/
Shader "Custom/MobileARShadow"
{
SubShader {
Pass {
// 1.) This will be the base forward rendering pass in which ambient, vertex, and
// main directional light will be applied. Additional lights will need additional passes
// using the "ForwardAdd" lightmode.
@p2or
p2or / OpticalZDefocus.md
Created July 2, 2019 11:40 — forked from jedypod/OpticalZDefocus.md
OpticalZDefocus is a physically accurate ZDefocus, which controls circle of confusion (coc) size based on lens geometry using the depth of field equation. Set your lens and film-back characteristics, your focus distance, and adjust the size of your bokeh with the aperture size, just like a real lens. #Nuke

OpticalZDefocus

OpticalZDefocus is a physically accurate ZDefocus, which controls circle of confusion size based on lens geometry using the depth of field equation.

  1. Set your focal length and film-back characteristics to match the lens that shot your plate
  2. Animate your focus distance
  3. Adjust the f-stop to match the size of your bokeh to your plate

Just like a real lens! (And using the same math :P )

Features

@p2or
p2or / convert_anim.py
Created November 9, 2018 23:16 — forked from pink-vertex/convert_anim.py
Applies parent inverse matrix to the child's local matrix #Blender
import bpy
import mathutils
class Converter:
def __init__(self, ob, logging=False):
self.ob = ob
self.action = ob.animation_data.action
self.rot_mode = ob.rotation_mode
self.logging = logging
@p2or
p2or / mesh_to_pointcloud.md
Created October 15, 2018 12:35 — forked from keijiro/mesh_to_pointcloud.md
How to convert a mesh into a point cloud #Houdini

screenshot

  1. Import the source geometry.
  2. Append a Point Wrangle SOP and set the following snippet.
int vlist[] = pointvertices(0, @ptnum);
vector uv = vertex(0, "uv", vlist[0]);
@Cd = colormap("$HIP/TEXTURE_FILENAME.jpg", uv);
  1. Insert a Delete SOP. Change the pattern to "*". Enable "Keep Points".
@p2or
p2or / premult-exr-psd.nk
Last active May 22, 2023 12:49 — forked from julik/unpremult.jsx
Unpremultiply the selected Photoshop layer #Nuke
set cut_paste_input [stack 0]
version 11.0 v1
Read {
inputs 0
file Untitled-1.psd
format "3881 1081 0 0 3881 1081 1 "
origset true
name Read6
selected true
xpos 1335
@p2or
p2or / print_github_bitbucket.js
Created July 24, 2016 19:27 — forked from markov00/print_github_bitbucket.js
Github print styling #Bookmarlet
javascript:void%20function(){(function(e,o,i,a,n,r,t,d){(!(n=e.jQuery)||i%3En.fn.jquery||a(n))%26%26(r=o.createElement(%22script%22),r.type=%22text/javascript%22,r.src=%22http://ajax.googleapis.com/ajax/libs/jquery/%22+i+%22/jquery.min.js%22,r.onload=r.onreadystatechange=function(){t||(d=this.readyState)%26%26%22loaded%22!=d%26%26%22complete%22!=d||(a((n=e.jQuery).noConflict(1),t=1),n(r).remove())},o.documentElement.childNodes[0].appendChild(r))})(window,document,%221.3.2%22,function(e,o){e(%22%23header,%20.header,.gh-header-actions,.repo-nav,.site-footer,%20.pagehead,%20.breadcrumb,%20.commit,%20.meta,%20%23footer,%20%23footer-push,%23wiki-rightbar%22).remove(),e(%22%23files,%20.file%22).css({background:%22none%22,border:%22none%22}),e(%22.aui-group,.aui-sidebar,.aui-header,%23wiki%20header,footer,.revision-date%22).css({display:%22none%22}),e(%22%23wiki%20.wiki-content%22).css({border:%22none%22,overflow:%22hidden%22}),e(%22.aui-page-panel%22).css({%22padding-left%22:0}),e(%22link%22).removeAttr(%22media%22
@p2or
p2or / playPausePanel.py
Created January 15, 2016 17:18 — forked from sambler/playPausePanel.py
PlayPause panel #Blender
# made in response to
# http://blender.stackexchange.com/q/44983/935
bl_info = {
"version": (1, 0),
"blender": (2, 75, 0),
"name": "testing play pause",
"description": """testing addon""" ,
"category": "test",
@p2or
p2or / colorTempToRGB.js
Created December 18, 2015 15:51 — forked from paulkaplan/colorTempToRGB.js
Color Temperature to RGB #Color
// From http://www.tannerhelland.com/4435/convert-temperature-rgb-algorithm-code/
// Start with a temperature, in Kelvin, somewhere between 1000 and 40000. (Other values may work,
// but I can't make any promises about the quality of the algorithm's estimates above 40000 K.)
function colorTemperatureToRGB(kelvin){
var temp = kelvin / 100;