diff options
Diffstat (limited to 'source/blender/editors/sculpt_paint/sculpt_intern.h')
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt_intern.h | 52 |
1 files changed, 46 insertions, 6 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt_intern.h b/source/blender/editors/sculpt_paint/sculpt_intern.h index a28c18359e5..4817591a5c3 100644 --- a/source/blender/editors/sculpt_paint/sculpt_intern.h +++ b/source/blender/editors/sculpt_paint/sculpt_intern.h @@ -27,6 +27,7 @@ extern "C" { #endif struct AutomaskingCache; +struct AutomaskingNodeData; struct Image; struct ImageUser; struct KeyBlock; @@ -394,16 +395,20 @@ typedef struct AutomaskingSettings { /* Flags from eAutomasking_flag. */ int flags; int initial_face_set; + float cavity_factor; int cavity_blur_steps; struct CurveMapping *cavity_curve; + + float start_normal_limit, start_normal_falloff; + float view_normal_limit, view_normal_falloff; } AutomaskingSettings; typedef struct AutomaskingCache { AutomaskingSettings settings; - bool can_reuse_cavity; - uchar cavity_stroke_id; + bool can_reuse_mask; + uchar current_stroke_id; } AutomaskingCache; typedef struct FilterCache { @@ -463,6 +468,8 @@ typedef struct FilterCache { /* Auto-masking. */ AutomaskingCache *automasking; + float initial_normal[3]; + float view_normal[3]; /* Pre-smoothed colors used by sharpening. Colors are HSL. */ float (*pre_smoothed_color)[4]; @@ -913,6 +920,8 @@ float SCULPT_vertex_mask_get(struct SculptSession *ss, PBVHVertRef vertex); void SCULPT_vertex_color_get(const SculptSession *ss, PBVHVertRef vertex, float r_color[4]); void SCULPT_vertex_color_set(SculptSession *ss, PBVHVertRef vertex, const float color[4]); +bool SCULPT_vertex_is_occluded(SculptSession *ss, PBVHVertRef vertex, bool original); + /** Returns true if a color attribute exists in the current sculpt session. */ bool SCULPT_has_colors(const SculptSession *ss); @@ -1194,7 +1203,8 @@ float SCULPT_brush_strength_factor(struct SculptSession *ss, const float fno[3], float mask, const PBVHVertRef vertex, - int thread_id); + int thread_id, + struct AutomaskingNodeData *automask_data); /** * Tilts a normal by the x and y tilt values using the view axis. @@ -1282,9 +1292,30 @@ enum eDynTopoWarnFlag SCULPT_dynamic_topology_check(Scene *scene, Object *ob); /** \name Auto-masking. * \{ */ +typedef struct AutomaskingNodeData { + PBVHNode *node; + SculptOrigVertData orig_data; + bool have_orig_data; +} AutomaskingNodeData; + +/** Call before PBVH vertex iteration. + * \param automask_data: pointer to an uninitialized AutomaskingNodeData struct. + */ +void SCULPT_automasking_node_begin(struct Object *ob, + const SculptSession *ss, + struct AutomaskingCache *automasking, + AutomaskingNodeData *automask_data, + PBVHNode *node); + +/* Call before SCULPT_automasking_factor_get and SCULPT_brush_strength_factor. */ +void SCULPT_automasking_node_update(SculptSession *ss, + AutomaskingNodeData *automask_data, + PBVHVertexIter *vd); + float SCULPT_automasking_factor_get(struct AutomaskingCache *automasking, SculptSession *ss, - PBVHVertRef vertex); + PBVHVertRef vertex, + AutomaskingNodeData *automask_data); /* Returns the automasking cache depending on the active tool. Used for code that can run both for * brushes and filter. */ @@ -1300,6 +1331,9 @@ float *SCULPT_boundary_automasking_init(Object *ob, eBoundaryAutomaskMode mode, int propagation_steps, float *automask_factor); +bool SCULPT_automasking_needs_normal(const SculptSession *ss, + const Sculpt *sculpt, + const Brush *brush); bool SCULPT_automasking_needs_original(const struct Sculpt *sd, const struct Brush *brush); int SCULPT_automasking_settings_hash(Object *ob, AutomaskingCache *automasking); @@ -1329,8 +1363,14 @@ float *SCULPT_geodesic_from_vertex(Object *ob, PBVHVertRef vertex, float limit_r /** \name Filter API * \{ */ -void SCULPT_filter_cache_init(struct bContext *C, Object *ob, Sculpt *sd, int undo_type); +void SCULPT_filter_cache_init(struct bContext *C, + Object *ob, + Sculpt *sd, + int undo_type, + const int mval[2], + float area_normal_radius); void SCULPT_filter_cache_free(SculptSession *ss); +void SCULPT_mesh_filter_properties(struct wmOperatorType *ot); void SCULPT_mask_filter_smooth_apply( Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode, int smooth_iterations); @@ -1849,7 +1889,7 @@ BLI_INLINE bool SCULPT_tool_is_face_sets(int tool) void SCULPT_stroke_id_ensure(struct Object *ob); void SCULPT_stroke_id_next(struct Object *ob); -bool SCULPT_tool_can_reuse_cavity_mask(int sculpt_tool); +bool SCULPT_tool_can_reuse_automask(int sculpt_tool); #ifdef __cplusplus } |