Exemple #1
0
def test_load_attachments(world):
    skel = pagoda.skeleton.Skeleton(world)
    skel.load(fn('cooper-skeleton.txt'))

    markers = pagoda.cooper.Markers(world)
    markers.load_c3d(fn('cooper-motion.c3d'))
    markers.load_attachments(fn('cooper-markers.txt'), skel)

    assert len(markers.targets) == 41
    assert len(markers.offsets) == 41
Exemple #2
0
def test_c3d(markers):
    markers.load_c3d(fn('cooper-motion.c3d'))
    assert markers.num_frames == 343
    assert len(markers.bodies) == 41
    assert len(markers.targets) == 0
    assert len(markers.offsets) == 0
    assert len(markers.channels) == 41
Exemple #3
0
def test_csv(markers):
    return  # TODO
    markers.load_csv(fn('cooper-motion.csv'))
    assert markers.num_frames == 343
    assert len(markers.bodies) == 41
    assert len(markers.targets) == 0
    assert len(markers.offsets) == 0
    assert len(markers.channels) == 41
Exemple #4
0
def test_135(world):
    with open(fn('135.asf')) as h:
        visitor = pagoda.parser.parse_asf(h, world, color='foo')
    assert len(visitor.bodies) == 0
    assert len(visitor.joints) == 0
    assert len(visitor.bones) == 30
    assert len(visitor.hierarchy) == 24
    visitor.create_bodies()
    assert len(visitor.bodies) == 30
    assert len(visitor.joints) == 0
    assert visitor.bodies[0].color == 'foo'
    visitor.create_joints()
    assert len(visitor.joints) == 27
Exemple #5
0
def test_cooper(world):
    with open(fn('cooper-skeleton.txt')) as h:
        visitor = pagoda.parser.parse(h, world, density=12, color='foo')
    assert len(visitor.bodies) == 21
    assert visitor.bodies[0].color == 'foo'
Exemple #6
0
def test_hinge(world):
    with open(fn('hinge-limits.txt')) as h:
        visitor = pagoda.parser.parse(h, world, color='foo')
    assert len(visitor.bodies) == 2
    assert len(visitor.joints) == 2
    assert visitor.bodies[0].color == (0.9, 0.3, 0.1, 0.8)