diff --git a/intern/cycles/device/metal/bvh.mm b/intern/cycles/device/metal/bvh.mm index d9c96740898..cea9ff68460 100644 --- a/intern/cycles/device/metal/bvh.mm +++ b/intern/cycles/device/metal/bvh.mm @@ -35,6 +35,14 @@ CCL_NAMESPACE_BEGIN # define bvh_throttle_printf(...) # endif +/* This flag didn't exist until Xcode 26.0, so we ensure that it is defined for + * forward-compatibility. + */ +# ifndef MAC_OS_VERSION_26_0 +# define MTLAccelerationStructureUsagePreferFastIntersection \ + MTLAccelerationStructureUsage(1 << 4) +# endif + /* Limit the number of concurrent BVH builds so that we don't approach unsafe GPU working set * sizes. */ struct BVHMetalBuildThrottler { @@ -292,11 +300,9 @@ bool BVHMetal::build_BLAS_mesh(Progress &progress, accelDesc.usage |= (MTLAccelerationStructureUsageRefit | MTLAccelerationStructureUsagePreferFastBuild); } -# if defined(MAC_OS_VERSION_26_0) else if (@available(macos 26.0, *)) { accelDesc.usage |= MTLAccelerationStructureUsagePreferFastIntersection; } -# endif MTLAccelerationStructureSizes accelSizes = [mtl_device accelerationStructureSizesWithDescriptor:accelDesc]; @@ -638,11 +644,9 @@ bool BVHMetal::build_BLAS_hair(Progress &progress, accelDesc.usage |= (MTLAccelerationStructureUsageRefit | MTLAccelerationStructureUsagePreferFastBuild); } -# if defined(MAC_OS_VERSION_26_0) else if (@available(macos 26.0, *)) { accelDesc.usage |= MTLAccelerationStructureUsagePreferFastIntersection; } -# endif MTLAccelerationStructureSizes accelSizes = [mtl_device accelerationStructureSizesWithDescriptor:accelDesc]; @@ -874,11 +878,9 @@ bool BVHMetal::build_BLAS_pointcloud(Progress &progress, accelDesc.usage |= (MTLAccelerationStructureUsageRefit | MTLAccelerationStructureUsagePreferFastBuild); } -# if defined(MAC_OS_VERSION_26_0) else if (@available(macos 26.0, *)) { accelDesc.usage |= MTLAccelerationStructureUsagePreferFastIntersection; } -# endif MTLAccelerationStructureSizes accelSizes = [mtl_device accelerationStructureSizesWithDescriptor:accelDesc]; @@ -1352,11 +1354,9 @@ bool BVHMetal::build_TLAS(Progress &progress, accelDesc.usage |= (MTLAccelerationStructureUsageRefit | MTLAccelerationStructureUsagePreferFastBuild); } -# if defined(MAC_OS_VERSION_26_0) else if (@available(macos 26.0, *)) { accelDesc.usage |= MTLAccelerationStructureUsagePreferFastIntersection; } -# endif MTLAccelerationStructureSizes accelSizes = [mtl_device accelerationStructureSizesWithDescriptor:accelDesc]; diff --git a/scripts/startup/bl_operators/object.py b/scripts/startup/bl_operators/object.py index 975edfa7c13..715fa0a98da 100644 --- a/scripts/startup/bl_operators/object.py +++ b/scripts/startup/bl_operators/object.py @@ -886,24 +886,23 @@ class TransformsToDeltasAnim(Operator): # no conflict yet existingFCurves[dpath] = [fcu.array_index] - # if F-Curve uses standard transform path - # just append "delta_" to this path + # Move the 'standard' to the 'delta' data paths. for fcu in channelbag.fcurves: - if fcu.data_path == "location": - fcu.data_path = "delta_location" - obj.location.zero() - elif fcu.data_path == "rotation_euler": - fcu.data_path = "delta_rotation_euler" - obj.rotation_euler.zero() - elif fcu.data_path == "rotation_quaternion": - fcu.data_path = "delta_rotation_quaternion" - obj.rotation_quaternion.identity() - # XXX: currently not implemented - # ~ elif fcu.data_path == "rotation_axis_angle": - # ~ fcu.data_path = "delta_rotation_axis_angle" - elif fcu.data_path == "scale": - fcu.data_path = "delta_scale" - obj.scale = 1.0, 1.0, 1.0 + standard_path = fcu.data_path + array_index = fcu.array_index + try: + delta_path = STANDARD_TO_DELTA_PATHS[standard_path] + except KeyError: + # Not a standard transform path. + continue + + # Just change the F-Curve's data path. The array index should remain the same. + fcu.data_path = delta_path + + # Reset the now-no-longer-animated property to its default value. + default_array = obj.bl_rna.properties[standard_path].default_array + property_array = getattr(obj, standard_path) + property_array[array_index] = default_array[array_index] # hack: force animsys flush by changing frame, so that deltas get run context.scene.frame_set(context.scene.frame_current) diff --git a/source/blender/editors/armature/bone_collections.cc b/source/blender/editors/armature/bone_collections.cc index 9e00d3b91fd..65bab742c82 100644 --- a/source/blender/editors/armature/bone_collections.cc +++ b/source/blender/editors/armature/bone_collections.cc @@ -752,6 +752,17 @@ static bool armature_bone_select_poll(bContext *C) return false; } + const bool is_editmode = armature->edbo != nullptr; + if (!is_editmode) { + Object *active_object = blender::ed::object::context_active_object(C); + if (!active_object || active_object->type != OB_ARMATURE || active_object->data != armature) { + /* There has to be an active object in order to hide a pose bone that points to the correct + * armature. With pinning, the active object may not be an armature. */ + CTX_wm_operator_poll_msg_set(C, "The active object does not match the armature"); + return false; + } + } + if (armature->runtime.active_collection == nullptr) { CTX_wm_operator_poll_msg_set(C, "No active bone collection"); return false; @@ -778,9 +789,17 @@ static void bone_collection_select(bContext *C, } } else { + Object *active_object = blender::ed::object::context_active_object(C); + if (!active_object || active_object->type != OB_ARMATURE || active_object->data != armature) { + /* This is covered by the poll function. */ + BLI_assert_unreachable(); + return; + } LISTBASE_FOREACH (BoneCollectionMember *, member, &bcoll->bones) { Bone *bone = member->bone; - if (!blender::animrig::bone_is_visible(armature, bone)) { + bPoseChannel *pose_bone = BKE_pose_channel_find_name(active_object->pose, bone->name); + BLI_assert_msg(pose_bone != nullptr, "The pose bones and armature bones are out of sync"); + if (!blender::animrig::bone_is_visible(armature, pose_bone)) { continue; } if (bone->flag & BONE_UNSELECTABLE) { @@ -788,12 +807,13 @@ static void bone_collection_select(bContext *C, } if (select) { - bone->flag |= BONE_SELECTED; + pose_bone->flag |= POSE_SELECTED; } else { - bone->flag &= ~BONE_SELECTED; + pose_bone->flag &= ~POSE_SELECTED; } } + DEG_id_tag_update(&active_object->id, ID_RECALC_SELECT); } DEG_id_tag_update(&armature->id, ID_RECALC_SELECT); diff --git a/source/blender/makesrna/intern/rna_brush.cc b/source/blender/makesrna/intern/rna_brush.cc index 1b7ac07fdf5..cbbcd0809d2 100644 --- a/source/blender/makesrna/intern/rna_brush.cc +++ b/source/blender/makesrna/intern/rna_brush.cc @@ -33,21 +33,6 @@ static const EnumPropertyItem prop_direction_items[] = { {0, nullptr, 0, nullptr, nullptr}, }; -#ifdef RNA_RUNTIME - -# include "DNA_material_types.h" - -static const EnumPropertyItem prop_smooth_direction_items[] = { - {0, "SMOOTH", ICON_ADD, "Smooth", "Smooth the surface"}, - {BRUSH_DIR_IN, - "ENHANCE_DETAILS", - ICON_REMOVE, - "Enhance Details", - "Enhance the surface detail"}, - {0, nullptr, 0, nullptr, nullptr}, -}; -#endif - static const EnumPropertyItem sculpt_stroke_method_items[] = { {0, "DOTS", 0, "Dots", "Apply paint on each mouse move step"}, {BRUSH_DRAG_DOT, "DRAG_DOT", 0, "Drag Dot", "Allows a single dot to be carefully positioned"}, @@ -379,6 +364,8 @@ static EnumPropertyItem rna_enum_gpencil_brush_modes_items[] = { #ifdef RNA_RUNTIME +# include "DNA_material_types.h" + # include "RNA_access.hh" # include "BKE_brush.hh" @@ -784,34 +771,84 @@ static const EnumPropertyItem *rna_Brush_direction_itemf(bContext *C, PaintMode mode = BKE_paintmode_get_active_from_context(C); /* sculpt mode */ + static const EnumPropertyItem prop_smooth_direction_items[] = { + {0, + "SMOOTH", + ICON_ADD, + CTX_N_(BLT_I18NCONTEXT_ID_BRUSH, "Smooth"), + N_("Smooth the surface")}, + {BRUSH_DIR_IN, + "ENHANCE_DETAILS", + ICON_REMOVE, + CTX_N_(BLT_I18NCONTEXT_ID_BRUSH, "Enhance Details"), + N_("Enhance the surface detail")}, + {0, nullptr, 0, nullptr, nullptr}, + }; + static const EnumPropertyItem prop_pinch_magnify_items[] = { - {BRUSH_DIR_IN, "MAGNIFY", ICON_ADD, "Magnify", "Subtract effect of brush"}, - {0, "PINCH", ICON_REMOVE, "Pinch", "Add effect of brush"}, + {BRUSH_DIR_IN, + "MAGNIFY", + ICON_ADD, + CTX_N_(BLT_I18NCONTEXT_ID_BRUSH, "Magnify"), + N_("Subtract effect of brush")}, + {0, + "PINCH", + ICON_REMOVE, + CTX_N_(BLT_I18NCONTEXT_ID_BRUSH, "Pinch"), + N_("Add effect of brush")}, {0, nullptr, 0, nullptr, nullptr}, }; static const EnumPropertyItem prop_inflate_deflate_items[] = { - {0, "INFLATE", ICON_ADD, "Inflate", "Add effect of brush"}, - {BRUSH_DIR_IN, "DEFLATE", ICON_REMOVE, "Deflate", "Subtract effect of brush"}, + {0, + "INFLATE", + ICON_ADD, + CTX_N_(BLT_I18NCONTEXT_ID_BRUSH, "Inflate"), + N_("Add effect of brush")}, + {BRUSH_DIR_IN, + "DEFLATE", + ICON_REMOVE, + CTX_N_(BLT_I18NCONTEXT_ID_BRUSH, "Deflate"), + N_("Subtract effect of brush")}, {0, nullptr, 0, nullptr, nullptr}, }; /* texture paint mode */ static const EnumPropertyItem prop_soften_sharpen_items[] = { - {BRUSH_DIR_IN, "SHARPEN", ICON_ADD, "Sharpen", "Sharpen effect of brush"}, - {0, "SOFTEN", ICON_REMOVE, "Soften", "Blur effect of brush"}, + {BRUSH_DIR_IN, + "SHARPEN", + ICON_ADD, + CTX_N_(BLT_I18NCONTEXT_ID_BRUSH, "Sharpen"), + N_("Sharpen effect of brush")}, + {0, + "SOFTEN", + ICON_REMOVE, + CTX_N_(BLT_I18NCONTEXT_ID_BRUSH, "Soften"), + N_("Blur effect of brush")}, {0, nullptr, 0, nullptr, nullptr}, }; /* gpencil sculpt */ static const EnumPropertyItem prop_pinch_items[] = { - {0, "ADD", ICON_ADD, "Pinch", "Add effect of brush"}, - {BRUSH_DIR_IN, "SUBTRACT", ICON_REMOVE, "Inflate", "Subtract effect of brush"}, + {0, "ADD", ICON_ADD, CTX_N_(BLT_I18NCONTEXT_ID_BRUSH, "Pinch"), N_("Add effect of brush")}, + {BRUSH_DIR_IN, + "SUBTRACT", + ICON_REMOVE, + CTX_N_(BLT_I18NCONTEXT_ID_BRUSH, "Inflate"), + N_("Subtract effect of brush")}, {0, nullptr, 0, nullptr, nullptr}, }; static const EnumPropertyItem prop_twist_items[] = { - {0, "ADD", ICON_ADD, "Counter-Clockwise", "Add effect of brush"}, - {BRUSH_DIR_IN, "SUBTRACT", ICON_REMOVE, "Clockwise", "Subtract effect of brush"}, + {0, + "ADD", + ICON_ADD, + CTX_N_(BLT_I18NCONTEXT_ID_BRUSH, "Counter-Clockwise"), + N_("Add effect of brush")}, + {BRUSH_DIR_IN, + "SUBTRACT", + ICON_REMOVE, + CTX_N_(BLT_I18NCONTEXT_ID_BRUSH, "Clockwise"), + N_("Subtract effect of brush")}, {0, nullptr, 0, nullptr, nullptr}, }; @@ -2563,6 +2600,7 @@ static void rna_def_brush(BlenderRNA *brna) RNA_def_property_enum_items(prop, prop_direction_items); RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_Brush_direction_itemf"); RNA_def_property_ui_text(prop, "Direction", ""); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_BRUSH); RNA_def_property_update(prop, 0, "rna_Brush_update"); prop = RNA_def_property(srna, "stroke_method", PROP_ENUM, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_curves.cc b/source/blender/makesrna/intern/rna_curves.cc index c3ddd943f7b..e32eff8c565 100644 --- a/source/blender/makesrna/intern/rna_curves.cc +++ b/source/blender/makesrna/intern/rna_curves.cc @@ -17,6 +17,8 @@ #include "BKE_attribute.h" +#include "BLT_translation.hh" + #include "WM_types.hh" const EnumPropertyItem rna_enum_curves_type_items[] = { @@ -55,19 +57,20 @@ const EnumPropertyItem rna_enum_curve_normal_mode_items[] = { {NORMAL_MODE_MINIMUM_TWIST, "MINIMUM_TWIST", ICON_NONE, - "Minimum Twist", - "Calculate normals with the smallest twist around the curve tangent across the whole curve"}, + N_("Minimum Twist"), + N_("Calculate normals with the smallest twist around the curve tangent across the whole " + "curve")}, {NORMAL_MODE_Z_UP, "Z_UP", ICON_NONE, - "Z Up", - "Calculate normals perpendicular to the Z axis and the curve tangent. If a series of points " - "is vertical, the X axis is used."}, + N_("Z Up"), + N_("Calculate normals perpendicular to the Z axis and the curve tangent. If a series of " + "points is vertical, the X axis is used.")}, {NORMAL_MODE_FREE, "FREE", ICON_NONE, - "Free", - "Use the stored custom normal attribute as the final normals"}, + N_("Free"), + N_("Use the stored custom normal attribute as the final normals")}, {0, nullptr, 0, nullptr, nullptr}, }; diff --git a/source/blender/makesrna/intern/rna_nodetree.cc b/source/blender/makesrna/intern/rna_nodetree.cc index ef6d41a2c26..690e396c320 100644 --- a/source/blender/makesrna/intern/rna_nodetree.cc +++ b/source/blender/makesrna/intern/rna_nodetree.cc @@ -532,30 +532,38 @@ const EnumPropertyItem rna_enum_node_compositor_extension_items[] = { {CMP_NODE_EXTENSION_MODE_CLIP, "CLIP", 0, - "Clip", - "Areas outside of the image are filled with zero"}, + N_("Clip"), + N_("Areas outside of the image are filled with zero")}, {CMP_NODE_EXTENSION_MODE_EXTEND, "EXTEND", 0, - "Extend", - "Areas outside of the image are filled with the closest boundary pixel in the image"}, + N_("Extend"), + N_("Areas outside of the image are filled with the closest boundary pixel in the image")}, {CMP_NODE_EXTENSION_MODE_REPEAT, "REPEAT", 0, - "Repeat", - "Areas outside of the image are filled with repetitions of the image"}, + N_("Repeat"), + N_("Areas outside of the image are filled with repetitions of the image")}, {0, nullptr, 0, nullptr, nullptr}, }; const EnumPropertyItem rna_enum_node_compositor_interpolation_items[] = { - {CMP_NODE_INTERPOLATION_NEAREST, "NEAREST", 0, "Nearest", "Use Nearest interpolation"}, - {CMP_NODE_INTERPOLATION_BILINEAR, "BILINEAR", 0, "Bilinear", "Use Bilinear interpolation"}, - {CMP_NODE_INTERPOLATION_BICUBIC, "BICUBIC", 0, "Bicubic", "Use Cubic B-Spline interpolation"}, + {CMP_NODE_INTERPOLATION_NEAREST, "NEAREST", 0, N_("Nearest"), N_("Use Nearest interpolation")}, + {CMP_NODE_INTERPOLATION_BILINEAR, + "BILINEAR", + 0, + N_("Bilinear"), + N_("Use Bilinear interpolation")}, + {CMP_NODE_INTERPOLATION_BICUBIC, + "BICUBIC", + 0, + N_("Bicubic"), + N_("Use Cubic B-Spline interpolation")}, {CMP_NODE_INTERPOLATION_ANISOTROPIC, "ANISOTROPIC", 0, - "Anisotropic", - "Use Anisotropic interpolation"}, + N_("Anisotropic"), + N_("Use Anisotropic interpolation")}, {0, nullptr, 0, nullptr, nullptr}, }; diff --git a/source/blender/nodes/NOD_node_declaration.hh b/source/blender/nodes/NOD_node_declaration.hh index e791002f24b..3d3776ce1f5 100644 --- a/source/blender/nodes/NOD_node_declaration.hh +++ b/source/blender/nodes/NOD_node_declaration.hh @@ -256,7 +256,7 @@ class SocketDeclaration : public ItemDeclaration { public: /** Some input sockets can have non-trivial values in the case when they are unlinked. */ - NodeDefaultInputType default_input_type; + NodeDefaultInputType default_input_type = NodeDefaultInputType::NODE_DEFAULT_INPUT_VALUE; /** * Property that stores the name of the socket so that it can be modified directly from the * node without going to the side-bar. diff --git a/source/blender/nodes/geometry/nodes/node_geo_combine_bundle.cc b/source/blender/nodes/geometry/nodes/node_geo_combine_bundle.cc index bac34904910..3ef222562b0 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_combine_bundle.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_combine_bundle.cc @@ -156,7 +156,7 @@ static void node_gather_link_searches(GatherLinkSearchOpParams ¶ms) { return; } - params.add_item("Item", [](LinkSearchOpParams ¶ms) { + params.add_item(IFACE_("Item"), [](LinkSearchOpParams ¶ms) { bNode &node = params.add_node("NodeCombineBundle"); const auto *item = socket_items::add_item_with_socket_type_and_name( @@ -168,7 +168,7 @@ static void node_gather_link_searches(GatherLinkSearchOpParams ¶ms) if (other_socket.type != SOCK_BUNDLE) { return; } - params.add_item("Bundle", [](LinkSearchOpParams ¶ms) { + params.add_item(IFACE_("Bundle"), [](LinkSearchOpParams ¶ms) { bNode &node = params.add_node("NodeCombineBundle"); params.connect_available_socket(node, "Bundle"); diff --git a/source/blender/nodes/geometry/nodes/node_geo_evaluate_closure.cc b/source/blender/nodes/geometry/nodes/node_geo_evaluate_closure.cc index 48238339fb7..f570e718eb0 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_evaluate_closure.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_evaluate_closure.cc @@ -162,7 +162,7 @@ static void node_gather_link_searches(GatherLinkSearchOpParams ¶ms) { const bNodeSocket &other_socket = params.other_socket(); if (other_socket.in_out == SOCK_IN) { - params.add_item("Item", [](LinkSearchOpParams ¶ms) { + params.add_item(IFACE_("Item"), [](LinkSearchOpParams ¶ms) { bNode &node = params.add_node("NodeEvaluateClosure"); const auto *item = socket_items::add_item_with_socket_type_and_name( @@ -172,7 +172,7 @@ static void node_gather_link_searches(GatherLinkSearchOpParams ¶ms) return; } if (other_socket.type == SOCK_CLOSURE) { - params.add_item("Closure", [](LinkSearchOpParams ¶ms) { + params.add_item(IFACE_("Closure"), [](LinkSearchOpParams ¶ms) { bNode &node = params.add_node("NodeEvaluateClosure"); params.connect_available_socket(node, "Closure"); @@ -184,7 +184,7 @@ static void node_gather_link_searches(GatherLinkSearchOpParams ¶ms) params.node_tree().type)) { params.add_item( - "Item", + IFACE_("Item"), [](LinkSearchOpParams ¶ms) { bNode &node = params.add_node("NodeEvaluateClosure"); const auto *item = diff --git a/source/blender/nodes/geometry/nodes/node_geo_separate_bundle.cc b/source/blender/nodes/geometry/nodes/node_geo_separate_bundle.cc index 6730352bdb9..5dd6267185a 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_separate_bundle.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_separate_bundle.cc @@ -202,7 +202,7 @@ static void node_gather_link_searches(GatherLinkSearchOpParams ¶ms) { return; } - params.add_item("Item", [](LinkSearchOpParams ¶ms) { + params.add_item(IFACE_("Item"), [](LinkSearchOpParams ¶ms) { bNode &node = params.add_node("NodeSeparateBundle"); const auto *item = socket_items::add_item_with_socket_type_and_name( @@ -214,7 +214,7 @@ static void node_gather_link_searches(GatherLinkSearchOpParams ¶ms) if (other_socket.type != SOCK_BUNDLE) { return; } - params.add_item("Bundle", [](LinkSearchOpParams ¶ms) { + params.add_item(IFACE_("Bundle"), [](LinkSearchOpParams ¶ms) { bNode &node = params.add_node("NodeSeparateBundle"); params.connect_available_socket(node, "Bundle"); diff --git a/source/blender/nodes/geometry/nodes/node_geo_viewer.cc b/source/blender/nodes/geometry/nodes/node_geo_viewer.cc index 73418d81f42..a74c8118b96 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_viewer.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_viewer.cc @@ -287,7 +287,7 @@ static void node_gather_link_searches(GatherLinkSearchOpParams ¶ms) { const bNodeSocket &other_socket = params.other_socket(); if (other_socket.in_out == SOCK_OUT) { - params.add_item("Value", [](LinkSearchOpParams ¶ms) { + params.add_item(IFACE_("Value"), [](LinkSearchOpParams ¶ms) { bNode &node = params.add_node("GeometryNodeViewer"); const auto *item = socket_items::add_item_with_socket_type_and_name( params.node_tree, node, params.socket.typeinfo->type, params.socket.name); diff --git a/tests/python/eevee_render_tests.py b/tests/python/eevee_render_tests.py index d6532c7aac2..9d36bd809e3 100644 --- a/tests/python/eevee_render_tests.py +++ b/tests/python/eevee_render_tests.py @@ -260,12 +260,18 @@ def main(): elif test_dir_name.startswith('displacement'): # metal shadow and wireframe difference. To be fixed. report.set_fail_threshold(0.07) + elif test_dir_name.startswith('bsdf'): + # metallic thinfilm tests + report.set_fail_threshold(0.03) + elif test_dir_name.startswith('principled_bsdf'): + # principled bsdf transmission test + report.set_fail_threshold(0.02) # Noise pattern changes depending on platform. Mostly caused by transparency. # TODO(fclem): See if we can just increase number of samples per file. if test_dir_name.startswith('render_layer'): # shadow pass, rlayer flag - report.set_fail_threshold(0.075) + report.set_fail_threshold(0.08) elif test_dir_name.startswith('hair'): # hair close up report.set_fail_threshold(0.0275) @@ -278,6 +284,9 @@ def main(): elif test_dir_name.startswith('light_linking'): # Noise difference in transparent material report.set_fail_threshold(0.05) + elif test_dir_name.startswith('light'): + # Noise difference in background + report.set_fail_threshold(0.02) ok = report.run(args.testdir, args.blender, get_arguments, batch=args.batch) sys.exit(not ok)