diff options
-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 */ |