Newer
Older
createFaces(loopsJoints[loopIdx],
base = create_mesh_object(context, verts, [], faces, "N Joint")
class INFO_MT_mesh_pipe_joints_add(bpy.types.Menu):
# Define the "Pipe Joints" menu
bl_idname = "INFO_MT_mesh_pipe_joints_add"
bl_label = "Pipe Joints"
def draw(self, context):
layout = self.layout
layout.operator_context = 'INVOKE_REGION_WIN'
layout.operator("mesh.primitive_elbow_joint_add",
text="Pipe Elbow")
layout.operator("mesh.primitive_tee_joint_add",
text="Pipe T-Joint")
layout.operator("mesh.primitive_wye_joint_add",
text="Pipe Y-Joint")
layout.operator("mesh.primitive_cross_joint_add",
text="Pipe Cross-Joint")
layout.operator("mesh.primitive_n_joint_add",
text="Pipe N-Joint")
################################
# Define "Pipe Joints" menu
def menu_func(self, context):
self.layout.menu("INFO_MT_mesh_pipe_joints_add", icon="PLUGIN")
def register():
Campbell Barton
committed
bpy.utils.register_module(__name__)
# Add "Pipe Joints" menu to the "Add Mesh" menu
bpy.types.INFO_MT_mesh_add.append(menu_func)
def unregister():
Campbell Barton
committed
bpy.utils.unregister_module(__name__)
# Remove "Pipe Joints" menu from the "Add Mesh" menu.
bpy.types.INFO_MT_mesh_add.remove(menu_func)
if __name__ == "__main__":
register()