Gltf cannot load multiple parts

My model consists of 2-5 parts. The original format is Iqe. After converting to gltf format, I can see all parts with other tools. Gltf viewer can also see all parts, but when the animation is played, only one part is moving, and the rest parts keep the initial posture. In Panda3D, only one part can be seen. I think gltf only loads one part, not other parts in the model. I tried to split the parts of the model into multiple models, but failed. In other tools, these split models can be combined normally, and even the animation can be synchronized perfectly. In gltf viewer and Panda3D, the angle and position errors always appear from the fourth split model, which leads to the animation can not be combined with other models. Strangely enough, in Panda3D, the position of the initial pose is normal, and all the models I split can be combined normally. Only when I play the animation, there is a position error. I wonder if this error is caused by the change of the height and width of the split model, but it seems that this is not the reason, because the width and height of the first three split models are not consistent, but their positions are not wrong.

Through other viewing tools, I can make sure that no matter how many parts are integrated into a model or how many models are split up, they can display and play animation normally. I’m sure the problem is in Panda3D. Does Panda3D not support multiple parts in gltf model? If so, can you tell me how to solve it?

There is an error in PS: gltf module, which can’t fully support gltf 2.0 standard. After I converted to gltf format, gltf viewer and Panda3D could not recognize the load. I’ve tried other tools, no problem at all. Before, I always used three.js to render gltf, which can recognize the gltf I converted, but Panda3D can’t. Now I can only convert to FBX format (I tried this format, there are too many problems in Panda3D), and then convert to gltf format, so that I can be recognized by Panda3D.

1 Like

Panda3D have support for multipart actors. You have to do something like that to create a multipart actor:

model = loader.load_model('model.gltf')

parts = {}
anims = {}

for np in model.find_all_matches('**/+Character'):
    parts[np.get_name()] = np
    anims[np.get_name()] = {}  # you need at least an empty dict if you don't have any animations files to load

actor = Actor(models=parts, anims=anims)

The problem is that Panda3D cannot load more than one part. My model is composed of head, body, legs, clothes and weapons. Each part is a separate map. I can’t merge these maps. Because of the heavy workload, splitting these parts into independent gltf models is the best way I can think of now, but this method can’t be used in Panda3D.

My biggest problem now is that Panda3D can only load the head of my model, and other parts of the body and legs cannot be loaded. If it loads other parts, I should be able to see the data of other parts, but I don’t see the data. Even if I try your method, I still can only see the data of only one part in the loaded model. Based on the fact that I only saw the name of one part.

My model has four parts, using for NP in model.find_ all_ Matches (’* / + character’): after running, I found that it only executed once. If all parts are loaded, it should be executed four times. This makes me quite sure that other parts are not loaded.

Gltf viewer can see all parts of my model, just play animation, which is only effective for one part. Panda3D is only one part of the data, and can not load all parts of the data like gltf viewer. If Panda3D can load data of all parts like gltf viewer, this problem will be solved.

I don’t know what the problem is now. I suspect that my model is converted to gltf format. There is a problem here, but it is normal for me to use other tools such as 3ds max, and it is also normal to call threer.js in the browser, except gltf viewer and Panda3D. So now I think there may be a bug in the gltf module. If it’s a problem with my model, other tools should also have problems, but they don’t have any exceptions.

It might be worth noting here that this sort of thing–if I’m understanding your problem correctly–works as expected when loading egg-files. I’ve also seen a similar-seeming problem occurring when dealing with glTF files exported via blend2bam, I think.

I found that using other 3D modules in Python to render the gltf model I wrote made the same mistake. If the gltf model I wrote was wrong, it should have the same error in the tools like 3ds max, but it didn’t appear in these tools.

I can now be sure that there is no problem with the static model, but there is a problem with the animation. I split each part into its own model, and it always has the wrong position. The bones and animations referenced by these models are the same. The only difference is that the triangle index is different. I don’t understand why the same skeleton and the same animation can’t synchronize the positions of the parts of the model after splitting.

If you’ve ever seen this before, I think these errors will still occur even if you switch to the egg model.

It is entirely possible that the problem lies in the way that the model has been constructed.

I will say that it’s very possible to have a multi-mesh animated model, I do believe–as I recall, I’ve made and used a number of such models.

That said, I haven’t yet used the glTF format, let alone the current Blender-exporters to that format. To be specific, I’m most familiar with a pipeline that produces egg-files from Blender <2.8 via YABEE.

The original data of my model is not in 3D format, but in binary format according to my own requirements. When I rewrote them to gltf format, they won’t work in Panda3D. If it’s my model problem, it should have the same error on tools like 3DS max. Like the three.js library I used before, it has no problems.

What happens then if you import your model into, say, Blender, and then re-export it in glTF format?

Why. You can do it the same way.

You just have to call load_model multiple times:

parts = {}
anims = {}
parts['head'] = loader.load_model('head.gltf')
anims['head'] = {}
parts['body'] = loader.load_model('body.gltf')
anims['body'] = {}
actor = Actor(models=parts, anims=anims)

You can check contents of the loaded model with:

model.ls()

You can also do it in gltf-viewer by pressing Shift+L

1 Like

Blender also has this problem. In recent days, I have tried many methods, including converting to FBX format. However, the FBX model is so serious that no data can be imported.

I can’t understand why the gltf I wrote didn’t appear in other 3D tools, even the three. JS library I used before didn’t appear any problems. This makes me doubt that Panda3D has serious defects in gltf format, and even can be described as not supporting it. What I can’t understand is that if FBX is not supported, at least a general model format can be supported. However, Panda3D doesn’t seem to have this idea. I think the 3D engine can have its own model format, but at least it has to support a general model format. Moreover, Panda3D seems to be ten years old. I can’t imagine why the team hasn’t updated the function supporting a common model in ten years.
I decided to give up Panda3D because of its limitations on the model. I think it’s a waste of time to continue to use Panda3D.Thank you for your reply.

The animation data viewed by LS () is consistent. I also spent a lot of time comparing the joints, and there is no difference in their data. But there is a problem of wrong position in rendering. I’ve been trying to solve this problem these days, but in vain. I have to give up using the engine. Thank you for your reply.

What is a “general model format”?

To the best of my knowledge, each format is different; there is no one format that is compatible with all others.

[edit]
Unless you mean a format that’s commonly used. In that case, I suspect that there simply wasn’t much call for such support from the engine’s community; I imagine that many were happy with exporting to “egg” or “bam” from Blender.
[/edit]

I think that this may just stem from Panda’s “egg”/“bam” formats having worked well over the years. It’s only fairly recently that support for glTF has been introduced.

Ah, I’m sorry that it’s not working out for you. But indeed, if a given engine doesn’t meet your requirements, then it seems fair to move on!

I want to correct you: it’s not exported from blender, it’s to find the specified blender version first, then install the plug-in, and then export.

I just want to take the software I’m using now as an example: 3ds max, Maya, blender and C4d. If you have these four tools, you will see that at least three model formats are supported at the same time when you open them.

The three. JS library I used before can support dozens of model formats. Because it is based on the browser and can’t solve the memory bug, I want to find a convenient engine to replace it.

As for the good format of “egg” and “BAM”, if I didn’t see so many people complaining about the egg format, I might believe you.

I’m not quite sure that I follow you here–could you clarify, please?

[edit]
Are you referring to the process of exporting from Blender to egg? That is, that it’s not a simple out-of-the-box process?

If so, then that is fair–but in all fairness too, it’s only since Blender 2.8 (I gather) introduced changes that broke YABEE that getting a specific version-range became important.
[/edit]

I don’t know the .js library that you were using, but I suspect that the other tools that you mentioned have had rather larger teams working on them for much of their development, and perhaps even a less sprawling set of requirements.

Why the original developers decided to use their own model-formats I don’t know, offhand. But they did, and those formats worked, and the engine has likely had plenty of other elements to see work on, so I don’t blame the devs here if they preferred to focus on those other elements rather than develop further model-format support.

Sure–but that’s a relatively recent phenomenon (at least in its commonness), I believe.

It has nothing to do with the strength of the team. If it is a small-scale team, it should be compatible with the format that has been widely used.

You seem to have reversed the order: plug-ins need to cooperate with software, not software to cooperate with plug-ins.

I wonder why you said that blender broke yabee, not that yabee can’t support blender. It seems that you think yabee is more important than blender. It’s a wrong way to update blender. Everything should be done around yabee. I think most people will wonder why yabee can’t be updated to support the latest version of blender instead of complaining about why the latest version of blender doesn’t support yabee.

I’ve encapsulated many libraries, and I’ve always asked to use custom format to process data, so I think I can help you answer why they decided to use their own format: using their own format can process data more easily, especially without knowing other model formats. It can be directly described as lazy behavior. If you’ve ever had experience with bottom-up development, you can see how happy this approach is.
My current model library has thousands of models: a model has 2-5 parts, 50 + animations, each part needs to change 1-3 maps, I write my own gltf format to deal with, a model only takes 10 seconds. I only need to set the directory for all the models to be processed automatically. Even if it takes one day, I can let the program handle it automatically and do other things by myself. If you switch to other converters, it will take at least 2 minutes to process a model. If you think that the egg format allows me to process a model in 10 seconds, I have to admit that I can’t find a reason not to use Panda3D.

And there is a more serious problem. Every frame of my animation is a key frame, and there is no need to supplement it. When I use the converter, they automatically fill the frame. Like my 5-frame animation, in the conversion process, it always makes up frames in the way of these converters. Finally, after loading into Panda3D, a frame supplement will be performed. What shocked me was that other tools were frame filling, while Panda3D was frame subtraction. A 400 frame animation is added to 500 frames and reduced to 300 frames in Panda 3D. When I use the controller to get the number of frames I want by time,It can’t play normally again. Even if I finally solve the problem that the model cannot be loaded into Panda3D normally, I will face this problem again. So I can no longer use the jurisdiction.

Again, the decision to make a custom format was made before the current, small team–it was made, I believe, back in the days in which the project was run by CMU and Disney.

Not at all.

But remember: Blender and YABEE weren’t made by the same people. Blender is a third-party tool, unrelated to Panda, while YABEE was a tool made by a member of the Panda community.

So, when significant changes were made to Blender after version 2.78, those changes broke YABEE’s functioning. And alas, at that time the developer of YABEE was (I forget) either not around any more or not interested in porting it to work with Blender’s new functionality.

In short, the Blender team has nothing to do with YABEE, as far as I’m aware, so they’re not likely to do things around it.

That’s a plausible answer, indeed. Of course, it may also have been a matter of “not invented here” syndrome, or perhaps there wasn’t at the time a format that suited them, or some other reason besides.

I don’t think that I’ve benchmarked that, but indeed, I doubt that you’d get a particularly fast result from the egg-pipeline, I’m afraid. Between the text-based nature of “egg” and the internal conversion to “bam”, I suspect that you’d find it to be a little slow.

That issue I’m not in a position to speak to, myself. Perhaps one of the others might know whether there’s a way to preserve the exact keyframes that your animations have. (If you were to stick with the engine, that is, of course.)

[edit]
Another thought: I fear that you’ve caught the engine in a bit of a transitional period. Right now development is moving towards a glTF pipeline–but as you found, it’s not quite there yet. Conversely, it’s perhaps moving away from the egg-pipeline, with tools like YABEE heading towards deprecation.

Alas, that leaves a user like yourself, wanting particularly robust model-support, to find the engine’s model-handling to be lacking.

I’ve never had an issue with the engine subtracting frames. Actually, the per-frame animation specification is quite good, and it absolutely will work with properly exported glTF files, if not in all possible conversion cases.

I think part of the issue new users have is that they think they can just jump into Panda3D the same way that they can jump into other engines, which are tailored to do that.

If you have a huge, varied, model workflow, why not just use Unreal? Then you can deal with all the problems of Unreal model integration, with a larger community providing tutorials and support. “Right tool for the right job.”

Panda3D, to me, is better suited for a creator who wants to build a simulation or a game world entirely from scratch, with custom built assets. I’d say, even in the current transitional period between .egg and .gltf, that Panda is best in class in this regard. I certainly wouldn’t want to do science in Unity or Unreal Engine (not to say they couldn’t do it). I’m not getting on the Unreal forum and complaining that their engine is too bloated and opinionated to do science efficiently.

If you as a developer are relying entirely on prebuilt assets, Panda3D is probably not the best choice.

However, if you want an engine that can do really custom boutique stuff, or if you want an engine that allows fancy Python Package support, or if you’re doing scientific simulations in real-time, Panda is probably going to be great for that.

1 Like

You didn’t catch what I said. I believe you don’t have much experience in development. I guess you may not have your own works yet. I can understand you very well, because you won’t encounter the problems I encounter.

Now I think of the problem that shocked me: the rendering of the engine I used will trigger an event, in which you can accurately control the rendering process and result. In Panda3D, it is not bound by the situation of events, but triggered by a timer. This method will inevitably lead to a bug that the rendering time is not synchronized with the timer trigger time. In the document, I also see that this phenomenon does exist. They explained that this is a bug of multithreading rendering. In fact, it has nothing to do with multithreading, that is, if multithreading rendering is used, it will trigger synchronously if binding events. A timer, of course, can’t trigger synchronously.
Just like I’m working on the rendering of frame 2, I’m going to add some parameters. Under normal circumstances, engine rendering needs to wait until I finish processing the second frame before new rendering. But in Panda3, the engine will be in an uncontrollable state and continue to render the following frames. It doesn’t need to wait for my processing to finish. I should continue to process frames 3 and 4 after processing frame 2. When I finished processing frame 2, I found that the engine rendered frames 5 and 3-4 at this time. It did not trigger the timer, and I did not receive any information about frames 3-4.

Let us please stick to the issue at hand and not go on unnecessary tangents or make insulting remarks.

Are you able to share the .gltf model so that we may examine it and determine why panda3d-gltf is unable to load it?

As for the frame subtraction, panda3d-gltf expects that the .gltf model uses sampled animation data, not keyframes. It is unable to sample the keyframes by itself. Many gltf exporters can generate sampled data at the desired framerate.

2 Likes