Merge branch 'blender-v5.0-release'

This commit is contained in:
Lukas Tönne
2025-10-16 12:15:44 +02:00
12 changed files with 158 additions and 81 deletions

View File

@@ -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];

View File

@@ -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)

View File

@@ -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);

View File

@@ -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);

View File

@@ -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},
};

View File

@@ -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},
};

View File

@@ -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.

View File

@@ -156,7 +156,7 @@ static void node_gather_link_searches(GatherLinkSearchOpParams &params)
{
return;
}
params.add_item("Item", [](LinkSearchOpParams &params) {
params.add_item(IFACE_("Item"), [](LinkSearchOpParams &params) {
bNode &node = params.add_node("NodeCombineBundle");
const auto *item =
socket_items::add_item_with_socket_type_and_name<CombineBundleItemsAccessor>(
@@ -168,7 +168,7 @@ static void node_gather_link_searches(GatherLinkSearchOpParams &params)
if (other_socket.type != SOCK_BUNDLE) {
return;
}
params.add_item("Bundle", [](LinkSearchOpParams &params) {
params.add_item(IFACE_("Bundle"), [](LinkSearchOpParams &params) {
bNode &node = params.add_node("NodeCombineBundle");
params.connect_available_socket(node, "Bundle");

View File

@@ -162,7 +162,7 @@ static void node_gather_link_searches(GatherLinkSearchOpParams &params)
{
const bNodeSocket &other_socket = params.other_socket();
if (other_socket.in_out == SOCK_IN) {
params.add_item("Item", [](LinkSearchOpParams &params) {
params.add_item(IFACE_("Item"), [](LinkSearchOpParams &params) {
bNode &node = params.add_node("NodeEvaluateClosure");
const auto *item =
socket_items::add_item_with_socket_type_and_name<EvaluateClosureOutputItemsAccessor>(
@@ -172,7 +172,7 @@ static void node_gather_link_searches(GatherLinkSearchOpParams &params)
return;
}
if (other_socket.type == SOCK_CLOSURE) {
params.add_item("Closure", [](LinkSearchOpParams &params) {
params.add_item(IFACE_("Closure"), [](LinkSearchOpParams &params) {
bNode &node = params.add_node("NodeEvaluateClosure");
params.connect_available_socket(node, "Closure");
@@ -184,7 +184,7 @@ static void node_gather_link_searches(GatherLinkSearchOpParams &params)
params.node_tree().type))
{
params.add_item(
"Item",
IFACE_("Item"),
[](LinkSearchOpParams &params) {
bNode &node = params.add_node("NodeEvaluateClosure");
const auto *item =

View File

@@ -202,7 +202,7 @@ static void node_gather_link_searches(GatherLinkSearchOpParams &params)
{
return;
}
params.add_item("Item", [](LinkSearchOpParams &params) {
params.add_item(IFACE_("Item"), [](LinkSearchOpParams &params) {
bNode &node = params.add_node("NodeSeparateBundle");
const auto *item =
socket_items::add_item_with_socket_type_and_name<SeparateBundleItemsAccessor>(
@@ -214,7 +214,7 @@ static void node_gather_link_searches(GatherLinkSearchOpParams &params)
if (other_socket.type != SOCK_BUNDLE) {
return;
}
params.add_item("Bundle", [](LinkSearchOpParams &params) {
params.add_item(IFACE_("Bundle"), [](LinkSearchOpParams &params) {
bNode &node = params.add_node("NodeSeparateBundle");
params.connect_available_socket(node, "Bundle");

View File

@@ -287,7 +287,7 @@ static void node_gather_link_searches(GatherLinkSearchOpParams &params)
{
const bNodeSocket &other_socket = params.other_socket();
if (other_socket.in_out == SOCK_OUT) {
params.add_item("Value", [](LinkSearchOpParams &params) {
params.add_item(IFACE_("Value"), [](LinkSearchOpParams &params) {
bNode &node = params.add_node("GeometryNodeViewer");
const auto *item = socket_items::add_item_with_socket_type_and_name<GeoViewerItemsAccessor>(
params.node_tree, node, params.socket.typeinfo->type, params.socket.name);

View File

@@ -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)