Skip to content

Instantly share code, notes, and snippets.

View Taremin's full-sized avatar

Taremin Taremin

View GitHub Profile
@Taremin
Taremin / rename_uv.py
Created August 6, 2023 12:46
UVMapの名前を正規表現でリネームするBlenderスクリプト
import bpy
import re
pattern = re.compile(r'^Bake(?:\.\d{3})?$')
new_name = "BakeUV"
for obj in bpy.data.objects:
if obj.type != "MESH":
continue
for uv_layer in obj.data.uv_layers:
@Taremin
Taremin / __init__.py
Last active January 9, 2022 21:58
アクティブスプラインの制御点を概ね等間隔にする Blender Addon (とりあえず実装)
import bpy
bl_info = {
'name': 'Relax Curve Control Point',
'category': '3D View',
'author': 'Taremin',
'location': 'View 3D > Curve > EditMode > Context Menu',
'description': 'カーブの制御点を整列します',
'version': (0, 0, 2),
@Taremin
Taremin / anisotropic.osl
Last active August 2, 2021 11:12
Anisotropic Reflection
/*
* https://en.wikibooks.org/wiki/GLSL_Programming/Unity/Brushed_Metal
*/
float anisotropy(
vector varyingNormalDirection,
vector varyingTangentDirection,
vector lightDirection,
vector viewDirection,
float alphaX,
float alphaY
@Taremin
Taremin / mi_curve_stretch.py
Created June 20, 2020 08:12
MiraToolsのCStreachで制御点を移動中にX,Y,Zキーで軸固定するパッチ
# ***** 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
@Taremin
Taremin / __init__.py
Created May 8, 2020 12:19
HumanoidボーンのJSONをつかって頂点グループ(ウェイト)を置換するBlenderアドオン
import bpy
import json
import numpy
bl_info = {
'name': 'Taremin Replace Weight',
'category': '3D View',
'author': 'Taremin',
'location': 'View 3D > UI > Taremin Replace Weight',
'description': "",
namespace ExportHumanoidRig
{
using System.Collections.Generic;
using System.Linq;
using UnityEditor;
using UnityEngine;
[System.Serializable]
public class ExportHumanoidRigWindow : EditorWindow
{
shader hue_shift (
float Hue = 0.0,
float Scale = 1.0,
output float Highlight = 0.0,
output float Shadow = 0.0
) {
float tmp = Hue * 3;
Shadow = ((round(tmp) - tmp) * Scale + tmp) / 3.0;
Highlight = ((floor(tmp) + 0.5 - tmp) * Scale + tmp) / 3.0;
}
float fract(float a) {
return a - floor(a);
}
point fract(point p) {
return point(fract(p[0]), fract(p[1]), fract(p[2]));
}
float lerp(float a, float b, float t) {
return (1 - t) * a + t * b;
}
@Taremin
Taremin / ReplaceOnAssetsUpdate.cs
Last active November 9, 2018 14:38
アセット更新時に自動的に文字列置換を行うUnityエディタ拡張
namespace ReplaceOnAssetsUpdate {
using System.IO;
using System.Text.RegularExpressions;
using UnityEditor;
using UnityEngine;
public class ReplaceOnAssetsUpdateWindow : EditorWindow {
public static string jsonPath = "";
void OnEnable () {
@Taremin
Taremin / __init__.py
Last active August 28, 2020 09:49
Voxel Heat Diffuse Skinning アドオンで選択したボーンのみで処理を行う補助アドオン
bl_info = {
"name": "Voxel Heat Diffuse Skinning - Only selected bones",
"author": "Taremin",
"version": (0, 0),
"blender": (2, 79, 0),
"location": "View3D > Tools > Animation",
"description": "Voxel Heat Diffuse Skinning - Only selected bones",
"warning": "",
"category": "Object"
}