Blender V5.3
scene_project.cc File Reference

Go to the source code of this file.

Classes

struct  blender::ed::sculpt_paint::brushes::scene_project_cc::LocalData

Namespaces

namespace  blender
 BMesh Iterators.
namespace  blender::ed
namespace  blender::ed::sculpt_paint
namespace  blender::ed::sculpt_paint::brushes
namespace  blender::ed::sculpt_paint::brushes::scene_project_cc

Functions

static float blender::ed::sculpt_paint::brushes::scene_project_cc::absolute_min_distance (const float d1, const float d2)
static void blender::ed::sculpt_paint::brushes::scene_project_cc::object_raycast (const ProjectBrushTarget &project_target, const bool bidirectional, const float3 &normal, const Span< float3 > positions, const Span< float > factors, const MutableSpan< float3 > ray_origins, const MutableSpan< float > best_hit_distances)
static void blender::ed::sculpt_paint::brushes::scene_project_cc::scene_raycast (const Span< ProjectBrushTarget > project_targets, const bool bidirectional, const float minimum_distance, const float3 &normal, const Span< float3 > positions, const Span< float > factors, const MutableSpan< float3 > ray_origins, const MutableSpan< float > r_hit_distances)
static void blender::ed::sculpt_paint::brushes::scene_project_cc::calc_translations (const float3 &normal, const Span< float > factors, const Span< float > hit_distances, const MutableSpan< float3 > r_translations)
static float3 blender::ed::sculpt_paint::brushes::scene_project_cc::calc_normal (const Brush &brush, const StrokeCache &cache)
static void blender::ed::sculpt_paint::brushes::scene_project_cc::calc_faces (const Depsgraph &depsgraph, const Sculpt &sd, const Brush &brush, const bool bidirectional, const float3 &normal, const MeshAttributeData &attribute_data, const Span< float3 > vert_normals, const bke::pbvh::MeshNode &node, Object &object, const PositionDeformData &position_data)
static void blender::ed::sculpt_paint::brushes::scene_project_cc::calc_grids (const Depsgraph &depsgraph, const Sculpt &sd, Object &object, const Brush &brush, const bool bidirectional, const float3 &normal, const bke::pbvh::GridsNode &node, LocalData &tls)
static void blender::ed::sculpt_paint::brushes::scene_project_cc::calc_bmesh (const Depsgraph &depsgraph, const Sculpt &sd, Object &object, const Brush &brush, const bool bidirectional, const float3 &normal, bke::pbvh::BMeshNode &node, LocalData &tls)
void blender::ed::sculpt_paint::brushes::do_scene_project_brush (const Depsgraph &depsgraph, const Sculpt &sd, Object &object, const IndexMask &node_mask)

Detailed Description

The Scene Project brush projects vertices of the active object towards the surfaces of other objects in the scene. Using raycasting along the specified direction, it determines the distance to the nearest target surface for each affected vertex. The vertex is then displaced along the raycasting direction, with the magnitude proportional to the determined distance and the brush's overall influence (strength, falloff, etc.).

Settings:

  • Projection Direction: The ray direction, which can be set to the view normal or the brush plane normal.
  • Bidirectional: When enabled, projects vertices both along the projection direction and its inverse, choosing the closest intersection.
  • Relative: Offsets the projection to maintain the average relative positions of the vertices.

Inverting the brush inverts the ray direction.

Definition in file scene_project.cc.