diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-12-03 11:10:31 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-12-03 11:10:31 +0400 |
commit | ca25fd0307f9387af34cfa3120cecb7e12575579 (patch) | |
tree | 15187ae2abd6c34bede05308ae6c16b910c900fb | |
parent | 671b871e7f5d3e031017aec4d976e8e3eaa9e50e (diff) |
fix [#33389] Curve points restricted to 0..1 range,
also added note on python3.3's faulthandler module.
-rw-r--r-- | doc/python_api/rst/info_gotcha.rst | 7 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_templates.c | 10 |
2 files changed, 15 insertions, 2 deletions
diff --git a/doc/python_api/rst/info_gotcha.rst b/doc/python_api/rst/info_gotcha.rst index e60f1e256cd..08548ea73e5 100644 --- a/doc/python_api/rst/info_gotcha.rst +++ b/doc/python_api/rst/info_gotcha.rst @@ -537,6 +537,13 @@ Here are some general hints to avoid running into these problems. * Crashes may not happen every time, they may happen more on some configurations/operating-systems. +.. note:: + + To find the line of your script that crashes you can use the ``faulthandler`` module. + See `faulthandler docs<http://docs.python.org/dev/library/faulthandler.html>`_. + + While the crash may be in Blenders C/C++ code, this can help a lot to track down the area of the script that causes the crash. + Undo/Redo --------- diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index e01e6bdd49e..19d4de8bce4 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -2021,10 +2021,16 @@ static void curvemap_buttons_layout(uiLayout *layout, PointerRNA *ptr, char labe } if (cmp) { + const float range_clamp[2] = {0.0f, 1.0f}; + const float range_unclamp[2] = {-1000.0f, 1000.0f}; /* arbitrary limits here */ + const float *range = (cumap->flag & CUMA_DO_CLIP) ? range_clamp : range_unclamp; + uiLayoutRow(layout, TRUE); uiBlockSetNFunc(block, curvemap_buttons_update, MEM_dupallocN(cb), cumap); - bt = uiDefButF(block, NUM, 0, "X", 0, 2 * UI_UNIT_Y, UI_UNIT_X * 10, UI_UNIT_Y, &cmp->x, 0.0f, 1.0f, 1, 5, ""); - bt = uiDefButF(block, NUM, 0, "Y", 0, 1 * UI_UNIT_Y, UI_UNIT_X * 10, UI_UNIT_Y, &cmp->y, 0.0f, 1.0f, 1, 5, ""); + bt = uiDefButF(block, NUM, 0, "X", 0, 2 * UI_UNIT_Y, UI_UNIT_X * 10, UI_UNIT_Y, + &cmp->x, range[0], range[1], 1, 5, ""); + bt = uiDefButF(block, NUM, 0, "Y", 0, 1 * UI_UNIT_Y, UI_UNIT_X * 10, UI_UNIT_Y, + &cmp->y, range[0], range[1], 1, 5, ""); } /* black/white levels */ |