817 const MPoly *polys =
static_cast<const MPoly *
>(
820 if (polys[
i].totloop == 2) {
826 reinterpret_cast<float (*)[3]
>(me->vert_positions_for_write().data()),
828 me->edges_for_write().data(),
831 &me->fdata_legacy,
CD_MFACE, me->totface_legacy),
833 me->corner_verts().data(),
834 me->corner_edges_for_write().data(),
836 me->face_offsets().data(),
838 me->deform_verts_for_write().data(),
858 if (!DNA_struct_member_exists(fd->
filesdna,
"SpaceImage",
"float",
"uv_opacity")) {
872 if (!DNA_struct_member_exists(fd->
filesdna,
"BrushGpencilSettings",
"float",
"random_hue")) {
874 if ((brush->gpencil_settings) && (brush->gpencil_settings->curve_rand_pressure ==
nullptr))
877 1, 0.0f, 0.0f, 1.0f, 1.0f);
879 1, 0.0f, 0.0f, 1.0f, 1.0f);
882 1, 0.0f, 0.0f, 1.0f, 1.0f);
884 1, 0.0f, 0.0f, 1.0f, 1.0f);
886 1, 0.0f, 0.0f, 1.0f, 1.0f);
904 if (!DNA_struct_member_exists(fd->
filesdna,
"NodeTexSky",
"float",
"sun_size")) {
933 bool use_optix =
false;
934 bool use_denoising =
false;
938 use_denoising = use_denoising ||
940 use_optix = use_optix ||
947 use_denoising = use_denoising ||
949 use_optix = use_optix ||
975 if (!use_denoising) {
994 if (!DNA_struct_member_exists(fd->
filesdna,
"ModifierData",
"short",
"ui_expand_flag")) {
997 if (md->mode & eModifierMode_Expanded_DEPRECATED) {
1001 md->ui_expand_flag = 0;
1008 if (!DNA_struct_member_exists(fd->
filesdna,
"SceneEEVEE",
"float",
"motion_blur_depth_scale"))
1011 scene->eevee.motion_blur_depth_scale = 100.0f;
1012 scene->eevee.motion_blur_max = 32;
1016 if (!DNA_struct_member_exists(fd->
filesdna,
"SceneEEVEE",
"int",
"motion_blur_steps")) {
1018 scene->eevee.motion_blur_steps = 1;
1023 if (!DNA_struct_member_exists(fd->
filesdna,
"bConstraint",
"short",
"ui_expand_flag")) {
1026 if (con->flag & CONSTRAINT_EXPAND_DEPRECATED) {
1030 con->ui_expand_flag = 0;
1037 if (!DNA_struct_member_exists(fd->
filesdna,
"GpencilModifierData",
"short",
"ui_expand_flag"))
1041 if (md->mode & eGpencilModifierMode_Expanded_DEPRECATED) {
1045 md->ui_expand_flag = 0;
1052 if (!DNA_struct_member_exists(fd->
filesdna,
"ShaderFxData",
"short",
"ui_expand_flag")) {
1055 if (fx->mode & eShaderFxMode_Expanded_DEPRECATED) {
1059 fx->ui_expand_flag = 0;
1066 if (!DNA_struct_member_exists(fd->
filesdna,
"BevelModifierData",
"short",
"profile_type")) {
1071 bool use_custom_profile = bmd->
flags & MOD_BEVEL_CUSTOM_PROFILE_DEPRECATED;
1094 if (!DNA_struct_member_exists(fd->
filesdna,
"NodeTexSky",
"float",
"sun_intensity")) {
1110 if (!DNA_struct_member_exists(fd->
filesdna,
"BevelModifierData",
"char",
"affect_type")) {
1115 const bool use_vertex_bevel = bmd->
flags & MOD_BEVEL_VERT_DEPRECATED;
1124 if (!DNA_struct_member_exists(
1125 fd->
filesdna,
"MeshSeqCacheModifierData",
"float",
"velocity_scale"))
1137 if (!DNA_struct_member_exists(fd->
filesdna,
"CacheFile",
"char",
"velocity_unit")) {
1139 STRNCPY_UTF8(cache_file->velocity_name,
".velocities");
1144 if (!DNA_struct_member_exists(fd->
filesdna,
"OceanModifierData",
"int",
"viewport_resolution"))
1172 if (rbw ==
nullptr) {
1220 mesh->vert_data.totlayer = mesh->vert_data.maxlayer =
MEM_allocN_len(
1221 mesh->vert_data.layers) /
1223 mesh->edge_data.totlayer = mesh->edge_data.maxlayer =
MEM_allocN_len(
1224 mesh->edge_data.layers) /
1227 mesh->corner_data.totlayer = mesh->corner_data.maxlayer =
MEM_allocN_len(
1228 mesh->corner_data.layers) /
1230 mesh->face_data.totlayer = mesh->face_data.maxlayer =
MEM_allocN_len(
1231 mesh->face_data.layers) /
1241 if (fcu->totvert < 2 || fcu->bezt ==
nullptr) {
1254 if (scene->master_collection) {
1260 if (!DNA_struct_member_exists(fd->
filesdna,
"Curve",
"char",
"bevel_mode")) {
1262 if (curve->bevobj !=
nullptr) {
1276 if (fmd->
domain !=
nullptr) {
1283 const float grid_lines[4] = {1.0, 0.0, 0.0, 1.0};
1293 if (!DNA_struct_member_exists(fd->
filesdna,
"View3DOverlay",
"float",
"fade_alpha")) {
1308 if (!DNA_struct_member_exists(fd->
filesdna,
"Mesh",
"char",
"symmetry")) {
1331 scene->r.simplify_volumes = 1.0f;
1336 if (!DNA_struct_member_exists(fd->
filesdna,
"WorkSpaceDataRelation",
"int",
"parentid")) {
1343 if (relation->parent !=
nullptr) {
1347 if (win !=
nullptr) {
1348 relation->parentid = win->
winid;
1352 if (relation->parentid == 0) {
1355 "Found a valid parent for workspace data relation, but no valid parent id.");
1358 if (relation->parentid == 0) {
1366 if (!DNA_struct_exists(fd->
filesdna,
"SpaceImageOverlay")) {
1393 switch (sl->spacetype) {
1404 if (!DNA_struct_member_exists(
1405 fd->
filesdna,
"FluidModifierData",
"float",
"fractions_distance"))
1422 const int LEGACY_REFINE_RADIAL_DISTORTION_K1 = (1 << 2);
1427 int new_refine_camera_intrinsics = 0;
1451 if (!DNA_struct_member_exists(fd->
filesdna,
"View3DOverlay",
"float",
"wireframe_opacity")) {
1497 if (!DNA_struct_member_exists(fd->
filesdna,
"ViewLayer",
"short",
"cryptomatte_levels")) {
1500 view_layer->cryptomatte_levels = 6;
1531 if (scene->nodetree) {
1535 const char *volume_scatter =
"VolumeScatterCol";
1546 if (!DNA_struct_exists(fd->
filesdna,
"CryptomatteEntry")) {
1548 if (scene->nodetree) {
1552 char *matte_id = storage->
matte_id;
1553 if ((matte_id ==
nullptr) || (storage->
matte_id[0] ==
'\0')) {
1580 if (
STREQ(node->idname,
"GeometryNodeRandomAttribute")) {
1581 STRNCPY_UTF8(node->idname,
"GeometryLegacyNodeAttributeRandomize");
1587 if (scene->toolsettings->sequencer_tool_settings ==
nullptr) {
1607 if (!DNA_struct_member_exists(fd->
filesdna,
"FluidModifierData",
"float",
"viscosity_value")) {
1612 if (fmd->
domain !=
nullptr) {
1622 if (!DNA_struct_exists(fd->
filesdna,
"NodeSetAlpha")) {
1633 node->storage = storage;
1641 if (ed ==
nullptr) {
1658 simf->save_as_render =
true;
1677 if (!DNA_struct_member_exists(fd->
filesdna,
"bGPdata",
"int",
"curve_edit_resolution")) {
1684 if (!DNA_struct_member_exists(fd->
filesdna,
"bGPdata",
"float",
"curve_edit_threshold")) {
1703 node->storage =
data;
1712 if (!DNA_struct_member_exists(fd->
filesdna,
"bGPDlayer",
"float",
"location[0]")) {
1725 if ((brush->gpencil_settings) && (brush->gpencil_settings->fill_factor == 0.0f)) {
1726 brush->gpencil_settings->fill_factor = 1.0f;
1770 if (!DNA_struct_member_exists(fd->
filesdna,
"SceneEEVEE",
"float",
"bokeh_overblur")) {
1772 scene->eevee.bokeh_neighbor_max = 10.0f;
1773 scene->eevee.bokeh_overblur = 5.0f;
1778 if (!DNA_struct_member_exists(fd->
filesdna,
"FModifier",
"short",
"ui_expand_flag")) {
1783 fcm->flag & FMODIFIER_FLAG_EXPANDED,
1796 scene->eevee.volumetric_shadow_samples = std::min(scene->eevee.volumetric_shadow_samples,
1805 if (
STREQ(node->idname,
"GeometryNodeSubdivisionSurfaceSimple")) {
1808 if (
STREQ(node->idname,
"GeometryNodeSubdivisionSurface")) {
1809 STRNCPY_UTF8(node->idname,
"GeometryNodeSubdivideSmooth");
1820 switch (sl->spacetype) {
1844 ListBase *regionbase = (sl == area->spacedata.first) ? &area->regionbase :
1848 if (new_footer !=
nullptr) {
1862 if (
STREQ(node->idname,
"GeometryNodeSubdivideSmooth")) {
1863 STRNCPY_UTF8(node->idname,
"GeometryNodeSubdivisionSurface");
1871 if (!DNA_struct_member_exists(fd->
filesdna,
"Light",
"float",
"diff_fac")) {
1873 light->diff_fac = 1.0f;
1874 light->volume_fac = 1.0f;
1883 if (
STREQ(node->idname,
"GeometryNodeMeshPlane")) {
1884 STRNCPY(node->idname,
"GeometryNodeMeshGrid");
1901#define CU_2D (1 << 3)
1906 if (nu->flag &
CU_2D) {
1921 if (!DNA_struct_member_exists(fd->
filesdna,
"bArmature",
"float",
"axes_position")) {
1924 arm->axes_position = 1.0;
1929 if (!DNA_struct_member_exists(fd->
filesdna,
"Light",
"float",
"area_spread")) {
1931 la->area_spread =
DEG2RADF(180.0f);