diff options
author | Jason Wilkins <Jason.A.Wilkins@gmail.com> | 2010-07-14 18:11:03 +0400 |
---|---|---|
committer | Jason Wilkins <Jason.A.Wilkins@gmail.com> | 2010-07-14 18:11:03 +0400 |
commit | 5505697ac508c02b8a2e196c5a8c07431bc687cf (patch) | |
tree | a550a4718d586066017e3861d42104ef09e969bf /source/blender/makesdna | |
parent | ae1748b98470f08ed805e101b218f44c17d9b6b2 (diff) |
Merge GSOC Sculpt Branch: 28499-30319
https://svn.blender.org/svnroot/bf-blender/branches/soc-2010-jwilkins
See log of that branch for details.
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r-- | source/blender/makesdna/DNA_ID.h | 2 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_brush_types.h | 139 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_color_types.h | 7 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_scene_types.h | 43 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_userdef_types.h | 13 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_windowmanager_types.h | 3 |
6 files changed, 148 insertions, 59 deletions
diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h index 7c3641db379..76468ada523 100644 --- a/source/blender/makesdna/DNA_ID.h +++ b/source/blender/makesdna/DNA_ID.h @@ -130,7 +130,7 @@ typedef struct PreviewImage { unsigned int w[2]; unsigned int h[2]; short changed[2]; - short pad0, pad1; + short changed_timestamp[2]; unsigned int * rect[2]; } PreviewImage; diff --git a/source/blender/makesdna/DNA_brush_types.h b/source/blender/makesdna/DNA_brush_types.h index 14930f85e63..3b2ce6b436e 100644 --- a/source/blender/makesdna/DNA_brush_types.h +++ b/source/blender/makesdna/DNA_brush_types.h @@ -33,9 +33,9 @@ #include "DNA_ID.h" #include "DNA_texture_types.h" -#ifndef MAX_MTEX -#define MAX_MTEX 18 -#endif +//#ifndef MAX_MTEX // XXX Not used? +//#define MAX_MTEX 18 +//#endif struct CurveMapping; struct MTex; @@ -43,8 +43,8 @@ struct Image; typedef struct BrushClone { struct Image *image; /* image for clone tool */ - float offset[2]; /* offset of clone image from canvas */ - float alpha, pad; /* transparency for drawing of clone image */ + float offset[2]; /* offset of clone image from canvas */ + float alpha, pad; /* transparency for drawing of clone image */ } BrushClone; typedef struct Brush { @@ -53,50 +53,94 @@ typedef struct Brush { struct BrushClone clone; struct CurveMapping *curve; /* falloff curve */ struct MTex mtex; - - short flag, blend; /* general purpose flag, blend mode */ - int size; /* brush diameter */ - float jitter; /* jitter the position of the brush */ - float spacing; /* spacing of paint operations */ - int smooth_stroke_radius; /* turning radius (in pixels) for smooth stroke */ - float smooth_stroke_factor; /* higher values limit fast changes in the stroke direction */ - float rate; /* paint operations / second (airbrush) */ - - float rgb[3]; /* color */ - float alpha; /* opacity */ - - char sculpt_tool; /* active sculpt tool */ + struct Image *image_icon; + + float normal_weight; + + short blend, pad; /* blend mode */ + int size; /* brush diameter */ + int flag; /* general purpose flag */ + float jitter; /* jitter the position of the brush */ + int spacing; /* spacing of paint operations */ + int smooth_stroke_radius; /* turning radius (in pixels) for smooth stroke */ + float smooth_stroke_factor; /* higher values limit fast changes in the stroke direction */ + float rate; /* paint operations / second (airbrush) */ + + float rgb[3]; /* color */ + float alpha; /* opacity */ + + int sculpt_plane; /* the direction of movement for sculpt vertices */ + + float plane_offset; /* offset for plane brushes (clay, flatten, fill, scrape) */ + + char sculpt_tool; /* active sculpt tool */ char vertexpaint_tool; /* active vertex/weight paint tool/blend mode */ char imagepaint_tool; /* active image paint tool */ - char pad2; + char pad3; + + float autosmooth_factor; + + float crease_pinch_factor; + + float plane_trim; + + float texture_sample_bias; + int texture_overlay_alpha; + + float unprojected_radius; + + float add_col[3]; + float sub_col[3]; } Brush; /* Brush.flag */ -#define BRUSH_AIRBRUSH 1 -#define BRUSH_TORUS 2 -#define BRUSH_ALPHA_PRESSURE 4 -#define BRUSH_SIZE_PRESSURE 8 -#define BRUSH_JITTER_PRESSURE 16 /* was BRUSH_RAD_PRESSURE */ -#define BRUSH_SPACING_PRESSURE 32 -#define BRUSH_FIXED_TEX 64 -#define BRUSH_RAKE 128 -#define BRUSH_ANCHORED 256 -#define BRUSH_DIR_IN 512 -#define BRUSH_SPACE 1024 -#define BRUSH_SMOOTH_STROKE 2048 -#define BRUSH_PERSISTENT 4096 -#define BRUSH_ACCUMULATE 8192 -#define BRUSH_LOCK_ALPHA 16384 +#define BRUSH_AIRBRUSH (1<<0) +#define BRUSH_TORUS (1<<1) +#define BRUSH_ALPHA_PRESSURE (1<<2) +#define BRUSH_SIZE_PRESSURE (1<<3) +#define BRUSH_JITTER_PRESSURE (1<<4) /* was BRUSH_RAD_PRESSURE */ +#define BRUSH_SPACING_PRESSURE (1<<5) +#define BRUSH_FIXED_TEX (1<<6) +#define BRUSH_RAKE (1<<7) +#define BRUSH_ANCHORED (1<<8) +#define BRUSH_DIR_IN (1<<9) +#define BRUSH_SPACE (1<<10) +#define BRUSH_SMOOTH_STROKE (1<<11) +#define BRUSH_PERSISTENT (1<<12) +#define BRUSH_ACCUMULATE (1<<13) +#define BRUSH_LOCK_ALPHA (1<<14) +#define BRUSH_ORIGINAL_NORMAL (1<<15) +#define BRUSH_OFFSET_PRESSURE (1<<16) +#define BRUSH_SPACE_ATTEN (1<<18) +#define BRUSH_ADAPTIVE_SPACE (1<<19) +#define BRUSH_LOCK_SIZE (1<<20) +#define BRUSH_TEXTURE_OVERLAY (1<<21) +#define BRUSH_EDGE_TO_EDGE (1<<22) +#define BRUSH_RESTORE_MESH (1<<23) +#define BRUSH_INVERSE_SMOOTH_PRESSURE (1<<24) +#define BRUSH_RANDOM_ROTATION (1<<25) +#define BRUSH_PLANE_TRIM (1<<26) +#define BRUSH_FRONTFACE (1<<27) /* Brush.sculpt_tool */ -#define SCULPT_TOOL_DRAW 1 -#define SCULPT_TOOL_SMOOTH 2 -#define SCULPT_TOOL_PINCH 3 -#define SCULPT_TOOL_INFLATE 4 -#define SCULPT_TOOL_GRAB 5 -#define SCULPT_TOOL_LAYER 6 -#define SCULPT_TOOL_FLATTEN 7 -#define SCULPT_TOOL_CLAY 8 +#define SCULPT_TOOL_DRAW 1 +#define SCULPT_TOOL_SMOOTH 2 +#define SCULPT_TOOL_PINCH 3 +#define SCULPT_TOOL_INFLATE 4 +#define SCULPT_TOOL_GRAB 5 +#define SCULPT_TOOL_LAYER 6 +#define SCULPT_TOOL_FLATTEN 7 +#define SCULPT_TOOL_CLAY 8 +#define SCULPT_TOOL_FILL 9 +#define SCULPT_TOOL_SCRAPE 10 +#define SCULPT_TOOL_NUDGE 11 +#define SCULPT_TOOL_THUMB 12 +#define SCULPT_TOOL_SNAKE_HOOK 13 +#define SCULPT_TOOL_ROTATE 14 +//#define SCULPT_TOOL_WAX 15 // XXX: reuse this slot later +#define SCULPT_TOOL_CREASE 16 +#define SCULPT_TOOL_BLOB 17 +#define SCULPT_TOOL_CLAY_TUBES 18 /* ImagePaintSettings.tool */ #define PAINT_TOOL_DRAW 0 @@ -104,5 +148,16 @@ typedef struct Brush { #define PAINT_TOOL_SMEAR 2 #define PAINT_TOOL_CLONE 3 +/* direction that the brush displaces along */ +enum { + SCULPT_DISP_DIR_AREA, + SCULPT_DISP_DIR_VIEW, + SCULPT_DISP_DIR_X, + SCULPT_DISP_DIR_Y, + SCULPT_DISP_DIR_Z, +}; + +#define MAX_BRUSH_PIXEL_RADIUS 200 + #endif diff --git a/source/blender/makesdna/DNA_color_types.h b/source/blender/makesdna/DNA_color_types.h index bc35d379334..83cd7979ce7 100644 --- a/source/blender/makesdna/DNA_color_types.h +++ b/source/blender/makesdna/DNA_color_types.h @@ -64,7 +64,8 @@ typedef struct CurveMap { typedef struct CurveMapping { int flag, cur; /* cur; for buttons, to show active curve */ - int preset, pad; + int preset; + int changed_timestamp; rctf curr, clipr; /* current rect, clip rect (is default rect too) */ @@ -87,7 +88,9 @@ typedef enum CurveMappingPreset { CURVE_PRESET_SHARP, CURVE_PRESET_SMOOTH, CURVE_PRESET_MAX, - CURVE_PRESET_MID9 + CURVE_PRESET_MID9, + CURVE_PRESET_ROUND, + CURVE_PRESET_ROOT, } CurveMappingPreset; /* histogram->mode */ diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index a4e9deaa7d9..3ac11eabe54 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -569,12 +569,30 @@ typedef struct Sculpt { Paint paint; /* For rotating around a pivot point */ - float pivot[3]; + //float pivot[3]; XXX not used? int flags; /* Control tablet input */ - char tablet_size, tablet_strength; - char pad[6]; + //char tablet_size, tablet_strength; XXX not used? + int radial_symm[3]; + + // all this below is used to communicate with the cursor drawing routine + + /* record movement of mouse so that rake can start at an intuitive angle */ + float last_x, last_y; + float last_angle; + + int draw_anchored; + int anchored_size; + float anchored_location[3]; + float anchored_initial_mouse[2]; + + int draw_pressure; + float pressure_value; + + float special_rotation; + + int pad; } Sculpt; typedef struct VPaint { @@ -1105,19 +1123,22 @@ typedef struct Scene { /* Paint.flags */ typedef enum { - PAINT_SHOW_BRUSH = 1, - PAINT_FAST_NAVIGATE = 2 + PAINT_SHOW_BRUSH = (1<<0), + PAINT_FAST_NAVIGATE = (1<<1), + PAINT_SHOW_BRUSH_ON_SURFACE = (1<<2), } PaintFlags; /* Sculpt.flags */ /* These can eventually be moved to paint flags? */ typedef enum SculptFlags { - SCULPT_SYMM_X = 1, - SCULPT_SYMM_Y = 2, - SCULPT_SYMM_Z = 4, - SCULPT_LOCK_X = 64, - SCULPT_LOCK_Y = 128, - SCULPT_LOCK_Z = 256 + SCULPT_SYMM_X = (1<<0), + SCULPT_SYMM_Y = (1<<1), + SCULPT_SYMM_Z = (1<<2), + SCULPT_LOCK_X = (1<<3), + SCULPT_LOCK_Y = (1<<4), + SCULPT_LOCK_Z = (1<<5), + SCULPT_SYMMETRY_FEATHER = (1<<6), + SCULPT_USE_OPENMP = (1<<7), } SculptFlags; /* ImagePaintSettings.flag */ diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index b6e52699340..19db6316659 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -341,9 +341,10 @@ typedef struct UserDef { short gp_settings; short tb_leftmouse, tb_rightmouse; struct SolidLight light[3]; + short sculpt_paint_settings; /* user preferences for sculpt and paint */ short tw_hotspot, tw_flag, tw_handlesize, tw_size; short textimeout,texcollectrate; - short wmdrawmethod, wmpad; + short wmdrawmethod; /* removed wmpad */ int memcachelimit; int prefetchframes; short frameserverport; @@ -373,6 +374,11 @@ typedef struct UserDef { short autokey_flag; /* flags for autokeying */ struct ColorBand coba_weight; /* from texture.h */ + + int sculpt_paint_unified_size; /* unified radius of brush in pixels */ + float sculpt_paint_unified_unprojected_radius;/* unified radius of brush in Blender units */ + float sculpt_paint_unified_alpha; /* unified strength of brush */ + float sculpt_paint_overlay_col[3]; } UserDef; extern UserDef U; /* from blenkernel blender.c */ @@ -524,6 +530,11 @@ extern UserDef U; /* from blenkernel blender.c */ #define GP_PAINT_DOSMOOTH (1<<0) #define GP_PAINT_DOSIMPLIFY (1<<1) +/* sculpt_paint_settings */ +#define SCULPT_PAINT_USE_UNIFIED_SIZE (1<<0) +#define SCULPT_PAINT_USE_UNIFIED_ALPHA (1<<1) +#define SCULPT_PAINT_UNIFIED_LOCK_BRUSH_SIZE (1<<2) + /* color picker types */ #define USER_CP_CIRCLE 0 #define USER_CP_SQUARE_SV 1 diff --git a/source/blender/makesdna/DNA_windowmanager_types.h b/source/blender/makesdna/DNA_windowmanager_types.h index ed52316990e..e6d0772f425 100644 --- a/source/blender/makesdna/DNA_windowmanager_types.h +++ b/source/blender/makesdna/DNA_windowmanager_types.h @@ -307,8 +307,7 @@ typedef struct wmOperator { typedef enum wmRadialControlMode { WM_RADIALCONTROL_SIZE, WM_RADIALCONTROL_STRENGTH, - WM_RADIALCONTROL_ANGLE + WM_RADIALCONTROL_ANGLE, } wmRadialControlMode; #endif /* DNA_WINDOWMANAGER_TYPES_H */ - |