Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/geometry/nodes/node_geo_attribute_remove.cc
| Show First 20 Lines • Show All 53 Lines • ▼ Show 20 Lines | static void geo_node_attribute_remove_exec(GeoNodeExecParams params) | ||||
| if (geometry_set.has<PointCloudComponent>()) { | if (geometry_set.has<PointCloudComponent>()) { | ||||
| remove_attribute( | remove_attribute( | ||||
| geometry_set.get_component_for_write<PointCloudComponent>(), params, attribute_names); | geometry_set.get_component_for_write<PointCloudComponent>(), params, attribute_names); | ||||
| } | } | ||||
| if (geometry_set.has<CurveComponent>()) { | if (geometry_set.has<CurveComponent>()) { | ||||
| remove_attribute( | remove_attribute( | ||||
| geometry_set.get_component_for_write<CurveComponent>(), params, attribute_names); | geometry_set.get_component_for_write<CurveComponent>(), params, attribute_names); | ||||
| } | } | ||||
| if (geometry_set.has<InstancesComponent>()) { | |||||
| remove_attribute( | |||||
| geometry_set.get_component_for_write<InstancesComponent>(), params, attribute_names); | |||||
| } | |||||
| params.set_output("Geometry", geometry_set); | params.set_output("Geometry", geometry_set); | ||||
| } | } | ||||
| } // namespace blender::nodes | } // namespace blender::nodes | ||||
| void register_node_type_geo_attribute_remove() | void register_node_type_geo_attribute_remove() | ||||
| { | { | ||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| geo_node_type_base( | geo_node_type_base( | ||||
| &ntype, GEO_NODE_ATTRIBUTE_REMOVE, "Attribute Remove", NODE_CLASS_ATTRIBUTE, 0); | &ntype, GEO_NODE_ATTRIBUTE_REMOVE, "Attribute Remove", NODE_CLASS_ATTRIBUTE, 0); | ||||
| ntype.geometry_node_execute = blender::nodes::geo_node_attribute_remove_exec; | ntype.geometry_node_execute = blender::nodes::geo_node_attribute_remove_exec; | ||||
| ntype.declare = blender::nodes::geo_node_attribute_remove_declare; | ntype.declare = blender::nodes::geo_node_attribute_remove_declare; | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||