diff options
author | Falk David <falkdavid@gmx.de> | 2022-03-07 19:47:43 +0300 |
---|---|---|
committer | Falk David <falkdavid@gmx.de> | 2022-03-07 19:48:36 +0300 |
commit | 21d633f83b3ab09342ad32c4c3d896d3a8308404 (patch) | |
tree | 50da9e8eee0b76ad7df4b2769d03f397f33ca4b3 | |
parent | 15186f4259a2e0611a64a3aed8db8858e8ca081f (diff) |
GPencil: Temporary fix to avoid crashes on startup
This quick fix will populate the runtime orig pointers to avoid
crashes when a grease pencil object uses layer transforms, parenting
or modifiers.
This will have to be revisited and fixed with a better solution.
-rw-r--r-- | source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc index 6346bab1fe8..b1635ce6e09 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc +++ b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc @@ -41,6 +41,7 @@ #include "DNA_ID.h" #include "DNA_anim_types.h" #include "DNA_armature_types.h" +#include "DNA_gpencil_types.h" #include "DNA_mesh_types.h" #include "DNA_modifier_types.h" #include "DNA_object_types.h" @@ -733,6 +734,16 @@ void update_id_after_copy(const Depsgraph *depsgraph, scene_setup_view_layers_after_remap(depsgraph, id_node, reinterpret_cast<Scene *>(id_cow)); break; } + /* FIXME: This is a temporary fix to update the runtime pointers properly, see T96216. Should + * be removed at some point. */ + case ID_GD: { + bGPdata *gpd_cow = (bGPdata *)id_cow; + bGPDlayer *gpl = (bGPDlayer *)(gpd_cow->layers.first); + if (gpl != NULL && gpl->runtime.gpl_orig == NULL) { + BKE_gpencil_data_update_orig_pointers((bGPdata *)id_orig, gpd_cow); + } + break; + } default: break; } |