Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/object.c
| Show First 20 Lines • Show All 1,112 Lines • ▼ Show 20 Lines | static void object_blend_read_expand(BlendExpander *expander, ID *id) | ||||
| } | } | ||||
| if (ob->rigidbody_constraint) { | if (ob->rigidbody_constraint) { | ||||
| BLO_expand(expander, ob->rigidbody_constraint->ob1); | BLO_expand(expander, ob->rigidbody_constraint->ob1); | ||||
| BLO_expand(expander, ob->rigidbody_constraint->ob2); | BLO_expand(expander, ob->rigidbody_constraint->ob2); | ||||
| } | } | ||||
| } | } | ||||
| static void object_lib_override_apply_post(ID *id_dst, ID *UNUSED(id_src)) | |||||
| { | |||||
| Object *object = (Object *)id_dst; | |||||
| ListBase pidlist; | |||||
| BKE_ptcache_ids_from_object(&pidlist, object, NULL, 0); | |||||
| LISTBASE_FOREACH (PTCacheID *, pid, &pidlist) { | |||||
| LISTBASE_FOREACH (PointCache *, point_cache, pid->ptcaches) { | |||||
| point_cache->flag |= PTCACHE_FLAG_INFO_DIRTY; | |||||
| } | |||||
| } | |||||
| BLI_freelistN(&pidlist); | |||||
| } | |||||
| IDTypeInfo IDType_ID_OB = { | IDTypeInfo IDType_ID_OB = { | ||||
| .id_code = ID_OB, | .id_code = ID_OB, | ||||
| .id_filter = FILTER_ID_OB, | .id_filter = FILTER_ID_OB, | ||||
| .main_listbase_index = INDEX_ID_OB, | .main_listbase_index = INDEX_ID_OB, | ||||
| .struct_size = sizeof(Object), | .struct_size = sizeof(Object), | ||||
| .name = "Object", | .name = "Object", | ||||
| .name_plural = "objects", | .name_plural = "objects", | ||||
| .translation_context = BLT_I18NCONTEXT_ID_OBJECT, | .translation_context = BLT_I18NCONTEXT_ID_OBJECT, | ||||
| .flags = 0, | .flags = 0, | ||||
| .init_data = object_init_data, | .init_data = object_init_data, | ||||
| .copy_data = object_copy_data, | .copy_data = object_copy_data, | ||||
| .free_data = object_free_data, | .free_data = object_free_data, | ||||
| .make_local = object_make_local, | .make_local = object_make_local, | ||||
| .foreach_id = object_foreach_id, | .foreach_id = object_foreach_id, | ||||
| .foreach_cache = NULL, | .foreach_cache = NULL, | ||||
| .blend_write = object_blend_write, | .blend_write = object_blend_write, | ||||
| .blend_read_data = object_blend_read_data, | .blend_read_data = object_blend_read_data, | ||||
| .blend_read_lib = object_blend_read_lib, | .blend_read_lib = object_blend_read_lib, | ||||
| .blend_read_expand = object_blend_read_expand, | .blend_read_expand = object_blend_read_expand, | ||||
| .blend_read_undo_preserve = NULL, | .blend_read_undo_preserve = NULL, | ||||
| .lib_override_apply_post = object_lib_override_apply_post, | |||||
| }; | }; | ||||
| void BKE_object_workob_clear(Object *workob) | void BKE_object_workob_clear(Object *workob) | ||||
| { | { | ||||
| memset(workob, 0, sizeof(Object)); | memset(workob, 0, sizeof(Object)); | ||||
| workob->scale[0] = workob->scale[1] = workob->scale[2] = 1.0f; | workob->scale[0] = workob->scale[1] = workob->scale[2] = 1.0f; | ||||
| workob->dscale[0] = workob->dscale[1] = workob->dscale[2] = 1.0f; | workob->dscale[0] = workob->dscale[1] = workob->dscale[2] = 1.0f; | ||||
| ▲ Show 20 Lines • Show All 349 Lines • ▼ Show 20 Lines | bool BKE_object_copy_gpencil_modifier(struct Object *ob_dst, GpencilModifierData *gmd_src) | ||||
| BKE_gpencil_modifier_unique_name(&ob_dst->greasepencil_modifiers, gmd_dst); | BKE_gpencil_modifier_unique_name(&ob_dst->greasepencil_modifiers, gmd_dst); | ||||
| return true; | return true; | ||||
| } | } | ||||
| /** | /** | ||||
| * Copy the whole stack of modifiers from one object into another. | * Copy the whole stack of modifiers from one object into another. | ||||
| * | * | ||||
| * \warning **Does not** clear modifier stack and related data (particle systems, softbody, | * \warning **Does not** clear modifier stack and related data (particle systems, soft-body, | ||||
| * etc.) in `ob_dst`, if needed calling code must do it. | * etc.) in `ob_dst`, if needed calling code must do it. | ||||
| * | * | ||||
| * @param do_copy_all If true, even modifiers that should not suport copying (like Hook one) will | * \param do_copy_all: If true, even modifiers that should not support copying (like Hook one) | ||||
| * be duplicated. | * will be duplicated. | ||||
| */ | */ | ||||
| bool BKE_object_modifier_stack_copy(Object *ob_dst, | bool BKE_object_modifier_stack_copy(Object *ob_dst, | ||||
| const Object *ob_src, | const Object *ob_src, | ||||
| const bool do_copy_all, | const bool do_copy_all, | ||||
| const int flag_subdata) | const int flag_subdata) | ||||
| { | { | ||||
| if ((ob_dst->type == OB_GPENCIL) != (ob_src->type == OB_GPENCIL)) { | if ((ob_dst->type == OB_GPENCIL) != (ob_src->type == OB_GPENCIL)) { | ||||
| BLI_assert(!"Trying to copy a modifier stack between a GPencil object and another type."); | BLI_assert(!"Trying to copy a modifier stack between a GPencil object and another type."); | ||||
| ▲ Show 20 Lines • Show All 2,000 Lines • ▼ Show 20 Lines | if ((ob->partype & PARTYPE) == PARSKEL) { | ||||
| copy_v3_v3(ob->runtime.parent_display_origin, par->obmat[3]); | copy_v3_v3(ob->runtime.parent_display_origin, par->obmat[3]); | ||||
| } | } | ||||
| else { | else { | ||||
| copy_v3_v3(ob->runtime.parent_display_origin, totmat[3]); | copy_v3_v3(ob->runtime.parent_display_origin, totmat[3]); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /** | |||||
| * \note scene is the active scene while actual_scene is the scene the object resides in. | |||||
| */ | |||||
| static void object_where_is_calc_ex(Depsgraph *depsgraph, | static void object_where_is_calc_ex(Depsgraph *depsgraph, | ||||
| Scene *scene, | Scene *scene, | ||||
| Object *ob, | Object *ob, | ||||
| float ctime, | float ctime, | ||||
| RigidBodyWorld *rbw, | RigidBodyWorld *rbw, | ||||
| float r_originmat[3][3]) | float r_originmat[3][3]) | ||||
| { | { | ||||
| if (ob->parent) { | if (ob->parent) { | ||||
| ▲ Show 20 Lines • Show All 2,081 Lines • Show Last 20 Lines | |||||