3100#define SCE_SNAP_PROJECT (1 << 3)
3105#undef SCE_SNAP_PROJECT
3130 if (light->type ==
LA_SPOT && light->nodetree) {
3138 if (brush->tip_scale_x == 0.0f) {
3139 brush->tip_scale_x = 1.0f;
3161 if (!DNA_struct_member_exists(fd->
filesdna,
"LightProbe",
"int",
"grid_bake_samples")) {
3163 lightprobe->grid_bake_samples = 2048;
3164 lightprobe->grid_normal_bias = 0.3f;
3165 lightprobe->grid_view_bias = 0.0f;
3166 lightprobe->grid_facing_bias = 0.5f;
3167 lightprobe->grid_dilation_threshold = 0.5f;
3168 lightprobe->grid_dilation_radius = 1.0f;
3173 if (!DNA_struct_member_exists(fd->
filesdna,
"World",
"int",
"probe_resolution")) {
3179 if (!DNA_struct_member_exists(fd->
filesdna,
"LightProbe",
"float",
"grid_surface_bias")) {
3181 lightprobe->grid_surface_bias = 0.05f;
3182 lightprobe->grid_escape_bias = 0.1f;
3188 const int R_IMF_FLAG_ZBUF_LEGACY = 1 << 0;
3190 scene->r.im_format.flag &= ~R_IMF_FLAG_ZBUF_LEGACY;
3197 layer->opacity = 1.0f;
3216 ListBase *regionbase = (sl == area->spacedata.first) ? &area->regionbase :
3247 if (!DNA_struct_member_exists(fd->
filesdna,
"SceneEEVEE",
"int",
"ray_tracing_method")) {
3253 if (!DNA_struct_exists(fd->
filesdna,
"RegionAssetShelf")) {
3261 ListBase *regionbase = (sl == area->spacedata.first) ? &area->regionbase :
3267 "asset shelf for view3d (versioning)",
3275 "asset shelf header for view3d (versioning)",
3301 if (!DNA_struct_exists(fd->
filesdna,
"NodeShaderHairPrincipled")) {
3311 if (!DNA_struct_member_exists(fd->
filesdna,
"Camera",
"float",
"fisheye_fov")) {
3360 if (!DNA_struct_member_exists(fd->
filesdna,
"LightProbe",
"float",
"grid_flag")) {
3368 if (!DNA_struct_member_exists(fd->
filesdna,
"SceneEEVEE",
"int",
"gi_irradiance_pool_size")) {
3370 scene->eevee.gi_irradiance_pool_size = 16;
3375 scene->toolsettings->snap_flag_anim |=
SCE_SNAP;
3376 scene->toolsettings->snap_anim_mode |= (1 << 10);
3398 if (legacy_socket->prop) {
3401 MEM_delete(legacy_socket->runtime);
3407 if (legacy_socket->prop) {
3410 MEM_delete(legacy_socket->runtime);
3431 if (node->type == GEO_NODE_SET_SHADE_SMOOTH) {
3456 const ListBase *regionbase = (sl == area->spacedata.first) ? &area->regionbase :
3480 bNodeTreeInterfaceSocket &socket = reinterpret_cast<bNodeTreeInterfaceSocket &>(item);
3481 if ((socket.flag & NODE_INTERFACE_SOCKET_INPUT) &&
3482 (socket.flag & NODE_INTERFACE_SOCKET_OUTPUT))
3484 sockets_to_split.append(&socket);
3491 const int position = ntree->tree_interface.find_item_position(socket->item);
3515 scene->simulation_frame_start = scene->r.sfra;
3516 scene->simulation_frame_end = scene->r.efra;
3532 if (!DNA_struct_member_exists(fd->filesdna,
"SceneEEVEE",
"int",
"shadow_step_count")) {
3545 const ListBase *regionbase = (sl == area->spacedata.first) ? &area->regionbase :
3570 if (node->is_reroute()) {
3582 enum { IS_DEFAULT = 0, IS_UV, IS_NODE, IS_ANIM };
3583 auto versioning_snap_to = [](
short snap_to_old,
int type) {
3585 if (snap_to_old & (1 << 0)) {
3590 if (snap_to_old & (1 << 1)) {
3595 if (
ELEM(type, IS_DEFAULT, IS_ANIM) && snap_to_old & (1 << 2)) {
3598 if (type == IS_DEFAULT && snap_to_old & (1 << 3)) {
3601 if (type == IS_DEFAULT && snap_to_old & (1 << 4)) {
3604 if (type == IS_DEFAULT && snap_to_old & (1 << 5)) {
3607 if (
ELEM(type, IS_DEFAULT, IS_UV, IS_NODE) && snap_to_old & (1 << 6)) {
3610 if (
ELEM(type, IS_DEFAULT, IS_UV, IS_NODE) && snap_to_old & (1 << 7)) {
3613 if (type == IS_DEFAULT && snap_to_old & (1 << 8)) {
3616 if (type == IS_DEFAULT && snap_to_old & (1 << 9)) {
3619 if (snap_to_old & (1 << 10)) {
3622 if (snap_to_old & (1 << 11)) {
3625 if (snap_to_old & (1 << 12)) {
3648 if (info !=
nullptr) {
3649 for (
int i = curve->len_char32 - 1; i >= 0; i--, info++) {
3693 bool transparent_shadows =
true;
3695 transparent_shadows = material->blend_shadow !=
MA_BS_SOLID;
3699 cmat,
"use_transparent_shadow",
true);
3718 if (!DNA_struct_member_exists(fd->filesdna,
"SceneEEVEE",
"int",
"volumetric_ray_depth")) {
3725 if (!DNA_struct_member_exists(fd->filesdna,
"Material",
"char",
"surface_render_method")) {
3727 mat->surface_render_method = (mat->blend_method ==
MA_BM_BLEND) ?
3736 const ListBase *regionbase = (sl == area->spacedata.first) ? &area->regionbase :
3742 region->alignment &= ~RGN_SPLIT_PREV;
3749 if (!DNA_struct_member_exists(fd->filesdna,
"SceneEEVEE",
"float",
"gtao_thickness")) {
3753 scene->eevee.gtao_focus = default_eevee.
gtao_focus;
3757 if (!DNA_struct_member_exists(fd->filesdna,
"LightProbe",
"float",
"data_display_size")) {
3765 mesh->flag &= ~ME_NO_OVERLAPPING_TOPOLOGY;
3779 if (!DNA_struct_member_exists(fd->filesdna,
"Material",
"char",
"displacement_method")) {
3787 material->displacement_method = displacement_method;
3795 bone->color.custom.solid[3] = 255;
3796 bone->color.custom.select[3] = 255;
3797 bone->color.custom.active[3] = 255;
3801 ebone->color.custom.solid[3] = 255;
3802 ebone->color.custom.select[3] = 255;
3803 ebone->color.custom.active[3] = 255;
3808 if (obj->pose ==
nullptr) {
3812 pchan->color.custom.solid[3] = 255;
3813 pchan->color.custom.select[3] = 255;
3814 pchan->color.custom.active[3] = 255;
3820 if (!DNA_struct_member_exists(
3821 fd->filesdna,
"SceneEEVEE",
"RaytraceEEVEE",
"ray_tracing_options"))
3828 scene->eevee.ray_tracing_options.screen_trace_quality = 0.25f;
3829 scene->eevee.ray_tracing_options.screen_trace_thickness = 0.2f;
3830 scene->eevee.ray_tracing_options.trace_max_roughness = 0.5f;
3831 scene->eevee.ray_tracing_options.resolution_scale = 2;
3856 if (node->type == CMP_NODE_PIXELATE) {
3869 if (node->type == CMP_NODE_MAP_UV) {
3893 if (node->type == CMP_NODE_KEYING) {
3905 Sculpt *sculpt = scene->toolsettings->sculpt;
3906 if (sculpt !=
nullptr) {
3908 sculpt->automasking_boundary_edges_propagation_steps =
3917 int input_sample_values[9];
3920 input_sample_values[1] = ts->
sculpt !=
nullptr ?
3927 input_sample_values[3] = ts->
gp_paint !=
nullptr ?
3940 input_sample_values[7] = ts->
vpaint !=
nullptr ?
3943 input_sample_values[8] = ts->
wpaint !=
nullptr ?
3947 int unified_value = 1;
3948 for (
int i = 0; i < 9; i++) {
3949 if (input_sample_values[i] != 1) {
3950 if (unified_value == 1) {
3951 unified_value = input_sample_values[i];
3966 brush->input_samples = 1;
3972 if (scene->ed !=
nullptr) {
3993 md->persistent_uid = uid++;
4002 if (brush->gpencil_settings && (brush->gpencil_settings->sculpt_flag &
BRUSH_DIR_IN) != 0) {
4021 for (Layer *layer : grease_pencil->layers_for_write()) {
4035 scene->r.motion_blur_position = order_conversion[std::clamp(cposition, 0, 2)];
4041 scene->r.motion_blur_position = scene->eevee.motion_blur_position_deprecated;
4042 scene->r.motion_blur_shutter = scene->eevee.motion_blur_shutter_deprecated;
4048 constexpr int NTREE_EXECUTION_MODE_CPU = 0;
4049 constexpr int NTREE_EXECUTION_MODE_FULL_FRAME = 1;
4051 constexpr int NTREE_COM_GROUPNODE_BUFFER = 1 << 3;
4052 constexpr int NTREE_COM_OPENCL = 1 << 1;
4059 ntree->flag &= ~(NTREE_COM_GROUPNODE_BUFFER | NTREE_COM_OPENCL);
4061 if (ntree->execution_mode == NTREE_EXECUTION_MODE_FULL_FRAME) {
4062 ntree->execution_mode = NTREE_EXECUTION_MODE_CPU;
4069 if (!DNA_struct_member_exists(fd->filesdna,
"SpaceImage",
"float",
"stretch_opacity")) {
4093 settings->curve_radius = 0.01f;
4100 light->shadow_filter_radius = 1.0f;
4105 const float default_snap_angle_increment =
DEG2RADF(5.0f);
4106 const float default_snap_angle_increment_precision =
DEG2RADF(1.0f);
4108 scene->toolsettings->snap_angle_increment_2d = default_snap_angle_increment;
4109 scene->toolsettings->snap_angle_increment_3d = default_snap_angle_increment;
4110 scene->toolsettings->snap_angle_increment_2d_precision =
4111 default_snap_angle_increment_precision;
4112 scene->toolsettings->snap_angle_increment_3d_precision =
4113 default_snap_angle_increment_precision;
4118 if (!DNA_struct_member_exists(fd->filesdna,
"SceneEEVEE",
"int",
"gtao_resolution")) {
4120 scene->eevee.gtao_resolution = 2;
4132 if (scene->ed !=
nullptr) {
4141 mpath->color_post[0] = 0.1f;
4142 mpath->color_post[1] = 1.0f;
4143 mpath->color_post[2] = 0.1f;
4150 mpath->color_post[0] = 0.1f;
4151 mpath->color_post[1] = 1.0f;
4152 mpath->color_post[2] = 0.1f;
4159 if (!DNA_struct_member_exists(fd->filesdna,
"Light",
"float",
"transmission_fac")) {
4163 light->transmission_fac = 0.0f;
4175 scene->eevee.clamp_surface_indirect = 10.0f;
4178 scene->eevee.clamp_volume_indirect = 1e-8f;
4196 if (scene->ed !=
nullptr) {
4215 if (!DNA_struct_member_exists(fd->filesdna,
"Material",
"char",
"thickness_mode")) {
4238 if (node->type != CMP_NODE_BLUR) {
4250 const float size_factor = 3.0f / 2.0f;
4251 blur_data.
sizex *= size_factor;
4252 blur_data.
sizey *= size_factor;
4261 if (!DNA_struct_member_exists(fd->filesdna,
"SceneEEVEE",
"float",
"shadow_resolution_scale"))
4272 if (scene->ed !=
nullptr) {
4291 if (scene->ed !=
nullptr) {
4312 if (scene->nodetree) {
4313 scene->nodetree->flag &= ~NTREE_UNUSED_2;
4322 lightprobe->grid_surfel_density =
max_ii(20,
4323 2 *
max_iii(lightprobe->grid_resolution_x,
4324 lightprobe->grid_resolution_y,
4325 lightprobe->grid_resolution_z));
4330 bool only_uses_eevee_legacy_or_workbench =
true;
4333 only_uses_eevee_legacy_or_workbench =
false;
4338 if (world->nodetree) {
4343 if (volume_input_socket) {
4345 if (node_link->tonode == output_node && node_link->tosock == volume_input_socket) {
4348 if (only_uses_eevee_legacy_or_workbench) {
4351 RPT_(
"%s contains a volume shader that might need to be "
4352 "converted to object (see world volume panel)\n"),
4353 world->id.name + 2);
4364 constexpr int NTREE_EXECUTION_MODE_GPU = 2;
4367 if (scene->nodetree) {
4368 if (scene->nodetree->execution_mode == NTREE_EXECUTION_MODE_GPU) {
4371 scene->r.compositor_precision = scene->nodetree->precision;
4377 float shadow_max_res_sun = 0.001f;
4378 float shadow_max_res_local = 0.001f;
4379 bool shadow_resolution_absolute =
false;
4382 shadow_max_res_local = (2.0f *
M_SQRT2) / scene->eevee.shadow_cube_size_deprecated;
4384 shadow_max_res_local =
ceil(shadow_max_res_local * 1000.0f) / 1000.0f;
4385 shadow_resolution_absolute =
true;
4390 if (light->type ==
LA_SUN) {
4392 light->shadow_maximum_resolution = shadow_max_res_sun;
4396 light->shadow_maximum_resolution = shadow_max_res_local;
4405 if (brush->gpencil_settings) {
4409 brush->unprojected_radius = brush->size *
4419 world->sun_angle = default_world->
sun_angle;
4424 world->flag &= ~WO_USE_SUN_SHADOW;
4453 ntree, FN_NODE_SEPARATE_TRANSFORM,
"Location",
"Translation");
4506 pchan->custom_shape_wire_width = 1.0;
4530 if (node->type != GEO_NODE_CAPTURE_ATTRIBUTE) {
4539 storage->
capture_items = MEM_cnew_array<NodeGeometryAttributeCaptureItem>(
4568 if (node->type != CMP_NODE_CURVE_RGB) {
4578 curve_mapping.
cur = 3;
4591 space_node->
flag &= ~SNODE_FLAG_UNUSED_5;
4629 if (scene->eevee.gi_cubemap_resolution < 128) {
4630 scene->eevee.gi_cubemap_resolution = 128;
4639 bool transparent_shadows = material->blend_shadow !=
MA_BS_SOLID;
4643 mat->surface_render_method = (mat->blend_method ==
MA_BM_BLEND) ?
4654 brush->alpha = settings->draw_strength;
4659 settings->simplify_px = settings->simplify_f /
4667 scene->view_settings.temperature = 6500.0f;
4668 scene->view_settings.tint = 10.0f;
4694 if (node->type == CMP_NODE_COLORBALANCE) {
4707 curves->geometry.attributes_active_index = curves->attributes_active_index_legacy;
4734 if (node->type != CMP_NODE_OUTPUT_FILE) {
4766 const bool first_save_as_render = first_input_storage->
save_as_render;
4767 bool all_inputs_have_same_save_as_render =
true;
4771 if (
bool(input_storage->
save_as_render) != first_save_as_render) {
4772 all_inputs_have_same_save_as_render =
false;
4779 if (all_inputs_have_same_save_as_render) {
4807 const ListBase *exporters = &collection->exporters;
4826 if (
tree->default_group_node_width == 0) {
4839 if (region !=
nullptr) {
4840 region->flag &= ~RGN_FLAG_HIDDEN;
4854 if (region !=
nullptr) {
4855 View2D *v2d = ®ion->v2d;
4856 v2d->
flag &= ~V2D_VIEWSYNC_SCREEN_TIME;
4927 STRNCPY(tref->idname,
"builtin.select_box");