From 00641bb237d32c341134e22201459aa74ea2e370 Mon Sep 17 00:00:00 2001 From: Antony Riakiotakis Date: Mon, 9 Sep 2013 18:39:51 +0000 Subject: Attempt fix for #36688. Curves may not be not initialized when called from python. C code explicilty says that curvemapping_initialize should be called prior to evaluating the curve, however the curve clip rectangle is not available when calling evaluation on the curvemap. This is not possible unless we force the evaluation on CurveMapping level, not on CurveMap level. For now just pass a rectangle with the x boundary values of the curvemap for evaluation to avoid the crash. --- source/blender/blenkernel/intern/colortools.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'source/blender/blenkernel/intern/colortools.c') diff --git a/source/blender/blenkernel/intern/colortools.c b/source/blender/blenkernel/intern/colortools.c index 7f94f365925..063fc2eccab 100644 --- a/source/blender/blenkernel/intern/colortools.c +++ b/source/blender/blenkernel/intern/colortools.c @@ -878,6 +878,19 @@ void curvemapping_initialize(CurveMapping *cumap) } } +void curvemap_initialize(CurveMap *cuma) +{ + if (cuma->table == NULL) { + rctf clipr; + /* clip rectangle is not available here, but we can use a temporary + * rectangle with the same min/max values */ + clipr.xmin = cuma->mintable; + clipr.xmax = cuma->maxtable; + + curvemap_make_table(cuma, &clipr); + } +} + void curvemapping_table_RGBA(const CurveMapping *cumap, float **array, int *size) { int a; -- cgit v1.2.3