error on Multi-Part Actors

I am trying to use multi-part actors, but I keep getting this error:

File “”, line 1738, in activate
File “C:\Panda3D-1.5.2\direct\src\actor\”, line 258, in init
self.loadModel(models[lodName], lodName=lodName, copy = copy)
File “C:\Panda3D-1.5.2\direct\src\actor\”, line 1742, in loadModel
self.__prepareBundle(bundleNP, model.node(), partName, lodName)
File “C:\Panda3D-1.5.2\direct\src\actor\”, line 1785, in __prepareBundle
File “C:\Panda3D-1.5.2\direct\src\actor\”, line 549, in __updateSortedLODNames
File “C:\Panda3D-1.5.2\direct\src\actor\”, line 545, in sortFunc
return cmp(smap[y[0]], smap[x[0]])
KeyError: ‘s’

Here’s my code:

        self.plant01 =Actor({"stalk":"Models/plantStalk.egg","flower01":"Models/plantFlower01.egg",},

What might be the problem? Thanks

Looks like the manual was a little inaccurate. For a multi-part actor, the second parameter must be a dictionary of dictionaries, not just a simple dictionary. I’ve corrected the manual page.

Without a two-level dictionary in the second parameter, the actor code thinks you’re trying to create a multiple-LOD actor, not a multipart actor. And it’s making some assumptions about the names of your different LOD’s (which in your case aren’t LOD’s anyway).

Note that multi-part actors are pretty complicated to set up and difficult to get right.


You could say that again.
With this code my flower model should now be standing on top of my stalk model, since the top bone of my stalk is named ‘bone_joint’, and the botom bone of my flower carries the same name. Instead though, both are at the same level, and position.

        self.plant01 =Actor({"stalk":"Models/plantStall.egg","flower01":"Models/plantFlower01.egg",},

How difficult is difficult? 80% difficult, or can I get it done with a bit of understanding of what is in the manual?

You can certainly do it. It’s just that there are lots of ways for things to go wrong, and it’s not always easy to figure out why.

In this case, since your flower bloom isn’t inheriting the animation, it must mean that either (a) the bloom is not parented to the joint node properly by the attach() method, or (b) the joint node is not showing the animation properly.

You can use to visually check the scene graph hierarchy and make sure that it’s parented properly, to test (a).

To test (b), try loading a normal, single-part actor and parenting any old node (like a cube.egg) to the joint node in question. Does it animate? If not, are you sure that particular joint actually does have animation? Presumably you’ve already exposed the joint in question (or there wouldn’t even be a joint node to attach to), right?


I haven’t had a chance to try out you suggestion yet, but thanks.