Blender V4.3
object.cc File Reference
#include <cmath>
#include <cstdio>
#include <cstring>
#include <optional>
#include "CLG_log.h"
#include "MEM_guardedalloc.h"
#include "DNA_anim_types.h"
#include "DNA_armature_types.h"
#include "DNA_camera_types.h"
#include "DNA_collection_types.h"
#include "DNA_constraint_types.h"
#include "DNA_defaults.h"
#include "DNA_dynamicpaint_types.h"
#include "DNA_effect_types.h"
#include "DNA_fluid_types.h"
#include "DNA_gpencil_legacy_types.h"
#include "DNA_gpencil_modifier_types.h"
#include "DNA_grease_pencil_types.h"
#include "DNA_key_types.h"
#include "DNA_lattice_types.h"
#include "DNA_light_types.h"
#include "DNA_lightprobe_types.h"
#include "DNA_material_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_meta_types.h"
#include "DNA_movieclip_types.h"
#include "DNA_nla_types.h"
#include "DNA_object_fluidsim_types.h"
#include "DNA_object_types.h"
#include "DNA_pointcloud_types.h"
#include "DNA_rigidbody_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "DNA_sequence_types.h"
#include "DNA_shader_fx_types.h"
#include "DNA_space_types.h"
#include "DNA_view3d_types.h"
#include "DNA_world_types.h"
#include "BLI_blenlib.h"
#include "BLI_bounds.hh"
#include "BLI_kdtree.h"
#include "BLI_linklist.h"
#include "BLI_listbase.h"
#include "BLI_math_matrix.h"
#include "BLI_math_rotation.h"
#include "BLI_math_vector_types.hh"
#include "BLI_threads.h"
#include "BLI_utildefines.h"
#include "BLT_translation.hh"
#include "BKE_action.hh"
#include "BKE_anim_data.hh"
#include "BKE_anim_path.h"
#include "BKE_anim_visualization.h"
#include "BKE_animsys.h"
#include "BKE_armature.hh"
#include "BKE_asset.hh"
#include "BKE_bpath.hh"
#include "BKE_camera.h"
#include "BKE_collection.hh"
#include "BKE_constraint.h"
#include "BKE_crazyspace.hh"
#include "BKE_curve.hh"
#include "BKE_curves.hh"
#include "BKE_deform.hh"
#include "BKE_displist.h"
#include "BKE_duplilist.hh"
#include "BKE_editmesh.hh"
#include "BKE_editmesh_cache.hh"
#include "BKE_effect.h"
#include "BKE_fcurve.hh"
#include "BKE_fcurve_driver.h"
#include "BKE_geometry_set.hh"
#include "BKE_geometry_set_instances.hh"
#include "BKE_global.hh"
#include "BKE_gpencil_geom_legacy.h"
#include "BKE_gpencil_legacy.h"
#include "BKE_gpencil_modifier_legacy.h"
#include "BKE_grease_pencil.hh"
#include "BKE_idprop.hh"
#include "BKE_idtype.hh"
#include "BKE_image.hh"
#include "BKE_key.hh"
#include "BKE_lattice.hh"
#include "BKE_layer.hh"
#include "BKE_lib_id.hh"
#include "BKE_lib_query.hh"
#include "BKE_lib_remap.hh"
#include "BKE_light.h"
#include "BKE_lightprobe.h"
#include "BKE_linestyle.h"
#include "BKE_main.hh"
#include "BKE_material.h"
#include "BKE_mball.hh"
#include "BKE_mesh.hh"
#include "BKE_mesh_legacy_derived_mesh.hh"
#include "BKE_mesh_wrapper.hh"
#include "BKE_modifier.hh"
#include "BKE_multires.hh"
#include "BKE_node.hh"
#include "BKE_object.hh"
#include "BKE_object_types.hh"
#include "BKE_paint.hh"
#include "BKE_particle.h"
#include "BKE_pointcache.h"
#include "BKE_pointcloud.hh"
#include "BKE_pose_backup.h"
#include "BKE_preview_image.hh"
#include "BKE_rigidbody.h"
#include "BKE_scene.hh"
#include "BKE_shader_fx.h"
#include "BKE_softbody.h"
#include "BKE_speaker.h"
#include "BKE_subdiv_ccg.hh"
#include "BKE_subsurf.hh"
#include "BKE_vfont.hh"
#include "BKE_volume.hh"
#include "DEG_depsgraph.hh"
#include "DEG_depsgraph_query.hh"
#include "DRW_engine.hh"
#include "BLO_read_write.hh"
#include "BLO_readfile.hh"
#include "SEQ_sequencer.hh"
#include "ANIM_action_legacy.hh"
#include "CCGSubSurf.h"
#include "atomic_ops.h"

Go to the source code of this file.

Classes

struct  ObTfmBack
 

Macros

#define DNA_DEPRECATED_ALLOW
 
#define VPARENT_THREADING_HACK
 
#define TFMCPY(_v)   (obtfm->_v = ob->_v)
 
#define TFMCPY3D(_v)   copy_v3_v3(obtfm->_v, ob->_v)
 
#define TFMCPY4D(_v)   copy_v4_v4(obtfm->_v, ob->_v)
 
#define TFMCPY(_v)   (object_dst->_v = object_src->_v)
 
#define TFMCPY3D(_v)   copy_v3_v3(object_dst->_v, object_src->_v)
 
#define TFMCPY4D(_v)   copy_v4_v4(object_dst->_v, object_src->_v)
 

Functions

static void copy_object_pose (Object *obn, const Object *ob, const int flag)
 
static void object_init_data (ID *id)
 
static void object_copy_data (Main *bmain, std::optional< Library * >, ID *id_dst, const ID *id_src, const int flag)
 
static void object_free_data (ID *id)
 
static void library_foreach_modifiersForeachIDLink (void *user_data, Object *, ID **id_pointer, int cb_flag)
 
static void library_foreach_gpencil_modifiersForeachIDLink (void *user_data, Object *, ID **id_pointer, int cb_flag)
 
static void library_foreach_shaderfxForeachIDLink (void *user_data, Object *, ID **id_pointer, int cb_flag)
 
static void library_foreach_constraintObjectLooper (bConstraint *, ID **id_pointer, bool is_reference, void *user_data)
 
static void library_foreach_particlesystemsObjectLooper (ParticleSystem *, ID **id_pointer, void *user_data, int cb_flag)
 
static void object_foreach_id (ID *id, LibraryForeachIDData *data)
 
static void object_foreach_path_pointcache (ListBase *ptcache_list, BPathForeachPathData *bpath_data)
 
static void object_foreach_path (ID *id, BPathForeachPathData *bpath_data)
 
static void object_foreach_cache (ID *id, IDTypeForeachCacheFunctionCallback function_callback, void *user_data)
 
static void object_blend_write (BlendWriter *writer, ID *id, const void *id_address)
 
static void direct_link_nlastrips (BlendDataReader *reader, ListBase *strips)
 
static void object_blend_read_data (BlendDataReader *reader, ID *id)
 
static void object_blend_read_after_liblink (BlendLibReader *reader, ID *id)
 
PartEffBKE_object_do_version_give_parteff_245 (Object *ob)
 
static void object_lib_override_apply_post (ID *id_dst, ID *id_src)
 
static IDPropertyobject_asset_dimensions_property (Object *ob)
 
static void object_asset_metadata_ensure (void *asset_ptr, AssetMetaData *asset_data)
 
void BKE_object_workob_clear (Object *workob)
 
void BKE_object_free_particlesystems (Object *ob)
 
void BKE_object_free_softbody (Object *ob)
 
void BKE_object_free_curve_cache (Object *ob)
 
void BKE_object_free_modifiers (Object *ob, const int flag)
 
void BKE_object_free_shaderfx (Object *ob, const int flag)
 
void BKE_object_modifier_hook_reset (Object *ob, HookModifierData *hmd)
 
void BKE_object_modifier_gpencil_hook_reset (Object *ob, HookGpencilModifierData *hmd)
 
void BKE_object_modifier_set_active (Object *ob, ModifierData *md)
 
ModifierDataBKE_object_active_modifier (const Object *ob)
 
bool BKE_object_supports_modifiers (const Object *ob)
 
bool BKE_object_support_modifier_type_check (const Object *ob, int modifier_type)
 
static bool object_modifier_type_copy_check (ModifierType md_type)
 
static ParticleSystemobject_copy_modifier_particle_system_ensure (Main *bmain, const Scene *scene, Object *ob_dst, ParticleSystem *psys_src)
 
bool BKE_object_copy_modifier (Main *bmain, const Scene *scene, Object *ob_dst, const Object *ob_src, const ModifierData *md_src)
 
bool BKE_object_modifier_stack_copy (Object *ob_dst, const Object *ob_src, const bool do_copy_all, const int flag_subdata)
 
void BKE_object_link_modifiers (Object *ob_dst, const Object *ob_src)
 
static void copy_ccg_data (Mesh *mesh_destination, Mesh *mesh_source, const eCustomDataType layer_type)
 
static void object_update_from_subsurf_ccg (Object *object)
 
void BKE_object_eval_assign_data (Object *object_eval, ID *data_eval, bool is_owned)
 
void BKE_object_free_derived_caches (Object *ob)
 
void BKE_object_free_caches (Object *object)
 
bool BKE_object_is_in_editmode (const Object *ob)
 
bool BKE_object_is_in_editmode_vgroup (const Object *ob)
 
bool BKE_object_data_is_in_editmode (const Object *ob, const ID *id)
 
char * BKE_object_data_editmode_flush_ptr_get (ID *id)
 
bool BKE_object_is_in_wpaint_select_vert (const Object *ob)
 
bool BKE_object_has_mode_data (const Object *ob, eObjectMode object_mode)
 
bool BKE_object_is_mode_compat (const Object *ob, eObjectMode object_mode)
 
int BKE_object_visibility (const Object *ob, const int dag_eval_mode)
 
bool BKE_object_exists_check (Main *bmain, const Object *obtest)
 
static const char * get_obdata_defname (int type)
 
static void object_init (Object *ob, const short ob_type)
 
void * BKE_object_obdata_add_from_type (Main *bmain, int type, const char *name)
 
int BKE_object_obdata_to_type (const ID *id)
 
ObjectBKE_object_add_only_object (Main *bmain, int type, const char *name)
 
static Objectobject_add_common (Main *bmain, const Scene *scene, ViewLayer *view_layer, int type, const char *name)
 
ObjectBKE_object_add (Main *bmain, Scene *scene, ViewLayer *view_layer, int type, const char *name)
 
ObjectBKE_object_add_from (Main *bmain, Scene *scene, ViewLayer *view_layer, int type, const char *name, Object *ob_src)
 
ObjectBKE_object_add_for_data (Main *bmain, const Scene *scene, ViewLayer *view_layer, int type, const char *name, ID *data, bool do_id_user)
 
void BKE_object_copy_softbody (Object *ob_dst, const Object *ob_src, const int flag)
 
ParticleSystemBKE_object_copy_particlesystem (ParticleSystem *psys, const int flag)
 
void BKE_object_copy_particlesystems (Object *ob_dst, const Object *ob_src, const int flag)
 
bool BKE_object_pose_context_check (const Object *ob)
 
ObjectBKE_object_pose_armature_get (Object *ob)
 
ObjectBKE_object_pose_armature_get_with_wpaint_check (Object *ob)
 
ObjectBKE_object_pose_armature_get_visible (Object *ob, const Scene *scene, ViewLayer *view_layer, View3D *v3d)
 
Vector< Object * > BKE_object_pose_array_get_ex (const Scene *scene, ViewLayer *view_layer, View3D *v3d, bool unique)
 
Vector< Object * > BKE_object_pose_array_get_unique (const Scene *scene, ViewLayer *view_layer, View3D *v3d)
 
Vector< Object * > BKE_object_pose_array_get (const Scene *scene, ViewLayer *view_layer, View3D *v3d)
 
blender::Vector< Base * > BKE_object_pose_base_array_get_ex (const Scene *scene, ViewLayer *view_layer, View3D *v3d, bool unique)
 
Vector< Base * > BKE_object_pose_base_array_get_unique (const Scene *scene, ViewLayer *view_layer, View3D *v3d)
 
Vector< Base * > BKE_object_pose_base_array_get (const Scene *scene, ViewLayer *view_layer, View3D *v3d)
 
void BKE_object_transform_copy (Object *ob_tar, const Object *ob_src)
 
ObjectBKE_object_duplicate (Main *bmain, Object *ob, eDupli_ID_Flags dupflag, uint duplicate_options)
 
bool BKE_object_is_libdata (const Object *ob)
 
bool BKE_object_obdata_is_libdata (const Object *ob)
 
void BKE_object_obdata_size_init (Object *ob, const float size)
 
Object Matrix Get/Set API
void BKE_object_scale_to_mat3 (const Object *ob, float mat[3][3])
 
void BKE_object_rot_to_mat3 (const Object *ob, float mat[3][3], bool use_drot)
 
void BKE_object_mat3_to_rot (Object *ob, float mat[3][3], bool use_compat)
 
void BKE_object_tfm_protected_backup (const Object *ob, ObjectTfmProtectedChannels *obtfm)
 
void BKE_object_tfm_protected_restore (Object *ob, const ObjectTfmProtectedChannels *obtfm, const short protectflag)
 
void BKE_object_tfm_copy (Object *object_dst, const Object *object_src)
 
void BKE_object_to_mat3 (const Object *ob, float r_mat[3][3])
 
void BKE_object_to_mat4 (const Object *ob, float r_mat[4][4])
 
void BKE_object_matrix_local_get (Object *ob, float r_mat[4][4])
 
static bool ob_parcurve (const Object *ob, Object *par, float r_mat[4][4])
 
static void ob_parbone (const Object *ob, const Object *par, float r_mat[4][4])
 
static void give_parvert (const Object *par, int nr, float vec[3])
 
static void ob_parvert3 (const Object *ob, const Object *par, float r_mat[4][4])
 
void BKE_object_get_parent_matrix (const Object *ob, Object *par, float r_parentmat[4][4])
 
Object Matrix Evaluation API
static void solve_parenting (const Object *ob, Object *par, const bool set_origin, float r_obmat[4][4], float r_originmat[3][3])
 
static void object_where_is_calc_ex (Depsgraph *depsgraph, Scene *scene, Object *ob, float ctime, RigidBodyWorld *rbw, float r_originmat[3][3])
 
void BKE_object_where_is_calc_time (Depsgraph *depsgraph, Scene *scene, Object *ob, float ctime)
 
void BKE_object_where_is_calc_mat4 (const Object *ob, float r_obmat[4][4])
 
void BKE_object_where_is_calc_ex (Depsgraph *depsgraph, Scene *scene, RigidBodyWorld *rbw, Object *ob, float r_originmat[3][3])
 
void BKE_object_where_is_calc (Depsgraph *depsgraph, Scene *scene, Object *ob)
 
blender::float4x4 BKE_object_calc_parent (Depsgraph *depsgraph, Scene *scene, Object *ob)
 
void BKE_object_apply_mat4_ex (Object *ob, const float mat[4][4], Object *parent, const float parentinv[4][4], const bool use_compat)
 
void BKE_object_apply_mat4 (Object *ob, const float mat[4][4], const bool use_compat, const bool use_parent)
 
void BKE_object_apply_parent_inverse (Object *ob)
 
Object Bounding Box API
void BKE_boundbox_init_from_minmax (BoundBox *bb, const float min[3], const float max[3])
 
void BKE_boundbox_minmax (const BoundBox *bb, const float obmat[4][4], float r_min[3], float r_max[3])
 
std::optional< blender::Bounds< blender::float3 > > BKE_object_boundbox_get (const Object *ob)
 
std::optional< Bounds< float3 > > BKE_object_boundbox_eval_cached_get (const Object *ob)
 
std::optional< Bounds< float3 > > BKE_object_evaluated_geometry_bounds (const Object *ob)
 
Object Dimension Get/Set
Warning
Setting dimensions is prone to feedback loops in evaluation.
static float3 boundbox_to_dimensions (const Object *ob, const std::optional< Bounds< float3 > > bounds)
 
void BKE_object_dimensions_get (Object *ob, float r_vec[3])
 
void BKE_object_dimensions_eval_cached_get (Object *ob, float r_vec[3])
 
void BKE_object_dimensions_set_ex (Object *ob, const float value[3], int axis_mask, const float ob_scale_orig[3], const float ob_obmat_orig[4][4])
 
void BKE_object_dimensions_set (Object *ob, const float value[3], int axis_mask)
 
void BKE_object_minmax (Object *ob, float r_min[3], float r_max[3])
 
void BKE_object_empty_draw_type_set (Object *ob, const int value)
 
bool BKE_object_empty_image_frame_is_visible_in_view3d (const Object *ob, const RegionView3D *rv3d)
 
bool BKE_object_empty_image_data_is_visible_in_view3d (const Object *ob, const RegionView3D *rv3d)
 
bool BKE_object_minmax_empty_drawtype (const Object *ob, float r_min[3], float r_max[3])
 
bool BKE_object_minmax_dupli (Depsgraph *depsgraph, Scene *scene, Object *ob, float r_min[3], float r_max[3], const bool use_hidden)
 
void BKE_object_foreach_display_point (Object *ob, const float obmat[4][4], void(*func_cb)(const float[3], void *), void *user_data)
 
void BKE_scene_foreach_display_point (Depsgraph *depsgraph, void(*func_cb)(const float[3], void *), void *user_data)
 
Object Transform Channels (Backup/Restore)
void * BKE_object_tfm_backup (Object *ob)
 
void BKE_object_tfm_restore (Object *ob, void *obtfm_pt)
 
Object Evaluation/Update API
void BKE_object_handle_update_ex (Depsgraph *depsgraph, Scene *scene, Object *ob, RigidBodyWorld *rbw)
 
void BKE_object_handle_update (Depsgraph *depsgraph, Scene *scene, Object *ob)
 
void BKE_object_sculpt_data_create (Object *ob)
 
bool BKE_object_obdata_texspace_get (Object *ob, char **r_texspace_flag, float **r_texspace_location, float **r_texspace_size)
 
MeshBKE_object_get_evaluated_mesh_no_subsurf_unchecked (const Object *object)
 
MeshBKE_object_get_evaluated_mesh_no_subsurf (const Object *object)
 
MeshBKE_object_get_evaluated_mesh_unchecked (const Object *object_eval)
 
MeshBKE_object_get_evaluated_mesh (const Object *object_eval)
 
MeshBKE_object_get_pre_modified_mesh (const Object *object)
 
MeshBKE_object_get_original_mesh (const Object *object)
 
const MeshBKE_object_get_editmesh_eval_final (const Object *object)
 
const MeshBKE_object_get_editmesh_eval_cage (const Object *object)
 
const MeshBKE_object_get_mesh_deform_eval (const Object *object)
 
LatticeBKE_object_get_lattice (const Object *object)
 
LatticeBKE_object_get_evaluated_lattice (const Object *object)
 
Object Point Cache
static int pc_cmp (const void *a, const void *b)
 
int BKE_object_insert_ptcache (Object *ob)
 
static int pc_findindex (ListBase *listbase, int index)
 
void BKE_object_delete_ptcache (Object *ob, int index)
 
Object Data Shape Key Insert
static KeyBlockinsert_meshkey (Main *bmain, Object *ob, const char *name, const bool from_mix)
 
static KeyBlockinsert_lattkey (Main *bmain, Object *ob, const char *name, const bool from_mix)
 
static KeyBlockinsert_curvekey (Main *bmain, Object *ob, const char *name, const bool from_mix)
 
Object Shape Key API
KeyBlockBKE_object_shapekey_insert (Main *bmain, Object *ob, const char *name, const bool from_mix)
 
bool BKE_object_shapekey_free (Main *bmain, Object *ob)
 
bool BKE_object_shapekey_remove (Main *bmain, Object *ob, KeyBlock *kb)
 
Object Query API
bool BKE_object_parent_loop_check (const Object *par, const Object *ob)
 
bool BKE_object_flag_test_recursive (const Object *ob, short flag)
 
bool BKE_object_is_child_recursive (const Object *ob_parent, const Object *ob_child)
 
int BKE_object_is_modified (Scene *scene, Object *ob)
 
bool BKE_object_moves_in_time (const Object *object, bool recurse_parent)
 
static bool object_moves_in_time (const Object *object)
 
static bool object_deforms_in_time (Object *object)
 
static bool constructive_modifier_is_deform_modified (Object *ob, ModifierData *md)
 
static bool modifiers_has_animation_check (const Object *ob)
 
int BKE_object_is_deform_modified (Scene *scene, Object *ob)
 
int BKE_object_scenes_users_get (Main *bmain, Object *ob)
 
MovieClipBKE_object_movieclip_get (Scene *scene, const Object *ob, bool use_default)
 
bool BKE_object_supports_material_slots (Object *ob)
 
Object Runtime
void BKE_object_runtime_reset (Object *object)
 
void BKE_object_runtime_reset_on_copy (Object *object, const int)
 
void BKE_object_runtime_free_data (Object *object)
 
Object Relationships
static Objectobrel_armature_find (Object *ob)
 
static bool obrel_list_test (Object *ob)
 
static void obrel_list_add (LinkNode **links, Object *ob)
 
LinkNodeBKE_object_relational_superset (const Scene *scene, ViewLayer *view_layer, eObjectSet objectSet, eObRelationTypes includeFilter)
 
LinkNodeBKE_object_groups (Main *bmain, Scene *scene, Object *ob)
 
void BKE_object_groups_clear (Main *bmain, Scene *scene, Object *ob)
 
Object KD-Tree
KDTree_3d * BKE_object_as_kdtree (Object *ob, int *r_tot)
 
Object Modifier Utilities
static void object_cacheIgnoreClear (Object *ob, int state)
 
bool BKE_object_modifier_update_subframe (Depsgraph *depsgraph, Scene *scene, Object *ob, bool update_mesh, int parent_recursion, float frame, int type)
 
void BKE_object_update_select_id (Main *bmain)
 
Object Conversion
MeshBKE_object_to_mesh (Depsgraph *depsgraph, Object *object, bool preserve_all_data_layers)
 
void BKE_object_to_mesh_clear (Object *object)
 
CurveBKE_object_to_curve (Object *object, Depsgraph *depsgraph, bool apply_modifiers)
 
void BKE_object_to_curve_clear (Object *object)
 
void BKE_object_check_uids_unique_and_report (const Object *object)
 
SubsurfModifierDataBKE_object_get_last_subsurf_modifier (const Object *ob)
 
void BKE_object_replace_data_on_shallow_copy (Object *ob, ID *new_data)
 

Variables

static CLG_LogRef LOG = {"bke.object"}
 
static ThreadMutex vparent_lock = BLI_MUTEX_INITIALIZER
 
static AssetTypeInfo AssetType_OB
 
IDTypeInfo IDType_ID_OB
 

Macro Definition Documentation

◆ DNA_DEPRECATED_ALLOW

#define DNA_DEPRECATED_ALLOW

Definition at line 10 of file blenkernel/intern/object.cc.

◆ TFMCPY [1/2]

#define TFMCPY ( _v)    (obtfm->_v = ob->_v)

◆ TFMCPY [2/2]

#define TFMCPY ( _v)    (object_dst->_v = object_src->_v)

◆ TFMCPY3D [1/2]

#define TFMCPY3D ( _v)    copy_v3_v3(obtfm->_v, ob->_v)

◆ TFMCPY3D [2/2]

#define TFMCPY3D ( _v)    copy_v3_v3(object_dst->_v, object_src->_v)

◆ TFMCPY4D [1/2]

#define TFMCPY4D ( _v)    copy_v4_v4(obtfm->_v, ob->_v)

◆ TFMCPY4D [2/2]

#define TFMCPY4D ( _v)    copy_v4_v4(object_dst->_v, object_src->_v)

◆ VPARENT_THREADING_HACK

#define VPARENT_THREADING_HACK

NOTE(@sergey): Vertex parent modifies original BMesh which is not safe for threading. Ideally such a modification should be handled as a separate DAG update callback for mesh data-block, but for until it is actually supported use simpler solution with a mutex lock.

Definition at line 169 of file blenkernel/intern/object.cc.

Function Documentation

◆ BKE_boundbox_init_from_minmax()

◆ BKE_boundbox_minmax()

void BKE_boundbox_minmax ( const BoundBox * bb,
const float obmat[4][4],
float r_min[3],
float r_max[3] )

Definition at line 3525 of file blenkernel/intern/object.cc.

References minmax_v3v3_v3(), mul_v3_m4v3(), and BoundBox::vec.

Referenced by BKE_pchan_minmax().

◆ BKE_object_active_modifier()

◆ BKE_object_add()

◆ BKE_object_add_for_data()

Object * BKE_object_add_for_data ( Main * bmain,
const Scene * scene,
ViewLayer * view_layer,
int type,
const char * name,
ID * data,
bool do_id_user )

Add a new object, but assign the given data-block as the ob->data for the newly created object.

Parameters
dataThe data-block to assign as ob->data for the new object. This is assumed to be of the correct type.
do_id_userIf true, id_us_plus() will be called on data when assigning it to the object.

Definition at line 2154 of file blenkernel/intern/object.cc.

References BKE_collection_object_add(), BKE_layer_collection_get_active(), BKE_object_add_only_object(), BKE_view_layer_base_deselect_all(), BKE_view_layer_base_find(), BKE_view_layer_base_select_and_set_active(), BKE_view_layer_synced_ensure(), LayerCollection::collection, Object::data, DEG_id_tag_update_ex(), Object::id, ID_RECALC_ANIMATION, ID_RECALC_GEOMETRY, ID_RECALC_TRANSFORM, and id_us_plus().

Referenced by blender::ed::object::add_type_with_obdata().

◆ BKE_object_add_from()

Object * BKE_object_add_from ( Main * bmain,
Scene * scene,
ViewLayer * view_layer,
int type,
const char * name,
Object * ob_src )

◆ BKE_object_add_only_object()

Object * BKE_object_add_only_object ( Main * bmain,
int type,
const char * name )

More general add: creates minimum required data, but without vertices etc.

Parameters
bmainThe main to add the object to. May be null for LIB_ID_CREATE_NO_MAIN behavior.

Definition at line 2092 of file blenkernel/intern/object.cc.

References BKE_libblock_alloc(), get_obdata_defname(), Object::id, ID_OB, id_us_min(), LIB_ID_CREATE_NO_MAIN, and object_init().

Referenced by bc_add_object(), BKE_object_add_for_data(), blender::io::obj::CurveFromGeometry::create_curve_object(), blender::io::obj::MeshFromGeometry::create_mesh_object(), blender::io::usd::USDCameraReader::create_object(), blender::io::usd::USDCurvesReader::create_object(), blender::io::usd::USDInstanceReader::create_object(), blender::io::usd::USDLightReader::create_object(), blender::io::usd::USDMeshReader::create_object(), blender::io::usd::USDNurbsReader::create_object(), blender::io::usd::USDPointInstancerReader::create_object(), blender::io::usd::USDPointsReader::create_object(), blender::io::usd::USDShapeReader::create_object(), blender::io::usd::USDSkeletonReader::create_object(), blender::io::usd::USDVolumeReader::create_object(), blender::io::usd::USDXformReader::create_object(), duplicate_ids(), blender::io::ply::importer_main(), blender::io::stl::importer_main(), loose_data_instantiate_collection_process(), loose_data_instantiate_obdata_process(), Freestyle::BlenderStrokeRenderer::NewMesh(), object_add_common(), blender::io::alembic::AbcCameraReader::readObjectData(), blender::io::alembic::AbcCurveReader::readObjectData(), blender::io::alembic::AbcEmptyReader::readObjectData(), blender::io::alembic::AbcMeshReader::readObjectData(), blender::io::alembic::AbcNurbsReader::readObjectData(), blender::io::alembic::AbcPointsReader::readObjectData(), blender::io::alembic::AbcSubDReader::readObjectData(), blender::animrig::nla::tests::NLASlottedActionTest::SetUp(), blender::animrig::tests::ActionFilterTest::SetUp(), blender::animrig::tests::ActionLayersTest::SetUp(), blender::animrig::tests::AnimationEvaluationTest::SetUp(), blender::animrig::tests::KeyframingTest::SetUp(), blender::interface::tests::CopyDriversToSelected::SetUp(), blender::bke::tests::MeshObjectTestData::setup(), blender::bke::tests::WholeIDTestData::setup(), and blender::animrig::tests::TEST_F().

◆ BKE_object_apply_mat4()

void BKE_object_apply_mat4 ( Object * ob,
const float mat[4][4],
bool use_compat,
bool use_parent )

◆ BKE_object_apply_mat4_ex()

void BKE_object_apply_mat4_ex ( Object * ob,
const float mat[4][4],
Object * parent,
const float parentinv[4][4],
bool use_compat )

Applies the global transformation mat to the ob using a relative parent space if supplied.

Parameters
matthe global transformation mat that the object should be set object to.
parentthe parent space in which this object will be set relative to (should probably always be parent_eval).
use_compattrue to ensure that rotations are set using the min difference between the old and new orientation.

Definition at line 3407 of file blenkernel/intern/object.cc.

References BKE_object_get_parent_matrix(), BKE_object_mat3_to_rot(), Object::dloc, Object::dscale, invert_m4_m4(), Object::loc, mat4_to_loc_rot_size(), mul_m4_m4m4(), rot, Object::scale, and sub_v3_v3().

Referenced by BKE_object_apply_mat4(), ED_mesh_join_objects_exec(), and ED_view3d_to_object().

◆ BKE_object_apply_parent_inverse()

void BKE_object_apply_parent_inverse ( Object * ob)

Use parent's world location and rotation as the child's origin. The parent inverse will become identity when the parent has no shearing. Otherwise, it is non-identity and contains the object's local matrix data that cannot be decomposed into location, rotation and scale.

Assumes the object's world matrix has no shear. Assumes parent exists.

Definition at line 3458 of file blenkernel/intern/object.cc.

References BKE_object_apply_mat4(), BKE_object_get_parent_matrix(), copy_m4_m4(), invert_m4(), invert_m4_m4(), mul_m4_m4_post(), mul_m4_m4m4(), orthogonalize_m4_stable(), Object::parent, and Object::parentinv.

Referenced by blender::ed::object::object_parent_inverse_apply_exec(), and blender::ed::object::parent_noinv_set_exec().

◆ BKE_object_as_kdtree()

KDTree_3d * BKE_object_as_kdtree ( Object * ob,
int * r_tot )

◆ BKE_object_boundbox_eval_cached_get()

std::optional< Bounds< float3 > > BKE_object_boundbox_eval_cached_get ( const Object * ob)

Retrieve the bounds of the evaluated object's geometry, stored on the original object as part of the latest dependency graph evaluation, or fall back to the current bounds of the object if no such cache exists. For evaluated objects this indirection is unnecessary, so BKE_object_boundbox_get should be used instead.

Definition at line 3567 of file blenkernel/intern/object.cc.

References BKE_object_boundbox_get(), and Object::runtime.

Referenced by BKE_object_dimensions_eval_cached_get(), BKE_object_dimensions_set_ex(), and snap_source_closest_fn().

◆ BKE_object_boundbox_get()

◆ BKE_object_calc_parent()

blender::float4x4 BKE_object_calc_parent ( Depsgraph * depsgraph,
Scene * scene,
Object * ob )

For calculation of the inverse parent transform, only used for editor.

It assumes the object parent is already in the depsgraph. Otherwise, after changing ob->parent you need to call:

  • #DEG_relations_tag_update(bmain);
  • #BKE_scene_graph_update_tagged(depsgraph, bmain);
Returns
calculated object_to_world.

Definition at line 3371 of file blenkernel/intern/object.cc.

References BKE_object_where_is_calc(), BKE_object_workob_clear(), Object::constinv, DEG_get_evaluated_object(), depsgraph, Object::par1, Object::par2, Object::par3, Object::parent, Object::parentinv, Object::parsubstr, Object::partype, Object::runtime, STRNCPY, Object::trackflag, unit_m4(), and Object::upflag.

Referenced by blender::ed::object::apply_objects_internal(), applyarmature_fix_boneparents(), blender::ed::object::ignore_parent_tx(), SkinInfo::link_armature(), blender::ed::object::parent_set(), and blender::ed::object::vertex_parent_set_exec().

◆ BKE_object_check_uids_unique_and_report()

void BKE_object_check_uids_unique_and_report ( const Object * object)

◆ BKE_object_copy_modifier()

bool BKE_object_copy_modifier ( Main * bmain,
const Scene * scene,
Object * ob_dst,
const Object * ob_src,
const ModifierData * md )

Copy a single modifier.

Note
Do not use this function to copy a whole modifier stack (see note below too). Use BKE_object_modifier_stack_copy instead.
Complex modifiers relaying on other data (like e.g. dynamic paint or fluid using particle systems) are not always 100% 'correctly' copied here, since we have to use heuristics to decide which particle system to use or add in ob_dst, and it's placement in the stack, etc. If used more than once, this function should preferably be called in stack order.

Definition at line 1336 of file blenkernel/intern/object.cc.

References BKE_mesh_ensure_skin_customdata(), BKE_modifier_copydata(), BKE_modifier_get_info(), BKE_modifier_new(), BKE_modifier_unique_name(), BKE_modifiers_findby_type(), BKE_modifiers_persistent_uid_init(), BKE_object_copy_softbody(), BKE_object_modifier_set_active(), BKE_object_support_modifier_type_check(), BLI_assert, BLI_insertlinkbefore(), DynamicPaintModifierData::brush, Object::data, eModifierFlag_PinLast, eModifierType_DynamicPaint, eModifierType_Fluid, eModifierType_Multires, eModifierType_ParticleSystem, eModifierType_Skin, eModifierType_Softbody, eModifierTypeFlag_Single, ModifierTypeInfo::flags, FluidModifierData::flow, LISTBASE_FOREACH_BACKWARD, MOD_FLUID_TYPE_FLOW, Object::modifiers, multiresModifier_sync_levels_ex(), ModifierData::name, OB_GPENCIL_LEGACY, object_copy_modifier_particle_system_ensure(), object_copy_particle_system(), object_modifier_type_copy_check(), DynamicPaintBrushSettings::psys, FluidFlowSettings::psys, STRNCPY, FluidModifierData::type, ModifierData::type, and Object::type.

Referenced by blender::ed::object::modifier_copy_to_object().

◆ BKE_object_copy_particlesystem()

◆ BKE_object_copy_particlesystems()

◆ BKE_object_copy_softbody()

◆ BKE_object_data_editmode_flush_ptr_get()

◆ BKE_object_data_is_in_editmode()

◆ BKE_object_delete_ptcache()

void BKE_object_delete_ptcache ( Object * ob,
int index )

◆ BKE_object_dimensions_eval_cached_get()

void BKE_object_dimensions_eval_cached_get ( Object * ob,
float r_vec[3] )

Similar to BKE_object_boundbox_eval_cached_get but gives the size of the bounds instead.

Definition at line 3612 of file blenkernel/intern/object.cc.

References BKE_object_boundbox_eval_cached_get(), boundbox_to_dimensions(), and copy_v3_v3().

Referenced by v3d_object_dimension_buts(), and view3d_ob_drop_on_enter().

◆ BKE_object_dimensions_get()

◆ BKE_object_dimensions_set()

void BKE_object_dimensions_set ( Object * ob,
const float value[3],
int axis_mask )

Definition at line 3645 of file blenkernel/intern/object.cc.

References BKE_object_dimensions_set_ex().

◆ BKE_object_dimensions_set_ex()

void BKE_object_dimensions_set_ex ( Object * ob,
const float value[3],
int axis_mask,
const float ob_scale_orig[3],
const float ob_obmat_orig[4][4] )

The original scale and object matrix can be passed in so any difference of the objects matrix and the final matrix can be accounted for, typically this caused by parenting, constraints or delta-scale.

Re-using these values from the object causes a feedback loop when multiple values are modified at once in some situations. see: #69536.

Definition at line 3617 of file blenkernel/intern/object.cc.

References BKE_object_boundbox_eval_cached_get(), bounds(), copysignf, len, len_v3(), and Object::scale.

Referenced by BKE_object_dimensions_set(), and v3d_object_dimension_buts().

◆ BKE_object_do_version_give_parteff_245()

PartEff * BKE_object_do_version_give_parteff_245 ( Object * ob)

Definition at line 962 of file blenkernel/intern/object.cc.

References EFF_PARTICLE, PartEff::next, and PartEff::type.

Referenced by blo_do_versions_pre250(), and object_foreach_id().

◆ BKE_object_duplicate()

Object * BKE_object_duplicate ( Main * bmain,
Object * ob,
eDupli_ID_Flags dupflag,
uint duplicate_options )

Perform deep-copy of object and its 'children' data-blocks (obdata, materials, actions, etc.).

Parameters
dupflagControls which sub-data are also duplicated (see eDupli_ID_Flags in DNA_userdef_types.h).
Note
This function does not do any remapping to new IDs, caller must do it (BKE_libblock_relink_to_newid()).
Caller MUST free newid pointers itself (BKE_main_id_newptr_and_tag_clear()) and call updates of DEG too (#DAG_relations_tag_update()).

Definition at line 2520 of file blenkernel/intern/object.cc.

References BKE_id_copy_for_duplicate(), BKE_libblock_relink_to_newid(), BKE_main_id_newptr_and_tag_clear(), BKE_object_material_array_p(), BKE_pose_tag_recalc(), BLI_assert, Object::data, DEG_id_tag_update(), DEG_id_tag_update_ex(), ELEM, FOREACH_MAIN_ID_BEGIN, FOREACH_MAIN_ID_END, Object::id, ID_IS_LINKED, ID_RECALC_EDITORS, ID_RECALC_GEOMETRY, ID_TAG_NEW, LIB_ID_COPY_DEFAULT, LIB_ID_COPY_RIGID_BODY_NO_COLLECTION_HANDLING, LIB_ID_DUPLICATE_IS_ROOT_ID, LIB_ID_DUPLICATE_IS_SUBPROCESS, LISTBASE_FOREACH, Object::mat, ID::newid, OB_ARMATURE, OB_CAMERA, OB_CURVES, OB_CURVES_LEGACY, OB_FONT, OB_GPENCIL_LEGACY, OB_GREASE_PENCIL, OB_LAMP, OB_LATTICE, OB_LIGHTPROBE, OB_MBALL, OB_MESH, OB_POINTCLOUD, OB_SPEAKER, OB_SURF, OB_VOLUME, Object::particlesystem, Object::pose, ID::tag, Object::totcol, Object::type, USER_DUP_ARM, USER_DUP_CAMERA, USER_DUP_CURVE, USER_DUP_CURVES, USER_DUP_FONT, USER_DUP_GPENCIL, USER_DUP_LAMP, USER_DUP_LATTICE, USER_DUP_LIGHTPROBE, USER_DUP_LINKED_ID, USER_DUP_MAT, USER_DUP_MBALL, USER_DUP_MESH, USER_DUP_POINTCLOUD, USER_DUP_PSYS, USER_DUP_SPEAKER, USER_DUP_SURF, and USER_DUP_VOLUME.

Referenced by collection_duplicate_recursive(), and blender::ed::object::object_add_duplicate_internal().

◆ BKE_object_empty_draw_type_set()

◆ BKE_object_empty_image_data_is_visible_in_view3d()

◆ BKE_object_empty_image_frame_is_visible_in_view3d()

◆ BKE_object_eval_assign_data()

◆ BKE_object_evaluated_geometry_bounds()

std::optional< Bounds< float3 > > BKE_object_evaluated_geometry_bounds ( const Object * ob)

◆ BKE_object_exists_check()

bool BKE_object_exists_check ( Main * bmain,
const Object * obtest )

Definition at line 1922 of file blenkernel/intern/object.cc.

References LISTBASE_FOREACH, and Main::objects.

Referenced by blender::ed::object::test_constraint().

◆ BKE_object_flag_test_recursive()

bool BKE_object_flag_test_recursive ( const Object * ob,
short flag )

◆ BKE_object_foreach_display_point()

void BKE_object_foreach_display_point ( Object * ob,
const float obmat[4][4],
void(* func_cb )(const float[3], void *),
void * user_data )

Sometimes min-max isn't enough, we need to loop over each point.

Definition at line 3861 of file blenkernel/intern/object.cc.

References BKE_mesh_wrapper_vert_coords(), BKE_object_get_evaluated_mesh(), LISTBASE_FOREACH, mul_v3_m4v3(), and Object::runtime.

Referenced by BKE_scene_foreach_display_point().

◆ BKE_object_free_caches()

◆ BKE_object_free_curve_cache()

◆ BKE_object_free_derived_caches()

void BKE_object_free_derived_caches ( Object * ob)

◆ BKE_object_free_modifiers()

◆ BKE_object_free_particlesystems()

void BKE_object_free_particlesystems ( Object * ob)

◆ BKE_object_free_shaderfx()

void BKE_object_free_shaderfx ( Object * ob,
const int flag )

◆ BKE_object_free_softbody()

void BKE_object_free_softbody ( Object * ob)

Definition at line 1117 of file blenkernel/intern/object.cc.

References sbFree().

Referenced by BKE_object_free_modifiers().

◆ BKE_object_get_editmesh_eval_cage()

◆ BKE_object_get_editmesh_eval_final()

◆ BKE_object_get_evaluated_lattice()

Lattice * BKE_object_get_evaluated_lattice ( const Object * object)

◆ BKE_object_get_evaluated_mesh()

Mesh * BKE_object_get_evaluated_mesh ( const Object * object_eval)

Get evaluated mesh for given object.

Definition at line 4135 of file blenkernel/intern/object.cc.

References BKE_object_get_evaluated_mesh_unchecked(), and DEG_object_geometry_is_evaluated().

Referenced by add_verts_to_dgroups(), bc_get_mesh_copy(), BKE_effectors_create(), BKE_mesh_to_pointcloud(), BKE_modifier_get_evaluated_mesh_from_evaluated_object(), BKE_object_as_kdtree(), BKE_object_data_transfer_ex(), BKE_object_data_transfer_layout(), BKE_object_foreach_display_point(), bpy_bmesh_from_object(), bvh_get_mesh(), contarget_get_mesh_mat(), data_for_snap(), blender::io::alembic::ABCHairWriter::do_write(), ED_mesh_pick_face_vert(), ED_mesh_pick_vert(), blender::ed::sculpt_paint::AddOperationExecutor::execute(), blender::ed::sculpt_paint::DensityAddOperationExecutor::execute(), blender::ed::sculpt_paint::DensitySubtractOperationExecutor::execute(), blender::ed::sculpt_paint::SlideOperationExecutor::execute(), blender::io::stl::export_frame(), followtrack_project_to_depth_object_if_needed(), get_effector_data(), get_effector_tot(), blender::io::alembic::ABCCurveMeshWriter::get_export_mesh(), blender::io::alembic::ABCMeshWriter::get_export_mesh(), blender::io::alembic::ABCMetaballWriter::get_export_mesh(), blender::io::usd::USDMeshWriter::get_export_mesh(), blender::io::usd::USDMetaballWriter::get_export_mesh(), give_parvert(), blender::io::obj::OBJImportTest::import_and_check(), blender::io::stl::stl_importer_test::import_and_check(), knifeproject_poly_from_object(), lineart_object_load_single_instance(), blender::io::ply::load_plydata(), mesh_data_from_duplicator_object(), mesh_new_from_evaluated_curve_type_object(), mesh_new_from_mball_object(), meshobject_foreachScreenVert(), blender::ed::sculpt_paint::min_distance_edit::min_distance_edit_invoke(), MOD_lineart_gpencil_generate_v3(), multiresModifier_reshapeFromObject(), blender::ed::object::object_convert_exec(), blender::io::obj::OBJMesh::OBJMesh(), paint_init_pivot_mesh(), paint_sample_color(), paint_weight_gradient_exec(), paintvert_flush_flags(), particle_intersect_mesh(), PE_create_shape_tree(), proj_paint_state_mesh_eval_init(), blender::ed::sculpt_paint::sample_curves_3d_brush(), shrinkwrap_get_tarmat(), blender::ed::sculpt_paint::use_add_density_mode(), vpaint_proj_dm_map_cosnos_init(), and vpaint_proj_dm_map_cosnos_update().

◆ BKE_object_get_evaluated_mesh_no_subsurf()

◆ BKE_object_get_evaluated_mesh_no_subsurf_unchecked()

◆ BKE_object_get_evaluated_mesh_unchecked()

Mesh * BKE_object_get_evaluated_mesh_unchecked ( const Object * object_eval)

◆ BKE_object_get_last_subsurf_modifier()

SubsurfModifierData * BKE_object_get_last_subsurf_modifier ( const Object * ob)

Return the last subsurf modifier of an object, this does not check whether modifiers on top of it are disabled. Return NULL if no such modifier is found.

This does not check if the modifier is enabled as it is assumed that the caller verified that it is enabled for its evaluation mode.

Definition at line 5309 of file blenkernel/intern/object.cc.

References eModifierType_Subsurf, ListBase::last, Object::modifiers, ModifierData::prev, and ModifierData::type.

◆ BKE_object_get_lattice()

Lattice * BKE_object_get_lattice ( const Object * object)

◆ BKE_object_get_mesh_deform_eval()

◆ BKE_object_get_original_mesh()

◆ BKE_object_get_parent_matrix()

◆ BKE_object_get_pre_modified_mesh()

Mesh * BKE_object_get_pre_modified_mesh ( const Object * object)

Get mesh which is not affected by modifiers:

  • For original objects it will be same as object->data, and it is a mesh which is in the corresponding Main.
  • For copied-on-write objects it will give pointer to a copied-on-write mesh which corresponds to original object's mesh.

Definition at line 4143 of file blenkernel/intern/object.cc.

References BLI_assert, ID_TAG_COPIED_ON_EVAL, ID_TAG_COPIED_ON_EVAL_FINAL_RESULT, OB_MESH, result, and Mesh::runtime.

Referenced by blender::io::stl::export_frame(), blender::io::usd::USDMeshWriter::get_export_mesh(), blender::io::usd::get_shape_key_basis_mesh(), blender::io::ply::load_plydata(), and blender::io::obj::OBJMesh::OBJMesh().

◆ BKE_object_groups()

LinkNode * BKE_object_groups ( Main * bmain,
Scene * scene,
Object * ob )
Returns
All groups this object is a part of, caller must free.

Definition at line 4982 of file blenkernel/intern/object.cc.

References BKE_collection_object_find(), and BLI_linklist_prepend().

Referenced by blender::ed::object::make_links_data_exec().

◆ BKE_object_groups_clear()

◆ BKE_object_handle_update()

void BKE_object_handle_update ( Depsgraph * depsgraph,
Scene * scene,
Object * ob )
Warning
"scene" here may not be the scene object actually resides in. When dealing with background-sets, "scene" is actually the active scene. e.g. "scene" <– set 1 <– set 2 ("ob" lives here) <– set 3 <– ... <– set n rigid bodies depend on their world so use BKE_object_handle_update_ex() to also pass along the current rigid body world.

Definition at line 4026 of file blenkernel/intern/object.cc.

References BKE_object_handle_update_ex(), and depsgraph.

Referenced by BKE_object_modifier_update_subframe().

◆ BKE_object_handle_update_ex()

void BKE_object_handle_update_ex ( Depsgraph * depsgraph,
Scene * scene,
Object * ob,
RigidBodyWorld * rbw )

The main object update call, for object matrix, constraints, keys and modifiers. Requires flags to be set!

Ideally we shouldn't have to pass the rigid body world, but need bigger restructuring to avoid id.

Definition at line 3979 of file blenkernel/intern/object.cc.

References BKE_object_handle_data_update(), BKE_object_where_is_calc_ex(), BKE_pose_channels_hash_ensure(), BKE_pose_rebuild(), BKE_pose_update_constraint_flags(), Object::data, depsgraph, bPose::flag, G, G_DEBUG_DEPSGRAPH_EVAL, Object::id, ID_RECALC_ALL, ID::name, OB_ARMATURE, Object::pose, POSE_CONSTRAINTS_NEED_UPDATE_FLAGS, POSE_RECALC, printf, ID::recalc, recalc_data(), and Object::type.

Referenced by BKE_object_handle_update().

◆ BKE_object_has_mode_data()

◆ BKE_object_insert_ptcache()

◆ BKE_object_is_child_recursive()

◆ BKE_object_is_deform_modified()

int BKE_object_is_deform_modified ( Scene * scene,
Object * ob )

Test if object is affected by deforming modifiers (for motion blur). again most important is to avoid false positives, this is to skip computations and we can still if there was actual deformation afterwards.

Definition at line 4723 of file blenkernel/intern/object.cc.

References BKE_key_from_object(), BKE_modifier_get_info(), BKE_modifier_is_enabled(), BKE_modifiers_get_virtual_modifierlist(), constructive_modifier_is_deform_modified(), Object::data, DEG_get_original_object(), eModifierMode_Realtime, eModifierMode_Render, flag, modifiers_has_animation_check(), ModifierData::next, OB_CURVES_LEGACY, object_deforms_in_time(), OnlyDeform, Curve::taperobj, ModifierData::type, ModifierTypeInfo::type, and Object::type.

◆ BKE_object_is_in_editmode()

bool BKE_object_is_in_editmode ( const Object * ob)

Actual check for internal data, not context or flags.

Definition at line 1721 of file blenkernel/intern/object.cc.

References Object::data, GPENCIL_EDIT_MODE, Object::mode, OB_ARMATURE, OB_CURVES, OB_CURVES_LEGACY, OB_FONT, OB_GPENCIL_LEGACY, OB_GREASE_PENCIL, OB_LATTICE, OB_MBALL, OB_MESH, OB_MODE_EDIT, OB_POINTCLOUD, OB_SURF, and Object::type.

Referenced by blender::ed::object::add_duplicate(), armature_undosys_step_decode(), BKE_object_data_is_in_editmode(), BKE_object_has_mode_data(), BKE_object_is_in_editmode_vgroup(), createTransObject(), curve_undosys_step_decode(), curves_evaluate_modifiers(), data_for_snap(), blender::ed::outliner::do_outliner_item_editmode_toggle(), DRW_object_is_in_edit_mode(), ED_armature_edit_select_pick_bone(), ED_armature_origin_set(), blender::ed::object::ed_object_mode_generic_exit_ex(), ED_view3d_viewcontext_init_object(), ED_wpaint_ensure_data(), blender::ed::object::editmode_enter_ex(), foreach_libblock_remap_callback(), grease_pencil_evaluate_modifiers(), knifeproject_exec(), lattice_undosys_step_decode(), material_slot_remove_unused_exec(), mball_undosys_step_decode(), mesh_undosys_step_decode(), blender::ed::object::modifier_apply(), nearest_world_object_fn(), object_array_for_shading_edit_mode_disabled_filter(), object_array_for_shading_edit_mode_enabled_filter(), blender::ed::object::object_convert_poll(), blender::ed::object::object_remesh_poll(), blender::ed::outliner::outliner_draw_mode_column_toggle(), blender::ed::outliner::outliner_object_delete_fn(), raycast_obj_fn(), setSnappingCallback(), snap_obj_fn(), snapCurve(), blender::ed::curves::undo::step_decode(), and blender::ed::greasepencil::undo::step_decode().

◆ BKE_object_is_in_editmode_vgroup()

◆ BKE_object_is_in_wpaint_select_vert()

◆ BKE_object_is_libdata()

bool BKE_object_is_libdata ( const Object * ob)

Returns true if the Object is from an external blend file (libdata).

Definition at line 2693 of file blenkernel/intern/object.cc.

References ID_IS_LINKED.

Referenced by BKE_view_layer_selected_editable_objects_iterator_begin(), and BKE_view_layer_selected_editable_objects_iterator_next().

◆ BKE_object_is_mode_compat()

bool BKE_object_is_mode_compat ( const Object * ob,
eObjectMode object_mode )

◆ BKE_object_is_modified()

int BKE_object_is_modified ( Scene * scene,
Object * ob )

Most important if this is modified it should always return true, in certain cases false positives are hard to avoid (shape keys for example).

Returns
ModifierMode flag.

Definition at line 4592 of file blenkernel/intern/object.cc.

References BKE_key_from_object(), BKE_modifier_is_enabled(), BKE_modifiers_get_virtual_modifierlist(), DEG_get_original_object(), eModifierMode_Realtime, eModifierMode_Render, flag, and ModifierData::next.

◆ BKE_object_link_modifiers()

void BKE_object_link_modifiers ( Object * ob_dst,
const Object * ob_src )

◆ BKE_object_mat3_to_rot()

◆ BKE_object_matrix_local_get()

void BKE_object_matrix_local_get ( Object * ob,
float r_mat[4][4] )

◆ BKE_object_minmax()

◆ BKE_object_minmax_dupli()

◆ BKE_object_minmax_empty_drawtype()

bool BKE_object_minmax_empty_drawtype ( const Object * ob,
float r_min[3],
float r_max[3] )

Calculate visual bounds from an empty objects draw-type.

Note
This is not part of the calculation used by BKE_object_boundbox_get as these bounds represent the extents of visual guides (use for viewport culling for e.g.)

Definition at line 3751 of file blenkernel/intern/object.cc.

References BLI_assert, CLAMP_MAX, CLAMP_MIN, copy_v3_v3(), Object::empty_drawsize, Object::empty_drawtype, Object::ima_ofs, max, min, OB_ARROWS, OB_CIRCLE, OB_CUBE, OB_EMPTY, OB_EMPTY_CONE, OB_EMPTY_IMAGE, OB_EMPTY_SPHERE, OB_PLAINAXES, OB_SINGLE_ARROW, and Object::type.

Referenced by BKE_pchan_minmax().

◆ BKE_object_modifier_gpencil_hook_reset()

◆ BKE_object_modifier_hook_reset()

◆ BKE_object_modifier_set_active()

◆ BKE_object_modifier_stack_copy()

bool BKE_object_modifier_stack_copy ( Object * ob_dst,
const Object * ob_src,
bool do_copy_all,
int flag_subdata )

Copy the whole stack of modifiers from one object into another.

Warning
Does not clear modifier stack and related data (particle systems, soft-body, etc.) in ob_dst, if needed calling code must do it. The caller is also responsible for ensuring the modifier identifiers are unique.
Parameters
do_copy_allIf true, even modifiers that should not support copying (like Hook one) will be duplicated.

Definition at line 1448 of file blenkernel/intern/object.cc.

References BKE_modifier_copy_ex(), BKE_object_copy_particlesystems(), BKE_object_copy_softbody(), BKE_object_support_modifier_type_check(), BLI_addtail(), BLI_assert_msg, BLI_listbase_is_empty(), Object::greasepencil_modifiers, LISTBASE_FOREACH, Object::modifiers, OB_GPENCIL_LEGACY, object_modifier_type_copy_check(), and Object::type.

Referenced by BKE_object_link_modifiers(), and object_copy_data().

◆ BKE_object_modifier_update_subframe()

◆ BKE_object_moves_in_time()

bool BKE_object_moves_in_time ( const Object * object,
bool recurse_parent )

Check of objects moves in time.

Note
This function is currently optimized for usage in combination with modifier deformation checks (ModifierTypeType::OnlyDeform), so modifiers can quickly check if their target objects moves (causing deformation motion blur) or not.

This makes it possible to give some degree of false-positives here, but it's currently an acceptable tradeoff between complexity and check speed. In combination with checks of modifier stack and real life usage percentage of false-positives shouldn't be that high.

Note
This function does not consider physics systems.

Definition at line 4628 of file blenkernel/intern/object.cc.

References BKE_animdata_id_is_animated(), BKE_object_moves_in_time(), and BLI_listbase_is_empty().

Referenced by BKE_object_moves_in_time(), blender::io::alembic::ABCTransformWriter::check_is_animated(), blender::io::usd::USDTransformWriter::check_is_animated(), and object_moves_in_time().

◆ BKE_object_movieclip_get()

◆ BKE_object_obdata_add_from_type()

◆ BKE_object_obdata_is_libdata()

bool BKE_object_obdata_is_libdata ( const Object * ob)

◆ BKE_object_obdata_size_init()

◆ BKE_object_obdata_texspace_get()

bool BKE_object_obdata_texspace_get ( Object * ob,
char ** r_texspace_flag,
float ** r_texspace_location,
float ** r_texspace_size )

◆ BKE_object_obdata_to_type()

◆ BKE_object_parent_loop_check()

◆ BKE_object_pose_armature_get()

Object * BKE_object_pose_armature_get ( Object * ob)

Definition at line 2372 of file blenkernel/intern/object.cc.

References BKE_modifiers_is_deformed_by_armature(), and BKE_object_pose_context_check().

Referenced by apply_armature_pose2bones_exec(), BKE_object_defgroup_selected_get(), BKE_object_pose_armature_get_visible(), BKE_object_pose_armature_get_with_wpaint_check(), BKE_object_pose_array_get_ex(), BKE_object_pose_base_array_get_ex(), draw_selected_name(), drw_context_state_init(), blender::ed::object::dt_layers_select_src_itemf(), ED_operator_posemode(), ed_operator_posemode_exclusive_ex(), ED_operator_posemode_local(), ED_pose_object_from_context(), ED_view3d_select_filter_from_mode(), get_poselib_object(), gizmo_3d_transform_space_object_get(), is_cursor_visible(), blender::draw::overlay::Armatures::is_pose_mode(), blender::ed::outliner::outliner_show_active_get_element(), blender::ed::outliner::outliner_viewcontext_init(), pose_calculate_paths_exec(), pose_calculate_paths_invoke(), pose_clear_paths_exec(), blender::ed::object::pose_constraint_add_exec(), pose_copy_exec(), blender::ed::object::pose_ik_add_invoke(), pose_paste_exec(), pose_select_grouped_exec(), pose_select_hierarchy_exec(), pose_select_parent_exec(), pose_select_same_keyingset(), pose_update_paths_exec(), pose_update_paths_range_exec(), poseAnim_object_get(), screen_ctx_active_pose_bone(), screen_ctx_pose_object(), screen_ctx_selected_pose_bones(), screen_ctx_selected_pose_bones_from_active_object(), screen_ctx_visible_pose_bones(), toggle_xray_exec(), blender::ed::outliner::tree_element_posechannel_activate(), uiTemplatePaintModeSelection(), blender::ed::object::vgroup_selection_itemf_helper(), blender::ed::object::vgroup_sync_from_pose(), view3d_orbit_calc_center(), view3d_select_exec(), WIDGETGROUP_armature_spline_poll(), WIDGETGROUP_armature_spline_refresh(), and WIDGETGROUP_armature_spline_setup().

◆ BKE_object_pose_armature_get_visible()

Object * BKE_object_pose_armature_get_visible ( Object * ob,
const Scene * scene,
ViewLayer * view_layer,
View3D * v3d )

◆ BKE_object_pose_armature_get_with_wpaint_check()

Object * BKE_object_pose_armature_get_with_wpaint_check ( Object * ob)

A version of BKE_object_pose_armature_get with an additional check. When ob isn't an armature: only return the referenced pose object when the active object is in weight paint mode.

Note
Some callers need to check that pose bones are selectable which isn't the case when the object using the armature isn't in weight-paint mode.

Definition at line 2392 of file blenkernel/intern/object.cc.

References BKE_object_pose_armature_get(), Object::mode, OB_GPENCIL_LEGACY, OB_MESH, OB_MODE_WEIGHT_GREASE_PENCIL, OB_MODE_WEIGHT_PAINT, and Object::type.

Referenced by do_pose_tag_select_op_prepare(), ed_object_select_pick(), view3d_box_select_exec(), view3d_circle_select_exec(), view3d_lasso_select(), view3d_select_exec(), and view3d_selectable_data().

◆ BKE_object_pose_array_get()

Vector< Object * > BKE_object_pose_array_get ( const Scene * scene,
ViewLayer * view_layer,
View3D * v3d )

◆ BKE_object_pose_array_get_ex()

Vector< Object * > BKE_object_pose_array_get_ex ( const Scene * scene,
ViewLayer * view_layer,
View3D * v3d,
bool unique )

◆ BKE_object_pose_array_get_unique()

◆ BKE_object_pose_base_array_get()

Vector< Base * > BKE_object_pose_base_array_get ( const Scene * scene,
ViewLayer * view_layer,
View3D * v3d )

◆ BKE_object_pose_base_array_get_ex()

◆ BKE_object_pose_base_array_get_unique()

Vector< Base * > BKE_object_pose_base_array_get_unique ( const Scene * scene,
ViewLayer * view_layer,
View3D * v3d )

◆ BKE_object_pose_context_check()

bool BKE_object_pose_context_check ( const Object * ob)

◆ BKE_object_relational_superset()

LinkNode * BKE_object_relational_superset ( const Scene * scene,
ViewLayer * view_layer,
eObjectSet objectSet,
eObRelationTypes includeFilter )

Iterates over all objects of the given scene layer. Depending on the eObjectSet flag: collect either OB_SET_ALL, OB_SET_VISIBLE or OB_SET_SELECTED objects. If OB_SET_VISIBLE or::OB_SET_SELECTED are collected, then also add related objects according to the given includeFilter.

Definition at line 4901 of file blenkernel/intern/object.cc.

References BASE_EDITABLE, BASE_SELECTED_EDITABLE, BKE_object_is_child_recursive(), BKE_view_layer_object_bases_get(), BKE_view_layer_synced_ensure(), LISTBASE_FOREACH, OB_REL_CHILDREN, OB_REL_CHILDREN_RECURSIVE, OB_REL_MOD_ARMATURE, OB_REL_PARENT, OB_REL_PARENT_RECURSIVE, OB_SET_ALL, OB_SET_SELECTED, OB_SET_VISIBLE, obrel_armature_find(), obrel_list_add(), obrel_list_test(), and Object::parent.

Referenced by collada_export().

◆ BKE_object_replace_data_on_shallow_copy()

void BKE_object_replace_data_on_shallow_copy ( Object * ob,
ID * new_data )

◆ BKE_object_rot_to_mat3()

◆ BKE_object_runtime_free_data()

void BKE_object_runtime_free_data ( Object * object)

The function frees memory used by the runtime data, but not the runtime field itself.

All runtime data is cleared to ensure it's not used again, in keeping with other _free_data(..) functions.

Definition at line 4855 of file blenkernel/intern/object.cc.

References BKE_object_free_derived_caches(), and BKE_object_runtime_reset().

Referenced by curve_to_mesh_eval_ensure().

◆ BKE_object_runtime_reset()

void BKE_object_runtime_reset ( Object * object)

◆ BKE_object_runtime_reset_on_copy()

◆ BKE_object_scale_to_mat3()

◆ BKE_object_scenes_users_get()

int BKE_object_scenes_users_get ( Main * bmain,
Object * ob )

Return the number of scenes using (instantiating) that object in their collections.

Definition at line 4775 of file blenkernel/intern/object.cc.

References BKE_collection_has_object_recursive(), LISTBASE_FOREACH, and Main::scenes.

Referenced by blender::ed::object::single_object_users_collection().

◆ BKE_object_sculpt_data_create()

void BKE_object_sculpt_data_create ( Object * ob)

◆ BKE_object_shapekey_free()

bool BKE_object_shapekey_free ( Main * bmain,
Object * ob )

◆ BKE_object_shapekey_insert()

KeyBlock * BKE_object_shapekey_insert ( Main * bmain,
Object * ob,
const char * name,
const bool from_mix )

◆ BKE_object_shapekey_remove()

◆ BKE_object_support_modifier_type_check()

◆ BKE_object_supports_material_slots()

◆ BKE_object_supports_modifiers()

bool BKE_object_supports_modifiers ( const Object * ob)

◆ BKE_object_tfm_backup()

◆ BKE_object_tfm_copy()

void BKE_object_tfm_copy ( Object * object_dst,
const Object * object_src )

Definition at line 2908 of file blenkernel/intern/object.cc.

References rot, TFMCPY, TFMCPY3D, and TFMCPY4D.

Referenced by ObjectToTransData().

◆ BKE_object_tfm_protected_backup()

void BKE_object_tfm_protected_backup ( const Object * ob,
ObjectTfmProtectedChannels * obtfm )

◆ BKE_object_tfm_protected_restore()

◆ BKE_object_tfm_restore()

◆ BKE_object_to_curve()

Curve * BKE_object_to_curve ( Object * object,
Depsgraph * depsgraph,
bool apply_modifiers )

This is an utility function for Python's object.to_curve(). The result is owned by the object.

The curve will be freed when object is re-evaluated or is destroyed. It is possible to force clear memory used by this curve by calling BKE_object_to_curve_clear().

If apply_modifiers is true and the object is a curve one, then spline deform modifiers are applied on the curve control points.

Definition at line 5286 of file blenkernel/intern/object.cc.

References BKE_curve_new_from_object(), BKE_object_to_curve_clear(), curve, and depsgraph.

◆ BKE_object_to_curve_clear()

void BKE_object_to_curve_clear ( Object * object)

Definition at line 5295 of file blenkernel/intern/object.cc.

References BKE_id_free().

Referenced by BKE_object_free_derived_caches(), and BKE_object_to_curve().

◆ BKE_object_to_mat3()

◆ BKE_object_to_mat4()

◆ BKE_object_to_mesh()

Mesh * BKE_object_to_mesh ( Depsgraph * depsgraph,
Object * object,
bool preserve_all_data_layers )

This is an utility function for Python's object.to_mesh() (the naming is not very clear though). The result is owned by the object.

The mesh will be freed when object is re-evaluated or is destroyed. It is possible to force to clear memory used by this mesh by calling BKE_object_to_mesh_clear().

If preserve_all_data_layers is truth then the modifier stack is re-evaluated to ensure it preserves all possible custom data layers.

NOTE: Dependency graph argument is required when preserve_all_data_layers is truth, and is ignored otherwise.

Definition at line 5268 of file blenkernel/intern/object.cc.

References BKE_mesh_new_from_object(), BKE_object_to_mesh_clear(), depsgraph, and mesh.

Referenced by blender::io::hydra::MeshData::init(), and Freestyle::BlenderFileLoader::Load().

◆ BKE_object_to_mesh_clear()

◆ BKE_object_transform_copy()

◆ BKE_object_update_select_id()

◆ BKE_object_visibility()

◆ BKE_object_where_is_calc()

◆ BKE_object_where_is_calc_ex()

void BKE_object_where_is_calc_ex ( Depsgraph * depsgraph,
Scene * scene,
RigidBodyWorld * rbw,
Object * ob,
float r_originmat[3][3] )

◆ BKE_object_where_is_calc_mat4()

void BKE_object_where_is_calc_mat4 ( const Object * ob,
float r_obmat[4][4] )

Calculate object transformation matrix without recalculating dependencies and constraints – assume dependencies are already solved by depsgraph. No changes to object and its parent would be done. Used for bundles orientation in 3d space relative to parented blender camera.

Definition at line 3348 of file blenkernel/intern/object.cc.

References BKE_object_to_mat4(), Object::parent, and solve_parenting().

Referenced by BKE_tracking_get_camera_object_matrix(), followtrack_distance_from_viewplane_get(), and object_solver_inverted_matrix().

◆ BKE_object_where_is_calc_time()

◆ BKE_object_workob_clear()

void BKE_object_workob_clear ( Object * workob)

◆ BKE_scene_foreach_display_point()

◆ boundbox_to_dimensions()

static float3 boundbox_to_dimensions ( const Object * ob,
const std::optional< Bounds< float3 > > bounds )
static

◆ constructive_modifier_is_deform_modified()

◆ copy_ccg_data()

static void copy_ccg_data ( Mesh * mesh_destination,
Mesh * mesh_source,
const eCustomDataType layer_type )
static

◆ copy_object_pose()

static void copy_object_pose ( Object * obn,
const Object * ob,
const int flag )
static

◆ direct_link_nlastrips()

static void direct_link_nlastrips ( BlendDataReader * reader,
ListBase * strips )
static

Definition at line 688 of file blenkernel/intern/object.cc.

References BLO_read_struct_list, and LISTBASE_FOREACH.

Referenced by object_blend_read_data().

◆ get_obdata_defname()

◆ give_parvert()

◆ insert_curvekey()

◆ insert_lattkey()

◆ insert_meshkey()

static KeyBlock * insert_meshkey ( Main * bmain,
Object * ob,
const char * name,
const bool from_mix )
static

◆ library_foreach_constraintObjectLooper()

static void library_foreach_constraintObjectLooper ( bConstraint * ,
ID ** id_pointer,
bool is_reference,
void * user_data )
static

◆ library_foreach_gpencil_modifiersForeachIDLink()

static void library_foreach_gpencil_modifiersForeachIDLink ( void * user_data,
Object * ,
ID ** id_pointer,
int cb_flag )
static

◆ library_foreach_modifiersForeachIDLink()

static void library_foreach_modifiersForeachIDLink ( void * user_data,
Object * ,
ID ** id_pointer,
int cb_flag )
static

◆ library_foreach_particlesystemsObjectLooper()

static void library_foreach_particlesystemsObjectLooper ( ParticleSystem * ,
ID ** id_pointer,
void * user_data,
int cb_flag )
static

◆ library_foreach_shaderfxForeachIDLink()

static void library_foreach_shaderfxForeachIDLink ( void * user_data,
Object * ,
ID ** id_pointer,
int cb_flag )
static

◆ modifiers_has_animation_check()

static bool modifiers_has_animation_check ( const Object * ob)
static

◆ ob_parbone()

◆ ob_parcurve()

◆ ob_parvert3()

static void ob_parvert3 ( const Object * ob,
const Object * par,
float r_mat[4][4] )
static

◆ object_add_common()

◆ object_asset_dimensions_property()

static IDProperty * object_asset_dimensions_property ( Object * ob)
static

◆ object_asset_metadata_ensure()

static void object_asset_metadata_ensure ( void * asset_ptr,
AssetMetaData * asset_data )
static

◆ object_blend_read_after_liblink()

◆ object_blend_read_data()

static void object_blend_read_data ( BlendDataReader * reader,
ID * id )
static

Definition at line 697 of file blenkernel/intern/object.cc.

References animviz_motionpath_blend_read_data(), BKE_constraint_blend_read_data(), BKE_effector_add_weights(), BKE_gpencil_modifier_blend_read_data(), BKE_lightprobe_cache_blend_read(), BKE_modifier_blend_read_data(), BKE_modifier_new(), BKE_modifier_unique_name(), BKE_modifiers_persistent_uid_init(), BKE_object_empty_draw_type_set(), BKE_object_sculpt_data_create(), BKE_particle_partdeflect_blend_read_data(), BKE_particle_system_blend_read_data(), BKE_pose_blend_read_data(), BKE_previewimg_blend_read(), BKE_ptcache_blend_read_data(), BKE_shaderfx_blend_read_data(), BLI_addhead(), BLI_addtail(), BLI_remlink(), BLO_read_char_array(), BLO_read_data_is_undo(), BLO_read_int32_array(), BLO_read_pointer_array(), BLO_read_struct, BLO_read_struct_list, SoftBody::bpoint, SoftBody::bspring, HookModifierData::cent, ObHook::cent, CLAMP, Object::constraints, copy_v3_v3(), WaveEff::damp, WaveModifierData::damp, direct_link_nlastrips(), EFF_BUILD, EFF_PARTICLE, EFF_WAVE, SoftBody::effector_weights, eModifierType_Build, eModifierType_Hook, eModifierType_Wave, Object::empty_drawtype, HookModifierData::falloff, ObHook::falloff, WaveEff::flag, WaveModifierData::flag, HookModifierData::force, ObHook::force, Object::greasepencil_modifiers, WaveEff::height, WaveModifierData::height, Object::id, ID_TAG_EXTERN, ID_TAG_INDIRECT, HookModifierData::indexar, ObHook::indexar, HookModifierData::indexar_num, Object::iuser, PartEff::keys, SoftBody::keys, BuildEff::len, BuildModifierData::length, WaveEff::lifetime, WaveModifierData::lifetime, Object::light_linking, Object::lightgroup, Object::lightprobe_cache, Object::mat, Object::matbits, MEM_callocN, MEM_freeN(), Object::mode, BuildModifierData::modifier, HookModifierData::modifier, WaveModifierData::modifier, Object::modifiers, Object::mpath, WaveEff::narrow, WaveModifierData::narrow, next, PartEff::next, OB_EMPTY, OB_EMPTY_IMAGE, OB_MODE_ALL_SCULPT, OB_MODE_EDIT, OB_MODE_PARTICLE_EDIT, HookModifierData::object, ObHook::parent, HookModifierData::parentinv, ObHook::parentinv, Object::particlesystem, Object::pc_ids, Object::pd, RigidBodyCon::physics_constraint, SoftBody_Shared::pointcache, Object::pose, Object::preview, SoftBody_Shared::ptcaches, BuildModifierData::randomize, Object::rigidbody_constraint, Object::rigidbody_object, ROT_MODE_MAX, ROT_MODE_MIN, Object::rotmode, Object::runtime, SoftBody::scratch, Object::sculpt, BuildModifierData::seed, BuildEff::sfra, Object::shader_fx, RigidBodyOb::shared, SoftBody::shared, Object::soft, WaveEff::speed, WaveModifierData::speed, BuildModifierData::start, WaveEff::startx, WaveModifierData::startx, WaveModifierData::starty, ID::tag, WaveEff::timeoffs, WaveModifierData::timeoffs, Object::totcol, ObHook::totindex, SoftBody::totkey, Object::type, PartEff::type, WaveEff::width, and WaveModifierData::width.

◆ object_blend_write()

◆ object_cacheIgnoreClear()

static void object_cacheIgnoreClear ( Object * ob,
int state )
static

Set "ignore cache" flag for all caches on this object.

Definition at line 5136 of file blenkernel/intern/object.cc.

References BKE_ptcache_ids_from_object(), BLI_freelistN(), LISTBASE_FOREACH, PTCACHE_IGNORE_CLEAR, and state.

Referenced by BKE_object_modifier_update_subframe().

◆ object_copy_data()

◆ object_copy_modifier_particle_system_ensure()

static ParticleSystem * object_copy_modifier_particle_system_ensure ( Main * bmain,
const Scene * scene,
Object * ob_dst,
ParticleSystem * psys_src )
static

Find a psys matching given psys_src in ob_dst (i.e. sharing the same ParticleSettings ID), or add one, and return valid psys from ob_dst.

Note
Order handling is fairly weak here. This code assumes that it is called before the modifier using the psys is actually copied, and that this copied modifier will be added at the end of the stack. That way we can be sure that the particle modifier will be before the one using its particle system in the stack.

Definition at line 1311 of file blenkernel/intern/object.cc.

References LISTBASE_FOREACH, object_copy_particle_system(), ParticleSystem::part, and Object::particlesystem.

Referenced by BKE_object_copy_modifier().

◆ object_deforms_in_time()

static bool object_deforms_in_time ( Object * object)
static

◆ object_foreach_cache()

static void object_foreach_cache ( ID * id,
IDTypeForeachCacheFunctionCallback function_callback,
void * user_data )
static

◆ object_foreach_id()

◆ object_foreach_path()

◆ object_foreach_path_pointcache()

static void object_foreach_path_pointcache ( ListBase * ptcache_list,
BPathForeachPathData * bpath_data )
static

◆ object_free_data()

◆ object_init()

◆ object_init_data()

◆ object_lib_override_apply_post()

◆ object_modifier_type_copy_check()

static bool object_modifier_type_copy_check ( ModifierType md_type)
static

◆ object_moves_in_time()

static bool object_moves_in_time ( const Object * object)
static

◆ object_update_from_subsurf_ccg()

◆ object_where_is_calc_ex()

◆ obrel_armature_find()

static Object * obrel_armature_find ( Object * ob)
static

◆ obrel_list_add()

static void obrel_list_add ( LinkNode ** links,
Object * ob )
static

◆ obrel_list_test()

static bool obrel_list_test ( Object * ob)
static

Definition at line 4890 of file blenkernel/intern/object.cc.

References Object::id, ID_TAG_DOIT, and ID::tag.

Referenced by BKE_object_relational_superset().

◆ pc_cmp()

static int pc_cmp ( const void * a,
const void * b )
static

Definition at line 4245 of file blenkernel/intern/object.cc.

References b, LinkData::data, and POINTER_AS_INT.

Referenced by BKE_object_insert_ptcache().

◆ pc_findindex()

static int pc_findindex ( ListBase * listbase,
int index )
static

◆ solve_parenting()

static void solve_parenting ( const Object * ob,
Object * par,
const bool set_origin,
float r_obmat[4][4],
float r_originmat[3][3] )
static
Parameters
r_originmatOptional matrix that stores the space the object is in (without its own matrix applied)

Definition at line 3264 of file blenkernel/intern/object.cc.

References BKE_object_get_parent_matrix(), BKE_object_to_mat4(), copy_m3_m4(), copy_v3_v3(), mul_m4_m4m4(), Object::parentinv, PARSKEL, PARTYPE, Object::partype, and Object::runtime.

Referenced by BKE_object_where_is_calc_mat4(), and object_where_is_calc_ex().

Variable Documentation

◆ AssetType_OB

AssetTypeInfo AssetType_OB
static
Initial value:
= {
nullptr,
}
static void object_asset_metadata_ensure(void *asset_ptr, AssetMetaData *asset_data)

Definition at line 1064 of file blenkernel/intern/object.cc.

◆ IDType_ID_OB

IDTypeInfo IDType_ID_OB
Initial value:
= {
sizeof(Object),
"Object",
N_("objects"),
0,
nullptr,
nullptr,
nullptr,
}
#define BLT_I18NCONTEXT_ID_OBJECT
#define FILTER_ID_OB
Definition DNA_ID.h:1181
#define FILTER_ID_ALL
Definition DNA_ID.h:1206
@ INDEX_ID_OB
Definition DNA_ID.h:1307
@ ID_OB
struct Object Object
static void object_blend_write(BlendWriter *writer, ID *id, const void *id_address)
static void object_blend_read_after_liblink(BlendLibReader *reader, ID *id)
static void object_copy_data(Main *bmain, std::optional< Library * >, ID *id_dst, const ID *id_src, const int flag)
static void object_lib_override_apply_post(ID *id_dst, ID *id_src)
static void object_foreach_path(ID *id, BPathForeachPathData *bpath_data)
static AssetTypeInfo AssetType_OB
static void object_blend_read_data(BlendDataReader *reader, ID *id)
static void object_init_data(ID *id)
static void object_foreach_cache(ID *id, IDTypeForeachCacheFunctionCallback function_callback, void *user_data)
static void object_foreach_id(ID *id, LibraryForeachIDData *data)
static void object_free_data(ID *id)
#define N_(msgid)

Definition at line 1070 of file blenkernel/intern/object.cc.

◆ LOG

CLG_LogRef LOG = {"bke.object"}
static

◆ vparent_lock

ThreadMutex vparent_lock = BLI_MUTEX_INITIALIZER
static

Definition at line 172 of file blenkernel/intern/object.cc.

Referenced by give_parvert().