Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different Blender meshes with the same name end up as the same Bullet collision shape #92

Open
insolite opened this issue May 1, 2024 · 0 comments

Comments

@insolite
Copy link

insolite commented May 1, 2024

Description

When I convert/load 2 models with different (but identically named) meshes, the second one gets a collision shape from the first one.

image

Use case

I have 3 separate blend files:

  • cube1.blend - A model with mesh named Cube.
  • cube2.blend - Another model of a different shape but the mesh is also named Cube.
  • level.blend - Aggregating 2 assets from the files above into a single scene via Blender's Link feature.

So I convert only the level.blend to level.bam

blend2bam --physics-engine bullet level.blend level.bam

Then I load it into the panda3d app, add the nodes to the world, and the result is as on the screenshot above.

Although it's not possible to have identically named meshes in a single blend file, we can still have this case when importing models from other blend files via Blender's Link feature. Of course it's possible, but very hard to maintain globally unique names of the nodes across different blend files. Anyhow, if it can't be supported, I'd expect at least an error in case of interference rather than silently squashed nodes. So I assume it's a bug.

Notes

  • When I inspect the nodes in Python debugger they seem to be still separate in terms of references, shapes, etc.
  • Weird enough but even if I manually alter the repeating name property on nodes in Python, it doesn't help.
  • Not sure if it's relevant to meshes names only or something else as well (Materials, Objects, etc.)

I'm still not 100% sure if it's a blend2bam issue and not panda3d itself. But there are a few evidences that make me think it's blend2bam:

  • This doesn't happen when I convert and load models from 2 separate BAM files.
  • When I change the mesh name in Blender to something unique, the resulting level.bam slightly increases in size (assuming 2 bullet nodes getting generated instead of 1)

Example

Attaching a minimal example code with blend files.

panda3d-name-bug.tar.gz

Environment

blend2bam 0.25.0
panda3d 1.10.14
Blender 4.1.1
Python 3.12.3

Thanks for taking a look :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant