How to trigger code when a CSGShape has finished updating its shape

Godot Version

Godot 4.2.1 stable oficial

Question

With a CSGPolygon3D in Path mode, updating said path will trigger an update_shape, which will rebuild the mesh eventually returned in get_meshes(). However, if one were to query the get_meshes() in the following line to updating the path, the mesh returned is the old mesh.

Browsing godot’s code in github, the set_path_node triggers a dirty set, which calls in a deferred way the update_shape.

My specific question is: how can one know when it’s finished? I couldn’t find any type of signal emitted when the shape is no longer dirty, and waiting to ask again doesn’t seem to be the proper way.

TLDR:

csgPolygon3D.set_path_node(new_path_node)
csgPolygon3D.get_meshes() # returns old_path mesh

I couldn’t find my answer on either internet, docs, or forum; apologies if it’s a dumb one.

1 Like