Asset Pipeline v2 #145
@ -183,3 +183,20 @@ def apply_transfer_data(context: bpy.types.Context, transfer_data_map) -> None:
|
||||
transfer_data_item=transfer_data_item,
|
||||
target_obj=target_obj,
|
||||
)
|
||||
|
||||
def data_type_from_transfer_data_key(obj:bpy.types.Object, td_type:str):
|
||||
""" Returns the data on an object that is referred to by the transfer data type"""
|
||||
if td_type == constants.VERTEX_GROUP_KEY:
|
||||
return obj.vertex_groups
|
||||
if td_type == constants.MODIFIER_KEY:
|
||||
return obj.modifiers
|
||||
if td_type == constants.CONSTRAINT_KEY:
|
||||
return obj.constraints
|
||||
if td_type == constants.MATERIAL_SLOT_KEY:
|
||||
return obj.material_slots
|
||||
if td_type == constants.SHAPE_KEY_KEY:
|
||||
return obj.data.shape_keys.key_blocks
|
||||
if td_type == constants.ATTRIBUTE_KEY:
|
||||
return obj.data.attributes
|
||||
if td_type == constants.PARENT_KEY:
|
||||
return obj.parent
|
Loading…
Reference in New Issue
Block a user