Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2021-01-13 19:10:25 +0300
committerHans Goudey <h.goudey@me.com>2021-01-13 19:10:25 +0300
commit8df0268e2bac6fce22b1642555474fe8ccc8538d (patch)
treeec3328031432343f78ffd6a26c96c77f96701142 /source/blender
parent80578a9d54fbff72065fddb5ac61bc9c0288aebd (diff)
Geometry Nodes: Rename "Rotate Points" to "Point Rotate"
This is consistent with the other node names, giving (almost) all of the nodes in the "Point" category the same prefix.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenkernel/BKE_node.h2
-rw-r--r--source/blender/blenkernel/intern/node.c2
-rw-r--r--source/blender/editors/space_node/drawnode.c10
-rw-r--r--source/blender/makesdna/DNA_node_types.h8
-rw-r--r--source/blender/makesrna/intern/rna_nodetree.c10
-rw-r--r--source/blender/nodes/CMakeLists.txt2
-rw-r--r--source/blender/nodes/NOD_geometry.h2
-rw-r--r--source/blender/nodes/NOD_static_types.h2
-rw-r--r--source/blender/nodes/geometry/nodes/node_geo_point_rotate.cc (renamed from source/blender/nodes/geometry/nodes/node_geo_rotate_points.cc)83
9 files changed, 59 insertions, 62 deletions
diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h
index 869681775e4..b2a35fce0ca 100644
--- a/source/blender/blenkernel/BKE_node.h
+++ b/source/blender/blenkernel/BKE_node.h
@@ -1356,7 +1356,7 @@ int ntreeTexExecTree(struct bNodeTree *ntree,
#define GEO_NODE_ATTRIBUTE_COLOR_RAMP 1013
#define GEO_NODE_POINT_SEPARATE 1014
#define GEO_NODE_ATTRIBUTE_COMPARE 1015
-#define GEO_NODE_ROTATE_POINTS 1016
+#define GEO_NODE_POINT_ROTATE 1016
#define GEO_NODE_ATTRIBUTE_VECTOR_MATH 1017
#define GEO_NODE_ALIGN_ROTATION_TO_VECTOR 1018
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c
index c257a1182bc..f77d71023a5 100644
--- a/source/blender/blenkernel/intern/node.c
+++ b/source/blender/blenkernel/intern/node.c
@@ -4745,7 +4745,7 @@ static void registerGeometryNodes(void)
register_node_type_geo_join_geometry();
register_node_type_geo_attribute_mix();
register_node_type_geo_attribute_color_ramp();
- register_node_type_geo_rotate_points();
+ register_node_type_geo_point_rotate();
register_node_type_geo_align_rotation_to_vector();
}
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c
index bf38f6d606a..e30f10915f6 100644
--- a/source/blender/editors/space_node/drawnode.c
+++ b/source/blender/editors/space_node/drawnode.c
@@ -3246,9 +3246,7 @@ static void node_geometry_buts_attribute_color_ramp(uiLayout *layout,
uiTemplateColorRamp(layout, ptr, "color_ramp", 0);
}
-static void node_geometry_buts_rotate_points(uiLayout *layout,
- bContext *UNUSED(C),
- PointerRNA *ptr)
+static void node_geometry_buts_point_rotate(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
NodeGeometryRotatePoints *storage = (NodeGeometryRotatePoints *)((bNode *)ptr->data)->storage;
@@ -3256,7 +3254,7 @@ static void node_geometry_buts_rotate_points(uiLayout *layout,
uiItemR(layout, ptr, "space", DEFAULT_FLAGS | UI_ITEM_R_EXPAND, NULL, ICON_NONE);
uiLayout *col = uiLayoutColumn(layout, false);
- if (storage->type == GEO_NODE_ROTATE_POINTS_TYPE_AXIS_ANGLE) {
+ if (storage->type == GEO_NODE_POINT_ROTATE_TYPE_AXIS_ANGLE) {
uiItemR(col, ptr, "input_type_axis", DEFAULT_FLAGS, IFACE_("Axis"), ICON_NONE);
uiItemR(col, ptr, "input_type_angle", DEFAULT_FLAGS, IFACE_("Angle"), ICON_NONE);
}
@@ -3314,8 +3312,8 @@ static void node_geometry_set_butfunc(bNodeType *ntype)
case GEO_NODE_ATTRIBUTE_COLOR_RAMP:
ntype->draw_buttons = node_geometry_buts_attribute_color_ramp;
break;
- case GEO_NODE_ROTATE_POINTS:
- ntype->draw_buttons = node_geometry_buts_rotate_points;
+ case GEO_NODE_POINT_ROTATE:
+ ntype->draw_buttons = node_geometry_buts_point_rotate;
break;
case GEO_NODE_ALIGN_ROTATION_TO_VECTOR:
ntype->draw_buttons = node_geometry_buts_align_rotation_to_vector;
diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h
index 3da0409447b..c3c22b1e853 100644
--- a/source/blender/makesdna/DNA_node_types.h
+++ b/source/blender/makesdna/DNA_node_types.h
@@ -1579,13 +1579,13 @@ typedef enum GeometryNodePointDistributeMethod {
} GeometryNodePointDistributeMethod;
typedef enum GeometryNodeRotatePointsType {
- GEO_NODE_ROTATE_POINTS_TYPE_EULER = 0,
- GEO_NODE_ROTATE_POINTS_TYPE_AXIS_ANGLE = 1,
+ GEO_NODE_POINT_ROTATE_TYPE_EULER = 0,
+ GEO_NODE_POINT_ROTATE_TYPE_AXIS_ANGLE = 1,
} GeometryNodeRotatePointsType;
typedef enum GeometryNodeRotatePointsSpace {
- GEO_NODE_ROTATE_POINTS_SPACE_OBJECT = 0,
- GEO_NODE_ROTATE_POINTS_SPACE_POINT = 1,
+ GEO_NODE_POINT_ROTATE_SPACE_OBJECT = 0,
+ GEO_NODE_POINT_ROTATE_SPACE_POINT = 1,
} GeometryNodeRotatePointsSpace;
typedef enum GeometryNodeAlignRotationToVectorAxis {
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index 1f6359c2ed4..48821156b82 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -8721,15 +8721,15 @@ static void def_geo_attribute_color_ramp(StructRNA *srna)
RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
}
-static void def_geo_rotate_points(StructRNA *srna)
+static void def_geo_point_rotate(StructRNA *srna)
{
static const EnumPropertyItem type_items[] = {
- {GEO_NODE_ROTATE_POINTS_TYPE_AXIS_ANGLE,
+ {GEO_NODE_POINT_ROTATE_TYPE_AXIS_ANGLE,
"AXIS_ANGLE",
ICON_NONE,
"Axis Angle",
"Rotate around an axis by an angle"},
- {GEO_NODE_ROTATE_POINTS_TYPE_EULER,
+ {GEO_NODE_POINT_ROTATE_TYPE_EULER,
"EULER",
ICON_NONE,
"Euler",
@@ -8738,12 +8738,12 @@ static void def_geo_rotate_points(StructRNA *srna)
};
static const EnumPropertyItem space_items[] = {
- {GEO_NODE_ROTATE_POINTS_SPACE_OBJECT,
+ {GEO_NODE_POINT_ROTATE_SPACE_OBJECT,
"OBJECT",
ICON_NONE,
"Object",
"Rotate points in the local space of the object"},
- {GEO_NODE_ROTATE_POINTS_SPACE_POINT,
+ {GEO_NODE_POINT_ROTATE_SPACE_POINT,
"POINT",
ICON_NONE,
"Point",
diff --git a/source/blender/nodes/CMakeLists.txt b/source/blender/nodes/CMakeLists.txt
index d72189636e4..19c95d3373d 100644
--- a/source/blender/nodes/CMakeLists.txt
+++ b/source/blender/nodes/CMakeLists.txt
@@ -156,7 +156,7 @@ set(SRC
geometry/nodes/node_geo_point_distribute.cc
geometry/nodes/node_geo_point_instance.cc
geometry/nodes/node_geo_point_separate.cc
- geometry/nodes/node_geo_rotate_points.cc
+ geometry/nodes/node_geo_point_rotate.cc
geometry/nodes/node_geo_subdivision_surface.cc
geometry/nodes/node_geo_transform.cc
geometry/nodes/node_geo_triangulate.cc
diff --git a/source/blender/nodes/NOD_geometry.h b/source/blender/nodes/NOD_geometry.h
index 4cd9bce1b9d..22f04356426 100644
--- a/source/blender/nodes/NOD_geometry.h
+++ b/source/blender/nodes/NOD_geometry.h
@@ -43,7 +43,7 @@ void register_node_type_geo_point_separate(void);
void register_node_type_geo_attribute_compare(void);
void register_node_type_geo_attribute_mix(void);
void register_node_type_geo_attribute_color_ramp(void);
-void register_node_type_geo_rotate_points(void);
+void register_node_type_geo_point_rotate(void);
void register_node_type_geo_align_rotation_to_vector(void);
#ifdef __cplusplus
diff --git a/source/blender/nodes/NOD_static_types.h b/source/blender/nodes/NOD_static_types.h
index 8eeb179ed0d..07a377dbdf6 100644
--- a/source/blender/nodes/NOD_static_types.h
+++ b/source/blender/nodes/NOD_static_types.h
@@ -284,7 +284,7 @@ DefNode(GeometryNode, GEO_NODE_ATTRIBUTE_MIX, def_geo_attribute_mix, "ATTRIBUTE_
DefNode(GeometryNode, GEO_NODE_ATTRIBUTE_COLOR_RAMP, def_geo_attribute_color_ramp, "ATTRIBUTE_COLOR_RAMP", AttributeColorRamp, "Attribute Color Ramp", "")
DefNode(GeometryNode, GEO_NODE_POINT_SEPARATE, 0, "POINT_SEPARATE", PointSeparate, "Point Separate", "")
DefNode(GeometryNode, GEO_NODE_ATTRIBUTE_COMPARE, def_geo_attribute_attribute_compare, "ATTRIBUTE_COMPARE", AttributeCompare, "Attribute Compare", "")
-DefNode(GeometryNode, GEO_NODE_ROTATE_POINTS, def_geo_rotate_points, "ROTATE_POINTS", RotatePoints, "Rotate Points", "")
+DefNode(GeometryNode, GEO_NODE_POINT_ROTATE, def_geo_point_rotate, "POINT_ROTATE", RotatePoints, "Point Rotate", "")
DefNode(GeometryNode, GEO_NODE_ATTRIBUTE_VECTOR_MATH, def_geo_attribute_vector_math, "ATTRIBUTE_VECTOR_MATH", AttributeVectorMath, "Attribute Vector Math", "")
DefNode(GeometryNode, GEO_NODE_ALIGN_ROTATION_TO_VECTOR, def_geo_align_rotation_to_vector, "ALIGN_ROTATION_TO_VECTOR", AlignRotationToVector, "Align Rotation to Vector", "")
diff --git a/source/blender/nodes/geometry/nodes/node_geo_rotate_points.cc b/source/blender/nodes/geometry/nodes/node_geo_point_rotate.cc
index 1272e36a216..f22036ffe62 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_rotate_points.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_point_rotate.cc
@@ -18,7 +18,7 @@
#include "BLI_math_rotation.h"
-static bNodeSocketTemplate geo_node_rotate_points_in[] = {
+static bNodeSocketTemplate geo_node_point_rotate_in[] = {
{SOCK_GEOMETRY, N_("Geometry")},
{SOCK_STRING, N_("Axis")},
{SOCK_VECTOR, N_("Axis"), 0.0, 0.0, 1.0, 0.0, -FLT_MAX, FLT_MAX, PROP_XYZ},
@@ -29,17 +29,17 @@ static bNodeSocketTemplate geo_node_rotate_points_in[] = {
{-1, ""},
};
-static bNodeSocketTemplate geo_node_rotate_points_out[] = {
+static bNodeSocketTemplate geo_node_point_rotate_out[] = {
{SOCK_GEOMETRY, N_("Geometry")},
{-1, ""},
};
namespace blender::nodes {
-static void rotate_points__axis_angle__object_space(const int domain_size,
- const Float3ReadAttribute &axis,
- const FloatReadAttribute &angles,
- MutableSpan<float3> rotations)
+static void point_rotate__axis_angle__object_space(const int domain_size,
+ const Float3ReadAttribute &axis,
+ const FloatReadAttribute &angles,
+ MutableSpan<float3> rotations)
{
for (const int i : IndexRange(domain_size)) {
float old_rotation[3][3];
@@ -52,10 +52,10 @@ static void rotate_points__axis_angle__object_space(const int domain_size,
}
}
-static void rotate_points__axis_angle__point_space(const int domain_size,
- const Float3ReadAttribute &axis,
- const FloatReadAttribute &angles,
- MutableSpan<float3> rotations)
+static void point_rotate__axis_angle__point_space(const int domain_size,
+ const Float3ReadAttribute &axis,
+ const FloatReadAttribute &angles,
+ MutableSpan<float3> rotations)
{
for (const int i : IndexRange(domain_size)) {
float old_rotation[3][3];
@@ -68,9 +68,9 @@ static void rotate_points__axis_angle__point_space(const int domain_size,
}
}
-static void rotate_points__euler__object_space(const int domain_size,
- const Float3ReadAttribute &eulers,
- MutableSpan<float3> rotations)
+static void point_rotate__euler__object_space(const int domain_size,
+ const Float3ReadAttribute &eulers,
+ MutableSpan<float3> rotations)
{
for (const int i : IndexRange(domain_size)) {
float old_rotation[3][3];
@@ -83,9 +83,9 @@ static void rotate_points__euler__object_space(const int domain_size,
}
}
-static void rotate_points__euler__point_space(const int domain_size,
- const Float3ReadAttribute &eulers,
- MutableSpan<float3> rotations)
+static void point_rotate__euler__point_space(const int domain_size,
+ const Float3ReadAttribute &eulers,
+ MutableSpan<float3> rotations)
{
for (const int i : IndexRange(domain_size)) {
float old_rotation[3][3];
@@ -98,8 +98,8 @@ static void rotate_points__euler__point_space(const int domain_size,
}
}
-static void rotate_points_on_component(GeometryComponent &component,
- const GeoNodeExecParams &params)
+static void point_rotate_on_component(GeometryComponent &component,
+ const GeoNodeExecParams &params)
{
const bNode &node = params.node();
const NodeGeometryRotatePoints &storage = *(const NodeGeometryRotatePoints *)node.storage;
@@ -113,56 +113,55 @@ static void rotate_points_on_component(GeometryComponent &component,
MutableSpan<float3> rotations = rotation_attribute->get_span().typed<float3>();
const int domain_size = rotations.size();
- if (storage.type == GEO_NODE_ROTATE_POINTS_TYPE_AXIS_ANGLE) {
+ if (storage.type == GEO_NODE_POINT_ROTATE_TYPE_AXIS_ANGLE) {
Float3ReadAttribute axis = params.get_input_attribute<float3>(
"Axis", component, ATTR_DOMAIN_POINT, {0, 0, 1});
FloatReadAttribute angles = params.get_input_attribute<float>(
"Angle", component, ATTR_DOMAIN_POINT, 0);
- if (storage.space == GEO_NODE_ROTATE_POINTS_SPACE_OBJECT) {
- rotate_points__axis_angle__object_space(domain_size, axis, angles, rotations);
+ if (storage.space == GEO_NODE_POINT_ROTATE_SPACE_OBJECT) {
+ point_rotate__axis_angle__object_space(domain_size, axis, angles, rotations);
}
else {
- rotate_points__axis_angle__point_space(domain_size, axis, angles, rotations);
+ point_rotate__axis_angle__point_space(domain_size, axis, angles, rotations);
}
}
else {
Float3ReadAttribute eulers = params.get_input_attribute<float3>(
"Rotation", component, ATTR_DOMAIN_POINT, {0, 0, 0});
- if (storage.space == GEO_NODE_ROTATE_POINTS_SPACE_OBJECT) {
- rotate_points__euler__object_space(domain_size, eulers, rotations);
+ if (storage.space == GEO_NODE_POINT_ROTATE_SPACE_OBJECT) {
+ point_rotate__euler__object_space(domain_size, eulers, rotations);
}
else {
- rotate_points__euler__point_space(domain_size, eulers, rotations);
+ point_rotate__euler__point_space(domain_size, eulers, rotations);
}
}
rotation_attribute->apply_span();
}
-static void geo_node_rotate_points_exec(GeoNodeExecParams params)
+static void geo_node_point_rotate_exec(GeoNodeExecParams params)
{
GeometrySet geometry_set = params.extract_input<GeometrySet>("Geometry");
if (geometry_set.has<MeshComponent>()) {
- rotate_points_on_component(geometry_set.get_component_for_write<MeshComponent>(), params);
+ point_rotate_on_component(geometry_set.get_component_for_write<MeshComponent>(), params);
}
if (geometry_set.has<PointCloudComponent>()) {
- rotate_points_on_component(geometry_set.get_component_for_write<PointCloudComponent>(),
- params);
+ point_rotate_on_component(geometry_set.get_component_for_write<PointCloudComponent>(), params);
}
params.set_output("Geometry", geometry_set);
}
-static void geo_node_rotate_points_init(bNodeTree *UNUSED(ntree), bNode *node)
+static void geo_node_point_rotate_init(bNodeTree *UNUSED(ntree), bNode *node)
{
NodeGeometryRotatePoints *node_storage = (NodeGeometryRotatePoints *)MEM_callocN(
sizeof(NodeGeometryRotatePoints), __func__);
- node_storage->type = GEO_NODE_ROTATE_POINTS_TYPE_EULER;
- node_storage->space = GEO_NODE_ROTATE_POINTS_SPACE_OBJECT;
+ node_storage->type = GEO_NODE_POINT_ROTATE_TYPE_EULER;
+ node_storage->space = GEO_NODE_POINT_ROTATE_SPACE_OBJECT;
node_storage->input_type_axis = GEO_NODE_ATTRIBUTE_INPUT_VECTOR;
node_storage->input_type_angle = GEO_NODE_ATTRIBUTE_INPUT_FLOAT;
node_storage->input_type_rotation = GEO_NODE_ATTRIBUTE_INPUT_VECTOR;
@@ -170,38 +169,38 @@ static void geo_node_rotate_points_init(bNodeTree *UNUSED(ntree), bNode *node)
node->storage = node_storage;
}
-static void geo_node_rotate_points_update(bNodeTree *UNUSED(ntree), bNode *node)
+static void geo_node_point_rotate_update(bNodeTree *UNUSED(ntree), bNode *node)
{
NodeGeometryRotatePoints *node_storage = (NodeGeometryRotatePoints *)node->storage;
update_attribute_input_socket_availabilities(
*node,
"Axis",
(GeometryNodeAttributeInputMode)node_storage->input_type_axis,
- node_storage->type == GEO_NODE_ROTATE_POINTS_TYPE_AXIS_ANGLE);
+ node_storage->type == GEO_NODE_POINT_ROTATE_TYPE_AXIS_ANGLE);
update_attribute_input_socket_availabilities(
*node,
"Angle",
(GeometryNodeAttributeInputMode)node_storage->input_type_angle,
- node_storage->type == GEO_NODE_ROTATE_POINTS_TYPE_AXIS_ANGLE);
+ node_storage->type == GEO_NODE_POINT_ROTATE_TYPE_AXIS_ANGLE);
update_attribute_input_socket_availabilities(
*node,
"Rotation",
(GeometryNodeAttributeInputMode)node_storage->input_type_rotation,
- node_storage->type == GEO_NODE_ROTATE_POINTS_TYPE_EULER);
+ node_storage->type == GEO_NODE_POINT_ROTATE_TYPE_EULER);
}
} // namespace blender::nodes
-void register_node_type_geo_rotate_points()
+void register_node_type_geo_point_rotate()
{
static bNodeType ntype;
- geo_node_type_base(&ntype, GEO_NODE_ROTATE_POINTS, "Rotate Points", NODE_CLASS_GEOMETRY, 0);
- node_type_socket_templates(&ntype, geo_node_rotate_points_in, geo_node_rotate_points_out);
- node_type_init(&ntype, blender::nodes::geo_node_rotate_points_init);
- node_type_update(&ntype, blender::nodes::geo_node_rotate_points_update);
+ geo_node_type_base(&ntype, GEO_NODE_POINT_ROTATE, "Point Rotate", NODE_CLASS_GEOMETRY, 0);
+ node_type_socket_templates(&ntype, geo_node_point_rotate_in, geo_node_point_rotate_out);
+ node_type_init(&ntype, blender::nodes::geo_node_point_rotate_init);
+ node_type_update(&ntype, blender::nodes::geo_node_point_rotate_update);
node_type_storage(
&ntype, "NodeGeometryRotatePoints", node_free_standard_storage, node_copy_standard_storage);
- ntype.geometry_node_execute = blender::nodes::geo_node_rotate_points_exec;
+ ntype.geometry_node_execute = blender::nodes::geo_node_point_rotate_exec;
nodeRegisterType(&ntype);
}