818 const MPoly *polys =
static_cast<const MPoly *
>(
821 if (polys[i].totloop == 2) {
827 reinterpret_cast<float(*)[3]
>(me->vert_positions_for_write().data()),
829 me->edges_for_write().data(),
832 &me->fdata_legacy,
CD_MFACE, me->totface_legacy),
834 me->corner_verts().data(),
835 me->corner_edges_for_write().data(),
837 me->face_offsets().data(),
839 me->deform_verts_for_write().data(),
853 for (
int i = 0; i <
ARRAY_SIZE(id_codes); i++) {
859 if (!DNA_struct_member_exists(fd->
filesdna,
"SpaceImage",
"float",
"uv_opacity")) {
873 if (!DNA_struct_member_exists(fd->
filesdna,
"BrushGpencilSettings",
"float",
"random_hue")) {
875 if ((brush->gpencil_settings) && (brush->gpencil_settings->curve_rand_pressure ==
nullptr))
878 1, 0.0f, 0.0f, 1.0f, 1.0f);
880 1, 0.0f, 0.0f, 1.0f, 1.0f);
883 1, 0.0f, 0.0f, 1.0f, 1.0f);
885 1, 0.0f, 0.0f, 1.0f, 1.0f);
887 1, 0.0f, 0.0f, 1.0f, 1.0f);
905 if (!DNA_struct_member_exists(fd->
filesdna,
"NodeTexSky",
"float",
"sun_size")) {
911 tex->sun_disc =
true;
914 tex->sun_rotation = 0.0f;
915 tex->altitude = 0.0f;
916 tex->air_density = 1.0f;
917 tex->dust_density = 1.0f;
918 tex->ozone_density = 1.0f;
934 bool use_optix =
false;
935 bool use_denoising =
false;
939 use_denoising = use_denoising ||
941 use_optix = use_optix ||
948 use_denoising = use_denoising ||
950 use_optix = use_optix ||
976 if (!use_denoising) {
995 if (!DNA_struct_member_exists(fd->
filesdna,
"ModifierData",
"short",
"ui_expand_flag")) {
998 if (md->mode & eModifierMode_Expanded_DEPRECATED) {
1002 md->ui_expand_flag = 0;
1009 if (!DNA_struct_member_exists(fd->
filesdna,
"SceneEEVEE",
"float",
"motion_blur_depth_scale"))
1012 scene->eevee.motion_blur_depth_scale = 100.0f;
1013 scene->eevee.motion_blur_max = 32;
1017 if (!DNA_struct_member_exists(fd->
filesdna,
"SceneEEVEE",
"int",
"motion_blur_steps")) {
1019 scene->eevee.motion_blur_steps = 1;
1024 if (!DNA_struct_member_exists(fd->
filesdna,
"bConstraint",
"short",
"ui_expand_flag")) {
1027 if (con->flag & CONSTRAINT_EXPAND_DEPRECATED) {
1031 con->ui_expand_flag = 0;
1038 if (!DNA_struct_member_exists(fd->
filesdna,
"GpencilModifierData",
"short",
"ui_expand_flag"))
1042 if (md->mode & eGpencilModifierMode_Expanded_DEPRECATED) {
1046 md->ui_expand_flag = 0;
1053 if (!DNA_struct_member_exists(fd->
filesdna,
"ShaderFxData",
"short",
"ui_expand_flag")) {
1056 if (fx->mode & eShaderFxMode_Expanded_DEPRECATED) {
1060 fx->ui_expand_flag = 0;
1067 if (!DNA_struct_member_exists(fd->
filesdna,
"BevelModifierData",
"short",
"profile_type")) {
1072 bool use_custom_profile = bmd->
flags & MOD_BEVEL_CUSTOM_PROFILE_DEPRECATED;
1095 if (!DNA_struct_member_exists(fd->
filesdna,
"NodeTexSky",
"float",
"sun_intensity")) {
1101 tex->sun_intensity = 1.0f;
1102 tex->altitude *= 0.001f;
1111 if (!DNA_struct_member_exists(fd->
filesdna,
"BevelModifierData",
"char",
"affect_type")) {
1116 const bool use_vertex_bevel = bmd->
flags & MOD_BEVEL_VERT_DEPRECATED;
1125 if (!DNA_struct_member_exists(
1126 fd->
filesdna,
"MeshSeqCacheModifierData",
"float",
"velocity_scale"))
1138 if (!DNA_struct_member_exists(fd->
filesdna,
"CacheFile",
"char",
"velocity_unit")) {
1140 STRNCPY(cache_file->velocity_name,
".velocities");
1145 if (!DNA_struct_member_exists(fd->
filesdna,
"OceanModifierData",
"int",
"viewport_resolution"))
1173 if (rbw ==
nullptr) {
1221 mesh->vert_data.totlayer = mesh->vert_data.maxlayer =
MEM_allocN_len(
1222 mesh->vert_data.layers) /
1224 mesh->edge_data.totlayer = mesh->edge_data.maxlayer =
MEM_allocN_len(
1225 mesh->edge_data.layers) /
1228 mesh->corner_data.totlayer = mesh->corner_data.maxlayer =
MEM_allocN_len(
1229 mesh->corner_data.layers) /
1231 mesh->face_data.totlayer = mesh->face_data.maxlayer =
MEM_allocN_len(
1232 mesh->face_data.layers) /
1242 if (fcu->totvert < 2 || fcu->bezt ==
nullptr) {
1255 if (scene->master_collection) {
1261 if (!DNA_struct_member_exists(fd->
filesdna,
"Curve",
"char",
"bevel_mode")) {
1263 if (curve->bevobj !=
nullptr) {
1277 if (fmd->
domain !=
nullptr) {
1284 const float grid_lines[4] = {1.0, 0.0, 0.0, 1.0};
1294 if (!DNA_struct_member_exists(fd->
filesdna,
"View3DOverlay",
"float",
"fade_alpha")) {
1309 if (!DNA_struct_member_exists(fd->
filesdna,
"Mesh",
"char",
"symmetry")) {
1332 scene->r.simplify_volumes = 1.0f;
1337 if (!DNA_struct_member_exists(fd->
filesdna,
"WorkSpaceDataRelation",
"int",
"parentid")) {
1344 if (relation->parent !=
nullptr) {
1348 if (win !=
nullptr) {
1349 relation->parentid = win->
winid;
1353 if (relation->parentid == 0) {
1356 "Found a valid parent for workspace data relation, but no valid parent id.");
1359 if (relation->parentid == 0) {
1367 if (!DNA_struct_exists(fd->
filesdna,
"SpaceImageOverlay")) {
1394 switch (sl->spacetype) {
1405 if (!DNA_struct_member_exists(
1406 fd->
filesdna,
"FluidModifierData",
"float",
"fractions_distance"))
1423 const int LEGACY_REFINE_RADIAL_DISTORTION_K1 = (1 << 2);
1428 int new_refine_camera_intrinsics = 0;
1441 if (settings->refine_camera_intrinsics & LEGACY_REFINE_RADIAL_DISTORTION_K1) {
1452 if (!DNA_struct_member_exists(fd->
filesdna,
"View3DOverlay",
"float",
"wireframe_opacity")) {
1498 if (!DNA_struct_member_exists(fd->
filesdna,
"ViewLayer",
"short",
"cryptomatte_levels")) {
1501 view_layer->cryptomatte_levels = 6;
1528 view_layer->eevee.render_passes &= ~EEVEE_RENDER_PASS_UNUSED_8;
1532 if (scene->nodetree) {
1534 if (node->type == CMP_NODE_R_LAYERS) {
1536 const char *volume_scatter =
"VolumeScatterCol";
1547 if (!DNA_struct_exists(fd->
filesdna,
"CryptomatteEntry")) {
1549 if (scene->nodetree) {
1551 if (node->type == CMP_NODE_CRYPTOMATTE_LEGACY) {
1553 char *matte_id = storage->
matte_id;
1554 if (matte_id ==
nullptr || strlen(storage->
matte_id) == 0) {
1581 if (
STREQ(node->idname,
"GeometryNodeRandomAttribute")) {
1582 STRNCPY(node->idname,
"GeometryLegacyNodeAttributeRandomize");
1588 if (scene->toolsettings->sequencer_tool_settings ==
nullptr) {
1608 if (!DNA_struct_member_exists(fd->
filesdna,
"FluidModifierData",
"float",
"viscosity_value")) {
1613 if (fmd->
domain !=
nullptr) {
1623 if (!DNA_struct_exists(fd->
filesdna,
"NodeSetAlpha")) {
1629 if (node->type != CMP_NODE_SETALPHA) {
1632 NodeSetAlpha *storage = MEM_cnew<NodeSetAlpha>(
"NodeSetAlpha");
1634 node->storage = storage;
1642 if (ed ==
nullptr) {
1656 if (node->type == CMP_NODE_OUTPUT_FILE) {
1679 if (!DNA_struct_member_exists(fd->
filesdna,
"bGPdata",
"int",
"curve_edit_resolution")) {
1686 if (!DNA_struct_member_exists(fd->
filesdna,
"bGPdata",
"float",
"curve_edit_threshold")) {
1702 if (node->type == GEO_NODE_OBJECT_INFO && node->storage ==
nullptr) {
1706 node->storage =
data;
1715 if (!DNA_struct_member_exists(fd->
filesdna,
"bGPDlayer",
"float",
"location[0]")) {
1728 if ((brush->gpencil_settings) && (brush->gpencil_settings->fill_factor == 0.0f)) {
1729 brush->gpencil_settings->fill_factor = 1.0f;
1741 tex->altitude *= 1000.0f;
1773 if (!DNA_struct_member_exists(fd->
filesdna,
"SceneEEVEE",
"float",
"bokeh_overblur")) {
1775 scene->eevee.bokeh_neighbor_max = 10.0f;
1776 scene->eevee.bokeh_overblur = 5.0f;
1781 if (!DNA_struct_member_exists(fd->
filesdna,
"FModifier",
"short",
"ui_expand_flag")) {
1786 fcm->flag & FMODIFIER_FLAG_EXPANDED,
1799 if (scene->eevee.volumetric_shadow_samples > 32) {
1800 scene->eevee.volumetric_shadow_samples = 32;
1809 if (
STREQ(node->idname,
"GeometryNodeSubdivisionSurfaceSimple")) {
1810 STRNCPY(node->idname,
"GeometryNodeSubdivide");
1812 if (
STREQ(node->idname,
"GeometryNodeSubdivisionSurface")) {
1813 STRNCPY(node->idname,
"GeometryNodeSubdivideSmooth");
1824 switch (sl->spacetype) {
1848 ListBase *regionbase = (sl == area->spacedata.first) ? &area->regionbase :
1852 if (new_footer !=
nullptr) {
1866 if (
STREQ(node->idname,
"GeometryNodeSubdivideSmooth")) {
1867 STRNCPY(node->idname,
"GeometryNodeSubdivisionSurface");
1875 if (!DNA_struct_member_exists(fd->
filesdna,
"Light",
"float",
"diff_fac")) {
1877 light->diff_fac = 1.0f;
1878 light->volume_fac = 1.0f;
1887 if (
STREQ(node->idname,
"GeometryNodeMeshPlane")) {
1888 STRNCPY(node->idname,
"GeometryNodeMeshGrid");
1905#define CU_2D (1 << 3)
1910 if (nu->flag &
CU_2D) {
1925 if (!DNA_struct_member_exists(fd->
filesdna,
"bArmature",
"float",
"axes_position")) {
1928 arm->axes_position = 1.0;
1933 if (!DNA_struct_member_exists(fd->
filesdna,
"Light",
"float",
"area_spread")) {
1935 la->area_spread =
DEG2RADF(180.0f);
1945 STRNCPY(path->display_name, path->node_name);