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

3D model is missing/invisible in entity browser with specific size() #4573

Open
Froyok opened this issue Jul 25, 2024 · 2 comments
Open

3D model is missing/invisible in entity browser with specific size() #4573

Froyok opened this issue Jul 25, 2024 · 2 comments
Labels
Prio:2 Medium priority: Non crash bugs that impede the user, features that add new functionality. Type:Bug Errors and problems
Milestone

Comments

@Froyok
Copy link

Froyok commented Jul 25, 2024

System Information

TrenchBroom:

  • TrenchBroom version 2024.1
  • Build v2024.1 Release Lionux-ubuntu-22.04
  • Qt 5.15.12

System:

  • OS: Linux Manjaro (KDE Plasma 5.27.11)
  • Kernel: 6.6.26-1MANJARO (64-bit)
  • Arch: x64
  • Renderer info:
    • X11
    • 4.6 (Core Profile) Mesa 24.0.2-manjaro1.1
    • AMD Radeon RX 7900 XT (radeonsi, navi31, LLVM 16.0.6, DRM 3.54, 6.6.26-1-MANJARO)

Issue description

I have a custom FGD entity definition to load a custom 3D model in TrenchBroom. The mesh and its bounds display correctly in the level/viewports but not in the entity browser:

2024-07-25__12-23-26

Expected Behavior

The model appears properly in the entity browser and match the result seen in the scene/viewports.

Steps to Reproduce

  1. Create a 3D model with its origin coordinate (0,0,0) below its bounds (bbox). In my example the 0,0,0 is below the character's feet.
  2. Define the entity in the FGD as follow:
@PointClass
    size( -16 -32 0, 16 32 128 )
    color( 255 0 255 )
    model(
        {
            "path" : "meshes/character_male.obj",
            "scale" : 64.0
        }
    )
    = character_guide : "Character size guide"
[]

Additional notes

  • I tried using size( -16 -32 -128, 16 32 0 ) but that gave me weird results (bounds are below the model in viewport, but the model is visible in browser).
  • Using size( -16 -32 0, 16 32 32 ) clearly shows the mesh being above the bounds in the entity browser, unlike inside the bounds like in the viewport:
    2024-07-16__14-51-48
  • Using:
@PointClass
    size( -16 -32 0, 16 32 0 )
    color( 255 0 255 )
    model(
        {
            "path" : "meshes/character_male.obj",
            "scale" : 64.0
        }
    )
    = character_guide : "Character size guide"
[]

gives the following result:
2024-07-15__01-07-48

Let me know if any other information is needed.

@eGax
Copy link
Contributor

eGax commented Jul 25, 2024

I was looking at this too with them after they brought it up in #TrenchBroom-Talk.

It doesn't feel related to #4007, but does feels related to #4190.

It is not the exact same issue we had with sprites in the Entity Browser, but it very much feels like a similar issue in the Entity browser but now with models.

The link here is the offset in a sprite is very similar to how the origin (center) of how a model works.

Looks like when the model is scaled up from the FGD entity entry the bbox of a scaled up model throws the view way off in the Entity browser. Similar as to how the sprites were behaving IMO. If you change the bbox number dimensions it will throw off the model view in the Entity browser differently every time it's changed.

The problem is you need to have the bbox a certain way in the map view to make it look ok and work. That same bbox throws the models too far off in the Entity browser that it is out of view.

@kduske kduske added Type:Bug Errors and problems Prio:2 Medium priority: Non crash bugs that impede the user, features that add new functionality. labels Jul 25, 2024
@kduske kduske added this to the 2024.2 milestone Aug 23, 2024
@kduske
Copy link
Collaborator

kduske commented Aug 23, 2024

We might just disregard the bounding box entirely and only inspect the model bounds for the entity browser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Prio:2 Medium priority: Non crash bugs that impede the user, features that add new functionality. Type:Bug Errors and problems
Projects
None yet
Development

No branches or pull requests

3 participants