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:
authorJacques Lucke <jacques@blender.org>2021-06-28 17:52:49 +0300
committerJacques Lucke <jacques@blender.org>2021-06-28 17:53:25 +0300
commit6ce4d39e6bd585257845e29a3de4eb278b941fd3 (patch)
tree951dbd289828c34f6723ef11fddd01d880aab360 /source/blender/editors/geometry
parent0afe4e81cbb2a0f8f26a2a5c2e5cb5e6c876f20e (diff)
Geometry Nodes: initial attribute list for meshes
This adds a new Attributes panel in the mesh properties editor. It shows a list of all the generic attributes on the mesh. In the future, we want to show built-in and other attributes in the list as well. Related technical design tasks: T88460, T89054. There is also a new simple name collision check that warns the user when there are multiple attributes with the same name. This can be problematic when the attribute is supposed to be used in geometry nodes or during rendering. Differential Revision: https://developer.blender.org/D11276
Diffstat (limited to 'source/blender/editors/geometry')
-rw-r--r--source/blender/editors/geometry/geometry_attributes.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/source/blender/editors/geometry/geometry_attributes.c b/source/blender/editors/geometry/geometry_attributes.c
index b2ecee90a57..9b034d82a51 100644
--- a/source/blender/editors/geometry/geometry_attributes.c
+++ b/source/blender/editors/geometry/geometry_attributes.c
@@ -109,14 +109,6 @@ void GEOMETRY_OT_attribute_add(wmOperatorType *ot)
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
prop = RNA_def_enum(ot->srna,
- "data_type",
- rna_enum_attribute_type_items,
- CD_PROP_FLOAT,
- "Data Type",
- "Type of data stored in attribute");
- RNA_def_property_flag(prop, PROP_SKIP_SAVE);
-
- prop = RNA_def_enum(ot->srna,
"domain",
rna_enum_attribute_domain_items,
ATTR_DOMAIN_POINT,
@@ -124,6 +116,14 @@ void GEOMETRY_OT_attribute_add(wmOperatorType *ot)
"Type of element that attribute is stored on");
RNA_def_enum_funcs(prop, geometry_attribute_domain_itemf);
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
+
+ prop = RNA_def_enum(ot->srna,
+ "data_type",
+ rna_enum_attribute_type_items,
+ CD_PROP_FLOAT,
+ "Data Type",
+ "Type of data stored in attribute");
+ RNA_def_property_flag(prop, PROP_SKIP_SAVE);
}
static int geometry_attribute_remove_exec(bContext *C, wmOperator *op)
@@ -140,6 +140,11 @@ static int geometry_attribute_remove_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
+ int *active_index = BKE_id_attributes_active_index_p(id);
+ if (*active_index > 0) {
+ *active_index -= 1;
+ }
+
DEG_id_tag_update(id, ID_RECALC_GEOMETRY);
WM_main_add_notifier(NC_GEOM | ND_DATA, id);