Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Animating a subPart of Actor does not use the animation from the model #647

TheCheapestPixels opened this issue May 6, 2019 · 1 comment


Copy link

commented May 6, 2019

The model contains two animations (currently one, but the error of one being not present gets silently swallowed at the moment, for reasons that this bug also shows) for two different parts of the vehicle. Since the animations shouldn't be blended, we create subparts for them. Upon wanting to play one of them, Actor seems to look for a file containing the animation.

from direct.showbase.ShowBase import ShowBase
from import Actor

s = ShowBase()

AIRBRAKE = 'airbrake'
STABILIZER_FINS = 'stabilizer_fins'

actor = Actor('Ricardeaut_Magnesium.bam')
airbrake_joints = [
                   for joint in actor.getJoints()
actor.makeSubpart(AIRBRAKE, airbrake_joints)
stabilizer_joints = [
                     for joint in actor.getJoints()
actor.makeSubpart(STABILIZER_FINS, stabilizer_joints), partName=AIRBRAKE)


Traceback (most recent call last):
  File "", line 23, in <module>, partName=AIRBRAKE)
  File "/home/baribal/.virtualenvs/py3/lib/python3.5/site-packages/direct/actor/", line 1536, in play
    for control in self.getAnimControls(animName, partName):
  File "/home/baribal/.virtualenvs/py3/lib/python3.5/site-packages/direct/actor/", line 1849, in getAnimControls
    allowAsyncBind = allowAsyncBind)
  File "/home/baribal/.virtualenvs/py3/lib/python3.5/site-packages/direct/actor/", line 2362, in __bindAnimToPart
    self.loader, Filename(anim.filename), -1,
TypeError: expected str, bytes, Path or Filename object, not NoneType

@rdb rdb self-assigned this Jul 18, 2019

@rdb rdb added the bug label Jul 18, 2019

@rdb rdb added this to the 1.10.4 milestone Jul 18, 2019


This comment has been minimized.

Copy link

commented Jul 18, 2019

Yeah, it looks like this combination of edge cases ("virtual" subparts on models with pre-bound animations) probably hadn't been tested. It looks like this has a fairly easy fix and I think I can get this in 1.0.4.

Note that blending can be used as alternative (that doesn't require setting up subsets of joints) if you just set the blend weights to 1 explicitly. You shouldn't expect trouble with that approach if the animations target different joints.

@rdb rdb closed this in 22d5029 Jul 18, 2019

PointSource-xx added a commit to PointSource-xx/panda3d that referenced this issue Jul 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.