diff options
-rw-r--r-- | source/blender/blenkernel/BKE_colortools.h | 1 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/colortools.c | 13 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_color.c | 1 |
3 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_colortools.h b/source/blender/blenkernel/BKE_colortools.h index e0b7e68bafc..e703f189d6f 100644 --- a/source/blender/blenkernel/BKE_colortools.h +++ b/source/blender/blenkernel/BKE_colortools.h @@ -64,6 +64,7 @@ void curvemapping_changed_all(struct CurveMapping *cumap); /* call before _all_ evaluation functions */ void curvemapping_initialize(struct CurveMapping *cumap); +void curvemap_initialize(struct CurveMap *cuma); /* keep these (const CurveMap) - to help with thread safety */ /* single curve, no table check */ 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; diff --git a/source/blender/makesrna/intern/rna_color.c b/source/blender/makesrna/intern/rna_color.c index dcf6adf6fca..b9b3fe1ce79 100644 --- a/source/blender/makesrna/intern/rna_color.c +++ b/source/blender/makesrna/intern/rna_color.c @@ -623,6 +623,7 @@ static void rna_ColorManagement_update(Main *UNUSED(bmain), Scene *UNUSED(scene) /* this function only exists because #curvemap_evaluateF uses a 'const' qualifier */ static float rna_CurveMap_evaluateF(struct CurveMap *cuma, float value) { + curvemap_initialize(cuma); return curvemap_evaluateF(cuma, value); } |