Blender V5.0
blender::ed::sculpt_paint::AddOperationExecutor Struct Reference

Public Member Functions

 AddOperationExecutor (const bContext &C)
void execute (AddOperation &self, const bContext &C, const StrokeExtension &stroke_extension)
void sample_in_center_with_symmetry (Vector< float2 > &r_sampled_uvs)
void sample_in_center (Vector< float2 > &r_sampled_uvs, const float3 &ray_start_su, const float3 &ray_end_su)
void sample_projected_with_symmetry (RandomNumberGenerator &rng, Vector< float2 > &r_sampled_uvs)
void sample_projected (RandomNumberGenerator &rng, Vector< float2 > &r_sampled_uvs, const float4x4 &brush_transform)
void sample_spherical_with_symmetry (RandomNumberGenerator &rng, Vector< float2 > &r_sampled_uvs)
void sample_spherical (RandomNumberGenerator &rng, Vector< float2 > &r_sampled_uvs, const float3 &brush_pos_su, const float brush_radius_su, const float3 &view_direction_su)
void ensure_curve_roots_kdtree ()

Public Attributes

AddOperationself_ = nullptr
CurvesSculptCommonContext ctx_
Objectcurves_ob_orig_ = nullptr
Curvescurves_id_orig_ = nullptr
CurvesGeometrycurves_orig_ = nullptr
Objectsurface_ob_eval_ = nullptr
Meshsurface_eval_ = nullptr
Span< float3surface_positions_eval_
Span< int > surface_corner_verts_eval_
Span< int3surface_corner_tris_eval_
VArraySpan< float2surface_uv_map_eval_
bke::BVHTreeFromMesh surface_bvh_eval_
CurvesSculptcurves_sculpt_ = nullptr
const Brushbrush_ = nullptr
const BrushCurvesSculptSettingsbrush_settings_ = nullptr
int add_amount_
bool use_front_face_
float brush_radius_re_
float2 brush_pos_re_
CurvesSurfaceTransforms transforms_

Detailed Description

Utility class that actually executes the update when the stroke is updated. That's useful because it avoids passing a very large number of parameters between functions.

Definition at line 79 of file curves_sculpt_add.cc.

Constructor & Destructor Documentation

◆ AddOperationExecutor()

blender::ed::sculpt_paint::AddOperationExecutor::AddOperationExecutor ( const bContext & C)
inline

Definition at line 106 of file curves_sculpt_add.cc.

References C, and ctx_.

Member Function Documentation

◆ ensure_curve_roots_kdtree()

void blender::ed::sculpt_paint::AddOperationExecutor::ensure_curve_roots_kdtree ( )
inline

Definition at line 498 of file curves_sculpt_add.cc.

References curves_orig_, and self_.

Referenced by execute().

◆ execute()

void blender::ed::sculpt_paint::AddOperationExecutor::execute ( AddOperation & self,
const bContext & C,
const StrokeExtension & stroke_extension )
inline

Definition at line 108 of file curves_sculpt_add.cc.

References add_amount_, blender::geometry::add_curves_on_mesh(), Geometry::attributes, BKE_object_get_evaluated_mesh(), BKE_paint_brush_for_read(), BLI_assert_unreachable, brush_, BRUSH_CURVES_SCULPT_FLAG_INTERPOLATE_LENGTH, BRUSH_CURVES_SCULPT_FLAG_INTERPOLATE_POINT_COUNT, BRUSH_CURVES_SCULPT_FLAG_INTERPOLATE_RADIUS, BRUSH_CURVES_SCULPT_FLAG_INTERPOLATE_SHAPE, BRUSH_FRONTFACE, brush_pos_re_, blender::ed::sculpt_paint::brush_radius_get(), brush_radius_re_, brush_settings_, C, blender::bke::Corner, blender::geometry::AddCurvesOnMeshInputs::corner_normals_su, ctx_, CTX_data_active_object(), curves_id_orig_, curves_ob_orig_, curves_orig_, curves_sculpt_, Object::data, DEG_get_evaluated(), DEG_id_tag_update(), ED_region_tag_redraw(), ensure_curve_roots_kdtree(), Mesh::faces_num, blender::geometry::AddCurvesOnMeshInputs::fallback_curve_length, blender::geometry::AddCurvesOnMeshInputs::fallback_curve_radius, blender::geometry::AddCurvesOnMeshInputs::fallback_point_count, blender::ed::curves::fill_selection_true(), blender::RandomNumberGenerator::from_random_seed(), ID_RECALC_GEOMETRY, blender::geometry::AddCurvesOnMeshInputs::interpolate_length, blender::geometry::AddCurvesOnMeshInputs::interpolate_point_count, blender::geometry::AddCurvesOnMeshInputs::interpolate_radius, blender::geometry::AddCurvesOnMeshInputs::interpolate_resolution, blender::geometry::AddCurvesOnMeshInputs::interpolate_shape, blender::Span< T >::is_empty(), blender::Vector< T, InlineBufferCapacity, Allocator >::is_empty(), blender::bke::MutableAttributeAccessor::lookup_for_write_span(), blender::bounds::min_max(), blender::ed::sculpt_paint::StrokeExtension::mouse_position, NC_GEOM, ND_DATA, blender::geometry::AddCurvesOnMeshOutputs::new_curves_range, blender::geometry::AddCurvesOnMeshOutputs::new_points_range, OB_MESH, blender::geometry::AddCurvesOnMeshInputs::old_roots_kdtree, PAINT_FALLOFF_SHAPE_SPHERE, PAINT_FALLOFF_SHAPE_TUBE, blender::bke::Point, blender::ed::sculpt_paint::remember_stroke_position(), blender::ed::sculpt_paint::report_empty_evaluated_surface(), blender::ed::sculpt_paint::report_empty_original_surface(), blender::ed::sculpt_paint::report_invalid_uv_map(), blender::ed::sculpt_paint::report_missing_surface(), blender::ed::sculpt_paint::report_missing_uv_map_on_evaluated_surface(), blender::ed::sculpt_paint::report_missing_uv_map_on_original_surface(), blender::ed::sculpt_paint::StrokeExtension::reports, blender::geometry::AddCurvesOnMeshInputs::reverse_uv_sampler, sample_in_center_with_symmetry(), sample_projected_with_symmetry(), sample_spherical_with_symmetry(), self, self_, blender::geometry::AddCurvesOnMeshInputs::surface, surface_bvh_eval_, blender::geometry::AddCurvesOnMeshInputs::surface_corner_tris, surface_corner_tris_eval_, surface_corner_verts_eval_, surface_eval_, surface_ob_eval_, surface_positions_eval_, surface_uv_map_eval_, blender::math::transform_point(), blender::geometry::AddCurvesOnMeshInputs::transforms, transforms_, U, use_front_face_, USER_ORBIT_SELECTION, blender::geometry::AddCurvesOnMeshOutputs::uv_error, blender::geometry::AddCurvesOnMeshInputs::uvs, and WM_main_add_notifier().

Referenced by blender::ed::sculpt_paint::AddOperation::on_stroke_extended().

◆ sample_in_center()

◆ sample_in_center_with_symmetry()

void blender::ed::sculpt_paint::AddOperationExecutor::sample_in_center_with_symmetry ( Vector< float2 > & r_sampled_uvs)
inline

◆ sample_projected()

◆ sample_projected_with_symmetry()

void blender::ed::sculpt_paint::AddOperationExecutor::sample_projected_with_symmetry ( RandomNumberGenerator & rng,
Vector< float2 > & r_sampled_uvs )
inline

Sample points by shooting rays within the brush radius in the 3D view.

Definition at line 315 of file curves_sculpt_add.cc.

References curves_id_orig_, blender::ed::sculpt_paint::get_symmetry_brush_transforms(), and sample_projected().

Referenced by execute().

◆ sample_spherical()

void blender::ed::sculpt_paint::AddOperationExecutor::sample_spherical ( RandomNumberGenerator & rng,
Vector< float2 > & r_sampled_uvs,
const float3 & brush_pos_su,
const float brush_radius_su,
const float3 & view_direction_su )
inline

◆ sample_spherical_with_symmetry()

void blender::ed::sculpt_paint::AddOperationExecutor::sample_spherical_with_symmetry ( RandomNumberGenerator & rng,
Vector< float2 > & r_sampled_uvs )
inline

Member Data Documentation

◆ add_amount_

int blender::ed::sculpt_paint::AddOperationExecutor::add_amount_

Definition at line 98 of file curves_sculpt_add.cc.

Referenced by execute(), and sample_projected().

◆ brush_

const Brush* blender::ed::sculpt_paint::AddOperationExecutor::brush_ = nullptr

Definition at line 96 of file curves_sculpt_add.cc.

Referenced by execute().

◆ brush_pos_re_

float2 blender::ed::sculpt_paint::AddOperationExecutor::brush_pos_re_

◆ brush_radius_re_

float blender::ed::sculpt_paint::AddOperationExecutor::brush_radius_re_

Definition at line 101 of file curves_sculpt_add.cc.

Referenced by execute(), sample_projected(), and sample_spherical_with_symmetry().

◆ brush_settings_

const BrushCurvesSculptSettings* blender::ed::sculpt_paint::AddOperationExecutor::brush_settings_ = nullptr

Definition at line 97 of file curves_sculpt_add.cc.

Referenced by execute().

◆ ctx_

CurvesSculptCommonContext blender::ed::sculpt_paint::AddOperationExecutor::ctx_

◆ curves_id_orig_

Curves* blender::ed::sculpt_paint::AddOperationExecutor::curves_id_orig_ = nullptr

◆ curves_ob_orig_

Object* blender::ed::sculpt_paint::AddOperationExecutor::curves_ob_orig_ = nullptr

Definition at line 83 of file curves_sculpt_add.cc.

Referenced by execute().

◆ curves_orig_

CurvesGeometry* blender::ed::sculpt_paint::AddOperationExecutor::curves_orig_ = nullptr

Definition at line 85 of file curves_sculpt_add.cc.

Referenced by ensure_curve_roots_kdtree(), and execute().

◆ curves_sculpt_

CurvesSculpt* blender::ed::sculpt_paint::AddOperationExecutor::curves_sculpt_ = nullptr

Definition at line 95 of file curves_sculpt_add.cc.

Referenced by execute().

◆ self_

AddOperation* blender::ed::sculpt_paint::AddOperationExecutor::self_ = nullptr

Definition at line 80 of file curves_sculpt_add.cc.

Referenced by ensure_curve_roots_kdtree(), and execute().

◆ surface_bvh_eval_

bke::BVHTreeFromMesh blender::ed::sculpt_paint::AddOperationExecutor::surface_bvh_eval_

◆ surface_corner_tris_eval_

Span<int3> blender::ed::sculpt_paint::AddOperationExecutor::surface_corner_tris_eval_

Definition at line 91 of file curves_sculpt_add.cc.

Referenced by execute(), sample_in_center(), and sample_projected().

◆ surface_corner_verts_eval_

Span<int> blender::ed::sculpt_paint::AddOperationExecutor::surface_corner_verts_eval_

Definition at line 90 of file curves_sculpt_add.cc.

Referenced by execute(), and sample_in_center().

◆ surface_eval_

Mesh* blender::ed::sculpt_paint::AddOperationExecutor::surface_eval_ = nullptr

Definition at line 88 of file curves_sculpt_add.cc.

Referenced by execute(), and sample_projected().

◆ surface_ob_eval_

Object* blender::ed::sculpt_paint::AddOperationExecutor::surface_ob_eval_ = nullptr

Definition at line 87 of file curves_sculpt_add.cc.

Referenced by execute().

◆ surface_positions_eval_

Span<float3> blender::ed::sculpt_paint::AddOperationExecutor::surface_positions_eval_

Definition at line 89 of file curves_sculpt_add.cc.

Referenced by execute(), and sample_in_center().

◆ surface_uv_map_eval_

VArraySpan<float2> blender::ed::sculpt_paint::AddOperationExecutor::surface_uv_map_eval_

Definition at line 92 of file curves_sculpt_add.cc.

Referenced by execute(), sample_in_center(), and sample_projected().

◆ transforms_

CurvesSurfaceTransforms blender::ed::sculpt_paint::AddOperationExecutor::transforms_

◆ use_front_face_

bool blender::ed::sculpt_paint::AddOperationExecutor::use_front_face_

Definition at line 99 of file curves_sculpt_add.cc.

Referenced by execute(), sample_projected(), and sample_spherical().


The documentation for this struct was generated from the following file: