Skip to content

Instantly share code, notes, and snippets.

# This Python script for Blender first tries to convert all the Blender scene meshes into quads
# It will then proceed to merge all vertices that occupy the same position
# Lastly, it will subdivide the quad edges until every edge has at least the length of the "max_edge_length" variable
# You can use this script to subdivide the scene into quads, which is ideal for vertex lighting
# Please set the "max_edge_length" and "vert_merge_distance" variables value accordingly
# Set the maximum edge length here. The smaller the value, the more the edges get subdivided
max_edge_length = 300.0
# Set the minimum distance a vertex can have from each other not to be merged here
//Original code from:
//https://github.com/RishiAstra/Survive-From-Scratch/blob/21d98a4dcbb3ef25a79bb3ca9733b35b866eda74/Assets/AwesomeTechnologies/VegetationStudio/Utility/LightProbeUtility.cs
//Added EvaluateSH2 method to evaluate the SH2 with C#, so it will work with Unity Jobs
public class LightProbeUtility
{
public struct LightProbeData
{
public Vector4 unity_SHAr;
public Vector4 unity_SHAg;
public Vector4 unity_SHAb;
Shader "Hidden/SpecularDiffuseToAlbedo"
{
SubShader
{
// No culling or depth
Cull Off ZWrite Off ZTest Always
Pass
{
precision highp float;
varying vec2 vUv;
varying vec3 vecPos;
varying vec3 vecNormal;
uniform sampler2D _Diffuse;
uniform sampler2D _Specular;
@rickomax
rickomax / UVCoordinatesEditor.mel
Created November 28, 2020 17:39
MELScript to edit Maya mesh UVs by using values
global proc CreateUI() {
global int $job;
if (`window -ex _uv_window`) {
return;
}
$job = `scriptJob -idleEvent UpdateUI`;
window -t "UV Coordinates Editor" _uv_window;
columnLayout;
rowLayout -numberOfColumns 4;
text "u";