this was working but not is not anymore in 2.57 need help

hope someone can help to make this one work again

this is an interesting general example and still worth to make it work again in 2.57 if possible


 
import bpy
#import dynamic_menu
 
 
class VIEW3D_MT_tools(bpy.types.Menu):
 bl_label = "Tools"
 def draw(self, context):
 
  layout = self.layout
  layout.operator_context = 'INVOKE_REGION_WIN'
 
  ob = context
  if ob.mode == 'OBJECT':
 
   layout.operator("mesh.primitive_plane_add")
   layout.operator("mesh.primitive_cube_add")
   layout.operator("mesh.primitive_circle_add")
   layout.operator("mesh.primitive_uv_sphere_add")
   layout.operator("mesh.primitive_ico_sphere_add")
   layout.operator("mesh.primitive_tube_add")
   layout.operator("mesh.primitive_cone_add")
   layout.separator()
   layout.operator("object.lamp_add")
   layout.separator()
   layout.operator("object.armature_add")
   layout.separator()
   layout.operator("object.parent_set")
 
  elif ob.mode == 'EDIT_MESH':
   layout.operator("mesh.loopcut_slide",text="Loopcut")
   layout.operator("mesh.merge", text="Merge")
   ob = context.tool_settings
   if ob.mesh_selection_mode == 'FACE':
    layout.operator("mesh.extrude_move_along_normals",text="Extrude")
   else:
    layout.operator("mesh.extrude_move",text="Extrude")
 
   if ob.mesh_selection_mode == 'EDGE':
    layout.operator("transform_OT_edge_slide",text="Edge Slide")  
 
   layout.operator("mesh.remove_doubles",text="Remove Doubles").limit=0.0100
   layout.operator("mesh.subdivide")
   layout.operator("mesh.edge_face_add")
   layout.operator("mesh.select_more")
   layout.separator()
   layout.menu("VIEW3D_MT_addM")
   layout.menu("VIEW3D_MT_editM_Edge")
 
  layout.operator("screen.redo_last", text="Tweak Last")
  layout.operator("transform.snap_type", text="3D cursor")
 
class VIEW3D_MT_addM(bpy.types.Menu):
 bl_label = "Add"
 
 def draw(self, context):
 
  layout = self.layout
  layout.operator_context = 'INVOKE_REGION_WIN'
  layout.operator("mesh.primitive_plane_add")
  layout.operator("mesh.primitive_cube_add")
  layout.operator("mesh.primitive_circle_add")
  layout.operator("mesh.primitive_uv_sphere_add")
  layout.operator("mesh.primitive_ico_sphere_add")
  layout.operator("mesh.primitive_tube_add")
  layout.operator("mesh.primitive_cone_add")
 
class VIEW3D_MT_editM_Edge(bpy.types.Menu):
 bl_label = "Edges"
 
 def draw(self, context):
  layout = self.layout
  layout.operator_context = 'INVOKE_REGION_WIN'
 
 
 
  layout.separator()
 
  layout.operator("mesh.mark_seam")
  layout.operator("mesh.mark_seam", text="Clear Seam").clear = True
 
  layout.separator()
 
  layout.operator("mesh.mark_sharp")
  layout.operator("mesh.mark_sharp", text="Clear Sharp").clear = True
  layout.operator("mesh.extrude_move_along_normals",text="Extrude")
 
  layout.separator()
 
  layout.operator("mesh.edge_rotate", text="Rotate Edge CW").direction = 'CW'
  layout.operator("mesh.edge_rotate", text="Rotate Edge CCW").direction = 'CCW'
 
  layout.separator()
 
  layout.operator("TFM_OT_edge_slide", text="Edge Slide")
  layout.operator("mesh.loop_multi_select", text="Edge Loop")
 
  # uiItemO(layout, "Loopcut", 0, "mesh.loop_cut"); // CutEdgeloop(em, 1);
  # uiItemO(layout, "Edge Slide", 0, "mesh.edge_slide"); // EdgeSlide(em, 0,0.0);
 
  layout.operator("mesh.loop_multi_select", text="Edge Ring").ring = True
 
  layout.operator("mesh.loop_to_region")
  layout.operator("mesh.region_to_loop")
 
 
 
 
 
#bpy.utils.register_class(OBJECT_PT_ObjectSelecting)
 
 
 
def register():
 
 bpy.utils.register_class(VIEW3D_MT_tools)
 bpy.utils.register_class(VIEW3D_MT_addM)
 bpy.utils.register_class(VIEW3D_MT_editM_Edge)
 km = bpy.context.manager.active_keyconfig.keymaps['3D View']
 kmi = km.add_item('wm.call_menu', 'RIGHTMOUSE', 'DOUBLE_CLICK')
 kmi.properties.name = "VIEW3D_MT_tools"
 
 
def unregister():
 
 bpy.utils.unregister_class(VIEW3D_MT_tools)
 bpy.utils.unregister_class(VIEW3D_MT_addM)
 bpy.utils.unregister_class(VIEW3D_MT_editM_Edge)
 km = bpy.context.manager.active_keyconfig.keymaps['3D View']
 
 for kmi in km.items:
  if kmi.idname == 'wm.call_menu':
   if kmi.properties.name == "VIEW3D_MT_tools":
    km.remove_item(kmi)
    break
 
 
 
 
if __name__ == "__main__":
 register()
 
 
 

any help apprecaited

thanks
happy 2.5

start with correcting the title of your thread: this was working but not is not amymore in 2.47 need help

done
sorry i corrected it inside but not in title !LOL

hope someone can help to get it going again in 2.57

thanks for any help to make it work again

Ah…give em some slack, Ricky never corrects any typos. The lovable mispeller:p

Yep and bonus points to Ricky for using CODE tags!!! :wink:

Just taking a look now…



def register():
 
 bpy.utils.register_class(VIEW3D_MT_tools)
 bpy.utils.register_class(VIEW3D_MT_addM)
 bpy.utils.register_class(VIEW3D_MT_editM_Edge)
 #km = bpy.context.manager.active_keyconfig.keymaps['3D View']
 #kmi = km.add_item('wm.call_menu', 'RIGHTMOUSE', 'DOUBLE_CLICK')
 kc = bpy.context.window_manager.keyconfigs['Blender']
 km=kc.keymaps.get('3D View')
 kmi = km.keymap_items.new('wm.call_menu', 'RIGHTMOUSE', 'DOUBLE_CLICK')
 kmi.properties.name = "VIEW3D_MT_tools"
 
 
def unregister():
 
 bpy.utils.unregister_class(VIEW3D_MT_tools)
 bpy.utils.unregister_class(VIEW3D_MT_addM)
 bpy.utils.unregister_class(VIEW3D_MT_editM_Edge)
 #km = bpy.context.manager.active_keyconfig.keymaps['3D View']
 km=bpy.data.window_managers['WinMan'].keyconfigs['Blender'].keymaps['3D View']
 
 for kmi in km.items:
  if kmi.idname == 'wm.call_menu':
   if kmi.properties.name == "VIEW3D_MT_tools":
    km.remove_item(kmi)
    break