Setup thumbnail param

Update export to find export path without the operator
This commit is contained in:
2024-06-07 10:49:41 +02:00
parent cfb7a8b514
commit 44b0781b94
4 changed files with 34 additions and 35 deletions
+3 -29
View File
@@ -1,6 +1,7 @@
import bpy
from ..properties.models import FangeProject
from ..utils import get_export_path, get_asset_name
from pathlib import Path
@@ -12,9 +13,8 @@ Requiert your blend file are write on your hard-drive."""
def __init__(self):
self.coll_layout = bpy.data.collections.get('Placeholder')
self.path = FangeProject()
self.asset = self.get_asset_name()
self.category = self.get_asset_type()
self.asset = get_asset_name()
self.category = get_export_path()
self.instance_type_dict = {}
self.temp_copy = {}
@@ -120,32 +120,6 @@ Requiert your blend file are write on your hard-drive."""
self.report({'INFO'}, 'Placeholder exported')
return {'FINISHED'}
def get_asset_type(self) -> Path:
"""Look the file path, to understand if the asset are a Character, Buildings or Props"""
abs_blend_path = Path(bpy.data.filepath)
if 'Buildings' in abs_blend_path.parts:
print(f'[Pipeline] Export here "{self.path.buildings}"')
return self.path.buildings
elif 'Props' in abs_blend_path.parts:
print(f'[Pipeline] Export here "{self.path.props}"')
return self.path.props
elif 'Characters' in abs_blend_path.parts:
print(f'[Pipeline] Export here "{self.path.characters}"')
return self.path.characters
else:
print(f'[Pipeline] Can\'t find asset category')
return Path()
@staticmethod
def get_asset_name() -> str:
"""From the .blend file, return the blend name."""
abs_blend_path = Path(bpy.data.filepath)
return abs_blend_path.stem
def set_instance_type(self):
for key, value in self.instance_type_dict.items():
ob = bpy.data.objects.get(key)