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.
2 changed files with 31 additions and 87 deletions
Showing only changes of commit a05f5b20b6 - Show all commits

View File

@ -190,3 +190,18 @@ def transfer_info_clean(obj, list):
def transfer_info_is_missing(transfer_info, type_key, list):
if transfer_info.type == type_key and not list.get(transfer_info["name"]):
return True
def transfer_info_init(scene, obj, list, type_key):
transfer_data = obj.transfer_data_ownership
task_layer_name = scene.asset_pipeline.task_layer_name
for item in list:
# Only add new ownership transfer_info if vertex group doesn't have an owner
matches = check_transfer_data_entry(transfer_data, item.name, type_key)
if len(matches) == 0:
scene.asset_pipeline.add_temp_trasnfer_data(
name=item.name,
owner=task_layer_name,
type=type_key,
obj=obj,
)

View File

@ -19,21 +19,9 @@ def vertex_group_is_missing(transfer_info):
def init_vertex_groups(scene, obj):
transfer_data = obj.transfer_data_ownership
task_layer_name = scene.asset_pipeline.task_layer_name
td_type = constants.VERTEX_GROUP_KEY
for vertex_group in obj.vertex_groups:
# Only add new ownership transfer_info if vertex group doesn't have an owner
matches = transfer_core.check_transfer_data_entry(
transfer_data, vertex_group.name, td_type
)
if len(matches) == 0:
scene.asset_pipeline.add_temp_trasnfer_data(
name=vertex_group.name,
owner=task_layer_name,
type=td_type,
obj=obj,
)
transfer_core.transfer_info_init(
scene, obj, obj.vertex_groups, constants.VERTEX_GROUP_KEY
)
def transfer_vertex_group(
@ -78,23 +66,11 @@ def vertex_color_is_missing(transfer_info):
def init_vertex_colors(scene, obj):
transfer_data = obj.transfer_data_ownership
task_layer_name = scene.asset_pipeline.task_layer_name
td_type = constants.VERTEX_COLOR_KEY
if not obj.type == "MESH":
return
for vertex_color in obj.data.vertex_colors:
# Only add new ownership transfer_info if vertex color doesn't have an owner
matches = transfer_core.check_transfer_data_entry(
transfer_data, vertex_color.name, td_type
)
if len(matches) == 0:
scene.asset_pipeline.add_temp_trasnfer_data(
name=vertex_color.name,
owner=task_layer_name,
type=td_type,
obj=obj,
)
transfer_core.transfer_info_init(
scene, obj, obj.data.vertex_colors, constants.VERTEX_COLOR_KEY
)
def transfer_vertex_color(
@ -133,23 +109,11 @@ def uv_layer_is_missing(transfer_info):
def init_uv_layers(scene, obj):
transfer_data = obj.transfer_data_ownership
task_layer_name = scene.asset_pipeline.task_layer_name
td_type = constants.UV_LAYERS_KEY
if not obj.type == "MESH":
return
for uv_layer in obj.data.uv_layers:
# Only add new ownership transfer_info if vertex color doesn't have an owner
matches = transfer_core.check_transfer_data_entry(
transfer_data, uv_layer.name, td_type
)
if len(matches) == 0:
scene.asset_pipeline.add_temp_trasnfer_data(
name=uv_layer.name,
owner=task_layer_name,
type=td_type,
obj=obj,
)
transfer_core.transfer_info_init(
scene, obj, obj.data.uv_layers, constants.UV_LAYERS_KEY
)
def transfer_uv_layer(source_obj, target_obj, uv_name):
@ -186,20 +150,7 @@ def modifier_is_missing(transfer_info):
def init_modifiers(scene, obj):
task_layer_name = scene.asset_pipeline.task_layer_name
transfer_data = obj.transfer_data_ownership
td_type = constants.MODIFIER_KEY
for mod in obj.modifiers:
matches = transfer_core.check_transfer_data_entry(
transfer_data, mod.name, td_type
)
if len(matches) == 0:
scene.asset_pipeline.add_temp_trasnfer_data(
name=mod.name,
owner=task_layer_name,
type=td_type,
obj=obj,
)
transfer_core.transfer_info_init(scene, obj, obj.modifiers, constants.MODIFIER_KEY)
def transfer_modifier(modifier_name, target_obj, source_obj):
@ -268,20 +219,9 @@ def constraint_is_missing(transfer_info):
def init_constraints(scene, obj):
task_layer_name = scene.asset_pipeline.task_layer_name
transfer_data = obj.transfer_data_ownership
td_type = constants.CONSTRAINT_KEY
for constraint in obj.constraints:
matches = transfer_core.check_transfer_data_entry(
transfer_data, constraint.name, td_type
)
if len(matches) == 0:
scene.asset_pipeline.add_temp_trasnfer_data(
name=constraint.name,
owner=task_layer_name,
type=td_type,
obj=obj,
)
transfer_core.transfer_info_init(
scene, obj, obj.constraints, constants.CONSTRAINT_KEY
)
def transfer_constraint(constraint_name, target_obj, source_obj):
@ -334,20 +274,9 @@ def material_slot_is_missing(transfer_info):
def init_material_slots(scene, obj):
task_layer_name = scene.asset_pipeline.task_layer_name
transfer_data = obj.transfer_data_ownership
td_type = constants.MATERIAL_SLOT_KEY
for slot in obj.material_slots:
matches = transfer_core.check_transfer_data_entry(
transfer_data, slot.name, td_type
)
if len(matches) == 0:
scene.asset_pipeline.add_temp_trasnfer_data(
name=slot.name,
owner=task_layer_name,
type=td_type,
obj=obj,
)
transfer_core.transfer_info_init(
scene, obj, obj.material_slots, constants.MATERIAL_SLOT_KEY
)
def transfer_material_slot(material_slot_name, target_obj, source_obj):