Blender  V3.3
Functions
blender::ed::curves::convert_to_particle_system Namespace Reference

Functions

static int find_mface_for_root_position (const Mesh &mesh, const Span< int > possible_mface_indices, const float3 &root_pos)
 
static float4 compute_mface_weights_for_position (const Mesh &mesh, 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 Mesh mesh,
const MFace mface,
const float3 position 
)
static
Returns
Barycentric coordinates in the MFace.

Definition at line 189 of file curves_ops.cc.

References MVert::co, copy_v3_v3(), interp_weights_poly_v3(), interp_weights_tri_v3(), mesh, Mesh::mvert, 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 Mesh mesh,
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 213 of file curves_ops.cc.

References BKE_bvhtree_from_mesh_get(), BKE_mesh_runtime_looptri_ensure(), BKE_mesh_runtime_looptri_len(), BKE_mesh_tessface_calc(), BLI_assert, BLI_bvhtree_find_nearest(), BLI_SCOPED_DEFER, BVHTREE_FROM_LOOPTRI, CD_ORIGINDEX, HairKey::co, compute_mface_weights_for_position(), copy_v3_v3(), copy_v4_v4(), curves, CustomData_get_layer(), Object::data, DEG_id_tag_update(), BVHTreeNearest::dist_sq, DMCACHE_NOTFOUND, ParticleSettings::draw_step, Mesh::fdata, find_mface_for_root_position(), blender::IndexRange::first(), ParticleSystem::flag, float(), free_bvhtree_from_mesh(), ParticleData::fuv, Curves::geometry, ParticleData::hair, Object::id, ParticleSettings::id, ID_RECALC_COPY_ON_WRITE, ID_RECALC_GEOMETRY, ID_RECALC_PSYS_RESET, BVHTreeNearest::index, blender::float4x4::inverted(), LISTBASE_FOREACH, MEM_calloc_arrayN, Mesh::mface, 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, MLoopTri::poly, ParticleSystemModifierData::psys, psys_changed_type(), PSYS_EDITED, psys_free_particles(), psys_mat_hair_to_object(), ParticleSystem::recalc, scene, blender::IndexRange::size(), STREQ, Curves::surface, HairKey::time, Mesh::totface, ParticleData::totkey, ParticleSettings::totpart, ParticleSystem::totpart, Mesh::totpoly, BVHTreeFromMesh::tree, Object::type, ParticleSettings::type, blender::float4x4::values, and blender::bke::CurvesGeometry::wrap().

Referenced by curves_convert_to_particle_system_exec().