diff options
author | Nicholas Bishop <nicholasbishop@gmail.com> | 2009-08-16 18:43:08 +0400 |
---|---|---|
committer | Nicholas Bishop <nicholasbishop@gmail.com> | 2009-08-16 18:43:08 +0400 |
commit | f250a92808a10f81abef1459223dbb5be40753b8 (patch) | |
tree | c564f0ca58639cb557cd74a97637f173ffdc5f72 /source/blender/windowmanager/intern | |
parent | 406d009269f50d02504aa3576c33e31d58b7112d (diff) |
2.5/RNA:
* Added Context access to RNA_property_as_string. This is needed for doing a Python call to the object mode set operator, which has a dynamic enum property that needs context.
Diffstat (limited to 'source/blender/windowmanager/intern')
-rw-r--r-- | source/blender/windowmanager/intern/wm.c | 2 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 2 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_operators.c | 6 |
3 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/windowmanager/intern/wm.c b/source/blender/windowmanager/intern/wm.c index 406541d62ba..85f8a647826 100644 --- a/source/blender/windowmanager/intern/wm.c +++ b/source/blender/windowmanager/intern/wm.c @@ -103,7 +103,7 @@ void wm_operator_register(bContext *C, wmOperator *op) /* Report the string representation of the operator */ - buf = WM_operator_pystring(op->type, op->ptr, 1); + buf = WM_operator_pystring(C, op->type, op->ptr, 1); BKE_report(CTX_wm_reports(C), RPT_OPERATOR, buf); MEM_freeN(buf); diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index dbb4086c541..05be825b3bd 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -370,7 +370,7 @@ static wmOperator *wm_operator_create(wmWindowManager *wm, wmOperatorType *ot, P static void wm_operator_print(wmOperator *op) { - char *buf = WM_operator_pystring(op->type, op->ptr, 1); + char *buf = WM_operator_pystring(NULL, op->type, op->ptr, 1); printf("%s\n", buf); MEM_freeN(buf); } diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 41613d0ab78..dd4728d97af 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -345,7 +345,7 @@ void WM_operator_bl_idname(char *to, const char *from) * When calling from an existing wmOperator do. * WM_operator_pystring(op->type, op->ptr); */ -char *WM_operator_pystring(wmOperatorType *ot, PointerRNA *opptr, int all_args) +char *WM_operator_pystring(bContext *C, wmOperatorType *ot, PointerRNA *opptr, int all_args) { const char *arg_name= NULL; char idname_py[OP_MAX_TYPENAME]; @@ -378,7 +378,7 @@ char *WM_operator_pystring(wmOperatorType *ot, PointerRNA *opptr, int all_args) if (strcmp(arg_name, "rna_type")==0) continue; - buf= RNA_property_as_string(opptr, prop); + buf= RNA_property_as_string(C, opptr, prop); ok= 1; @@ -388,7 +388,7 @@ char *WM_operator_pystring(wmOperatorType *ot, PointerRNA *opptr, int all_args) prop_default= RNA_struct_find_property(&opptr_default, arg_name); if(prop_default) { - buf_default= RNA_property_as_string(&opptr_default, prop_default); + buf_default= RNA_property_as_string(C, &opptr_default, prop_default); if(strcmp(buf, buf_default)==0) ok= 0; /* values match, dont bother printing */ |