Changeset View
Changeset View
Standalone View
Standalone View
add_mesh_extra_objects/__init__.py
| Context not available. | |||||
| # Note: Blocks has to be loaded before the WallFactory or the script | # Note: Blocks has to be loaded before the WallFactory or the script | ||||
| # will not work properly after (F8) reload | # will not work properly after (F8) reload | ||||
| if "bpy" in locals(): | modules = ( | ||||
| import importlib | 'add_mesh_star', | ||||
| importlib.reload(add_mesh_star) | 'add_mesh_twisted_torus', | ||||
| importlib.reload(add_mesh_twisted_torus) | 'add_mesh_gemstones', | ||||
| importlib.reload(add_mesh_gemstones) | 'add_mesh_gears', | ||||
| importlib.reload(add_mesh_gears) | 'add_mesh_3d_function_surface', | ||||
| importlib.reload(add_mesh_3d_function_surface) | 'add_mesh_round_cube', | ||||
| importlib.reload(add_mesh_round_cube) | 'add_mesh_supertoroid', | ||||
| importlib.reload(add_mesh_supertoroid) | 'add_mesh_pyramid', | ||||
| importlib.reload(add_mesh_pyramid) | 'add_mesh_torusknot', | ||||
| importlib.reload(add_mesh_torusknot) | 'add_mesh_honeycomb', | ||||
| importlib.reload(add_mesh_honeycomb) | 'add_mesh_teapot', | ||||
| importlib.reload(add_mesh_teapot) | 'add_mesh_pipe_joint', | ||||
| importlib.reload(add_mesh_pipe_joint) | 'add_mesh_solid', | ||||
| importlib.reload(add_mesh_solid) | 'add_mesh_round_brilliant', | ||||
| importlib.reload(add_mesh_round_brilliant) | 'add_mesh_menger_sponge', | ||||
| importlib.reload(add_mesh_menger_sponge) | 'add_mesh_vertex', | ||||
| importlib.reload(add_mesh_vertex) | 'add_empty_as_parent', | ||||
| importlib.reload(add_empty_as_parent) | 'mesh_discombobulator', | ||||
| importlib.reload(mesh_discombobulator) | 'add_mesh_beam_builder', | ||||
| importlib.reload(add_mesh_beam_builder) | 'Blocks', | ||||
| importlib.reload(Blocks) | 'Wallfactory', | ||||
| importlib.reload(Wallfactory) | 'add_mesh_triangles', | ||||
| importlib.reload(add_shape_geodesic) | 'geodesic_domes.add_shape_geodesic', | ||||
| importlib.reload(forms_271) | 'geodesic_domes.forms_271', | ||||
| importlib.reload(geodesic_classes_271) | 'geodesic_domes.geodesic_classes_271', | ||||
| importlib.reload(third_domes_panel_271) | 'geodesic_domes.third_domes_panel_271', | ||||
| importlib.reload(vefm_271) | 'geodesic_domes.vefm_271' | ||||
| importlib.reload(add_mesh_triangles) | ) | ||||
| else: | |||||
| from . import add_mesh_star | import sys | ||||
| from . import add_mesh_twisted_torus | from bpy.utils.module_loader import ModuleLoader | ||||
| from . import add_mesh_gemstones | |||||
| from . import add_mesh_gears | loader = ModuleLoader(sys.modules[__name__]) | ||||
| from . import add_mesh_3d_function_surface | loader.import_modules(modules, | ||||
| from . import add_mesh_round_cube | package = __package__, reload = "bpy" in locals()) | ||||
| from . import add_mesh_supertoroid | |||||
| from . import add_mesh_pyramid | |||||
| from . import add_mesh_torusknot | |||||
| from . import add_mesh_honeycomb | |||||
| from . import add_mesh_teapot | |||||
| from . import add_mesh_pipe_joint | |||||
| from . import add_mesh_solid | |||||
| from . import add_mesh_round_brilliant | |||||
| from . import add_mesh_menger_sponge | |||||
| from . import add_mesh_vertex | |||||
| from . import add_empty_as_parent | |||||
| from . import mesh_discombobulator | |||||
| from . import add_mesh_beam_builder | |||||
| from . import Blocks | |||||
| from . import Wallfactory | |||||
| from . import add_mesh_triangles | |||||
| from .geodesic_domes import add_shape_geodesic | |||||
| from .geodesic_domes import forms_271 | |||||
| from .geodesic_domes import geodesic_classes_271 | |||||
| from .geodesic_domes import third_domes_panel_271 | |||||
| from .geodesic_domes import vefm_271 | |||||
| import bpy | import bpy | ||||
| from bpy.types import Menu | from bpy.types import Menu | ||||
| Context not available. | |||||
| StringProperty, | StringProperty, | ||||
| ) | ) | ||||
| class VIEW3D_MT_mesh_vert_add(Menu): | class VIEW3D_MT_mesh_vert_add(Menu): | ||||
| # Define the "Single Vert" menu | # Define the "Single Vert" menu | ||||
| bl_idname = "VIEW3D_MT_mesh_vert_add" | bl_idname = "VIEW3D_MT_mesh_vert_add" | ||||
| Context not available. | |||||
| text="Extras") | text="Extras") | ||||
| lay_out.separator() | lay_out.separator() | ||||
| lay_out.operator("object.parent_to_empty", | lay_out.operator("object.parent_to_empty", | ||||
| text="Parent To Empty") | text="Parent To Empty") | ||||
| # Register | |||||
| classes = [ | |||||
| VIEW3D_MT_mesh_vert_add, | |||||
| VIEW3D_MT_mesh_gears_add, | |||||
| VIEW3D_MT_mesh_diamonds_add, | |||||
| VIEW3D_MT_mesh_math_add, | |||||
| VIEW3D_MT_mesh_mech, | |||||
| VIEW3D_MT_mesh_extras_add, | |||||
| VIEW3D_MT_mesh_torus_add, | |||||
| VIEW3D_MT_mesh_pipe_joints_add, | |||||
| add_mesh_star.AddStar, | |||||
| add_mesh_twisted_torus.AddTwistedTorus, | |||||
| add_mesh_gemstones.AddDiamond, | |||||
| add_mesh_gemstones.AddGem, | |||||
| add_mesh_gears.AddGear, | |||||
| add_mesh_gears.AddWormGear, | |||||
| add_mesh_3d_function_surface.AddZFunctionSurface, | |||||
| add_mesh_3d_function_surface.AddXYZFunctionSurface, | |||||
| add_mesh_round_cube.AddRoundCube, | |||||
| add_mesh_supertoroid.add_supertoroid, | |||||
| add_mesh_pyramid.AddPyramid, | |||||
| add_mesh_torusknot.AddTorusKnot, | |||||
| add_mesh_honeycomb.add_mesh_honeycomb, | |||||
| add_mesh_teapot.AddTeapot, | |||||
| add_mesh_pipe_joint.AddElbowJoint, | |||||
| add_mesh_pipe_joint.AddTeeJoint, | |||||
| add_mesh_pipe_joint.AddWyeJoint, | |||||
| add_mesh_pipe_joint.AddCrossJoint, | |||||
| add_mesh_pipe_joint.AddNJoint, | |||||
| add_mesh_solid.Solids, | |||||
| add_mesh_round_brilliant.MESH_OT_primitive_brilliant_add, | |||||
| add_mesh_menger_sponge.AddMengerSponge, | |||||
| add_mesh_vertex.AddVert, | |||||
| add_mesh_vertex.AddEmptyVert, | |||||
| add_mesh_vertex.AddSymmetricalEmpty, | |||||
| add_mesh_vertex.AddSymmetricalVert, | |||||
| add_empty_as_parent.P2E, | |||||
| add_empty_as_parent.PreFix, | |||||
| mesh_discombobulator.discombobulator, | |||||
| mesh_discombobulator.discombobulator_dodads_list, | |||||
| mesh_discombobulator.discombob_help, | |||||
| mesh_discombobulator.VIEW3D_OT_tools_discombobulate, | |||||
| mesh_discombobulator.chooseDoodad, | |||||
| mesh_discombobulator.unchooseDoodad, | |||||
| add_mesh_beam_builder.addBeam, | |||||
| Wallfactory.add_mesh_wallb, | |||||
| add_shape_geodesic.add_corrective_pose_shape_fast, | |||||
| third_domes_panel_271.GenerateGeodesicDome, | |||||
| third_domes_panel_271.DialogOperator, | |||||
| add_mesh_triangles.MakeTriangle | |||||
| ] | |||||
| def register(): | def register(): | ||||
| from bpy.utils import register_class | loader.register_classes() | ||||
| for cls in classes: | |||||
| register_class(cls) | |||||
| # Add "Extras" menu to the "Add Mesh" menu | # Add "Extras" menu to the "Add Mesh" menu | ||||
| bpy.types.VIEW3D_MT_mesh_add.append(menu_func) | bpy.types.VIEW3D_MT_mesh_add.append(menu_func) | ||||
| Context not available. | |||||
| def unregister(): | def unregister(): | ||||
| # Remove "Extras" menu from the "Add Mesh" menu. | # Remove "Extras" menu from the "Add Mesh" menu. | ||||
| bpy.types.VIEW3D_MT_mesh_add.remove(menu_func) | bpy.types.VIEW3D_MT_mesh_add.remove(menu_func) | ||||
| from bpy.utils import unregister_class | loader.unregister_classes() | ||||
| for cls in reversed(classes): | |||||
| unregister_class(cls) | |||||
| if __name__ == "__main__": | if __name__ == "__main__": | ||||
| register() | register() | ||||
| Context not available. | |||||