33 tree_logger->node_warnings.append(
34 *tree_logger->allocator,
35 {node_.identifier, {type, tree_logger->allocator->copy_string(message)}});
39void GeoNodeExecParams::used_named_attribute(
const StringRef attribute_name,
40 const NamedAttributeUsage usage)
43 tree_logger->used_named_attributes.append(
44 *tree_logger->allocator,
45 {node_.identifier, tree_logger->allocator->copy_string(attribute_name), usage});
49void GeoNodeExecParams::check_input_geometry_set(
StringRef identifier,
52 const SocketDeclaration &decl = *node_.input_by_identifier(identifier).runtime->declaration;
54 if (geo_decl ==
nullptr) {
62 if (only_realized_data) {
64 this->error_message_add(NodeWarningType::Info,
65 TIP_(
"Instances in input geometry are ignored"));
70 this->error_message_add(NodeWarningType::Info,
71 TIP_(
"Realized data in input geometry is ignored"));
81 if (type == GeometryComponent::Type::Instance) {
84 if (supported_types.
contains(type)) {
87 std::string message =
RPT_(
"Input geometry has unsupported type: ");
89 case GeometryComponent::Type::Mesh: {
91 if (mesh->verts_num == 0) {
95 message +=
RPT_(
"Mesh");
98 case GeometryComponent::Type::PointCloud: {
100 if (pointcloud->totpoint == 0) {
104 message +=
RPT_(
"Point Cloud");
107 case GeometryComponent::Type::Instance: {
111 case GeometryComponent::Type::Volume: {
115 case GeometryComponent::Type::Curve: {
117 if (curves->geometry.point_num == 0) {
121 message +=
RPT_(
"Curve");
124 case GeometryComponent::Type::Edit: {
127 case GeometryComponent::Type::GreasePencil: {
129 if (grease_pencil->drawing_array_num == 0) {
133 message +=
RPT_(
"Grease Pencil");
137 this->error_message_add(NodeWarningType::Info, std::move(message));
141void GeoNodeExecParams::check_output_geometry_set(
const GeometrySet &geometry_set)
const
155 for (
const bNodeSocket *socket : node_.input_sockets()) {
156 if (socket->is_available() && socket->name == name) {
164void GeoNodeExecParams::set_default_remaining_outputs()
169void GeoNodeExecParams::check_input_access(
StringRef identifier,
170 const CPPType *requested_type)
const
173 for (
const bNodeSocket *socket : node_.input_sockets()) {
174 if (socket->identifier == identifier) {
175 found_socket = socket;
180 if (found_socket ==
nullptr) {
181 std::cout <<
"Did not find an input socket with the identifier '" << identifier <<
"'.\n";
182 std::cout <<
"Possible identifiers are: ";
183 for (
const bNodeSocket *socket : node_.input_sockets()) {
184 if (socket->is_available()) {
185 std::cout <<
"'" << socket->
identifier <<
"', ";
192 std::cout <<
"The socket corresponding to the identifier '" << identifier
193 <<
"' is disabled.\n";
197 const CPPType &expected_type = *found_socket->
typeinfo->geometry_nodes_cpp_type;
198 if (*requested_type != expected_type) {
199 std::cout <<
"The requested type '" << requested_type->
name() <<
"' is incorrect. Expected '"
200 << expected_type.name() <<
"'.\n";
206void GeoNodeExecParams::check_output_access(StringRef identifier,
const CPPType &value_type)
const
209 for (
const bNodeSocket *socket : node_.output_sockets()) {
210 if (socket->identifier == identifier) {
211 found_socket = socket;
216 if (found_socket ==
nullptr) {
217 std::cout <<
"Did not find an output socket with the identifier '" << identifier <<
"'.\n";
218 std::cout <<
"Possible identifiers are: ";
219 for (
const bNodeSocket *socket : node_.output_sockets()) {
220 if (socket->is_available()) {
221 std::cout <<
"'" << socket->
identifier <<
"', ";
228 std::cout <<
"The socket corresponding to the identifier '" << identifier
229 <<
"' is disabled.\n";
232 else if (params_.output_was_set(this->get_output_index(identifier))) {
233 std::cout <<
"The identifier '" << identifier <<
"' has been set already.\n";
237 const CPPType &expected_type = *found_socket->
typeinfo->geometry_nodes_cpp_type;
238 if (value_type != expected_type) {
239 std::cout <<
"The value type '" << value_type.name() <<
"' is incorrect. Expected '"
240 << expected_type.name() <<
"'.\n";
249 return AttributeFilter::Result::Process;
252 return AttributeFilter::Result::AllowSkip;
254 if (set_.names->contains(attribute_name)) {
255 return AttributeFilter::Result::Process;
257 return AttributeFilter::Result::AllowSkip;
Low-level operations for curves.
#define BLI_assert_unreachable()
#define UNUSED_VARS_NDEBUG(...)
#define BLT_I18NCONTEXT_ID_ID
#define CTX_RPT_(context, msgid)
Main * DEG_get_bmain(const Depsgraph *graph)
StringRefNull name() const
constexpr bool is_empty() const
constexpr bool contains(const T &value) const
geo_eval_log::GeoTreeLogger * get_local_tree_logger() const
void error_message_add(const NodeWarningType type, StringRef message) const
const Depsgraph * depsgraph() const
bool only_realized_data() const
Span< bke::GeometryComponent::Type > supported_types() const
bool only_instances() const
bool attribute_name_is_anonymous(const StringRef name)
void set_default_remaining_node_outputs(lf::Params ¶ms, const bNode &node)
bNodeSocketTypeHandle * typeinfo
const CurvesEditHints * get_curve_edit_hints() const
const GreasePencil * get_grease_pencil() const
bool has_realized_data() const
const Curves * get_curves() const
bool has_instances() const
const PointCloud * get_pointcloud() const
const Mesh * get_mesh() const
Vector< GeometryComponent::Type > gather_component_types(bool include_instances, bool ignore_empty) const