Skip to content

Instantly share code, notes, and snippets.

View bitinn's full-sized avatar
🔜
Personal Project

David Frank bitinn

🔜
Personal Project
View GitHub Profile
@bitinn
bitinn / .a-unity-git-config.md
Last active June 25, 2024 13:21
My Unity git config
@bitinn
bitinn / finder-tab-restore.applescript
Created January 2, 2019 07:05
restore finder tabs after close
tell application "Finder"
activate
-- Get current user's name
tell application "System Events"
set currentUser to (name of current user)
end tell
-- for cleanliness
close every window
@bitinn
bitinn / MainLightDataNode.cs
Last active August 11, 2023 08:15 — forked from ciro-unity/MainLightNode.cs
A custom node for Unity's ShaderGraph to capture lighting and use it into the shader. Works as of Dec 2018, but the APIs might change!
using UnityEngine;
using UnityEditor.ShaderGraph;
using System.Reflection;
// IMPORTANT:
// - tested with LWRP and Shader Graph 4.6.0-preview ONLY
// - likely to break in SG 5.x and beyond
// - for HDRP, add your own keyword to detect environment
[Title("Custom", "Main Light Data")]
@bitinn
bitinn / pre-commit
Last active September 5, 2024 06:50
pre-commit hook to prevent large file on git commit (and allow git-lfs tracked binary files to pass through)
#!/bin/sh
#
# An example hook script to verify what is about to be committed.
# Called by "git commit" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
# To enable this hook, rename this file to "pre-commit".
# Redirect output to stderr.
@bitinn
bitinn / LWRPCustomCameraEditor.cs
Created November 16, 2018 03:48
Why doesn't LWRPCustomCameraEditor add a label?
using UnityEngine;
using UnityEditor;
using UnityEngine.Experimental.Rendering.LightweightPipeline;
using UnityEditor.Experimental.Rendering.LightweightPipeline;
//[CustomEditor(typeof(Camera))]
[CustomEditorForRenderPipeline(typeof(Camera), typeof(LightweightRenderPipelineAsset))]
//public class LWRPCustomCameraEditor : Editor {
public class LWRPCustomCameraEditor : CameraEditor {
@bitinn
bitinn / bitinn.py
Last active January 11, 2024 01:36
Blender keymap for busy Maya / Unity / Substance Designer users
# version: 1.0.1
# latest source: https://gist.github.com/bitinn/22f6fefe026d8d9e83468864edb8f835
import bpy
import os
def kmi_props_setattr(kmi_props, attr, value):
try:
setattr(kmi_props, attr, value)
@bitinn
bitinn / depth.shader
Created May 16, 2018 04:01
depth.shader
Shader "Hidden/BeginHQ/FogMachine" {
HLSLINCLUDE
#include "PostProcessing/Shaders/StdLib.hlsl"
/* effect parameters */
TEXTURE2D_SAMPLER2D(_MainTex, sampler_MainTex);
TEXTURE2D_SAMPLER2D(_CameraDepthTexture, sampler_CameraDepthTexture);
@bitinn
bitinn / example.shader
Created May 1, 2018 13:16
shader debug
Shader "Leocities/Tileable"
{
Properties
{
_BaseColorMask("BaseColor Mask", 2D) = "white" {}
_NormalMetallicRoughness("Normal Metallic Roughness", 2D) = "black" {}
[Toggle]_UseDecal("Use Decal", Range( 0 , 1)) = 1
[Toggle]_UseDecalNormal("Use Decal Normal", Range( 0 , 1)) = 1
_DecalBackgroundColor("Decal Background Color", Color) = (0,0,0,0)
_DecalForegroundColor("Decal Foreground Color", Color) = (1,1,1,0)
@bitinn
bitinn / output.txt
Created March 19, 2018 06:36
console output
source dp_MaterialManager.mel;
materialManager;
// Error: "source dp_materialManager.mel;\n\
//
// Error: "/Users/df/Library/Preferences/Autodesk/maya/2018LT/prefs/scripts/dp_MaterialManager.mel" line 2250.1: Unterminated string. //
// Error: deleteUI mmDockWindow; \n\
//
// Error: "/Users/df/Library/Preferences/Autodesk/maya/2018LT/prefs/scripts/dp_MaterialManager.mel" line 2252.25: Syntax error //
// Error: deleteUI materialManagerWindow; \n\
//
@bitinn
bitinn / UISubmitInput.cs
Created March 1, 2018 15:38
Fake OnSubmit for Input Field
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;
namespace BeginHQ.Utility {
/*
redirect submit event to parent
*/