Skip to content

Instantly share code, notes, and snippets.

View kingmax's full-sized avatar

Jason kingmax

View GitHub Profile
@kingmax
kingmax / TransparentScreenshotRecorder.cs
Created November 24, 2022 07:11 — forked from haosizheng/ImageSequenceRecorderWithTransparentBackground.cs
Render screenshots in Unity with transparent backgrounds
using UnityEngine;
using System.Collections;
using System.IO;
using UnityEngine.Rendering.Universal;
/*
Usage:
1. Attach this script to your chosen camera's game object.
2. Set that camera's Clear Flags field to Solid Color.
3. Use the inspector to set frameRate and framesToCapture
@kingmax
kingmax / TransparentBackgroundScreenshotRecorder.cs
Created November 24, 2022 07:06 — forked from bitbutter/TransparentBackgroundScreenshotRecorder.cs
Rendering screenshots from Unity3d with transparent backgrounds
using UnityEngine;
using System.Collections;
using System.IO;
/*
Usage:
1. Attach this script to your chosen camera's game object.
2. Set that camera's Clear Flags field to Solid Color.
3. Use the inspector to set frameRate and framesToCapture
@kingmax
kingmax / GLSL-Noise.md
Created September 7, 2022 06:00 — forked from patriciogonzalezvivo/GLSL-Noise.md
GLSL Noise Algorithms

Generic 1,2,3 Noise

float rand(float n){return fract(sin(n) * 43758.5453123);}

float noise(float p){
	float fl = floor(p);
  float fc = fract(p);
	return mix(rand(fl), rand(fl + 1.0), fc);
}
@kingmax
kingmax / check_uv_flips_overlaps.py
Created June 27, 2022 09:00 — forked from SEVEZ/check_uv_flips_overlaps.py
Maya Python script for selecting overlapped and flipped uv polygons
import math
import maya.api.OpenMaya as om
from pymel.core import *
from pymel.core.datatypes import *
def createBoundingCircle(meshfn):
"""Parameter: meshfn - MFnMesh
Represent a face by a center and radius, i.e.
center = [center1u, center1v, center2u, center2v, ... ]
radius = [radius1, radius2, ... ]
@kingmax
kingmax / workspaceControl.py
Created December 14, 2018 03:37 — forked from ryusas/workspaceControl.py
A simple example to avoid the issue of Maya 2017 workspaceControl.
# coding: utf-8
u"""
Maya 2017 workspaceControl の問題回避のサンプル。
workspaceControl と workspaceControlState のゴミが残らないようにする。
retain=False の場合でも何故か state のゴミが残ってしまうが、
scriptJob で workspaceControl の削除を監視して state も同時に削除するようにする。
retain=True の場合は、UI が閉じたとしても state は残って良いはずなので監視はしない。
@kingmax
kingmax / shelfBase.py
Created December 14, 2018 01:39 — forked from vshotarov/shelfBase.py
Maya base class for building custom shelves.
import maya.cmds as mc
def _null(*args):
pass
class _shelf():
'''A simple class to build shelves in maya. Since the build method is empty,
it should be extended by the derived class to build the necessary shelf elements.