Changeset View
Changeset View
Standalone View
Standalone View
source/blender/modifiers/intern/MOD_meshsequencecache.c
| Show First 20 Lines • Show All 108 Lines • ▼ Show 20 Lines | if (!mcmd->reader || !STREQ(mcmd->reader_object_path, mcmd->object_path)) { | ||||
| STRNCPY(mcmd->reader_object_path, mcmd->object_path); | STRNCPY(mcmd->reader_object_path, mcmd->object_path); | ||||
| BKE_cachefile_reader_open(cache_file, &mcmd->reader, ctx->object, mcmd->object_path); | BKE_cachefile_reader_open(cache_file, &mcmd->reader, ctx->object, mcmd->object_path); | ||||
| if (!mcmd->reader) { | if (!mcmd->reader) { | ||||
| modifier_setError(md, "Could not create Alembic reader for file %s", cache_file->filepath); | modifier_setError(md, "Could not create Alembic reader for file %s", cache_file->filepath); | ||||
| return mesh; | return mesh; | ||||
| } | } | ||||
| } | } | ||||
| /* If this invocation is for the ORCO mesh, and the mesh in Alembic hasn't changed topology, we | |||||
| * must return the mesh as-is instead of deforming it. */ | |||||
| if (ctx->flag & MOD_APPLY_ORCO && | |||||
| !ABC_mesh_topology_changed(mcmd->reader, ctx->object, mesh, time, &err_str)) { | |||||
| return mesh; | |||||
| } | |||||
| if (me != NULL) { | if (me != NULL) { | ||||
| MVert *mvert = mesh->mvert; | MVert *mvert = mesh->mvert; | ||||
| MEdge *medge = mesh->medge; | MEdge *medge = mesh->medge; | ||||
| MPoly *mpoly = mesh->mpoly; | MPoly *mpoly = mesh->mpoly; | ||||
| /* TODO(sybren+bastien): possibly check relevant custom data layers (UV/color depending on | |||||
| * flags) and duplicate those too. */ | |||||
| if ((me->mvert == mvert) || (me->medge == medge) || (me->mpoly == mpoly)) { | if ((me->mvert == mvert) || (me->medge == medge) || (me->mpoly == mpoly)) { | ||||
| /* We need to duplicate data here, otherwise we'll modify org mesh, see T51701. */ | /* We need to duplicate data here, otherwise we'll modify org mesh, see T51701. */ | ||||
| BKE_id_copy_ex(NULL, | BKE_id_copy_ex(NULL, | ||||
| &mesh->id, | &mesh->id, | ||||
| (ID **)&mesh, | (ID **)&mesh, | ||||
| LIB_ID_CREATE_NO_MAIN | LIB_ID_CREATE_NO_USER_REFCOUNT | | LIB_ID_CREATE_NO_MAIN | LIB_ID_CREATE_NO_USER_REFCOUNT | | ||||
| LIB_ID_CREATE_NO_DEG_TAG | LIB_ID_COPY_NO_PREVIEW); | LIB_ID_CREATE_NO_DEG_TAG | LIB_ID_COPY_NO_PREVIEW); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 75 Lines • Show Last 20 Lines | |||||