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/makesrna/intern/rna_attribute.c
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/makesrna/intern/rna_attribute.c')
-rw-r--r--source/blender/makesrna/intern/rna_attribute.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_attribute.c b/source/blender/makesrna/intern/rna_attribute.c
index a256002ffc1..b4ea70c33ab 100644
--- a/source/blender/makesrna/intern/rna_attribute.c
+++ b/source/blender/makesrna/intern/rna_attribute.c
@@ -162,6 +162,9 @@ const EnumPropertyItem *rna_enum_attribute_domain_itemf(ID *id, bool *r_free)
const ID_Type id_type = GS(id->name);
int totitem = 0, a;
+ static EnumPropertyItem mesh_vertex_domain_item = {
+ ATTR_DOMAIN_POINT, "POINT", 0, "Vertex", "Attribute per point/vertex"};
+
for (a = 0; rna_enum_attribute_domain_items[a].identifier; a++) {
domain_item = &rna_enum_attribute_domain_items[a];
@@ -175,7 +178,12 @@ const EnumPropertyItem *rna_enum_attribute_domain_itemf(ID *id, bool *r_free)
continue;
}
- RNA_enum_item_add(&item, &totitem, domain_item);
+ if (domain_item->value == ATTR_DOMAIN_POINT && id_type == ID_ME) {
+ RNA_enum_item_add(&item, &totitem, &mesh_vertex_domain_item);
+ }
+ else {
+ RNA_enum_item_add(&item, &totitem, domain_item);
+ }
}
RNA_enum_item_end(&item, &totitem);