diff --git a/source/blender/makesrna/RNA_enum_items.hh b/source/blender/makesrna/RNA_enum_items.hh index ce7752bc3c0..93f062cef5e 100644 --- a/source/blender/makesrna/RNA_enum_items.hh +++ b/source/blender/makesrna/RNA_enum_items.hh @@ -227,6 +227,9 @@ DEF_ENUM(rna_enum_geometry_component_type_items) DEF_ENUM(rna_node_combsep_color_items) DEF_ENUM(node_socket_data_type_items) +DEF_ENUM(rna_node_geometry_curve_handle_side_items) +DEF_ENUM(rna_node_geometry_mesh_circle_fill_type_items) + DEF_ENUM(rna_enum_volume_grid_data_type_items) DEF_ENUM(rna_enum_collection_color_items) diff --git a/source/blender/makesrna/intern/rna_nodetree.cc b/source/blender/makesrna/intern/rna_nodetree.cc index 161ae24762b..c826d946286 100644 --- a/source/blender/makesrna/intern/rna_nodetree.cc +++ b/source/blender/makesrna/intern/rna_nodetree.cc @@ -511,7 +511,7 @@ static const EnumPropertyItem rna_node_geometry_curve_handle_type_items[] = { "The location is constrained to point in the opposite direction as the other handle"}, {0, nullptr, 0, nullptr, nullptr}}; -static const EnumPropertyItem rna_node_geometry_curve_handle_side_items[] = { +const EnumPropertyItem rna_node_geometry_curve_handle_side_items[] = { {GEO_NODE_CURVE_HANDLE_LEFT, "LEFT", ICON_NONE, "Left", "Use the left handles"}, {GEO_NODE_CURVE_HANDLE_RIGHT, "RIGHT", ICON_NONE, "Right", "Use the right handles"}, {0, nullptr, 0, nullptr, nullptr}}; @@ -531,6 +531,13 @@ static const EnumPropertyItem rna_enum_mix_data_type_items[] = { {0, nullptr, 0, nullptr, nullptr}, }; +const EnumPropertyItem rna_node_geometry_mesh_circle_fill_type_items[] = { + {GEO_NODE_MESH_CIRCLE_FILL_NONE, "NONE", 0, "None", ""}, + {GEO_NODE_MESH_CIRCLE_FILL_NGON, "NGON", 0, "N-Gon", ""}, + {GEO_NODE_MESH_CIRCLE_FILL_TRIANGLE_FAN, "TRIANGLE_FAN", 0, "Triangles", ""}, + {0, nullptr, 0, nullptr, nullptr}, +}; + #ifndef RNA_RUNTIME static const EnumPropertyItem node_sampler_type_items[] = { {0, "NEAREST", 0, "Nearest", ""}, @@ -557,12 +564,6 @@ static const EnumPropertyItem node_cryptomatte_layer_name_items[] = { {0, nullptr, 0, nullptr, nullptr}, }; -static EnumPropertyItem rna_node_geometry_mesh_circle_fill_type_items[] = { - {GEO_NODE_MESH_CIRCLE_FILL_NONE, "NONE", 0, "None", ""}, - {GEO_NODE_MESH_CIRCLE_FILL_NGON, "NGON", 0, "N-Gon", ""}, - {GEO_NODE_MESH_CIRCLE_FILL_TRIANGLE_FAN, "TRIANGLE_FAN", 0, "Triangles", ""}, - {0, nullptr, 0, nullptr, nullptr}, -}; #endif #ifndef RNA_RUNTIME @@ -8930,16 +8931,6 @@ static void def_tex_bricks(StructRNA *srna) /* -- Geometry Nodes --------------------------------------------------------- */ -static void def_geo_attribute_domain_size(StructRNA *srna) -{ - PropertyRNA *prop = RNA_def_property(srna, "component", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, nullptr, "custom1"); - RNA_def_property_enum_items(prop, rna_enum_geometry_component_type_items); - RNA_def_property_enum_default(prop, int(blender::bke::GeometryComponent::Type::Mesh)); - RNA_def_property_ui_text(prop, "Component", ""); - RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update"); -} - static void def_geo_curve_sample(StructRNA *srna) { static EnumPropertyItem mode_items[] = { @@ -9090,19 +9081,6 @@ static void def_geo_distribute_points_on_faces(StructRNA *srna) RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update"); } -static void def_geo_curve_spline_type(StructRNA *srna) -{ - PropertyRNA *prop; - RNA_def_struct_sdna_from(srna, "NodeGeometryCurveSplineType", "storage"); - - prop = RNA_def_property(srna, "spline_type", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, nullptr, "spline_type"); - RNA_def_property_enum_items(prop, rna_enum_curves_types); - RNA_def_property_ui_text(prop, "Type", "The curve type to change the selected curves to"); - - RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update"); -} - static void def_geo_curve_set_handle_type(StructRNA *srna) { PropertyRNA *prop; @@ -9121,18 +9099,6 @@ static void def_geo_curve_set_handle_type(StructRNA *srna) RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update"); } -static void def_geo_curve_set_handle_positions(StructRNA *srna) -{ - PropertyRNA *prop; - - RNA_def_struct_sdna_from(srna, "NodeGeometrySetCurveHandlePositions", "storage"); - - prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_items(prop, rna_node_geometry_curve_handle_side_items); - RNA_def_property_ui_text(prop, "Mode", "Whether to update left and right handles"); - RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update"); -} - static void def_geo_simulation_input(StructRNA *srna) { PropertyRNA *prop; @@ -9475,52 +9441,6 @@ static void def_fn_rotate_euler(StructRNA *srna) RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); } -static void def_geo_tool_set_selection(StructRNA *srna) -{ - PropertyRNA *prop = RNA_def_property(srna, "domain", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, nullptr, "custom1"); - RNA_def_property_enum_items(prop, rna_enum_attribute_domain_point_face_curve_items); - RNA_def_property_enum_default(prop, ATTR_DOMAIN_POINT); - RNA_def_property_ui_text(prop, "Domain", ""); - RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); -} - -static void def_geo_mesh_circle(StructRNA *srna) -{ - PropertyRNA *prop; - - RNA_def_struct_sdna_from(srna, "NodeGeometryMeshCircle", "storage"); - - prop = RNA_def_property(srna, "fill_type", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_items(prop, rna_node_geometry_mesh_circle_fill_type_items); - RNA_def_property_ui_text(prop, "Fill Type", ""); - RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); -} - -static void def_geo_mesh_cylinder(StructRNA *srna) -{ - PropertyRNA *prop; - - RNA_def_struct_sdna_from(srna, "NodeGeometryMeshCylinder", "storage"); - - prop = RNA_def_property(srna, "fill_type", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_items(prop, rna_node_geometry_mesh_circle_fill_type_items); - RNA_def_property_ui_text(prop, "Fill Type", ""); - RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update"); -} - -static void def_geo_mesh_cone(StructRNA *srna) -{ - PropertyRNA *prop; - - RNA_def_struct_sdna_from(srna, "NodeGeometryMeshCone", "storage"); - - prop = RNA_def_property(srna, "fill_type", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_items(prop, rna_node_geometry_mesh_circle_fill_type_items); - RNA_def_property_ui_text(prop, "Fill Type", ""); - RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update"); -} - static void def_geo_switch(StructRNA *srna) { PropertyRNA *prop; @@ -9574,16 +9494,6 @@ static void def_geo_sample_nearest_surface(StructRNA *srna) RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update"); } -static void def_geo_sample_nearest(StructRNA *srna) -{ - PropertyRNA *prop = RNA_def_property(srna, "domain", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, nullptr, "custom2"); - RNA_def_property_enum_items(prop, rna_enum_attribute_domain_only_mesh_items); - RNA_def_property_enum_default(prop, ATTR_DOMAIN_POINT); - RNA_def_property_ui_text(prop, "Domain", ""); - RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); -} - static void def_geo_sample_uv_surface(StructRNA *srna) { PropertyRNA *prop = RNA_def_property(srna, "data_type", PROP_ENUM, PROP_NONE); @@ -9711,31 +9621,6 @@ static void def_geo_image(StructRNA *srna) RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); } -static void def_geo_delete_geometry(StructRNA *srna) -{ - PropertyRNA *prop; - - static const EnumPropertyItem mode_items[] = { - {GEO_NODE_DELETE_GEOMETRY_MODE_ALL, "ALL", 0, "All", ""}, - {GEO_NODE_DELETE_GEOMETRY_MODE_EDGE_FACE, "EDGE_FACE", 0, "Only Edges & Faces", ""}, - {GEO_NODE_DELETE_GEOMETRY_MODE_ONLY_FACE, "ONLY_FACE", 0, "Only Faces", ""}, - {0, nullptr, 0, nullptr, nullptr}, - }; - RNA_def_struct_sdna_from(srna, "NodeGeometryDeleteGeometry", "storage"); - - prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_items(prop, mode_items); - RNA_def_property_enum_default(prop, GEO_NODE_DELETE_GEOMETRY_MODE_ALL); - RNA_def_property_ui_text(prop, "Mode", "Which parts of the mesh component to delete"); - RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - - prop = RNA_def_property(srna, "domain", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_items(prop, rna_enum_attribute_domain_without_corner_items); - RNA_def_property_enum_default(prop, ATTR_DOMAIN_POINT); - RNA_def_property_ui_text(prop, "Domain", "Which domain to delete in"); - RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); -} - static void def_geo_string_to_curves(StructRNA *srna) { static const EnumPropertyItem rna_node_geometry_string_to_curves_overflow_items[] = { @@ -9887,19 +9772,6 @@ static void def_geo_string_to_curves(StructRNA *srna) RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); } -static void def_geo_separate_geometry(StructRNA *srna) -{ - PropertyRNA *prop; - - RNA_def_struct_sdna_from(srna, "NodeGeometrySeparateGeometry", "storage"); - - prop = RNA_def_property(srna, "domain", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_items(prop, rna_enum_attribute_domain_without_corner_items); - RNA_def_property_enum_default(prop, ATTR_DOMAIN_POINT); - RNA_def_property_ui_text(prop, "Domain", "Which domain to separate on"); - RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); -} - static void def_geo_viewer(StructRNA *srna) { PropertyRNA *prop; diff --git a/source/blender/nodes/NOD_static_types.h b/source/blender/nodes/NOD_static_types.h index fcfa30e83b0..258fd03e9d6 100644 --- a/source/blender/nodes/NOD_static_types.h +++ b/source/blender/nodes/NOD_static_types.h @@ -283,7 +283,7 @@ DefNode(FunctionNode, FN_NODE_STRING_LENGTH, 0, "STRING_LENGTH", StringLength, " DefNode(FunctionNode, FN_NODE_VALUE_TO_STRING, 0, "VALUE_TO_STRING", ValueToString, "Value to String", "") DefNode(GeometryNode, GEO_NODE_ACCUMULATE_FIELD, def_geo_accumulate_field, "ACCUMULATE_FIELD", AccumulateField, "Accumulate Field", "Add the values of an evaluated field together and output the running total for each element") -DefNode(GeometryNode, GEO_NODE_ATTRIBUTE_DOMAIN_SIZE, def_geo_attribute_domain_size, "ATTRIBUTE_DOMAIN_SIZE", AttributeDomainSize, "Domain Size", "Retrieve the number of elements in a geometry for each attribute domain") +DefNode(GeometryNode, GEO_NODE_ATTRIBUTE_DOMAIN_SIZE, 0, "ATTRIBUTE_DOMAIN_SIZE", AttributeDomainSize, "Domain Size", "Retrieve the number of elements in a geometry for each attribute domain") DefNode(GeometryNode, GEO_NODE_ATTRIBUTE_STATISTIC, def_geo_attribute_statistic, "ATTRIBUTE_STATISTIC",AttributeStatistic, "Attribute Statistic", "Calculate statistics about a data set from a field evaluated on a geometry") DefNode(GeometryNode, GEO_NODE_BLUR_ATTRIBUTE, def_geo_blur_attribute, "BLUR_ATTRIBUTE", BlurAttribute, "Blur Attribute", "Mix attribute values of neighboring elements") DefNode(GeometryNode, GEO_NODE_BOUNDING_BOX, 0, "BOUNDING_BOX", BoundBox, "Bounding Box", "Calculate the limits of a geometry's positions and generate a box mesh with those dimensions") @@ -303,13 +303,13 @@ DefNode(GeometryNode, GEO_NODE_CURVE_PRIMITIVE_SPIRAL,0, "CURVE_PRIMITIVE_SPIRAL DefNode(GeometryNode, GEO_NODE_CURVE_PRIMITIVE_STAR, 0, "CURVE_PRIMITIVE_STAR", CurveStar, "Star", "Generate a poly spline in a star pattern by connecting alternating points of two circles") DefNode(GeometryNode, GEO_NODE_CURVE_SET_HANDLE_TYPE, def_geo_curve_set_handle_type, "CURVE_SET_HANDLES", CurveSetHandles, "Set Handle Type", "Set the handle type for the control points of a Bézier curve") DefNode(GeometryNode, GEO_NODE_CURVE_SPLINE_PARAMETER,0, "SPLINE_PARAMETER", SplineParameter, "Spline Parameter", "Retrieve how far along each spline a control point is") -DefNode(GeometryNode, GEO_NODE_CURVE_SPLINE_TYPE, def_geo_curve_spline_type, "CURVE_SPLINE_TYPE", CurveSplineType, "Set Spline Type", "Change the type of curves") +DefNode(GeometryNode, GEO_NODE_CURVE_SPLINE_TYPE, 0, "CURVE_SPLINE_TYPE", CurveSplineType, "Set Spline Type", "Change the type of curves") DefNode(GeometryNode, GEO_NODE_CURVE_TO_MESH, 0, "CURVE_TO_MESH", CurveToMesh, "Curve to Mesh", "Convert curves into a mesh, optionally with a custom profile shape defined by curves") DefNode(GeometryNode, GEO_NODE_CURVE_TO_POINTS, 0, "CURVE_TO_POINTS", CurveToPoints, "Curve to Points", "Generate a point cloud by sampling positions along curves") DefNode(GeometryNode, GEO_NODE_CURVE_TOPOLOGY_CURVE_OF_POINT, 0, "CURVE_OF_POINT", CurveOfPoint, "Curve of Point", "Retrieve the curve a control point is part of") DefNode(GeometryNode, GEO_NODE_CURVE_TOPOLOGY_POINTS_OF_CURVE, 0, "POINTS_OF_CURVE", PointsOfCurve, "Points of Curve", "Retrieve a point index within a curve") DefNode(GeometryNode, GEO_NODE_DEFORM_CURVES_ON_SURFACE, 0, "DEFORM_CURVES_ON_SURFACE", DeformCurvesOnSurface, "Deform Curves on Surface", "Translate and rotate curves based on changes between the object's original and evaluated surface mesh") -DefNode(GeometryNode, GEO_NODE_DELETE_GEOMETRY, def_geo_delete_geometry, "DELETE_GEOMETRY", DeleteGeometry, "Delete Geometry", "Remove selected elements of a geometry") +DefNode(GeometryNode, GEO_NODE_DELETE_GEOMETRY, 0, "DELETE_GEOMETRY", DeleteGeometry, "Delete Geometry", "Remove selected elements of a geometry") DefNode(GeometryNode, GEO_NODE_DISTRIBUTE_POINTS_IN_VOLUME, 0, "DISTRIBUTE_POINTS_IN_VOLUME", DistributePointsInVolume, "Distribute Points in Volume", "Generate points inside a volume") DefNode(GeometryNode, GEO_NODE_DISTRIBUTE_POINTS_ON_FACES, def_geo_distribute_points_on_faces, "DISTRIBUTE_POINTS_ON_FACES", DistributePointsOnFaces, "Distribute Points on Faces", "Generate points spread out on the surface of a mesh") DefNode(GeometryNode, GEO_NODE_DUAL_MESH, 0, "DUAL_MESH", DualMesh, "Dual Mesh", "Convert Faces into vertices and vertices into faces") @@ -365,10 +365,10 @@ DefNode(GeometryNode, GEO_NODE_MEAN_FILTER_SDF_VOLUME, 0, "MEAN_FILTER_SDF_VOLUM DefNode(GeometryNode, GEO_NODE_MERGE_BY_DISTANCE, 0, "MERGE_BY_DISTANCE", MergeByDistance, "Merge by Distance", "Merge vertices or points within a given distance") DefNode(GeometryNode, GEO_NODE_MESH_BOOLEAN, 0, "MESH_BOOLEAN", MeshBoolean, "Mesh Boolean", "Cut, subtract, or join multiple mesh inputs") DefNode(GeometryNode, GEO_NODE_MESH_FACE_GROUP_BOUNDARIES, 0, "MESH_FACE_SET_BOUNDARIES", MeshFaceSetBoundaries, "Face Group Boundaries", "Find edges on the boundaries between groups of faces with the same ID value") -DefNode(GeometryNode, GEO_NODE_MESH_PRIMITIVE_CIRCLE, def_geo_mesh_circle, "MESH_PRIMITIVE_CIRCLE", MeshCircle, "Mesh Circle", "Generate a circular ring of edges") -DefNode(GeometryNode, GEO_NODE_MESH_PRIMITIVE_CONE, def_geo_mesh_cone, "MESH_PRIMITIVE_CONE",MeshCone, "Cone", "Generate a cone mesh") +DefNode(GeometryNode, GEO_NODE_MESH_PRIMITIVE_CIRCLE, 0, "MESH_PRIMITIVE_CIRCLE", MeshCircle, "Mesh Circle", "Generate a circular ring of edges") +DefNode(GeometryNode, GEO_NODE_MESH_PRIMITIVE_CONE, 0, "MESH_PRIMITIVE_CONE",MeshCone, "Cone", "Generate a cone mesh") DefNode(GeometryNode, GEO_NODE_MESH_PRIMITIVE_CUBE, 0, "MESH_PRIMITIVE_CUBE",MeshCube, "Cube", "Generate a cuboid mesh with variable side lengths and subdivisions") -DefNode(GeometryNode, GEO_NODE_MESH_PRIMITIVE_CYLINDER, def_geo_mesh_cylinder, "MESH_PRIMITIVE_CYLINDER", MeshCylinder, "Cylinder", "Generate a cylinder mesh") +DefNode(GeometryNode, GEO_NODE_MESH_PRIMITIVE_CYLINDER, 0, "MESH_PRIMITIVE_CYLINDER", MeshCylinder, "Cylinder", "Generate a cylinder mesh") DefNode(GeometryNode, GEO_NODE_MESH_PRIMITIVE_GRID, 0, "MESH_PRIMITIVE_GRID",MeshGrid, "Grid", "Generate a planar mesh on the XY plane") DefNode(GeometryNode, GEO_NODE_MESH_PRIMITIVE_ICO_SPHERE, 0, "MESH_PRIMITIVE_ICO_SPHERE", MeshIcoSphere, "Ico Sphere", "Generate a spherical mesh that consists of equally sized triangles") DefNode(GeometryNode, GEO_NODE_MESH_PRIMITIVE_LINE, 0, "MESH_PRIMITIVE_LINE",MeshLine, "Mesh Line", "Generate vertices in a line and connect them with edges") @@ -391,7 +391,7 @@ DefNode(GeometryNode, GEO_NODE_OFFSET_SDF_VOLUME, 0, "OFFSET_SDF_VOLUME", Offset DefNode(GeometryNode, GEO_NODE_TOOL_FACE_SET, 0, "TOOL_FACE_SET", ToolFaceSet, "Face Set", "Each face's sculpt face set value") DefNode(GeometryNode, GEO_NODE_TOOL_3D_CURSOR, 0, "TOOL_3D_CURSOR", Tool3DCursor, "3D Cursor", "The scene's 3D cursor location and rotation") DefNode(GeometryNode, GEO_NODE_TOOL_SELECTION, 0, "TOOL_SELECTION", ToolSelection, "Selection", "User selection of the edited geometry, for tool execution") -DefNode(GeometryNode, GEO_NODE_TOOL_SET_SELECTION, def_geo_tool_set_selection, "TOOL_SELECTION_SET", ToolSetSelection, "Set Selection", "Set selection of the edited geometry, for tool execution") +DefNode(GeometryNode, GEO_NODE_TOOL_SET_SELECTION, 0, "TOOL_SELECTION_SET", ToolSetSelection, "Set Selection", "Set selection of the edited geometry, for tool execution") DefNode(GeometryNode, GEO_NODE_TOOL_SET_FACE_SET, 0, "TOOL_SET_FACE_SET", ToolSetFaceSet, "Set Face Set", "Set sculpt face set values for faces") DefNode(GeometryNode, GEO_NODE_POINTS_TO_SDF_VOLUME, 0, "POINTS_TO_SDF_VOLUME", PointsToSDFVolume, "Points to SDF Volume", "Generate an SDF volume sphere around every point") DefNode(GeometryNode, GEO_NODE_POINTS_TO_VERTICES, 0, "POINTS_TO_VERTICES", PointsToVertices, "Points to Vertices", "Generate a mesh vertex for each point cloud point") @@ -410,7 +410,7 @@ DefNode(GeometryNode, GEO_NODE_ROTATE_INSTANCES, 0, "ROTATE_INSTANCES", RotateIn DefNode(GeometryNode, GEO_NODE_SAMPLE_CURVE, def_geo_curve_sample, "SAMPLE_CURVE", SampleCurve, "Sample Curve", "Retrieve data from a point on a curve at a certain distance from its start") DefNode(GeometryNode, GEO_NODE_SAMPLE_INDEX, def_geo_sample_index, "SAMPLE_INDEX", SampleIndex, "Sample Index", "Retrieve values from specific geometry elements") DefNode(GeometryNode, GEO_NODE_SAMPLE_NEAREST_SURFACE, def_geo_sample_nearest_surface, "SAMPLE_NEAREST_SURFACE", SampleNearestSurface, "Sample Nearest Surface", "Calculate the interpolated value of a mesh attribute on the closest point of its surface") -DefNode(GeometryNode, GEO_NODE_SAMPLE_NEAREST, def_geo_sample_nearest, "SAMPLE_NEAREST", SampleNearest, "Sample Nearest", "Find the element of a geometry closest to a position. Similar to the \"Index of Nearest\" node") +DefNode(GeometryNode, GEO_NODE_SAMPLE_NEAREST, 0, "SAMPLE_NEAREST", SampleNearest, "Sample Nearest", "Find the element of a geometry closest to a position. Similar to the \"Index of Nearest\" node") DefNode(GeometryNode, GEO_NODE_SAMPLE_UV_SURFACE, def_geo_sample_uv_surface, "SAMPLE_UV_SURFACE", SampleUVSurface, "Sample UV Surface", "Calculate the interpolated values of a mesh attribute at a UV coordinate") DefNode(GeometryNode, GEO_NODE_SAMPLE_VOLUME, 0, "SAMPLE_VOLUME", SampleVolume, "Sample Volume", "Calculate the interpolated values of a Volume grid at the specified position") DefNode(GeometryNode, GEO_NODE_SCALE_ELEMENTS, 0, "SCALE_ELEMENTS", ScaleElements, "Scale Elements", "Scale groups of connected edges and faces") @@ -418,8 +418,8 @@ DefNode(GeometryNode, GEO_NODE_SCALE_INSTANCES, 0, "SCALE_INSTANCES", ScaleInsta DefNode(GeometryNode, GEO_NODE_SDF_VOLUME_SPHERE, 0, "SDF_VOLUME_SPHERE", SDFVolumeSphere, "SDF Volume Sphere", "Generate an SDF Volume Sphere") DefNode(GeometryNode, GEO_NODE_SELF_OBJECT, 0, "SELF_OBJECT", SelfObject, "Self Object", "Retrieve the object that contains the geometry nodes modifier currently being executed") DefNode(GeometryNode, GEO_NODE_SEPARATE_COMPONENTS, 0, "SEPARATE_COMPONENTS",SeparateComponents, "Separate Components", "Split a geometry into a separate output for each type of data in the geometry") -DefNode(GeometryNode, GEO_NODE_SEPARATE_GEOMETRY, def_geo_separate_geometry, "SEPARATE_GEOMETRY", SeparateGeometry, "Separate Geometry", "Split a geometry into two geometry outputs based on a selection") -DefNode(GeometryNode, GEO_NODE_SET_CURVE_HANDLES, def_geo_curve_set_handle_positions, "SET_CURVE_HANDLES", SetCurveHandlePositions, "Set Handle Positions", "Set the positions for the handles of Bézier curves") +DefNode(GeometryNode, GEO_NODE_SEPARATE_GEOMETRY, 0, "SEPARATE_GEOMETRY", SeparateGeometry, "Separate Geometry", "Split a geometry into two geometry outputs based on a selection") +DefNode(GeometryNode, GEO_NODE_SET_CURVE_HANDLES, 0, "SET_CURVE_HANDLES", SetCurveHandlePositions, "Set Handle Positions", "Set the positions for the handles of Bézier curves") DefNode(GeometryNode, GEO_NODE_SET_CURVE_NORMAL, 0, "SET_CURVE_NORMAL", SetCurveNormal, "Set Curve Normal", "Set the evaluation mode for curve normals") DefNode(GeometryNode, GEO_NODE_SET_CURVE_RADIUS, 0, "SET_CURVE_RADIUS", SetCurveRadius, "Set Curve Radius", "Set the radius of the curve at each control point") DefNode(GeometryNode, GEO_NODE_SET_CURVE_TILT, 0, "SET_CURVE_TILT", SetCurveTilt, "Set Curve Tilt", "Set the tilt angle at each curve control point") diff --git a/source/blender/nodes/geometry/nodes/node_geo_attribute_domain_size.cc b/source/blender/nodes/geometry/nodes/node_geo_attribute_domain_size.cc index a2662ee9d92..77bf2685ef3 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_attribute_domain_size.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_attribute_domain_size.cc @@ -2,9 +2,13 @@ * * SPDX-License-Identifier: GPL-2.0-or-later */ +#include "NOD_rna_define.hh" + #include "UI_interface.hh" #include "UI_resources.hh" +#include "RNA_enum_types.hh" + #include "node_geometry_util.hh" namespace blender::nodes::node_geo_attribute_domain_size_cc { @@ -125,6 +129,17 @@ static void node_geo_exec(GeoNodeExecParams params) } } +static void node_rna(StructRNA *srna) +{ + RNA_def_node_enum(srna, + "component", + "Component", + "", + rna_enum_geometry_component_type_items, + NOD_inline_enum_accessors(custom1), + int(blender::bke::GeometryComponent::Type::Mesh)); +} + static void node_register() { static bNodeType ntype; @@ -136,6 +151,8 @@ static void node_register() ntype.updatefunc = node_update; nodeRegisterType(&ntype); + + node_rna(ntype.rna_ext.srna); } NOD_REGISTER_NODE(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 7e30f064f44..eae9ae73e10 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 @@ -4,11 +4,15 @@ #include "BKE_curves.hh" +#include "NOD_rna_define.hh" + #include "UI_interface.hh" #include "UI_resources.hh" #include "GEO_set_curve_type.hh" +#include "RNA_enum_types.hh" + #include "node_geometry_util.hh" namespace blender::nodes::node_geo_curve_spline_type_cc { @@ -81,6 +85,17 @@ static void node_geo_exec(GeoNodeExecParams params) params.set_output("Curve", std::move(geometry_set)); } +static void node_rna(StructRNA *srna) +{ + RNA_def_node_enum(srna, + "spline_type", + "Type", + "The curve type to change the selected curves to", + rna_enum_curves_types, + NOD_storage_enum_accessors(spline_type), + CURVE_TYPE_POLY); +} + static void node_register() { static bNodeType ntype; @@ -95,6 +110,8 @@ static void node_register() ntype.draw_buttons = node_layout; nodeRegisterType(&ntype); + + node_rna(ntype.rna_ext.srna); } NOD_REGISTER_NODE(node_register) diff --git a/source/blender/nodes/geometry/nodes/node_geo_delete_geometry.cc b/source/blender/nodes/geometry/nodes/node_geo_delete_geometry.cc index 7b48899c9d1..35a62e93872 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_delete_geometry.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_delete_geometry.cc @@ -2,6 +2,8 @@ * * SPDX-License-Identifier: GPL-2.0-or-later */ +#include "NOD_rna_define.hh" + #include "UI_interface.hh" #include "UI_resources.hh" @@ -13,6 +15,8 @@ #include "GEO_mesh_copy_selection.hh" +#include "RNA_enum_types.hh" + #include "node_geometry_util.hh" namespace blender::nodes::node_geo_delete_geometry_cc { @@ -246,6 +250,32 @@ static void node_geo_exec(GeoNodeExecParams params) params.set_output("Geometry", std::move(geometry_set)); } +static void node_rna(StructRNA *srna) +{ + static const EnumPropertyItem mode_items[] = { + {GEO_NODE_DELETE_GEOMETRY_MODE_ALL, "ALL", 0, "All", ""}, + {GEO_NODE_DELETE_GEOMETRY_MODE_EDGE_FACE, "EDGE_FACE", 0, "Only Edges & Faces", ""}, + {GEO_NODE_DELETE_GEOMETRY_MODE_ONLY_FACE, "ONLY_FACE", 0, "Only Faces", ""}, + {0, nullptr, 0, nullptr, nullptr}, + }; + + RNA_def_node_enum(srna, + "mode", + "Mode", + "Which parts of the mesh component to delete", + mode_items, + NOD_storage_enum_accessors(mode), + GEO_NODE_DELETE_GEOMETRY_MODE_ALL); + + RNA_def_node_enum(srna, + "domain", + "Domain", + "Which domain to delete in", + rna_enum_attribute_domain_without_corner_items, + NOD_storage_enum_accessors(domain), + ATTR_DOMAIN_POINT); +} + static void node_register() { static bNodeType ntype; @@ -262,6 +292,8 @@ static void node_register() ntype.geometry_node_execute = node_geo_exec; ntype.draw_buttons = node_layout; nodeRegisterType(&ntype); + + node_rna(ntype.rna_ext.srna); } NOD_REGISTER_NODE(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 a19c78ce4b5..2c71fe3d590 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 @@ -8,11 +8,15 @@ #include "BKE_material.h" #include "BKE_mesh.hh" +#include "NOD_rna_define.hh" + #include "UI_interface.hh" #include "UI_resources.hh" #include "node_geometry_util.hh" +#include "RNA_enum_types.hh" + namespace blender::nodes::node_geo_mesh_primitive_circle_cc { NODE_STORAGE_FUNCS(NodeGeometryMeshCircle) @@ -198,6 +202,17 @@ static void node_geo_exec(GeoNodeExecParams params) params.set_output("Mesh", GeometrySet::from_mesh(mesh)); } +static void node_rna(StructRNA *srna) +{ + RNA_def_node_enum(srna, + "fill_type", + "Fill Type", + "", + rna_node_geometry_mesh_circle_fill_type_items, + NOD_storage_enum_accessors(fill_type), + GEO_NODE_MESH_CIRCLE_FILL_NONE); +} + static void node_register() { static bNodeType ntype; @@ -210,6 +225,8 @@ static void node_register() ntype.draw_buttons = node_layout; ntype.declare = node_declare; nodeRegisterType(&ntype); + + node_rna(ntype.rna_ext.srna); } NOD_REGISTER_NODE(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 f5487a71c2a..e7c5814bf01 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 @@ -8,11 +8,15 @@ #include "BKE_material.h" #include "BKE_mesh.hh" +#include "NOD_rna_define.hh" + #include "UI_interface.hh" #include "UI_resources.hh" #include "node_geometry_util.hh" +#include "RNA_enum_types.hh" + #include namespace blender::nodes { @@ -856,6 +860,17 @@ static void node_geo_exec(GeoNodeExecParams params) params.set_output("Mesh", GeometrySet::from_mesh(mesh)); } +static void node_rna(StructRNA *srna) +{ + RNA_def_node_enum(srna, + "fill_type", + "Fill Type", + "", + rna_node_geometry_mesh_circle_fill_type_items, + NOD_storage_enum_accessors(fill_type), + GEO_NODE_MESH_CIRCLE_FILL_NGON); +} + static void node_register() { static bNodeType ntype; @@ -869,6 +884,8 @@ static void node_register() ntype.draw_buttons = node_layout; ntype.declare = node_declare; nodeRegisterType(&ntype); + + node_rna(ntype.rna_ext.srna); } NOD_REGISTER_NODE(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 1591a327600..02bf67ba218 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 @@ -8,11 +8,15 @@ #include "BKE_material.h" #include "BKE_mesh.hh" +#include "NOD_rna_define.hh" + #include "UI_interface.hh" #include "UI_resources.hh" #include "node_geometry_util.hh" +#include "RNA_enum_types.hh" + namespace blender::nodes::node_geo_mesh_primitive_cylinder_cc { NODE_STORAGE_FUNCS(NodeGeometryMeshCylinder) @@ -127,6 +131,16 @@ static void node_geo_exec(GeoNodeExecParams params) params.set_output("Mesh", GeometrySet::from_mesh(mesh)); } +static void node_rna(StructRNA *srna) +{ + RNA_def_node_enum(srna, + "fill_type", + "Fill Type", "", + rna_node_geometry_mesh_circle_fill_type_items, + NOD_storage_enum_accessors(fill_type), + GEO_NODE_MESH_CIRCLE_FILL_NGON); +} + static void node_register() { static bNodeType ntype; @@ -139,6 +153,8 @@ static void node_register() ntype.geometry_node_execute = node_geo_exec; ntype.draw_buttons = node_layout; nodeRegisterType(&ntype); + + node_rna(ntype.rna_ext.srna); } NOD_REGISTER_NODE(node_register) diff --git a/source/blender/nodes/geometry/nodes/node_geo_sample_nearest.cc b/source/blender/nodes/geometry/nodes/node_geo_sample_nearest.cc index e61e04ebcb1..c8769d3c52a 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_sample_nearest.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_sample_nearest.cc @@ -10,9 +10,13 @@ #include "BKE_mesh.hh" #include "BKE_mesh_runtime.hh" +#include "NOD_rna_define.hh" + #include "UI_interface.hh" #include "UI_resources.hh" +#include "RNA_enum_types.hh" + #include "node_geometry_util.hh" namespace blender::nodes { @@ -318,6 +322,16 @@ static void node_geo_exec(GeoNodeExecParams params) params.set_output>("Index", Field(std::move(op))); } +static void node_rna(StructRNA *srna) +{ + RNA_def_node_enum(srna, + "domain", + "Domain", "", + rna_enum_attribute_domain_only_mesh_items, + NOD_inline_enum_accessors(custom2), + ATTR_DOMAIN_POINT); +} + static void node_register() { static bNodeType ntype; @@ -328,6 +342,8 @@ static void node_register() ntype.geometry_node_execute = node_geo_exec; ntype.draw_buttons = node_layout; nodeRegisterType(&ntype); + + node_rna(ntype.rna_ext.srna); } NOD_REGISTER_NODE(node_register) diff --git a/source/blender/nodes/geometry/nodes/node_geo_separate_geometry.cc b/source/blender/nodes/geometry/nodes/node_geo_separate_geometry.cc index 75de9f3b002..f0b47e0085b 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_separate_geometry.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_separate_geometry.cc @@ -2,9 +2,13 @@ * * SPDX-License-Identifier: GPL-2.0-or-later */ +#include "NOD_rna_define.hh" + #include "UI_interface.hh" #include "UI_resources.hh" +#include "RNA_enum_types.hh" + #include "node_geometry_util.hh" namespace blender::nodes::node_geo_separate_geometry_cc { @@ -89,6 +93,16 @@ static void node_geo_exec(GeoNodeExecParams params) } } +static void node_rna(StructRNA *srna) +{ + RNA_def_node_enum(srna, + "domain", + "Domain", "Which domain to separate on", + rna_enum_attribute_domain_without_corner_items, + NOD_storage_enum_accessors(domain), + ATTR_DOMAIN_POINT); +} + static void node_register() { static bNodeType ntype; @@ -106,6 +120,8 @@ static void node_register() ntype.geometry_node_execute = node_geo_exec; ntype.draw_buttons = node_layout; nodeRegisterType(&ntype); + + node_rna(ntype.rna_ext.srna); } NOD_REGISTER_NODE(node_register) diff --git a/source/blender/nodes/geometry/nodes/node_geo_set_curve_handles.cc b/source/blender/nodes/geometry/nodes/node_geo_set_curve_handles.cc index 01072c93752..7433f1a02be 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_set_curve_handles.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_set_curve_handles.cc @@ -8,9 +8,13 @@ #include "BKE_curves.hh" +#include "NOD_rna_define.hh" + #include "UI_interface.hh" #include "UI_resources.hh" +#include "RNA_enum_types.hh" + #include "node_geometry_util.hh" namespace blender::nodes::node_geo_set_curve_handles_cc { @@ -164,6 +168,16 @@ static void node_geo_exec(GeoNodeExecParams params) params.set_output("Curve", std::move(geometry_set)); } +static void node_rna(StructRNA *srna) +{ + RNA_def_node_enum(srna, + "mode", + "Mode", "Whether to update left and right handles", + rna_node_geometry_curve_handle_side_items, + NOD_storage_enum_accessors(mode), + GEO_NODE_CURVE_HANDLE_LEFT); +} + static void node_register() { static bNodeType ntype; @@ -180,6 +194,8 @@ static void node_register() node_copy_standard_storage); ntype.draw_buttons = node_layout; nodeRegisterType(&ntype); + + node_rna(ntype.rna_ext.srna); } NOD_REGISTER_NODE(node_register) diff --git a/source/blender/nodes/geometry/nodes/node_geo_tool_set_selection.cc b/source/blender/nodes/geometry/nodes/node_geo_tool_set_selection.cc index 95f888a4d93..bd12f74f272 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_tool_set_selection.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_tool_set_selection.cc @@ -4,9 +4,13 @@ #include "BKE_mesh.hh" +#include "NOD_rna_define.hh" + #include "UI_interface.hh" #include "UI_resources.hh" +#include "RNA_enum_types.hh" + #include "node_geometry_util.hh" namespace blender::nodes::node_geo_tool_set_selection_cc { @@ -75,6 +79,16 @@ static void node_geo_exec(GeoNodeExecParams params) params.set_output("Geometry", std::move(geometry)); } +static void node_rna(StructRNA *srna) +{ + RNA_def_node_enum(srna, + "domain", + "Domain", "", + rna_enum_attribute_domain_point_face_curve_items, + NOD_inline_enum_accessors(custom1), + ATTR_DOMAIN_POINT); +} + static void node_register() { static bNodeType ntype; @@ -86,6 +100,8 @@ static void node_register() ntype.gather_add_node_search_ops = search_link_ops_for_for_tool_node; ntype.gather_link_search_ops = search_link_ops_for_tool_node; nodeRegisterType(&ntype); + + node_rna(ntype.rna_ext.srna); } NOD_REGISTER_NODE(node_register)