Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/object.c
| Show First 20 Lines • Show All 2,740 Lines • ▼ Show 20 Lines | else { | ||||
| ob->transflag &= ~OB_NEG_SCALE; | ob->transflag &= ~OB_NEG_SCALE; | ||||
| } | } | ||||
| } | } | ||||
| void BKE_object_where_is_calc_time(Depsgraph *depsgraph, Scene *scene, Object *ob, float ctime) | void BKE_object_where_is_calc_time(Depsgraph *depsgraph, Scene *scene, Object *ob, float ctime) | ||||
| { | { | ||||
| /* Execute drivers and animation. */ | /* Execute drivers and animation. */ | ||||
| const bool flush_to_original = DEG_is_active(depsgraph); | const bool flush_to_original = DEG_is_active(depsgraph); | ||||
| BKE_animsys_evaluate_animdata(&ob->id, ob->adt, ctime, ADT_RECALC_ALL, flush_to_original); | const AnimationEvalContext anim_eval_context = BKE_animsys_eval_context(depsgraph, ctime); | ||||
| BKE_animsys_evaluate_animdata( | |||||
| &ob->id, ob->adt, &anim_eval_context, ADT_RECALC_ALL, flush_to_original); | |||||
| object_where_is_calc_ex(depsgraph, scene, ob, ctime, NULL, NULL); | object_where_is_calc_ex(depsgraph, scene, ob, ctime, NULL, NULL); | ||||
| } | } | ||||
| /* get object transformation matrix without recalculating dependencies and | /* get object transformation matrix without recalculating dependencies and | ||||
| * constraints -- assume dependencies are already solved by depsgraph. | * constraints -- assume dependencies are already solved by depsgraph. | ||||
| * no changes to object and it's parent would be done. | * no changes to object and it's parent would be done. | ||||
| * used for bundles orientation in 3d space relative to parented blender camera */ | * used for bundles orientation in 3d space relative to parented blender camera */ | ||||
| void BKE_object_where_is_calc_mat4(Object *ob, float obmat[4][4]) | void BKE_object_where_is_calc_mat4(Object *ob, float obmat[4][4]) | ||||
| ▲ Show 20 Lines • Show All 1,880 Lines • ▼ Show 20 Lines | for (con = ob->constraints.first; con; con = con->next) { | ||||
| cti->flush_constraint_targets(con, &targets, 0); | cti->flush_constraint_targets(con, &targets, 0); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /* was originally ID_RECALC_ALL - TODO - which flags are really needed??? */ | /* was originally ID_RECALC_ALL - TODO - which flags are really needed??? */ | ||||
| /* TODO(sergey): What about animation? */ | /* TODO(sergey): What about animation? */ | ||||
| const AnimationEvalContext anim_eval_context = BKE_animsys_eval_context(depsgraph, frame); | |||||
| ob->id.recalc |= ID_RECALC_ALL; | ob->id.recalc |= ID_RECALC_ALL; | ||||
| if (update_mesh) { | if (update_mesh) { | ||||
| BKE_animsys_evaluate_animdata(&ob->id, ob->adt, frame, ADT_RECALC_ANIM, flush_to_original); | BKE_animsys_evaluate_animdata( | ||||
| &ob->id, ob->adt, &anim_eval_context, ADT_RECALC_ANIM, flush_to_original); | |||||
| /* ignore cache clear during subframe updates | /* ignore cache clear during subframe updates | ||||
| * to not mess up cache validity */ | * to not mess up cache validity */ | ||||
| object_cacheIgnoreClear(ob, 1); | object_cacheIgnoreClear(ob, 1); | ||||
| BKE_object_handle_update(depsgraph, scene, ob); | BKE_object_handle_update(depsgraph, scene, ob); | ||||
| object_cacheIgnoreClear(ob, 0); | object_cacheIgnoreClear(ob, 0); | ||||
| } | } | ||||
| else { | else { | ||||
| BKE_object_where_is_calc_time(depsgraph, scene, ob, frame); | BKE_object_where_is_calc_time(depsgraph, scene, ob, frame); | ||||
| } | } | ||||
| /* for curve following objects, parented curve has to be updated too */ | /* for curve following objects, parented curve has to be updated too */ | ||||
| if (ob->type == OB_CURVE) { | if (ob->type == OB_CURVE) { | ||||
| Curve *cu = ob->data; | Curve *cu = ob->data; | ||||
| BKE_animsys_evaluate_animdata(&cu->id, cu->adt, frame, ADT_RECALC_ANIM, flush_to_original); | BKE_animsys_evaluate_animdata( | ||||
| &cu->id, cu->adt, &anim_eval_context, ADT_RECALC_ANIM, flush_to_original); | |||||
| } | } | ||||
| /* and armatures... */ | /* and armatures... */ | ||||
| if (ob->type == OB_ARMATURE) { | if (ob->type == OB_ARMATURE) { | ||||
| bArmature *arm = ob->data; | bArmature *arm = ob->data; | ||||
| BKE_animsys_evaluate_animdata(&arm->id, arm->adt, frame, ADT_RECALC_ANIM, flush_to_original); | BKE_animsys_evaluate_animdata( | ||||
| &arm->id, arm->adt, &anim_eval_context, ADT_RECALC_ANIM, flush_to_original); | |||||
| BKE_pose_where_is(depsgraph, scene, ob); | BKE_pose_where_is(depsgraph, scene, ob); | ||||
| } | } | ||||
| return false; | return false; | ||||
| } | } | ||||
| /* Updates select_id of all objects in the given bmain. */ | /* Updates select_id of all objects in the given bmain. */ | ||||
| void BKE_object_update_select_id(struct Main *bmain) | void BKE_object_update_select_id(struct Main *bmain) | ||||
| Show All 26 Lines | |||||