From 53f168be48de418d8df5310689ec1e64f43ed477 Mon Sep 17 00:00:00 2001 From: Gowthami5 <42027766+Gowthami5@users.noreply.github.com> Date: Thu, 8 Jun 2023 15:03:26 +0100 Subject: [PATCH] Update bvh.py to get channel names as a list --- bvh.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bvh.py b/bvh.py index 40fc5a2..0567e6c 100644 --- a/bvh.py +++ b/bvh.py @@ -112,7 +112,17 @@ def iterate_joints(joint): iterate_joints(child) iterate_joints(next(self.root.filter('ROOT'))) return joints + + def get_channel_names(self): + joints = [] + def iterate_joints(joint): + joints.append(joint['CHANNELS'][1:]) + for child in joint.filter('JOINT'): + iterate_joints(child) + iterate_joints(next(self.root.filter('ROOT'))) + return joints + def joint_direct_children(self, name): joint = self.get_joint(name) return [child for child in joint.filter('JOINT')]