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:
authorCampbell Barton <ideasman42@gmail.com>2009-01-09 19:08:47 +0300
committerCampbell Barton <ideasman42@gmail.com>2009-01-09 19:08:47 +0300
commite60be63d23bce8c8fe9b749a17c1f3dc3fd56711 (patch)
tree5a264d6a9d21a896f913dd573fee2544a801972a /source/blender/makesrna/intern/rna_rna.c
parent2fe5005bbb6b81831eba33f3d6a93c4719b912a0 (diff)
added rna property "parent" so nested RNA structs can access their parent RNA struct
This is used for generating docs so a nested RNA struct such as MaterialRaytraceTransparency are listed under Material rather then in the global struct list) These RNA structs are used for grouping properties and don't correspond to a C structure.
Diffstat (limited to 'source/blender/makesrna/intern/rna_rna.c')
-rw-r--r--source/blender/makesrna/intern/rna_rna.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c
index 069f344b290..60faf0c8e07 100644
--- a/source/blender/makesrna/intern/rna_rna.c
+++ b/source/blender/makesrna/intern/rna_rna.c
@@ -69,6 +69,11 @@ static void *rna_Struct_base_get(PointerRNA *ptr)
return ((StructRNA*)ptr->data)->from;
}
+static void *rna_Struct_parent_get(PointerRNA *ptr)
+{
+ return ((StructRNA*)ptr->data)->parent;
+}
+
static void *rna_Struct_name_property_get(PointerRNA *ptr)
{
return ((StructRNA*)ptr->data)->nameproperty;
@@ -430,6 +435,12 @@ static void rna_def_struct(BlenderRNA *brna)
RNA_def_property_pointer_funcs(prop, "rna_Struct_base_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Base", "Struct definition this is derived from.");
+ prop= RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_struct_type(prop, "Struct");
+ RNA_def_property_pointer_funcs(prop, "rna_Struct_parent_get", NULL, NULL);
+ RNA_def_property_ui_text(prop, "Parent", "Parent struct, used only for nested structs.");
+
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, "StringProperty");