Loading FBX models with Assimp: model is not a character

Hi,

All FBX models that I tried load as Actor failed with message “model is not a character”. These models are rigged: some of them I downloaded from internet and others I exported from Blender or Cinema4D to FBX format. It’s weird because the same model works very well when I convert it to EGG (but I would like avoid this because I want discard Blender).

Could someone provide a fully working FBX model to me?? So I could check what’s wrong with my current model (maybe adapting my model to this working model).

Thanks in advance,
David

PS: I download animated models and all of them failed with message “number of frames mismatch”, then I deleted the animation and they failed again with “model is not a character”…

Nobody has a working FBX model?

Have you had a look at the Autodesk FBX converter utility ? It’s been a while since I used it but I’m fairly sure it can convert between different versions of FBX and allow you to view animations. (and is free)

May help to troubleshoot what works. It can also convert to other formats.

I guess FBX isn’t really used a lot around here; if you’re looking for a transmission format that enjoys better support, you might want to take a look at glTF.

Thank you guys, you are amazing!

I didn’t test glTF format yet but it seems an interesting option. In summary my game need create rigid bodies and collision shapes from meshes and then get position and hpr of the model joints to create bullet contraints to rotate these bodies. Why? I will apply torque to move these parts like a human muscle like biceps flex or entend the forearm.

So I need a format that:

  • Run out of box on Panda3D without need external converters (except those native exporters within Cinema4D or Blender).
  • Keeps the meshes (including names) as are.

Direct X format, for example, run out of box on Panda but don’t keep meshes.

PS: I love Cinema4D and I would like export my model directly to a format natively loaded by Panda3D like FBX or glTF. But also I am considering use Blender 2.8 as my new favorite 3d modelling software (I liked the new UI, it’s easier to use) to export to EGG, the problem is that YABEE is not updated to 2.8.

Blender 2.8 has native glTF export, which is supported (with some caveats) by panda3d-gltf. The caveats are:

  • No support for collision solids (work in progress)
  • No support for lights (work in progress)
  • Animation data must be sampled (this is an option when exporting)

There is also blend2bam to convert blend files to Panda’s native BAM format. Once I add a Python file loader for it, you should be able to load blend files via Panda’s usual Loader interface.

Thanks @Moguri, I’ll will try!

Hi @Moguri,

I tried load a rigged .glb model using panda3d-gltf and also gave me “model is not character”. I used Actor class anyway. Is this loader working with Actor?

Yes, panda3d-gltf supports converting rigged models to characters. Can you load the model and paste the output of its ls() method?

model = loader.load_model(path)
model.ls()

Yes, panda3d-gltf supports converting rigged models to characters. Can you load the model and paste the output of its ls() method?

Yes, sure! Later I’ll paste the output.

Hi @Moguri

Here we go:

Known pipe types:
  wglGraphicsPipe
(all display modules loaded.)
:Actor(warning): /c/Users/David_Ragazzi/zebat_robot.gltf is not a character!
PandaNode actor T:(pos 25 -175 50 hpr 0 90 0 scale 10)
  ModelRoot zebat_robot.gltf

Note that there is only a single node but when if you open the glTF file you’ll see that it contain all meshes. I think that at least it should list all meshes as GeomNodes. zebat_robot.blend (2.8 MB) zebat_robot.gltf (905.6 KB)

I uploaded the .blend and .gltf file of my model. Could you check them, please?

Anyway, maybe the problem is way that I’m using python-gltf library:

from direct.showbase.ShowBase import ShowBase
import gltf

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

        loadPrcFileData("", "load-file-type p3assimp")

        gltf.patch_loader(self.loader)
        robot_np = Actor("/c/Users/David_Ragazzi/zebat_robot.gltf")
        robot_np.reparentTo(self.render)
        robot_np.ls()
        robot_np.list_joints()

app = MyApp()
app.run()

My panda3d version is 1.0.4.

Man, where is the error? Everything seems ok!

I need to dig more into this, but the error appears to be with exporting the glTF file from Blender. I have not gotten to analyzing the blend file, but I took a quick look at the glTF file, and I do not see a “skin” which is what ties a mesh to a skeleton and results in a Character in Panda. Are you using the armature modifier?

The code snippet looks fine. You don’t need the gltf.patch_loader(self.loader) if you’re using Panda 1.10.4+, but it also doesn’t hurt anything.

I do not see a “skin” which is what ties a mesh to a skeleton and results in a Character in Panda. Are you using the armature modifier?

Yep, in fact I still didn’t bind joints and polygons. I thought that this wouldn’t hinder at all once that I understood the rig present in the model already could be considered an armature (even without skins). I will do that and test it again.

The code snippet looks fine. You don’t need the gltf.patch_loader(self.loader) if you’re using Panda 1.10.4+, but it also doesn’t hurt anything.

Is also need the line bellow if I use only glTF files?

loadPrcFileData("", "load-file-type p3assimp")

p3assimp can also load glTF files, so I would not advise having that line, as it may conflict. You really want to be sure you’re using panda3d-gltf.

p3assimp can also load glTF files, so I would not advise having that line, as it may conflict. You really want to be sure you’re using panda3d-gltf.

Interesting… Thanks!

@Moguri

Ah… I forgot say… I also tried using the load_model function and also no GeoNodes listed… Although this probably is because I used p3assimp instead of panda3d-gltf.

For some reason, the problem was Cinema4D which when it converted my model to FBX, DAE, GLTF, the armature wasn’t read by Panda3D. Probably is the C4D exporter or then Assimp library is not prepared to read the C4D exported files.

So I had to recreate a model from scratch on Blender and then put my polygons again over a new armature… And works fine…