Skip to content

Commit

Permalink
Merge pull request #17 from yanchxx/yanchxx-patch-1
Browse files Browse the repository at this point in the history
fix time_col length bug for converting to csv
  • Loading branch information
OlafHaag authored Sep 19, 2022
2 parents 35451c8 + 21a461d commit 83b23d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/bvhtoolbox/convert/bvh2csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def write_joint_rotations(bvh_tree, filepath):
:return: If the write process was successful or not.
:rtype: bool
"""
time_col = np.arange(0, bvh_tree.nframes*bvh_tree.frame_time, bvh_tree.frame_time)[:, None]
time_col = np.arange(0, (bvh_tree.nframes - 0.5)*bvh_tree.frame_time, bvh_tree.frame_time)[:, None]
data_list = [time_col]
header = ['time']
for joint in bvh_tree.get_joints():
Expand Down Expand Up @@ -84,7 +84,7 @@ def write_joint_positions(bvh_tree, filepath, scale=1.0, end_sites=False):
:return: If the write process was successful or not.
:rtype: bool
"""
time_col = np.arange(0, bvh_tree.nframes * bvh_tree.frame_time, bvh_tree.frame_time)[:, None]
time_col = np.arange(0, (bvh_tree.nframes - 0.5) * bvh_tree.frame_time, bvh_tree.frame_time)[:, None]
data_list = [time_col]
header = ['time']
root = next(bvh_tree.root.filter('ROOT'))
Expand Down

0 comments on commit 83b23d0

Please sign in to comment.