Skip to content

Instantly share code, notes, and snippets.

@UuuNyaa
UuuNyaa / plot_verts_and_edgs.py
Created November 30, 2022 03:51
Plot vertices and edges as mesh objects
import bpy
frames = [
{'leg.l': [(0.0, 1.1860303, 0.0), (-0.0695946, 1.0660217, -0.034061156), (-0.11811634, 0.57155114, -0.13624609), (-0.008873149, 0.04841693, -0.2796949), (-0.053069953, 0.0, -0.09684668)], 'leg.r': [(0.0, 1.1860303, 0.0), (0.0724319, 1.073727, -0.009826176), (0.12871023, 0.61304337, 0.20569803), (0.089175716, 0.058375914, 0.2882095), (0.11506506, 0.064310126, 0.47270375)], 'spine': [(0.0, 1.1860303, 0.0), (0.017183019, 1.3511815, -0.041037392), (0.022112308, 1.5361633, -0.020832425), (0.013682552, 1.6097751, -0.029291518), (-0.009506061, 1.884695, -0.101417266), (-0.029154574, 2.0003433, -0.036746368)], 'arm.l': [(0.013682552, 1.6097751, -0.029291518), (-0.10034585, 1.7455293, -0.08684481), (-0.2577192, 1.7277443, -0.10872765), (-0.11073624, 1.4572028, 0.040203743), (-0.045355406, 1.7803317, 0.16021127)], 'arm.r': [(0.013682552, 1.6097751, -0.029291518), (0.107355446, 1.7587388, -0.06060553), (0.26224223, 1.7657496, -0.13296261), (0.1572879, 1.4490935, -0.14701252), (0.22211389, 1.501365
@UuuNyaa
UuuNyaa / apply_smpl_motion.py
Created December 14, 2022 18:58
Apply SMPL motion to a SMPL model.
import json
import bpy
from mathutils import Matrix, Quaternion, Vector
SMPL_JOINT_NAMES = [
'pelvis', # 0
'left_hip', # 1
'right_hip', # 2
'spine1', # 3
@UuuNyaa
UuuNyaa / batch_request.py
Last active November 4, 2025 04:29
Batch processing for stable-diffusion-webui API with sd-webui-controlnet
import base64
import collections.abc
import glob
import io
import json
import math
import os
from concurrent.futures import ThreadPoolExecutor
from functools import lru_cache
from typing import Any, Dict, Iterable, List, Optional, Tuple, TypeVar
@UuuNyaa
UuuNyaa / gimp_color_correction.scm
Created March 10, 2023 18:26
Color correction for GIMP Script-Fu
(define (string-replace strIn strReplace strReplaceWith)
(let* (
(curIndex 0)
(replaceLen (string-length strReplace))
(replaceWithLen (string-length strReplaceWith))
(inLen (string-length strIn))
(result strIn)
)
;loop through the main string searching for the substring
(while (<= (+ curIndex replaceLen) inLen)
@UuuNyaa
UuuNyaa / setup_stable-diffusion-webui.sh
Last active May 26, 2023 16:38
Setup EC2 instance for stable-diffusion-webui
# install NVIDIA Drivers
sudo yum update -y
sudo yum install -y kernel-devel
# for amazon linux 2
# sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc10-cc 30
# for amazon linux 2023
sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 30