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 12 additions and 9 deletions
Showing only changes of commit 321c233d90 - Show all commits

View File

@ -6,17 +6,20 @@ from . import asset_suffix
def transfer_vertex_group( def transfer_vertex_group(
context, context,
vertex_group_name: str, vertex_group_name: str,
obj_source: bpy.types.Object,
obj_target: bpy.types.Object, obj_target: bpy.types.Object,
obj_source: bpy.types.Object,
): ):
if obj_source == obj_target: if obj_target == obj_source:
return return
# TODO remove old vertex groups before transfer !!
obj_target.vertex_groups.active = obj_target.vertex_groups[vertex_group_name] if obj_target.vertex_groups.get(vertex_group_name):
obj_target.vertex_groups.remove(obj_target.vertex_groups.get(vertex_group_name))
obj_source.vertex_groups.active = obj_source.vertex_groups[vertex_group_name]
override = context.copy() override = context.copy()
override["selected_editable_objects"] = [obj_source, obj_target] override["selected_editable_objects"] = [obj_target, obj_source]
override["active_object"] = obj_target override["active_object"] = obj_source
override["object"] = obj_target override["object"] = obj_source
with context.temp_override(**override): with context.temp_override(**override):
bpy.ops.object.data_transfer( bpy.ops.object.data_transfer(
data_type="VGROUP_WEIGHTS", data_type="VGROUP_WEIGHTS",

View File

@ -29,8 +29,8 @@ def apply_transfer_data(
transfer_functions.transfer_vertex_group( transfer_functions.transfer_vertex_group(
context=context, context=context,
vertex_group_name=item.name, vertex_group_name=item.name,
obj_source=target_obj, obj_target=target_obj,
obj_target=item.id_data, obj_source=item.id_data,
) )
if item.type == "MODIFIER": if item.type == "MODIFIER":
transfer_functions.transfer_modifier(item, target_obj) transfer_functions.transfer_modifier(item, target_obj)