generated from stilobique/BlenderTemplate
Add basic plugin preference
This commit is contained in:
@@ -2,6 +2,7 @@ import bpy
|
||||
|
||||
from .ui import GRAOU_PT_panel
|
||||
from .ops import ExportForFange
|
||||
from .preference import GRAOU_AddonPreference
|
||||
|
||||
bl_info = {
|
||||
'name': 'Fange Pipeline',
|
||||
@@ -19,7 +20,9 @@ modules_class = [
|
||||
# Main Property
|
||||
ExportForFange,
|
||||
# UI
|
||||
GRAOU_PT_panel
|
||||
GRAOU_PT_panel,
|
||||
# Preference
|
||||
GRAOU_AddonPreference
|
||||
]
|
||||
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@ from pathlib import Path
|
||||
|
||||
class ExportForFange(bpy.types.Operator):
|
||||
"""Export a building for fange"""
|
||||
bl_idname = "graou.building_export"
|
||||
bl_label = "Easily export a building asset"
|
||||
bl_idname = 'graou.building_export'
|
||||
bl_label = 'Easily export a building asset'
|
||||
|
||||
def __init__(self):
|
||||
self.coll_layout = bpy.data.collections.get('Placeholder')
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
import bpy
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def check_game_project():
|
||||
"""Define the unity game project"""
|
||||
unity_game_project = Path("W:\\", "Graou Studio", "Game Projects", "Fange Prototype", "Fange Prototype.sln")
|
||||
if unity_game_project.exists():
|
||||
return unity_game_project.parent.as_posix()
|
||||
|
||||
else:
|
||||
return ''
|
||||
|
||||
|
||||
class GRAOU_AddonPreference(bpy.types.AddonPreferences):
|
||||
"""
|
||||
Configuration about the Fange pipeline
|
||||
"""
|
||||
bl_idname = __package__.split('.')[0]
|
||||
|
||||
project_path: bpy.props.StringProperty(
|
||||
name='Fange Unity project',
|
||||
description='Select your Unity game project',
|
||||
default=check_game_project(),
|
||||
subtype='FILE_PATH',
|
||||
)
|
||||
|
||||
subdir_graph: bpy.props.StringProperty(
|
||||
name='Subdir about assets folder',
|
||||
default=r'Assets\Graph',
|
||||
subtype='DIR_PATH',
|
||||
)
|
||||
|
||||
subdir_props: bpy.props.StringProperty(
|
||||
name='The props subdir',
|
||||
default='Props',
|
||||
subtype='DIR_PATH',
|
||||
)
|
||||
|
||||
subdir_buildings: bpy.props.StringProperty(
|
||||
name='The buildings subdir',
|
||||
default='Buildings',
|
||||
subtype='DIR_PATH',
|
||||
)
|
||||
|
||||
subdir_characters: bpy.props.StringProperty(
|
||||
name='The characters subdir',
|
||||
default='Characters',
|
||||
subtype='DIR_PATH',
|
||||
)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.label(text='Config all setup about the pipeline.')
|
||||
layout.prop(self, 'project_path')
|
||||
Reference in New Issue
Block a user