Asset Pipeline v2 #145

Closed
Nick Alberelli wants to merge 431 commits from (deleted):feature/asset-pipeline-v2 into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
3 changed files with 27 additions and 21 deletions
Showing only changes of commit 95788baed2 - Show all commits

View File

@ -3,6 +3,7 @@ import bpy
from . import core from . import core
from pathlib import Path from pathlib import Path
from . import constants from . import constants
from .transfer_data import transfer_ui
def get_parent_col_name(): def get_parent_col_name():
@ -76,6 +77,7 @@ class ASSETPIPE_OT_sync_with_publish(bpy.types.Operator):
else: else:
layout.label(text="No New Transfer Data found") layout.label(text="No New Transfer Data found")
# TODO re-use transfer UI here
for key in constants.TRANSFER_DATA_KEYS: for key in constants.TRANSFER_DATA_KEYS:
self.draw_transfer_data_items(layout, key) self.draw_transfer_data_items(layout, key)

View File

@ -0,0 +1,23 @@
from .. import constants, core
def draw_transfer_data_type(layout, items):
name = core.get_enum_item(constants.TRANSFER_DATA_TYPES, items[0].type)[1]
box = layout.box()
box.label(text=name, icon=items[0].type)
for item in items:
owner = core.get_enum_item(constants.TASK_LAYER_ITEMS, item.owner)[1]
box.label(text=f"{item.name}: '{owner}'")
def draw_transfer_data(ownership, layout) -> None:
vertex_groups = [
item for item in ownership if item.type == constants.VERTEX_GROUP_KEY
]
material_slots = [
item for item in ownership if item.type == constants.MATERIAL_SLOT_KEY
]
modifiers = [item for item in ownership if item.type == constants.MODIFIER_KEY]
draw_transfer_data_type(layout, vertex_groups)
draw_transfer_data_type(layout, modifiers)
draw_transfer_data_type(layout, material_slots)

View File

@ -1,6 +1,7 @@
import bpy import bpy
from . import core, constants from . import core, constants
from .transfer_data import transfer_ui
class ASSETPIPE_sync(bpy.types.Panel): class ASSETPIPE_sync(bpy.types.Panel):
@ -31,26 +32,6 @@ class ASSETPIPE_ownership_inspector(bpy.types.Panel):
bl_category = 'Asset Pipe 2' bl_category = 'Asset Pipe 2'
bl_label = "Ownership Inspector" bl_label = "Ownership Inspector"
def draw_transfer_data_type(self, layout, items):
name = core.get_enum_item(constants.TRANSFER_DATA_TYPES, items[0].type)[1]
box = layout.box()
box.label(text=name, icon=items[0].type)
for item in items:
owner = core.get_enum_item(constants.TASK_LAYER_ITEMS, item.owner)[1]
box.label(text=f"{item.name}: '{owner}'")
def draw_transfer_data(self, ownership, layout) -> None:
vertex_groups = [
item for item in ownership if item.type == constants.VERTEX_GROUP_KEY
]
material_slots = [
item for item in ownership if item.type == constants.MATERIAL_SLOT_KEY
]
modifiers = [item for item in ownership if item.type == constants.MODIFIER_KEY]
self.draw_transfer_data_type(layout, vertex_groups)
self.draw_transfer_data_type(layout, modifiers)
self.draw_transfer_data_type(layout, material_slots)
def draw(self, context: bpy.types.Context) -> None: def draw(self, context: bpy.types.Context) -> None:
layout = self.layout layout = self.layout
if not context.active_object: if not context.active_object:
@ -61,7 +42,7 @@ class ASSETPIPE_ownership_inspector(bpy.types.Panel):
layout = layout.box() layout = layout.box()
owner = core.get_enum_item(constants.TASK_LAYER_ITEMS, obj.asset_id_owner)[1] owner = core.get_enum_item(constants.TASK_LAYER_ITEMS, obj.asset_id_owner)[1]
layout.label(text=f"{obj.name}: '{owner}'", icon="OBJECT_DATA") layout.label(text=f"{obj.name}: '{owner}'", icon="OBJECT_DATA")
self.draw_transfer_data(ownership, layout) transfer_ui.draw_transfer_data(ownership, layout)
task_layer_name = core.get_task_layer_name_from_file() task_layer_name = core.get_task_layer_name_from_file()
if task_layer_name not in constants.TASK_LAYER_KEYS: if task_layer_name not in constants.TASK_LAYER_KEYS: