mecab / BVHToolkit

A helper library for cgkit This provides some useful function to handle BVH animation format with cgkit
3 stars 0 forks source link

problems with the documentation example #1

Closed aguirrea closed 10 years ago

aguirrea commented 10 years ago

I'm trying the example:

import os import BVHToolkit from cgkit.bvh import Node from BVHToolkit import Animation, Pose, Bone

"""Load BVH and get node positions."""

bvh_serial_path = os.path.join(os.path.dirname(file), "test.bvh") animation = BVHToolkit.Animation(bvh_serial_path) pose = animation.get_pose(3) # get pose at third frame pose.get_position(1) # get position of the root node

And I get the error "IndexError: list index out of range" Any idea? Andrés

mecab commented 10 years ago

Thanks for feedback.

My example is wrong. Sorry.

Replace

animation = BVHToolkit.Animation(bvh_serial_path)

to

animation = BVHToolkit.Animation.from_bvh(bvh_serial_path)

ofcourse

animation = Animation.from_bvh(bvh_serial_path)

is fine.

I'll fix documentation last night.

Mecab

mecab commented 10 years ago

oh, I mean today's night, not last night :D

aguirrea commented 10 years ago

Thanks for your fast response! There is a way to use the pose.get_position method but insted of using the id number use the string of the node? All the best Andrés

On Thu, Oct 30, 2014 at 12:20 AM, mecab notifications@github.com wrote:

Thanks for feedback.

My example is wrong. Sorry.

Replace

animation = BVHToolkit.Animation(bvh_serial_path)

to

animation = BVHToolkit.Animation.from_bvh(bvh_serial_path)

ofcourse

animation = Animation.from_bvh(bvh_serial_path)

is fine.

I'll fix documentation last night.

Mecab

— Reply to this email directly or view it on GitHub https://github.com/mecab/BVHToolkit/issues/1#issuecomment-61036650.