generated from stilobique/BlenderTemplate
Make the outline config ops
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import bpy
|
import bpy
|
||||||
|
|
||||||
from .ui import GRAOU_PT_panel
|
from .ui import GRAOU_PT_panel
|
||||||
|
from .operators.outline import ConfigBlendScene
|
||||||
from .ops import ExportForFange, MakeBasicCollision
|
from .ops import ExportForFange, MakeBasicCollision
|
||||||
from .preference import GRAOU_AddonPreference
|
from .preference import GRAOU_AddonPreference
|
||||||
|
|
||||||
@@ -18,7 +19,7 @@ bl_info = {
|
|||||||
|
|
||||||
modules_class = [
|
modules_class = [
|
||||||
# Main Property
|
# Main Property
|
||||||
ExportForFange, MakeBasicCollision,
|
ExportForFange, MakeBasicCollision, ConfigBlendScene,
|
||||||
# UI
|
# UI
|
||||||
GRAOU_PT_panel,
|
GRAOU_PT_panel,
|
||||||
# Preference
|
# Preference
|
||||||
|
|||||||
@@ -4,6 +4,9 @@ from pathlib import Path
|
|||||||
|
|
||||||
|
|
||||||
class FangeProject:
|
class FangeProject:
|
||||||
|
"""
|
||||||
|
This object is a model to give all Unity project path.
|
||||||
|
"""
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self._pref = bpy.context.preferences.addons[__name__.split(".")[0]].preferences
|
self._pref = bpy.context.preferences.addons[__name__.split(".")[0]].preferences
|
||||||
|
|
||||||
@@ -26,3 +29,27 @@ class FangeProject:
|
|||||||
@property
|
@property
|
||||||
def characters(self):
|
def characters(self):
|
||||||
return self._project_path.joinpath(self._subdir_path, self._characters_path)
|
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'
|
||||||
|
|||||||
@@ -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'}
|
||||||
@@ -12,7 +12,6 @@ class ExportForFange(bpy.types.Operator):
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.coll_layout = bpy.data.collections.get('Placeholder')
|
self.coll_layout = bpy.data.collections.get('Placeholder')
|
||||||
self.path = FangeProject()
|
self.path = FangeProject()
|
||||||
self.fbx_preset = 'sm-unity-building'
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
|
|||||||
@@ -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='Scene Setup', icon='WORLD_DATA')
|
||||||
|
layout.operator('graou.build_scene')
|
||||||
|
|
||||||
layout.label(text='Collision', icon='WORLD_DATA')
|
layout.label(text='Collision', icon='WORLD_DATA')
|
||||||
layout.operator('graou.make_collision')
|
layout.operator('graou.make_collision')
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user