Animating only some joints

Ah, I see you are specifying only a single joint in makeSubpart. Evidently the documentation of makeSubpart claims that all the descendants are included automatically, but I have my doubts. What if you explicitly specify all of the joints of the model, excluding those belonging to the arms, in the lower body part, and same for the arm?

1 Like

I did as you suggested and added in every bone to both subpart groups excluding those used by the other group. It has the same behavior :frowning:

It seems if there is any kind of hierarchy overlap or common ancestry whatsoever between two groups, the system won’t play both animations on both subparts at the same time. I did another test as well where I broke the wave animation into the arm movement and hand movement, created a subpart for each, and tried to animate them at the same time. Despite having no overlap, both animations would not play at the same time.

If you like, I can write a small program out of the samples to illustrate what’s going wrong. I’m starting to get the feeling that this might be a bug…

[Edit]: I’m going ahead and making that small program, and I noticed that if I remove overlapping = True in makeSubpart, it throws an error even if there is no explicit overlap. I’m adding in just the shoulder bone of one group, and just the hand bone of another.

[Edit2]: Here’s that test program, it’s based off the Boxing Robots sample
test.zip (5.5 KB)

press A to play the arm animation and S to play the hand animation.

1 Like

The page to which the link leads seems to indicate that the file has been deleted, I fear.

1 Like

test.zip (5.5 KB)
I didn’t realize you could upload files directly to here! My mistake. Here’s the test

Well, I can confirm that half-body animation doesn’t seem to work in that test-program, on my machine at least!

However, I was able to hack together a model that does seem to work!

Try the following in place of your test-program:

Code:
(Modified from your own, above.)

from direct.showbase.ShowBase import ShowBase
from direct.actor.Actor import Actor

class BoxingRobotDemo(ShowBase):
 
	def __init__(self):
		ShowBase.__init__(self)

		#self.disableMouse()
		base.cam.setPos(-10,-10,10)
		self.model = Actor("data/halfBodyTest",{'mew':"data/halfBodyTest-mew",'meow':"data/halfBodyTest-meow"})
		self.model.makeSubpart('arm',['Bone.001'], overlapping = True)
		self.model.makeSubpart('hand',['Bone.002'], overlapping = True)

		self.model.reparentTo(render)	
		base.cam.lookAt(self.model)
		base.accept('1', self.animate,['mew', 'arm'])
		base.accept('2', self.animate,['meow', 'hand'])

	
	def animate(self, anim, part):
	
		self.model.play(anim, partName = part)

demo = BoxingRobotDemo()
demo.run()

Assets:
halfBodyTest.zip (4.0 KB)

So, the question is that of why one works, and the other doesn’t.

If I were to guess, I’d guess that it’s that one of the following:

  • One half-body section includes a joint that is a root-joint for the other
  • One animation affects the other (in this case, the “wave” animation has the effect of moving vertices that are also moved by the “curl” animation)

In my working example, above, the two animations each use one joint only, and while they have a common root-joint, they don’t make use of it. I also made a point of only including animation-keyframes for the joint involved in a given animation, and not the other joint.

3 Likes

It works on mine! That is something that I noticed, that YABEE and PRPEE export all joints as keyframes any time there are any keyframe present. So if one joint in the arm moves on one frame, the position, rotation, and scale are logged for each other joint on that frame. That might be a bug with PRPEE but still I think the halfbody animations of Panda should be able to animate only the joints you ask for (and their descendants) without this behavior. Do you think I should launch a bug report on this?

Oh no, another person who ended up with PRPEE?! >_<;

Please don’t use PRPEE.

As I understand it, it’s not a general replacement for YABEE, being made primarily toward the purposes of its creator. As a result, it may not always produce the results expected.

If you do want a version of YABEE that works with the newer versions of Blender, I suggest that you instead try Maxwell175’s port of YABEE–see here.

Otherwise, I have a “quick-reference” thread that goes through some of the options available for exporting from Blender–or at least, what I know of them! Perhaps that will provide some additional options.

*sigh*

But moving back to the point at hand:

Indeed, that does seem to be the case. However, if you check the animation files that I posted, I think that you’ll find that this seems to be the case even there–and, as you noted, half-body animation does seem to work with those animations.

I exported the above with an old version of YABEE (I’m still using an old version of Blender), so I don’t think that this behaviour is a bug.

However, perhaps try your model as exported via a non-PRPEE version of YABEE, just in case this does reflect a difference in PRPEE’s handling of animations.

1 Like

Good to know! I will uninstall PRPEE immediately! Thank you for providing a list of replacements.

I exported my test again using my old version of blender and YABEE, with the hand and the arm being separate subParts… and it still doesn’t work! It still seems like if one subPart has dependency that runs through another subPart, both subParts cannot play any animation at the same time.

I assume the expected behavior is that if the arm subPart animates, animating the hand subPart afterwards will not affect the arm at all, but will effect only the hand. I could expect playing an animation on the arm, with the hand included, to override the animation on the hand subPart, though.

1 Like

Hmm… Looking at the manual page that describes “half-body animation”, I see that it allows one to specify a list of joints to be excluded from a half-body animation.

I’ve thus gone back to your earlier test-program and modified the call to “makeSubpart” that defines the “arm” sub-part such that it now additionally has the following parameter: excludeJoints = ["hand"]

And indeed, with that change, the half-body animation seems to work! :slight_smile:

2 Likes

YES! Thank you so much! This works exactly like I expect it to! To have animations overlapping multiple subParts it wouldn’t be too hard to have a system walk down the dependencies looking for subparts, and animate them if no animation is already is playing. This is just what I was looking for!

2 Likes