From 4bb9fbd3a852c24db928f393467e1eab3a71af6c Mon Sep 17 00:00:00 2001 From: Pablo Dobarro Date: Wed, 31 Jul 2019 12:58:50 +0200 Subject: Sculpt/Paint: Brush curve presets This patch introduces the same presets that are used for proportional editing in the brush falloff menu. The user can select any of these presets or use the regular custom falloff curve. The presets are hardcoded formulas, so the falloff curve is not used when they are active. This change improves the general feeling of the brushes and it is more convenient and simpler to use. The CUSTOM curve option should now be used in the case that an unusual deformation is needed, in other cases, the hardcoded curve presets should be the default. The smooth curve presets is a must in the grab brush, as it fixes the deformation issue with the current custom curve setting. The user may try to adjust the deformation by tweaking the curve, but it is nearly impossible to replicate this desired behavior. {F7636217} Other brushes that are included in the sculpt branch also rely on this as they need specific hardcoded falloffs to produce the desired effect. Reviewers: brecht, billreynish Reviewed By: brecht Subscribers: JulienKaspar Differential Revision: https://developer.blender.org/D5367 --- source/blender/makesdna/DNA_brush_types.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'source/blender/makesdna') diff --git a/source/blender/makesdna/DNA_brush_types.h b/source/blender/makesdna/DNA_brush_types.h index 6f775e48d58..93ce3d9769b 100644 --- a/source/blender/makesdna/DNA_brush_types.h +++ b/source/blender/makesdna/DNA_brush_types.h @@ -186,6 +186,18 @@ typedef enum eGP_BrushIcons { GP_BRUSH_ICON_ERASE_STROKE = 10, } eGP_BrushIcons; +typedef enum eBrushCurvePreset { + BRUSH_CURVE_CUSTOM = 0, + BRUSH_CURVE_SMOOTH = 1, + BRUSH_CURVE_SPHERE = 2, + BRUSH_CURVE_ROOT = 3, + BRUSH_CURVE_SHARP = 4, + BRUSH_CURVE_LIN = 5, + BRUSH_CURVE_POW4 = 6, + BRUSH_CURVE_INVSQUARE = 7, + BRUSH_CURVE_CONSTANT = 8, +} eBrushCurvePreset; + typedef struct Brush { ID id; @@ -289,6 +301,9 @@ typedef struct Brush { float texture_sample_bias; + int curve_preset; + char _pad1[4]; + /* overlay */ int texture_overlay_alpha; int mask_overlay_alpha; -- cgit v1.2.3 From 059d61ae9daa0500123cb70ff1e5732cb878f3dd Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 1 Aug 2019 09:03:50 +1000 Subject: Cleanup: use braces, unused variable, unused enum --- source/blender/makesdna/DNA_gpencil_types.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source/blender/makesdna') diff --git a/source/blender/makesdna/DNA_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h index 9134e603a87..bf72ce5e598 100644 --- a/source/blender/makesdna/DNA_gpencil_types.h +++ b/source/blender/makesdna/DNA_gpencil_types.h @@ -148,8 +148,7 @@ typedef struct bGPDpalette { /* bGPDpalette->flag */ typedef enum eGPDpalette_Flag { /* palette is active */ - A, - PL_PALETTE_ACTIVE = (1 << 0) + PL_PALETTE_ACTIVE = (1 << 0), } eGPDpalette_Flag; /* ***************************************** */ -- cgit v1.2.3 From 1ec1797d35c28bb27e6bbadd0aec37641d7a2475 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 1 Aug 2019 09:08:43 +1000 Subject: Cleanup: remove unused compute-id from preferences --- source/blender/makesdna/DNA_userdef_types.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source/blender/makesdna') diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index 894dbc05c54..2d3d091c65d 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -756,8 +756,9 @@ typedef struct UserDef { char font_path_ui[1024]; char font_path_ui_mono[1024]; + /** Legacy, for backwards compatibility only. */ int compute_device_type; - int compute_device_id; + char _pad6[4]; /** Opacity of inactive F-Curves in F-Curve Editor. */ float fcu_inactive_alpha; -- cgit v1.2.3 From 760dbd1cbf56e13b0a827afb6f7784fa46fff9b4 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 1 Aug 2019 13:53:25 +1000 Subject: Cleanup: misc spelling fixes T68035 by @luzpaz --- source/blender/makesdna/DNA_constraint_types.h | 2 +- source/blender/makesdna/DNA_customdata_types.h | 8 ++++---- source/blender/makesdna/DNA_lightprobe_types.h | 2 +- source/blender/makesdna/DNA_object_types.h | 2 +- source/blender/makesdna/DNA_scene_types.h | 4 ++-- source/blender/makesdna/intern/dna_genfile.c | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) (limited to 'source/blender/makesdna') diff --git a/source/blender/makesdna/DNA_constraint_types.h b/source/blender/makesdna/DNA_constraint_types.h index b613c661f29..eda52fdf14a 100644 --- a/source/blender/makesdna/DNA_constraint_types.h +++ b/source/blender/makesdna/DNA_constraint_types.h @@ -149,7 +149,7 @@ typedef struct bPythonConstraint { */ struct Object *tar; /** - * Subtarger from previous implementation + * Subtarget from previous implementation * (version-patch sets this to "" on file-load), MAX_ID_NAME-2. */ char subtarget[64]; diff --git a/source/blender/makesdna/DNA_customdata_types.h b/source/blender/makesdna/DNA_customdata_types.h index 75a417150c8..14a078d8386 100644 --- a/source/blender/makesdna/DNA_customdata_types.h +++ b/source/blender/makesdna/DNA_customdata_types.h @@ -42,13 +42,13 @@ typedef struct CustomDataLayer { int flag; /** Number of the active layer of this type. */ int active; - /** Number of the layer to rende.r*/ + /** Number of the layer to render. */ int active_rnd; - /** Number of the layer to rende.r*/ + /** Number of the layer to render. */ int active_clone; - /** Number of the layer to rende.r*/ + /** Number of the layer to render. */ int active_mask; - /** Shape keyblock unique id referenc.e*/ + /** Shape keyblock unique id reference. */ int uid; /** Layer name, MAX_CUSTOMDATA_LAYER_NAME. */ char name[64]; diff --git a/source/blender/makesdna/DNA_lightprobe_types.h b/source/blender/makesdna/DNA_lightprobe_types.h index 5cae3c0b1e9..6ffdd60a094 100644 --- a/source/blender/makesdna/DNA_lightprobe_types.h +++ b/source/blender/makesdna/DNA_lightprobe_types.h @@ -142,7 +142,7 @@ typedef struct LightGridCache { float visibility_bias, visibility_bleed, visibility_range, _pad5; } LightGridCache; -/* Theses are used as ubo data. They need to be aligned to size of vec4. */ +/* These are used as ubo data. They need to be aligned to size of vec4. */ BLI_STATIC_ASSERT_ALIGN(LightProbeCache, 16) BLI_STATIC_ASSERT_ALIGN(LightGridCache, 16) diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h index 13b7a0a7600..d9487f4338f 100644 --- a/source/blender/makesdna/DNA_object_types.h +++ b/source/blender/makesdna/DNA_object_types.h @@ -177,7 +177,7 @@ typedef struct Object_Runtime { /** Runtime grease pencil drawing data */ struct GpencilBatchCache *gpencil_cache; - void *_pad2; /* Padding is here for win32s unconventional stuct alignment rules. */ + void *_pad2; /* Padding is here for win32s unconventional struct alignment rules. */ } Object_Runtime; typedef struct Object { diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index 0973405ce7b..f0ca4e30cdf 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -1116,7 +1116,7 @@ typedef struct GP_Sculpt_Settings { char _pad[4]; /** Multiframe edit falloff effect by frame. */ struct CurveMapping *cur_falloff; - /** Curve used for primitve tools. */ + /** Curve used for primitive tools. */ struct CurveMapping *cur_primitive; /** Guides used for paint tools */ struct GP_Sculpt_Guide guide; @@ -1138,7 +1138,7 @@ typedef enum eGP_Sculpt_SettingsFlag { GP_SCULPT_SETT_FLAG_FRAME_FALLOFF = (1 << 5), /* apply brush to uv data */ GP_SCULPT_SETT_FLAG_APPLY_UV = (1 << 6), - /* apply primitve curve */ + /* apply primitive curve */ GP_SCULPT_SETT_FLAG_PRIMITIVE_CURVE = (1 << 7), } eGP_Sculpt_SettingsFlag; diff --git a/source/blender/makesdna/intern/dna_genfile.c b/source/blender/makesdna/intern/dna_genfile.c index 3cc005535b6..5252c8f3350 100644 --- a/source/blender/makesdna/intern/dna_genfile.c +++ b/source/blender/makesdna/intern/dna_genfile.c @@ -899,7 +899,7 @@ static void cast_elem( * as lookup keys to identify data blocks in the saved .blend file, not * as actual in-memory pointers. * - * \param curlen: Pointer length to conver to + * \param curlen: Pointer length to convert to * \param oldlen: Length of pointers in olddata * \param name_array_len: Result of #DNA_elem_array_size for this element. * \param curdata: Where to put converted data -- cgit v1.2.3 From 502c2c233d1741a5288f0d4a52df9173d850348c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 1 Aug 2019 17:32:42 +1000 Subject: Cleanup: misc spelling fixes in variable names & defines T68045 by @luzpaz --- source/blender/makesdna/DNA_node_types.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'source/blender/makesdna') diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h index 672dbaebae1..75c0721f72a 100644 --- a/source/blender/makesdna/DNA_node_types.h +++ b/source/blender/makesdna/DNA_node_types.h @@ -387,12 +387,12 @@ typedef struct bNodeLink { #define NTREE_QUALITY_LOW 2 /* tree->chunksize */ -#define NTREE_CHUNCKSIZE_32 32 -#define NTREE_CHUNCKSIZE_64 64 -#define NTREE_CHUNCKSIZE_128 128 -#define NTREE_CHUNCKSIZE_256 256 -#define NTREE_CHUNCKSIZE_512 512 -#define NTREE_CHUNCKSIZE_1024 1024 +#define NTREE_CHUNKSIZE_32 32 +#define NTREE_CHUNKSIZE_64 64 +#define NTREE_CHUNKSIZE_128 128 +#define NTREE_CHUNKSIZE_256 256 +#define NTREE_CHUNKSIZE_512 512 +#define NTREE_CHUNKSIZE_1024 1024 /* the basis for a Node tree, all links and nodes reside internal here */ /* only re-usable node trees are in the library though, -- cgit v1.2.3 From 80123efc5fc258ef8b27efba67d6ad2a0efb7edd Mon Sep 17 00:00:00 2001 From: Antonioya Date: Thu, 1 Aug 2019 17:54:51 +0200 Subject: Fix T67939: GPencil Noise modifier wrong random calculation There were several problems in the old random calculation: * Different result in the viewport and render. * Noise "pop" in some frames. * Random number was calculated every time the file was opened, so get different results. Now, instead to calculate the random numbers when n number of frames changed, the random values are calculated using a unique seed by stroke. Also, a new Seed parameter has been added and this adds more control in the noise generated. This value can be animated and get more variations. Differential Revision: http://developer.blender.org/D5393 --- source/blender/makesdna/DNA_gpencil_modifier_types.h | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'source/blender/makesdna') diff --git a/source/blender/makesdna/DNA_gpencil_modifier_types.h b/source/blender/makesdna/DNA_gpencil_modifier_types.h index c2a9d3cf296..47347753f42 100644 --- a/source/blender/makesdna/DNA_gpencil_modifier_types.h +++ b/source/blender/makesdna/DNA_gpencil_modifier_types.h @@ -90,16 +90,10 @@ typedef struct NoiseGpencilModifierData { float factor; /** How many frames before recalculate randoms. */ int step; - /** Last gp frame used. */ - int gp_frame; - /** First scene frame used. */ - int scene_frame; - /** Random values. */ - float vrand1, vrand2; - struct RNG *rng; /** Custom index for passes. */ int layer_pass; - char _pad[4]; + /** Random seed */ + int seed; } NoiseGpencilModifierData; typedef enum eNoiseGpencil_Flag { -- cgit v1.2.3