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.
4 changed files with 46 additions and 7 deletions
Showing only changes of commit bd8dca64b1 - Show all commits

View File

@ -22,10 +22,46 @@ class ASSETPIPE_OT_push_test(bpy.types.Operator):
bl_label = 'Push to Publish' bl_label = 'Push to Publish'
def execute(self, context): def execute(self, context):
if self.text != "test": # Find current task Layer
self.report({'ERROR'}, "Failure") obj = context.active_object
return {'CANCELLED'} task_layer_col = context.collection
self.report({'INFO'}, "Success") current_task_layer = task_layer_col.name.split('.')[-1]
# Find PUBLUSH Collection
for col in context.scene.collection.children_recursive:
if "PUB" in col.name:
publish_col = col
# Find Obj owned by Current Task Layer
push_obj = []
for obj in task_layer_col.objects:
if obj.asset_id_owner == current_task_layer:
push_obj.append(obj)
# Delete existing root OBJ
for obj in publish_col.objects:
obj_root_name = obj.name.split('.')[0]
if f"{obj_root_name}.PUB" in obj.name:
bpy.data.objects.remove(obj)
# Link new obj to collection
for obj in push_obj:
obj_root_name = obj.name.split('.')[0]
new_obj = obj.copy()
new_obj.data = obj.data.copy()
new_obj.name = f"{obj_root_name}.PUB"
publish_col.objects.link(new_obj)
# Cosmetically move the obj for easier organization
# TODO Remove this step
new_obj.location[0] = 0
new_obj.location[2] = 3
# TODO Move transferrable data onto obj owned by others
# Find Transfer-Data in current TL
# Find matching Target Object in Publish
# Copy Transfer-Data
return {'FINISHED'} return {'FINISHED'}

View File

@ -20,7 +20,7 @@ def register():
bpy.types.Object.asset_ownership = bpy.props.CollectionProperty(type=ASSETOWNERSHIP) bpy.types.Object.asset_ownership = bpy.props.CollectionProperty(type=ASSETOWNERSHIP)
bpy.types.Object.asset_id_owner = bpy.props.EnumProperty( bpy.types.Object.asset_id_owner = bpy.props.EnumProperty(
name="ID Owner", name="ID Owner",
items=[("NONE", "None", ""), ("MODEL", "Rigging", ""), ("RIG", "Modeling", "")], items=[("NONE", "None", ""), ("MODEL", "Modeling", ""), ("RIG", "Rigging", "")],
) )

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:cb034f7920e413371c56f11d73735f36cf7c2c1302e6696b46b701b9dbde4b31 oid sha256:9224d4dbb2b5f169ca9cf98d3da89dfd550167c7384575ecdc1a473adbb9e814
size 891200 size 901508

View File

@ -8,6 +8,9 @@ class ASSETPIPE_PT_TestUI(bpy.types.Panel):
bl_label = "Test UI" bl_label = "Test UI"
def draw(self, context: bpy.types.Context) -> None: def draw(self, context: bpy.types.Context) -> None:
self.layout.label(
text=f"Active Task Layer: {context.collection.name.split('.')[-1]}"
)
self.layout.label(text="Test UI") self.layout.label(text="Test UI")
self.layout.operator("assetpipe.update_ownership") self.layout.operator("assetpipe.update_ownership")
self.layout.operator("assetpipe.push_test", icon="TRIA_UP") self.layout.operator("assetpipe.push_test", icon="TRIA_UP")