fix: remove bone group

This commit is contained in:
Swann 2024-03-24 15:46:28 +01:00
parent eff81e976e
commit 38e88d0a4c

View File

@ -575,16 +575,6 @@ class BlObject(ReplicatedDatablock):
if 'pose' in data: if 'pose' in data:
if not datablock.pose: if not datablock.pose:
raise Exception('No pose data yet (Fixed in a near futur)') raise Exception('No pose data yet (Fixed in a near futur)')
# Bone groups
for bg_name in data['pose']['bone_groups']:
bg_data = data['pose']['bone_groups'].get(bg_name)
bg_target = datablock.pose.bone_groups.get(bg_name)
if not bg_target:
bg_target = datablock.pose.bone_groups.new(name=bg_name)
loader.load(bg_target, bg_data)
# datablock.pose.bone_groups.get
# Bones # Bones
for bone in data['pose']['bones']: for bone in data['pose']['bones']:
@ -596,9 +586,6 @@ class BlObject(ReplicatedDatablock):
load_pose(target_bone, bone_data) load_pose(target_bone, bone_data)
if 'bone_index' in bone_data.keys():
target_bone.bone_group = datablock.pose.bone_group[bone_data['bone_group_index']]
# TODO: find another way... # TODO: find another way...
if datablock.empty_display_type == "IMAGE": if datablock.empty_display_type == "IMAGE":
img_uuid = data.get('data_uuid') img_uuid = data.get('data_uuid')
@ -738,7 +725,6 @@ class BlObject(ReplicatedDatablock):
bones[bone.name] = {} bones[bone.name] = {}
dumper.depth = 1 dumper.depth = 1
rotation = 'rotation_quaternion' if bone.rotation_mode == 'QUATERNION' else 'rotation_euler' rotation = 'rotation_quaternion' if bone.rotation_mode == 'QUATERNION' else 'rotation_euler'
group_index = 'bone_group_index' if bone.bone_group else None
dumper.include_filter = [ dumper.include_filter = [
'rotation_mode', 'rotation_mode',
'location', 'location',
@ -746,7 +732,6 @@ class BlObject(ReplicatedDatablock):
'custom_shape', 'custom_shape',
'use_custom_shape_bone_size', 'use_custom_shape_bone_size',
'custom_shape_scale', 'custom_shape_scale',
group_index,
rotation rotation
] ]
bones[bone.name] = dumper.dump(bone) bones[bone.name] = dumper.dump(bone)
@ -757,17 +742,6 @@ class BlObject(ReplicatedDatablock):
data['pose'] = {'bones': bones} data['pose'] = {'bones': bones}
# GROUPS
bone_groups = {}
for group in datablock.pose.bone_groups:
dumper.depth = 3
dumper.include_filter = [
'name',
'color_set'
]
bone_groups[group.name] = dumper.dump(group)
data['pose']['bone_groups'] = bone_groups
# VERTEx GROUP # VERTEx GROUP
if len(datablock.vertex_groups) > 0: if len(datablock.vertex_groups) > 0:
data['vertex_groups'] = dump_vertex_groups(datablock) data['vertex_groups'] = dump_vertex_groups(datablock)