diff options
author | Jacques Lucke <jacques@blender.org> | 2021-09-06 13:05:41 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2021-09-06 13:05:41 +0300 |
commit | 507f2628fd01db9676c2edae32ba3661efee796f (patch) | |
tree | f754fcabd5c264a3fc0131d0b06a19b91e2adefa | |
parent | c227b4da17ccc0d5aec5454ead8966d4204b49db (diff) |
rename Freeze to Capture
-rw-r--r-- | release/scripts/startup/nodeitems_builtins.py | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/BKE_node.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/node.cc | 2 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_node_types.h | 4 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_nodetree.c | 4 | ||||
-rw-r--r-- | source/blender/nodes/CMakeLists.txt | 2 | ||||
-rw-r--r-- | source/blender/nodes/NOD_geometry.h | 2 | ||||
-rw-r--r-- | source/blender/nodes/NOD_static_types.h | 2 | ||||
-rw-r--r-- | source/blender/nodes/geometry/nodes/node_geo_attribute_capture.cc (renamed from source/blender/nodes/geometry/nodes/node_geo_attribute_freeze.cc) | 52 |
9 files changed, 37 insertions, 35 deletions
diff --git a/release/scripts/startup/nodeitems_builtins.py b/release/scripts/startup/nodeitems_builtins.py index 337523ef633..3f922e36b09 100644 --- a/release/scripts/startup/nodeitems_builtins.py +++ b/release/scripts/startup/nodeitems_builtins.py @@ -478,12 +478,12 @@ geometry_node_categories = [ GeometryNodeCategory("GEO_ATTRIBUTE", "Attribute", items=[ NodeItem("GeometryNodeAttributeRandomize"), NodeItem("GeometryNodeAttributeMath"), + NodeItem("GeometryNodeAttributeCapture"), NodeItem("GeometryNodeAttributeClamp"), NodeItem("GeometryNodeAttributeCompare"), NodeItem("GeometryNodeAttributeConvert"), NodeItem("GeometryNodeAttributeCurveMap"), NodeItem("GeometryNodeAttributeFill"), - NodeItem("GeometryNodeAttributeFreeze"), NodeItem("GeometryNodeAttributeMix"), NodeItem("GeometryNodeAttributeProximity"), NodeItem("GeometryNodeAttributeColorRamp"), diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h index beb4fbf26a5..0d70e812ecb 100644 --- a/source/blender/blenkernel/BKE_node.h +++ b/source/blender/blenkernel/BKE_node.h @@ -1488,7 +1488,7 @@ int ntreeTexExecTree(struct bNodeTree *ntree, #define GEO_NODE_SET_POSITION 1077 #define GEO_NODE_INPUT_INDEX 1078 #define GEO_NODE_INPUT_NORMAL 1079 -#define GEO_NODE_ATTRIBUTE_FREEZE 1080 +#define GEO_NODE_ATTRIBUTE_CAPTURE 1080 /** \} */ diff --git a/source/blender/blenkernel/intern/node.cc b/source/blender/blenkernel/intern/node.cc index 6789aed45c4..950026b9d65 100644 --- a/source/blender/blenkernel/intern/node.cc +++ b/source/blender/blenkernel/intern/node.cc @@ -5140,7 +5140,7 @@ static void registerGeometryNodes() register_node_type_geo_attribute_convert(); register_node_type_geo_attribute_curve_map(); register_node_type_geo_attribute_fill(); - register_node_type_geo_attribute_freeze(); + register_node_type_geo_attribute_capture(); register_node_type_geo_attribute_map_range(); register_node_type_geo_attribute_math(); register_node_type_geo_attribute_mix(); diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h index e97c6232ec9..174101771b2 100644 --- a/source/blender/makesdna/DNA_node_types.h +++ b/source/blender/makesdna/DNA_node_types.h @@ -1441,12 +1441,12 @@ typedef struct NodeGeometryCurveFill { uint8_t mode; } NodeGeometryCurveFill; -typedef struct NodeGeometryAttributeFreeze { +typedef struct NodeGeometryAttributeCapture { /* CustomDataType. */ int8_t data_type; /* AttributeDomain. */ int8_t domain; -} NodeGeometryAttributeFreeze; +} NodeGeometryAttributeCapture; /* script node mode */ #define NODE_SCRIPT_INTERNAL 0 diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 26f214b83be..b13745a0809 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -10279,11 +10279,11 @@ static void def_geo_curve_fill(StructRNA *srna) RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); } -static void def_geo_attribute_freeze(StructRNA *srna) +static void def_geo_attribute_capture(StructRNA *srna) { PropertyRNA *prop; - RNA_def_struct_sdna_from(srna, "NodeGeometryAttributeFreeze", "storage"); + RNA_def_struct_sdna_from(srna, "NodeGeometryAttributeCapture", "storage"); prop = RNA_def_property(srna, "data_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, rna_enum_attribute_type_items); diff --git a/source/blender/nodes/CMakeLists.txt b/source/blender/nodes/CMakeLists.txt index 7ed9d3e09b6..d315c4fd7c4 100644 --- a/source/blender/nodes/CMakeLists.txt +++ b/source/blender/nodes/CMakeLists.txt @@ -142,6 +142,7 @@ set(SRC function/node_function_util.cc geometry/nodes/node_geo_align_rotation_to_vector.cc + geometry/nodes/node_geo_attribute_capture.cc geometry/nodes/node_geo_attribute_clamp.cc geometry/nodes/node_geo_attribute_color_ramp.cc geometry/nodes/node_geo_attribute_combine_xyz.cc @@ -149,7 +150,6 @@ set(SRC geometry/nodes/node_geo_attribute_convert.cc geometry/nodes/node_geo_attribute_curve_map.cc geometry/nodes/node_geo_attribute_fill.cc - geometry/nodes/node_geo_attribute_freeze.cc geometry/nodes/node_geo_attribute_map_range.cc geometry/nodes/node_geo_attribute_math.cc geometry/nodes/node_geo_attribute_mix.cc diff --git a/source/blender/nodes/NOD_geometry.h b/source/blender/nodes/NOD_geometry.h index 79354ad4134..e9fb4ad123c 100644 --- a/source/blender/nodes/NOD_geometry.h +++ b/source/blender/nodes/NOD_geometry.h @@ -37,7 +37,7 @@ void register_node_type_geo_attribute_compare(void); void register_node_type_geo_attribute_convert(void); void register_node_type_geo_attribute_curve_map(void); void register_node_type_geo_attribute_fill(void); -void register_node_type_geo_attribute_freeze(void); +void register_node_type_geo_attribute_capture(void); void register_node_type_geo_attribute_map_range(void); void register_node_type_geo_attribute_math(void); void register_node_type_geo_attribute_mix(void); diff --git a/source/blender/nodes/NOD_static_types.h b/source/blender/nodes/NOD_static_types.h index 6110c06ed27..e249c65368a 100644 --- a/source/blender/nodes/NOD_static_types.h +++ b/source/blender/nodes/NOD_static_types.h @@ -276,7 +276,7 @@ DefNode(GeometryNode, GEO_NODE_ATTRIBUTE_COMBINE_XYZ, def_geo_attribute_combine_ DefNode(GeometryNode, GEO_NODE_ATTRIBUTE_COMPARE, def_geo_attribute_attribute_compare, "ATTRIBUTE_COMPARE", AttributeCompare, "Attribute Compare", "") DefNode(GeometryNode, GEO_NODE_ATTRIBUTE_CONVERT, def_geo_attribute_convert, "ATTRIBUTE_CONVERT", AttributeConvert, "Attribute Convert", "") DefNode(GeometryNode, GEO_NODE_ATTRIBUTE_CURVE_MAP, def_geo_attribute_curve_map, "ATTRIBUTE_CURVE_MAP", AttributeCurveMap, "Attribute Curve Map", "") -DefNode(GeometryNode, GEO_NODE_ATTRIBUTE_FREEZE, def_geo_attribute_freeze, "ATTRIBUTE_FREEZE", AttributeFreeze, "Attribute Freeze", "") +DefNode(GeometryNode, GEO_NODE_ATTRIBUTE_CAPTURE, def_geo_attribute_capture, "ATTRIBUTE_CAPTURE", AttributeCapture, "Attribute Capture", "") DefNode(GeometryNode, GEO_NODE_ATTRIBUTE_FILL, def_geo_attribute_fill, "ATTRIBUTE_FILL", AttributeFill, "Attribute Fill", "") DefNode(GeometryNode, GEO_NODE_ATTRIBUTE_MAP_RANGE, def_geo_attribute_map_range, "ATTRIBUTE_MAP_RANGE", AttributeMapRange, "Attribute Map Range", "") DefNode(GeometryNode, GEO_NODE_ATTRIBUTE_MATH, def_geo_attribute_math, "ATTRIBUTE_MATH", AttributeMath, "Attribute Math", "") diff --git a/source/blender/nodes/geometry/nodes/node_geo_attribute_freeze.cc b/source/blender/nodes/geometry/nodes/node_geo_attribute_capture.cc index 6f3984038ca..1fa71d3f57d 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_attribute_freeze.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_attribute_capture.cc @@ -23,7 +23,7 @@ namespace blender::nodes { -static void geo_node_attribute_freeze_declare(NodeDeclarationBuilder &b) +static void geo_node_attribute_capture_declare(NodeDeclarationBuilder &b) { b.add_input<decl::Geometry>("Geometry"); b.add_input<decl::Vector>("Value"); @@ -40,9 +40,9 @@ static void geo_node_attribute_freeze_declare(NodeDeclarationBuilder &b) b.add_output<decl::Int>("Attribute", "Attribute_004"); } -static void geo_node_attribute_freeze_layout(uiLayout *layout, - bContext *UNUSED(C), - PointerRNA *ptr) +static void geo_node_attribute_capture_layout(uiLayout *layout, + bContext *UNUSED(C), + PointerRNA *ptr) { uiLayoutSetPropSep(layout, true); uiLayoutSetPropDecorate(layout, false); @@ -50,19 +50,20 @@ static void geo_node_attribute_freeze_layout(uiLayout *layout, uiItemR(layout, ptr, "data_type", 0, "", ICON_NONE); } -static void geo_node_attribute_freeze_init(bNodeTree *UNUSED(tree), bNode *node) +static void geo_node_attribute_capture_init(bNodeTree *UNUSED(tree), bNode *node) { - NodeGeometryAttributeFreeze *data = (NodeGeometryAttributeFreeze *)MEM_callocN( - sizeof(NodeGeometryAttributeFreeze), __func__); + NodeGeometryAttributeCapture *data = (NodeGeometryAttributeCapture *)MEM_callocN( + sizeof(NodeGeometryAttributeCapture), __func__); data->data_type = CD_PROP_FLOAT; data->domain = ATTR_DOMAIN_POINT; node->storage = data; } -static void geo_node_attribute_freeze_update(bNodeTree *UNUSED(ntree), bNode *node) +static void geo_node_attribute_capture_update(bNodeTree *UNUSED(ntree), bNode *node) { - const NodeGeometryAttributeFreeze &storage = *(const NodeGeometryAttributeFreeze *)node->storage; + const NodeGeometryAttributeCapture &storage = *(const NodeGeometryAttributeCapture *) + node->storage; const CustomDataType data_type = static_cast<CustomDataType>(storage.data_type); bNodeSocket *socket_value_attribute_name = (bNodeSocket *)node->inputs.first; @@ -92,10 +93,10 @@ static void geo_node_attribute_freeze_update(bNodeTree *UNUSED(ntree), bNode *no nodeSetSocketAvailability(out_socket_value_int32, data_type == CD_PROP_INT32); } -static void try_freeze_field_on_geometry(GeometryComponent &component, - const AttributeIDRef &attribute_id, - const AttributeDomain domain, - const GField &field) +static void try_capture_field_on_geometry(GeometryComponent &component, + const AttributeIDRef &attribute_id, + const AttributeDomain domain, + const GField &field) { GeometryComponentFieldContext field_context{component, domain}; const int domain_size = component.attribute_domain_size(domain); @@ -112,14 +113,15 @@ static void try_freeze_field_on_geometry(GeometryComponent &component, output_attribute.save(); } -static void geo_node_attribute_freeze_exec(GeoNodeExecParams params) +static void geo_node_attribute_capture_exec(GeoNodeExecParams params) { GeometrySet geometry_set = params.extract_input<GeometrySet>("Geometry"); geometry_set = bke::geometry_set_realize_instances(geometry_set); const bNode &node = params.node(); - const NodeGeometryAttributeFreeze &storage = *(const NodeGeometryAttributeFreeze *)node.storage; + const NodeGeometryAttributeCapture &storage = *(const NodeGeometryAttributeCapture *) + node.storage; const CustomDataType data_type = static_cast<CustomDataType>(storage.data_type); const AttributeDomain domain = static_cast<AttributeDomain>(storage.domain); @@ -144,7 +146,7 @@ static void geo_node_attribute_freeze_exec(GeoNodeExecParams params) break; } - WeakAnonymousAttributeID anonymous_id{"Attribute Freeze"}; + WeakAnonymousAttributeID anonymous_id{"Attribute Capture"}; const CPPType &type = field.cpp_type(); static const Array<GeometryComponentType> types = { @@ -152,7 +154,7 @@ static void geo_node_attribute_freeze_exec(GeoNodeExecParams params) for (const GeometryComponentType type : types) { if (geometry_set.has(type)) { GeometryComponent &component = geometry_set.get_component_for_write(type); - try_freeze_field_on_geometry(component, anonymous_id.get(), domain, field); + try_capture_field_on_geometry(component, anonymous_id.get(), domain, field); } } @@ -189,20 +191,20 @@ static void geo_node_attribute_freeze_exec(GeoNodeExecParams params) } // namespace blender::nodes -void register_node_type_geo_attribute_freeze() +void register_node_type_geo_attribute_capture() { static bNodeType ntype; geo_node_type_base( - &ntype, GEO_NODE_ATTRIBUTE_FREEZE, "Attribute Freeze", NODE_CLASS_ATTRIBUTE, 0); + &ntype, GEO_NODE_ATTRIBUTE_CAPTURE, "Attribute Capture", NODE_CLASS_ATTRIBUTE, 0); node_type_storage(&ntype, - "NodeGeometryAttributeFreeze", + "NodeGeometryAttributeCapture", node_free_standard_storage, node_copy_standard_storage); - node_type_init(&ntype, blender::nodes::geo_node_attribute_freeze_init); - node_type_update(&ntype, blender::nodes::geo_node_attribute_freeze_update); - ntype.declare = blender::nodes::geo_node_attribute_freeze_declare; - ntype.geometry_node_execute = blender::nodes::geo_node_attribute_freeze_exec; - ntype.draw_buttons = blender::nodes::geo_node_attribute_freeze_layout; + node_type_init(&ntype, blender::nodes::geo_node_attribute_capture_init); + node_type_update(&ntype, blender::nodes::geo_node_attribute_capture_update); + ntype.declare = blender::nodes::geo_node_attribute_capture_declare; + ntype.geometry_node_execute = blender::nodes::geo_node_attribute_capture_exec; + ntype.draw_buttons = blender::nodes::geo_node_attribute_capture_layout; nodeRegisterType(&ntype); } |