Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenloader/intern/versioning_290.c
| Show All 22 Lines | |||||
| #include "BLI_listbase.h" | #include "BLI_listbase.h" | ||||
| #include "BLI_math.h" | #include "BLI_math.h" | ||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| #include "DNA_brush_types.h" | #include "DNA_brush_types.h" | ||||
| #include "DNA_constraint_types.h" | #include "DNA_constraint_types.h" | ||||
| #include "DNA_genfile.h" | #include "DNA_genfile.h" | ||||
| #include "DNA_gpencil_modifier_types.h" | #include "DNA_gpencil_modifier_types.h" | ||||
| #include "DNA_gpencil_types.h" | |||||
| #include "DNA_modifier_types.h" | #include "DNA_modifier_types.h" | ||||
| #include "DNA_object_types.h" | #include "DNA_object_types.h" | ||||
| #include "DNA_screen_types.h" | #include "DNA_screen_types.h" | ||||
| #include "DNA_shader_fx_types.h" | #include "DNA_shader_fx_types.h" | ||||
| #include "BKE_collection.h" | #include "BKE_collection.h" | ||||
| #include "BKE_colortools.h" | #include "BKE_colortools.h" | ||||
| #include "BKE_gpencil.h" | |||||
| #include "BKE_lib_id.h" | #include "BKE_lib_id.h" | ||||
| #include "BKE_main.h" | #include "BKE_main.h" | ||||
| #include "BKE_node.h" | #include "BKE_node.h" | ||||
| #include "BLO_readfile.h" | #include "BLO_readfile.h" | ||||
| #include "readfile.h" | #include "readfile.h" | ||||
| /* Make preferences read-only, use versioning_userdef.c. */ | /* Make preferences read-only, use versioning_userdef.c. */ | ||||
| ▲ Show 20 Lines • Show All 132 Lines • ▼ Show 20 Lines | LISTBASE_FOREACH (Object *, ob, &bmain->objects) { | ||||
| } | } | ||||
| break; | break; | ||||
| } | } | ||||
| default: | default: | ||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /* Patch first frame for old files. */ | |||||
| Scene *scene = bmain->scenes.first; | |||||
| LISTBASE_FOREACH (Object *, ob, &bmain->objects) { | |||||
| if (ob->type != OB_GPENCIL) { | |||||
| continue; | |||||
| } | |||||
| bGPdata *gpd = ob->data; | |||||
| LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) { | |||||
| bGPDframe *gpf = gpl->frames.first; | |||||
| if (gpf && gpf->framenum > scene->r.sfra) { | |||||
| bGPDframe *gpf_dup = BKE_gpencil_frame_duplicate(gpf); | |||||
dfelinto: Nit picking, I would either move both ifs to the same line, or do a short exit for the first… | |||||
| gpf_dup->framenum = scene->r.sfra; | |||||
| BLI_addhead(&gpl->frames, gpf_dup); | |||||
| } | |||||
| } | |||||
| } | |||||
| } | } | ||||
| /** | /** | ||||
| * Versioning code until next subversion bump goes here. | * Versioning code until next subversion bump goes here. | ||||
| * | * | ||||
| * \note Be sure to check when bumping the version: | * \note Be sure to check when bumping the version: | ||||
| * - #blo_do_versions_290 in this file. | * - #blo_do_versions_290 in this file. | ||||
| * - "versioning_userdef.c", #BLO_version_defaults_userpref_blend | * - "versioning_userdef.c", #BLO_version_defaults_userpref_blend | ||||
| ▲ Show 20 Lines • Show All 238 Lines • Show Last 20 Lines | |||||
Nit picking, I would either move both ifs to the same line, or do a short exit for the first one. In other words:
A) if (gpf && gpf->framenum > scene->r.sfra) {
B)
if (gpf != NULL) { continue; }