Skip to content

Commit

Permalink
Add custom shape for markers
Browse files Browse the repository at this point in the history
Fixes #8
  • Loading branch information
amorgun committed Nov 22, 2024
1 parent 7a25f79 commit 2bba671
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit 2bba671

Please sign in to comment.