Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/object_update.c
| Show First 20 Lines • Show All 262 Lines • ▼ Show 20 Lines | while (psys) { | ||||
| psys_free(ob, psys); | psys_free(ob, psys); | ||||
| psys = tpsys; | psys = tpsys; | ||||
| } | } | ||||
| else { | else { | ||||
| psys = psys->next; | psys = psys->next; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| BKE_object_eval_boundbox(depsgraph, ob); | |||||
| } | } | ||||
| /** | /** Bounding box from evaluated geometry. */ | ||||
| * TODO(sergey): Ensure that bounding box is already calculated, and move this | static void object_sync_boundbox_to_original(Object *object_orig, Object *object_eval) | ||||
| * into #BKE_object_sync_to_original(). | |||||
| */ | |||||
| void BKE_object_eval_boundbox(Depsgraph *depsgraph, Object *object) | |||||
| { | { | ||||
| if (!DEG_is_active(depsgraph)) { | BoundBox *bb = BKE_object_boundbox_get(object_eval); | ||||
| return; | |||||
| } | |||||
| Object *ob_orig = DEG_get_original_object(object); | |||||
| BoundBox *bb = BKE_object_boundbox_get(object); | |||||
| if (bb != NULL) { | if (bb != NULL) { | ||||
| if (ob_orig->runtime.bb == NULL) { | if (object_orig->runtime.bb == NULL) { | ||||
| ob_orig->runtime.bb = MEM_mallocN(sizeof(*ob_orig->runtime.bb), __func__); | object_orig->runtime.bb = MEM_mallocN(sizeof(*object_orig->runtime.bb), __func__); | ||||
| } | } | ||||
| *ob_orig->runtime.bb = *bb; | *object_orig->runtime.bb = *bb; | ||||
| } | } | ||||
| } | } | ||||
| void BKE_object_sync_to_original(Depsgraph *depsgraph, Object *object) | void BKE_object_sync_to_original(Depsgraph *depsgraph, Object *object) | ||||
| { | { | ||||
| if (!DEG_is_active(depsgraph)) { | if (!DEG_is_active(depsgraph)) { | ||||
| return; | return; | ||||
| } | } | ||||
| Show All 12 Lines | for (ModifierData *md = object->modifiers.first, *md_orig = object_orig->modifiers.first; | ||||
| md != NULL && md_orig != NULL; | md != NULL && md_orig != NULL; | ||||
| md = md->next, md_orig = md_orig->next) { | md = md->next, md_orig = md_orig->next) { | ||||
| BLI_assert(md->type == md_orig->type && STREQ(md->name, md_orig->name)); | BLI_assert(md->type == md_orig->type && STREQ(md->name, md_orig->name)); | ||||
| MEM_SAFE_FREE(md_orig->error); | MEM_SAFE_FREE(md_orig->error); | ||||
| if (md->error != NULL) { | if (md->error != NULL) { | ||||
| md_orig->error = BLI_strdup(md->error); | md_orig->error = BLI_strdup(md->error); | ||||
| } | } | ||||
| } | } | ||||
| object_sync_boundbox_to_original(object_orig, object); | |||||
| } | } | ||||
| bool BKE_object_eval_proxy_copy(Depsgraph *depsgraph, Object *object) | bool BKE_object_eval_proxy_copy(Depsgraph *depsgraph, Object *object) | ||||
| { | { | ||||
| /* Handle proxy copy for target, */ | /* Handle proxy copy for target, */ | ||||
| if (ID_IS_LINKED(object) && object->proxy_from) { | if (ID_IS_LINKED(object) && object->proxy_from) { | ||||
| DEG_debug_print_eval(depsgraph, __func__, object->id.name, object); | DEG_debug_print_eval(depsgraph, __func__, object->id.name, object); | ||||
| if (object->proxy_from->proxy_group) { | if (object->proxy_from->proxy_group) { | ||||
| ▲ Show 20 Lines • Show All 173 Lines • Show Last 20 Lines | |||||