Fix #107420: crash getting PTCacheID when baking scene rigid body world #107536

Merged
Philipp Oeser merged 1 commits from lichtwerk/blender:107420_a into main 2023-05-02 17:56:23 +02:00
1 changed files with 2 additions and 1 deletions

View File

@ -188,7 +188,8 @@ static PTCacheBaker *ptcache_baker_create(bContext *C, wmOperator *op, bool all)
if (!all) {
PointerRNA ptr = CTX_data_pointer_get_type(C, "point_cache", &RNA_PointCache);
Object *ob = (Object *)ptr.owner_id;
ID *id = ptr.owner_id;
Object *ob = (GS(id->name) == ID_OB) ? (Object *)id : NULL;
PointCache *cache = ptr.data;
baker->pid = BKE_ptcache_id_find(ob, baker->scene, cache);
}