Blender V4.3
blender::ed::curves::convert_to_particle_system Namespace Reference

Functions

static int find_mface_for_root_position (const Span< float3 > positions, const MFace *mface, const Span< int > possible_mface_indices, const float3 &root_pos)
 
static float4 compute_mface_weights_for_position (const Span< float3 > positions, const MFace &mface, const float3 &position)
 
static void try_convert_single_object (Object &curves_ob, Main &bmain, Scene &scene, bool *r_could_not_convert_some_curves)
 
static int curves_convert_to_particle_system_exec (bContext *C, wmOperator *op)
 

Function Documentation

◆ compute_mface_weights_for_position()

static float4 blender::ed::curves::convert_to_particle_system::compute_mface_weights_for_position ( const Span< float3 > positions,
const MFace & mface,
const float3 & position )
static
Returns
Barycentric coordinates in the MFace.

Definition at line 236 of file curves_ops.cc.

References copy_v3_v3(), interp_weights_poly_v3(), interp_weights_tri_v3(), MFace::v1, MFace::v2, MFace::v3, and MFace::v4.

Referenced by try_convert_single_object().

◆ curves_convert_to_particle_system_exec()

static int blender::ed::curves::convert_to_particle_system::curves_convert_to_particle_system_exec ( bContext * C,
wmOperator * op )
static

◆ find_mface_for_root_position()

static int blender::ed::curves::convert_to_particle_system::find_mface_for_root_position ( const Span< float3 > positions,
const MFace * mface,
const Span< int > possible_mface_indices,
const float3 & root_pos )
static

◆ try_convert_single_object()

static void blender::ed::curves::convert_to_particle_system::try_convert_single_object ( Object & curves_ob,
Main & bmain,
Scene & scene,
bool * r_could_not_convert_some_curves )
static

Definition at line 257 of file curves_ops.cc.

References BKE_bvhtree_from_mesh_get(), BKE_mesh_tessface_calc(), BLI_assert, BLI_bvhtree_find_nearest(), BLI_SCOPED_DEFER, BVHTREE_FROM_CORNER_TRIS, CD_MFACE, CD_ORIGINDEX, HairKey::co, compute_mface_weights_for_position(), copy_v3_v3(), copy_v4_v4(), CustomData_get_layer(), Object::data, DEG_id_tag_update(), BVHTreeNearest::dist_sq, DMCACHE_NOTFOUND, ParticleSettings::draw_step, Mesh::faces_num, Mesh::fdata_legacy, find_mface_for_root_position(), ParticleSystem::flag, float, FLT_MAX, blender::index_mask::IndexMask::foreach_index(), free_bvhtree_from_mesh(), blender::index_mask::IndexMask::from_predicate(), ParticleData::fuv, Curves::geometry, ParticleData::hair, Object::id, ID_RECALC_GEOMETRY, ID_RECALC_PSYS_RESET, ID_RECALC_SYNC_TO_EVAL, blender::math::invert(), blender::Span< T >::is_empty(), LISTBASE_FOREACH, blender::MatBase< T, NumCol, NumRow, Alignment >::location(), MEM_calloc_arrayN, ID::name, BVHTreeFromMesh::nearest_callback, ParticleData::num, ParticleData::num_dmcache, OB_CURVES, OB_MESH, object_add_particle_system(), ParticleSystem::part, PART_FROM_FACE, PART_HAIR, ParticleSystem::particles, Object::particlesystem, ParticleSystemModifierData::psys, psys_changed_type(), PSYS_EDITED, psys_free_particles(), psys_mat_hair_to_object(), blender::MatBase< T, NumCol, NumRow, Alignment >::ptr(), ParticleSystem::recalc, blender::index_mask::IndexMask::size(), blender::offset_indices::OffsetIndices< T >::size(), ParticleData::size, STREQ, Curves::surface, HairKey::time, Mesh::totface_legacy, ParticleData::totkey, ParticleSystem::totpart, blender::math::transform_point(), BVHTreeFromMesh::tree, Object::type, and HairKey::weight.

Referenced by curves_convert_to_particle_system_exec().