Changeset View
Changeset View
Standalone View
Standalone View
source/blender/modifiers/intern/MOD_nodes.cc
| Show All 15 Lines | |||||
| #include "BLI_math_vec_types.hh" | #include "BLI_math_vec_types.hh" | ||||
| #include "BLI_multi_value_map.hh" | #include "BLI_multi_value_map.hh" | ||||
| #include "BLI_set.hh" | #include "BLI_set.hh" | ||||
| #include "BLI_string.h" | #include "BLI_string.h" | ||||
| #include "BLI_string_search.h" | #include "BLI_string_search.h" | ||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| #include "DNA_collection_types.h" | #include "DNA_collection_types.h" | ||||
| #include "DNA_curves_types.h" | |||||
| #include "DNA_defaults.h" | #include "DNA_defaults.h" | ||||
| #include "DNA_material_types.h" | #include "DNA_material_types.h" | ||||
| #include "DNA_mesh_types.h" | #include "DNA_mesh_types.h" | ||||
| #include "DNA_meshdata_types.h" | #include "DNA_meshdata_types.h" | ||||
| #include "DNA_modifier_types.h" | #include "DNA_modifier_types.h" | ||||
| #include "DNA_node_types.h" | #include "DNA_node_types.h" | ||||
| #include "DNA_object_types.h" | #include "DNA_object_types.h" | ||||
| #include "DNA_pointcloud_types.h" | #include "DNA_pointcloud_types.h" | ||||
| ▲ Show 20 Lines • Show All 153 Lines • ▼ Show 20 Lines | static bool node_needs_own_transform_relation(const bNode &node) | ||||
| } | } | ||||
| if (node.type == GEO_NODE_OBJECT_INFO) { | if (node.type == GEO_NODE_OBJECT_INFO) { | ||||
| const NodeGeometryObjectInfo &storage = *static_cast<const NodeGeometryObjectInfo *>( | const NodeGeometryObjectInfo &storage = *static_cast<const NodeGeometryObjectInfo *>( | ||||
| node.storage); | node.storage); | ||||
| return storage.transform_space == GEO_NODE_TRANSFORM_SPACE_RELATIVE; | return storage.transform_space == GEO_NODE_TRANSFORM_SPACE_RELATIVE; | ||||
| } | } | ||||
| if (node.type == GEO_NODE_DEFORM_CURVES_ON_SURFACE) { | |||||
| return true; | |||||
| } | |||||
| return false; | return false; | ||||
| } | } | ||||
| static void process_nodes_for_depsgraph(const bNodeTree &tree, | static void process_nodes_for_depsgraph(const bNodeTree &tree, | ||||
| Set<ID *> &ids, | Set<ID *> &ids, | ||||
| bool &needs_own_transform_relation) | bool &needs_own_transform_relation) | ||||
| { | { | ||||
| Set<const bNodeTree *> handled_groups; | Set<const bNodeTree *> handled_groups; | ||||
| ▲ Show 20 Lines • Show All 63 Lines • ▼ Show 20 Lines | static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx) | ||||
| } | } | ||||
| DEG_add_node_tree_output_relation(ctx->node, nmd->node_group, "Nodes Modifier"); | DEG_add_node_tree_output_relation(ctx->node, nmd->node_group, "Nodes Modifier"); | ||||
| bool needs_own_transform_relation = false; | bool needs_own_transform_relation = false; | ||||
| Set<ID *> used_ids; | Set<ID *> used_ids; | ||||
| find_used_ids_from_settings(nmd->settings, used_ids); | find_used_ids_from_settings(nmd->settings, used_ids); | ||||
| process_nodes_for_depsgraph(*nmd->node_group, used_ids, needs_own_transform_relation); | process_nodes_for_depsgraph(*nmd->node_group, used_ids, needs_own_transform_relation); | ||||
| if (ctx->object->type == OB_CURVES) { | |||||
| Curves *curves_id = static_cast<Curves *>(ctx->object->data); | |||||
| if (curves_id->surface != nullptr) { | |||||
| used_ids.add(&curves_id->surface->id); | |||||
| } | |||||
| } | |||||
| for (ID *id : used_ids) { | for (ID *id : used_ids) { | ||||
| switch ((ID_Type)GS(id->name)) { | switch ((ID_Type)GS(id->name)) { | ||||
| case ID_OB: { | case ID_OB: { | ||||
| Object *object = reinterpret_cast<Object *>(id); | Object *object = reinterpret_cast<Object *>(id); | ||||
| add_object_relation(ctx, *object); | add_object_relation(ctx, *object); | ||||
| break; | break; | ||||
| } | } | ||||
| case ID_GR: { | case ID_GR: { | ||||
| ▲ Show 20 Lines • Show All 1,565 Lines • Show Last 20 Lines | |||||