Browse Source

move blender script code into functions

master
poikilos 5 years ago
committed by Jacob Gustafson
parent
commit
ee31727094
  1. 6
      utilities/blender/generate_lua_collisionbox.py

6
utilities/blender/generate_lua_collisionbox.py

@ -42,12 +42,14 @@ import bpy
from mathutils import Vector
# from mathutils import Euler
def calculate_one():
ob1 = None
try:
ob1 = obj.select_get()
except:
# < 2.8
ob1 = bpy.context.scene.objects.active
calculate_collisionbox(ob1)
class MessageBox(bpy.types.Operator):
@ -79,6 +81,8 @@ bpy.utils.register_class(MessageBox)
msgSuffix = ""
def calculate_collisionbox(ob1):
global msgSuffix
mesh = None
if ob1 is not None:
mesh = ob1.data
@ -245,3 +249,5 @@ else:
# Unregistering before user clicks the MessageBox will crash Blender!
# bpy.utils.unregister_class(MessageBox)
calculate_one()

Loading…
Cancel
Save