Cleanup: Remove unnecessary includes from C++ data structure headers

The hash tables and vector blenlib headers were pulling many more
headers than they actually need, including the C base math header,
our C string API header, and the StringRef header. All of this
potentially slows down compilation and polutes autocomplete
with unrelated information.

Also remove the `ListBase` constructor for `Vector`. It wasn't used
much, and making it easy to use `ListBase` isn't worth it for the
same reasons mentioned above.

It turns out a lot of files depended on indirect includes of
`BLI_string.h` and `BLI_listbase.h`, so those are fixed here.

Pull Request: https://projects.blender.org/blender/blender/pulls/111801
This commit is contained in:
Hans Goudey
2023-09-01 21:37:11 +02:00
committed by Hans Goudey
parent 9f4b28bba8
commit fa34992def
135 changed files with 237 additions and 71 deletions

View File

@@ -18,7 +18,9 @@
#include "BKE_preferences.h"
#include "BLI_fileops.h"
#include "BLI_listbase.h"
#include "BLI_path_util.h"
#include "BLI_string.h"
#include "DNA_userdef_types.h"

View File

@@ -6,6 +6,7 @@
#include "BLI_fileops.h" /* For PATH_MAX (at least on Windows). */
#include "BLI_path_util.h"
#include "BLI_string.h"
#include "BKE_appdir.h"
#include "BKE_callbacks.h"

View File

@@ -2,6 +2,8 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#include "BLI_string.h"
#include "asset_library_service.hh"
#include "asset_library_test_common.hh"

View File

@@ -8,6 +8,7 @@
#include "BLI_math_matrix.h"
#include "BLI_math_rotation.h"
#include "BLI_math_vector.h"
#include "BLI_string.h"
#include "DNA_armature_types.h"

View File

@@ -8,6 +8,8 @@
#include <memory>
#include "BLI_string.h"
#include "AS_asset_identifier.hh"
#include "AS_asset_library.hh"

View File

@@ -1,8 +1,11 @@
/* SPDX-FileCopyrightText: 2021 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#include "testing/testing.h"
#include "BLI_string.h"
#include "BKE_cryptomatte.h"
#include "BKE_cryptomatte.hh"
#include "BKE_image.h"

View File

@@ -2,6 +2,7 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#include "BLI_listbase.h"
#include "BLI_task.hh"
#include "BLI_vector.hh"
@@ -81,7 +82,10 @@ static KnotsMode knots_mode_from_legacy(const short flag)
Curves *curve_legacy_to_curves(const Curve &curve_legacy, const ListBase &nurbs_list)
{
const Vector<const Nurb *> src_curves(nurbs_list);
Vector<const Nurb *> src_curves;
LISTBASE_FOREACH (const Nurb *, item, &nurbs_list) {
src_curves.append(item);
}
if (src_curves.is_empty()) {
return nullptr;
}

View File

@@ -13,6 +13,7 @@
#include "BLI_color.hh"
#include "BLI_listbase.h"
#include "BLI_math_vector_types.hh"
#include "BLI_string.h"
#include "BLI_vector.hh"
#include "DNA_gpencil_legacy_types.h"

View File

@@ -4,6 +4,8 @@
#include "testing/testing.h"
#include "BLI_string.h"
#include "BKE_curves.hh"
#include "BKE_grease_pencil.hh"
#include "BKE_idtype.h"

View File

@@ -4,6 +4,8 @@
#include "testing/testing.h"
#include "BLI_listbase.h"
#include "DNA_ID.h"
#include "BKE_idprop.hh"

View File

@@ -57,6 +57,7 @@
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
#include "BLI_listbase.h"
#include "BLI_vector.hh"
namespace blender::bke::image::partial_update {

View File

@@ -18,6 +18,7 @@
#include "BLI_map.hh"
#include "BLI_math_base.hh"
#include "BLI_set.hh"
#include "BLI_string.h"
#include "BLI_string_utf8.h"
#include "BLI_string_utils.h"

View File

@@ -41,6 +41,7 @@
#include "BLI_listbase.h"
#include "BLI_math_color.h"
#include "BLI_math_vector.h"
#include "BLI_string.h"
#include "BLI_utildefines.h"
#include "BLT_translation.h"

View File

@@ -25,6 +25,7 @@
#include "BLI_mesh_boolean.hh"
#include "BLI_mesh_intersect.hh"
#include "BLI_span.hh"
#include "BLI_string.h"
#include "BLI_task.hh"
#include "BLI_virtual_array.hh"

View File

@@ -23,6 +23,7 @@
#include "BLI_memarena.h"
#include "BLI_polyfill_2d.h"
#include "BLI_resource_scope.hh"
#include "BLI_string.h"
#include "BLI_task.hh"
#include "BLI_utildefines.h"

View File

@@ -452,12 +452,10 @@ void BKE_remesh_reproject_vertex_paint(Mesh *target, const Mesh *source)
/* Make sure active/default color attribute (names) are brought over. */
if (source->active_color_attribute) {
MEM_SAFE_FREE(target->active_color_attribute);
target->active_color_attribute = BLI_strdup(source->active_color_attribute);
BKE_id_attributes_active_color_set(&target->id, source->active_color_attribute);
}
if (source->default_color_attribute) {
MEM_SAFE_FREE(target->default_color_attribute);
target->default_color_attribute = BLI_strdup(source->default_color_attribute);
BKE_id_attributes_default_color_set(&target->id, source->default_color_attribute);
}
free_bvhtree_from_mesh(&bvhtree);

View File

@@ -17,6 +17,7 @@
#include "BLI_math_geom.h"
#include "BLI_math_vector.h"
#include "BLI_string.h"
#include "BLI_task.h"
#include "BLI_utildefines.h"

View File

@@ -1,7 +1,9 @@
/* SPDX-FileCopyrightText: 2023 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#include "BLI_compiler_compat.h"
#include "BLI_string.h"
#include "DNA_material_types.h"
#include "DNA_mesh_types.h"

View File

@@ -14,9 +14,11 @@
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
#include "BLI_listbase.h"
#include "BLI_math_geom.h"
#include "BLI_math_vector.h"
#include "BLI_task.h"
#include "PIL_time.h"
#include "BKE_global.h"

View File

@@ -4,6 +4,7 @@
#include "BLI_array.hh"
#include "BLI_bit_vector.hh"
#include "BLI_listbase.h"
#include "BLI_math_geom.h"
#include "BLI_math_vector.hh"
#include "BLI_task.hh"

View File

@@ -17,6 +17,7 @@
#include "BLI_fileops.hh"
#include "BLI_hash_md5.h"
#include "BLI_path_util.h"
#include "BLI_string.h"
#include "BLI_string_utils.h"
#include "MOD_nodes.hh"

View File

@@ -66,7 +66,6 @@
#include <string>
#include <utility>
#include "BLI_math_base.h"
#include "BLI_string_ref.hh"
#include "BLI_utildefines.h"

View File

@@ -14,11 +14,7 @@
#include <cmath>
#include "BLI_allocator.hh"
#include "BLI_array.hh"
#include "BLI_math_base.h"
#include "BLI_memory_utils.hh"
#include "BLI_string.h"
#include "BLI_string_ref.hh"
#include "BLI_utildefines.h"
#include "BLI_vector.hh"
@@ -303,7 +299,7 @@ class HashTableStats {
removed_load_factor_ = (float)removed_amount_ / (float)capacity_;
}
void print(StringRef name = "") const;
void print(const char *name) const;
};
/** \} */

View File

@@ -915,7 +915,7 @@ class Map {
/**
* Print common statistics like size and collision count. This is useful for debugging purposes.
*/
void print_stats(StringRef name = "") const
void print_stats(const char *name) const
{
HashTableStats stats(*this, this->keys());
stats.print(name);

View File

@@ -511,7 +511,7 @@ class Set {
/**
* Print common statistics like size and collision count. This is useful for debugging purposes.
*/
void print_stats(StringRef name = "") const
void print_stats(const char *name) const
{
HashTableStats stats(*this, *this);
stats.print(name);

View File

@@ -31,11 +31,8 @@
#include "BLI_allocator.hh"
#include "BLI_index_range.hh"
#include "BLI_listbase_wrapper.hh"
#include "BLI_math_base.h"
#include "BLI_memory_utils.hh"
#include "BLI_span.hh"
#include "BLI_string_ref.hh"
#include "BLI_utildefines.h"
#include "MEM_guardedalloc.h"
@@ -43,7 +40,7 @@
namespace blender {
namespace internal {
void vector_print_stats(StringRef name,
void vector_print_stats(const char *name,
void *address,
int64_t size,
int64_t capacity,
@@ -211,21 +208,6 @@ class Vector {
}
}
/**
* Create a vector from a ListBase. The caller has to make sure that the values in the linked
* list have the correct type.
*
* Example Usage:
* Vector<ModifierData *> modifiers(ob->modifiers);
*/
Vector(const ListBase &values, Allocator allocator = {})
: Vector(NoExceptConstructor(), allocator)
{
LISTBASE_FOREACH (T, value, &values) {
this->append(value);
}
}
/**
* Create a copy of another vector. The other vector will not be changed. If the other vector has
* less than InlineBufferCapacity elements, no allocation will be made.
@@ -983,7 +965,7 @@ class Vector {
/**
* Print some debug information about the vector.
*/
void print_stats(StringRef name = "") const
void print_stats(const char *name) const
{
internal::vector_print_stats(
name, this, this->size(), capacity_end_ - begin_, InlineBufferCapacity, sizeof(*this));

View File

@@ -482,7 +482,7 @@ class VectorSet {
/**
* Print common statistics like size and collision count. This is useful for debugging purposes.
*/
void print_stats(StringRef name = "") const
void print_stats(const char *name) const
{
HashTableStats stats(*this, this->as_span());
stats.print(name);

View File

@@ -7,7 +7,7 @@
#include <iostream>
void blender::HashTableStats::print(StringRef name) const
void blender::HashTableStats::print(const char *name) const
{
std::cout << "Hash Table Stats: " << name << "\n";
std::cout << " Address: " << address_ << "\n";

View File

@@ -206,7 +206,7 @@ TriMeshTopology::TriMeshTopology(const IMesh &tm)
std::cout << "tris for edge " << item.key << ": " << *item.value << "\n";
constexpr bool print_stats = false;
if (print_stats) {
edge_tri_.print_stats();
edge_tri_.print_stats("");
}
}
for (auto item : vert_edges_.items()) {

View File

@@ -7,7 +7,7 @@
#include <iostream>
void blender::internal::vector_print_stats(StringRef name,
void blender::internal::vector_print_stats(const char *name,
void *address,
int64_t size,
int64_t capacity,

View File

@@ -79,27 +79,27 @@ struct TestListValue {
int value;
};
TEST(vector, ListBaseConstructor)
{
TestListValue *value1 = new TestListValue{nullptr, nullptr, 4};
TestListValue *value2 = new TestListValue{nullptr, nullptr, 5};
TestListValue *value3 = new TestListValue{nullptr, nullptr, 6};
// TEST(vector, ListBaseConstructor)
// {
// TestListValue *value1 = new TestListValue{nullptr, nullptr, 4};
// TestListValue *value2 = new TestListValue{nullptr, nullptr, 5};
// TestListValue *value3 = new TestListValue{nullptr, nullptr, 6};
ListBase list = {nullptr, nullptr};
BLI_addtail(&list, value1);
BLI_addtail(&list, value2);
BLI_addtail(&list, value3);
Vector<TestListValue *> vec(list);
// ListBase list = {nullptr, nullptr};
// BLI_addtail(&list, value1);
// BLI_addtail(&list, value2);
// BLI_addtail(&list, value3);
// Vector<TestListValue *> vec(list);
EXPECT_EQ(vec.size(), 3);
EXPECT_EQ(vec[0]->value, 4);
EXPECT_EQ(vec[1]->value, 5);
EXPECT_EQ(vec[2]->value, 6);
// EXPECT_EQ(vec.size(), 3);
// EXPECT_EQ(vec[0]->value, 4);
// EXPECT_EQ(vec[1]->value, 5);
// EXPECT_EQ(vec[2]->value, 6);
delete value1;
delete value2;
delete value3;
}
// delete value1;
// delete value2;
// delete value3;
// }
TEST(vector, IteratorConstructor)
{

View File

@@ -30,6 +30,7 @@
#include "BLI_map.hh"
#include "BLI_math_vector.h"
#include "BLI_set.hh"
#include "BLI_string.h"
#include "BLI_string_ref.hh"
#include "BKE_armature.h"

View File

@@ -11,6 +11,7 @@
#include "MEM_guardedalloc.h"
#include "BLI_alloca.h"
#include "BLI_listbase.h"
#include "BLI_math_vector.h"
#include "BLI_sort_utils.h"

View File

@@ -12,6 +12,7 @@
#include "DNA_listBase.h"
#include "BLI_listbase.h"
#include "BLI_math_vector.h"
#include "BLI_scanfill.h"
#include "BLI_sort_utils.h"

View File

@@ -10,6 +10,7 @@
#include "MEM_guardedalloc.h"
#include "BLI_listbase.h"
#include "BLI_utildefines.h"
#include "bmesh.h"

View File

@@ -4,14 +4,13 @@
#include "COM_Debug.h"
extern "C" {
#include "BLI_fileops.h"
#include "BLI_path_util.h"
#include "BLI_string.h"
#include "BKE_appdir.h"
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
}
#include "COM_ExecutionGroup.h"
#include "COM_ReadBufferOperation.h"

View File

@@ -12,6 +12,7 @@
#include "COM_defines.h"
#include "BLI_rand.hh"
#include "BLI_string.h"
#include "BLT_translation.h"

View File

@@ -4,6 +4,8 @@
#include "COM_FullFrameExecutionModel.h"
#include "BLI_string.h"
#include "BLT_translation.h"
#include "COM_Debug.h"

View File

@@ -2,6 +2,8 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#include "BLI_string.h"
#include "BKE_node.hh"
#include "NOD_composite.h"

View File

@@ -4,6 +4,8 @@
#include "COM_OutputFileNode.h"
#include "BLI_string.h"
namespace blender::compositor {
OutputFileNode::OutputFileNode(bNode *editor_node) : Node(editor_node)

View File

@@ -4,6 +4,8 @@
#include "COM_CompositorOperation.h"
#include "BLI_string.h"
#include "BKE_global.h"
#include "BKE_image.h"
#include "BKE_scene.h"
@@ -176,6 +178,11 @@ void CompositorOperation::execute_region(rcti *rect, uint /*tile_number*/)
}
}
void CompositorOperation::set_scene_name(const char *scene_name)
{
BLI_strncpy(scene_name_, scene_name, sizeof(scene_name_));
}
void CompositorOperation::update_memory_buffer_partial(MemoryBuffer * /*output*/,
const rcti &area,
Span<MemoryBuffer *> inputs)

View File

@@ -67,10 +67,7 @@ class CompositorOperation : public MultiThreadedOperation {
{
scene_ = scene;
}
void set_scene_name(const char *scene_name)
{
BLI_strncpy(scene_name_, scene_name, sizeof(scene_name_));
}
void set_scene_name(const char *scene_name);
void set_view_name(const char *view_name)
{
view_name_ = view_name;

View File

@@ -4,6 +4,8 @@
#include "COM_ConvertColorSpaceOperation.h"
#include "BLI_string.h"
namespace blender::compositor {
ConvertColorSpaceOperation::ConvertColorSpaceOperation()

View File

@@ -4,6 +4,8 @@
#include "COM_MultilayerImageOperation.h"
#include "BLI_string.h"
#include "IMB_imbuf.h"
namespace blender::compositor {

View File

@@ -5,6 +5,7 @@
#include "COM_OutputFileMultiViewOperation.h"
#include "BLI_fileops.h"
#include "BLI_string.h"
#include "BKE_image.h"
#include "BKE_image_format.h"

View File

@@ -4,6 +4,8 @@
#include "COM_RenderLayersProg.h"
#include "BLI_string.h"
#include "BKE_image.h"
namespace blender::compositor {

View File

@@ -12,6 +12,8 @@
#include <cstring>
#include "BLI_listbase.h"
#include "DNA_anim_types.h"
#include "BKE_anim_data.h"

View File

@@ -13,6 +13,7 @@
#include "DNA_object_types.h"
#include "BLI_assert.h"
#include "BLI_listbase.h"
#include "BLI_stack.h"
#include "DEG_depsgraph.h"

View File

@@ -2,6 +2,8 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#include "BLI_string.h"
#include "draw_attributes.hh"
/* Return true if the given DRW_AttributeRequest is already in the requests. */

View File

@@ -12,6 +12,7 @@
#include "MEM_guardedalloc.h"
#include "BLI_listbase.h"
#include "BLI_math_base.h"
#include "BLI_math_color.hh"
#include "BLI_math_vector.h"

View File

@@ -26,6 +26,7 @@
#include "BLI_map.hh"
#include "BLI_math_color.h"
#include "BLI_math_vector_types.hh"
#include "BLI_string.h"
#include "BLI_string_ref.hh"
#include "BLI_timeit.hh"
#include "BLI_utildefines.h"

View File

@@ -8,6 +8,7 @@
#include "BLI_array_utils.hh"
#include "BLI_math_vector_types.hh"
#include "BLI_string.h"
#include "draw_subdivision.h"
#include "extract_mesh.hh"

View File

@@ -22,6 +22,7 @@
#include "BLI_path_util.h"
#include "BLI_serialize.hh"
#include "BLI_set.hh"
#include "BLI_string.h"
#include "BLI_string_ref.hh"
#include "BLI_uuid.h"

View File

@@ -21,6 +21,7 @@
#include "BKE_screen.h"
#include "BLI_map.hh"
#include "BLI_string.h"
#include "BLI_utility_mixins.hh"
#include "DNA_space_types.h"

View File

@@ -14,6 +14,7 @@
#include "BKE_screen.h"
#include "BLI_fnmatch.h"
#include "BLI_string.h"
#include "DNA_asset_types.h"
#include "DNA_screen_types.h"

View File

@@ -12,6 +12,8 @@
#include "AS_asset_catalog_tree.hh"
#include "AS_asset_library.hh"
#include "BLI_string.h"
#include "DNA_screen_types.h"
#include "BKE_context.h"

View File

@@ -14,6 +14,7 @@
#include "BLI_math_geom.h"
#include "BLI_math_matrix.hh"
#include "BLI_rand.hh"
#include "BLI_string.h"
#include "BLI_utildefines.h"
#include "BLI_vector_set.hh"

View File

@@ -6,6 +6,8 @@
* \ingroup edcurves
*/
#include "BLI_string.h"
#include "ED_curves.hh"
#include "ED_object.hh"
#include "ED_screen.hh"

View File

@@ -16,6 +16,7 @@
struct Collection;
struct ID;
struct ImBuf;
struct ListBase;
struct PointerRNA;
struct PreviewImage;
struct Scene;

View File

@@ -20,6 +20,7 @@
#include "BLI_array_utils.h"
#include "BLI_implicit_sharing.hh"
#include "BLI_listbase.h"
#include "BLI_string.h"
#include "BLI_task.hh"
#include "BKE_context.h"

View File

@@ -11,6 +11,7 @@
#include "BLI_fileops.hh"
#include "BLI_path_util.h"
#include "BLI_serialize.hh"
#include "BLI_string.h"
#include "BLI_string_utils.h"
#include "BLI_vector.hh"

View File

@@ -14,6 +14,7 @@
#include "BLI_listbase.h"
#include "BLI_rect.h"
#include "BLI_string.h"
#include "BLI_string_utils.h"
#include "BLI_threads.h"
#include "BLI_timecode.h"

View File

@@ -26,6 +26,7 @@
#include "BLI_listbase.h"
#include "BLI_math_vector.h"
#include "BLI_path_util.h"
#include "BLI_string.h"
#include "BLI_string_utils.h"
#include "BLI_utildefines.h"

View File

@@ -15,6 +15,7 @@
#include "MEM_guardedalloc.h"
#include "BLI_math_vector.hh"
#include "BLI_string.h"
#include "BLI_utildefines.h"
#include "BLT_translation.h"

View File

@@ -15,6 +15,7 @@
#include "BLI_math_matrix.h"
#include "BLI_math_vector.h"
#include "BLI_math_vector_types.hh"
#include "BLI_string.h"
#include "BLI_task.h"
#include "BLT_translation.h"

View File

@@ -8,6 +8,7 @@
#include "AS_asset_representation.hh"
#include "BLI_multi_value_map.hh"
#include "BLI_string.h"
#include "DNA_screen_types.h"
#include "DNA_space_types.h"

View File

@@ -9,6 +9,7 @@
#include "AS_asset_representation.hh"
#include "BLI_listbase.h"
#include "BLI_string.h"
#include "BLI_string_search.hh"
#include "DNA_space_types.h"

View File

@@ -8,6 +8,7 @@
*/
#include "BLI_color.hh"
#include "BLI_string.h"
#include "BLI_system.h"
#include "BLI_threads.h"

View File

@@ -55,9 +55,10 @@ static void context_path_add_node_tree_and_node_groups(const SpaceNode &snode,
Vector<ui::ContextPathItem> &path,
const bool skip_base = false)
{
Vector<const bNodeTreePath *> tree_path = snode.treepath;
for (const bNodeTreePath *path_item : tree_path.as_span().drop_front(int(skip_base))) {
ui::context_path_add_generic(path, RNA_NodeTree, path_item->nodetree, ICON_NODETREE);
LISTBASE_FOREACH (const bNodeTreePath *, path_item, &snode.treepath) {
if (skip_base && path_item == snode.treepath.first) {
ui::context_path_add_generic(path, RNA_NodeTree, path_item->nodetree, ICON_NODETREE);
}
}
}

View File

@@ -28,6 +28,7 @@
#include "BLI_map.hh"
#include "BLI_set.hh"
#include "BLI_span.hh"
#include "BLI_string.h"
#include "BLI_string_ref.hh"
#include "BLI_vector.hh"

View File

@@ -32,6 +32,7 @@
#include "BKE_workspace.h"
#include "BLI_set.hh"
#include "BLI_string.h"
#include "BLI_string_utf8.h"
#include "BLT_translation.h"

View File

@@ -7,6 +7,7 @@
#include "BLI_map.hh"
#include "BLI_rect.h"
#include "BLI_set.hh"
#include "BLI_string.h"
#include "BLI_string_ref.hh"
#include "BLI_string_search.hh"

View File

@@ -22,6 +22,8 @@
* the wanted viewlayer/pass for each previewed node.
*/
#include "BLI_string.h"
#include "DNA_camera_types.h"
#include "DNA_material_types.h"
#include "DNA_world_types.h"
@@ -101,7 +103,11 @@ static void ensure_nodetree_previews(const bContext &C,
static std::optional<ComputeContextHash> get_compute_context_hash_for_node_editor(
const SpaceNode &snode)
{
Vector<const bNodeTreePath *> treepath = snode.treepath;
Vector<const bNodeTreePath *> treepath;
LISTBASE_FOREACH (const bNodeTreePath *, item, &snode.treepath) {
treepath.append(item);
}
if (treepath.is_empty()) {
return std::nullopt;
}

View File

@@ -6,6 +6,8 @@
* \ingroup spnode
*/
#include "BLI_string.h"
#include "DNA_ID.h"
#include "DNA_gpencil_legacy_types.h"
#include "DNA_light_types.h"

View File

@@ -6,6 +6,8 @@
* \ingroup spoutliner
*/
#include "BLI_listbase.h"
#include "DNA_object_types.h"
#include "DNA_outliner_types.h"

View File

@@ -6,6 +6,8 @@
* \ingroup spoutliner
*/
#include "BLI_listbase.h"
#include "BKE_grease_pencil.hh"
#include "DNA_outliner_types.h"

View File

@@ -6,6 +6,8 @@
* \ingroup spoutliner
*/
#include "BLI_listbase.h"
#include "BKE_grease_pencil.hh"
#include "DNA_outliner_types.h"

View File

@@ -6,12 +6,13 @@
* \ingroup spoutliner
*/
#include "BLI_listbase.h"
#include "DNA_ID.h"
#include "DNA_action_types.h"
#include "DNA_armature_types.h"
#include "DNA_constraint_types.h"
#include "DNA_gpencil_modifier_types.h"
#include "DNA_listBase.h"
#include "DNA_modifier_types.h"
#include "DNA_object_types.h"
#include "DNA_outliner_types.h"

View File

@@ -5,6 +5,7 @@
#include <cstring>
#include "BLI_listbase.h"
#include "BLI_string.h"
#include "BKE_global.h"
#include "BKE_lib_remap.h"

View File

@@ -2,6 +2,8 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#include "BLI_string.h"
#include "DNA_space_types.h"
#include "DNA_windowmanager_types.h"

View File

@@ -8,6 +8,7 @@
#include "BLI_math_color.hh"
#include "BLI_math_quaternion_types.hh"
#include "BLI_math_vector_types.hh"
#include "BLI_string.h"
#include "BKE_geometry_set.hh"
#include "BKE_instances.hh"

View File

@@ -2,6 +2,9 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#include "BLI_listbase.h"
#include "BLI_string.h"
#include "BKE_screen.h"
#include "BLT_translation.h"

View File

@@ -12,6 +12,7 @@
#include "BKE_workspace.h"
#include "BLI_listbase.h"
#include "BLI_string.h"
#include "BLI_vector.hh"
#include "DNA_modifier_types.h"
@@ -85,7 +86,11 @@ static void viewer_path_for_geometry_node(const SpaceNode &snode,
modifier_elem->modifier_name = BLI_strdup(modifier->modifier.name);
BLI_addtail(&r_dst.path, modifier_elem);
Vector<const bNodeTreePath *, 16> tree_path = snode.treepath;
Vector<const bNodeTreePath *, 16> tree_path;
LISTBASE_FOREACH (const bNodeTreePath *, item, &snode.treepath) {
tree_path.append(item);
}
for (const int i : tree_path.index_range().drop_back(1)) {
bNodeTree *tree = tree_path[i]->nodetree;
/* The tree path contains the name of the node but not its ID. */
@@ -207,7 +212,11 @@ Object *parse_object_only(const ViewerPath &viewer_path)
std::optional<ViewerPathForGeometryNodesViewer> parse_geometry_nodes_viewer(
const ViewerPath &viewer_path)
{
const Vector<const ViewerPathElem *, 16> elems_vec = viewer_path.path;
Vector<const ViewerPathElem *, 16> elems_vec;
LISTBASE_FOREACH (const ViewerPathElem *, item, &viewer_path.path) {
elems_vec.append(item);
}
if (elems_vec.size() < 3) {
/* Need at least the object, modifier and viewer node name. */
return std::nullopt;

View File

@@ -13,6 +13,7 @@
* This API uses #BMesh data structures and doesn't have limitations for manifold meshes.
*/
#include "BLI_listbase.h"
#include "BLI_math_vector.h"
#include "BKE_editmesh.h"

View File

@@ -6,6 +6,7 @@
#include "BLI_enumerable_thread_specific.hh"
#include "BLI_index_mask.hh"
#include "BLI_listbase.h"
#include "BKE_attribute.hh"
#include "BKE_geometry_fields.hh"

View File

@@ -11,6 +11,7 @@
#include "DNA_object_types.h"
#include "DNA_pointcloud_types.h"
#include "BLI_listbase.h"
#include "BLI_math_matrix.hh"
#include "BLI_noise.hh"
#include "BLI_task.hh"

View File

@@ -17,6 +17,8 @@
#include "BLI_ghash.h"
#include "BLI_hash_mm2a.h"
#include "BLI_link_utils.h"
#include "BLI_listbase.h"
#include "BLI_string.h"
#include "BLI_threads.h"
#include "BLI_utildefines.h"

View File

@@ -17,6 +17,7 @@
#include "BLI_ghash.h"
#include "BLI_map.hh"
#include "BLI_string.h"
#include "BLI_string_ref.hh"
#include "gpu_material_library.h"

View File

@@ -6,6 +6,8 @@
* \ingroup gpu
*/
#include "BLI_string.h"
#include "BKE_global.h"
#include "mtl_context.hh"

View File

@@ -6,6 +6,8 @@
* \ingroup gpu
*/
#include "BLI_string.h"
#include "BKE_global.h"
#include "gl_backend.hh"

View File

@@ -9,6 +9,7 @@
#include <string>
#include "BLI_assert.h"
#include "BLI_string.h"
#include "DNA_userdef_types.h"

View File

@@ -18,6 +18,8 @@
#include <Alembic/Abc/OTypedArrayProperty.h>
#include <Alembic/Abc/OTypedScalarProperty.h>
#include "BLI_listbase.h"
#include "BKE_idprop.h"
#include "DNA_ID.h"

View File

@@ -5,6 +5,7 @@
#include "BLI_fileops.h"
#include "BLI_path_util.h"
#include "BLI_string.h"
namespace blender::io {

View File

@@ -9,6 +9,7 @@
#include "BLI_math_matrix.hh"
#include "BLI_path_util.h"
#include "BLI_span.hh"
#include "BLI_string.h"
#include "DNA_gpencil_legacy_types.h"
#include "DNA_layer_types.h"

View File

@@ -20,6 +20,7 @@
#include "BLI_math_rotation.h"
#include "BLI_math_vector.h"
#include "BLI_memory_utils.hh"
#include "BLI_string.h"
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_build.h"

View File

@@ -11,6 +11,7 @@
#include "ply_import_buffer.hh"
#include "BLI_endian_switch.h"
#include "BLI_string_ref.hh"
#include "fast_float.h"

View File

@@ -21,6 +21,7 @@
#include "BLI_math_rotation.h"
#include "BLI_math_vector.h"
#include "BLI_memory_utils.hh"
#include "BLI_string.h"
#include "DNA_object_types.h"

View File

@@ -9,6 +9,7 @@
#include "DNA_scene_types.h"
#include "BLI_set.hh"
#include "BLI_string.h"
#include "DEG_depsgraph_query.h"

View File

@@ -7,6 +7,8 @@
#include <pxr/base/gf/vec2f.h>
#include <pxr/imaging/hd/light.h>
#include "BLI_string.h"
#include "DEG_depsgraph_query.h"
#include "hydra_scene_delegate.h"

View File

@@ -6,6 +6,8 @@
#include <pxr/base/tf/staticTokens.h>
#include <pxr/imaging/hd/tokens.h>
#include "BLI_string.h"
#include "BKE_material.h"
#include "BKE_mesh.hh"
#include "BKE_mesh_runtime.hh"

View File

@@ -10,6 +10,7 @@
#include "DNA_volume_types.h"
#include "BLI_path_util.h"
#include "BLI_string.h"
#include "BKE_mesh.h"
#include "BKE_modifier.h"

View File

@@ -34,6 +34,7 @@
#include "BKE_object_deform.h"
#include "BLI_math_vector.h"
#include "BLI_string.h"
#include "ED_armature.hh"
#include "ED_keyframing.hh"

View File

@@ -14,6 +14,7 @@
#include "BLI_math_vector.h"
#include "BLI_math_vector.hh"
#include "BLI_path_util.h"
#include "BLI_string.h"
#include "DNA_material_types.h"
#include "DNA_node_types.h"

View File

@@ -13,6 +13,7 @@
#include "BKE_scene.h"
#include "BLI_path_util.h"
#include "BLI_string.h"
#include "BLI_task.hh"
#include "BLI_vector.hh"

View File

@@ -9,6 +9,7 @@
#include "BLI_map.hh"
#include "BLI_math_color.h"
#include "BLI_math_vector.h"
#include "BLI_string.h"
#include "BLI_string_ref.hh"
#include "BLI_vector.hh"

View File

@@ -13,6 +13,7 @@
#include "BLI_map.hh"
#include "BLI_math_vector.h"
#include "BLI_path_util.h"
#include "BLI_string.h"
#include "DNA_material_types.h"
#include "DNA_node_types.h"

View File

@@ -8,6 +8,7 @@
#include "BKE_object.h"
#include "BLI_listbase.h"
#include "BLI_math_vector.h"
#include "DNA_curve_types.h"

View File

@@ -12,6 +12,7 @@
#include "BLI_math_vector_types.hh"
#include "BLI_set.hh"
#include "BLI_sort.hh"
#include "BLI_string.h"
#include "BLI_string_ref.hh"
#include "BKE_layer.h"

View File

@@ -17,6 +17,7 @@
#include "BLI_fileops.h"
#include "BLI_index_range.hh"
#include "BLI_string.h"
#include "BLI_string_utf8.h"
#include "BLI_vector.hh"

View File

@@ -6,6 +6,7 @@
* \ingroup modifiers
*/
#include "BLI_string.h"
#include "BLI_utildefines.h"
#include "BLT_translation.h"

View File

@@ -36,6 +36,7 @@
#include "BLI_math_matrix_types.hh"
#include "BLI_math_vector.h"
#include "BLI_span.hh"
#include "BLI_string.h"
#include "BLI_timeit.hh"
#include "DEG_depsgraph_query.h"

View File

@@ -8,6 +8,8 @@
#include <cstdio>
#include "BLI_string.h"
#include "DNA_color_types.h"
#include "DNA_node_types.h"
#include "DNA_scene_types.h"

View File

@@ -8,6 +8,8 @@
#include "RNA_access.hh"
#include "BLI_string.h"
#include "UI_interface.hh"
#include "UI_resources.hh"

View File

@@ -12,6 +12,7 @@
#include "BLI_dynstr.h"
#include "BLI_hash_mm3.h"
#include "BLI_math_vector.h"
#include "BLI_string.h"
#include "BLI_string_ref.hh"
#include "BLI_utildefines.h"

View File

@@ -11,6 +11,7 @@
#include "BLI_linklist.h"
#include "BLI_math_vector_types.hh"
#include "BLI_rect.h"
#include "BLI_string.h"
#include "BLI_utildefines.h"
#include "BKE_context.h"

View File

@@ -11,6 +11,7 @@
#include "BLI_math_base.h"
#include "BLI_math_color.h"
#include "BLI_string.h"
#include "BKE_context.h"
#include "BKE_lib_id.h"

View File

@@ -8,6 +8,7 @@
#include <cstring>
#include "BLI_string.h"
#include "BLI_string_utf8.h"
#include "BLI_string_utils.h"
#include "BLI_utildefines.h"

View File

@@ -9,6 +9,7 @@
#include "BLI_array.hh"
#include "BLI_math_matrix_types.hh"
#include "BLI_math_vector_types.hh"
#include "BLI_string.h"
#include "DNA_defaults.h"
#include "DNA_movieclip_types.h"

View File

@@ -10,6 +10,7 @@
#include "BLI_math_base.hh"
#include "BLI_math_matrix.hh"
#include "BLI_math_vector_types.hh"
#include "BLI_string.h"
#include "RNA_access.hh"

View File

@@ -8,6 +8,7 @@
#include "BLI_index_range.hh"
#include "BLI_math_vector_types.hh"
#include "BLI_string.h"
#include "DNA_defaults.h"
#include "DNA_movieclip_types.h"

View File

@@ -4,6 +4,8 @@
#include <cstring>
#include "BLI_string.h"
#include "MEM_guardedalloc.h"
#include "NOD_geometry.hh"

View File

@@ -3,6 +3,7 @@
* SPDX-License-Identifier: GPL-2.0-or-later */
#include "BLI_math_matrix.h"
#include "BLI_string.h"
#include "DNA_collection_types.h"

View File

@@ -2,6 +2,8 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#include "BLI_string.h"
#include "BKE_compute_contexts.hh"
#include "BKE_scene.h"

View File

@@ -3,6 +3,7 @@
* SPDX-License-Identifier: GPL-2.0-or-later */
#include "BLI_math_matrix.hh"
#include "BLI_string.h"
#include "BLI_string_utils.h"
#include "BLI_task.hh"

View File

@@ -9,6 +9,7 @@
#include "BLI_math_color.hh"
#include "BLI_math_euler.hh"
#include "BLI_math_quaternion.hh"
#include "BLI_string.h"
#include "NOD_geometry_nodes_execute.hh"
#include "NOD_geometry_nodes_lazy_function.hh"

View File

@@ -553,7 +553,10 @@ static void find_tree_zone_hash_recursive(
Map<const bNodeTreeZone *, ComputeContextHash> GeoModifierLog::
get_context_hash_by_zone_for_node_editor(const SpaceNode &snode, StringRefNull modifier_name)
{
const Vector<const bNodeTreePath *> tree_path = snode.treepath;
Vector<const bNodeTreePath *> tree_path;
LISTBASE_FOREACH (const bNodeTreePath *, item, &snode.treepath) {
tree_path.append(item);
}
if (tree_path.is_empty()) {
return {};
}

View File

@@ -2,6 +2,8 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#include "BLI_string.h"
#include "NOD_geometry.hh"
#include "NOD_register.hh"
#include "NOD_socket.hh"

View File

@@ -287,8 +287,17 @@ static void refresh_node_sockets_and_panels(bNodeTree &ntree,
++new_num_panels;
}
}
Vector<bNodeSocket *> old_inputs = node.inputs;
Vector<bNodeSocket *> old_outputs = node.outputs;
Vector<bNodeSocket *> old_inputs;
LISTBASE_FOREACH (bNodeSocket *, socket, &node.inputs) {
old_inputs.append(socket);
}
Vector<bNodeSocket *> old_outputs;
LISTBASE_FOREACH (bNodeSocket *, socket, &node.outputs) {
old_outputs.append(socket);
}
Vector<bNodePanelState> old_panels = Vector<bNodePanelState>(node.panel_states());
/* New panel states buffer. */

View File

@@ -2,6 +2,8 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#include "BLI_string.h"
#include "NOD_socket_declarations.hh"
#include "NOD_socket_declarations_geometry.hh"

View File

@@ -21,6 +21,7 @@
#include "BLI_linklist.h"
#include "BLI_listbase.h"
#include "BLI_math_vector.h"
#include "BLI_string.h"
#include "BLI_threads.h"
#include "BLI_utildefines.h"
#include "BLI_vector.hh"

View File

@@ -10,6 +10,7 @@
#include "DNA_space_types.h"
#include "BLI_math_vector.h"
#include "BLI_string.h"
#include "BKE_context.h"
#include "BKE_node_runtime.hh"

View File

@@ -2,6 +2,8 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#include "BLI_string.h"
#include "node_shader_util.hh"
#include "node_util.hh"

View File

@@ -2,6 +2,8 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#include "BLI_string.h"
#include "node_shader_util.hh"
#include "UI_interface.hh"

View File

@@ -4,6 +4,8 @@
#include "node_shader_util.hh"
#include "BLI_string.h"
#include "UI_interface.hh"
#include "UI_resources.hh"

View File

@@ -13,6 +13,7 @@
#include "DNA_texture_types.h"
#include "BLI_listbase.h"
#include "BLI_string.h"
#include "BLI_threads.h"
#include "BLI_utildefines.h"