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 15 additions and 12 deletions
Showing only changes of commit 8190c5fa1f - Show all commits

View File

@ -1,6 +1,7 @@
import bpy
from .transfer_data import transfer_core, transfer_functions
from . import asset_suffix, transferable_data, transfer_functions
from . import asset_suffix
from pathlib import Path
from typing import Dict
from .asset_mapping import AssetTransferMapping
@ -20,7 +21,7 @@ def get_ownership(local_col: str, task_layer_name: str):
def set_ownership(new_transfer_data):
for data in new_transfer_data:
item = new_transfer_data[data]
transferable_data.transfer_data_add_entry(item[0], item[1], item[2], item[3])
transfer_core.transfer_data_add_entry(item[0], item[1], item[2], item[3])
def remap_user(source_datablock: bpy.data, target_datablock: bpy.data):
@ -64,19 +65,19 @@ def merge_task_layer(
map = AssetTransferMapping(local_col, external_col, local_tls)
# Find Transfer Data
transfer_data = []
transfer_data_items = []
for obj in external_col.all_objects:
for item in obj.transfer_data_ownership:
if item.owner not in local_tls:
transfer_data.append(item)
transfer_data_items.append(item)
for obj in local_col.all_objects:
for item in obj.transfer_data_ownership:
if item.owner in local_tls:
transfer_data.append(item)
transfer_data_items.append(item)
target_objs = [map.object_map[obj] for obj in map.object_map]
transferable_data.apply_transfer_data(context, transfer_data, target_objs)
transfer_core.apply_transfer_data(context, transfer_data_items, target_objs)
for source_obj in map.object_map:
target_obj = map.object_map[source_obj]

View File

@ -2,7 +2,7 @@ import bpy
from . import core
from pathlib import Path
from . import transferable_data, constants
from . import constants
def get_parent_col_name():

View File

@ -1,6 +1,7 @@
import bpy
from . import transfer_functions
from . import transfer_functions, asset_suffix
from .. import asset_suffix
from typing import Dict

View File

@ -1,6 +1,7 @@
import bpy
from bpy import context
from . import asset_suffix, transferable_data
from . import transfer_core
from .. import asset_suffix
## FUNCTIONS SPECFIC TO TRANSFER DATA TYPES
@ -11,7 +12,7 @@ def get_vertex_groups(obj, task_layer_name, new_transfer_data):
ownership = obj.transfer_data_ownership
for vertex_group in obj.vertex_groups:
# Only add new ownership item if vertex group doesn't have an owner
matches = transferable_data.check_transfer_data_entry(
matches = transfer_core.check_transfer_data_entry(
ownership, vertex_group.name, "VERTEX_GROUP"
)
if len(matches) == 0:
@ -57,7 +58,7 @@ def transfer_vertex_group(
def get_modifiers(obj, task_layer_name, new_transfer_data):
ownership = obj.transfer_data_ownership
for mod in obj.modifiers:
matches = transferable_data.check_transfer_data_entry(
matches = transfer_core.check_transfer_data_entry(
ownership, mod.name, "MODIFIER"
)
if len(matches) == 0:
@ -131,7 +132,7 @@ def transfer_modifier(item, obj_target):
def get_material_slots(obj, task_layer_name, new_transfer_data):
ownership = obj.transfer_data_ownership
for slot in obj.material_slots:
matches = transferable_data.check_transfer_data_entry(
matches = transfer_core.check_transfer_data_entry(
ownership, slot.name, "MATERIAL_SLOT"
)
if len(matches) == 0: