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 <brechtvanlommel@pandora.be>2008-11-14 20:05:25 +0300
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2008-11-14 20:05:25 +0300
commita2175968a7a21bd09463ac9582130c593d27094d (patch)
tree26456772fb769aa67a9bc381908eb277bc76a097 /source/blender/makesrna/intern
parent4a8e571e8d3b5a4f8d223d40594b1be96206a141 (diff)
RNA
* Added RNA list viewer. This is currently drawn in the outliner window, the UI is limited but it is just intended to test RNA at the moment. * Added UI names for currently wrapped properties. * Made iterating collections a bit more convenient.
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r--source/blender/makesrna/intern/rna_access.c75
-rw-r--r--source/blender/makesrna/intern/rna_define.c5
-rw-r--r--source/blender/makesrna/intern/rna_main.c61
-rw-r--r--source/blender/makesrna/intern/rna_mesh.c4
-rw-r--r--source/blender/makesrna/intern/rna_object.c7
-rw-r--r--source/blender/makesrna/intern/rna_rna.c75
6 files changed, 134 insertions, 93 deletions
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index 9304618f596..afb83e97d33 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -355,51 +355,61 @@ StructRNA *RNA_property_pointer_type(PropertyRNA *prop, PointerRNA *ptr)
return pprop->structtype;
}
-void RNA_property_collection_begin(PropertyRNA *prop, CollectionPropertyIterator *iter, PointerRNA *ptr)
+static StructRNA *rna_property_collection_type(PropertyRNA *prop, CollectionPropertyIterator *iter)
{
CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop;
- iter->pointer= *ptr;
- cprop->begin(iter, ptr);
+ if(cprop->type)
+ return cprop->type(iter);
+
+ return cprop->structtype;
}
-void RNA_property_collection_next(PropertyRNA *prop, CollectionPropertyIterator *iter)
+static void rna_property_collection_get(PropertyRNA *prop, CollectionPropertyIterator *iter, PointerRNA *r_ptr)
{
CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop;
- cprop->next(iter);
+ r_ptr->data= cprop->get(iter);
+
+ if(r_ptr->data) {
+ r_ptr->type= rna_property_collection_type(prop, iter);
+ rna_pointer_inherit_id(&iter->parent, r_ptr);
+ }
+ else
+ memset(r_ptr, 0, sizeof(*r_ptr));
}
-void RNA_property_collection_end(PropertyRNA *prop, CollectionPropertyIterator *iter)
+void RNA_property_collection_begin(PropertyRNA *prop, CollectionPropertyIterator *iter, PointerRNA *ptr)
{
CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop;
- if(cprop->end)
- cprop->end(iter);
+ iter->parent= *ptr;
+ cprop->begin(iter, ptr);
+
+ if(iter->valid)
+ rna_property_collection_get(prop, iter, &iter->ptr);
+ else
+ memset(&iter->ptr, 0, sizeof(iter->ptr));
}
-void RNA_property_collection_get(PropertyRNA *prop, CollectionPropertyIterator *iter, PointerRNA *r_ptr)
+void RNA_property_collection_next(PropertyRNA *prop, CollectionPropertyIterator *iter)
{
CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop;
- r_ptr->data= cprop->get(iter);
+ cprop->next(iter);
- if(r_ptr->data) {
- r_ptr->type= RNA_property_collection_type(prop, iter);
- rna_pointer_inherit_id(&iter->pointer, r_ptr);
- }
+ if(iter->valid)
+ rna_property_collection_get(prop, iter, &iter->ptr);
else
- memset(r_ptr, 0, sizeof(*r_ptr));
+ memset(&iter->ptr, 0, sizeof(iter->ptr));
}
-StructRNA *RNA_property_collection_type(PropertyRNA *prop, CollectionPropertyIterator *iter)
+void RNA_property_collection_end(PropertyRNA *prop, CollectionPropertyIterator *iter)
{
CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop;
- if(cprop->type)
- return cprop->type(iter);
-
- return cprop->structtype;
+ if(cprop->end)
+ cprop->end(iter);
}
int RNA_property_collection_length(PropertyRNA *prop, PointerRNA *ptr)
@@ -451,7 +461,7 @@ int RNA_property_collection_lookup_int(PropertyRNA *prop, PointerRNA *ptr, int k
RNA_property_collection_begin(prop, &iter, ptr);
for(i=0; iter.valid; RNA_property_collection_next(prop, &iter), i++) {
if(i == key) {
- RNA_property_collection_get(prop, &iter, r_ptr);
+ *r_ptr= iter.ptr;
break;
}
}
@@ -488,18 +498,15 @@ int RNA_property_collection_lookup_string(PropertyRNA *prop, PointerRNA *ptr, co
/* no callback defined, compare with name properties if they exist */
CollectionPropertyIterator iter;
PropertyRNA *nameprop;
- PointerRNA iterptr;
char name[256], *nameptr;
int length, alloc, found= 0;
RNA_property_collection_begin(prop, &iter, ptr);
for(; iter.valid; RNA_property_collection_next(prop, &iter)) {
- RNA_property_collection_get(prop, &iter, &iterptr);
-
- if(iterptr.data && iterptr.type->nameproperty) {
- nameprop= iterptr.type->nameproperty;
+ if(iter.ptr.data && iter.ptr.type->nameproperty) {
+ nameprop= iter.ptr.type->nameproperty;
- length= RNA_property_string_length(nameprop, &iterptr);
+ length= RNA_property_string_length(nameprop, &iter.ptr);
if(sizeof(name)-1 < length) {
nameptr= name;
@@ -510,10 +517,10 @@ int RNA_property_collection_lookup_string(PropertyRNA *prop, PointerRNA *ptr, co
alloc= 1;
}
- RNA_property_string_get(nameprop, &iterptr, nameptr);
+ RNA_property_string_get(nameprop, &iter.ptr, nameptr);
if(strcmp(nameptr, key) == 0) {
- *r_ptr= iterptr;
+ *r_ptr= iter.ptr;
found= 1;
}
@@ -670,14 +677,8 @@ int RNA_path_resolve(PointerRNA *ptr, const char *path, PointerRNA *r_ptr, Prope
prop= NULL;
for(; iter.valid; RNA_property_collection_next(iterprop, &iter)) {
- PointerRNA cptr;
- PropertyRNA *cprop;
-
- RNA_property_collection_get(iterprop, &iter, &cptr);
- cprop= cptr.data;
-
- if(strcmp(token, cprop->cname) == 0) {
- prop= cprop;
+ if(strcmp(token, RNA_property_cname(iter.ptr.data, &iter.ptr)) == 0) {
+ prop= iter.ptr.data;
break;
}
}
diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c
index 003773381c9..8e16c422409 100644
--- a/source/blender/makesrna/intern/rna_define.c
+++ b/source/blender/makesrna/intern/rna_define.c
@@ -272,6 +272,7 @@ PropertyRNA *RNA_def_property(StructRNA *srna, const char *cname, int type, int
iprop->softmin= (subtype == PROP_UNSIGNED)? 0: -10000; /* rather arbitrary .. */
iprop->softmax= 10000;
+ iprop->step= 1;
break;
}
case PROP_FLOAT: {
@@ -284,6 +285,8 @@ PropertyRNA *RNA_def_property(StructRNA *srna, const char *cname, int type, int
fprop->softmin= (subtype == PROP_UNSIGNED)? 0.0f: -10000.0f; /* rather arbitrary .. */
fprop->softmax= 10000.0f;
+ fprop->step= 10;
+ fprop->precision= 3;
break;
}
case PROP_STRING: {
@@ -372,7 +375,9 @@ PropertyRNA *RNA_def_property(StructRNA *srna, const char *cname, int type, int
void RNA_def_property_flag(PropertyRNA *prop, int flag)
{
+#if 0
StructDefRNA *ds= DefRNA.structs.last;
+#endif
prop->flag |= flag;
diff --git a/source/blender/makesrna/intern/rna_main.c b/source/blender/makesrna/intern/rna_main.c
index 2e95d8af74b..8f771eb4ea4 100644
--- a/source/blender/makesrna/intern/rna_main.c
+++ b/source/blender/makesrna/intern/rna_main.c
@@ -206,36 +206,36 @@ void RNA_def_main(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
- const char *lists[][4]= {
- {"scenes", "Scene", "rna_Main_scene_begin"},
- {"objects", "Object", "rna_Main_object_begin"},
- {"meshes", "Mesh", "rna_Main_mesh_begin"},
- {NULL, NULL, NULL},
- {"libraries", "Library", "rna_Main_library_begin"},
- {"curves", "Curve", "rna_Main_curve_begin"},
- {"metaballs", "MBall", "rna_Main_mball_begin"},
- {"materials", "Material", "rna_Main_mat_begin"},
- {"textures", "Texture", "rna_Main_tex_begin"},
- {"images", "Image", "rna_Main_image_begin"},
- {"lattices", "Lattice", "rna_Main_latt_begin"},
- {"lamps", "Lamp", "rna_Main_lamp_begin"},
- {"cameras", "Camera", "rna_Main_camera_begin"},
- {"ipos", "Ipo", "rna_Main_ipo_begin"},
- {"keys", "Key", "rna_Main_key_begin"},
- {"worlds", "World", "rna_Main_world_begin"},
- {"screens", "Screen", "rna_Main_screen_begin"},
- {"scripts", "Script", "rna_Main_script_begin"},
- {"vfonts", "VFont", "rna_Main_vfont_begin"},
- {"texts", "Text", "rna_Main_text_begin"},
- {"sounds", "Sound", "rna_Main_sound_begin"},
- {"groups", "Group", "rna_Main_group_begin"},
- {"armatures", "Armature", "rna_Main_armature_begin"},
- {"actions", "Action", "rna_Main_action_begin"},
- {"nodegroups", "NodeGroup", "rna_Main_nodetree_begin"},
- {"brushes", "Brush", "rna_Main_brush_begin"},
- {"particles", "Particle", "rna_Main_particle_begin"},
- {"windowmanagers", "wmWindowManager", "rna_Main_wm_begin"},
- {NULL, NULL, NULL}};
+ const char *lists[][5]= {
+ {"scenes", "Scene", "rna_Main_scene_begin", "Scenes", "Scene datablocks."},
+ {"objects", "Object", "rna_Main_object_begin", "Objects", "Object datablocks."},
+ {"meshes", "Mesh", "rna_Main_mesh_begin", "Meshes", "Mesh datablocks."},
+ {NULL, NULL, NULL, NULL, NULL},
+ {"libraries", "Library", "rna_Main_library_begin", "Libraries", "Library datablocks."},
+ {"curves", "Curve", "rna_Main_curve_begin", "Curves", "Curve datablocks."},
+ {"metaballs", "MBall", "rna_Main_mball_begin", "Metaballs", "Metaball datablocks."},
+ {"materials", "Material", "rna_Main_mat_begin", "Materials", "Material datablocks."},
+ {"textures", "Texture", "rna_Main_tex_begin", "Textures", "Texture datablocks."},
+ {"images", "Image", "rna_Main_image_begin", "Images", "Image datablocks."},
+ {"lattices", "Lattice", "rna_Main_latt_begin", "Lattices", "Lattice datablocks."},
+ {"lamps", "Lamp", "rna_Main_lamp_begin", "Lamps", "Lamp datablocks."},
+ {"cameras", "Camera", "rna_Main_camera_begin", "Cameras", "Camera datablocks."},
+ {"ipos", "Ipo", "rna_Main_ipo_begin", "Ipos", "Ipo datablocks."},
+ {"keys", "Key", "rna_Main_key_begin", "Keys", "Key datablocks."},
+ {"worlds", "World", "rna_Main_world_begin", "Worlds", "World datablocks."},
+ {"screens", "Screen", "rna_Main_screen_begin", "Screens", "Screen datablocks."},
+ {"scripts", "Script", "rna_Main_script_begin", "Scripts", "Script datablocks."},
+ {"vfonts", "VFont", "rna_Main_vfont_begin", "VFonts", "VFont datablocks."},
+ {"texts", "Text", "rna_Main_text_begin", "Texts", "Text datablocks."},
+ {"sounds", "Sound", "rna_Main_sound_begin", "Sounds", "Sound datablocks."},
+ {"groups", "Group", "rna_Main_group_begin", "Groups", "Group datablocks."},
+ {"armatures", "Armature", "rna_Main_armature_begin", "Armatures", "Armature datablocks."},
+ {"actions", "Action", "rna_Main_action_begin", "Actions", "Action datablocks."},
+ {"nodegroups", "NodeGroup", "rna_Main_nodetree_begin", "Node Groups", "Node group datablocks."},
+ {"brushes", "Brush", "rna_Main_brush_begin", "Brushes", "Brush datablocks."},
+ {"particles", "Particle", "rna_Main_particle_begin", "Particles", "Particle datablocks."},
+ {"windowmanagers", "wmWindowManager", "rna_Main_wm_begin", "Window Managers", "Window manager datablocks."},
+ {NULL, NULL, NULL, NULL, NULL}};
int i;
srna= RNA_def_struct(brna, "Main", "Main");
@@ -245,6 +245,7 @@ void RNA_def_main(BlenderRNA *brna)
prop= RNA_def_property(srna, lists[i][0], PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, lists[i][1]);
RNA_def_property_collection_funcs(prop, lists[i][2], "rna_iterator_listbase_next", 0, "rna_iterator_listbase_get", 0, 0, 0, 0);
+ RNA_def_property_ui_text(prop, lists[i][3], lists[i][4]);
}
}
diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c
index 38bd523cfc7..6a4125e6257 100644
--- a/source/blender/makesrna/intern/rna_mesh.c
+++ b/source/blender/makesrna/intern/rna_mesh.c
@@ -49,11 +49,13 @@ void RNA_def_mesh(BlenderRNA *brna)
prop= RNA_def_property(srna, "verts", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "mvert", "totvert");
RNA_def_property_struct_type(prop, "MVert");
+ RNA_def_property_ui_text(prop, "Vertices", "Vertices of the mesh.");
/* vertex */
srna= RNA_def_struct(brna, "MVert", "Mesh Vertex");
- prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_VECTOR);
+ RNA_def_property_ui_text(prop, "Location", "Location of the vertex.");
}
#endif
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index d79bd2a3f48..fc6efc242fb 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -34,6 +34,7 @@
#ifdef RNA_RUNTIME
+#if 0
static StructRNA *rna_Object_data_type(PointerRNA *ptr)
{
Object *ob= (Object*)ptr->data;
@@ -65,6 +66,7 @@ static StructRNA *rna_Object_data_type(PointerRNA *ptr)
return NULL;
}
}
+#endif
#else
@@ -77,14 +79,17 @@ void RNA_def_object(BlenderRNA *brna)
RNA_def_ID(srna);
- prop= RNA_def_property(srna, "data", PROP_POINTER, PROP_NONE);
+ /*prop= RNA_def_property(srna, "data", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_funcs(prop, NULL, "rna_Object_data_type", NULL);
+ RNA_def_property_ui_text(prop, "Data", "Object data."); */
prop= RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Object");
+ RNA_def_property_ui_text(prop, "Parent", "Parent Object");
prop= RNA_def_property(srna, "track", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Object");
+ RNA_def_property_ui_text(prop, "Track", "Object being tracked to define the rotation (Old Track).");
}
#endif
diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c
index dc3d2486126..02746681d4a 100644
--- a/source/blender/makesrna/intern/rna_rna.c
+++ b/source/blender/makesrna/intern/rna_rna.c
@@ -57,19 +57,19 @@ static void *rna_StructRNA_name_property_get(PointerRNA *ptr)
return ((StructRNA*)ptr->data)->nameproperty;
}
-static void *rna_StructRNA_iterator_property_get(PointerRNA *ptr)
+static void rna_StructRNA_properties_next(CollectionPropertyIterator *iter)
{
- return ((StructRNA*)ptr->data)->iteratorproperty;
+ do {
+ rna_iterator_listbase_next(iter);
+ } while(iter->valid && (((PropertyRNA*)iter->internal)->flag & PROP_BUILTIN));
}
static void rna_StructRNA_properties_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
rna_iterator_listbase_begin(iter, &((StructRNA*)ptr->data)->properties);
-}
-static void rna_StructRNA_properties_next(CollectionPropertyIterator *iter)
-{
- rna_iterator_listbase_next(iter);
+ if(iter->valid && (((PropertyRNA*)iter->internal)->flag & PROP_BUILTIN))
+ rna_StructRNA_properties_next(iter);
}
static void *rna_StructRNA_properties_get(CollectionPropertyIterator *iter)
@@ -180,6 +180,11 @@ static int rna_PropertyRNA_array_length_get(PointerRNA *ptr)
return ((PropertyRNA*)ptr->data)->arraylength;
}
+static int rna_PropertyRNA_max_length_get(PointerRNA *ptr)
+{
+ return ((StringPropertyRNA*)ptr->data)->maxlength;
+}
+
#else
static void rna_def_property(StructRNA *srna)
@@ -204,32 +209,33 @@ static void rna_def_property(StructRNA *srna)
{PROP_ROTATION, "ROTATION", "Rotation"},
{0, NULL, NULL}};
- prop= RNA_def_property(srna, "cname", PROP_STRING, PROP_NONE);
- RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
- RNA_def_property_string_funcs(prop, "rna_PropertyRNA_cname_get", "rna_PropertyRNA_cname_length", NULL);
-
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
RNA_def_property_string_funcs(prop, "rna_PropertyRNA_name_get", "rna_PropertyRNA_name_length", NULL);
+ RNA_def_property_ui_text(prop, "Name", "Human readable name.");
RNA_def_struct_name_property(srna, prop);
+ prop= RNA_def_property(srna, "cname", PROP_STRING, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_string_funcs(prop, "rna_PropertyRNA_cname_get", "rna_PropertyRNA_cname_length", NULL);
+ RNA_def_property_ui_text(prop, "Identifier", "Unique name used in the code and scripting.");
+
prop= RNA_def_property(srna, "description", PROP_STRING, PROP_NONE);
RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
RNA_def_property_string_funcs(prop, "rna_PropertyRNA_description_get", "rna_PropertyRNA_description_length", NULL);
+ RNA_def_property_ui_text(prop, "Description", "Description of the property for tooltips.");
prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
RNA_def_property_enum_items(prop, type_items);
RNA_def_property_enum_funcs(prop, "rna_PropertyRNA_type_get", NULL);
+ RNA_def_property_ui_text(prop, "Type", "Data type of the property.");
prop= RNA_def_property(srna, "subtype", PROP_ENUM, PROP_NONE);
RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
RNA_def_property_enum_items(prop, subtype_items);
RNA_def_property_enum_funcs(prop, "rna_PropertyRNA_subtype_get", NULL);
-
- prop= RNA_def_property(srna, "array_length", PROP_INT, PROP_NONE);
- RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
- RNA_def_property_int_funcs(prop, "rna_PropertyRNA_array_length_get", NULL);
+ RNA_def_property_ui_text(prop, "Sub Type", "Sub type indicating the interpretation of the property.");
}
void RNA_def_rna(BlenderRNA *brna)
@@ -240,45 +246,64 @@ void RNA_def_rna(BlenderRNA *brna)
/* StructRNA */
srna= RNA_def_struct(brna, "StructRNA", "Struct RNA");
- prop= RNA_def_property(srna, "cname", PROP_STRING, PROP_NONE);
- RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
- RNA_def_property_string_funcs(prop, "rna_StructRNA_cname_get", "rna_StructRNA_cname_length", NULL);
-
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
RNA_def_property_string_funcs(prop, "rna_StructRNA_name_get", "rna_StructRNA_name_length", NULL);
+ RNA_def_property_ui_text(prop, "Name", "Human readable name.");
RNA_def_struct_name_property(srna, prop);
+ prop= RNA_def_property(srna, "cname", PROP_STRING, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_string_funcs(prop, "rna_StructRNA_cname_get", "rna_StructRNA_cname_length", NULL);
+ RNA_def_property_ui_text(prop, "Identifier", "Unique name used in the code and scripting.");
+
prop= RNA_def_property(srna, "name_property", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
RNA_def_property_struct_type(prop, "StringPropertyRNA");
RNA_def_property_pointer_funcs(prop, "rna_StructRNA_name_property_get", NULL, NULL);
-
- prop= RNA_def_property(srna, "iterator_property", PROP_POINTER, PROP_NONE);
- RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
- RNA_def_property_struct_type(prop, "CollectionPropertyRNA");
- RNA_def_property_pointer_funcs(prop, "rna_StructRNA_iterator_property_get", NULL, NULL);
+ RNA_def_property_ui_text(prop, "Name Property", "Property that gives the name of the struct.");
prop= RNA_def_property(srna, "properties", PROP_COLLECTION, PROP_NONE);
RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
RNA_def_property_collection_funcs(prop, "rna_StructRNA_properties_begin", "rna_StructRNA_properties_next", 0, "rna_StructRNA_properties_get", "rna_StructRNA_properties_type", 0, 0, 0);
+ RNA_def_property_ui_text(prop, "Properties", "Properties in the struct.");
/* BooleanPropertyRNA */
srna= RNA_def_struct(brna, "BooleanPropertyRNA", "Boolean Property");
rna_def_property(srna);
+ prop= RNA_def_property(srna, "array_length", PROP_INT, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_int_funcs(prop, "rna_PropertyRNA_array_length_get", NULL);
+ RNA_def_property_ui_text(prop, "Array Length", "Maximum length of the array, 0 means unlimited.");
+
/* IntPropertyRNA */
srna= RNA_def_struct(brna, "IntPropertyRNA", "Int Property");
rna_def_property(srna);
+ prop= RNA_def_property(srna, "array_length", PROP_INT, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_int_funcs(prop, "rna_PropertyRNA_array_length_get", NULL);
+ RNA_def_property_ui_text(prop, "Array Length", "Maximum length of the array, 0 means unlimited.");
+
/* FloatPropertyRNA */
srna= RNA_def_struct(brna, "FloatPropertyRNA", "Float Property");
rna_def_property(srna);
+ prop= RNA_def_property(srna, "array_length", PROP_INT, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_int_funcs(prop, "rna_PropertyRNA_array_length_get", NULL);
+ RNA_def_property_ui_text(prop, "Array Length", "Maximum length of the array, 0 means unlimited.");
+
/* StringPropertyRNA */
srna= RNA_def_struct(brna, "StringPropertyRNA", "String Property");
rna_def_property(srna);
+ prop= RNA_def_property(srna, "max_length", PROP_INT, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_int_funcs(prop, "rna_PropertyRNA_max_length_get", NULL);
+ RNA_def_property_ui_text(prop, "Maximum Length", "Maximum length of the string, 0 means unlimited.");
+
/* EnumPropertyRNA */
srna= RNA_def_struct(brna, "EnumPropertyRNA", "Enum Property");
rna_def_property(srna);
@@ -299,11 +324,13 @@ void rna_def_builtin_properties(StructRNA *srna)
prop= RNA_def_property(srna, "rna_properties", PROP_COLLECTION, PROP_NONE);
RNA_def_property_flag(prop, PROP_NOT_EDITABLE|PROP_BUILTIN);
RNA_def_property_collection_funcs(prop, "rna_builtin_properties_begin", "rna_builtin_properties_next", 0, "rna_builtin_properties_get", "rna_builtin_properties_type", 0, 0, 0);
+ RNA_def_property_ui_text(prop, "Properties", "RNA property collection.");
prop= RNA_def_property(srna, "rna_type", PROP_POINTER, PROP_NONE);
- RNA_def_property_flag(prop, PROP_NOT_EDITABLE|PROP_BUILTIN);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
RNA_def_property_struct_type(prop, "StructRNA");
RNA_def_property_pointer_funcs(prop, "rna_builtin_type_get", NULL, NULL);
+ RNA_def_property_ui_text(prop, "Type", "RNA type definition.");
}
#endif