Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/intern/node_socket.cc
| /* SPDX-License-Identifier: GPL-2.0-or-later | /* SPDX-License-Identifier: GPL-2.0-or-later | ||||
| * Copyright 2007 Blender Foundation. All rights reserved. */ | * Copyright 2007 Blender Foundation. All rights reserved. */ | ||||
| /** \file | /** \file | ||||
| * \ingroup nodes | * \ingroup nodes | ||||
| */ | */ | ||||
| #include <climits> | #include <climits> | ||||
| #include "DNA_node_types.h" | #include "DNA_node_types.h" | ||||
| #include "BLI_color.hh" | #include "BLI_color.hh" | ||||
| #include "BLI_cpp_type_make.hh" | |||||
| #include "BLI_listbase.h" | #include "BLI_listbase.h" | ||||
| #include "BLI_math_vec_types.hh" | #include "BLI_math_vec_types.hh" | ||||
| #include "BLI_string.h" | #include "BLI_string.h" | ||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| #include "BKE_geometry_set.hh" | #include "BKE_geometry_set.hh" | ||||
| #include "BKE_lib_id.h" | #include "BKE_lib_id.h" | ||||
| #include "BKE_node.h" | #include "BKE_node.h" | ||||
| ▲ Show 20 Lines • Show All 752 Lines • ▼ Show 20 Lines | socktype->get_geometry_nodes_cpp_value = [](const bNodeSocket &socket, void *r_value) { | ||||
| std::string value; | std::string value; | ||||
| value.~basic_string(); | value.~basic_string(); | ||||
| socket.typeinfo->get_base_cpp_value(socket, &value); | socket.typeinfo->get_base_cpp_value(socket, &value); | ||||
| new (r_value) ValueOrField<std::string>(value); | new (r_value) ValueOrField<std::string>(value); | ||||
| }; | }; | ||||
| return socktype; | return socktype; | ||||
| } | } | ||||
| 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() | static bNodeSocketType *make_socket_type_object() | ||||
| { | { | ||||
| bNodeSocketType *socktype = make_standard_socket_type(SOCK_OBJECT, PROP_NONE); | bNodeSocketType *socktype = make_standard_socket_type(SOCK_OBJECT, PROP_NONE); | ||||
| socktype->base_cpp_type = &blender::CPPType::get<Object *>(); | socktype->base_cpp_type = &blender::CPPType::get<Object *>(); | ||||
| socktype->get_base_cpp_value = [](const bNodeSocket &socket, void *r_value) { | socktype->get_base_cpp_value = [](const bNodeSocket &socket, void *r_value) { | ||||
| *(Object **)r_value = ((bNodeSocketValueObject *)socket.default_value)->value; | *(Object **)r_value = ((bNodeSocketValueObject *)socket.default_value)->value; | ||||
| }; | }; | ||||
| socktype->geometry_nodes_cpp_type = socktype->base_cpp_type; | socktype->geometry_nodes_cpp_type = socktype->base_cpp_type; | ||||
| ▲ Show 20 Lines • Show All 112 Lines • Show Last 20 Lines | |||||