Merge branch 'blender-v5.0-release'
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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},
|
||||
};
|
||||
|
||||
|
||||
@@ -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},
|
||||
};
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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<CombineBundleItemsAccessor>(
|
||||
@@ -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");
|
||||
|
||||
|
||||
@@ -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<EvaluateClosureOutputItemsAccessor>(
|
||||
@@ -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 =
|
||||
|
||||
@@ -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<SeparateBundleItemsAccessor>(
|
||||
@@ -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");
|
||||
|
||||
|
||||
@@ -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<GeoViewerItemsAccessor>(
|
||||
params.node_tree, node, params.socket.typeinfo->type, params.socket.name);
|
||||
|
||||
Reference in New Issue
Block a user