generated from stilobique/BlenderTemplate
Add basic setup to generate collision mesh
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import bpy
|
||||
|
||||
from .ui import GRAOU_PT_panel
|
||||
from .ops import ExportForFange
|
||||
from .ops import ExportForFange, MakeBasicCollision
|
||||
from .preference import GRAOU_AddonPreference
|
||||
|
||||
bl_info = {
|
||||
@@ -18,7 +18,7 @@ bl_info = {
|
||||
|
||||
modules_class = [
|
||||
# Main Property
|
||||
ExportForFange,
|
||||
ExportForFange, MakeBasicCollision,
|
||||
# UI
|
||||
GRAOU_PT_panel,
|
||||
# Preference
|
||||
|
||||
@@ -90,3 +90,15 @@ class ExportForFange(bpy.types.Operator):
|
||||
# print(f'[Pipeline] Check {coll}. Item type {type(coll)}')
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
class MakeBasicCollision(bpy.types.Operator):
|
||||
"""From selected mesh, make a collision object"""
|
||||
bl_idname = 'graou.make_collision'
|
||||
bl_label = 'Generate a collision from selected mesh'
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return bpy.context.object
|
||||
|
||||
def execute(self, context):
|
||||
return {'FINISHED'}
|
||||
|
||||
@@ -17,7 +17,7 @@ class GRAOU_AddonPreference(bpy.types.AddonPreferences):
|
||||
"""
|
||||
Configuration about the Fange pipeline
|
||||
"""
|
||||
bl_idname = __package__.split('.')[0]
|
||||
bl_idname = __package__.split(".")[0]
|
||||
|
||||
project_path: bpy.props.StringProperty(
|
||||
name='Fange Unity project',
|
||||
|
||||
@@ -14,6 +14,9 @@ class GRAOU_PT_panel(bpy.types.Panel):
|
||||
layout.use_property_split = True
|
||||
layout.use_property_decorate = False
|
||||
|
||||
layout.label(text='Collision', icon='WORLD_DATA')
|
||||
layout.operator('graou.make_collision')
|
||||
|
||||
layout.label(text='Building', icon='WORLD_DATA')
|
||||
layout.operator('graou.building_export')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user