Skip to content

Commit

Permalink
Python / Cleanup: rename INFO_MT to TOPBAR_MT to reflect actual locat…
Browse files Browse the repository at this point in the history
…ion.
  • Loading branch information
brechtvl committed Aug 29, 2018
1 parent cdf62c7 commit 4925188
Show file tree
Hide file tree
Showing 52 changed files with 207 additions and 207 deletions.
40 changes: 20 additions & 20 deletions add_advanced_objects_menu/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@


# Define the "Scenes" menu
class INFO_MT_scene_elements_add(Menu):
bl_idname = "INFO_MT_scene_elements"
class VIEW3D_MT_scene_elements_add(Menu):
bl_idname = "VIEW3D_MT_scene_elements"
bl_label = "Test Scenes"

def draw(self, context):
Expand All @@ -108,8 +108,8 @@ def draw(self, context):


# Define the "Lights" menu
class INFO_MT_mesh_lights_add(Menu):
bl_idname = "INFO_MT_scene_lights"
class VIEW3D_MT_mesh_lights_add(Menu):
bl_idname = "VIEW3D_MT_scene_lights"
bl_label = "Lighting Sets"

def draw(self, context):
Expand All @@ -122,8 +122,8 @@ def draw(self, context):


# Define the "Chains" menu
class INFO_MT_mesh_chain_add(Menu):
bl_idname = "INFO_MT_mesh_chain"
class VIEW3D_MT_mesh_chain_add(Menu):
bl_idname = "VIEW3D_MT_mesh_chain"
bl_label = "Chains"

def draw(self, context):
Expand All @@ -134,15 +134,15 @@ def draw(self, context):


# Define the "Array" Menu
class INFO_MT_array_mods_add(Menu):
bl_idname = "INFO_MT_array_mods"
class VIEW3D_MT_array_mods_add(Menu):
bl_idname = "VIEW3D_MT_array_mods"
bl_label = "Array Mods"

def draw(self, context):
layout = self.layout
layout.operator_context = 'INVOKE_REGION_WIN'

layout.menu("INFO_MT_mesh_chain", icon="LINKED")
layout.menu("VIEW3D_MT_mesh_chain", icon="LINKED")

layout.operator("objects.circle_array_operator",
text="Circle Array", icon="MOD_ARRAY")
Expand All @@ -153,8 +153,8 @@ def draw(self, context):


# Define the "Blocks" Menu
class INFO_MT_quick_blocks_add(Menu):
bl_idname = "INFO_MT_quick_tools"
class VIEW3D_MT_quick_blocks_add(Menu):
bl_idname = "VIEW3D_MT_quick_tools"
bl_label = "Block Tools"

def draw(self, context):
Expand All @@ -171,8 +171,8 @@ def draw(self, context):


# Define the "Phsysics Tools" Menu
class INFO_MT_Physics_tools_add(Menu):
bl_idname = "INFO_MT_physics_tools"
class VIEW3D_MT_Physics_tools_add(Menu):
bl_idname = "VIEW3D_MT_physics_tools"
bl_label = "Physics Tools"

def draw(self, context):
Expand All @@ -190,12 +190,12 @@ def menu(self, context):
layout = self.layout
layout.operator_context = 'INVOKE_REGION_WIN'
self.layout.separator()
self.layout.menu("INFO_MT_scene_elements", icon="SCENE_DATA")
self.layout.menu("INFO_MT_scene_lights", icon="LIGHT_SPOT")
self.layout.menu("VIEW3D_MT_scene_elements", icon="SCENE_DATA")
self.layout.menu("VIEW3D_MT_scene_lights", icon="LIGHT_SPOT")
self.layout.separator()
self.layout.menu("INFO_MT_array_mods", icon="MOD_ARRAY")
self.layout.menu("INFO_MT_quick_tools", icon="MOD_BUILD")
self.layout.menu("INFO_MT_physics_tools", icon="PHYSICS")
self.layout.menu("VIEW3D_MT_array_mods", icon="MOD_ARRAY")
self.layout.menu("VIEW3D_MT_quick_tools", icon="MOD_BUILD")
self.layout.menu("VIEW3D_MT_physics_tools", icon="PHYSICS")


# Addons Preferences
Expand Down Expand Up @@ -524,7 +524,7 @@ def register():
)

# Add "Extras" menu to the "Add" menu
bpy.types.INFO_MT_add.append(menu)
bpy.types.VIEW3D_MT_add.append(menu)
try:
bpy.types.VIEW3D_MT_AddMenu.append(menu)
except:
Expand All @@ -533,7 +533,7 @@ def register():

def unregister():
# Remove "Extras" menu from the "Add" menu.
bpy.types.INFO_MT_add.remove(menu)
bpy.types.VIEW3D_MT_add.remove(menu)
try:
bpy.types.VIEW3D_MT_AddMenu.remove(menu)
except:
Expand Down
14 changes: 7 additions & 7 deletions add_curve_extra_objects/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,9 @@ def draw(self, context):
icon="LAYER_USED")


class INFO_MT_curve_knots_add(Menu):
class VIEW3D_MT_curve_knots_add(Menu):
# Define the "Extras" menu
bl_idname = "INFO_MT_curve_knots_add"
bl_idname = "VIEW3D_MT_curve_knots_add"
bl_label = "Plants"

def draw(self, context):
Expand All @@ -253,7 +253,7 @@ def menu_func(self, context):
icon='CURVE_DATA')
layout.separator()

layout.menu(INFO_MT_curve_knots_add.bl_idname, text="Knots", icon='CURVE_DATA')
layout.menu(VIEW3D_MT_curve_knots_add.bl_idname, text="Knots", icon='CURVE_DATA')
layout.separator()
layout.operator("curve.curlycurve", text="Curly Curve",
icon='CURVE_DATA')
Expand Down Expand Up @@ -282,17 +282,17 @@ def register():
bpy.utils.register_module(__name__)

# Add "Extras" menu to the "Add Curve" menu
bpy.types.INFO_MT_curve_add.append(menu_func)
bpy.types.VIEW3D_MT_curve_add.append(menu_func)
# Add "Extras" menu to the "Add Surface" menu
bpy.types.INFO_MT_surface_add.append(menu_surface)
bpy.types.VIEW3D_MT_surface_add.append(menu_surface)


def unregister():
add_curve_simple.unregister()
# Remove "Extras" menu from the "Add Curve" menu.
bpy.types.INFO_MT_curve_add.remove(menu_func)
bpy.types.VIEW3D_MT_curve_add.remove(menu_func)
# Remove "Extras" menu from the "Add Surface" menu.
bpy.types.INFO_MT_surface_add.remove(menu_surface)
bpy.types.VIEW3D_MT_surface_add.remove(menu_surface)

bpy.utils.unregister_module(__name__)

Expand Down
4 changes: 2 additions & 2 deletions add_curve_extra_objects/add_curve_curly.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,12 +479,12 @@ def add_curlycurve_button(self, context):

def register():
bpy.utils.register_class(add_curlycurve)
bpy.types.INFO_MT_curve_add.append(add_curlycurve_button)
bpy.types.VIEW3D_MT_curve_add.append(add_curlycurve_button)


def unregister():
bpy.utils.unregister_class(add_curlycurve)
bpy.types.INFO_MT_curve_add.remove(add_curlycurve_button)
bpy.types.VIEW3D_MT_curve_add.remove(add_curlycurve_button)


if __name__ == "__main__":
Expand Down
14 changes: 7 additions & 7 deletions add_curve_extra_objects/add_curve_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -1645,8 +1645,8 @@ class SimpleVariables(PropertyGroup):
)


class INFO_MT_simple_menu(Menu):
bl_idname = "INFO_MT_simple_menu"
class VIEW3D_MT_simple_menu(Menu):
bl_idname = "VIEW3D_MT_simple_menu"
bl_label = "2D Objects"

def draw(self, context):
Expand Down Expand Up @@ -1714,7 +1714,7 @@ def draw(self, context):
def Simple_button(self, context):
layout = self.layout
layout.separator()
self.layout.menu("INFO_MT_simple_menu", icon="MOD_CURVE")
self.layout.menu("VIEW3D_MT_simple_menu", icon="MOD_CURVE")


def register():
Expand All @@ -1723,10 +1723,10 @@ def register():
bpy.utils.register_class(BezierDivide)
bpy.utils.register_class(SimplePanel)
bpy.utils.register_class(SimpleEdit)
bpy.utils.register_class(INFO_MT_simple_menu)
bpy.utils.register_class(VIEW3D_MT_simple_menu)
bpy.utils.register_class(SimpleVariables)

bpy.types.INFO_MT_curve_add.append(Simple_button)
bpy.types.VIEW3D_MT_curve_add.append(Simple_button)

bpy.types.Object.s_curve = PointerProperty(type=SimpleVariables)

Expand All @@ -1737,10 +1737,10 @@ def unregister():
bpy.utils.unregister_class(BezierDivide)
bpy.utils.unregister_class(SimplePanel)
bpy.utils.unregister_class(SimpleEdit)
bpy.utils.unregister_class(INFO_MT_simple_menu)
bpy.utils.unregister_class(VIEW3D_MT_simple_menu)
bpy.utils.unregister_class(SimpleVariables)

bpy.types.INFO_MT_curve_add.remove(Simple_button)
bpy.types.VIEW3D_MT_curve_add.remove(Simple_button)
del bpy.types.Object.s_curve


Expand Down
4 changes: 2 additions & 2 deletions add_curve_sapling/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1126,13 +1126,13 @@ def menu_func(self, context):
def register():
bpy.utils.register_module(__name__)

bpy.types.INFO_MT_curve_add.append(menu_func)
bpy.types.VIEW3D_MT_curve_add.append(menu_func)


def unregister():
bpy.utils.unregister_module(__name__)

bpy.types.INFO_MT_curve_add.remove(menu_func)
bpy.types.VIEW3D_MT_curve_add.remove(menu_func)


if __name__ == "__main__":
Expand Down
4 changes: 2 additions & 2 deletions add_mesh_BoltFactory/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ def add_mesh_bolt_button(self, context):
def register():
bpy.utils.register_module(__name__)

bpy.types.INFO_MT_mesh_add.append(add_mesh_bolt_button)
bpy.types.VIEW3D_MT_mesh_add.append(add_mesh_bolt_button)
# bpy.types.VIEW3D_PT_tools_objectmode.prepend(add_mesh_bolt_button) # just for testing


def unregister():
bpy.utils.unregister_module(__name__)

bpy.types.INFO_MT_mesh_add.remove(add_mesh_bolt_button)
bpy.types.VIEW3D_MT_mesh_add.remove(add_mesh_bolt_button)
# bpy.types.VIEW3D_PT_tools_objectmode.remove(add_mesh_bolt_button) # just for testing


Expand Down
52 changes: 26 additions & 26 deletions add_mesh_extra_objects/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@
)


class INFO_MT_mesh_vert_add(Menu):
class VIEW3D_MT_mesh_vert_add(Menu):
# Define the "Single Vert" menu
bl_idname = "INFO_MT_mesh_vert_add"
bl_idname = "VIEW3D_MT_mesh_vert_add"
bl_label = "Single Vert"

def draw(self, context):
Expand All @@ -126,9 +126,9 @@ def draw(self, context):
text="Object Origin Mirrored")


class INFO_MT_mesh_gears_add(Menu):
class VIEW3D_MT_mesh_gears_add(Menu):
# Define the "Gears" menu
bl_idname = "INFO_MT_mesh_gears_add"
bl_idname = "VIEW3D_MT_mesh_gears_add"
bl_label = "Gears"

def draw(self, context):
Expand All @@ -140,9 +140,9 @@ def draw(self, context):
text="Worm")


class INFO_MT_mesh_diamonds_add(Menu):
class VIEW3D_MT_mesh_diamonds_add(Menu):
# Define the "Diamonds" menu
bl_idname = "INFO_MT_mesh_diamonds_add"
bl_idname = "VIEW3D_MT_mesh_diamonds_add"
bl_label = "Diamonds"

def draw(self, context):
Expand All @@ -156,9 +156,9 @@ def draw(self, context):
text="Gem")


class INFO_MT_mesh_math_add(Menu):
class VIEW3D_MT_mesh_math_add(Menu):
# Define the "Math Function" menu
bl_idname = "INFO_MT_mesh_math_add"
bl_idname = "VIEW3D_MT_mesh_math_add"
bl_label = "Math Functions"

def draw(self, context):
Expand All @@ -172,29 +172,29 @@ def draw(self, context):
self.layout.operator("mesh.make_triangle", icon="MESH_DATA")


class INFO_MT_mesh_mech(Menu):
class VIEW3D_MT_mesh_mech(Menu):
# Define the "Math Function" menu
bl_idname = "INFO_MT_mesh_mech_add"
bl_idname = "VIEW3D_MT_mesh_mech_add"
bl_label = "Mechanical"

def draw(self, context):
layout = self.layout
layout.operator_context = 'INVOKE_REGION_WIN'
layout.menu("INFO_MT_mesh_pipe_joints_add",
layout.menu("VIEW3D_MT_mesh_pipe_joints_add",
text="Pipe Joints", icon="SNAP_PEEL_OBJECT")
layout.menu("INFO_MT_mesh_gears_add",
layout.menu("VIEW3D_MT_mesh_gears_add",
text="Gears", icon="SCRIPTWIN")


class INFO_MT_mesh_extras_add(Menu):
class VIEW3D_MT_mesh_extras_add(Menu):
# Define the "Extra Objects" menu
bl_idname = "INFO_MT_mesh_extras_add"
bl_idname = "VIEW3D_MT_mesh_extras_add"
bl_label = "Extras"

def draw(self, context):
layout = self.layout
layout.operator_context = 'INVOKE_REGION_WIN'
layout.menu("INFO_MT_mesh_diamonds_add", text="Diamonds",
layout.menu("VIEW3D_MT_mesh_diamonds_add", text="Diamonds",
icon="PMARKER_SEL")
layout.separator()
layout.operator("mesh.add_beam",
Expand All @@ -214,9 +214,9 @@ def draw(self, context):
text="Menger Sponge")


class INFO_MT_mesh_torus_add(Menu):
class VIEW3D_MT_mesh_torus_add(Menu):
# Define the "Torus Objects" menu
bl_idname = "INFO_MT_mesh_torus_add"
bl_idname = "VIEW3D_MT_mesh_torus_add"
bl_label = "Torus Objects"

def draw(self, context):
Expand All @@ -230,9 +230,9 @@ def draw(self, context):
text="Torus Knot")


class INFO_MT_mesh_pipe_joints_add(Menu):
class VIEW3D_MT_mesh_pipe_joints_add(Menu):
# Define the "Pipe Joints" menu
bl_idname = "INFO_MT_mesh_pipe_joints_add"
bl_idname = "VIEW3D_MT_mesh_pipe_joints_add"
bl_label = "Pipe Joints"

def draw(self, context):
Expand Down Expand Up @@ -355,23 +355,23 @@ def menu_func(self, context):
lay_out.operator_context = 'INVOKE_REGION_WIN'

lay_out.separator()
lay_out.menu("INFO_MT_mesh_vert_add",
lay_out.menu("VIEW3D_MT_mesh_vert_add",
text="Single Vert", icon="LAYER_ACTIVE")
lay_out.operator("mesh.primitive_round_cube_add",
text="Round Cube", icon="MOD_SUBSURF")
lay_out.menu("INFO_MT_mesh_math_add",
lay_out.menu("VIEW3D_MT_mesh_math_add",
text="Math Function", icon="PACKAGE")
lay_out.menu("INFO_MT_mesh_mech_add",
lay_out.menu("VIEW3D_MT_mesh_mech_add",
text="Mechanical", icon="SCRIPTWIN")
lay_out.menu("INFO_MT_mesh_torus_add",
lay_out.menu("VIEW3D_MT_mesh_torus_add",
text="Torus Objects", icon="MESH_TORUS")
lay_out.separator()
lay_out.operator("mesh.generate_geodesic_dome",
text="Geodesic Dome", icon="MESH_ICOSPHERE")
lay_out.operator("discombobulate.ops",
text="Discombobulator", icon="RETOPO")
lay_out.separator()
lay_out.menu("INFO_MT_mesh_extras_add",
lay_out.menu("VIEW3D_MT_mesh_extras_add",
text="Extras", icon="MESH_DATA")
lay_out.separator()
lay_out.operator("object.parent_to_empty",
Expand Down Expand Up @@ -402,12 +402,12 @@ def register():
)

# Add "Extras" menu to the "Add Mesh" menu
bpy.types.INFO_MT_mesh_add.append(menu_func)
bpy.types.VIEW3D_MT_mesh_add.append(menu_func)


def unregister():
# Remove "Extras" menu from the "Add Mesh" menu.
bpy.types.INFO_MT_mesh_add.remove(menu_func)
bpy.types.VIEW3D_MT_mesh_add.remove(menu_func)

del bpy.types.Scene.discomb
del bpy.types.Scene.error_message
Expand Down
Loading

0 comments on commit 4925188

Please sign in to comment.