generated from stilobique/BlenderTemplate
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6f43ae733b | |||
| d1b2c0b4a9 | |||
| 6cf3d224d2 |
@@ -1,7 +1,9 @@
|
||||
import bpy
|
||||
|
||||
from .ui import GRAOU_PT_panel
|
||||
from .ops import ExportForFange, MakeBasicCollision
|
||||
from .operators.outline import ConfigBlendScene
|
||||
from .operators.exports import ExportForFange
|
||||
from .operators.misc import MakeBasicCollision
|
||||
from .preference import GRAOU_AddonPreference
|
||||
|
||||
bl_info = {
|
||||
@@ -18,7 +20,7 @@ bl_info = {
|
||||
|
||||
modules_class = [
|
||||
# Main Property
|
||||
ExportForFange, MakeBasicCollision,
|
||||
ExportForFange, MakeBasicCollision, ConfigBlendScene,
|
||||
# UI
|
||||
GRAOU_PT_panel,
|
||||
# Preference
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import bpy
|
||||
|
||||
from .models import FangeProject
|
||||
from pathlib import Path
|
||||
from ..models import FangeProject
|
||||
|
||||
|
||||
class ExportForFange(bpy.types.Operator):
|
||||
@@ -12,7 +11,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):
|
||||
@@ -90,15 +88,3 @@ 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'}
|
||||
@@ -0,0 +1,14 @@
|
||||
import bpy
|
||||
|
||||
|
||||
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'}
|
||||
@@ -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'}
|
||||
+10
-2
@@ -14,9 +14,17 @@ 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')
|
||||
row = layout.row(align=False)
|
||||
row.label(text='Main Config:')
|
||||
layout.operator('graou.build_scene', text='Init Scene', icon='OUTLINER')
|
||||
|
||||
row = layout.row(align=False)
|
||||
row.label(text='Asset:')
|
||||
layout.operator('graou.make_collision', text='Make all collision', icon='MOD_PHYSICS')
|
||||
|
||||
layout.label(text='Building', icon='WORLD_DATA')
|
||||
layout.operator('graou.building_export')
|
||||
|
||||
row = layout.row(align=False)
|
||||
row.label(text='Export scene:')
|
||||
layout.operator('graou.building_export', text='Export all assets', icon='EXPORT')
|
||||
|
||||
Reference in New Issue
Block a user