Skip to content

Instantly share code, notes, and snippets.

View WeaselOnaStick's full-sized avatar
🖥️
Coding During Spring Break

Weasel On A Stick WeaselOnaStick

🖥️
Coding During Spring Break
  • 14:26 (UTC +07:00)
View GitHub Profile
@esnosy
esnosy / faster_ray_cast_blender.py
Created June 3, 2021 16:43
How to efficiently ray cast static meshes Blender Python
import bpy
from mathutils.bvhtree import BVHTree
C = bpy.context
# Build BVH once
bvh = BVHTree.FromObject(C.object, C.evaluated_depsgraph_get())
for i in range(999999):
# Slower, this possibly builds BVH everytime