diff options
Diffstat (limited to 'source/blender/editors/sculpt_paint/sculpt_intern.h')
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt_intern.h | 40 |
1 files changed, 35 insertions, 5 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt_intern.h b/source/blender/editors/sculpt_paint/sculpt_intern.h index 5fa115ed629..83526006d7d 100644 --- a/source/blender/editors/sculpt_paint/sculpt_intern.h +++ b/source/blender/editors/sculpt_paint/sculpt_intern.h @@ -247,6 +247,10 @@ typedef struct SculptThreadedTaskData { float (*mat)[4]; float (*vertCos)[3]; + /* When true, the displacement stored in the proxies will be applied to the original coordinates + * instead of to the current coordinates. */ + bool use_proxies_orco; + /* X and Z vectors aligned to the stroke direction for operations where perpendicular vectors to * the stroke direction are needed. */ float (*stroke_xz)[3]; @@ -290,6 +294,10 @@ typedef struct SculptThreadedTaskData { bool mask_expand_create_face_set; float transform_mats[8][4][4]; + float elastic_transform_mat[4][4]; + float elastic_transform_pivot[3]; + float elastic_transform_pivot_init[3]; + float elastic_transform_radius; /* Boundary brush */ float boundary_deform_strength; @@ -372,6 +380,14 @@ typedef enum SculptFilterOrientation { SCULPT_FILTER_ORIENTATION_VIEW = 2, } SculptFilterOrientation; +/* Defines how transform tools are going to apply its displacement. */ +typedef enum SculptTransformDisplacementMode { + /* Displaces the elements from their original coordinates. */ + SCULPT_TRANSFORM_DISPLACEMENT_ORIGINAL = 0, + /* Displaces the elements incrementally from their previous position. */ + SCULPT_TRANSFORM_DISPLACEMENT_INCREMENTAL = 1, +} SculptTransformDisplacementMode; + #define SCULPT_CLAY_STABILIZER_LEN 10 typedef struct AutomaskingSettings { @@ -440,6 +456,8 @@ typedef struct FilterCache { int active_face_set; + SculptTransformDisplacementMode transform_displacement_mode; + /* Auto-masking. */ AutomaskingCache *automasking; @@ -827,7 +845,10 @@ void SCULPT_tag_update_overlays(bContext *C); * (This allows us to ignore the GL depth buffer) * Returns 0 if the ray doesn't hit the mesh, non-zero otherwise. */ -bool SCULPT_stroke_get_location(struct bContext *C, float out[3], const float mouse[2]); +bool SCULPT_stroke_get_location(struct bContext *C, + float out[3], + const float mouse[2], + bool force_original); /** * Gets the normal, location and active vertex location of the geometry under the cursor. This also * updates the active vertex and cursor related data of the SculptSession using the mouse position @@ -840,7 +861,7 @@ void SCULPT_geometry_preview_lines_update(bContext *C, struct SculptSession *ss, void SCULPT_stroke_modifiers_check(const bContext *C, Object *ob, const Brush *brush); float SCULPT_raycast_init(struct ViewContext *vc, - const float mouse[2], + const float mval[2], float ray_start[3], float ray_end[3], float ray_normal[3], @@ -1011,7 +1032,10 @@ void SCULPT_face_sets_visibility_all_set(SculptSession *ss, bool visible); * Initialize a #SculptOrigVertData for accessing original vertex data; * handles #BMesh, #Mesh, and multi-resolution. */ -void SCULPT_orig_vert_data_init(SculptOrigVertData *data, Object *ob, PBVHNode *node); +void SCULPT_orig_vert_data_init(SculptOrigVertData *data, + Object *ob, + PBVHNode *node, + SculptUndoType type); /** * Update a #SculptOrigVertData for a particular vertex from the PBVH iterator. */ @@ -1137,12 +1161,15 @@ bool SCULPT_search_sphere_cb(PBVHNode *node, void *data_v); */ bool SCULPT_search_circle_cb(PBVHNode *node, void *data_v); +void SCULPT_combine_transform_proxies(Sculpt *sd, Object *ob); + /** * Initialize a point-in-brush test with a given falloff shape. * * \param falloff_shape: #PAINT_FALLOFF_SHAPE_SPHERE or #PAINT_FALLOFF_SHAPE_TUBE. * \return The brush falloff function. */ + SculptBrushTestFn SCULPT_brush_test_init_with_falloff_shape(SculptSession *ss, SculptBrushTest *test, char falloff_shape); @@ -1446,7 +1473,7 @@ void SCULPT_cache_free(StrokeCache *cache); * \{ */ SculptUndoNode *SCULPT_undo_push_node(Object *ob, PBVHNode *node, SculptUndoType type); -SculptUndoNode *SCULPT_undo_get_node(PBVHNode *node); +SculptUndoNode *SCULPT_undo_get_node(PBVHNode *node, SculptUndoType type); SculptUndoNode *SCULPT_undo_get_first_node(void); /** @@ -1781,7 +1808,10 @@ void SCULPT_OT_brush_stroke(struct wmOperatorType *ot); /* end sculpt_ops.c */ -#define SCULPT_TOOL_NEEDS_COLOR(tool) ELEM(tool, SCULPT_TOOL_PAINT, SCULPT_TOOL_SMEAR) +BLI_INLINE bool SCULPT_tool_is_paint(int tool) +{ + return ELEM(tool, SCULPT_TOOL_PAINT, SCULPT_TOOL_SMEAR); +} #ifdef __cplusplus } |