Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/object.c
| Show First 20 Lines • Show All 2,556 Lines • ▼ Show 20 Lines | static void object_where_is_calc_ex(Depsgraph *depsgraph, | ||||
| else { | 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. */ | ||||
| BKE_animsys_evaluate_animdata(depsgraph, scene, &ob->id, ob->adt, ctime, ADT_RECALC_ALL); | const bool flush_to_original = DEG_is_active(depsgraph); | ||||
| BKE_animsys_evaluate_animdata(scene, &ob->id, ob->adt, ctime, 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,756 Lines • ▼ Show 20 Lines | |||||
| bool BKE_object_modifier_update_subframe(Depsgraph *depsgraph, | bool BKE_object_modifier_update_subframe(Depsgraph *depsgraph, | ||||
| Scene *scene, | Scene *scene, | ||||
| Object *ob, | Object *ob, | ||||
| bool update_mesh, | bool update_mesh, | ||||
| int parent_recursion, | int parent_recursion, | ||||
| float frame, | float frame, | ||||
| int type) | int type) | ||||
| { | { | ||||
| const bool flush_to_original = DEG_is_active(depsgraph); | |||||
| ModifierData *md = modifiers_findByType(ob, (ModifierType)type); | ModifierData *md = modifiers_findByType(ob, (ModifierType)type); | ||||
| bConstraint *con; | bConstraint *con; | ||||
| if (type == eModifierType_DynamicPaint) { | if (type == eModifierType_DynamicPaint) { | ||||
| DynamicPaintModifierData *pmd = (DynamicPaintModifierData *)md; | DynamicPaintModifierData *pmd = (DynamicPaintModifierData *)md; | ||||
| /* if other is dynamic paint canvas, don't update */ | /* if other is dynamic paint canvas, don't update */ | ||||
| if (pmd && pmd->canvas) { | if (pmd && pmd->canvas) { | ||||
| ▲ Show 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | for (con = ob->constraints.first; con; con = con->next) { | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /* 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? */ | ||||
| ob->id.recalc |= ID_RECALC_ALL; | ob->id.recalc |= ID_RECALC_ALL; | ||||
| if (update_mesh) { | if (update_mesh) { | ||||
| BKE_animsys_evaluate_animdata(depsgraph, scene, &ob->id, ob->adt, frame, ADT_RECALC_ANIM); | BKE_animsys_evaluate_animdata( | ||||
| scene, &ob->id, ob->adt, frame, 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(depsgraph, scene, &cu->id, cu->adt, frame, ADT_RECALC_ANIM); | BKE_animsys_evaluate_animdata( | ||||
| scene, &cu->id, cu->adt, frame, 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(depsgraph, scene, &arm->id, arm->adt, frame, ADT_RECALC_ANIM); | BKE_animsys_evaluate_animdata( | ||||
| scene, &arm->id, arm->adt, frame, 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 | |||||