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:
authorBrecht Van Lommel <brecht@blender.org>2020-08-19 19:12:52 +0300
committerBrecht Van Lommel <brecht@blender.org>2020-09-09 18:01:17 +0300
commit370d6e50252b979433f27959070315911cc340e5 (patch)
treef270972dd522a928e74b23334bb91a1cf174382f /source/blender/makesrna/intern/rna_attribute.c
parenta1397a3cc69382a64ab97bb71e4769fc0add0791 (diff)
Geometry: add Attributes panel for PointCloud and Hair
There is a list of attributes, along with operators to add and remove attributes. For adding, there are a few standard attributes that can be added quickly, as well as a popup to create a custom attribute. Ref T76659 Differential Revision: https://developer.blender.org/D8636
Diffstat (limited to 'source/blender/makesrna/intern/rna_attribute.c')
-rw-r--r--source/blender/makesrna/intern/rna_attribute.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/source/blender/makesrna/intern/rna_attribute.c b/source/blender/makesrna/intern/rna_attribute.c
index baa6e6135de..9e9575344c5 100644
--- a/source/blender/makesrna/intern/rna_attribute.c
+++ b/source/blender/makesrna/intern/rna_attribute.c
@@ -37,7 +37,7 @@
#include "WM_types.h"
-static const EnumPropertyItem rna_enum_attribute_type_items[] = {
+const EnumPropertyItem rna_enum_attribute_type_items[] = {
{CD_PROP_FLOAT, "FLOAT", 0, "Float", "Floating point value"},
{CD_PROP_INT32, "INT", 0, "Integer", "32 bit integer"},
{CD_PROP_FLOAT3, "FLOAT_VECTOR", 0, "Vector", "3D vector with floating point values"},
@@ -47,7 +47,7 @@ static const EnumPropertyItem rna_enum_attribute_type_items[] = {
{0, NULL, 0, NULL, NULL},
};
-static const EnumPropertyItem rna_enum_attribute_domain_items[] = {
+const EnumPropertyItem rna_enum_attribute_domain_items[] = {
/* Not implement yet
{ATTR_DOMAIN_GEOMETRY, "GEOMETRY", 0, "Geometry", "Attribute on (whole) geometry"}, */
{ATTR_DOMAIN_VERTEX, "VERTEX", 0, "Vertex", "Attribute on mesh vertex"},
@@ -101,14 +101,10 @@ static int rna_Attribute_type_get(PointerRNA *ptr)
return layer->type;
}
-static const EnumPropertyItem *rna_Attribute_domain_itemf(bContext *UNUSED(C),
- PointerRNA *ptr,
- PropertyRNA *UNUSED(prop),
- bool *r_free)
+const EnumPropertyItem *rna_enum_attribute_domain_itemf(ID *id, bool *r_free)
{
EnumPropertyItem *item = NULL;
const EnumPropertyItem *domain_item = NULL;
- ID *id = ptr->owner_id;
const ID_Type id_type = GS(id->name);
int totitem = 0, a;
@@ -133,6 +129,14 @@ static const EnumPropertyItem *rna_Attribute_domain_itemf(bContext *UNUSED(C),
return item;
}
+static const EnumPropertyItem *rna_Attribute_domain_itemf(bContext *UNUSED(C),
+ PointerRNA *ptr,
+ PropertyRNA *UNUSED(prop),
+ bool *r_free)
+{
+ return rna_enum_attribute_domain_itemf(ptr->owner_id, r_free);
+}
+
static int rna_Attribute_domain_get(PointerRNA *ptr)
{
return BKE_id_attribute_domain(ptr->owner_id, ptr->data);
@@ -617,7 +621,7 @@ static void rna_def_attribute_group(BlenderRNA *brna)
rna_enum_attribute_domain_items,
ATTR_DOMAIN_VERTEX,
"Domain",
- "Attribute domain");
+ "Type of element that attribute is stored on");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
parm = RNA_def_pointer(func, "attribute", "Attribute", "", "New geometry attribute");
RNA_def_parameter_flags(parm, 0, PARM_RNAPTR);