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>2012-12-18 19:22:06 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-12-18 19:22:06 +0400
commit5fcb12d7541dc9e83756f26422b160c97d9a124d (patch)
tree2be7b4fdc6139393af1c71ec332db96516d1b795 /source/blender/windowmanager/intern/wm_operators.c
parent3c2b5e7fc0328af24a45ccc704662b2e9fcc4fa7 (diff)
changing RNA properties now prints python script in the info view.
next will add context so bpy.data.xxx[id] are not used for all references.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_operators.c')
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c38
1 files changed, 7 insertions, 31 deletions
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index 7316e494b88..ed7f6dbcabe 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -560,42 +560,18 @@ char *WM_operator_pystring(bContext *C, wmOperatorType *ot, PointerRNA *opptr, i
return cstring;
}
-char *WM_prop_pystring(PointerRNA *ptr, PropertyRNA *prop, int index)
+char *WM_prop_pystring_assign(bContext *C, PointerRNA *ptr, PropertyRNA *prop, int index)
{
- char *id_path;
- char *data_path = NULL;
-
- char *ret;
+ char *lhs, *rhs, *ret;
- if (!ptr->id.data) {
+ lhs = RNA_path_full_property_py(ptr, prop, index);
+ if (!lhs) {
return NULL;
}
-
- /* never fails */
- id_path = RNA_path_from_ID_python(ptr->id.data);
-
- data_path = RNA_path_from_ID_to_property(ptr, prop);
-
- if ((index == -1) || (RNA_property_array_check(prop) == FALSE)) {
- ret = BLI_sprintfN("%s.%s",
- id_path, data_path);
- }
- else {
- ret = BLI_sprintfN("%s.%s[%d]",
- id_path, data_path, index);
- }
-
- return ret;
-}
-
-char *WM_prop_pystring_assign(bContext *C, PointerRNA *ptr, PropertyRNA *prop, int index)
-{
- char *lhs = WM_prop_pystring(ptr, prop, index);
- char *rhs = RNA_property_as_string(C, ptr, prop, index);
- char *ret;
-
- if (!lhs) {
+ rhs = RNA_property_as_string(C, ptr, prop, index);
+ if (!rhs) {
+ MEM_freeN(lhs);
return NULL;
}