diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-05-15 18:37:01 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-05-15 18:37:01 +0400 |
commit | 71775dc2a49d8ec20d31544f2fccf69729a8cd39 (patch) | |
tree | 39e17f1cb9a84516647dfc08714d1e304494bfb7 /source/blender/windowmanager | |
parent | bea14e8aaa518313a5ca851a0302db5649e6328b (diff) |
Fix another cases where painting long brush strokes with small radius was slowed
down, this time by the operator properties getting converted to a string for
display in the info window.
With 1000+ stroke points this can get slow, and takes up too much space anyway,
so now it's (somewhat arbitrarily) limited to printing only 10 points.
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/intern/wm_operators.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index c204554cc6c..4dce99dd017 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -541,6 +541,9 @@ char *WM_operator_pystring(bContext *C, wmOperatorType *ot, PointerRNA *opptr, i char *cstring; char *cstring_args; + /* arbitrary, but can get huge string with stroke painting otherwise */ + int max_prop_length = 10; + /* only to get the orginal props for comparisons */ PointerRNA opptr_default; @@ -554,7 +557,8 @@ char *WM_operator_pystring(bContext *C, wmOperatorType *ot, PointerRNA *opptr, i WM_operator_py_idname(idname_py, ot->idname); BLI_dynstr_appendf(dynstr, "bpy.ops.%s(", idname_py); - cstring_args = RNA_pointer_as_string_keywords(C, opptr, &opptr_default, FALSE, all_args); + cstring_args = RNA_pointer_as_string_keywords(C, opptr, &opptr_default, FALSE, + all_args, max_prop_length); BLI_dynstr_append(dynstr, cstring_args); MEM_freeN(cstring_args); @@ -737,7 +741,7 @@ char *WM_prop_pystring_assign(bContext *C, PointerRNA *ptr, PropertyRNA *prop, i return NULL; } - rhs = RNA_property_as_string(C, ptr, prop, index); + rhs = RNA_property_as_string(C, ptr, prop, index, INT_MAX); if (!rhs) { MEM_freeN(lhs); return NULL; |