Fix (unreported) broken-by-design code in depsgraph's deg_backup_object_runtime()

Committing this since it does fix broken logic (previously in that
condition obdata would always be set to NULL, since
`BKE_object_runtime_reset()` is called before).

However, this has presumably been broken that way since 05/2018, so
maybe that whole condition is not needed anymore? Or NULL pointer was
working as well here?

@sergey eyes are required here I guess ;)
This commit is contained in:
Bastien Montagne
2019-02-18 18:21:44 +01:00
parent 16a290bb6f
commit ecdd1864d1

View File

@@ -821,7 +821,9 @@ static void deg_backup_object_runtime(
* Need to make sure we don't have data set to evaluated one before free
* anything. */
if (mesh_eval != NULL && object->data == mesh_eval) {
object->data = object->runtime.mesh_orig;
/* XXX Is this still useful? code was broken for some times (always setting object->data to NULL),
* and did not seem to cause any issue? */
object->data = object_runtime_backup->runtime.mesh_orig;
}
/* Make a backup of base flags. */
object_runtime_backup->base_flag = object->base_flag;