diff options
author | Nicholas Bishop <nicholasbishop@gmail.com> | 2007-06-25 02:28:28 +0400 |
---|---|---|
committer | Nicholas Bishop <nicholasbishop@gmail.com> | 2007-06-25 02:28:28 +0400 |
commit | 8cf2d5ca4acb40459f6937f7b2c50e4fc42c22c7 (patch) | |
tree | 8d30288e77a902ee24a8f59a651b2e59ecbb1b21 /source/blender/include/BDR_sculptmode.h | |
parent | 296758ff0106eaa845fe1a1eeb14df2c6daa792d (diff) |
== Sculpt Mode ==
Added a new input control that smooths the brush stroke.
This option controlled by the menu item Sculpt>Input Control>Smooth Stroke. When enabled, the brush has a delayed effect on the model; a green line is drawn to indicate the smoothed path of the stroke. After ~200 pixels, the first half of the stroke will be applied to the model; the process then repeats, with a new segment of the stroke being applied to the model after every 200 pixels. On mouse up, any remaining portion of the stroke will be applied.
Other changes:
* Added a flags field to SculptData; currently only used for smooth stroke but other flags can be moved into it
* Moved the damaged_rects/verts into SculptSession
* Simplified brush application by moving init_editdata into do_symmetrical_brush_actions
* Removed Averaging from sculpt Input menu; smooth stroke should take its place
TODO:
* Fix display of the smooth line in Partial Redraw mode
* Make the smoothing and delay factors adjustable
* Optimize the stroke application (currently using the old 'dot' style of applying the brush)
Diffstat (limited to 'source/blender/include/BDR_sculptmode.h')
-rw-r--r-- | source/blender/include/BDR_sculptmode.h | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/source/blender/include/BDR_sculptmode.h b/source/blender/include/BDR_sculptmode.h index 0e80a7f0185..c80f9ea8626 100644 --- a/source/blender/include/BDR_sculptmode.h +++ b/source/blender/include/BDR_sculptmode.h @@ -30,13 +30,15 @@ #ifndef BDR_SCULPTMODE_H #define BDR_SCULPTMODE_H +#include "DNA_listBase.h" +#include "DNA_vec_types.h" /* For bglMats */ #include "BIF_glutil.h" - #include "transform.h" struct uiBlock; struct BrushData; +struct EditData; struct IndexNode; struct KeyBlock; struct Mesh; @@ -45,6 +47,7 @@ struct PartialVisibility; struct Scene; struct ScrArea; struct SculptData; +struct SculptStroke; typedef enum PropsetMode { PropsetNone = 0, @@ -75,6 +78,11 @@ typedef struct SculptSession { struct ListBase *vertex_users; struct IndexNode *vertex_users_mem; int vertex_users_size; + + /* Used temporarily per-stroke */ + float *vertexcosnos; + ListBase damaged_rects; + ListBase damaged_verts; /* Used to cache the render of the active texture */ unsigned int texcache_w, texcache_h, *texcache; @@ -83,6 +91,8 @@ typedef struct SculptSession { /* For rotating around a pivot point */ vec3f pivot; + + struct SculptStroke *stroke; } SculptSession; SculptSession *sculpt_session(void); @@ -102,15 +112,26 @@ void sculptmode_propset(const unsigned short event); void sculptmode_selectbrush_menu(void); void sculptmode_draw_mesh(int); void sculpt_paint_brush(char clear); +void sculpt_stroke_draw(); struct BrushData *sculptmode_brush(void); float tex_angle(void); +void do_symmetrical_brush_actions(struct EditData *e, short *, short *); void sculptmode_update_tex(void); char sculpt_modifiers_active(struct Object *ob); void sculpt(void); void set_sculptmode(void); +/* Stroke */ +void sculpt_stroke_new(const int max); +void sculpt_stroke_free(); +void sculpt_stroke_add_point(const short x, const short y); +void sculpt_stroke_apply(struct EditData *); +void sculpt_stroke_apply_all(struct EditData *e); +void sculpt_stroke_draw(); + + /* Partial Mesh Visibility */ struct PartialVisibility *sculptmode_copy_pmv(struct PartialVisibility *); void sculptmode_pmv_free(struct PartialVisibility *); |