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