Make the outline config ops

This commit is contained in:
2024-05-09 00:53:57 +02:00
parent 15df44a0eb
commit 6cf3d224d2
5 changed files with 48 additions and 2 deletions
+2 -1
View File
@@ -1,6 +1,7 @@
import bpy
from .ui import GRAOU_PT_panel
from .operators.outline import ConfigBlendScene
from .ops import ExportForFange, MakeBasicCollision
from .preference import GRAOU_AddonPreference
@@ -18,7 +19,7 @@ bl_info = {
modules_class = [
# Main Property
ExportForFange, MakeBasicCollision,
ExportForFange, MakeBasicCollision, ConfigBlendScene,
# UI
GRAOU_PT_panel,
# Preference
+27
View File
@@ -4,6 +4,9 @@ from pathlib import Path
class FangeProject:
"""
This object is a model to give all Unity project path.
"""
def __init__(self):
self._pref = bpy.context.preferences.addons[__name__.split(".")[0]].preferences
@@ -26,3 +29,27 @@ class FangeProject:
@property
def characters(self):
return self._project_path.joinpath(self._subdir_path, self._characters_path)
class Outline:
"""
Model about the Outline config.
"""
def __init__(self):
self._collections = {
'Placeholder': ['COLOR_01'],
'Icon': ['COLOR_04'],
'Game Object': ['COLOR_05']
}
@property
def placeholder(self):
return 'Placeholder'
@property
def icon(self):
return 'Icon'
@property
def game(self):
return 'Game Object'
+16
View File
@@ -0,0 +1,16 @@
import bpy
from ..models import Outline
class ConfigBlendScene(bpy.types.Operator):
"""Init the opened blend scene"""
bl_idname = 'graou.build_scene'
bl_label = 'Config or update the outline'
def __init__(self):
self._outline = Outline()
def execute(self, context):
print(f'[Pipeline] Generate outline')
return {'FINISHED'}
-1
View File
@@ -12,7 +12,6 @@ class ExportForFange(bpy.types.Operator):
def __init__(self):
self.coll_layout = bpy.data.collections.get('Placeholder')
self.path = FangeProject()
self.fbx_preset = 'sm-unity-building'
@classmethod
def poll(cls, context):
+3
View File
@@ -14,6 +14,9 @@ class GRAOU_PT_panel(bpy.types.Panel):
layout.use_property_split = True
layout.use_property_decorate = False
layout.label(text='Scene Setup', icon='WORLD_DATA')
layout.operator('graou.build_scene')
layout.label(text='Collision', icon='WORLD_DATA')
layout.operator('graou.make_collision')