From 2bba6717eb7e52f13d39dcc253a7dc6d3c512501 Mon Sep 17 00:00:00 2001 From: amorgun Date: Sat, 23 Nov 2024 02:07:01 +0300 Subject: [PATCH] Add custom shape for markers Fixes https://github.com/amorgun/blender_dow/issues/8 --- importer.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/importer.py b/importer.py index a3a014a..0cebd56 100644 --- a/importer.py +++ b/importer.py @@ -473,6 +473,7 @@ def CH_DATAMARK(self, reader: ChunkReader): bone_collection.assign(marker) marker.color.palette = 'CUSTOM' marker.color.custom.normal = mathutils.Color([14, 255, 2]) / 255 # -- Set Color Of New Marker + marker.color.custom.active = mathutils.Color([255, 98, 255]) / 255 if marker_name in self.armature.bones: continue # FIXME @@ -488,6 +489,14 @@ def CH_DATAMARK(self, reader: ChunkReader): self.bone_transform[marker_name] = parent_mat @ transform bpy.ops.object.mode_set(mode='EDIT', toggle=True) + custom_shape_template = bpy.data.objects.new(f'marker_custom_shape_template', None) + custom_shape_template.empty_display_type = 'ARROWS' + for bone in bone_collection.bones: + pose_bone = self.armature_obj.pose.bones[bone.name] + pose_bone.custom_shape = custom_shape_template + pose_bone.custom_shape_rotation_euler = 0, math.pi / 2, math.pi / 2 + pose_bone.custom_shape_scale_xyz = 1, 1, -1 + def CH_DATACAMS(self, reader: ChunkReader): cameras_collection = bpy.data.collections.new('Cameras') self.model_root_collection.children.link(cameras_collection)