From 645ca520a313a9881ee77556fc85820e74f83887 Mon Sep 17 00:00:00 2001 From: William Reynish Date: Sat, 19 Sep 2009 13:50:24 +0000 Subject: [PATCH] Armature UI Added the new pose tools in the toolbar. Changed a few armature values to enums. Brecht: The Heads/Tails enum seems to also enable armature.draw_axis, and the paths_type enum affects armature.draw_names --- release/ui/buttons_data_armature.py | 20 +++++---- release/ui/space_view3d_toolbar.py | 8 ++-- source/blender/makesrna/intern/rna_armature.c | 45 ++++++++++++------- 3 files changed, 46 insertions(+), 27 deletions(-) diff --git a/release/ui/buttons_data_armature.py b/release/ui/buttons_data_armature.py index 5924a2eb4ea..49da9c190ff 100644 --- a/release/ui/buttons_data_armature.py +++ b/release/ui/buttons_data_armature.py @@ -121,28 +121,31 @@ class DATA_PT_paths(DataButtonsPanel): layout = self.layout arm = context.armature - + + layout.itemR(arm, "paths_type", expand=True) + split = layout.split() col = split.column() - col.itemR(arm, "paths_show_around_current_frame", text="Around Frame") sub = col.column(align=True) - if (arm.paths_show_around_current_frame): + if (arm.paths_type == 'CURRENT_FRAME'): sub.itemR(arm, "path_before_current", text="Before") sub.itemR(arm, "path_after_current", text="After") - else: + elif (arm.paths_type == 'RANGE'): sub.itemR(arm, "path_start_frame", text="Start") sub.itemR(arm, "path_end_frame", text="End") - sub.itemR(arm, "path_size", text="Step") - col.itemR(arm, "paths_calculate_head_positions", text="Head") + sub.itemR(arm, "path_size", text="Step") + col.row().itemR(arm, "paths_location", expand=True) col = split.column() col.itemL(text="Show:") col.itemR(arm, "paths_show_frame_numbers", text="Frame Numbers") col.itemR(arm, "paths_highlight_keyframes", text="Keyframes") col.itemR(arm, "paths_show_keyframe_numbers", text="Keyframe Numbers") + + layout.itemO("pose.paths_calculate") class DATA_PT_ghost(DataButtonsPanel): __label__ = "Ghost" @@ -151,11 +154,12 @@ class DATA_PT_ghost(DataButtonsPanel): layout = self.layout arm = context.armature - + + layout.itemR(arm, "ghost_type", expand=True) + split = layout.split() col = split.column() - col.itemR(arm, "ghost_type", text="") sub = col.column(align=True) if arm.ghost_type == 'RANGE': diff --git a/release/ui/space_view3d_toolbar.py b/release/ui/space_view3d_toolbar.py index 9492437b863..415a3e223bb 100644 --- a/release/ui/space_view3d_toolbar.py +++ b/release/ui/space_view3d_toolbar.py @@ -299,11 +299,13 @@ class VIEW3D_PT_tools_posemode(View3DPanel): col.itemL(text="Pose:") col.itemO("pose.copy", text="Copy") col.itemO("pose.paste", text="Paste") + col.itemO("poselib.pose_add", text="Add To library") col = layout.column(align=True) - col.itemL(text="Library:") - col.itemO("poselib.pose_add", text="Add") - col.itemO("poselib.pose_remove", text="Remove") + col.itemL(text="In-Between:") + col.itemO("pose.relax", text="Relax") + col.itemO("pose.push", text="Push") + col.itemO("pose.breakdown", text="Breakdowner") col = layout.column(align=True) col.itemL(text="Repeat:") diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c index dcf89b7ac1e..c271b34b6d4 100644 --- a/source/blender/makesrna/intern/rna_armature.c +++ b/source/blender/makesrna/intern/rna_armature.c @@ -526,15 +526,24 @@ static void rna_def_armature(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_drawtype_items[] = { - {ARM_OCTA, "OCTAHEDRAL", 0, "Octahedral", "Draw bones as octahedral shape (default)."}, - {ARM_LINE, "STICK", 0, "Stick", "Draw bones as simple 2D lines with dots."}, - {ARM_B_BONE, "BBONE", 0, "B-Bone", "Draw bones as boxes, showing subdivision and B-Splines"}, - {ARM_ENVELOPE, "ENVELOPE", 0, "Envelope", "Draw bones as extruded spheres, showing defomation influence volume."}, + {ARM_OCTA, "OCTAHEDRAL", 0, "Octahedral", "Display bones as octahedral shape (default)."}, + {ARM_LINE, "STICK", 0, "Stick", "Display bones as simple 2D lines with dots."}, + {ARM_B_BONE, "BBONE", 0, "B-Bone", "Display bones as boxes, showing subdivision and B-Splines"}, + {ARM_ENVELOPE, "ENVELOPE", 0, "Envelope", "Display bones as extruded spheres, showing defomation influence volume."}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem prop_ghost_type_items[] = { - {ARM_GHOST_CUR, "CURRENT_FRAME", 0, "Around Current Frame", "Draw Ghosts of poses within a fixed number of frames around the current frame."}, - {ARM_GHOST_RANGE, "RANGE", 0, "In Range", "Draw Ghosts of poses within specified range."}, - {ARM_GHOST_KEYS, "KEYS", 0, "On Keyframes", "Draw Ghosts of poses on Keyframes."}, + {ARM_GHOST_CUR, "CURRENT_FRAME", 0, "Around Frame", "Display Ghosts of poses within a fixed number of frames around the current frame."}, + {ARM_GHOST_RANGE, "RANGE", 0, "In Range", "Display Ghosts of poses within specified range."}, + {ARM_GHOST_KEYS, "KEYS", 0, "On Keyframes", "Display Ghosts of poses on Keyframes."}, + {0, NULL, 0, NULL, NULL}}; + static const EnumPropertyItem prop_paths_type_items[]= { + {ARM_PATH_ACFRA, "CURRENT_FRAME", 0, "Around Frame", "Display Paths of poses within a fixed number of frames around the current frame."}, + {0, "RANGE", 0, "In Range", "Display Paths of poses within specified range."}, + {0, NULL, 0, NULL, NULL}}; + + static const EnumPropertyItem prop_paths_location_items[]= { + {ARM_PATH_HEADS, "HEADS", 0, "Heads", "Calculate bone paths from heads"}, + {0, "TIPS", 0, "Tips", "Calculate bone paths from tips"}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "Armature", "ID"); @@ -564,7 +573,19 @@ static void rna_def_armature(BlenderRNA *brna) prop= RNA_def_property(srna, "ghost_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "ghosttype"); RNA_def_property_enum_items(prop, prop_ghost_type_items); - RNA_def_property_ui_text(prop, "Ghost Drawing", "Method of Onion-skinning for active Action"); + RNA_def_property_ui_text(prop, "Ghost Type", "Method of Onion-skinning for active Action"); + RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); + + prop= RNA_def_property(srna, "paths_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); + RNA_def_property_enum_items(prop, prop_paths_type_items); + RNA_def_property_ui_text(prop, "Paths Type", "Mapping type to use for this image in the game engine."); + RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); + + prop= RNA_def_property(srna, "paths_location", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); + RNA_def_property_enum_items(prop, prop_paths_location_items); + RNA_def_property_ui_text(prop, "Paths Location", "When calculating Bone Paths, use Head or Tips"); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); /* Boolean values */ @@ -672,15 +693,7 @@ static void rna_def_armature(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Paths Show Keyframe Numbers", "When drawing Armature in Pose Mode, show frame numbers of Keyframes on Bone Paths"); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); - prop= RNA_def_property(srna, "paths_show_around_current_frame", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "pathflag", ARM_PATH_ACFRA); - RNA_def_property_ui_text(prop, "Paths Around Current Frame", "When drawing Armature in Pose Mode, only show section of Bone Paths that falls around current frame"); - RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); - prop= RNA_def_property(srna, "paths_calculate_head_positions", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "pathflag", ARM_PATH_HEADS); - RNA_def_property_ui_text(prop, "Paths Use Heads", "When calculating Bone Paths, use Head locations instead of Tips"); - RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); /* Number fields */ /* ghost/onionskining settings */