Extract pose parameters organized by bone name. Args: armature_data: List of frame dictionaries Returns: Dictionary mapping bone names to arrays of poses [num_frames, 7]
(armature_data)
| 152 | |
| 153 | |
| 154 | def extract_pose_params(armature_data): |
| 155 | """ |
| 156 | Extract pose parameters organized by bone name. |
| 157 | |
| 158 | Args: |
| 159 | armature_data: List of frame dictionaries |
| 160 | |
| 161 | Returns: |
| 162 | Dictionary mapping bone names to arrays of poses [num_frames, 7] |
| 163 | """ |
| 164 | if len(armature_data) == 0: |
| 165 | return {} |
| 166 | |
| 167 | # Get all bone names from first frame |
| 168 | bone_names = list(armature_data[0].keys()) |
| 169 | num_frames = len(armature_data) |
| 170 | |
| 171 | # Organize by bone |
| 172 | pose_params = {} |
| 173 | for bone_name in bone_names: |
| 174 | bone_poses = [] |
| 175 | for frame in armature_data: |
| 176 | if bone_name in frame: |
| 177 | bone_poses.append(frame[bone_name]) |
| 178 | else: |
| 179 | # Use identity if bone missing in frame |
| 180 | bone_poses.append([1, 0, 0, 0, 0, 0, 0]) |
| 181 | pose_params[bone_name] = np.array(bone_poses) |
| 182 | |
| 183 | return pose_params |
| 184 | |
| 185 | |
| 186 | def load_object_model(object_name, object_model_dir): |
no outgoing calls
no test coverage detected