Asset Pipeline v2 #145
@ -13,6 +13,7 @@ from ... import constants
|
||||
import mathutils
|
||||
import bmesh
|
||||
import numpy as np
|
||||
import time
|
||||
|
||||
|
||||
## FUNCTIONS SPECFIC TO TRANSFER DATA TYPES
|
||||
@ -59,12 +60,13 @@ def transfer_vertex_group(
|
||||
return
|
||||
|
||||
source_obj.vertex_groups.active = source_obj.vertex_groups.get(vertex_group_name)
|
||||
context = bpy.context
|
||||
override = context.copy()
|
||||
override["selected_editable_objects"] = [target_obj, source_obj]
|
||||
override["active_object"] = source_obj
|
||||
override["object"] = source_obj
|
||||
with context.temp_override(**override):
|
||||
# HACK without this sleep function Push will crash when transferring large amount of vertex groups
|
||||
time.sleep(0.00000000000001)
|
||||
|
||||
# DEBUG WHY THIS FAILS TO TRANSFER VERTEX GROUPS IN 4.0
|
||||
with context.temp_override(
|
||||
object=source_obj, selected_editable_objects=[target_obj, source_obj]
|
||||
):
|
||||
bpy.ops.object.data_transfer(
|
||||
data_type="VGROUP_WEIGHTS",
|
||||
use_create=True,
|
||||
|
Loading…
Reference in New Issue
Block a user