diff options
-rw-r--r-- | release/scripts/startup/nodeitems_builtins.py | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/BKE_blender_version.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/BKE_node.h | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/node.cc | 4 | ||||
-rw-r--r-- | source/blender/blenloader/intern/versioning_290.c | 15 | ||||
-rw-r--r-- | source/blender/nodes/CMakeLists.txt | 4 | ||||
-rw-r--r-- | source/blender/nodes/NOD_geometry.h | 4 | ||||
-rw-r--r-- | source/blender/nodes/NOD_static_types.h | 4 | ||||
-rw-r--r-- | source/blender/nodes/geometry/nodes/node_geo_subdivide.cc (renamed from source/blender/nodes/geometry/nodes/node_geo_subdivision_surface_simple.cc) | 19 | ||||
-rw-r--r-- | source/blender/nodes/geometry/nodes/node_geo_subdivide_smooth.cc (renamed from source/blender/nodes/geometry/nodes/node_geo_subdivision_surface.cc) | 23 |
10 files changed, 46 insertions, 37 deletions
diff --git a/release/scripts/startup/nodeitems_builtins.py b/release/scripts/startup/nodeitems_builtins.py index e013317b547..83e72e6f84c 100644 --- a/release/scripts/startup/nodeitems_builtins.py +++ b/release/scripts/startup/nodeitems_builtins.py @@ -516,8 +516,8 @@ geometry_node_categories = [ NodeItem("GeometryNodeBoolean"), NodeItem("GeometryNodeTriangulate"), NodeItem("GeometryNodeEdgeSplit"), - NodeItem("GeometryNodeSubdivisionSurface"), - NodeItem("GeometryNodeSubdivisionSurfaceSimple"), + NodeItem("GeometryNodeSubdivideSmooth"), + NodeItem("GeometryNodeSubdivide"), ]), GeometryNodeCategory("GEO_POINT", "Point", items=[ NodeItem("GeometryNodePointDistribute"), diff --git a/source/blender/blenkernel/BKE_blender_version.h b/source/blender/blenkernel/BKE_blender_version.h index 66bfe620df7..133f1c5100a 100644 --- a/source/blender/blenkernel/BKE_blender_version.h +++ b/source/blender/blenkernel/BKE_blender_version.h @@ -39,7 +39,7 @@ extern "C" { /* Blender file format version. */ #define BLENDER_FILE_VERSION BLENDER_VERSION -#define BLENDER_FILE_SUBVERSION 10 +#define BLENDER_FILE_SUBVERSION 11 /* Minimum Blender version that supports reading file written with the current * version. Older Blender versions will test this and show a warning if the file diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h index 655c53455cc..f5f65e71f7f 100644 --- a/source/blender/blenkernel/BKE_node.h +++ b/source/blender/blenkernel/BKE_node.h @@ -1348,7 +1348,7 @@ int ntreeTexExecTree(struct bNodeTree *ntree, #define GEO_NODE_BOOLEAN 1003 #define GEO_NODE_POINT_DISTRIBUTE 1004 #define GEO_NODE_POINT_INSTANCE 1005 -#define GEO_NODE_SUBDIVISION_SURFACE 1006 +#define GEO_NODE_SUBDIVIDE_SMOOTH 1006 #define GEO_NODE_OBJECT_INFO 1007 #define GEO_NODE_ATTRIBUTE_RANDOMIZE 1008 #define GEO_NODE_ATTRIBUTE_MATH 1009 @@ -1371,7 +1371,7 @@ int ntreeTexExecTree(struct bNodeTree *ntree, #define GEO_NODE_VOLUME_TO_MESH 1026 #define GEO_NODE_ATTRIBUTE_COMBINE_XYZ 1027 #define GEO_NODE_ATTRIBUTE_SEPARATE_XYZ 1028 -#define GEO_NODE_SUBDIVISION_SURFACE_SIMPLE 1029 +#define GEO_NODE_SUBDIVIDE 1029 /** \} */ diff --git a/source/blender/blenkernel/intern/node.cc b/source/blender/blenkernel/intern/node.cc index c2ce52b1358..9615fbc31e7 100644 --- a/source/blender/blenkernel/intern/node.cc +++ b/source/blender/blenkernel/intern/node.cc @@ -4809,8 +4809,8 @@ static void registerGeometryNodes() register_node_type_geo_point_translate(); register_node_type_geo_points_to_volume(); register_node_type_geo_sample_texture(); - register_node_type_geo_subdivision_surface(); - register_node_type_geo_subdivision_surface_simple(); + register_node_type_geo_subdivide_smooth(); + register_node_type_geo_subdivide(); register_node_type_geo_transform(); register_node_type_geo_triangulate(); register_node_type_geo_volume_to_mesh(); diff --git a/source/blender/blenloader/intern/versioning_290.c b/source/blender/blenloader/intern/versioning_290.c index 1aa1f0302e3..8cf840f665b 100644 --- a/source/blender/blenloader/intern/versioning_290.c +++ b/source/blender/blenloader/intern/versioning_290.c @@ -1806,6 +1806,21 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain) } } + if (!MAIN_VERSION_ATLEAST(bmain, 293, 11)) { + LISTBASE_FOREACH (bNodeTree *, ntree, &bmain->nodetrees) { + if (ntree->type == NTREE_GEOMETRY) { + LISTBASE_FOREACH (bNode *, node, &ntree->nodes) { + if (STREQ(node->idname, "GeometryNodeSubdivisionSurfaceSimple")) { + STRNCPY(node->idname, "GeometryNodeSubdivide"); + } + if (STREQ(node->idname, "GeometryNodeSubdivisionSurface")) { + STRNCPY(node->idname, "GeometryNodeSubdivideSmooth"); + } + } + } + } + } + /** * Versioning code until next subversion bump goes here. * diff --git a/source/blender/nodes/CMakeLists.txt b/source/blender/nodes/CMakeLists.txt index 9386f686c73..d89cf2ecefa 100644 --- a/source/blender/nodes/CMakeLists.txt +++ b/source/blender/nodes/CMakeLists.txt @@ -168,8 +168,8 @@ set(SRC geometry/nodes/node_geo_point_separate.cc geometry/nodes/node_geo_point_translate.cc geometry/nodes/node_geo_points_to_volume.cc - geometry/nodes/node_geo_subdivision_surface.cc - geometry/nodes/node_geo_subdivision_surface_simple.cc + geometry/nodes/node_geo_subdivide_smooth.cc + geometry/nodes/node_geo_subdivide.cc geometry/nodes/node_geo_transform.cc geometry/nodes/node_geo_triangulate.cc geometry/nodes/node_geo_volume_to_mesh.cc diff --git a/source/blender/nodes/NOD_geometry.h b/source/blender/nodes/NOD_geometry.h index 3ee8067e81a..b094256190c 100644 --- a/source/blender/nodes/NOD_geometry.h +++ b/source/blender/nodes/NOD_geometry.h @@ -51,8 +51,8 @@ void register_node_type_geo_point_separate(void); void register_node_type_geo_point_translate(void); void register_node_type_geo_points_to_volume(void); void register_node_type_geo_sample_texture(void); -void register_node_type_geo_subdivision_surface(void); -void register_node_type_geo_subdivision_surface_simple(void); +void register_node_type_geo_subdivide_smooth(void); +void register_node_type_geo_subdivide(void); void register_node_type_geo_transform(void); void register_node_type_geo_triangulate(void); void register_node_type_geo_volume_to_mesh(void); diff --git a/source/blender/nodes/NOD_static_types.h b/source/blender/nodes/NOD_static_types.h index 35550bdec48..22204d7204e 100644 --- a/source/blender/nodes/NOD_static_types.h +++ b/source/blender/nodes/NOD_static_types.h @@ -272,7 +272,7 @@ DefNode(FunctionNode, FN_NODE_INPUT_STRING, def_fn_input_string, "INPUT_STRING", DefNode(GeometryNode, GEO_NODE_TRIANGULATE, def_geo_triangulate, "TRIANGULATE", Triangulate, "Triangulate", "") DefNode(GeometryNode, GEO_NODE_EDGE_SPLIT, 0, "EDGE_SPLIT", EdgeSplit, "Edge Split", "") DefNode(GeometryNode, GEO_NODE_TRANSFORM, 0, "TRANSFORM", Transform, "Transform", "") -DefNode(GeometryNode, GEO_NODE_SUBDIVISION_SURFACE, 0, "SUBDIVISION_SURFACE", SubdivisionSurface, "Subdivision Surface", "") +DefNode(GeometryNode, GEO_NODE_SUBDIVIDE_SMOOTH, 0, "SUBDIVIDE_SMOOTH", SubdivideSmooth, "Subdivide Smooth", "") DefNode(GeometryNode, GEO_NODE_BOOLEAN, def_geo_boolean, "BOOLEAN", Boolean, "Boolean", "") DefNode(GeometryNode, GEO_NODE_POINT_DISTRIBUTE, def_geo_point_distribute, "POINT_DISTRIBUTE", PointDistribute, "Point Distribute", "") DefNode(GeometryNode, GEO_NODE_POINT_INSTANCE, def_geo_point_instance, "POINT_INSTANCE", PointInstance, "Point Instance", "") @@ -298,7 +298,7 @@ DefNode(GeometryNode, GEO_NODE_ATTRIBUTE_PROXIMITY, def_geo_attribute_proximity, DefNode(GeometryNode, GEO_NODE_VOLUME_TO_MESH, def_geo_volume_to_mesh, "VOLUME_TO_MESH", VolumeToMesh, "Volume to Mesh", "") DefNode(GeometryNode, GEO_NODE_ATTRIBUTE_COMBINE_XYZ, def_geo_attribute_combine_xyz, "ATTRIBUTE_COMBINE_XYZ", AttributeCombineXYZ, "Attribute Combine XYZ", "") DefNode(GeometryNode, GEO_NODE_ATTRIBUTE_SEPARATE_XYZ, def_geo_attribute_separate_xyz, "ATTRIBUTE_SEPARATE_XYZ", AttributeSeparateXYZ, "Attribute Separate XYZ", "") -DefNode(GeometryNode, GEO_NODE_SUBDIVISION_SURFACE_SIMPLE, 0, "SUBDIVISION_SURFACE_SIMPLE", SubdivisionSurfaceSimple, "Simple Subdivision Surface", "") +DefNode(GeometryNode, GEO_NODE_SUBDIVIDE, 0, "SUBDIVIDE", Subdivide, "Subdivide", "") /* undefine macros */ #undef DefNode diff --git a/source/blender/nodes/geometry/nodes/node_geo_subdivision_surface_simple.cc b/source/blender/nodes/geometry/nodes/node_geo_subdivide.cc index 38560d277e3..b5731851229 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_subdivision_surface_simple.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_subdivide.cc @@ -25,20 +25,20 @@ #include "node_geometry_util.hh" -static bNodeSocketTemplate geo_node_subdivision_surface_simple_in[] = { +static bNodeSocketTemplate geo_node_subdivide_in[] = { {SOCK_GEOMETRY, N_("Geometry")}, {SOCK_INT, N_("Level"), 1, 0, 0, 0, 0, 6}, {-1, ""}, }; -static bNodeSocketTemplate geo_node_subdivision_surface_simple_out[] = { +static bNodeSocketTemplate geo_node_subdivide_out[] = { {SOCK_GEOMETRY, N_("Geometry")}, {-1, ""}, }; namespace blender::nodes { -static void geo_node_subdivision_surface_simple_exec(GeoNodeExecParams params) +static void geo_node_subdivide_exec(GeoNodeExecParams params) { GeometrySet geometry_set = params.extract_input<GeometrySet>("Geometry"); @@ -99,17 +99,12 @@ static void geo_node_subdivision_surface_simple_exec(GeoNodeExecParams params) } } // namespace blender::nodes -void register_node_type_geo_subdivision_surface_simple() +void register_node_type_geo_subdivide() { static bNodeType ntype; - geo_node_type_base(&ntype, - GEO_NODE_SUBDIVISION_SURFACE_SIMPLE, - "Simple Subdivision Surface", - NODE_CLASS_GEOMETRY, - 0); - node_type_socket_templates( - &ntype, geo_node_subdivision_surface_simple_in, geo_node_subdivision_surface_simple_out); - ntype.geometry_node_execute = blender::nodes::geo_node_subdivision_surface_simple_exec; + geo_node_type_base(&ntype, GEO_NODE_SUBDIVIDE, "Subdivide", NODE_CLASS_GEOMETRY, 0); + node_type_socket_templates(&ntype, geo_node_subdivide_in, geo_node_subdivide_out); + ntype.geometry_node_execute = blender::nodes::geo_node_subdivide_exec; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/geometry/nodes/node_geo_subdivision_surface.cc b/source/blender/nodes/geometry/nodes/node_geo_subdivide_smooth.cc index 47304a0de68..4d9b8110d65 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_subdivision_surface.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_subdivide_smooth.cc @@ -25,7 +25,7 @@ #include "node_geometry_util.hh" -static bNodeSocketTemplate geo_node_subdivision_surface_in[] = { +static bNodeSocketTemplate geo_node_subdivide_smooth_in[] = { {SOCK_GEOMETRY, N_("Geometry")}, {SOCK_INT, N_("Level"), 1, 0, 0, 0, 0, 6}, {SOCK_BOOLEAN, N_("Use Creases")}, @@ -34,14 +34,14 @@ static bNodeSocketTemplate geo_node_subdivision_surface_in[] = { {-1, ""}, }; -static bNodeSocketTemplate geo_node_subdivision_surface_out[] = { +static bNodeSocketTemplate geo_node_subdivide_smooth_out[] = { {SOCK_GEOMETRY, N_("Geometry")}, {-1, ""}, }; -static void geo_node_subdivision_surface_layout(uiLayout *layout, - bContext *UNUSED(C), - PointerRNA *UNUSED(ptr)) +static void geo_node_subdivide_smooth_layout(uiLayout *layout, + bContext *UNUSED(C), + PointerRNA *UNUSED(ptr)) { #ifndef WITH_OPENSUBDIV uiItemL(layout, IFACE_("Disabled, built without OpenSubdiv"), ICON_ERROR); @@ -51,7 +51,7 @@ static void geo_node_subdivision_surface_layout(uiLayout *layout, } namespace blender::nodes { -static void geo_node_subdivision_surface_exec(GeoNodeExecParams params) +static void geo_node_subdivide_smooth_exec(GeoNodeExecParams params) { GeometrySet geometry_set = params.extract_input<GeometrySet>("Geometry"); @@ -120,15 +120,14 @@ static void geo_node_subdivision_surface_exec(GeoNodeExecParams params) } } // namespace blender::nodes -void register_node_type_geo_subdivision_surface() +void register_node_type_geo_subdivide_smooth() { static bNodeType ntype; geo_node_type_base( - &ntype, GEO_NODE_SUBDIVISION_SURFACE, "Subdivision Surface", NODE_CLASS_GEOMETRY, 0); - node_type_socket_templates( - &ntype, geo_node_subdivision_surface_in, geo_node_subdivision_surface_out); - ntype.geometry_node_execute = blender::nodes::geo_node_subdivision_surface_exec; - ntype.draw_buttons = geo_node_subdivision_surface_layout; + &ntype, GEO_NODE_SUBDIVIDE_SMOOTH, "Subdivide Smooth", NODE_CLASS_GEOMETRY, 0); + node_type_socket_templates(&ntype, geo_node_subdivide_smooth_in, geo_node_subdivide_smooth_out); + ntype.geometry_node_execute = blender::nodes::geo_node_subdivide_smooth_exec; + ntype.draw_buttons = geo_node_subdivide_smooth_layout; nodeRegisterType(&ntype); } |