From a76e69f5f75c06dda6d35113d80b6b65dcc94ea0 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 18 Jul 2016 15:28:56 +0200 Subject: Additional Waveform Drawing Mode This diff adds a 6th drawing mode to the Waveform Scope. The new mode shows the RGB colour channels overlaid as a "Full colour" waveform. The old "Red Green Blue" mode is renamed "Parade" which is the standard industry term for RGB channels shown side-by-side. This full colour style of waveform is very much more useful for colour grading than the Parade mode and is the default waveform for many artists. Files from older Blender versions which show scopes open as expected. Patch by John Cox (johnedwardcox), thanks! Reviewers: sergey Reviewed By: sergey Subscribers: campbellbarton, tmw, Blendify Differential Revision: https://developer.blender.org/D1936 --- source/blender/makesdna/DNA_color_types.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source/blender/makesdna') diff --git a/source/blender/makesdna/DNA_color_types.h b/source/blender/makesdna/DNA_color_types.h index c9a5e056e4a..1d88b01cf62 100644 --- a/source/blender/makesdna/DNA_color_types.h +++ b/source/blender/makesdna/DNA_color_types.h @@ -157,10 +157,11 @@ typedef struct Scopes { /* scopes->wavefrm_mode */ #define SCOPES_WAVEFRM_LUMA 0 -#define SCOPES_WAVEFRM_RGB 1 +#define SCOPES_WAVEFRM_RGB_PARADE 1 #define SCOPES_WAVEFRM_YCC_601 2 #define SCOPES_WAVEFRM_YCC_709 3 #define SCOPES_WAVEFRM_YCC_JPEG 4 +#define SCOPES_WAVEFRM_RGB 5 typedef struct ColorManagedViewSettings { int flag, pad; -- cgit v1.2.3 From 3948f65686ae78de2b0cd668390826f49598f99b Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 19 Jul 2016 10:23:26 +1000 Subject: Cleanup: style, spelling --- source/blender/makesdna/DNA_view3d_types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/makesdna') diff --git a/source/blender/makesdna/DNA_view3d_types.h b/source/blender/makesdna/DNA_view3d_types.h index 5b533d1ec48..4c243507e82 100644 --- a/source/blender/makesdna/DNA_view3d_types.h +++ b/source/blender/makesdna/DNA_view3d_types.h @@ -239,7 +239,7 @@ typedef struct View3D { float stereo3d_convergence_alpha; /* Previous viewport draw type. - * Runtime-only, set in the rendered viewport otggle operator. + * Runtime-only, set in the rendered viewport toggle operator. */ short prev_drawtype; short pad1; -- cgit v1.2.3 From a96c7daf806b7fd390fb8b4ac1401e6a8f0f612d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 21 Jul 2016 07:15:43 +1000 Subject: Cleanup: unused brush DNA --- source/blender/makesdna/DNA_brush_types.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'source/blender/makesdna') diff --git a/source/blender/makesdna/DNA_brush_types.h b/source/blender/makesdna/DNA_brush_types.h index 3dca087c7fa..f4a1677efc4 100644 --- a/source/blender/makesdna/DNA_brush_types.h +++ b/source/blender/makesdna/DNA_brush_types.h @@ -4,7 +4,7 @@ * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -70,7 +70,6 @@ typedef struct Brush { float normal_weight; float rake_factor; /* rake actual data (not texture), used for sculpt */ - int pad; short blend; /* blend mode */ short ob_mode; /* & with ob->mode to see if the brush is compatible, use for display only. */ @@ -95,7 +94,6 @@ typedef struct Brush { float plane_offset; /* offset for plane brushes (clay, flatten, fill, scrape) */ - int flag2; int gradient_spacing; int gradient_stroke_mode; /* source for stroke color gradient application */ int gradient_fill_mode; /* source for fill tool color gradient application */ @@ -104,7 +102,7 @@ typedef struct Brush { char vertexpaint_tool; /* active vertex/weight paint blend mode (poorly named) */ char imagepaint_tool; /* active image paint tool */ char mask_tool; /* enum BrushMaskTool, only used if sculpt_tool is SCULPT_TOOL_MASK */ - + float autosmooth_factor; float crease_pinch_factor; @@ -333,5 +331,4 @@ typedef enum BlurKernelType { #define MAX_BRUSH_PIXEL_RADIUS 500 -#endif - +#endif /* __DNA_BRUSH_TYPES_H__ */ -- cgit v1.2.3 From ecd33bacf0992d67bbad8e2c70996639837503b1 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 21 Jul 2016 11:49:30 +1000 Subject: Cleanup: use const, move comments to enum --- source/blender/makesdna/DNA_genfile.h | 9 ++++++--- source/blender/makesdna/intern/dna_genfile.c | 20 ++++++++------------ 2 files changed, 14 insertions(+), 15 deletions(-) (limited to 'source/blender/makesdna') diff --git a/source/blender/makesdna/DNA_genfile.h b/source/blender/makesdna/DNA_genfile.h index 0e34792e624..a2981c0aa76 100644 --- a/source/blender/makesdna/DNA_genfile.h +++ b/source/blender/makesdna/DNA_genfile.h @@ -69,8 +69,11 @@ typedef enum eSDNA_Type { * For use with #DNA_struct_reconstruct & #DNA_struct_get_compareflags */ enum eSDNA_StructCompare { + /* Struct has disappeared (values of this struct type will not be loaded by the current Blender) */ SDNA_CMP_REMOVED = 0, + /* Struct is the same (can be loaded with straight memory copy after any necessary endian conversion) */ SDNA_CMP_EQUAL = 1, + /* Struct is different in some way (needs to be copied/converted field by field) */ SDNA_CMP_NOT_EQUAL = 2, }; @@ -89,15 +92,15 @@ void DNA_sdna_current_free(void); int DNA_struct_find_nr_ex(const struct SDNA *sdna, const char *str, unsigned int *index_last); int DNA_struct_find_nr(const struct SDNA *sdna, const char *str); void DNA_struct_switch_endian(const struct SDNA *oldsdna, int oldSDNAnr, char *data); -char *DNA_struct_get_compareflags(const struct SDNA *sdna, const struct SDNA *newsdna); +const char *DNA_struct_get_compareflags(const struct SDNA *sdna, const struct SDNA *newsdna); void *DNA_struct_reconstruct( const struct SDNA *newsdna, const struct SDNA *oldsdna, - char *compflags, int oldSDNAnr, int blocks, void *data); + const char *compflags, int oldSDNAnr, int blocks, const void *data); int DNA_elem_array_size(const char *str); int DNA_elem_offset(struct SDNA *sdna, const char *stype, const char *vartype, const char *name); -bool DNA_struct_elem_find(struct SDNA *sdna, const char *stype, const char *vartype, const char *name); +bool DNA_struct_elem_find(const struct SDNA *sdna, const char *stype, const char *vartype, const char *name); int DNA_elem_type_size(const eSDNA_Type elem_nr); diff --git a/source/blender/makesdna/intern/dna_genfile.c b/source/blender/makesdna/intern/dna_genfile.c index 4db98bda7dd..8f0c091ecfd 100644 --- a/source/blender/makesdna/intern/dna_genfile.c +++ b/source/blender/makesdna/intern/dna_genfile.c @@ -632,13 +632,8 @@ static void recurs_test_compflags(const SDNA *sdna, char *compflags, int structn /** * Constructs and returns an array of byte flags with one element for each struct in oldsdna, * indicating how it compares to newsdna: - * - * flag value: - * - 0 Struct has disappeared (values of this struct type will not be loaded by the current Blender) - * - 1 Struct is the same (can be loaded with straight memory copy after any necessary endian conversion) - * - 2 Struct is different in some way (needs to be copied/converted field by field) */ -char *DNA_struct_get_compareflags(const SDNA *oldsdna, const SDNA *newsdna) +const char *DNA_struct_get_compareflags(const SDNA *oldsdna, const SDNA *newsdna) { int a, b; const short *sp_old, *sp_new; @@ -909,12 +904,12 @@ static int elem_strcmp(const char *name, const char *oname) * \param sppo Optional place to return pointer to field info in sdna * \return Data address. */ -static char *find_elem( +static const char *find_elem( const SDNA *sdna, const char *type, const char *name, const short *old, - char *olddata, + const char *olddata, const short **sppo) { int a, elemcount, len; @@ -1062,7 +1057,7 @@ static void reconstruct_struct( const char *compflags, int oldSDNAnr, - char *data, + const char *data, int curSDNAnr, char *cur) { @@ -1073,7 +1068,8 @@ static void reconstruct_struct( int a, elemcount, elen, eleno, mul, mulo, firststructtypenr; const short *spo, *spc, *sppo; const char *type; - char *cpo, *cpc; + const char *cpo; + char *cpc; const char *name, *nameo; unsigned int oldsdna_index_last = UINT_MAX; @@ -1250,7 +1246,7 @@ void DNA_struct_switch_endian(const SDNA *oldsdna, int oldSDNAnr, char *data) */ void *DNA_struct_reconstruct( const SDNA *newsdna, const SDNA *oldsdna, - char *compflags, int oldSDNAnr, int blocks, void *data) + const char *compflags, int oldSDNAnr, int blocks, const void *data) { int a, curSDNAnr, curlen = 0, oldlen; const short *spo, *spc; @@ -1297,7 +1293,7 @@ int DNA_elem_offset(SDNA *sdna, const char *stype, const char *vartype, const ch return (int)((intptr_t)cp); } -bool DNA_struct_elem_find(SDNA *sdna, const char *stype, const char *vartype, const char *name) +bool DNA_struct_elem_find(const SDNA *sdna, const char *stype, const char *vartype, const char *name) { const int SDNAnr = DNA_struct_find_nr(sdna, stype); -- cgit v1.2.3 From 1cc0ce58fd082a819431a766fa3e2f897dd46a4e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 22 Jul 2016 04:05:38 +1000 Subject: Cleanup: warnings --- source/blender/makesdna/intern/dna_genfile.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'source/blender/makesdna') diff --git a/source/blender/makesdna/intern/dna_genfile.c b/source/blender/makesdna/intern/dna_genfile.c index 8f0c091ecfd..6a41591e051 100644 --- a/source/blender/makesdna/intern/dna_genfile.c +++ b/source/blender/makesdna/intern/dna_genfile.c @@ -1107,7 +1107,7 @@ static void reconstruct_struct( if (spc[0] >= firststructtypenr && !ispointer(name)) { /* struct field type */ /* where does the old struct data start (and is there an old one?) */ - cpo = find_elem(oldsdna, type, name, spo, data, &sppo); + cpo = (char *)find_elem(oldsdna, type, name, spo, data, &sppo); if (cpo) { oldSDNAnr = DNA_struct_find_nr_ex(oldsdna, type, &oldsdna_index_last); @@ -1184,7 +1184,7 @@ void DNA_struct_switch_endian(const SDNA *oldsdna, int oldSDNAnr, char *data) if (spc[0] >= firststructtypenr && !ispointer(name)) { /* struct field type */ /* where does the old data start (is there one?) */ - char *cpo = find_elem(oldsdna, type, name, spo, data, NULL); + char *cpo = (char *)find_elem(oldsdna, type, name, spo, data, NULL); if (cpo) { oldSDNAnr = DNA_struct_find_nr_ex(oldsdna, type, &oldsdna_index_last); @@ -1250,7 +1250,8 @@ void *DNA_struct_reconstruct( { int a, curSDNAnr, curlen = 0, oldlen; const short *spo, *spc; - char *cur, *cpc, *cpo; + char *cur, *cpc; + const char *cpo; const char *type; /* oldSDNAnr == structnr, we're looking for the corresponding 'cur' number */ -- cgit v1.2.3 From a323d8edbfde8140e364df28194bc9e08eb45354 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 25 Jul 2016 14:14:31 +1000 Subject: Curve Drawing: Add option to use new refit method --- source/blender/makesdna/DNA_scene_types.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'source/blender/makesdna') diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index 60bd37799fb..c7578a19e0c 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -1273,7 +1273,9 @@ typedef struct CurvePaintSettings { char flag; char depth_mode; char surface_plane; - int error_threshold; + char fit_method; + char pad; + short error_threshold; float radius_min, radius_max; float radius_taper_start, radius_taper_end; float surface_offset; @@ -1288,6 +1290,12 @@ enum { CURVE_PAINT_FLAG_DEPTH_STROKE_OFFSET_ABS = (1 << 3), }; +/* CurvePaintSettings.fit_method */ +enum { + CURVE_PAINT_FIT_METHOD_REFIT = 0, + CURVE_PAINT_FIT_METHOD_SPLIT = 1, +}; + /* CurvePaintSettings.depth_mode */ enum { CURVE_PAINT_PROJECT_CURSOR = 0, -- cgit v1.2.3