Skip to content

Instantly share code, notes, and snippets.

View willstott101's full-sized avatar
🥁

Will Stott willstott101

🥁
View GitHub Profile
@willstott101
willstott101 / test_finalizer_weak_dict.py
Created August 15, 2022 15:35
MCVE of how finalizers cannot depend on weak reference state in the presence of circular references.
from weakref import WeakValueDictionary
import gc
objs = WeakValueDictionary()
class Registered:
def __init__(self):
objs[id(self)] = self
def __del__(self):
del objs[id(self)]
@willstott101
willstott101 / psd_to_gltf.py
Created October 7, 2023 12:29
Converts a PSD or PSB file to a layered shadeless GLTF file
# Depends on psd-tools pygltflib
from psd_tools import PSDImage
import pygltflib
from pygltflib import GLTF2
import sys
import os
import numpy as np