Skip to content

Commit

Permalink
Disconnect maps_edited->update_transforms signal; call directly
Browse files Browse the repository at this point in the history
  • Loading branch information
TokisanGames committed Dec 30, 2024
1 parent 04702af commit 9edf15d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 0 additions & 4 deletions src/terrain_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,6 @@ void Terrain3D::_initialize() {
_data->connect("height_maps_changed", callable_mp(this, &Terrain3D::update_aabbs));
}
// Connect height changes to update instances
if (!_data->is_connected("maps_edited", callable_mp(_instancer, &Terrain3DInstancer::update_transforms))) {
LOG(DEBUG, "Connecting maps_edited signal to update_transforms()");
_data->connect("maps_edited", callable_mp(_instancer, &Terrain3DInstancer::update_transforms));
}
// Texture assets changed, update material
if (!_assets->is_connected("textures_changed", callable_mp(_material.ptr(), &Terrain3DMaterial::_update_texture_arrays))) {
LOG(DEBUG, "Connecting _assets.textures_changed to _material->_update_texture_arrays()");
Expand Down
6 changes: 3 additions & 3 deletions src/terrain_3d_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -522,9 +522,9 @@ void Terrain3DEditor::_operate_map(const Vector3 &p_global_position, const real_
data->force_update_maps(map_type);
}
data->add_edited_area(edited_area);
if (_tool == HOLES) {
// Holes will send out the signal for both control and height map
data->add_edited_area(edited_area, TYPE_HEIGHT);

if (_tool == HOLES || _tool == HEIGHT || _tool == SCULPT) {
_terrain->get_instancer()->update_transforms(edited_area);
}
}

Expand Down

0 comments on commit 9edf15d

Please sign in to comment.