diff --git a/source/blender/blenkernel/intern/volume_render.cc b/source/blender/blenkernel/intern/volume_render.cc index ac69dc5d37f..7b5f29b8d74 100644 --- a/source/blender/blenkernel/intern/volume_render.cc +++ b/source/blender/blenkernel/intern/volume_render.cc @@ -104,6 +104,14 @@ bool BKE_volume_grid_dense_floats(const Volume *volume, if (bbox.empty()) { return false; } + const std::array bbox_indices = {UNPACK3(openvdb::math::Abs(bbox.min())), + UNPACK3(openvdb::math::Abs(bbox.max()))}; + const int64_t max_bbox_index = *std::max_element(bbox_indices.begin(), bbox_indices.end()); + if (max_bbox_index > (1 << 30)) { + /* There is an integer overflow when trying to extract dense voxels when the indices are very + * large. */ + return false; + } const openvdb::Vec3i resolution = bbox.dim().asVec3i(); const int64_t num_voxels = int64_t(resolution[0]) * int64_t(resolution[1]) * diff --git a/source/blender/makesrna/intern/rna_nodetree.cc b/source/blender/makesrna/intern/rna_nodetree.cc index 3a46c65d852..09978c45793 100644 --- a/source/blender/makesrna/intern/rna_nodetree.cc +++ b/source/blender/makesrna/intern/rna_nodetree.cc @@ -8886,6 +8886,7 @@ static void def_geo_curve_sample(StructRNA *srna) prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, mode_items); RNA_def_property_ui_text(prop, "Mode", "Method for sampling input"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update"); prop = RNA_def_property(srna, "use_all_curves", PROP_BOOLEAN, PROP_NONE); @@ -8893,6 +8894,7 @@ static void def_geo_curve_sample(StructRNA *srna) "All Curves", "Sample lengths based on the total length of all curves, rather than " "using a length inside each selected curve"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update"); prop = RNA_def_property(srna, "data_type", PROP_ENUM, PROP_NONE); @@ -8901,6 +8903,7 @@ static void def_geo_curve_sample(StructRNA *srna) prop, nullptr, nullptr, "rna_GeometryNodeAttributeType_type_with_socket_itemf"); RNA_def_property_enum_default(prop, CD_PROP_FLOAT); RNA_def_property_ui_text(prop, "Data Type", ""); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update"); } @@ -8943,6 +8946,7 @@ static void def_geo_distribute_points_on_faces(StructRNA *srna) RNA_def_property_enum_items(prop, rna_node_geometry_distribute_points_on_faces_mode_items); RNA_def_property_enum_default(prop, GEO_NODE_POINT_DISTRIBUTE_POINTS_ON_FACES_RANDOM); RNA_def_property_ui_text(prop, "Distribution Method", "Method to use for scattering points"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update"); prop = RNA_def_property(srna, "use_legacy_normal", PROP_BOOLEAN, PROP_NONE); @@ -8951,6 +8955,7 @@ static void def_geo_distribute_points_on_faces(StructRNA *srna) "Legacy Normal", "Output the normal and rotation values that have been output " "before the node started taking smooth normals into account"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update"); } @@ -8964,12 +8969,14 @@ static void def_geo_curve_set_handle_type(StructRNA *srna) RNA_def_property_enum_sdna(prop, nullptr, "handle_type"); RNA_def_property_ui_text(prop, "Handle Type", ""); RNA_def_property_enum_items(prop, rna_node_geometry_curve_handle_type_items); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update"); prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, rna_enum_node_geometry_curve_handle_side_items); RNA_def_property_ui_text(prop, "Mode", "Whether to update left and right handles"); RNA_def_property_flag(prop, PROP_ENUM_FLAG); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update"); } @@ -9312,6 +9319,7 @@ static void rna_def_geo_bake(StructRNA *srna) nullptr, nullptr); RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NO_DEG_UPDATE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Active Item Index", "Index of the active item"); RNA_def_property_update(prop, NC_NODE, nullptr); } @@ -9441,6 +9449,7 @@ static void def_geo_sample_index(StructRNA *srna) prop, nullptr, nullptr, "rna_GeometryNodeAttributeType_type_with_socket_itemf"); RNA_def_property_enum_default(prop, CD_PROP_FLOAT); RNA_def_property_ui_text(prop, "Data Type", ""); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update"); prop = RNA_def_property(srna, "domain", PROP_ENUM, PROP_NONE); diff --git a/source/blender/nodes/NOD_rna_define.hh b/source/blender/nodes/NOD_rna_define.hh index 3b536346790..37c1465906d 100644 --- a/source/blender/nodes/NOD_rna_define.hh +++ b/source/blender/nodes/NOD_rna_define.hh @@ -68,6 +68,7 @@ PropertyRNA *RNA_def_node_enum(StructRNA *srna, const EnumPropertyItem *static_items, const EnumRNAAccessors accessors, std::optional default_value = std::nullopt, - const EnumPropertyItemFunc item_func = nullptr); + const EnumPropertyItemFunc item_func = nullptr, + bool allow_animation = false); } // namespace blender::nodes diff --git a/source/blender/nodes/function/nodes/node_fn_align_euler_to_vector.cc b/source/blender/nodes/function/nodes/node_fn_align_euler_to_vector.cc index 89e40129de7..502683a3a2d 100644 --- a/source/blender/nodes/function/nodes/node_fn_align_euler_to_vector.cc +++ b/source/blender/nodes/function/nodes/node_fn_align_euler_to_vector.cc @@ -239,14 +239,20 @@ static void node_rna(StructRNA *srna) "Axis", "Axis to align to the vector", axis_items, - NOD_inline_enum_accessors(custom1)); + NOD_inline_enum_accessors(custom1), + std::nullopt, + nullptr, + true); RNA_def_node_enum(srna, "pivot_axis", "Pivot Axis", "Axis to rotate around", pivot_axis_items, - NOD_inline_enum_accessors(custom2)); + NOD_inline_enum_accessors(custom2), + std::nullopt, + nullptr, + true); } static void node_register() diff --git a/source/blender/nodes/geometry/nodes/node_geo_accumulate_field.cc b/source/blender/nodes/geometry/nodes/node_geo_accumulate_field.cc index 0f332c29216..5d18e2c999c 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_accumulate_field.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_accumulate_field.cc @@ -389,7 +389,8 @@ static void node_rna(StructRNA *srna) rna_enum_attribute_domain_items, NOD_storage_enum_accessors(domain), int(AttrDomain::Point), - enums::domain_experimental_grease_pencil_version3_fn); + enums::domain_experimental_grease_pencil_version3_fn, + true); } static void node_register() diff --git a/source/blender/nodes/geometry/nodes/node_geo_attribute_capture.cc b/source/blender/nodes/geometry/nodes/node_geo_attribute_capture.cc index 77f473ca155..77f3088b21e 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_attribute_capture.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_attribute_capture.cc @@ -182,7 +182,8 @@ static void node_rna(StructRNA *srna) rna_enum_attribute_domain_items, NOD_storage_enum_accessors(domain), int8_t(AttrDomain::Point), - enums::domain_experimental_grease_pencil_version3_fn); + enums::domain_experimental_grease_pencil_version3_fn, + true); } static void node_register() diff --git a/source/blender/nodes/geometry/nodes/node_geo_attribute_statistic.cc b/source/blender/nodes/geometry/nodes/node_geo_attribute_statistic.cc index 67fddcdb65c..92cadeae334 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_attribute_statistic.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_attribute_statistic.cc @@ -355,7 +355,8 @@ static void node_rna(StructRNA *srna) rna_enum_attribute_domain_items, NOD_inline_enum_accessors(custom2), int(AttrDomain::Point), - enums::domain_experimental_grease_pencil_version3_fn); + enums::domain_experimental_grease_pencil_version3_fn, + true); } static void node_register() diff --git a/source/blender/nodes/geometry/nodes/node_geo_curve_spline_type.cc b/source/blender/nodes/geometry/nodes/node_geo_curve_spline_type.cc index bbed8a0f842..dc4cc991893 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_curve_spline_type.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_curve_spline_type.cc @@ -84,7 +84,9 @@ static void node_rna(StructRNA *srna) "The curve type to change the selected curves to", rna_enum_curves_type_items, NOD_storage_enum_accessors(spline_type), - CURVE_TYPE_POLY); + CURVE_TYPE_POLY, + nullptr, + true); } static void node_register() diff --git a/source/blender/nodes/geometry/nodes/node_geo_duplicate_elements.cc b/source/blender/nodes/geometry/nodes/node_geo_duplicate_elements.cc index 654142a44d3..a5630d03b98 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_duplicate_elements.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_duplicate_elements.cc @@ -1061,7 +1061,9 @@ static void node_rna(StructRNA *srna) "Which domain to duplicate", domain_items, NOD_storage_enum_accessors(domain), - int(AttrDomain::Point)); + int(AttrDomain::Point), + nullptr, + true); } static void node_register() diff --git a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_circle.cc b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_circle.cc index 284f93a0d58..87e16c5f7fe 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_circle.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_circle.cc @@ -212,7 +212,9 @@ static void node_rna(StructRNA *srna) "", rna_enum_node_geometry_mesh_circle_fill_type_items, NOD_storage_enum_accessors(fill_type), - GEO_NODE_MESH_CIRCLE_FILL_NONE); + GEO_NODE_MESH_CIRCLE_FILL_NONE, + nullptr, + true); } static void node_register() diff --git a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cone.cc b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cone.cc index 7e264fb0f2d..7676f7e2977 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cone.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cone.cc @@ -148,7 +148,9 @@ static void node_rna(StructRNA *srna) "", rna_enum_node_geometry_mesh_circle_fill_type_items, NOD_storage_enum_accessors(fill_type), - GEO_NODE_MESH_CIRCLE_FILL_NGON); + GEO_NODE_MESH_CIRCLE_FILL_NGON, + nullptr, + true); } static void node_register() diff --git a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cylinder.cc b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cylinder.cc index 766eb0f1af4..e78023b0bc6 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cylinder.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cylinder.cc @@ -139,7 +139,9 @@ static void node_rna(StructRNA *srna) "", rna_enum_node_geometry_mesh_circle_fill_type_items, NOD_storage_enum_accessors(fill_type), - GEO_NODE_MESH_CIRCLE_FILL_NGON); + GEO_NODE_MESH_CIRCLE_FILL_NGON, + nullptr, + true); } static void node_register() diff --git a/source/blender/nodes/geometry/nodes/node_geo_mesh_to_points.cc b/source/blender/nodes/geometry/nodes/node_geo_mesh_to_points.cc index a59f6d97d58..0e9f68c292d 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_mesh_to_points.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_mesh_to_points.cc @@ -233,7 +233,9 @@ static void node_rna(StructRNA *srna) "", mode_items, NOD_storage_enum_accessors(mode), - GEO_NODE_MESH_TO_POINTS_VERTICES); + GEO_NODE_MESH_TO_POINTS_VERTICES, + nullptr, + true); } static void node_register() diff --git a/source/blender/nodes/geometry/nodes/node_geo_subdivision_surface.cc b/source/blender/nodes/geometry/nodes/node_geo_subdivision_surface.cc index 323c758f889..22bfb9c7b0d 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_subdivision_surface.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_subdivision_surface.cc @@ -205,7 +205,9 @@ static void node_rna(StructRNA *srna) "Controls how smoothing is applied to UVs", rna_enum_subdivision_uv_smooth_items, NOD_storage_enum_accessors(uv_smooth), - SUBSURF_UV_SMOOTH_PRESERVE_BOUNDARIES); + SUBSURF_UV_SMOOTH_PRESERVE_BOUNDARIES, + nullptr, + true); RNA_def_node_enum(srna, "boundary_smooth", @@ -213,7 +215,9 @@ static void node_rna(StructRNA *srna) "Controls how open boundaries are smoothed", rna_enum_subdivision_boundary_smooth_items, NOD_storage_enum_accessors(boundary_smooth), - SUBSURF_BOUNDARY_SMOOTH_ALL); + SUBSURF_BOUNDARY_SMOOTH_ALL, + nullptr, + true); } static void node_register() diff --git a/source/blender/nodes/geometry/nodes/node_geo_triangulate.cc b/source/blender/nodes/geometry/nodes/node_geo_triangulate.cc index e67469b41a0..ab5dc4e0a23 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_triangulate.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_triangulate.cc @@ -156,7 +156,9 @@ static void node_rna(StructRNA *srna) "Method for splitting the quads into triangles", rna_node_geometry_triangulate_quad_method_items, NOD_inline_enum_accessors(custom1), - GEO_NODE_POINTS_TO_VOLUME_RESOLUTION_MODE_AMOUNT); + GEO_NODE_POINTS_TO_VOLUME_RESOLUTION_MODE_AMOUNT, + nullptr, + true); RNA_def_node_enum(srna, "ngon_method", @@ -164,7 +166,9 @@ static void node_rna(StructRNA *srna) "Method for splitting the n-gons into triangles", rna_node_geometry_triangulate_ngon_method_items, NOD_inline_enum_accessors(custom2), - GEO_NODE_POINTS_TO_VOLUME_RESOLUTION_MODE_AMOUNT); + GEO_NODE_POINTS_TO_VOLUME_RESOLUTION_MODE_AMOUNT, + nullptr, + true); } static void node_register() diff --git a/source/blender/nodes/intern/node_rna_define.cc b/source/blender/nodes/intern/node_rna_define.cc index dd990f2934e..3d01a16f922 100644 --- a/source/blender/nodes/intern/node_rna_define.cc +++ b/source/blender/nodes/intern/node_rna_define.cc @@ -29,7 +29,8 @@ PropertyRNA *RNA_def_node_enum(StructRNA *srna, const EnumPropertyItem *static_items, const EnumRNAAccessors accessors, std::optional default_value, - const EnumPropertyItemFunc item_func) + const EnumPropertyItemFunc item_func, + const bool allow_animation) { PropertyRNA *prop = RNA_def_property(srna, identifier, PROP_ENUM, PROP_NONE); RNA_def_property_enum_funcs_runtime(prop, accessors.getter, accessors.setter, item_func); @@ -38,7 +39,13 @@ PropertyRNA *RNA_def_node_enum(StructRNA *srna, RNA_def_property_enum_default(prop, *default_value); } RNA_def_property_ui_text(prop, ui_name, ui_description); - RNA_def_property_update_runtime(prop, rna_Node_socket_update); + if (allow_animation) { + RNA_def_property_update_runtime(prop, rna_Node_update); + } + else { + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_update_runtime(prop, rna_Node_socket_update); + } RNA_def_property_update_notifier(prop, NC_NODE | NA_EDITED); return prop; }