Not loading blender animations

Normally, egg files work properly.
If you’re familiar with my last post,
You’ll see I have found the way to get my files in blender to .egg, This is true.
It seems like models/ralph or models/panda-model,
things of that sort, Work fine, and work very well.

I have created my own model, However,
And it is an egg file.
When i put the model into Panda3D,
It will not show as in the game.
And when i try to move my character,
I get errors, and panda closes.

The main thing is that when I use models/ralph,
It loads fine, No errors, nothing.
But when I use MY models, I get errors.

My model is listed in the “models” file, Btw.

Well, what errors are you getting and what do you see when you load the model into Panda?

can post the exact and full error you are getting?

when asking for help with code issues, you should always provide as much related information as possible.

[edit] darn… i was ninjad.

This is the full error message I receive:

DirectStart: Starting the game.
Known pipe types:
(all display modules loaded.)
:Actor(warning): models/character-idle is not a character!
Traceback (most recent call last):
  File "", line 146, in move
  File "C:\Users\Britany\Desktop\Panda3D\Panda3D-1.7.2\direct\actor\", line 1555, in loop
    for control in self.getAnimControls(animName, partName):
  File "C:\Users\Britany\Desktop\Panda3D\Panda3D-1.7.2\direct\actor\", line 1849, in getAnimControls
    allowAsyncBind = allowAsyncBind)
  File "C:\Users\Britany\Desktop\Panda3D\Panda3D-1.7.2\direct\actor\", line 2341, in __bindAnimToPart
    bundle = self.__commonBundleHandles[subpartDef.truePartName].getBundle()
KeyError: 'modelRoot'
:task(error): Exception occurred in PythonTask moveTask
Traceback (most recent call last):
  File "", line 197, in <module>
  File "C:\Users\Britany\Desktop\Panda3D\Panda3D-1.7.2\direct\showbase\", line 2630, in run
  File "C:\Users\Britany\Desktop\Panda3D\Panda3D-1.7.2\direct\task\", line 502, in run
  File "C:\Users\Britany\Desktop\Panda3D\Panda3D-1.7.2\direct\task\", line 460, in step
  File "", line 146, in move
  File "C:\Users\Britany\Desktop\Panda3D\Panda3D-1.7.2\direct\actor\", line 1555, in loop
    for control in self.getAnimControls(animName, partName):
  File "C:\Users\Britany\Desktop\Panda3D\Panda3D-1.7.2\direct\actor\", line 1849, in getAnimControls
    allowAsyncBind = allowAsyncBind)
  File "C:\Users\Britany\Desktop\Panda3D\Panda3D-1.7.2\direct\actor\", line 2341, in __bindAnimToPart
    bundle = self.__commonBundleHandles[subpartDef.truePartName].getBundle()
KeyError: 'modelRoot'

**** End of process output ****

Although this looks way too misleading,
So remember;
My animation is character-idle/walk.
It is a .egg file.

When i replace character-idle/walk with panda-model/walk4, Everything works perfectly fine.

Actually, I think that the error does indeed indicate where the problem lies:

(From the error)

It looks as though either you’re not loading the actor correctly or you’re attempting to load a model that is not in fact an animated model.

Based on the error, I strongly suspect that it’s the former; it looks as though you’re attempting to load the animation as though it were the model itself. Would you please post the code that you use to load your model?

Here you go.

from import Actor

self.blaze = Actor("models/character-idle",
                                  {"run": "models/character-walk",
                                  "walk": "models/character-walk"})

If i replace models/character-idle with:
models/character-walk with:
or whatever else Panda gives us to use as a default setting,
Everything works perfectly.

I used Blender,
And Yabee to make it .egg.

The problem is with your character model.
Is “character-idle” your character model or an animation? The first argument to Actor should be the model, not an animation.
If it is a model, then the model is not being properly exported as a character, and instead just as a regular model.

Character-idle is the name of my animation.

I don’t quite understand.
I created my model using Blender. A simple doll-like model.
I downloaded Yabee, installed it onto blender,
Exported the file as a .egg file (character-idle.egg),
And placed it into the models folder in panda’s base.

Anything sound different/wrong? Sounds fine to me.

You are trying to use an animation as a character model. There is no geometry being loaded.

The first file given to the Actor class should be the character model, not an animation. So it should look something like this:

self.blaze = Actor("models/character_model",
                   {"idle": "models/character-idle",
                    "run": "models/character-walk",
                    "walk": "models/character-walk"})

This equivalent way of loading animations may make the problem more clear:

self.blaze = Actor("models/character_model")
self.blaze.loadAnims({"idle": "models/character-idle",
                      "run": "models/character-walk",
                      "walk": "models/character-walk"})

A few more thoughts occur to me:

  • When exporting, do you add your animations to the box labelled “Animation”?

  • Is the check-box labelled “Separate animation files” checked?

  • Is the check-box labelled “Animation only” checked?

I had just checked on these:

  • No.

  • Yes, I had not known their were boxes for these, as seperate is default.

  • No.

I think this MIGHT explain what’s wrong?
Both of them are “Separate Animation Files”.

If this shows what i’m doing wrong,
Could you please explain to me how to fix it,
and what they might mean?

Hmm… First of all, how have you defined your animations? Do you have a single Blender file, containing a model that is controlled by an armature? If not, how have you gone about it?

Presuming that you it is as I describe above, the below is a method that I suggest, I believe. (I don’t claim that this is either the only or the best way, merely one that seems to work for me.)

  • Open the Yabee interface; choose a name for the model itself, not any of its animations (you might use just “character”, for example, based on the names above).

  • Next to the box labelled “Animation”, note the buttons labelled with a plus- and a minus- sign; these add and remove animations respectively.

[list][*]Press the “add” button; note the new controls that should appear below the “Animation” box.

  • Use these to name your animation (such as “idle”, “walk”, etc.), and to specify the start- and end- frames for the animation, as defined in the animations in Blender.
  • Repeat for each of your animations.

The next bit depends, I believe, on how you prefer to store your animations, and what you’re doing at the time.

If you select “Animation only”, it should export only the animations - there should be no exportation of the model. This might be useful if you later go back to add a new animation to your model.

If you leave “Separate animation files” selected, Yabee should export a separate file for each animation - along the lines of “character-walk.egg”, etc. If you de-select it, the animations should be stored all in a single file.

If you’re uncertain, it’s probably easiest and safest to leave them as you find them - “Animation only” off and “Separate animation files” on.

Thanks, I did get it:)
However, I have one problem.
My animations are in separate files.

When my idle and walk animations are loaded, they start as the actual T-Model rather than what I set my character to do.
For example: if I made him do a running animation, and put it into Panda3D,
He’d run without moving his legs and T-Arms stuff.

I don’t understand.

To clarify, please: does the model start in the T-pose, then play the animation, or does the animation never play?

Secondly, to double-check: you are loading your animations as teedee gave example of, correct? You’re not attempting to load the animations separately from the main model?

(Note: storing the animations as separate files does not entail, if I’m not much mistaken, loading them as separate models.)

Well it used to start in the T-Pose.
But then I decided to make a new animation for it, and see what would happen. Now no matter what order I put “Seperate File” or “Animation Only”, Nothing happens. It’ll say it is not a character. I will try one or the other, both, or even none. And now: Nothing.

From Teedee: No. Honestly, It only confused me more than usual. I don’t see which is better than the other (that he’s posted, since there is two), Or even what the difference is between what I have now.

This Note has also confused me. I have no idea at all what you’re trying to tell me.

Sorry that I sound kind of pissy, This whole thing is really starting to tick me off, Since I can’t even make my own animations, But rather someone else’s.
I’d like a simple step-by-step process that’s easy to understand.

This is what I want:
One saved file ONLY for idle.
One saved file ONLY for walk.
One saved file ONLY for run.

Right now, All i’m finding online is using Chicken export, Which is totally different than Yabee.

I would also like an explination on what the difference is on Seperate or Animation Only.

Maybe even make a YouTube video for this.
It would help people like me out, a ton.

Sorry for the late comment by the way. Been very busy.

Don’t worry if you are at all testy - I can understand, I believe, that this situation may well be frustrating for you. :confused:

As to the late reply, I’ll confess that I was away from the forum for a bit myself, so it works out.

As to your problem:
(And please forgive me if I’m a little vague, or off in some elements; I’m somewhat tired tonight, I fear. ^^; )

You should also, I believe, have one saved file for the model itself - the above should just hold the animation data, not the model data, I believe.

I’m not really in a position to create a YouTube video at the moment, I fear, but a quick set of instructions might be something like this:

First of all (just in case this is the problem), I recommend having one Blender file (.blend) for your model and its animations - not one Blender file per animation. I’m not sure of whether the latter would be likely to work at all, although it might.

Secondly, I don’t know whether shape-key animations work; for safety’s sake, I recommend sticking to using an armature for animation.

That said, you should then have a Blender file containing a model, an armature, and a set of keyframes describing its animations. For example, frames 0 to 10 might hold the “idle” animation, 11 to 34 might hold the “walking” animation, etc.

Now, go to Yabee via the “Export” menu option. There:

  1. Set the folder to which to export, if called for.

  2. Enter a name for your model in the entry at the top; in your case you might use “character”.

  3. Scroll down to the box labelled “Animation”.
    For each animation, perform 3.1 to 3.4 below:

3.1) Press the button labelled “+”
3.1.5) Note: If this is the first animation, a few new controls should appear beneath the box.

3.2) In the entry labelled “Name”, enter the name of the current animation, such as “idle” or “walk” - not “character-idle” or “character-walk”.

3.3) In the first control below that, enter the frame in Blender on which that animation starts; in the above example, that would be 0 for “idle” and 11 for “walking”, I believe.

3.4) In the control next to that, enter the frame in Blender on which the animation ends; in the above example, that would be 10 for “idle” and 34 for “walking”.

  1. Make sure that “Animation only” is unchecked, and that “Separate animation files” is checked.

  2. Press export! :slight_smile:

That should result in a set of files: the main model file (“character.egg”, for example) and a set of animation files, named along the lines of -.egg (“character-idle.egg”, for example).

As an example, here is a screenshot of the animation box as used for one of my models - in this case, a door, which has an “open” animation - and the resulting files:

Thanks for the quick reply, but it did not work.
Still get those errors.

I had done every single little thing you have told me to do, and it did not work. I am also getting asked for:

  1. TBS generat
  2. Tex. proces
  3. UV as texture
  4. Copy texture files
  5. Merge actor
  6. Apply modifiers
  7. Pview.
    Not sure if these have to do with it not working, but I listed them as the following:
  8. No.
  9. Simple.
  10. Unchecked
  11. Unchecked
  12. Checked
  13. Checked
  14. Unchecked

If it can help explain a little more what’s wrong, even after setting separate files,
And adding “Start” to “Finish”, with the names listed idle and walk, I still only get one file from the three. “Character-model”. No character-model-idle or character-model-walk, only character-model.

Hmm… That’s interesting, I don’t seem to have those last three options, I believe - perhaps you have a different version of Yabee than do I.

You could try unchecking “Merge actor”, I suppose. You could also try turning “Pview” on, which should load up the resultant files; in Pview, try pressing “a” and seeing whether one of your animations plays.

Otherwise, perhaps go to the Yabee thread - it seems possible that you’ve found a bug, or have taken a version of Yabee incompatible with your version of Blender. If you do try that thread, mention the versions of Yabee and Blender that you’re using, and include the list of options that you have checked/unchecked in Yabee.

I checked Pview and exported, and a pop-up viewer showed up. It was blank. Gray screen, nothing on it. A does nothing.

What version of Blender and Yabee do you use? Maybe I could just download (a) less new version(s).

I seem to be using Blender 2.62 and (I think) Yabee 11.2.

One thing that occurred to me is to check that the version of Yabee that you’re using is compatible with the version of Blender that you’re using. If you go to the Google Code page that should be linked to in the thread to which I linked in my previous post, you should find on the Downloads tab a variety of versions, each with a note indicating the version of Blender for which they are intended.