Skip to content

Commit

Permalink
test: Add test_load_actor
Browse files Browse the repository at this point in the history
This test makes sure the Python file loader works with the Actor class.
  • Loading branch information
Moguri committed Mar 24, 2024
1 parent 305078c commit 95e2621
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/test_load.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from direct.actor.Actor import Actor
import panda3d.core as p3d
import pytest #pylint:disable=wrong-import-order

Expand Down Expand Up @@ -26,3 +27,12 @@ def test_load_prc(showbase, modelpath):
scene = showbase.loader.load_model(modelpath, noCache=True)
p3d.unload_prc_file(page)
assert scene.find('**/+BulletRigidBodyNode')

def test_load_actor(modelroot):
actor = Actor(p3d.Filename(modelroot, 'Fox.glb'))
assert actor

print(actor.getAnimNames())
assert 'Walk' in actor.getAnimNames()

actor.play('Walk')

0 comments on commit 95e2621

Please sign in to comment.