diff options
author | Jacques Lucke <jacques@blender.org> | 2022-03-18 12:57:45 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2022-03-18 12:57:45 +0300 |
commit | 2252bc6a5527cd7360d1ccfe7a2d1bc640a8dfa6 (patch) | |
tree | bb6f8921b9977dc2c387b750a29aa6ded06ec5f9 /source/blender/nodes | |
parent | 7509a741166c97f5f87ed9e580eef6f99eb1e62a (diff) |
BLI: move CPPType to blenlib
For more detail about `CPPType`, see `BLI_cpp_type.hh` and D14367.
Differential Revision: https://developer.blender.org/D14367
Diffstat (limited to 'source/blender/nodes')
-rw-r--r-- | source/blender/nodes/NOD_geometry_exec.hh | 1 | ||||
-rw-r--r-- | source/blender/nodes/NOD_geometry_nodes_eval_log.hh | 4 | ||||
-rw-r--r-- | source/blender/nodes/geometry/node_geometry_exec.cc | 8 | ||||
-rw-r--r-- | source/blender/nodes/intern/geometry_nodes_eval_log.cc | 1 | ||||
-rw-r--r-- | source/blender/nodes/intern/node_socket.cc | 48 |
5 files changed, 28 insertions, 34 deletions
diff --git a/source/blender/nodes/NOD_geometry_exec.hh b/source/blender/nodes/NOD_geometry_exec.hh index 540afc41dba..ce0c027da25 100644 --- a/source/blender/nodes/NOD_geometry_exec.hh +++ b/source/blender/nodes/NOD_geometry_exec.hh @@ -32,7 +32,6 @@ using bke::ReadAttributeLookup; using bke::StrongAnonymousAttributeID; using bke::WeakAnonymousAttributeID; using bke::WriteAttributeLookup; -using fn::CPPType; using fn::Field; using fn::FieldContext; using fn::FieldEvaluator; diff --git a/source/blender/nodes/NOD_geometry_nodes_eval_log.hh b/source/blender/nodes/NOD_geometry_nodes_eval_log.hh index 113a7efb0a5..492c67a236f 100644 --- a/source/blender/nodes/NOD_geometry_nodes_eval_log.hh +++ b/source/blender/nodes/NOD_geometry_nodes_eval_log.hh @@ -67,7 +67,7 @@ class GenericValueLog : public ValueLog { class GFieldValueLog : public ValueLog { private: fn::GField field_; - const fn::CPPType &type_; + const CPPType &type_; Vector<std::string> input_tooltips_; public: @@ -83,7 +83,7 @@ class GFieldValueLog : public ValueLog { return input_tooltips_; } - const fn::CPPType &type() const + const CPPType &type() const { return type_; } diff --git a/source/blender/nodes/geometry/node_geometry_exec.cc b/source/blender/nodes/geometry/node_geometry_exec.cc index 474bfaa214a..58ded7aadd2 100644 --- a/source/blender/nodes/geometry/node_geometry_exec.cc +++ b/source/blender/nodes/geometry/node_geometry_exec.cc @@ -1,10 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0-or-later */ -#include "FN_cpp_type_make.hh" +#include "BLI_cpp_type_make.hh" #include "NOD_geometry_exec.hh" -MAKE_CPP_TYPE(GeometrySet, GeometrySet, CPPTypeFlags::Printable); - -namespace blender::nodes { - -} +BLI_CPP_TYPE_MAKE(GeometrySet, GeometrySet, CPPTypeFlags::Printable); diff --git a/source/blender/nodes/intern/geometry_nodes_eval_log.cc b/source/blender/nodes/intern/geometry_nodes_eval_log.cc index 5b1b0a21614..5c8f4c52f75 100644 --- a/source/blender/nodes/intern/geometry_nodes_eval_log.cc +++ b/source/blender/nodes/intern/geometry_nodes_eval_log.cc @@ -15,7 +15,6 @@ namespace blender::nodes::geometry_nodes_eval_log { -using fn::CPPType; using fn::FieldCPPType; using fn::FieldInput; using fn::GField; diff --git a/source/blender/nodes/intern/node_socket.cc b/source/blender/nodes/intern/node_socket.cc index 948c8376460..0ab446d8b0c 100644 --- a/source/blender/nodes/intern/node_socket.cc +++ b/source/blender/nodes/intern/node_socket.cc @@ -10,6 +10,7 @@ #include "DNA_node_types.h" #include "BLI_color.hh" +#include "BLI_cpp_type_make.hh" #include "BLI_listbase.h" #include "BLI_math_vec_types.hh" #include "BLI_string.h" @@ -30,7 +31,6 @@ #include "NOD_node_declaration.hh" #include "NOD_socket.h" -#include "FN_cpp_type_make.hh" #include "FN_field.hh" using namespace blender; @@ -683,11 +683,11 @@ static bNodeSocketType *make_socket_type_virtual() static bNodeSocketType *make_socket_type_bool() { bNodeSocketType *socktype = make_standard_socket_type(SOCK_BOOLEAN, PROP_NONE); - socktype->base_cpp_type = &blender::fn::CPPType::get<bool>(); + socktype->base_cpp_type = &blender::CPPType::get<bool>(); socktype->get_base_cpp_value = [](const bNodeSocket &socket, void *r_value) { *(bool *)r_value = ((bNodeSocketValueBoolean *)socket.default_value)->value; }; - socktype->geometry_nodes_cpp_type = &blender::fn::CPPType::get<ValueOrField<bool>>(); + socktype->geometry_nodes_cpp_type = &blender::CPPType::get<ValueOrField<bool>>(); socktype->get_geometry_nodes_cpp_value = [](const bNodeSocket &socket, void *r_value) { bool value; socket.typeinfo->get_base_cpp_value(socket, &value); @@ -699,11 +699,11 @@ static bNodeSocketType *make_socket_type_bool() static bNodeSocketType *make_socket_type_float(PropertySubType subtype) { bNodeSocketType *socktype = make_standard_socket_type(SOCK_FLOAT, subtype); - socktype->base_cpp_type = &blender::fn::CPPType::get<float>(); + socktype->base_cpp_type = &blender::CPPType::get<float>(); socktype->get_base_cpp_value = [](const bNodeSocket &socket, void *r_value) { *(float *)r_value = ((bNodeSocketValueFloat *)socket.default_value)->value; }; - socktype->geometry_nodes_cpp_type = &blender::fn::CPPType::get<ValueOrField<float>>(); + socktype->geometry_nodes_cpp_type = &blender::CPPType::get<ValueOrField<float>>(); socktype->get_geometry_nodes_cpp_value = [](const bNodeSocket &socket, void *r_value) { float value; socket.typeinfo->get_base_cpp_value(socket, &value); @@ -715,11 +715,11 @@ static bNodeSocketType *make_socket_type_float(PropertySubType subtype) static bNodeSocketType *make_socket_type_int(PropertySubType subtype) { bNodeSocketType *socktype = make_standard_socket_type(SOCK_INT, subtype); - socktype->base_cpp_type = &blender::fn::CPPType::get<int>(); + socktype->base_cpp_type = &blender::CPPType::get<int>(); socktype->get_base_cpp_value = [](const bNodeSocket &socket, void *r_value) { *(int *)r_value = ((bNodeSocketValueInt *)socket.default_value)->value; }; - socktype->geometry_nodes_cpp_type = &blender::fn::CPPType::get<ValueOrField<int>>(); + socktype->geometry_nodes_cpp_type = &blender::CPPType::get<ValueOrField<int>>(); socktype->get_geometry_nodes_cpp_value = [](const bNodeSocket &socket, void *r_value) { int value; socket.typeinfo->get_base_cpp_value(socket, &value); @@ -731,11 +731,11 @@ static bNodeSocketType *make_socket_type_int(PropertySubType subtype) static bNodeSocketType *make_socket_type_vector(PropertySubType subtype) { bNodeSocketType *socktype = make_standard_socket_type(SOCK_VECTOR, subtype); - socktype->base_cpp_type = &blender::fn::CPPType::get<blender::float3>(); + socktype->base_cpp_type = &blender::CPPType::get<blender::float3>(); socktype->get_base_cpp_value = [](const bNodeSocket &socket, void *r_value) { *(blender::float3 *)r_value = ((bNodeSocketValueVector *)socket.default_value)->value; }; - socktype->geometry_nodes_cpp_type = &blender::fn::CPPType::get<ValueOrField<blender::float3>>(); + socktype->geometry_nodes_cpp_type = &blender::CPPType::get<ValueOrField<blender::float3>>(); socktype->get_geometry_nodes_cpp_value = [](const bNodeSocket &socket, void *r_value) { blender::float3 value; socket.typeinfo->get_base_cpp_value(socket, &value); @@ -747,12 +747,12 @@ static bNodeSocketType *make_socket_type_vector(PropertySubType subtype) static bNodeSocketType *make_socket_type_rgba() { bNodeSocketType *socktype = make_standard_socket_type(SOCK_RGBA, PROP_NONE); - socktype->base_cpp_type = &blender::fn::CPPType::get<blender::ColorGeometry4f>(); + socktype->base_cpp_type = &blender::CPPType::get<blender::ColorGeometry4f>(); socktype->get_base_cpp_value = [](const bNodeSocket &socket, void *r_value) { *(blender::ColorGeometry4f *)r_value = ((bNodeSocketValueRGBA *)socket.default_value)->value; }; socktype->geometry_nodes_cpp_type = - &blender::fn::CPPType::get<ValueOrField<blender::ColorGeometry4f>>(); + &blender::CPPType::get<ValueOrField<blender::ColorGeometry4f>>(); socktype->get_geometry_nodes_cpp_value = [](const bNodeSocket &socket, void *r_value) { blender::ColorGeometry4f value; socket.typeinfo->get_base_cpp_value(socket, &value); @@ -764,11 +764,11 @@ static bNodeSocketType *make_socket_type_rgba() static bNodeSocketType *make_socket_type_string() { bNodeSocketType *socktype = make_standard_socket_type(SOCK_STRING, PROP_NONE); - socktype->base_cpp_type = &blender::fn::CPPType::get<std::string>(); + socktype->base_cpp_type = &blender::CPPType::get<std::string>(); socktype->get_base_cpp_value = [](const bNodeSocket &socket, void *r_value) { new (r_value) std::string(((bNodeSocketValueString *)socket.default_value)->value); }; - socktype->geometry_nodes_cpp_type = &blender::fn::CPPType::get<ValueOrField<std::string>>(); + socktype->geometry_nodes_cpp_type = &blender::CPPType::get<ValueOrField<std::string>>(); socktype->get_geometry_nodes_cpp_value = [](const bNodeSocket &socket, void *r_value) { std::string value; value.~basic_string(); @@ -778,16 +778,16 @@ static bNodeSocketType *make_socket_type_string() return socktype; } -MAKE_CPP_TYPE(Object, Object *, CPPTypeFlags::BasicType) -MAKE_CPP_TYPE(Collection, Collection *, CPPTypeFlags::BasicType) -MAKE_CPP_TYPE(Texture, Tex *, CPPTypeFlags::BasicType) -MAKE_CPP_TYPE(Image, Image *, CPPTypeFlags::BasicType) -MAKE_CPP_TYPE(Material, Material *, CPPTypeFlags::BasicType) +BLI_CPP_TYPE_MAKE(Object, Object *, CPPTypeFlags::BasicType) +BLI_CPP_TYPE_MAKE(Collection, Collection *, CPPTypeFlags::BasicType) +BLI_CPP_TYPE_MAKE(Texture, Tex *, CPPTypeFlags::BasicType) +BLI_CPP_TYPE_MAKE(Image, Image *, CPPTypeFlags::BasicType) +BLI_CPP_TYPE_MAKE(Material, Material *, CPPTypeFlags::BasicType) static bNodeSocketType *make_socket_type_object() { bNodeSocketType *socktype = make_standard_socket_type(SOCK_OBJECT, PROP_NONE); - socktype->base_cpp_type = &blender::fn::CPPType::get<Object *>(); + socktype->base_cpp_type = &blender::CPPType::get<Object *>(); socktype->get_base_cpp_value = [](const bNodeSocket &socket, void *r_value) { *(Object **)r_value = ((bNodeSocketValueObject *)socket.default_value)->value; }; @@ -799,7 +799,7 @@ static bNodeSocketType *make_socket_type_object() static bNodeSocketType *make_socket_type_geometry() { bNodeSocketType *socktype = make_standard_socket_type(SOCK_GEOMETRY, PROP_NONE); - socktype->base_cpp_type = &blender::fn::CPPType::get<GeometrySet>(); + socktype->base_cpp_type = &blender::CPPType::get<GeometrySet>(); socktype->get_base_cpp_value = [](const bNodeSocket &UNUSED(socket), void *r_value) { new (r_value) GeometrySet(); }; @@ -811,7 +811,7 @@ static bNodeSocketType *make_socket_type_geometry() static bNodeSocketType *make_socket_type_collection() { bNodeSocketType *socktype = make_standard_socket_type(SOCK_COLLECTION, PROP_NONE); - socktype->base_cpp_type = &blender::fn::CPPType::get<Collection *>(); + socktype->base_cpp_type = &blender::CPPType::get<Collection *>(); socktype->get_base_cpp_value = [](const bNodeSocket &socket, void *r_value) { *(Collection **)r_value = ((bNodeSocketValueCollection *)socket.default_value)->value; }; @@ -823,7 +823,7 @@ static bNodeSocketType *make_socket_type_collection() static bNodeSocketType *make_socket_type_texture() { bNodeSocketType *socktype = make_standard_socket_type(SOCK_TEXTURE, PROP_NONE); - socktype->base_cpp_type = &blender::fn::CPPType::get<Tex *>(); + socktype->base_cpp_type = &blender::CPPType::get<Tex *>(); socktype->get_base_cpp_value = [](const bNodeSocket &socket, void *r_value) { *(Tex **)r_value = ((bNodeSocketValueTexture *)socket.default_value)->value; }; @@ -835,7 +835,7 @@ static bNodeSocketType *make_socket_type_texture() static bNodeSocketType *make_socket_type_image() { bNodeSocketType *socktype = make_standard_socket_type(SOCK_IMAGE, PROP_NONE); - socktype->base_cpp_type = &blender::fn::CPPType::get<Image *>(); + socktype->base_cpp_type = &blender::CPPType::get<Image *>(); socktype->get_base_cpp_value = [](const bNodeSocket &socket, void *r_value) { *(Image **)r_value = ((bNodeSocketValueImage *)socket.default_value)->value; }; @@ -847,7 +847,7 @@ static bNodeSocketType *make_socket_type_image() static bNodeSocketType *make_socket_type_material() { bNodeSocketType *socktype = make_standard_socket_type(SOCK_MATERIAL, PROP_NONE); - socktype->base_cpp_type = &blender::fn::CPPType::get<Material *>(); + socktype->base_cpp_type = &blender::CPPType::get<Material *>(); socktype->get_base_cpp_value = [](const bNodeSocket &socket, void *r_value) { *(Material **)r_value = ((bNodeSocketValueMaterial *)socket.default_value)->value; }; |