Blender  V2.93
Classes | Macros | Functions | Variables
object.c File Reference
#include <math.h>
#include <stdio.h>
#include <string.h>
#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_modifier_types.h"
#include "DNA_gpencil_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_kdtree.h"
#include "BLI_linklist.h"
#include "BLI_listbase.h"
#include "BLI_math.h"
#include "BLI_threads.h"
#include "BLI_utildefines.h"
#include "BLT_translation.h"
#include "BKE_DerivedMesh.h"
#include "BKE_action.h"
#include "BKE_anim_data.h"
#include "BKE_anim_path.h"
#include "BKE_anim_visualization.h"
#include "BKE_animsys.h"
#include "BKE_armature.h"
#include "BKE_camera.h"
#include "BKE_collection.h"
#include "BKE_constraint.h"
#include "BKE_curve.h"
#include "BKE_deform.h"
#include "BKE_displist.h"
#include "BKE_duplilist.h"
#include "BKE_editmesh.h"
#include "BKE_editmesh_cache.h"
#include "BKE_effect.h"
#include "BKE_fcurve.h"
#include "BKE_fcurve_driver.h"
#include "BKE_font.h"
#include "BKE_geometry_set.h"
#include "BKE_global.h"
#include "BKE_gpencil.h"
#include "BKE_gpencil_geom.h"
#include "BKE_gpencil_modifier.h"
#include "BKE_hair.h"
#include "BKE_icons.h"
#include "BKE_idprop.h"
#include "BKE_idtype.h"
#include "BKE_image.h"
#include "BKE_key.h"
#include "BKE_lattice.h"
#include "BKE_layer.h"
#include "BKE_lib_id.h"
#include "BKE_lib_query.h"
#include "BKE_lib_remap.h"
#include "BKE_light.h"
#include "BKE_lightprobe.h"
#include "BKE_linestyle.h"
#include "BKE_main.h"
#include "BKE_material.h"
#include "BKE_mball.h"
#include "BKE_mesh.h"
#include "BKE_mesh_wrapper.h"
#include "BKE_modifier.h"
#include "BKE_multires.h"
#include "BKE_node.h"
#include "BKE_object.h"
#include "BKE_object_facemap.h"
#include "BKE_paint.h"
#include "BKE_particle.h"
#include "BKE_pbvh.h"
#include "BKE_pointcache.h"
#include "BKE_pointcloud.h"
#include "BKE_rigidbody.h"
#include "BKE_scene.h"
#include "BKE_shader_fx.h"
#include "BKE_softbody.h"
#include "BKE_speaker.h"
#include "BKE_subdiv_ccg.h"
#include "BKE_subsurf.h"
#include "BKE_volume.h"
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_query.h"
#include "DRW_engine.h"
#include "BLO_read_write.h"
#include "SEQ_sequencer.h"
#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, ID *id_dst, const ID *id_src, const int flag)
 
static void object_free_data (ID *id)
 
static void object_make_local (Main *bmain, ID *id, const int flags)
 
static void library_foreach_modifiersForeachIDLink (void *user_data, Object *UNUSED(object), ID **id_pointer, int cb_flag)
 
static void library_foreach_gpencil_modifiersForeachIDLink (void *user_data, Object *UNUSED(object), ID **id_pointer, int cb_flag)
 
static void library_foreach_shaderfxForeachIDLink (void *user_data, Object *UNUSED(object), ID **id_pointer, int cb_flag)
 
static void library_foreach_constraintObjectLooper (bConstraint *UNUSED(con), ID **id_pointer, bool is_reference, void *user_data)
 
static void library_foreach_particlesystemsObjectLooper (ParticleSystem *UNUSED(psys), ID **id_pointer, void *user_data, int cb_flag)
 
static void object_foreach_id (ID *id, LibraryForeachIDData *data)
 
static void write_defgroups (BlendWriter *writer, ListBase *defbase)
 
static void write_fmaps (BlendWriter *writer, ListBase *fbase)
 
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 lib_link_nlastrips (BlendLibReader *reader, ID *id, ListBase *striplist)
 
static void lib_link_constraint_channels (BlendLibReader *reader, ID *id, ListBase *chanbase)
 
static void object_blend_read_lib (BlendLibReader *reader, ID *id)
 
static void expand_constraint_channels (BlendExpander *expander, ListBase *chanbase)
 
static void expand_object_expandModifiers (void *userData, Object *UNUSED(ob), ID **idpoin, int UNUSED(cb_flag))
 
PartEffBKE_object_do_version_give_parteff_245 (Object *ob)
 
static void object_blend_read_expand (BlendExpander *expander, ID *id)
 
static void object_lib_override_apply_post (ID *id_dst, ID *UNUSED(id_src))
 
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, Scene *scene, Object *ob_dst, ParticleSystem *psys_src)
 
bool BKE_object_copy_modifier (Main *bmain, Scene *scene, Object *ob_dst, const Object *ob_src, ModifierData *md_src)
 
bool BKE_object_copy_gpencil_modifier (struct Object *ob_dst, GpencilModifierData *gmd_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, int 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)
 
void BKE_object_preview_geometry_set_add (Object *ob, const uint64_t key, struct GeometrySet *geometry_set)
 
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 ID *id)
 
char * BKE_object_data_editmode_flush_ptr_get (struct ID *id)
 
bool BKE_object_is_in_wpaint_select_vert (const Object *ob)
 
bool BKE_object_has_mode_data (const struct Object *ob, eObjectMode object_mode)
 
bool BKE_object_is_mode_compat (const struct 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, ViewLayer *view_layer, int type, const char *name)
 
ObjectBKE_object_add (Main *bmain, 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, 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_visible (Object *ob, ViewLayer *view_layer, View3D *v3d)
 
Object ** BKE_object_pose_array_get_ex (ViewLayer *view_layer, View3D *v3d, uint *r_objects_len, bool unique)
 
Object ** BKE_object_pose_array_get_unique (ViewLayer *view_layer, View3D *v3d, uint *r_objects_len)
 
Object ** BKE_object_pose_array_get (ViewLayer *view_layer, View3D *v3d, uint *r_objects_len)
 
Base ** BKE_object_pose_base_array_get_ex (ViewLayer *view_layer, View3D *v3d, uint *r_bases_len, bool unique)
 
Base ** BKE_object_pose_base_array_get_unique (ViewLayer *view_layer, View3D *v3d, uint *r_bases_len)
 
Base ** BKE_object_pose_base_array_get (ViewLayer *view_layer, View3D *v3d, uint *r_bases_len)
 
void BKE_object_transform_copy (Object *ob_tar, const Object *ob_src)
 
ObjectBKE_object_duplicate (Main *bmain, Object *ob, eDupli_ID_Flags dupflag, eLibIDDuplicateFlags duplicate_options)
 
bool BKE_object_is_libdata (const Object *ob)
 
bool BKE_object_obdata_is_libdata (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, Object *ob, bool use_default)
 
void BKE_object_runtime_reset (Object *object)
 
void BKE_object_runtime_reset_on_copy (Object *object, const int UNUSED(flag))
 
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 (struct ViewLayer *view_layer, eObjectSet objectSet, eObRelationTypes includeFilter)
 
struct LinkNodeBKE_object_groups (Main *bmain, Scene *scene, Object *ob)
 
void BKE_object_groups_clear (Main *bmain, Scene *scene, Object *ob)
 
KDTree_3d * BKE_object_as_kdtree (Object *ob, int *r_tot)
 
bool BKE_object_modifier_use_time (Object *ob, ModifierData *md)
 
bool BKE_object_modifier_gpencil_use_time (Object *ob, GpencilModifierData *md)
 
bool BKE_object_shaderfx_use_time (Object *ob, ShaderFxData *fx)
 
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 (struct Main *bmain)
 
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_uuids_unique_and_report (const Object *object)
 
void BKE_object_modifiers_lib_link_common (void *userData, struct Object *ob, struct ID **idpoin, int cb_flag)
 
Object Proxy API
static void armature_set_id_extern (Object *ob)
 
void BKE_object_copy_proxy_drivers (Object *ob, Object *target)
 
void BKE_object_make_proxy (Main *bmain, Object *ob, Object *target, Object *cob)
 
void BKE_object_obdata_size_init (struct Object *ob, const float size)
 
Object Matrix Get/Set API
void BKE_object_scale_to_mat3 (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 (Object *ob, float r_mat[3][3])
 
void BKE_object_to_mat4 (Object *ob, float r_mat[4][4])
 
void BKE_object_matrix_local_get (struct Object *ob, float r_mat[4][4])
 
static bool ob_parcurve (Object *ob, Object *par, float r_mat[4][4])
 
static void ob_parbone (Object *ob, Object *par, float r_mat[4][4])
 
static void give_parvert (Object *par, int nr, float vec[3])
 
static void ob_parvert3 (Object *ob, Object *par, float r_mat[4][4])
 
void BKE_object_get_parent_matrix (Object *ob, Object *par, float r_parentmat[4][4])
 
Object Matrix Evaluation API
static void solve_parenting (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 (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)
 
void BKE_object_workob_calc_parent (Depsgraph *depsgraph, Scene *scene, Object *ob, Object *workob)
 
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)
 
Object Bounding Box API
BoundBoxBKE_boundbox_alloc_unit (void)
 
void BKE_boundbox_init_from_minmax (BoundBox *bb, const float min[3], const float max[3])
 
void BKE_boundbox_calc_center_aabb (const BoundBox *bb, float r_cent[3])
 
void BKE_boundbox_calc_size_aabb (const BoundBox *bb, float r_size[3])
 
void BKE_boundbox_minmax (const BoundBox *bb, const float obmat[4][4], float r_min[3], float r_max[3])
 
BoundBoxBKE_object_boundbox_get (Object *ob)
 
void BKE_object_boundbox_flag (Object *ob, int flag, const bool set)
 
void BKE_object_boundbox_calc_from_mesh (struct Object *ob, struct Mesh *me_eval)
 
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)
 

Variables

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

Object Dimension Get/Set

Warning
Setting dimensions is prone to feedback loops in evaluation.
typedef struct ObTfmBack ObTfmBack
 
void BKE_object_dimensions_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], const bool use_hidden)
 
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_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)
 
void * BKE_object_tfm_backup (Object *ob)
 
void BKE_object_tfm_restore (Object *ob, void *obtfm_pt)
 
bool BKE_object_parent_loop_check (const Object *par, const Object *ob)
 
static void object_handle_update_proxy (Depsgraph *depsgraph, Scene *scene, Object *object, const bool do_proxy_update)
 
void BKE_object_handle_update_ex (Depsgraph *depsgraph, Scene *scene, Object *ob, RigidBodyWorld *rbw, const bool do_proxy_update)
 
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, short **r_texflag, float **r_loc, float **r_size)
 
MeshBKE_object_get_evaluated_mesh (Object *object)
 
MeshBKE_object_get_pre_modified_mesh (Object *object)
 
MeshBKE_object_get_original_mesh (Object *object)
 
LatticeBKE_object_get_lattice (const Object *object)
 
LatticeBKE_object_get_evaluated_lattice (const Object *object)
 
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)
 

Macro Definition Documentation

◆ DNA_DEPRECATED_ALLOW

#define DNA_DEPRECATED_ALLOW

Definition at line 25 of file object.c.

◆ 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

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 datablock, but for until it is actually supported use simpler solution with a mutex lock.

  • sergey -

Definition at line 166 of file object.c.

Typedef Documentation

◆ ObTfmBack

typedef struct ObTfmBack ObTfmBack

Struct members from DNA_object_types.h

Function Documentation

◆ armature_set_id_extern()

static void armature_set_id_extern ( Object ob)
static

◆ BKE_boundbox_alloc_unit()

BoundBox* BKE_boundbox_alloc_unit ( void  )

Definition at line 3768 of file object.c.

References BKE_boundbox_init_from_minmax(), max, MEM_callocN, and min.

◆ BKE_boundbox_calc_center_aabb()

void BKE_boundbox_calc_center_aabb ( const BoundBox bb,
float  r_cent[3] 
)

Definition at line 3790 of file object.c.

References BoundBox::vec.

◆ BKE_boundbox_calc_size_aabb()

void BKE_boundbox_calc_size_aabb ( const BoundBox bb,
float  r_size[3] 
)

Definition at line 3797 of file object.c.

References fabsf, and BoundBox::vec.

◆ BKE_boundbox_init_from_minmax()

void BKE_boundbox_init_from_minmax ( BoundBox bb,
const float  min[3],
const float  max[3] 
)

◆ 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 3804 of file object.c.

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

Referenced by BKE_object_minmax().

◆ BKE_object_active_modifier()

ModifierData* BKE_object_active_modifier ( const Object ob)

Definition at line 1296 of file object.c.

References BLI_assert, ELEM, eModifierFlag_Active, LISTBASE_FOREACH, Object::modifiers, and NULL.

◆ BKE_object_add()

Object* BKE_object_add ( Main bmain,
ViewLayer view_layer,
int  type,
const char *  name 
)

General add: to scene, with layer from area and default name

Object is added to the active Collection. If there is no linked collection to the active ViewLayer we create a new one.

Note
Creates minimum required data, but without vertices etc.

Definition at line 2230 of file object.c.

References BKE_collection_object_add(), BKE_layer_collection_get_active(), BKE_view_layer_base_find(), BKE_view_layer_base_select_and_set_active(), LayerCollection::collection, object_add_common(), and type.

◆ BKE_object_add_for_data()

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

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

Parameters
dataThe datablock 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 2269 of file object.c.

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(), LayerCollection::collection, data, Object::data, DEG_id_tag_update_ex(), Object::id, ID_RECALC_ANIMATION, ID_RECALC_GEOMETRY, ID_RECALC_TRANSFORM, id_us_plus(), and type.

Referenced by ED_object_add_type_with_obdata(), and gpencil_convert_old_files_exec().

◆ BKE_object_add_from()

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

Add a new object, using another one as a reference

Parameters
ob_srcobject to use to determine the collections of the new object.

Definition at line 2248 of file object.c.

References BKE_collection_object_add_from(), BKE_view_layer_base_find(), BKE_view_layer_base_select_and_set_active(), object_add_common(), scene, and type.

◆ BKE_object_add_only_object()

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

◆ BKE_object_apply_mat4()

void BKE_object_apply_mat4 ( Object ob,
const float  mat[4][4],
const bool  use_compat,
const 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],
const 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 3708 of file object.c.

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(), NULL, 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_as_kdtree()

KDTree_3d* BKE_object_as_kdtree ( Object ob,
int *  r_tot 
)

Return a KDTree_3d from the deformed object (in worldspace)

Note
Only mesh objects currently support deforming, others are TODO.
Parameters
ob
r_tot
Returns
The kdtree or NULL if it can't be created.

Definition at line 5280 of file object.c.

References Freestyle::a, Nurb::bezt, BKE_nurbList_verts_count_without_handles(), Nurb::bp, CD_ORIGINDEX, MVert::co, CustomData_get_layer(), Object::data, Lattice::def, ListBase::first, Object_Runtime::mesh_deform_eval, mul_v3_m4v3(), Mesh::mvert, Nurb::next, NULL, Curve::nurb, OB_CURVE, OB_LATTICE, OB_MESH, OB_SURF, Object::obmat, ORIGINDEX_NONE, Nurb::pntsu, Lattice::pntsu, Nurb::pntsv, Lattice::pntsv, Lattice::pntsw, Object::runtime, Mesh::totvert, tree, Object::type, BezTriple::vec, and BPoint::vec.

Referenced by parent_set_vertex_parent().

◆ BKE_object_boundbox_calc_from_mesh()

void BKE_object_boundbox_calc_from_mesh ( struct Object ob,
struct Mesh me_eval 
)

◆ BKE_object_boundbox_flag()

void BKE_object_boundbox_flag ( Object ob,
int  flag,
const bool  set 
)

Use this to temporally disable/enable bound-box.

Definition at line 3860 of file object.c.

References BKE_object_boundbox_get(), Lattice::flag, and BoundBox::flag.

◆ BKE_object_boundbox_get()

BoundBox* BKE_object_boundbox_get ( Object ob)

◆ BKE_object_check_uuids_unique_and_report()

void BKE_object_check_uuids_unique_and_report ( const Object object)

◆ BKE_object_copy_gpencil_modifier()

bool BKE_object_copy_gpencil_modifier ( struct Object ob_dst,
GpencilModifierData gmd_src 
)

◆ BKE_object_copy_modifier()

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

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 1407 of file object.c.

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_object_copy_softbody(), BKE_object_modifier_set_active(), BKE_object_support_modifier_type_check(), BLI_addtail(), BLI_assert, BLI_strncpy(), DynamicPaintModifierData::brush, Object::data, eModifierType_DynamicPaint, eModifierType_Fluid, eModifierType_Multires, eModifierType_ParticleSystem, eModifierType_Skin, eModifierType_Softbody, eModifierTypeFlag_Single, ModifierTypeInfo::flags, FluidModifierData::flow, MOD_FLUID_TYPE_FLOW, Object::modifiers, multiresModifier_sync_levels_ex(), ModifierData::name, NULL, OB_GPENCIL, object_copy_modifier_particle_system_ensure(), object_copy_particle_system(), object_modifier_type_copy_check(), DynamicPaintBrushSettings::psys, FluidFlowSettings::psys, scene, ModifierData::type, FluidModifierData::type, and Object::type.

◆ BKE_object_copy_particlesystem()

ParticleSystem* BKE_object_copy_particlesystem ( ParticleSystem psys,
const int  flag 
)

◆ BKE_object_copy_particlesystems()

void BKE_object_copy_particlesystems ( Object ob_dst,
const Object ob_src,
const int  flag 
)

◆ BKE_object_copy_proxy_drivers()

void BKE_object_copy_proxy_drivers ( Object ob,
Object target 
)

◆ BKE_object_copy_softbody()

void BKE_object_copy_softbody ( Object ob_dst,
const Object ob_src,
const int  flag 
)

◆ BKE_object_data_editmode_flush_ptr_get()

char* BKE_object_data_editmode_flush_ptr_get ( struct ID id)

◆ BKE_object_data_is_in_editmode()

bool BKE_object_data_is_in_editmode ( const ID id)

◆ BKE_object_delete_ptcache()

void BKE_object_delete_ptcache ( Object ob,
int  index 
)

Definition at line 4598 of file object.c.

References BLI_findlink(), BLI_freelinkN(), pc_findindex(), and Object::pc_ids.

Referenced by BKE_ptcache_toggle_disk_cache().

◆ BKE_object_dimensions_get()

void BKE_object_dimensions_get ( Object ob,
float  r_vec[3] 
)

◆ BKE_object_dimensions_set()

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

Definition at line 3959 of file object.c.

References BKE_object_dimensions_set_ex(), and NULL.

◆ 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: T69536.

Definition at line 3926 of file object.c.

References BKE_object_boundbox_get(), copysignf, CCL_NAMESPACE_BEGIN::isfinite(), len, len_v3(), NULL, Object::scale, and BoundBox::vec.

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 1024 of file object.c.

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

Referenced by blo_do_versions_pre250(), and object_blend_read_expand().

◆ BKE_object_duplicate()

Object* BKE_object_duplicate ( Main bmain,
Object ob,
eDupli_ID_Flags  dupflag,
eLibIDDuplicateFlags  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_clear_newpoins()) and call updates of DEG too (#DAG_relations_tag_update()).

Definition at line 2631 of file object.c.

References BKE_animdata_duplicate_id_action(), BKE_id_copy_for_duplicate(), BKE_libblock_relink_to_newid(), BKE_main_id_clear_newpoins(), BKE_main_id_tag_all(), BKE_object_material_array_p(), BKE_pose_tag_recalc(), BLI_assert, Object::data, DEG_id_tag_update(), DEG_id_tag_update_ex(), ELEM, ListBase::first, FOREACH_MAIN_ID_BEGIN, FOREACH_MAIN_ID_END, Object::id, ID_IS_LINKED, ID_RECALC_EDITORS, ID_RECALC_GEOMETRY, LIB_ID_DUPLICATE_IS_ROOT_ID, LIB_ID_DUPLICATE_IS_SUBPROCESS, LIB_TAG_NEW, Object::mat, ID::newid, ParticleSystem::next, NULL, OB_ARMATURE, OB_CAMERA, OB_CURVE, OB_FONT, OB_GPENCIL, OB_HAIR, OB_LAMP, OB_LATTICE, OB_LIGHTPROBE, OB_MBALL, OB_MESH, OB_POINTCLOUD, OB_SPEAKER, OB_SURF, OB_VOLUME, ParticleSystem::part, Object::particlesystem, Object::pose, ID::tag, Object::totcol, Object::type, USER_DUP_ARM, USER_DUP_CURVE, USER_DUP_FONT, USER_DUP_GPENCIL, USER_DUP_HAIR, USER_DUP_LAMP, USER_DUP_LIGHTPROBE, USER_DUP_LINKED_ID, USER_DUP_MAT, USER_DUP_MBALL, USER_DUP_MESH, USER_DUP_POINTCLOUD, USER_DUP_PSYS, USER_DUP_SURF, and USER_DUP_VOLUME.

◆ BKE_object_empty_draw_type_set()

void BKE_object_empty_draw_type_set ( Object ob,
const int  value 
)

◆ BKE_object_empty_image_data_is_visible_in_view3d()

bool BKE_object_empty_image_data_is_visible_in_view3d ( const Object ob,
const RegionView3D rv3d 
)

◆ BKE_object_empty_image_frame_is_visible_in_view3d()

bool BKE_object_empty_image_frame_is_visible_in_view3d ( const Object ob,
const RegionView3D rv3d 
)

◆ BKE_object_eval_assign_data()

void BKE_object_eval_assign_data ( Object object_eval,
ID data_eval,
bool  is_owned 
)

◆ BKE_object_exists_check()

bool BKE_object_exists_check ( Main bmain,
const Object obtest 
)

Definition at line 2029 of file object.c.

References LISTBASE_FOREACH, NULL, and Main::objects.

◆ BKE_object_flag_test_recursive()

bool BKE_object_flag_test_recursive ( const Object ob,
short  flag 
)

Definition at line 4843 of file object.c.

References Object::flag, and Object::parent.

◆ BKE_object_foreach_display_point()

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

◆ BKE_object_free_caches()

void BKE_object_free_caches ( Object object)

◆ BKE_object_free_curve_cache()

void BKE_object_free_curve_cache ( Object ob)

◆ BKE_object_free_derived_caches()

void BKE_object_free_derived_caches ( Object ob)

◆ BKE_object_free_modifiers()

void BKE_object_free_modifiers ( Object ob,
const int  flag 
)

◆ 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 
)

Definition at line 1222 of file object.c.

References BKE_shaderfx_free_ex(), BLI_pophead(), and Object::shader_fx.

Referenced by object_convert_exec(), and object_free_data().

◆ BKE_object_free_softbody()

void BKE_object_free_softbody ( Object ob)

Definition at line 1181 of file object.c.

References sbFree().

Referenced by BKE_object_free_modifiers().

◆ BKE_object_get_evaluated_lattice()

Lattice* BKE_object_get_evaluated_lattice ( const Object object)

Definition at line 4525 of file object.c.

References Lattice::editlatt, GS, ID_LT, EditLatt::latt, ID::name, and NULL.

◆ BKE_object_get_evaluated_mesh()

Mesh* BKE_object_get_evaluated_mesh ( Object object)

Get evaluated mesh for given object.

Definition at line 4459 of file object.c.

References GS, ID_ME, ID::name, and NULL.

Referenced by BKE_effectors_create(), BKE_gpencil_convert_mesh(), BKE_modifier_get_evaluated_mesh_from_evaluated_object(), BKE_object_foreach_display_point(), BKE_sculpt_update_object_after_eval(), BKE_sculpt_update_object_for_edit(), boundbox_displist_object(), contarget_get_mesh_mat(), DRW_batch_cache_free_old(), drw_batch_cache_generate_requested(), drw_batch_cache_validate(), DRW_cache_curve_edge_detection_get(), DRW_cache_curve_edge_wire_get(), DRW_cache_curve_face_wireframe_get(), DRW_cache_curve_loose_edges_get(), DRW_cache_curve_surface_get(), DRW_cache_curve_surface_shaded_get(), DRW_cache_object_material_count_get(), DRW_cache_object_pos_vertbuf_get(), DRW_cache_surf_edge_detection_get(), DRW_cache_surf_edge_wire_get(), DRW_cache_surf_face_wireframe_get(), DRW_cache_surf_loose_edges_get(), DRW_cache_surf_surface_get(), DRW_cache_surf_surface_shaded_get(), DRW_cache_text_edge_detection_get(), DRW_cache_text_edge_wire_get(), DRW_cache_text_face_wireframe_get(), DRW_cache_text_loose_edges_get(), DRW_cache_text_surface_get(), DRW_cache_text_surface_shaded_get(), ED_draw_object_facemap(), followtrack_project_to_depth_object_if_needed(), get_effector_data(), get_effector_tot(), blender::io::alembic::ABCCurveMeshWriter::get_export_mesh(), blender::io::alembic::ABCMetaballWriter::get_export_mesh(), blender::io::alembic::ABCMeshWriter::get_export_mesh(), blender::io::usd::USDMeshWriter::get_export_mesh(), blender::io::usd::USDMetaballWriter::get_export_mesh(), give_parvert(), knifeproject_poly_from_object(), mesh_data_from_duplicator_object(), mesh_get_eval_final(), object_update_from_subsurf_ccg(), paintvert_flush_flags(), PE_create_shape_tree(), raycast_obj_fn(), shrinkwrap_get_tarmat(), snap_obj_fn(), stats_object(), and vertex_paint_use_fast_update_check().

◆ BKE_object_get_lattice()

Lattice* BKE_object_get_lattice ( const Object object)

Definition at line 4510 of file object.c.

References data, Lattice::editlatt, GS, ID_LT, EditLatt::latt, and NULL.

◆ BKE_object_get_original_mesh()

Mesh* BKE_object_get_original_mesh ( Object object)

Get a mesh which corresponds to very very original mesh from Main.

  • For original objects it will be object->data.
  • For evaluated objects it will be same mesh as corresponding original object uses as data.

Definition at line 4493 of file object.c.

References BLI_assert, Object::id, LIB_TAG_COPIED_ON_WRITE, LIB_TAG_COPIED_ON_WRITE_EVAL_RESULT, NULL, ID::orig_id, result, and ID::tag.

Referenced by BKE_sculpt_color_layer_create_if_needed(), build_pbvh_from_regular_mesh(), SCULPT_geodesic_fallback_create(), SCULPT_geodesic_mesh_create(), sculpt_undo_face_sets_push(), sculpt_undo_restore_face_sets(), sculpt_update_object(), and SCULPT_visibility_sync_all_face_sets_to_vertices().

◆ BKE_object_get_parent_matrix()

void BKE_object_get_parent_matrix ( Object ob,
Object par,
float  r_parentmat[4][4] 
)

◆ BKE_object_get_pre_modified_mesh()

Mesh* BKE_object_get_pre_modified_mesh ( 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 4472 of file object.c.

References BLI_assert, Object_Runtime::data_orig, Object::id, LIB_TAG_COPIED_ON_WRITE, LIB_TAG_COPIED_ON_WRITE_EVAL_RESULT, NULL, OB_MESH, ID::orig_id, result, Object::runtime, ID::tag, and Object::type.

Referenced by MOD_deform_mesh_eval_get().

◆ BKE_object_groups()

struct LinkNode* BKE_object_groups ( Main bmain,
Scene scene,
Object ob 
)

return all groups this object is a part of, caller must free.

Definition at line 5251 of file object.c.

References BKE_collection_object_find(), BLI_linklist_prepend(), NULL, and scene.

Referenced by make_links_data_exec().

◆ BKE_object_groups_clear()

void BKE_object_groups_clear ( Main bmain,
Scene scene,
Object ob 
)

◆ 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 4401 of file object.c.

References BKE_object_handle_update_ex(), depsgraph, NULL, and scene.

Referenced by BKE_object_modifier_update_subframe(), and object_handle_update_proxy().

◆ BKE_object_handle_update_ex()

void BKE_object_handle_update_ex ( Depsgraph depsgraph,
Scene scene,
Object ob,
RigidBodyWorld rbw,
const bool  do_proxy_update 
)

Proxy rule:

  • lib_object->proxy_from == the one we borrow from, only set temporal and cleared here.
  • local_object->proxy == pointer to library object, saved in files and read.

Function below is polluted with proxy exceptions, cleanup will follow!

The main object update call, for object matrix, constraints, keys and displist (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 4341 of file object.c.

References BKE_object_eval_proxy_copy(), BKE_object_handle_data_update(), BKE_object_where_is_calc_ex(), BKE_pose_channels_hash_make(), 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, NULL, OB_ARMATURE, object_handle_update_proxy(), Object::pose, POSE_CONSTRAINTS_NEED_UPDATE_FLAGS, POSE_RECALC, ID::recalc, scene, and Object::type.

Referenced by BKE_object_handle_update().

◆ BKE_object_has_mode_data()

bool BKE_object_has_mode_data ( const struct Object ob,
eObjectMode  object_mode 
)

◆ BKE_object_insert_ptcache()

int BKE_object_insert_ptcache ( Object ob)

◆ BKE_object_is_child_recursive()

bool BKE_object_is_child_recursive ( const Object ob_parent,
const Object ob_child 
)

Definition at line 4855 of file object.c.

References Object::parent.

Referenced by BKE_object_relational_superset().

◆ 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 5018 of file object.c.

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, eModifierTypeType_OnlyDeform, if(), modifiers_has_animation_check(), ModifierData::next, NULL, OB_CURVE, object_deforms_in_time(), scene, Curve::taperobj, ModifierTypeInfo::type, ModifierData::type, and Object::type.

Referenced by EEVEE_motion_blur_cache_populate().

◆ 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 1839 of file object.c.

References Object::data, GPENCIL_EDIT_MODE, NULL, OB_ARMATURE, OB_CURVE, OB_FONT, OB_GPENCIL, OB_LATTICE, OB_MBALL, OB_MESH, OB_SURF, and Object::type.

Referenced by BKE_object_has_mode_data(), and BKE_object_is_in_editmode_vgroup().

◆ BKE_object_is_in_editmode_vgroup()

bool BKE_object_is_in_editmode_vgroup ( const Object ob)

Definition at line 1867 of file object.c.

References BKE_object_is_in_editmode(), OB_TYPE_SUPPORT_VGROUP, and Object::type.

◆ BKE_object_is_in_wpaint_select_vert()

bool BKE_object_is_in_wpaint_select_vert ( const Object ob)

◆ 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 2805 of file object.c.

References ID_IS_LINKED.

◆ BKE_object_is_mode_compat()

bool BKE_object_is_mode_compat ( const struct 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).

Definition at line 4869 of file object.c.

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

Referenced by motion_blur_deform_data_get().

◆ BKE_object_link_modifiers()

void BKE_object_link_modifiers ( Object ob_dst,
const Object ob_src 
)

Definition at line 1586 of file object.c.

References BKE_object_free_modifiers(), and BKE_object_modifier_stack_copy().

◆ BKE_object_make_proxy()

void BKE_object_make_proxy ( Main bmain,
Object ob,
Object target,
Object cob 
)

◆ BKE_object_mat3_to_rot()

void BKE_object_mat3_to_rot ( Object ob,
float  mat[3][3],
bool  use_compat 
)

◆ BKE_object_matrix_local_get()

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

◆ BKE_object_minmax()

void BKE_object_minmax ( Object ob,
float  r_min[3],
float  r_max[3],
const bool  use_hidden 
)

◆ BKE_object_minmax_dupli()

bool BKE_object_minmax_dupli ( Depsgraph depsgraph,
Scene scene,
Object ob,
float  r_min[3],
float  r_max[3],
const bool  use_hidden 
)

◆ BKE_object_modifier_gpencil_hook_reset()

void BKE_object_modifier_gpencil_hook_reset ( Object ob,
HookGpencilModifierData hmd 
)

◆ BKE_object_modifier_gpencil_use_time()

bool BKE_object_modifier_gpencil_use_time ( Object ob,
GpencilModifierData md 
)

◆ BKE_object_modifier_hook_reset()

void BKE_object_modifier_hook_reset ( Object ob,
HookModifierData hmd 
)

◆ BKE_object_modifier_set_active()

void BKE_object_modifier_set_active ( Object ob,
ModifierData md 
)

◆ BKE_object_modifier_stack_copy()

bool BKE_object_modifier_stack_copy ( Object ob_dst,
const Object ob_src,
const bool  do_copy_all,
const 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.
Parameters
do_copy_allIf true, even modifiers that should not support copying (like Hook one) will be duplicated.

Definition at line 1537 of file object.c.

References BKE_gpencil_modifier_copydata_ex(), BKE_gpencil_modifier_new(), BKE_modifier_copydata_ex(), BKE_modifier_new(), BKE_object_copy_particlesystems(), BKE_object_copy_softbody(), BKE_object_support_modifier_type_check(), BLI_addtail(), BLI_assert, BLI_listbase_is_empty(), BLI_strncpy(), Object::greasepencil_modifiers, LISTBASE_FOREACH, Object::modifiers, GpencilModifierData::name, ModifierData::name, OB_GPENCIL, object_modifier_type_copy_check(), and Object::type.

Referenced by BKE_object_link_modifiers(), and object_copy_data().

◆ BKE_object_modifier_update_subframe()

bool BKE_object_modifier_update_subframe ( Depsgraph depsgraph,
Scene scene,
Object ob,
bool  update_mesh,
int  parent_recursion,
float  frame,
int  type 
)

◆ BKE_object_modifier_use_time()

bool BKE_object_modifier_use_time ( Object ob,
ModifierData md 
)

◆ BKE_object_modifiers_lib_link_common()

void BKE_object_modifiers_lib_link_common ( void *  userData,
struct Object ob,
struct ID **  idpoin,
int  cb_flag 
)

◆ 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 (eModifierTypeType_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 4917 of file object.c.

References BKE_animdata_id_is_animated(), BLI_listbase_is_empty(), Object::constraints, Object::id, NULL, and Object::parent.

Referenced by object_moves_in_time().

◆ BKE_object_movieclip_get()

MovieClip* BKE_object_movieclip_get ( Scene scene,
Object ob,
bool  use_default 
)

◆ BKE_object_obdata_add_from_type()

void* BKE_object_obdata_add_from_type ( Main bmain,
int  type,
const char *  name 
)

◆ BKE_object_obdata_is_libdata()

bool BKE_object_obdata_is_libdata ( const Object ob)

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

Definition at line 2813 of file object.c.

References BLI_assert, Object::data, and ID_IS_LINKED.

◆ BKE_object_obdata_size_init()

void BKE_object_obdata_size_init ( struct Object ob,
const float  size 
)

◆ BKE_object_obdata_texspace_get()

bool BKE_object_obdata_texspace_get ( Object ob,
short **  r_texflag,
float **  r_loc,
float **  r_size 
)

◆ BKE_object_obdata_to_type()

int BKE_object_obdata_to_type ( const ID id)

◆ BKE_object_parent_loop_check()

bool BKE_object_parent_loop_check ( const Object par,
const Object ob 
)

Definition at line 4294 of file object.c.

References NULL, and Object::parent.

◆ BKE_object_pose_armature_get()

Object* BKE_object_pose_armature_get ( Object ob)

Definition at line 2487 of file object.c.

References BKE_modifiers_is_deformed_by_armature(), BKE_object_pose_context_check(), and NULL.

Referenced by apply_armature_pose2bones_exec(), armature_layers_get_data(), BKE_object_defgroup_selected_get(), BKE_object_pose_armature_get_visible(), BKE_object_pose_array_get_ex(), BKE_object_pose_base_array_get_ex(), draw_selected_name(), drw_context_state_init(), dt_layers_select_src_itemf(), ED_object_vgroup_selection_itemf_helper(), ED_operator_posemode(), ED_operator_posemode_exclusive(), ED_operator_posemode_local(), ED_pose_object_from_context(), ED_vgroup_sync_from_pose(), ED_view3d_select_filter_from_mode(), get_poselib_object(), is_cursor_visible(), outliner_viewcontext_init(), pose_calculate_paths_exec(), pose_calculate_paths_invoke(), pose_clear_paths_exec(), pose_constraint_add_exec(), pose_copy_exec(), pose_ik_add_invoke(), pose_paste_exec(), pose_select_grouped_exec(), pose_select_hierarchy_exec(), pose_select_parent_exec(), pose_select_same_group(), pose_select_same_keyingset(), pose_update_paths_exec(), pose_update_paths_range_exec(), poseAnim_object_get(), poselib_rename_exec(), 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(), tree_element_posechannel_activate(), 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,
ViewLayer view_layer,
View3D v3d 
)

◆ BKE_object_pose_array_get()

Object** BKE_object_pose_array_get ( ViewLayer view_layer,
View3D v3d,
uint r_objects_len 
)

◆ BKE_object_pose_array_get_ex()

Object** BKE_object_pose_array_get_ex ( ViewLayer view_layer,
View3D v3d,
uint r_objects_len,
bool  unique 
)

Access pose array with special check to get pose object when in weight paint mode.

Definition at line 2524 of file object.c.

References BKE_object_pose_armature_get(), BKE_view_layer_array_from_objects_in_mode, MEM_mallocN, NULL, OB_MODE_POSE, and OBACT.

Referenced by BKE_object_pose_array_get(), and BKE_object_pose_array_get_unique().

◆ BKE_object_pose_array_get_unique()

Object** BKE_object_pose_array_get_unique ( ViewLayer view_layer,
View3D v3d,
uint r_objects_len 
)

◆ BKE_object_pose_base_array_get()

Base** BKE_object_pose_base_array_get ( ViewLayer view_layer,
View3D v3d,
uint r_bases_len 
)

Definition at line 2604 of file object.c.

References BKE_object_pose_base_array_get_ex().

Referenced by ed_armature_pick_bone_impl().

◆ BKE_object_pose_base_array_get_ex()

Base** BKE_object_pose_base_array_get_ex ( ViewLayer view_layer,
View3D v3d,
uint r_bases_len,
bool  unique 
)

◆ BKE_object_pose_base_array_get_unique()

Base** BKE_object_pose_base_array_get_unique ( ViewLayer view_layer,
View3D v3d,
uint r_bases_len 
)

Definition at line 2600 of file object.c.

References BKE_object_pose_base_array_get_ex().

Referenced by ED_pose_deselect_all_multi().

◆ BKE_object_pose_context_check()

bool BKE_object_pose_context_check ( const Object ob)

Definition at line 2478 of file object.c.

References Object::mode, OB_ARMATURE, OB_MODE_POSE, Object::pose, and Object::type.

Referenced by BKE_object_pose_armature_get().

◆ BKE_object_preview_geometry_set_add()

void BKE_object_preview_geometry_set_add ( Object ob,
const uint64_t  key,
struct GeometrySet geometry_set 
)

◆ BKE_object_relational_superset()

LinkNode* BKE_object_relational_superset ( struct 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 5167 of file object.c.

References BASE_EDITABLE, BASE_SELECTED_EDITABLE, BKE_object_is_child_recursive(), ListBase::first, Object::id, LIB_TAG_DOIT, Base::next, NULL, 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, Base::object, ViewLayer::object_bases, obrel_armature_find(), obrel_list_add(), obrel_list_test(), Object::parent, and ID::tag.

Referenced by collada_export().

◆ BKE_object_rot_to_mat3()

void BKE_object_rot_to_mat3 ( const Object ob,
float  mat[3][3],
bool  use_drot 
)

◆ BKE_object_runtime_reset()

void BKE_object_runtime_reset ( Object object)

◆ BKE_object_runtime_reset_on_copy()

void BKE_object_runtime_reset_on_copy ( Object object,
const int   UNUSEDflag 
)

◆ BKE_object_scale_to_mat3()

void BKE_object_scale_to_mat3 ( Object ob,
float  mat[3][3] 
)

◆ 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 5068 of file object.c.

References BKE_collection_has_object_recursive(), ListBase::first, Scene::id, Scene::master_collection, ID::next, NULL, scene, and Main::scenes.

Referenced by single_object_users_collection().

◆ BKE_object_sculpt_data_create()

void BKE_object_sculpt_data_create ( Object ob)

◆ BKE_object_shaderfx_use_time()

bool BKE_object_shaderfx_use_time ( Object ob,
ShaderFxData fx 
)

◆ BKE_object_shapekey_free()

bool BKE_object_shapekey_free ( Main bmain,
Object ob 
)

Definition at line 4758 of file object.c.

References BKE_id_free_us(), BKE_key_from_object_p(), ELEM, and NULL.

Referenced by BKE_object_shapekey_remove(), and shape_key_remove_exec().

◆ BKE_object_shapekey_insert()

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

◆ BKE_object_shapekey_remove()

bool BKE_object_shapekey_remove ( Main bmain,
Object ob,
KeyBlock kb 
)

◆ BKE_object_support_modifier_type_check()

bool BKE_object_support_modifier_type_check ( const Object ob,
int  modifier_type 
)

◆ BKE_object_supports_modifiers()

bool BKE_object_supports_modifiers ( const Object ob)
Returns
True if the object's type supports regular modifiers (not grease pencil modifiers).

Definition at line 1321 of file object.c.

References ELEM, OB_CURVE, OB_FONT, OB_LATTICE, OB_MESH, OB_POINTCLOUD, OB_SURF, OB_VOLUME, and Object::type.

◆ BKE_object_tfm_backup()

void* BKE_object_tfm_backup ( Object ob)

◆ BKE_object_tfm_copy()

void BKE_object_tfm_copy ( Object object_dst,
const Object object_src 
)

Definition at line 3196 of file object.c.

References rot, TFMCPY, TFMCPY3D, and TFMCPY4D.

◆ BKE_object_tfm_protected_backup()

void BKE_object_tfm_protected_backup ( const Object ob,
ObjectTfmProtectedChannels obtfm 
)

Definition at line 3133 of file object.c.

References rot, TFMCPY, TFMCPY3D, and TFMCPY4D.

◆ BKE_object_tfm_protected_restore()

void BKE_object_tfm_protected_restore ( Object ob,
const ObjectTfmProtectedChannels obtfm,
const short  protectflag 
)

◆ BKE_object_tfm_restore()

void BKE_object_tfm_restore ( Object ob,
void *  obtfm_pt 
)

◆ BKE_object_to_curve()

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

Definition at line 5682 of file object.c.

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)

◆ BKE_object_to_mat3()

void BKE_object_to_mat3 ( Object ob,
float  r_mat[3][3] 
)

◆ BKE_object_to_mat4()

void BKE_object_to_mat4 ( Object ob,
float  r_mat[4][4] 
)

◆ BKE_object_to_mesh()

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

◆ BKE_object_to_mesh_clear()

void BKE_object_to_mesh_clear ( Object object)

◆ BKE_object_transform_copy()

void BKE_object_transform_copy ( Object ob_tar,
const Object ob_src 
)

◆ BKE_object_update_select_id()

void BKE_object_update_select_id ( struct Main bmain)

◆ BKE_object_visibility()

int BKE_object_visibility ( const Object ob,
const int  dag_eval_mode 
)

◆ BKE_object_where_is_calc()

void BKE_object_where_is_calc ( Depsgraph depsgraph,
Scene scene,
Object ob 
)

◆ 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 ( 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 3636 of file object.c.

References BKE_object_to_mat4(), NULL, 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()

void BKE_object_where_is_calc_time ( Depsgraph depsgraph,
Scene scene,
Object ob,
float  ctime 
)

◆ BKE_object_workob_calc_parent()

void BKE_object_workob_calc_parent ( Depsgraph depsgraph,
Scene scene,
Object ob,
Object workob 
)

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);

Definition at line 3667 of file object.c.

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

Referenced by applyarmature_fix_boneparents(), ED_object_parent_set(), ignore_parent_tx(), SkinInfo::link_armature(), and vertex_parent_set_exec().

◆ BKE_object_workob_clear()

void BKE_object_workob_clear ( Object workob)

◆ BKE_scene_foreach_display_point()

void BKE_scene_foreach_display_point ( Depsgraph depsgraph,
void(*)(const float[3], void *)  func_cb,
void *  user_data 
)

◆ constructive_modifier_is_deform_modified()

static bool constructive_modifier_is_deform_modified ( Object ob,
ModifierData md 
)
static

◆ copy_ccg_data()

static void copy_ccg_data ( Mesh mesh_destination,
Mesh mesh_source,
int  layer_type 
)
static

Copy CCG related data. Used to sync copy of mesh with reshaped original mesh.

Definition at line 1596 of file object.c.

References BLI_assert, CD_CALLOC, CustomData_add_layer(), CustomData_copy_layer_type_data(), CustomData_free_layer(), CustomData_get_layer_index(), CustomData_has_layer(), Mesh::ldata, NULL, and Mesh::totloop.

Referenced by object_update_from_subsurf_ccg().

◆ 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 604 of file object.c.

References BLO_read_list(), and LISTBASE_FOREACH.

Referenced by object_blend_read_data().

◆ expand_constraint_channels()

static void expand_constraint_channels ( BlendExpander expander,
ListBase chanbase 
)
static

Definition at line 1008 of file object.c.

References BLO_expand, and LISTBASE_FOREACH.

Referenced by object_blend_read_expand().

◆ expand_object_expandModifiers()

static void expand_object_expandModifiers ( void *  userData,
Object UNUSEDob,
ID **  idpoin,
int   UNUSEDcb_flag 
)
static

Definition at line 1015 of file object.c.

References BLO_expand.

Referenced by object_blend_read_expand().

◆ get_obdata_defname()

static const char* get_obdata_defname ( int  type)
static

◆ give_parvert()

static void give_parvert ( Object par,
int  nr,
float  vec[3] 
)
static

◆ insert_curvekey()

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

◆ insert_lattkey()

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

◆ insert_meshkey()

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

◆ lib_link_constraint_channels()

static void lib_link_constraint_channels ( BlendLibReader reader,
ID id,
ListBase chanbase 
)
static

Definition at line 831 of file object.c.

References BLO_read_id_address, id, ID::lib, and LISTBASE_FOREACH.

Referenced by object_blend_read_lib().

◆ lib_link_nlastrips()

static void lib_link_nlastrips ( BlendLibReader reader,
ID id,
ListBase striplist 
)
static

Definition at line 818 of file object.c.

References BLO_read_id_address, id, ID::lib, and LISTBASE_FOREACH.

Referenced by object_blend_read_lib().

◆ library_foreach_constraintObjectLooper()

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

Definition at line 399 of file object.c.

References BKE_lib_query_foreachid_process(), data, IDWALK_CB_NOP, IDWALK_CB_USER, and user_data.

Referenced by object_foreach_id().

◆ library_foreach_gpencil_modifiersForeachIDLink()

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

Definition at line 381 of file object.c.

References BKE_lib_query_foreachid_process(), data, and user_data.

Referenced by object_foreach_id().

◆ library_foreach_modifiersForeachIDLink()

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

Definition at line 372 of file object.c.

References BKE_lib_query_foreachid_process(), data, and user_data.

Referenced by object_foreach_id().

◆ library_foreach_particlesystemsObjectLooper()

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

Definition at line 409 of file object.c.

References BKE_lib_query_foreachid_process(), data, and user_data.

Referenced by object_foreach_id().

◆ library_foreach_shaderfxForeachIDLink()

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

Definition at line 390 of file object.c.

References BKE_lib_query_foreachid_process(), data, and user_data.

Referenced by object_foreach_id().

◆ modifiers_has_animation_check()

static bool modifiers_has_animation_check ( const Object ob)
static

◆ ob_parbone()

static void ob_parbone ( Object ob,
Object par,
float  r_mat[4][4] 
)
static

◆ ob_parcurve()

static bool ob_parcurve ( Object ob,
Object par,
float  r_mat[4][4] 
)
static

◆ ob_parvert3()

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

◆ object_add_common()

static Object* object_add_common ( Main bmain,
ViewLayer view_layer,
int  type,
const char *  name 
)
static

◆ object_blend_read_data()

static void object_blend_read_data ( BlendDataReader reader,
ID id 
)
static

Definition at line 613 of file object.c.

References Freestyle::a, Object::adt, animviz_motionpath_blend_read_data(), BKE_animdata_blend_read_data(), BKE_constraint_blend_read_data(), BKE_effector_add_weights(), BKE_gpencil_modifier_blend_read_data(), BKE_modifier_blend_read_data(), BKE_modifier_new(), BKE_modifier_unique_name(), BKE_object_empty_draw_type_set(), BKE_object_runtime_reset(), 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_data_address, BLO_read_data_is_undo(), BLO_read_int32_array(), BLO_read_list(), BLO_read_pointer_array(), SoftBody::bpoint, SoftBody::bspring, HookModifierData::cent, ObHook::cent, CLAMP, Object::constraints, copy_v3_v3(), WaveEff::damp, WaveModifierData::damp, Object::defbase, 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, Object::fmaps, HookModifierData::force, ObHook::force, Object::greasepencil_modifiers, WaveEff::height, WaveModifierData::height, Object::id, HookModifierData::indexar, ObHook::indexar, Object::iuser, PartEff::keys, SoftBody::keys, BuildEff::len, BuildModifierData::length, LIB_TAG_EXTERN, LIB_TAG_INDIRECT, WaveEff::lifetime, WaveModifierData::lifetime, Object::mat, Object::matbits, MEM_callocN, MEM_freeN, Object::mode, Object::modifiers, Object::mpath, WaveEff::narrow, WaveModifierData::narrow, PartEff::next, next, NULL, OB_EMPTY, OB_EMPTY_IMAGE, OB_MODE_ALL_MODE_DATA, 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, Object::proxy_from, SoftBody_Shared::ptcaches, BuildModifierData::randomize, Object::rigidbody_constraint, Object::rigidbody_object, ROT_MODE_MAX, ROT_MODE_MIN, Object::rotmode, SoftBody::scratch, Object::sculpt, BuildModifierData::seed, BuildEff::sfra, Object::shader_fx, SoftBody::shared, RigidBodyOb::shared, Object::soft, WaveEff::speed, WaveModifierData::speed, BuildModifierData::start, WaveEff::startx, WaveModifierData::startx, WaveModifierData::starty, ID::tag, WaveEff::timeoffs, WaveModifierData::timeoffs, HookModifierData::totindex, ObHook::totindex, SoftBody::totkey, PartEff::type, Object::type, WaveEff::width, and WaveModifierData::width.

◆ object_blend_read_expand()

static void object_blend_read_expand ( BlendExpander expander,
ID id 
)
static

◆ object_blend_read_lib()

static void object_blend_read_lib ( BlendLibReader reader,
ID id 
)
static

Definition at line 838 of file object.c.

References Freestyle::a, BKE_constraint_blend_read_lib(), BKE_gpencil_modifier_blend_read_lib(), BKE_modifier_blend_read_lib(), BKE_modifiers_findby_type(), BKE_object_material_len_p(), BKE_object_material_resize(), BKE_particle_partdeflect_blend_read_lib(), BKE_particle_system_blend_read_lib(), BKE_pose_blend_read_lib(), BKE_pose_free(), BKE_shaderfx_blend_read_lib(), BLO_read_get_new_id_address(), BLO_read_id_address, BLO_read_lib_get_main(), BLO_read_lib_reports(), BLO_reportf_wrap(), SoftBody::collision_group, Object::constraints, Object::data, FluidModifierData::domain, EFF_PARTICLE, FluidModifierData::effector, SoftBody::effector_weights, eModifierType_Fluid, eModifierType_Fluidsim, Library::filepath, FluidDomainSettings::flags, FluidFlowSettings::flags, FluidEffectorSettings::flags, FluidModifierData::flow, FLUID_DOMAIN_FILE_LOAD, FLUID_EFFECTOR_NEEDS_UPDATE, FLUID_FLOW_NEEDS_UPDATE, FluidsimModifierData::fss, EffectorWeights::group, Collection::id, Object::id, Object::instance_collection, FluidsimSettings::ipo, ID::lib, lib_link_constraint_channels(), lib_link_nlastrips(), LISTBASE_FOREACH, Object::mat, MEM_freeN, MOD_FLUID_TYPE_DOMAIN, MOD_FLUID_TYPE_EFFEC, MOD_FLUID_TYPE_FLOW, Object::mode, ID::name, NULL, RigidBodyCon::ob1, RigidBodyCon::ob2, OB_DUPLICOLLECTION, OB_EMPTY, OB_MODE_POSE, Object::parent, Object::particlesystem, Object::pd, Object::pose, Object::poselib, Object::proxy, Object::proxy_from, Object::proxy_group, Object::rigidbody_constraint, RPT_WARNING, Object::soft, TIP_, Object::totcol, Object::track, Object::transflag, FluidModifierData::type, and Object::type.

◆ object_blend_write()

static void object_blend_write ( BlendWriter writer,
ID id,
const void *  id_address 
)
static

◆ object_cacheIgnoreClear()

static void object_cacheIgnoreClear ( Object ob,
int  state 
)
static

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

Definition at line 5522 of file object.c.

References BKE_ptcache_ids_from_object(), BLI_freelistN(), PTCacheID::cache, ListBase::first, PointCache::flag, PTCacheID::next, NULL, PTCACHE_IGNORE_CLEAR, and state.

Referenced by BKE_object_modifier_update_subframe().

◆ object_copy_data()

static void object_copy_data ( Main bmain,
ID id_dst,
const ID id_src,
const int  flag 
)
static

◆ object_copy_modifier_particle_system_ensure()

static ParticleSystem* object_copy_modifier_particle_system_ensure ( Main bmain,
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 1371 of file object.c.

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

Referenced by BKE_object_copy_modifier().

◆ object_deforms_in_time()

static bool object_deforms_in_time ( Object object)
static

◆ object_foreach_id()

static void object_foreach_id ( ID id,
LibraryForeachIDData data 
)
static

◆ object_free_data()

static void object_free_data ( ID id)
static

◆ object_handle_update_proxy()

static void object_handle_update_proxy ( Depsgraph depsgraph,
Scene scene,
Object object,
const bool  do_proxy_update 
)
static

◆ object_init()

static void object_init ( Object ob,
const short  ob_type 
)
static

◆ object_init_data()

static void object_init_data ( ID id)
static

◆ object_lib_override_apply_post()

static void object_lib_override_apply_post ( ID id_dst,
ID UNUSEDid_src 
)
static

◆ object_make_local()

static void object_make_local ( Main bmain,
ID id,
const int  flags 
)
static

◆ 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()

static void object_update_from_subsurf_ccg ( Object object)
static

◆ object_where_is_calc_ex()

static void object_where_is_calc_ex ( Depsgraph depsgraph,
Scene scene,
Object ob,
float  ctime,
RigidBodyWorld rbw,
float  r_originmat[3][3] 
)
static

◆ obrel_armature_find()

static Object* obrel_armature_find ( Object ob)
static

Find an associated armature object.

Definition at line 5130 of file object.c.

References eModifierType_Armature, ListBase::first, mod(), Object::modifiers, NULL, OB_ARMATURE, Object::parent, PARSKEL, Object::partype, and Object::type.

Referenced by BKE_object_relational_superset().

◆ obrel_list_add()

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

Definition at line 5154 of file object.c.

References BLI_linklist_prepend(), Object::id, LIB_TAG_DOIT, and ID::tag.

Referenced by BKE_object_relational_superset().

◆ obrel_list_test()

static bool obrel_list_test ( Object ob)
static

Definition at line 5149 of file object.c.

References Object::id, LIB_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 4541 of file object.c.

References Freestyle::a, LinkData::data, and POINTER_AS_INT.

Referenced by BKE_object_insert_ptcache().

◆ pc_findindex()

static int pc_findindex ( ListBase listbase,
int  index 
)
static

Definition at line 4577 of file object.c.

References LinkData::data, ListBase::first, LinkData::next, NULL, and POINTER_AS_INT.

Referenced by BKE_object_delete_ptcache().

◆ solve_parenting()

static void solve_parenting ( 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 3549 of file object.c.

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

Referenced by BKE_object_where_is_calc_mat4(), and object_where_is_calc_ex().

◆ write_defgroups()

static void write_defgroups ( BlendWriter writer,
ListBase defbase 
)
static

Definition at line 513 of file object.c.

References BLO_write_struct, and LISTBASE_FOREACH.

Referenced by object_blend_write().

◆ write_fmaps()

static void write_fmaps ( BlendWriter writer,
ListBase fbase 
)
static

Definition at line 520 of file object.c.

References BLO_write_struct, and LISTBASE_FOREACH.

Referenced by object_blend_write().

Variable Documentation

◆ IDType_ID_OB

IDTypeInfo IDType_ID_OB
Initial value:
= {
.id_code = ID_OB,
.id_filter = FILTER_ID_OB,
.main_listbase_index = INDEX_ID_OB,
.struct_size = sizeof(Object),
.name = "Object",
.name_plural = "objects",
.translation_context = BLT_I18NCONTEXT_ID_OBJECT,
.flags = 0,
.copy_data = object_copy_data,
.free_data = object_free_data,
.make_local = object_make_local,
.foreach_id = object_foreach_id,
.foreach_cache = NULL,
.owner_get = NULL,
.blend_write = object_blend_write,
.blend_read_data = object_blend_read_data,
.blend_read_lib = object_blend_read_lib,
.blend_read_expand = object_blend_read_expand,
.blend_read_undo_preserve = NULL,
.lib_override_apply_post = object_lib_override_apply_post,
}
#define BLT_I18NCONTEXT_ID_OBJECT
#define FILTER_ID_OB
Definition: DNA_ID.h:722
@ INDEX_ID_OB
Definition: DNA_ID.h:840
@ ID_OB
Definition: DNA_ID_enums.h:59
struct Object Object
static void init_data(ModifierData *md)
static void object_blend_read_lib(BlendLibReader *reader, ID *id)
Definition: object.c:838
static void object_blend_write(BlendWriter *writer, ID *id, const void *id_address)
Definition: object.c:527
static void object_blend_read_expand(BlendExpander *expander, ID *id)
Definition: object.c:1038
static void object_copy_data(Main *bmain, ID *id_dst, const ID *id_src, const int flag)
Definition: object.c:190
static void object_make_local(Main *bmain, ID *id, const int flags)
Definition: object.c:324
static void object_blend_read_data(BlendDataReader *reader, ID *id)
Definition: object.c:613
static void object_init_data(ID *id)
Definition: object.c:174
static void object_lib_override_apply_post(ID *id_dst, ID *UNUSED(id_src))
Definition: object.c:1121
static void object_foreach_id(ID *id, LibraryForeachIDData *data)
Definition: object.c:418
static void object_free_data(ID *id)
Definition: object.c:273

Definition at line 1135 of file object.c.

Referenced by blender::bke::tests::test_lattice_deform_free(), and blender::bke::tests::test_lattice_deform_init().

◆ LOG

CLG_LogRef LOG = {"bke.object"}
static

◆ vparent_lock

ThreadMutex vparent_lock = BLI_MUTEX_INITIALIZER
static

Definition at line 169 of file object.c.

Referenced by give_parvert().