Merge branch 'blender-v4.0-release'
This commit is contained in:
@@ -4799,7 +4799,7 @@ def km_pose(params):
|
||||
op_menu("VIEW3D_MT_bone_options_toggle", {"type": 'W', "value": 'PRESS', "shift": True}),
|
||||
op_menu("VIEW3D_MT_bone_options_enable", {"type": 'W', "value": 'PRESS', "shift": True, "ctrl": True}),
|
||||
op_menu("VIEW3D_MT_bone_options_disable", {"type": 'W', "value": 'PRESS', "alt": True}),
|
||||
("armature.layers_show_all", {"type": 'ACCENT_GRAVE', "value": 'PRESS', "ctrl": True}, None),
|
||||
("armature.collection_show_all", {"type": 'ACCENT_GRAVE', "value": 'PRESS', "ctrl": True}, None),
|
||||
op_menu("VIEW3D_MT_bone_collections", {"type": 'M', "value": 'PRESS', "shift": True}),
|
||||
("armature.move_to_collection", {"type": 'M', "value": 'PRESS'}, None),
|
||||
("transform.bbone_resize", {"type": 'S', "value": 'PRESS', "shift": True, "ctrl": True, "alt": True}, None),
|
||||
@@ -5745,7 +5745,7 @@ def km_edit_armature(params):
|
||||
op_menu("VIEW3D_MT_bone_options_enable", {"type": 'W', "value": 'PRESS', "shift": True, "ctrl": True}),
|
||||
op_menu("VIEW3D_MT_bone_options_disable", {"type": 'W', "value": 'PRESS', "alt": True}),
|
||||
# Armature/bone layers.
|
||||
("armature.layers_show_all", {"type": 'ACCENT_GRAVE', "value": 'PRESS', "ctrl": True}, None),
|
||||
("armature.collection_show_all", {"type": 'ACCENT_GRAVE', "value": 'PRESS', "ctrl": True}, None),
|
||||
op_menu("VIEW3D_MT_bone_collections", {"type": 'M', "value": 'PRESS', "shift": True}),
|
||||
("armature.move_to_collection", {"type": 'M', "value": 'PRESS'}, None),
|
||||
# Special transforms.
|
||||
|
||||
@@ -70,8 +70,6 @@ void ARMATURE_OT_split(struct wmOperatorType *ot);
|
||||
void ARMATURE_OT_autoside_names(struct wmOperatorType *ot);
|
||||
void ARMATURE_OT_flip_names(struct wmOperatorType *ot);
|
||||
|
||||
void ARMATURE_OT_layers_show_all(struct wmOperatorType *ot);
|
||||
|
||||
void ARMATURE_OT_collection_add(struct wmOperatorType *ot);
|
||||
void ARMATURE_OT_collection_remove(struct wmOperatorType *ot);
|
||||
void ARMATURE_OT_collection_move(struct wmOperatorType *ot);
|
||||
|
||||
@@ -59,8 +59,6 @@ void ED_operatortypes_armature()
|
||||
WM_operatortype_append(ARMATURE_OT_autoside_names);
|
||||
WM_operatortype_append(ARMATURE_OT_flip_names);
|
||||
|
||||
WM_operatortype_append(ARMATURE_OT_layers_show_all);
|
||||
|
||||
WM_operatortype_append(ARMATURE_OT_collection_add);
|
||||
WM_operatortype_append(ARMATURE_OT_collection_remove);
|
||||
WM_operatortype_append(ARMATURE_OT_collection_move);
|
||||
|
||||
@@ -665,87 +665,6 @@ void POSE_OT_rotation_mode_set(wmOperatorType *ot)
|
||||
ot->srna, "type", rna_enum_object_rotation_mode_items, 0, "Rotation Mode", "");
|
||||
}
|
||||
|
||||
/* ********************************************** */
|
||||
|
||||
static bool armature_layers_poll(bContext *C)
|
||||
{
|
||||
/* Armature layers operators can be used in posemode OR editmode for armatures */
|
||||
return ED_operator_posemode(C) || ED_operator_editarmature(C);
|
||||
}
|
||||
|
||||
static bArmature *armature_layers_get_data(Object **ob)
|
||||
{
|
||||
bArmature *arm = nullptr;
|
||||
|
||||
/* Sanity checking and handling of posemode. */
|
||||
if (*ob) {
|
||||
Object *tob = BKE_object_pose_armature_get(*ob);
|
||||
if (tob) {
|
||||
*ob = tob;
|
||||
arm = static_cast<bArmature *>((*ob)->data);
|
||||
}
|
||||
else if ((*ob)->type == OB_ARMATURE) {
|
||||
arm = static_cast<bArmature *>((*ob)->data);
|
||||
}
|
||||
}
|
||||
|
||||
return arm;
|
||||
}
|
||||
|
||||
/* Show all armature layers */
|
||||
|
||||
static int pose_armature_layers_showall_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
Object *ob = CTX_data_active_object(C);
|
||||
bArmature *arm = armature_layers_get_data(&ob);
|
||||
int maxLayers = RNA_boolean_get(op->ptr, "all") ? 32 : 16;
|
||||
/* hardcoded for now - we can only have 32 armature layers, so this should be fine... */
|
||||
bool layers[32] = {false};
|
||||
|
||||
/* sanity checking */
|
||||
if (arm == nullptr) {
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
/* use RNA to set the layers
|
||||
* although it would be faster to just set directly using bitflags, we still
|
||||
* need to setup a RNA pointer so that we get the "update" callbacks for free...
|
||||
*/
|
||||
PointerRNA ptr = RNA_id_pointer_create(&arm->id);
|
||||
|
||||
for (int i = 0; i < maxLayers; i++) {
|
||||
layers[i] = true;
|
||||
}
|
||||
|
||||
RNA_boolean_set_array(&ptr, "layers", layers);
|
||||
|
||||
/* NOTE: notifier might evolve. */
|
||||
WM_event_add_notifier(C, NC_OBJECT | ND_POSE, ob);
|
||||
DEG_id_tag_update(&arm->id, ID_RECALC_COPY_ON_WRITE);
|
||||
|
||||
/* done */
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
void ARMATURE_OT_layers_show_all(wmOperatorType *ot)
|
||||
{
|
||||
/* identifiers */
|
||||
ot->name = "Show All Layers";
|
||||
ot->idname = "ARMATURE_OT_layers_show_all";
|
||||
ot->description = "Make all armature layers visible";
|
||||
|
||||
/* callbacks */
|
||||
ot->exec = pose_armature_layers_showall_exec;
|
||||
ot->poll = armature_layers_poll;
|
||||
|
||||
/* flags */
|
||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||
|
||||
/* properties */
|
||||
ot->prop = RNA_def_boolean(
|
||||
ot->srna, "all", true, "All Layers", "Enable all layers or just the first 16 (top row)");
|
||||
}
|
||||
|
||||
/* ********************************************** */
|
||||
/* Show/Hide Bones */
|
||||
|
||||
|
||||
@@ -45,6 +45,8 @@
|
||||
|
||||
#include "ED_undo.hh"
|
||||
|
||||
#include "WM_api.hh"
|
||||
|
||||
using blender::nodes::NodeDeclaration;
|
||||
|
||||
namespace blender::ed::space_node {
|
||||
@@ -775,6 +777,9 @@ static void node_panel_toggle_button_cb(bContext *C, void *panel_state_argv, voi
|
||||
panel_state->flag ^= NODE_PANEL_COLLAPSED;
|
||||
|
||||
ED_node_tree_propagate_change(C, bmain, ntree);
|
||||
|
||||
/* Make sure panel state updates from the Properties Editor, too. */
|
||||
WM_event_add_notifier(C, NC_SPACE | ND_SPACE_NODE_VIEW, nullptr);
|
||||
}
|
||||
|
||||
static void ui_node_draw_panel(uiLayout &layout,
|
||||
|
||||
Reference in New Issue
Block a user