Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/library.c
| Show First 20 Lines • Show All 106 Lines • ▼ Show 20 Lines | |||||
| #include "BKE_mask.h" | #include "BKE_mask.h" | ||||
| #include "BKE_movieclip.h" | #include "BKE_movieclip.h" | ||||
| #include "BKE_node.h" | #include "BKE_node.h" | ||||
| #include "BKE_object.h" | #include "BKE_object.h" | ||||
| #include "BKE_paint.h" | #include "BKE_paint.h" | ||||
| #include "BKE_particle.h" | #include "BKE_particle.h" | ||||
| #include "BKE_packedFile.h" | #include "BKE_packedFile.h" | ||||
| #include "BKE_lightprobe.h" | #include "BKE_lightprobe.h" | ||||
| #include "BKE_rigidbody.h" | |||||
| #include "BKE_sound.h" | #include "BKE_sound.h" | ||||
| #include "BKE_speaker.h" | #include "BKE_speaker.h" | ||||
| #include "BKE_scene.h" | #include "BKE_scene.h" | ||||
| #include "BKE_text.h" | #include "BKE_text.h" | ||||
| #include "BKE_texture.h" | #include "BKE_texture.h" | ||||
| #include "BKE_world.h" | #include "BKE_world.h" | ||||
| #include "DEG_depsgraph.h" | #include "DEG_depsgraph.h" | ||||
| ▲ Show 20 Lines • Show All 1,840 Lines • ▼ Show 20 Lines | |||||
| #endif | #endif | ||||
| /* This is probably more of a hack than something we should do here, but... | /* This is probably more of a hack than something we should do here, but... | ||||
| * Issue is, the whole copying + remapping done in complex cases above may leave pose channels of armatures | * Issue is, the whole copying + remapping done in complex cases above may leave pose channels of armatures | ||||
| * in complete invalid state (more precisely, the bone pointers of the pchans - very crappy cross-datablocks | * in complete invalid state (more precisely, the bone pointers of the pchans - very crappy cross-datablocks | ||||
| * relationship), se we tag it to be fully recomputed, but this does not seems to be enough in some cases, | * relationship), se we tag it to be fully recomputed, but this does not seems to be enough in some cases, | ||||
| * and evaluation code ends up trying to evaluate a not-yet-updated armature object's deformations. | * and evaluation code ends up trying to evaluate a not-yet-updated armature object's deformations. | ||||
| * Try "make all local" in 04_01_H.lighting.blend from Agent327 without this, e.g. */ | * Try "make all local" in 04_01_H.lighting.blend from Agent327 without this, e.g. */ | ||||
| /* Also, use this object loop to we handle rigid body resetting. */ | |||||
| for (Object *ob = bmain->object.first; ob; ob = ob->id.next) { | for (Object *ob = bmain->object.first; ob; ob = ob->id.next) { | ||||
| if (ob->data != NULL && ob->type == OB_ARMATURE && ob->pose != NULL && ob->pose->flag & POSE_RECALC) { | if (ob->data != NULL && ob->type == OB_ARMATURE && ob->pose != NULL && ob->pose->flag & POSE_RECALC) { | ||||
| BKE_pose_rebuild(bmain, ob, ob->data, true); | BKE_pose_rebuild(bmain, ob, ob->data, true); | ||||
| } | } | ||||
| /* If there was ever any rigidbody settings in the object, we reset it. */ | |||||
dfelinto: ```
- BKE_rigidbody_remove_object(bmain, scene_rigidbody, ob);
+ BKE_rigidbody_remove_object… | |||||
Not Done Inline ActionsThis whole assumption in the rigid body code that there is only one scene with rigid bodies is quite weak. That's not easy to fix though. Maybe for now BKE_rigidbody_remove_object could just not have a scene parameter and loop over all scenes. brecht: This whole assumption in the rigid body code that there is only one scene with rigid bodies is… | |||||
| if (ob->rigidbody_object) { | |||||
| for (Scene *scene_iter = bmain->scene.first; scene_iter; scene_iter = scene_iter->id.next) { | |||||
| if (scene_iter->rigidbody_world) { | |||||
| BKE_rigidbody_remove_object(bmain, scene_iter, ob); | |||||
| } | |||||
| } | |||||
| BKE_rigidbody_free_object(ob, NULL); | |||||
| } | |||||
| } | } | ||||
| #ifdef DEBUG_TIME | #ifdef DEBUG_TIME | ||||
| printf("Hack: Forcefully rebuild armature object poses: Done.\n"); | printf("Hack: Forcefully rebuild armature object poses: Done.\n"); | ||||
| TIMEIT_VALUE_PRINT(make_local); | TIMEIT_VALUE_PRINT(make_local); | ||||
| #endif | #endif | ||||
| BKE_main_id_clear_newpoins(bmain); | BKE_main_id_clear_newpoins(bmain); | ||||
| ▲ Show 20 Lines • Show All 237 Lines • Show Last 20 Lines | |||||
... or similar.