Skip to content

Instantly share code, notes, and snippets.

import bpy
from bpy.types import Operator, DATA_PT_shape_keys
bl_info = {
"name": "Shape key mirror",
"description": "",
"author": "Lateasusual",
"version": (1, 0, 0),
"blender": (2, 81, 0),
"location": "Properties > Mesh > Shape Keys",
@Lateasusual
Lateasusual / panel.py
Created June 18, 2020 17:49
An example use of a multi-purpose context manager class (with some tricks from withhacks)
import imgui
from sys import _getframe, settrace
class Panel:
"""
This is... not a particularly *useful* example, but it allows us to have one Panel class which can be used for drawing *without* inheritance. See below for examples
"""
class Closed(Exception):
...
@tool
extends EditorScenePostImport
class MeshInstanceList:
var mesh: Mesh
var aabb: AABB
var transforms: Array
# Converts geometry node instances into MultiMeshInstances
func gn_instances_to_mm(parent: Node, scene: Node):