[Bf-blender-cvs] [9636e79c5a1] geometry-nodes-curve-support: Splines: Reset unecessary geometry nodes changes
Hans Goudey
noreply at git.blender.org
Sun Apr 25 22:01:27 CEST 2021
Commit: 9636e79c5a1b4fcf25c9a83a8f6cf5c8142fd328
Author: Hans Goudey
Date: Sun Apr 25 15:01:19 2021 -0500
Branches: geometry-nodes-curve-support
https://developer.blender.org/rB9636e79c5a1b4fcf25c9a83a8f6cf5c8142fd328
Splines: Reset unecessary geometry nodes changes
===================================================================
M source/blender/blenkernel/BKE_geometry_set.hh
M source/blender/blenkernel/intern/geometry_set.cc
M source/blender/functions/FN_generic_virtual_array.hh
M source/blender/nodes/geometry/nodes/node_geo_align_rotation_to_vector.cc
M source/blender/nodes/geometry/nodes/node_geo_attribute_clamp.cc
M source/blender/nodes/geometry/nodes/node_geo_attribute_color_ramp.cc
M source/blender/nodes/geometry/nodes/node_geo_attribute_combine_xyz.cc
M source/blender/nodes/geometry/nodes/node_geo_attribute_compare.cc
M source/blender/nodes/geometry/nodes/node_geo_attribute_convert.cc
M source/blender/nodes/geometry/nodes/node_geo_attribute_fill.cc
M source/blender/nodes/geometry/nodes/node_geo_attribute_map_range.cc
M source/blender/nodes/geometry/nodes/node_geo_attribute_math.cc
M source/blender/nodes/geometry/nodes/node_geo_attribute_mix.cc
M source/blender/nodes/geometry/nodes/node_geo_attribute_proximity.cc
M source/blender/nodes/geometry/nodes/node_geo_attribute_randomize.cc
M source/blender/nodes/geometry/nodes/node_geo_attribute_remove.cc
M source/blender/nodes/geometry/nodes/node_geo_attribute_sample_texture.cc
M source/blender/nodes/geometry/nodes/node_geo_attribute_separate_xyz.cc
M source/blender/nodes/geometry/nodes/node_geo_attribute_vector_math.cc
M source/blender/nodes/geometry/nodes/node_geo_join_geometry.cc
===================================================================
diff --git a/source/blender/blenkernel/BKE_geometry_set.hh b/source/blender/blenkernel/BKE_geometry_set.hh
index cfcd9d25638..78d63aa412c 100644
--- a/source/blender/blenkernel/BKE_geometry_set.hh
+++ b/source/blender/blenkernel/BKE_geometry_set.hh
@@ -349,7 +349,6 @@ struct GeometrySet {
void add(const GeometryComponent &component);
blender::Vector<const GeometryComponent *> get_components_for_read() const;
- blender::Vector<GeometryComponent *> get_components_for_write();
void compute_boundbox_without_instances(blender::float3 *r_min, blender::float3 *r_max) const;
diff --git a/source/blender/blenkernel/intern/geometry_set.cc b/source/blender/blenkernel/intern/geometry_set.cc
index 1493eedf01c..646afcc702f 100644
--- a/source/blender/blenkernel/intern/geometry_set.cc
+++ b/source/blender/blenkernel/intern/geometry_set.cc
@@ -171,19 +171,6 @@ Vector<const GeometryComponent *> GeometrySet::get_components_for_read() const
return components;
}
-/**
- * Get all geometry components in this geometry set.
- */
-Vector<GeometryComponent *> GeometrySet::get_components_for_write()
-{
- Vector<GeometryComponent *> components;
-
- for (const GeometryComponentType component_type : components_.keys()) {
- components.append(&this->get_component_for_write(component_type));
- }
- return components;
-}
-
void GeometrySet::compute_boundbox_without_instances(float3 *r_min, float3 *r_max) const
{
const PointCloud *pointcloud = this->get_pointcloud_for_read();
diff --git a/source/blender/functions/FN_generic_virtual_array.hh b/source/blender/functions/FN_generic_virtual_array.hh
index a7a13c02461..2a7d01a7423 100644
--- a/source/blender/functions/FN_generic_virtual_array.hh
+++ b/source/blender/functions/FN_generic_virtual_array.hh
@@ -642,7 +642,7 @@ class GVArray_For_EmbeddedVArray : public GVArray_For_VArray<T> {
public:
template<typename... Args>
- GVArray_For_EmbeddedVArray(const int64_t size, Args &&...args)
+ GVArray_For_EmbeddedVArray(const int64_t size, Args &&... args)
: GVArray_For_VArray<T>(size), embedded_varray_(std::forward<Args>(args)...)
{
this->varray_ = &embedded_varray_;
@@ -657,7 +657,7 @@ class GVMutableArray_For_EmbeddedVMutableArray : public GVMutableArray_For_VMuta
public:
template<typename... Args>
- GVMutableArray_For_EmbeddedVMutableArray(const int64_t size, Args &&...args)
+ GVMutableArray_For_EmbeddedVMutableArray(const int64_t size, Args &&... args)
: GVMutableArray_For_VMutableArray<T>(size), embedded_varray_(std::forward<Args>(args)...)
{
this->varray_ = &embedded_varray_;
diff --git a/source/blender/nodes/geometry/nodes/node_geo_align_rotation_to_vector.cc b/source/blender/nodes/geometry/nodes/node_geo_align_rotation_to_vector.cc
index 371740bfd7c..870d09da001 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_align_rotation_to_vector.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_align_rotation_to_vector.cc
@@ -176,8 +176,15 @@ static void geo_node_align_rotation_to_vector_exec(GeoNodeExecParams params)
geometry_set = geometry_set_realize_instances(geometry_set);
- for (GeometryComponent *component : geometry_set.get_components_for_write()) {
- align_rotations_on_component(*component, params);
+ if (geometry_set.has<MeshComponent>()) {
+ align_rotations_on_component(geometry_set.get_component_for_write<MeshComponent>(), params);
+ }
+ if (geometry_set.has<PointCloudComponent>()) {
+ align_rotations_on_component(geometry_set.get_component_for_write<PointCloudComponent>(),
+ params);
+ }
+ if (geometry_set.has<CurveComponent>()) {
+ align_rotations_on_component(geometry_set.get_component_for_write<CurveComponent>(), params);
}
params.set_output("Geometry", geometry_set);
diff --git a/source/blender/nodes/geometry/nodes/node_geo_attribute_clamp.cc b/source/blender/nodes/geometry/nodes/node_geo_attribute_clamp.cc
index b544c962849..21538db5455 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_attribute_clamp.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_attribute_clamp.cc
@@ -249,8 +249,14 @@ static void geo_node_attribute_clamp_exec(GeoNodeExecParams params)
geometry_set = geometry_set_realize_instances(geometry_set);
- for (GeometryComponent *component : geometry_set.get_components_for_write()) {
- clamp_attribute(*component, params);
+ if (geometry_set.has<MeshComponent>()) {
+ clamp_attribute(geometry_set.get_component_for_write<MeshComponent>(), params);
+ }
+ if (geometry_set.has<PointCloudComponent>()) {
+ clamp_attribute(geometry_set.get_component_for_write<PointCloudComponent>(), params);
+ }
+ if (geometry_set.has<CurveComponent>()) {
+ clamp_attribute(geometry_set.get_component_for_write<CurveComponent>(), params);
}
params.set_output("Geometry", geometry_set);
diff --git a/source/blender/nodes/geometry/nodes/node_geo_attribute_color_ramp.cc b/source/blender/nodes/geometry/nodes/node_geo_attribute_color_ramp.cc
index 6e41573470d..07f29b81bc5 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_attribute_color_ramp.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_attribute_color_ramp.cc
@@ -98,8 +98,14 @@ static void geo_node_attribute_color_ramp_exec(GeoNodeExecParams params)
geometry_set = geometry_set_realize_instances(geometry_set);
- for (GeometryComponent *component : geometry_set.get_components_for_write()) {
- execute_on_component(params, *component);
+ if (geometry_set.has<MeshComponent>()) {
+ execute_on_component(params, geometry_set.get_component_for_write<MeshComponent>());
+ }
+ if (geometry_set.has<PointCloudComponent>()) {
+ execute_on_component(params, geometry_set.get_component_for_write<PointCloudComponent>());
+ }
+ if (geometry_set.has<CurveComponent>()) {
+ execute_on_component(params, geometry_set.get_component_for_write<CurveComponent>());
}
params.set_output("Geometry", std::move(geometry_set));
diff --git a/source/blender/nodes/geometry/nodes/node_geo_attribute_combine_xyz.cc b/source/blender/nodes/geometry/nodes/node_geo_attribute_combine_xyz.cc
index 460db230fdb..d8c52d16f41 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_attribute_combine_xyz.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_attribute_combine_xyz.cc
@@ -121,8 +121,14 @@ static void geo_node_attribute_combine_xyz_exec(GeoNodeExecParams params)
geometry_set = geometry_set_realize_instances(geometry_set);
- for (GeometryComponent *component : geometry_set.get_components_for_write()) {
- combine_attributes(*component, params);
+ if (geometry_set.has<MeshComponent>()) {
+ combine_attributes(geometry_set.get_component_for_write<MeshComponent>(), params);
+ }
+ if (geometry_set.has<PointCloudComponent>()) {
+ combine_attributes(geometry_set.get_component_for_write<PointCloudComponent>(), params);
+ }
+ if (geometry_set.has<CurveComponent>()) {
+ combine_attributes(geometry_set.get_component_for_write<CurveComponent>(), params);
}
params.set_output("Geometry", geometry_set);
diff --git a/source/blender/nodes/geometry/nodes/node_geo_attribute_compare.cc b/source/blender/nodes/geometry/nodes/node_geo_attribute_compare.cc
index dfaeeaa85aa..a2ff1668a06 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_attribute_compare.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_attribute_compare.cc
@@ -328,8 +328,14 @@ static void geo_node_attribute_compare_exec(GeoNodeExecParams params)
geometry_set = geometry_set_realize_instances(geometry_set);
- for (GeometryComponent *component : geometry_set.get_components_for_write()) {
- attribute_compare_calc(*component, params);
+ if (geometry_set.has<MeshComponent>()) {
+ attribute_compare_calc(geometry_set.get_component_for_write<MeshComponent>(), params);
+ }
+ if (geometry_set.has<PointCloudComponent>()) {
+ attribute_compare_calc(geometry_set.get_component_for_write<PointCloudComponent>(), params);
+ }
+ if (geometry_set.has<CurveComponent>()) {
+ attribute_compare_calc(geometry_set.get_component_for_write<CurveComponent>(), params);
}
params.set_output("Geometry", geometry_set);
diff --git a/source/blender/nodes/geometry/nodes/node_geo_attribute_convert.cc b/source/blender/nodes/geometry/nodes/node_geo_attribute_convert.cc
index cfc8e5801fc..d084f806500 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_attribute_convert.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_attribute_convert.cc
@@ -147,8 +147,29 @@ static void geo_node_attribute_convert_exec(GeoNodeExecParams params)
return;
}
- for (GeometryComponent *component : geometry_set.get_components_for_write()) {
- attribute_convert_calc(*component, params, source_name, result_name, data_type, domain);
+ if (geometry_set.has<MeshComponent>()) {
+ attribute_convert_calc(geometry_set.get_component_for_write<MeshComponent>(),
+ params,
+ source_name,
+ result_name,
+ data_type,
+ domain);
+ }
+ if (geometry_set.has<PointCloudComponent>()) {
+ attribute_convert_calc(geometry_set.get_component_for_write<PointCloudComponent>(),
+ params,
+ source_name,
+ result_name,
+ data_type,
+ domain);
+ }
+ if (geometry_set.has<CurveComponent>()) {
+ attribute_convert_calc(geometry_set.get_component_for_write<CurveComponent>(),
+ params,
+ source_name,
+ result_name,
+ data_type,
+ domain);
}
params.set_output("Geometry", geometry_set);
diff --git a/source/blender/nodes/geometry/nodes/node_geo_attribute_fill.cc b/source/blender/nodes/geometry/nodes/node_geo_attribute_fill.cc
index dd77a8101b5..60522fd0f72 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_attribute_fill.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_attribute_fill.cc
@@ -137,8 +137,14 @@ static void geo_node_attrib
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list