Blender V4.5
mesh_convert.cc File Reference
#include "CLG_log.h"
#include "MEM_guardedalloc.h"
#include "DNA_curve_types.h"
#include "DNA_key_types.h"
#include "DNA_material_types.h"
#include "DNA_object_types.h"
#include "DNA_pointcloud_types.h"
#include "DNA_scene_types.h"
#include "BLI_index_range.hh"
#include "BLI_listbase.h"
#include "BLI_span.hh"
#include "BLI_string.h"
#include "BLI_utildefines.h"
#include "BLT_translation.hh"
#include "BKE_curves.hh"
#include "BKE_deform.hh"
#include "BKE_displist.h"
#include "BKE_editmesh.hh"
#include "BKE_geometry_set.hh"
#include "BKE_geometry_set_instances.hh"
#include "BKE_key.hh"
#include "BKE_lib_id.hh"
#include "BKE_lib_query.hh"
#include "BKE_main.hh"
#include "BKE_material.hh"
#include "BKE_mball.hh"
#include "BKE_mesh.hh"
#include "BKE_mesh_runtime.hh"
#include "BKE_mesh_wrapper.hh"
#include "BKE_modifier.hh"
#include "BKE_object_types.hh"
#include "BKE_curve.hh"
#include "BKE_object.hh"
#include "BKE_pointcloud.hh"
#include "BKE_curve_to_mesh.hh"
#include "DEG_depsgraph.hh"
#include "DEG_depsgraph_query.hh"

Go to the source code of this file.

Classes

class  StringRefNull

Typedefs

using float3

Functions

static Meshmesh_nurbs_displist_to_mesh (const Curve *cu, const ListBase *dispbase)
static void mesh_copy_texture_space_from_curve_type (const Curve *cu, Mesh *mesh)
MeshBKE_mesh_new_nomain_from_curve_displist (const Object *ob, const ListBase *dispbase)
MeshBKE_mesh_new_nomain_from_curve (const Object *ob)
static void prependPolyLineVert (ListBase *lb, uint index)
static void appendPolyLineVert (ListBase *lb, uint index)
void BKE_mesh_to_curve_nurblist (const Mesh *mesh, ListBase *nurblist, const int edge_users_test)
void BKE_mesh_to_curve (Main *bmain, Depsgraph *depsgraph, Scene *, Object *ob)
void BKE_mesh_to_pointcloud (Main *bmain, Depsgraph *depsgraph, Scene *, Object *ob)
void BKE_pointcloud_to_mesh (Main *bmain, Depsgraph *depsgraph, Scene *, Object *ob)
static Objectobject_for_curve_to_mesh_create (const Object *object)
static void object_for_curve_to_mesh_free (Object *temp_object)
static void curve_to_mesh_eval_ensure (Object &object)
static const Curvesget_evaluated_curves_from_object (const Object *object)
static Meshmesh_new_from_evaluated_curve_type_object (const Object *evaluated_object)
static Meshmesh_new_from_curve_type_object (const Object *object)
static Meshmesh_new_from_mball_object (Object *object)
static Meshmesh_new_from_mesh (Object *object, const Mesh *mesh, const bool ensure_subdivision)
static Meshmesh_new_from_mesh_object_with_layers (Depsgraph *depsgraph, Object *object, const bool preserve_origindex, const bool ensure_subdivision)
static Meshmesh_new_from_mesh_object (Depsgraph *depsgraph, Object *object, const bool preserve_all_data_layers, const bool preserve_origindex, const bool use_subdivision)
MeshBKE_mesh_new_from_object (Depsgraph *depsgraph, Object *object, const bool preserve_all_data_layers, const bool preserve_origindex, const bool ensure_subdivision)
static int foreach_libblock_make_original_callback (LibraryIDLinkCallbackData *cb_data)
static int foreach_libblock_make_usercounts_callback (LibraryIDLinkCallbackData *cb_data)
MeshBKE_mesh_new_from_object_to_bmain (Main *bmain, Depsgraph *depsgraph, Object *object, bool preserve_all_data_layers)
static void copy_loose_vert_hint (const Mesh &src, Mesh &dst)
static void copy_loose_edge_hint (const Mesh &src, Mesh &dst)
static void copy_overlapping_hint (const Mesh &src, Mesh &dst)
static KeyBlockkeyblock_ensure_from_uid (Key &key, const int uid, const StringRefNull name)
static int find_object_active_key_uid (const Key &key, const Object &object)
static void move_shapekey_layers_to_keyblocks (const Mesh &mesh, const CustomData &custom_data, Key &key_dst, const int actshape_uid)
void BKE_mesh_nomain_to_mesh (Mesh *mesh_src, Mesh *mesh_dst, Object *ob)
void BKE_mesh_nomain_to_meshkey (Mesh *mesh_src, Mesh *mesh_dst, KeyBlock *kb)

Variables

static CLG_LogRef LOG = {"bke.mesh_convert"}

Typedef Documentation

◆ float3

Definition at line 619 of file BLI_math_vector_types.hh.

Function Documentation

◆ appendPolyLineVert()

void appendPolyLineVert ( ListBase * lb,
uint index )
static

◆ BKE_mesh_new_from_object()

Mesh * BKE_mesh_new_from_object ( Depsgraph * depsgraph,
Object * object,
bool preserve_all_data_layers,
bool preserve_origindex,
bool ensure_subdivision )

◆ BKE_mesh_new_from_object_to_bmain()

Mesh * BKE_mesh_new_from_object_to_bmain ( Main * bmain,
Depsgraph * depsgraph,
Object * object,
bool preserve_all_data_layers )

◆ BKE_mesh_new_nomain_from_curve()

Mesh * BKE_mesh_new_nomain_from_curve ( const Object * ob)

◆ BKE_mesh_new_nomain_from_curve_displist()

◆ BKE_mesh_nomain_to_mesh()

void BKE_mesh_nomain_to_mesh ( Mesh * mesh_src,
Mesh * mesh_dst,
Object * ob )

Move data from a mesh outside of the main data-base into a mesh in the data-base. Takes ownership of the source mesh.

Definition at line 1085 of file mesh_convert.cc.

References Mesh::active_color_attribute, BKE_id_free(), BKE_mesh_clear_geometry_and_metadata(), BKE_mesh_copy_parameters(), BKE_mesh_nomain_to_mesh(), BLI_assert, CD_MASK_MESH, CD_SHAPEKEY, CLOG_WARN, copy_loose_edge_hint(), copy_loose_vert_hint(), copy_overlapping_hint(), Mesh::corner_data, Mesh::corners_num, CustomData_has_layer(), CustomData_init_from(), Object::data, Mesh::default_color_attribute, Mesh::edge_data, Mesh::edges_num, Mesh::face_data, Mesh::face_offset_indices, Mesh::faces_num, find_object_active_key_uid(), Key::id, Mesh::id, ID_TAG_NO_MAIN, id_us_min(), Mesh::key, LOG, mask(), move_shapekey_layers_to_keyblocks(), ID::name, Mesh::runtime, ID::tag, Mesh::vert_data, Mesh::vertex_group_names, and Mesh::verts_num.

Referenced by blender::ed::sculpt_paint::trim::apply_join_operation(), blender::ed::sculpt_paint::trim::apply_trim(), BKE_mesh_new_from_object_to_bmain(), BKE_mesh_nomain_to_mesh(), BKE_mesh_orco_verts_transform(), blender::ed::object::convert_curves_to_mesh(), blender::ed::object::convert_grease_pencil_to_mesh(), blender::ed::object::convert_mesh_to_mesh(), blender::ed::object::convert_psys_to_mesh(), blender::io::obj::MeshFromGeometry::create_mesh_object(), geometry_extract_apply(), blender::io::ply::importer_main(), blender::io::stl::importer_main(), blender::ed::object::modifier_apply_obdata(), multiresModifier_rebuild_subdiv(), paint_mask_slice_exec(), blender::ed::object::quadriflow_start_job(), blender::io::usd::USDMeshReader::read_object_data(), blender::io::usd::USDShapeReader::read_object_data(), blender::io::alembic::AbcMeshReader::readObjectData(), blender::io::alembic::AbcSubDReader::readObjectData(), blender::ed::geometry::store_result_geometry(), blender::ed::sculpt_paint::store_sculpt_entire_mesh(), and blender::ed::object::voxel_remesh_exec().

◆ BKE_mesh_nomain_to_meshkey()

◆ BKE_mesh_to_curve()

◆ BKE_mesh_to_curve_nurblist()

◆ BKE_mesh_to_pointcloud()

◆ BKE_pointcloud_to_mesh()

◆ copy_loose_edge_hint()

void copy_loose_edge_hint ( const Mesh & src,
Mesh & dst )
static

Definition at line 1015 of file mesh_convert.cc.

References copy_loose_edge_hint(), and Mesh::runtime.

Referenced by BKE_mesh_nomain_to_mesh(), and copy_loose_edge_hint().

◆ copy_loose_vert_hint()

void copy_loose_vert_hint ( const Mesh & src,
Mesh & dst )
static

Definition at line 1007 of file mesh_convert.cc.

References copy_loose_vert_hint(), and Mesh::runtime.

Referenced by BKE_mesh_nomain_to_mesh(), and copy_loose_vert_hint().

◆ copy_overlapping_hint()

void copy_overlapping_hint ( const Mesh & src,
Mesh & dst )
static

Definition at line 1023 of file mesh_convert.cc.

References copy_overlapping_hint().

Referenced by BKE_mesh_nomain_to_mesh(), and copy_overlapping_hint().

◆ curve_to_mesh_eval_ensure()

void curve_to_mesh_eval_ensure ( Object & object)
static

◆ find_object_active_key_uid()

int find_object_active_key_uid ( const Key & key,
const Object & object )
static

◆ foreach_libblock_make_original_callback()

◆ foreach_libblock_make_usercounts_callback()

◆ get_evaluated_curves_from_object()

const Curves * get_evaluated_curves_from_object ( const Object * object)
static

◆ keyblock_ensure_from_uid()

KeyBlock * keyblock_ensure_from_uid ( Key & key,
const int uid,
const StringRefNull name )
static

◆ mesh_copy_texture_space_from_curve_type()

void mesh_copy_texture_space_from_curve_type ( const Curve * cu,
Mesh * mesh )
static

Copy evaluated texture space from curve to mesh.

Note
We disable auto texture space feature since that will cause texture space to evaluate differently for curve and mesh, since curves use control points and handles to calculate the bounding box, and mesh uses the tessellated curve.

Definition at line 318 of file mesh_convert.cc.

References BKE_mesh_texspace_calc(), copy_v3_v3(), CU_TEXSPACE_FLAG_AUTO, mesh_copy_texture_space_from_curve_type(), Curve::texspace_flag, Curve::texspace_location, and Curve::texspace_size.

Referenced by BKE_mesh_new_nomain_from_curve_displist(), and mesh_copy_texture_space_from_curve_type().

◆ mesh_new_from_curve_type_object()

◆ mesh_new_from_evaluated_curve_type_object()

◆ mesh_new_from_mball_object()

◆ mesh_new_from_mesh()

◆ mesh_new_from_mesh_object()

Mesh * mesh_new_from_mesh_object ( Depsgraph * depsgraph,
Object * object,
const bool preserve_all_data_layers,
const bool preserve_origindex,
const bool use_subdivision )
static

◆ mesh_new_from_mesh_object_with_layers()

Mesh * mesh_new_from_mesh_object_with_layers ( Depsgraph * depsgraph,
Object * object,
const bool preserve_origindex,
const bool ensure_subdivision )
static

◆ mesh_nurbs_displist_to_mesh()

◆ move_shapekey_layers_to_keyblocks()

◆ object_for_curve_to_mesh_create()

◆ object_for_curve_to_mesh_free()

void object_for_curve_to_mesh_free ( Object * temp_object)
static

◆ prependPolyLineVert()

void prependPolyLineVert ( ListBase * lb,
uint index )
static

Variable Documentation

◆ LOG

CLG_LogRef LOG = {"bke.mesh_convert"}
static

Definition at line 63 of file mesh_convert.cc.