[Bf-blender-cvs] [2d8db0d] master: Docs: explain some details of RNA enums

Campbell Barton noreply at git.blender.org
Sun May 8 18:32:17 CEST 2016


Commit: 2d8db0de79157975f710eece613da275d7b4036e
Author: Campbell Barton
Date:   Mon May 9 02:32:54 2016 +1000
Branches: master
https://developer.blender.org/rB2d8db0de79157975f710eece613da275d7b4036e

Docs: explain some details of RNA enums

===================================================================

M	source/blender/makesrna/RNA_types.h

===================================================================

diff --git a/source/blender/makesrna/RNA_types.h b/source/blender/makesrna/RNA_types.h
index 04a2361..d8bea93 100644
--- a/source/blender/makesrna/RNA_types.h
+++ b/source/blender/makesrna/RNA_types.h
@@ -301,11 +301,25 @@ typedef struct RawArray {
 	int stride;
 } RawArray;
 
+/**
+ * This struct is are typically defined in arrays which define an *enum* for RNA,
+ * which is used by the RNA API both for user-interface and the Python API.
+ */
 typedef struct EnumPropertyItem {
+	/** The internal value of the enum, not exposed to users. */
 	int value;
+	/**
+	 * Note that identifiers must be unique within the array,
+	 * by convention they're upper case with underscores for separators.
+	 * - An empty string is used to define menu separators.
+	 * - NULL denotes the end of the array of items.
+	 */
 	const char *identifier;
+	/** Optional icon, typically 'ICON_NONE' */
 	int icon;
+	/** Name displayed in the interface. */
 	const char *name;
+	/** Longer description used in the interface. */
 	const char *description;
 } EnumPropertyItem;




More information about the Bf-blender-cvs mailing list