diff options
-rw-r--r-- | release/ui/space_view3d.py | 463 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_header.c | 238 |
2 files changed, 482 insertions, 219 deletions
diff --git a/release/ui/space_view3d.py b/release/ui/space_view3d.py index 20c949889e0..1a5dd6b148c 100644 --- a/release/ui/space_view3d.py +++ b/release/ui/space_view3d.py @@ -11,7 +11,8 @@ class VIEW3D_HT_header(bpy.types.Header): view = context.space_data mode_string = context.mode - + edit_object = context.edit_object + layout.template_header() # Menus @@ -29,6 +30,8 @@ class VIEW3D_HT_header(bpy.types.Header): row.itemM("VIEW3D_MT_object") elif mode_string == 'SCULPT': row.itemM("VIEW3D_MT_sculpt") + elif edit_object: + row.itemM("VIEW3D_MT_edit_%s" % edit_object.type) layout.template_header_3D() @@ -500,6 +503,436 @@ class VIEW3D_MT_sculpt(bpy.types.Menu): layout.itemR(brush, "persistent") layout.itemO("sculpt.set_persistent_base") +# ********** Edit Menus, suffix from ob.type ********** + +class VIEW3D_MT_edit_snap(bpy.types.Menu): + __space_type__ = "VIEW_3D" + __label__ = "Snap" + + def draw(self, context): + layout = self.layout + + layout.itemO("view3d.snap_selected_to_grid") + layout.itemO("view3d.snap_selected_to_cursor") + layout.itemO("view3d.snap_selected_to_center") + + layout.itemS() + + layout.itemO("view3d.snap_cursor_to_selected") + layout.itemO("view3d.snap_cursor_to_grid") + layout.itemO("view3d.snap_cursor_to_active") + +# Edit MESH +class VIEW3D_MT_edit_MESH(bpy.types.Menu): + __space_type__ = "VIEW_3D" + __label__ = "Mesh" + + def draw(self, context): + layout = self.layout + + settings = context.tool_settings + + layout.itemO("ed.undo") + layout.itemO("ed.redo") + + layout.itemS() + + layout.itemM("VIEW3D_MT_edit_snap") + + layout.itemS() + + layout.itemO("uv.mapping_menu") + + layout.itemS() + + layout.itemO("mesh.extrude") + layout.itemO("mesh.duplicate") + layout.itemO("mesh.delete") + + layout.itemS() + + layout.itemM("VIEW3D_MT_edit_MESH_vertices") + layout.itemM("VIEW3D_MT_edit_MESH_edges") + layout.itemM("VIEW3D_MT_edit_MESH_faces") + layout.itemM("VIEW3D_MT_edit_MESH_normals") + + layout.itemS() + + layout.itemR(settings, "automerge_editing") + layout.itemR(settings, "proportional_editing") + layout.item_menu_enumR(settings, "proportional_editing_falloff") + + layout.itemS() + + layout.itemM("VIEW3D_MT_edit_MESH_showhide") + +class VIEW3D_MT_edit_MESH_vertices(bpy.types.Menu): + __space_type__ = "VIEW_3D" + __label__ = "Vertices" + + def draw(self, context): + layout = self.layout + + layout.itemO("mesh.merge") + layout.itemO("mesh.rip") + layout.itemO("mesh.split") + layout.itemO("mesh.separate") + + layout.itemS() + + layout.itemO("mesh.vertices_smooth") + layout.itemO("mesh.remove_doubles") + +class VIEW3D_MT_edit_MESH_edges(bpy.types.Menu): + __space_type__ = "VIEW_3D" + __label__ = "Edges" + + def draw(self, context): + layout = self.layout + + layout.itemO("mesh.edge_face_add") + layout.itemO("mesh.subdivide") + layout.item_floatO("mesh.subdivide", "smoothness", 1.0, text="Subdivide Smooth") + + layout.itemS() + + layout.itemO("mesh.mark_seam") + layout.item_booleanO("mesh.mark_seam", "clear", True, text="Clear Seam") + + layout.itemS() + + layout.itemO("mesh.mark_sharp") + layout.item_booleanO("mesh.mark_sharp", "clear", True, text="Clear Sharp") + + layout.itemS() + + layout.item_enumO("mesh.edge_rotate", "direction", 'CW', text="Rotate Edge CW") + layout.item_enumO("mesh.edge_rotate", "direction", 'CCW', text="Rotate Edge CCW") + +class VIEW3D_MT_edit_MESH_faces(bpy.types.Menu): + __space_type__ = "VIEW_3D" + __label__ = "Faces" + + def draw(self, context): + layout = self.layout + + layout.itemO("mesh.edge_face_add") + layout.itemO("mesh.fill") + layout.itemO("mesh.beauty_fill") + + layout.itemS() + + layout.itemO("mesh.quads_convert_to_tris") + layout.itemO("mesh.tris_convert_to_quads") + layout.itemO("mesh.edge_flip") + + layout.itemS() + + layout.itemO("mesh.faces_shade_smooth") + layout.itemO("mesh.faces_shade_flat") + +class VIEW3D_MT_edit_MESH_normals(bpy.types.Menu): + __space_type__ = "VIEW_3D" + __label__ = "Normals" + + def draw(self, context): + layout = self.layout + + layout.itemO("mesh.normals_make_consistent", text="Recalculate Outside") + layout.item_booleanO("mesh.normals_make_consistent", "inside", True, text="Recalculate Inside") + + layout.itemS() + + layout.itemO("mesh.flip_normals") + +class VIEW3D_MT_edit_MESH_showhide(bpy.types.Menu): + __space_type__ = "VIEW_3D" + __label__ = "Show/Hide" + + def draw(self, context): + layout = self.layout + + layout.itemO("mesh.reveal") + layout.itemO("mesh.hide") + layout.item_booleanO("mesh.hide", "unselected", True, text="Hide Unselected") + +# Edit CURVE + +# draw_CURVE is used by VIEW3D_MT_edit_CURVE and VIEW3D_MT_edit_SURFACE +def draw_CURVE(self, context): + layout = self.layout + + settings = context.tool_settings + + layout.itemM("VIEW3D_MT_edit_snap") + + layout.itemS() + + layout.itemO("curve.extrude") + layout.itemO("curve.duplicate") + layout.itemO("curve.separate") + layout.itemO("curve.make_segment") + layout.itemO("curve.cyclic_toggle") + layout.itemO("curve.delete") + + layout.itemS() + + layout.itemM("VIEW3D_MT_edit_CURVE_ctrlpoints") + layout.itemM("VIEW3D_MT_edit_CURVE_segments") + + layout.itemS() + + layout.itemR(settings, "proportional_editing") + layout.item_menu_enumR(settings, "proportional_editing_falloff") + + layout.itemS() + + layout.itemM("VIEW3D_MT_edit_CURVE_showhide") + +class VIEW3D_MT_edit_CURVE(bpy.types.Menu): + __space_type__ = "VIEW_3D" + __label__ = "Curve" + + draw = draw_CURVE + +class VIEW3D_MT_edit_CURVE_ctrlpoints(bpy.types.Menu): + __space_type__ = "VIEW_3D" + __label__ = "Control Points" + + def draw(self, context): + layout = self.layout + + edit_object = context.edit_object + + if edit_object.type == 'CURVE': + layout.item_enumO("tfm.transform", "mode", 'TILT') + layout.itemO("curve.tilt_clear") + layout.itemO("curve.separate") + + layout.itemS() + + layout.item_menu_enumO("curve.handle_type_set", "type") + +class VIEW3D_MT_edit_CURVE_segments(bpy.types.Menu): + __space_type__ = "VIEW_3D" + __label__ = "Segments" + + def draw(self, context): + layout = self.layout + + layout.itemO("curve.subdivide") + layout.itemO("curve.switch_direction") + +class VIEW3D_MT_edit_CURVE_showhide(bpy.types.Menu): + __space_type__ = "VIEW_3D" + __label__ = "Show/Hide" + + def draw(self, context): + layout = self.layout + + layout.itemO("curve.reveal") + layout.itemO("curve.hide") + layout.item_booleanO("curve.hide", "unselected", True, text="Hide Unselected") + +# Edit SURFACE +class VIEW3D_MT_edit_SURFACE(bpy.types.Menu): + __space_type__ = "VIEW_3D" + __label__ = "Surface" + + draw = draw_CURVE + +# Edit TEXT +class VIEW3D_MT_edit_TEXT(bpy.types.Menu): + __space_type__ = "VIEW_3D" + __label__ = "Text" + + def draw(self, context): + layout = self.layout + + layout.itemO("font.file_paste") + + layout.itemS() + + layout.itemM("VIEW3D_MT_edit_TEXT_chars") + +class VIEW3D_MT_edit_TEXT_chars(bpy.types.Menu): + __space_type__ = "VIEW_3D" + __label__ = "Special Characters" + + def draw(self, context): + layout = self.layout + + layout.item_stringO("font.text_insert", "text", b'\xC2\xA9'.decode(), text="Copyright|Alt C") + layout.item_stringO("font.text_insert", "text", b'\xC2\xAE'.decode(), text="Registered Trademark|Alt R") + + layout.itemS() + + layout.item_stringO("font.text_insert", "text", b'\xC2\xB0'.decode(), text="Degree Sign|Alt G") + layout.item_stringO("font.text_insert", "text", b'\xC3\x97'.decode(), text="Multiplication Sign|Alt x") + layout.item_stringO("font.text_insert", "text", b'\xC2\x8A'.decode(), text="Circle|Alt .") + layout.item_stringO("font.text_insert", "text", b'\xC2\xB9'.decode(), text="Superscript 1|Alt 1") + layout.item_stringO("font.text_insert", "text", b'\xC2\xB2'.decode(), text="Superscript 2|Alt 2") + layout.item_stringO("font.text_insert", "text", b'\xC2\xB3'.decode(), text="Superscript 3|Alt 3") + layout.item_stringO("font.text_insert", "text", b'\xC2\xBB'.decode(), text="Double >>|Alt >") + layout.item_stringO("font.text_insert", "text", b'\xC2\xAB'.decode(), text="Double <<|Alt <") + layout.item_stringO("font.text_insert", "text", b'\xE2\x80\xB0'.decode(), text="Promillage|Alt %") + + layout.itemS() + + layout.item_stringO("font.text_insert", "text", b'\xC2\xA4'.decode(), text="Dutch Florin|Alt F") + layout.item_stringO("font.text_insert", "text", b'\xC2\xA3'.decode(), text="British Pound|Alt L") + layout.item_stringO("font.text_insert", "text", b'\xC2\xA5'.decode(), text="Japanese Yen|Alt Y") + + layout.itemS() + + layout.item_stringO("font.text_insert", "text", b'\xC3\x9F'.decode(), text="German S|Alt S") + layout.item_stringO("font.text_insert", "text", b'\xC2\xBF'.decode(), text="Spanish Question Mark|Alt ?") + layout.item_stringO("font.text_insert", "text", b'\xC2\xA1'.decode(), text="Spanish Exclamation Mark|Alt !") + +# Edit META +class VIEW3D_MT_edit_META(bpy.types.Menu): + __space_type__ = "VIEW_3D" + __label__ = "Metaball" + + def draw(self, context): + layout = self.layout + + settings = context.tool_settings + + layout.itemO("ed.undo") + layout.itemO("ed.redo") + + layout.itemS() + + layout.itemM("VIEW3D_MT_edit_snap") + + layout.itemS() + + layout.itemO("mball.delete_metaelems") + layout.itemO("mball.duplicate_metaelems") + + layout.itemS() + + layout.itemR(settings, "proportional_editing") + layout.item_menu_enumR(settings, "proportional_editing_falloff") + + layout.itemS() + + layout.itemM("VIEW3D_MT_edit_META_showhide") + +class VIEW3D_MT_edit_META_showhide(bpy.types.Menu): + __space_type__ = "VIEW_3D" + __label__ = "Show/Hide" + + def draw(self, context): + layout = self.layout + + layout.itemO("mball.reveal_metaelems") + layout.itemO("mball.hide_metaelems") + layout.item_booleanO("mball.hide_metaelems", "unselected", True, text="Hide Unselected") + +# Edit LATTICE +class VIEW3D_MT_edit_LATTICE(bpy.types.Menu): + __space_type__ = "VIEW_3D" + __label__ = "Lattice" + + def draw(self, context): + layout = self.layout + + settings = context.tool_settings + + layout.itemM("VIEW3D_MT_edit_snap") + + layout.itemS() + + layout.itemO("lattice.make_regular") + + layout.itemS() + + layout.itemR(settings, "proportional_editing") + layout.item_menu_enumR(settings, "proportional_editing_falloff") + +# Edit ARMATURE +class VIEW3D_MT_edit_ARMATURE(bpy.types.Menu): + __space_type__ = "VIEW_3D" + __label__ = "Armature" + + def draw(self, context): + layout = self.layout + + edit_object = context.edit_object + arm = edit_object.data + + layout.itemM("VIEW3D_MT_edit_snap") + layout.itemM("VIEW3D_MT_edit_ARMATURE_roll") + + if arm.drawtype == 'ENVELOPE': + layout.item_enumO("tfm.transform", "mode", 'BONESIZE', text="Scale Envelope Distance") + else: + layout.item_enumO("tfm.transform", "mode", 'BONESIZE', text="Scale B-Bone Width") + + layout.itemS() + + layout.itemO("armature.extrude") + + if arm.x_axis_mirror: + layout.item_booleanO("armature.extrude", "forked", True, text="Extrude Forked") + + layout.itemO("armature.duplicate") + layout.itemO("armature.merge") + layout.itemO("armature.fill") + layout.itemO("armature.delete") + layout.itemO("armature.separate") + + layout.itemS() + + layout.itemO("armature.subdivide_simple") + layout.itemO("armature.subdivide_multi") + + layout.itemS() + + layout.item_enumO("armature.autoside_names", "axis", 'XAXIS', text="AutoName Left/Right") + layout.item_enumO("armature.autoside_names", "axis", 'YAXIS', text="AutoName Front/Back") + layout.item_enumO("armature.autoside_names", "axis", 'ZAXIS', text="AutoName Top/Bottom") + layout.itemO("armature.flip_names") + + layout.itemS() + + layout.itemO("armature.armature_layers") + layout.itemO("armature.bone_layers") + + layout.itemS() + + layout.itemM("VIEW3D_MT_edit_ARMATURE_parent") + + layout.itemS() + + layout.item_menu_enumO("armature.flags_set", "mode", text="Bone Settings") + +class VIEW3D_MT_edit_ARMATURE_parent(bpy.types.Menu): + __space_type__ = "VIEW_3D" + __label__ = "Parent" + + def draw(self, context): + layout = self.layout + + layout.itemO("armature.parent_set") + layout.itemO("armature.parent_clear") + +class VIEW3D_MT_edit_ARMATURE_roll(bpy.types.Menu): + __space_type__ = "VIEW_3D" + __label__ = "Bone Roll" + + def draw(self, context): + layout = self.layout + + layout.item_enumO("armature.calculate_roll", "type", 'GLOBALUP', text="Clear Roll (Z-Axis Up)") + layout.item_enumO("armature.calculate_roll", "type", 'CURSOR', text="Roll to Cursor") + + layout.itemS() + + layout.item_enumO("tfm.transform", "mode", 'BONE_ROLL', text="Set Roll") + # ********** Panel ********** class VIEW3D_PT_3dview_properties(bpy.types.Panel): @@ -630,6 +1063,34 @@ bpy.types.register(VIEW3D_MT_object_show) bpy.types.register(VIEW3D_MT_sculpt) # Sculpt Menu +bpy.types.register(VIEW3D_MT_edit_snap) # Edit Menus + +bpy.types.register(VIEW3D_MT_edit_MESH) +bpy.types.register(VIEW3D_MT_edit_MESH_vertices) +bpy.types.register(VIEW3D_MT_edit_MESH_edges) +bpy.types.register(VIEW3D_MT_edit_MESH_faces) +bpy.types.register(VIEW3D_MT_edit_MESH_normals) +bpy.types.register(VIEW3D_MT_edit_MESH_showhide) + +bpy.types.register(VIEW3D_MT_edit_CURVE) +bpy.types.register(VIEW3D_MT_edit_CURVE_ctrlpoints) +bpy.types.register(VIEW3D_MT_edit_CURVE_segments) +bpy.types.register(VIEW3D_MT_edit_CURVE_showhide) + +bpy.types.register(VIEW3D_MT_edit_SURFACE) + +bpy.types.register(VIEW3D_MT_edit_TEXT) +bpy.types.register(VIEW3D_MT_edit_TEXT_chars) + +bpy.types.register(VIEW3D_MT_edit_META) +bpy.types.register(VIEW3D_MT_edit_META_showhide) + +bpy.types.register(VIEW3D_MT_edit_LATTICE) + +bpy.types.register(VIEW3D_MT_edit_ARMATURE) +bpy.types.register(VIEW3D_MT_edit_ARMATURE_parent) +bpy.types.register(VIEW3D_MT_edit_ARMATURE_roll) + bpy.types.register(VIEW3D_PT_3dview_properties) # Panels bpy.types.register(VIEW3D_PT_3dview_display) bpy.types.register(VIEW3D_PT_background_image) diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index 076a0ecf253..2a7b718a664 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -1872,6 +1872,8 @@ static void do_view3d_edit_objectmenu(bContext *C, void *arg, int event) } #endif +#if 0 +/* visible buttons ported to python, check ifedout buttons */ static void view3d_edit_mesh_verticesmenu(bContext *C, uiLayout *layout, void *arg_unused) { uiItemO(layout, "Merge...", 0, "MESH_OT_merge"); @@ -1891,45 +1893,10 @@ static void view3d_edit_mesh_verticesmenu(bContext *C, uiLayout *layout, void *a uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add Hook|Ctrl H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); // make_parent(); #endif } - -void do_view3d_edit_mesh_edgesmenu(bContext *C, void *arg, int event) -{ -#if 0 - Scene *scene= CTX_data_scene(C); - float fac; - short randfac; - - switch(event) { - case 9: /* Crease SubSurf */ - if(!multires_level1_test()) { - initTransform(TFM_CREASE, CTX_EDGE); - Transform(); - } - break; - case 12: /* Edgeslide */ - EdgeSlide(0,0.0); - break; - case 13: /* Edge Loop Delete */ - if(EdgeLoopDelete()) { - countall(); - ED_undo_push(C, "Erase Edge Loop"); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - } - break; - case 14: /*Collapse Edges*/ - collapseEdges(); - ED_undo_push(C, "Collapse"); - break; - case 17: /* Adjust Bevel Weight */ - if(!multires_level1_test()) { - initTransform(TFM_BWEIGHT, CTX_EDGE); - Transform(); - } - break; - } #endif -} +#if 0 +/* visible buttons ported to python, check ifedout buttons */ static void view3d_edit_mesh_edgesmenu(bContext *C, uiLayout *layout, void *arg_unused) { uiItemO(layout, NULL, 0, "MESH_OT_edge_face_add"); @@ -1976,34 +1943,7 @@ static void view3d_edit_mesh_edgesmenu(bContext *C, uiLayout *layout, void *arg_ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Collapse", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 14, ""); #endif } - -static void view3d_edit_mesh_facesmenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - uiItemO(layout, NULL, 0, "MESH_OT_edge_face_add"); - uiItemO(layout, NULL, 0, "MESH_OT_fill"); - uiItemO(layout, NULL, 0, "MESH_OT_beauty_fill"); - - uiItemS(layout); - - uiItemO(layout, NULL, 0, "MESH_OT_quads_convert_to_tris"); - uiItemO(layout, NULL, 0, "MESH_OT_tris_convert_to_quads"); - uiItemO(layout, NULL, 0, "MESH_OT_edge_flip"); - - uiItemS(layout); - - uiItemO(layout, NULL, 0, "MESH_OT_faces_shade_smooth"); - uiItemO(layout, NULL, 0, "MESH_OT_faces_shade_flat"); -} - -static void view3d_edit_mesh_normalsmenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - uiItemO(layout, "Recalculate Outside", 0, "MESH_OT_normals_make_consistent"); - uiItemBooleanO(layout, "Recalculate Inside", 0, "MESH_OT_normals_make_consistent", "inside", 1); - - uiItemS(layout); - - uiItemO(layout, NULL, 0, "MESH_OT_flip_normals"); -} +#endif #if 0 void do_view3d_edit_mirrormenu(bContext *C, void *arg, int event) @@ -2078,13 +2018,6 @@ static uiBlock *view3d_edit_mirrormenu(bContext *C, ARegion *ar, void *arg_unuse } #endif -static void view3d_edit_mesh_showhidemenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - uiItemO(layout, NULL, 0, "MESH_OT_reveal"); - uiItemO(layout, NULL, 0, "MESH_OT_hide"); - uiItemBooleanO(layout, "Hide Unselected", 0, "MESH_OT_hide", "unselected", 1); -} - #ifndef DISABLE_PYTHON #if 0 static void do_view3d_edit_mesh_scriptsmenu(bContext *C, void *arg, int event) @@ -2134,6 +2067,8 @@ static void do_view3d_edit_meshmenu(bContext *C, void *arg, int event) } #endif +#if 0 +/* visible buttons ported to python, check ifedout buttons */ static void view3d_edit_meshmenu(bContext *C, uiLayout *layout, void *arg_unused) { Scene *scene= CTX_data_scene(C); @@ -2200,7 +2135,10 @@ static void view3d_edit_meshmenu(bContext *C, uiLayout *layout, void *arg_unused #endif #endif } +#endif +#if 0 +/* visible buttons ported to python, check ifedout buttons */ static void view3d_edit_curve_controlpointsmenu(bContext *C, uiLayout *layout, void *arg_unused) { Object *obedit= CTX_data_edit_object(C); @@ -2224,20 +2162,10 @@ static void view3d_edit_curve_controlpointsmenu(bContext *C, uiLayout *layout, v // XXX uiItemO(layout, NULL, 0, "OBJECT_OT_add_hook"); Add Hook| Ctrl H // add_hook_menu() } +#endif -static void view3d_edit_curve_segmentsmenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - uiItemO(layout, NULL, 0, "CURVE_OT_subdivide"); - uiItemO(layout, NULL, 0, "CURVE_OT_switch_direction"); -} - -static void view3d_edit_curve_showhidemenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - uiItemO(layout, NULL, 0, "CURVE_OT_reveal"); - uiItemO(layout, NULL, 0, "CURVE_OT_hide"); - uiItemBooleanO(layout, "Hide Unselected", 0, "CURVE_OT_hide", "unselected", 1); -} - +#if 0 +/* visible buttons ported to python, check ifedout buttons */ static void view3d_edit_curvemenu(bContext *C, uiLayout *layout, void *arg_unused) { Scene *scene= CTX_data_scene(C); @@ -2283,83 +2211,10 @@ static void view3d_edit_curvemenu(bContext *C, uiLayout *layout, void *arg_unuse uiItemMenuF(layout, "Show/Hide Control Points", 0, view3d_edit_curve_showhidemenu); } +#endif -static void view3d_edit_metaball_showhidemenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - uiItemO(layout, NULL, 0, "MBALL_OT_hide_metaelems"); - uiItemO(layout, NULL, 0, "MBALL_OT_reveal_metaelems"); - uiItemBooleanO(layout, "Hide Unselected", 0, "MBALL_OT_hide_metaelems", "unselected", 1); -} - -static void view3d_edit_metaballmenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - Scene *scene= CTX_data_scene(C); - ToolSettings *ts= CTX_data_tool_settings(C); - PointerRNA tsptr; - - RNA_pointer_create(&scene->id, &RNA_ToolSettings, ts, &tsptr); - - uiItemO(layout, "Undo Editing", 0, "ED_OT_undo"); - uiItemO(layout, "Redo Editing", 0, "ED_OT_redo"); - - uiItemS(layout); - - uiItemMenuF(layout, "Snap", 0, view3d_edit_snapmenu); - - uiItemS(layout); - - uiItemO(layout, NULL, 0, "MBALL_OT_delete_metaelems"); - uiItemO(layout, NULL, 0, "MBALL_OT_duplicate_metaelems"); - - uiItemS(layout); - - uiItemR(layout, NULL, 0, &tsptr, "proportional_editing", 0, 0, 0); // |O - uiItemMenuEnumR(layout, NULL, 0, &tsptr, "proportional_editing_falloff"); // |Shift O - - uiItemS(layout); - - uiItemMenuF(layout, "Show/Hide Control Points", 0, view3d_edit_metaball_showhidemenu); -} - -static void view3d_edit_text_charsmenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - /* the character codes are specified in UTF-8 */ - - uiItemStringO(layout, "Copyright|Alt C", 0, "FONT_OT_text_insert", "text", "\xC2\xA9"); - uiItemStringO(layout, "Registered Trademark|Alt R", 0, "FONT_OT_text_insert", "text", "\xC2\xAE"); - - uiItemS(layout); - - uiItemStringO(layout, "Degree Sign|Alt G", 0, "FONT_OT_text_insert", "text", "\xC2\xB0"); - uiItemStringO(layout, "Multiplication Sign|Alt x", 0, "FONT_OT_text_insert", "text", "\xC3\x97"); - uiItemStringO(layout, "Circle|Alt .", 0, "FONT_OT_text_insert", "text", "\xC2\x8A"); - uiItemStringO(layout, "Superscript 1|Alt 1", 0, "FONT_OT_text_insert", "text", "\xC2\xB9"); - uiItemStringO(layout, "Superscript 2|Alt 2", 0, "FONT_OT_text_insert", "text", "\xC2\xB2"); - uiItemStringO(layout, "Superscript 3|Alt 3", 0, "FONT_OT_text_insert", "text", "\xC2\xB3"); - uiItemStringO(layout, "Double >>|Alt >", 0, "FONT_OT_text_insert", "text", "\xC2\xBB"); - uiItemStringO(layout, "Double <<|Alt <", 0, "FONT_OT_text_insert", "text", "\xC2\xAB"); - uiItemStringO(layout, "Promillage|Alt %", 0, "FONT_OT_text_insert", "text", "\xE2\x80\xB0"); - - uiItemS(layout); - - uiItemStringO(layout, "Dutch Florin|Alt F", 0, "FONT_OT_text_insert", "text", "\xC2\xA4"); - uiItemStringO(layout, "British Pound|Alt L", 0, "FONT_OT_text_insert", "text", "\xC2\xA3"); - uiItemStringO(layout, "Japanese Yen|Alt Y", 0, "FONT_OT_text_insert", "text", "\xC2\xA5"); - - uiItemS(layout); - - uiItemStringO(layout, "German S|Alt S", 0, "FONT_OT_text_insert", "text", "\xC3\x9F"); - uiItemStringO(layout, "Spanish Question Mark|Alt ?", 0, "FONT_OT_text_insert", "text", "\xC2\xBF"); - uiItemStringO(layout, "Spanish Exclamation Mark|Alt !", 0, "FONT_OT_text_insert", "text", "\xC2\xA1"); -} - -static void view3d_edit_textmenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - uiItemO(layout, NULL, 0, "FONT_OT_file_paste"); - uiItemS(layout); - uiItemMenuF(layout, "Special Characters", 0, view3d_edit_text_charsmenu); -} - +#if 0 +/* visible buttons ported to python, check ifedout buttons */ static void view3d_edit_latticemenu(bContext *C, uiLayout *layout, void *arg_unused) { Scene *scene= CTX_data_scene(C); @@ -2393,32 +2248,7 @@ static void view3d_edit_latticemenu(bContext *C, uiLayout *layout, void *arg_unu uiItemR(layout, NULL, 0, &tsptr, "proportional_editing", 0, 0, 0); // |O uiItemMenuEnumR(layout, NULL, 0, &tsptr, "proportional_editing_falloff"); // |Shift O } - - -static void view3d_edit_armature_parentmenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - uiItemO(layout, NULL, 0, "ARMATURE_OT_parent_set"); - uiItemO(layout, NULL, 0, "ARMATURE_OT_parent_clear"); -} - -static void view3d_edit_armature_rollmenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - /* 0 = 'Global', 1 = 'Cursor' */ - // TODO: keep these in sync... - uiItemEnumO(layout, "Clear Roll (Z-Axis Up)", 0, "ARMATURE_OT_calculate_roll", "type", 0); - uiItemEnumO(layout, "Roll to Cursor", 0, "ARMATURE_OT_calculate_roll", "type", 1); - - uiItemS(layout); - - uiItemEnumO(layout, "Set Roll", 0, "TFM_OT_transform", "mode", TFM_BONE_ROLL); -} - -static void view3d_edit_armature_settingsmenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - uiItemEnumO(layout, "Toggle a Setting", 0, "ARMATURE_OT_flags_set", "mode", 2); - uiItemEnumO(layout, "Enable a Setting", 0, "ARMATURE_OT_flags_set", "mode", 1); - uiItemEnumO(layout, "Disable a Setting", 0, "ARMATURE_OT_flags_set", "mode", 0); -} +#endif #if 0 static void do_view3d_edit_armaturemenu(bContext *C, void *arg, int event) @@ -2444,6 +2274,8 @@ static void do_view3d_edit_armaturemenu(bContext *C, void *arg, int event) } #endif +#if 0 +/* visible buttons ported to python, check ifedout buttons */ static void view3d_edit_armaturemenu(bContext *C, uiLayout *layout, void *arg_unused) { Object *obedit = CTX_data_edit_object(C); @@ -2499,7 +2331,7 @@ static void view3d_edit_armaturemenu(bContext *C, uiLayout *layout, void *arg_un uiItemMenuF(layout, "Bone Settings ", 0, view3d_edit_armature_settingsmenu); } - +#endif static void view3d_pose_armature_transformmenu(bContext *C, uiLayout *layout, void *arg_unused) { @@ -3271,36 +3103,6 @@ static void view3d_header_pulldowns(const bContext *C, uiBlock *block, Object *o xco+= xmax; if (obedit) { - if (ob && ob->type == OB_MESH) { - xmax= GetButStringLength("Mesh"); - uiDefMenuBut(block, view3d_edit_meshmenu, NULL, "Mesh", xco,yco, xmax-3, 20, ""); - xco+= xmax; - } else if (ob && ob->type == OB_CURVE) { - xmax= GetButStringLength("Curve"); - uiDefMenuBut(block, view3d_edit_curvemenu, NULL, "Curve", xco, yco, xmax-3, 20, ""); - xco+= xmax; - } else if (ob && ob->type == OB_SURF) { - xmax= GetButStringLength("Surface"); - uiDefMenuBut(block, view3d_edit_curvemenu, NULL, "Surface", xco, yco, xmax-3, 20, ""); - xco+= xmax; - } else if (ob && ob->type == OB_FONT) { - xmax= GetButStringLength("Text"); - uiDefMenuBut(block, view3d_edit_textmenu, NULL, "Text", xco, yco, xmax-3, 20, ""); - xco+= xmax; - } else if (ob && ob->type == OB_MBALL) { - xmax= GetButStringLength("Metaball"); - uiDefMenuBut(block, view3d_edit_metaballmenu, NULL, "Metaball", xco,yco, xmax-3, 20, ""); - xco+= xmax; - } else if (ob && ob->type == OB_LATTICE) { - xmax= GetButStringLength("Lattice"); - uiDefMenuBut(block, view3d_edit_latticemenu, NULL, "Lattice", xco, yco, xmax-3, 20, ""); - xco+= xmax; - } else if (ob && ob->type == OB_ARMATURE) { - xmax= GetButStringLength("Armature"); - uiDefMenuBut(block, view3d_edit_armaturemenu, NULL, "Armature", xco,yco, xmax-3, 20, ""); - xco+= xmax; - } - } else if (ob && ob->mode & OB_MODE_WEIGHT_PAINT) { xmax= GetButStringLength("Paint"); |