Skip to content

Instantly share code, notes, and snippets.

@p2or
p2or / link_frame_handler.py
Created February 20, 2020 12:22
Link Frame Handler #Blender
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@p2or
p2or / Natron-Flicker.py
Created October 28, 2019 07:35
Flicker #Natron
# -*- coding: utf-8 -*-
# DO NOT EDIT THIS FILE
# This file was automatically generated by Natron PyPlug exporter version 10.
# Hand-written code should be added in a separate file named N_FlickerExt.py
# See http://natron.readthedocs.org/en/master/devel/groups.html#adding-hand-written-code-callbacks-etc
# Note that Viewers are never exported
import NatronEngine
import sys
@p2or
p2or / gtk.css
Created October 26, 2019 18:14
Titlebar size based on: https://unix.stackexchange.com/a/343643 #Gnome
/* ---------------------------------------------------------------------------
* Custom CSS to reduce title bar size
* ------------------------------------------------------------------------- */
/* shrink headerbars (don't forget semicolons after each property) */
headerbar {
min-height: 0px;
padding-left: 2px; /* same as childrens vertical margins for nicer proportions */
padding-right: 2px;
background-color: #2d2d2d;
@p2or
p2or / centOS_gaffer-cycles
Last active May 22, 2023 14:13
CentOS Gaffer-Cycles #Gaffer
# nano ~/.bash_profile
export PATH=$PATH\:/opt/gaffer-0.54.1.0-linux/bin
export GAFFERCYCLES="/opt/gafferCycles/"
export GAFFER_EXTENSION_PATHS=$GAFFERCYCLES:$GAFFER_EXTENSION_PATHS
@p2or
p2or / io_fusion_tracking_scene.py
Last active January 19, 2024 09:37
Export Camera to BMD Fusion [Blender 2.8x] from https://blenderartists.org/t/addon-export-camera-to-bmd-fusion #BlenderArtists
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
custom_range = (0,10)
filename = "~/flipbook/flip_$F4.png"
cur_desktop = hou.ui.curDesktop()
scene = cur_desktop.paneTabOfType(hou.paneTabType.SceneViewer)
flip_options = scene.flipbookSettings().stash()
flip_options.frameRange(custom_range)
flip_options.output(filename)
scene.flipbook(scene.curViewport(), flip_options)
@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 / blender-generate-mix-shader-example.py
Created June 24, 2019 10:37
Example on how to generate gloss diffuse shader via pyhon #Blender #BSE
# for https://blender.stackexchange.com/q/143599/3710
import bpy
mat_name = "Material_Name"
# check whether the material already exists
if bpy.data.materials.get(mat_name):
mat = bpy.data.materials[mat_name]
else: