Add basic setup to generate collision mesh

This commit is contained in:
2024-05-09 00:25:15 +02:00
parent 649b19a33d
commit 15df44a0eb
4 changed files with 18 additions and 3 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
import bpy import bpy
from .ui import GRAOU_PT_panel from .ui import GRAOU_PT_panel
from .ops import ExportForFange from .ops import ExportForFange, MakeBasicCollision
from .preference import GRAOU_AddonPreference from .preference import GRAOU_AddonPreference
bl_info = { bl_info = {
@@ -18,7 +18,7 @@ bl_info = {
modules_class = [ modules_class = [
# Main Property # Main Property
ExportForFange, ExportForFange, MakeBasicCollision,
# UI # UI
GRAOU_PT_panel, GRAOU_PT_panel,
# Preference # Preference
+12
View File
@@ -90,3 +90,15 @@ class ExportForFange(bpy.types.Operator):
# print(f'[Pipeline] Check {coll}. Item type {type(coll)}') # print(f'[Pipeline] Check {coll}. Item type {type(coll)}')
return {'FINISHED'} 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'}
+1 -1
View File
@@ -17,7 +17,7 @@ class GRAOU_AddonPreference(bpy.types.AddonPreferences):
""" """
Configuration about the Fange pipeline Configuration about the Fange pipeline
""" """
bl_idname = __package__.split('.')[0] bl_idname = __package__.split(".")[0]
project_path: bpy.props.StringProperty( project_path: bpy.props.StringProperty(
name='Fange Unity project', name='Fange Unity project',
+3
View File
@@ -14,6 +14,9 @@ class GRAOU_PT_panel(bpy.types.Panel):
layout.use_property_split = True layout.use_property_split = True
layout.use_property_decorate = False 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.label(text='Building', icon='WORLD_DATA')
layout.operator('graou.building_export') layout.operator('graou.building_export')