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')