Skip to content

create_trimesh_shape using stale Mesh data in editor #104003

Closed
@Arkaein

Description

@Arkaein

Tested versions

Started occurring in Godot 4.4, worked correctly in Godot 4.3

System information

Godot v4.4.stable.mono - Linux Mint 22 (Wilma) on X11 - X11 display driver, Multi-window, 1 monitor - Vulkan (Forward+) - dedicated Quadro RTX 4000 (nvidia; 535.183.01) - AMD Ryzen 5 5600X 6-Core Processor (12 threads)

Issue description

I use a tool script attached to a scene created on import of a *.GLB file exported from Blender to create a StaticBody3D and collision trimesh shape as children. This worked correctly in Godot 4.3, but in 4.4 I've discovered that after working on the scene, when editing and re-exporting the Blender model, the updates are correctly imported, however rerunning the script to update the collision shape appears to use stale mesh data from the initial load.

Closing and reopening the scene doesn't help, but restarting the project before running the script causes the correct updated mesh data to be used.

Steps to reproduce

  1. Open the attached project
  2. Open test.tscn, select the test child node and, and click the "Execute" button under AddTrimesh in the Inspector, view the created collision shape
  3. Edit test.blend in Blender and export test.glb, overwriting the existing file (note that the script only processes a single mesh, so edit or replace the existing object instead of adding full new meshes)
  4. After verifying that Godot reimports the new mesh, click "Execute" under AddTrimesh again, note that the collision mesh is not updated properly
  5. Reload Current Project, or quite and restart Godot and load the project again
  6. Click AddTrimesh -> Execute one more time, see the collision mesh generated correctly

Minimal reproduction project (MRP)

bug_trimesh_script.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions