Update visualize stick_show for Python 3 and with clear error message for failure.

This commit is contained in:
Neil Lawrence 2021-05-21 08:01:39 +01:00
parent ff2eea1169
commit 74fab170d1

View file

@ -499,7 +499,13 @@ class stick_show(mocap_data_show):
super(stick_show, self).__init__(vals, axes=axes, connect=connect)
def process_values(self):
self.vals = self.vals.reshape((3, self.vals.shape[1]//3)).T
"""Convert vector of values into a matrix for use as a 3-D point cloud."""
try:
self.vals = self.vals.reshape((3, self.vals.shape[1]//3)).T
except ValueError as e:
print('Passed values to data_show need to have a dimension which is divisible by 3 for display as they should be a point cloud of 3-D points.')
raise(e)
class skeleton_show(mocap_data_show):
"""data_show class for visualizing motion capture data encoded as a skeleton with angles."""