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>2010-08-06 21:54:02 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2010-08-06 21:54:02 +0400
commit7b6e895c11b44cccb665f3d3136098d232c70617 (patch)
tree981fffcb33c8f0cd7c4d02abe04d7c31c2db1434 /source/blender/makesrna/intern/rna_context.c
parent8c80f623f48b6bf193b3d75c01d1003507cdeba5 (diff)
Fix #23209: there was no access yet to region data from RNA, there's no
generic system for it yet, but for now already return it for the 3D view since that is the only space that uses it.
Diffstat (limited to 'source/blender/makesrna/intern/rna_context.c')
-rw-r--r--source/blender/makesrna/intern/rna_context.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/source/blender/makesrna/intern/rna_context.c b/source/blender/makesrna/intern/rna_context.c
index bb886f39f1c..6cc93d088ad 100644
--- a/source/blender/makesrna/intern/rna_context.c
+++ b/source/blender/makesrna/intern/rna_context.c
@@ -76,13 +76,19 @@ static PointerRNA rna_Context_region_get(PointerRNA *ptr)
return newptr;
}
-/*static PointerRNA rna_Context_region_data_get(PointerRNA *ptr)
+static PointerRNA rna_Context_region_data_get(PointerRNA *ptr)
{
bContext *C= (bContext*)ptr->data;
- PointerRNA newptr;
- RNA_pointer_create((ID*)CTX_wm_screen(C), &RNA_RegionData, CTX_wm_region_data(C), &newptr);
- return newptr;
-}*/
+
+ /* only exists for one space still, no generic system yet */
+ if(CTX_wm_view3d(C)) {
+ PointerRNA newptr;
+ RNA_pointer_create((ID*)CTX_wm_screen(C), &RNA_RegionView3D, CTX_wm_region_data(C), &newptr);
+ return newptr;
+ }
+
+ return PointerRNA_NULL;
+}
static PointerRNA rna_Context_main_get(PointerRNA *ptr)
{
@@ -175,10 +181,10 @@ void RNA_def_context(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "Region");
RNA_def_property_pointer_funcs(prop, "rna_Context_region_get", NULL, NULL, NULL);
- /*prop= RNA_def_property(srna, "region_data", PROP_POINTER, PROP_NONE);
+ prop= RNA_def_property(srna, "region_data", PROP_POINTER, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- RNA_def_property_struct_type(prop, "RegionData");
- RNA_def_property_pointer_funcs(prop, "rna_Context_region_data_get", NULL, NULL, NULL);*/
+ RNA_def_property_struct_type(prop, "RegionView3D");
+ RNA_def_property_pointer_funcs(prop, "rna_Context_region_data_get", NULL, NULL, NULL);
/* Data */
prop= RNA_def_property(srna, "main", PROP_POINTER, PROP_NONE);