I need to know how can we add in a custom option using python in the 'Make Links' menu which appears when Ctrl+L is pressed in the 3D view, as shown below:

enter image description here


It's bpy.types.VIEW3D_MT_make_links. For demonstration purposes I've added a 'Frame Rate' menu to 'Make Links' menu via append() method.

enter image description here
Frame Rate menu 'appended'

bl_info = {"name": "My Test Addon", "category": "Object"}

import bpy

class CustomFrameRateMenu(bpy.types.Menu):
    bl_label = "Frame Rate"
    bl_idname = "RENDER_MT_framerate_menu"

    def draw(self, context):
        scene = context.scene
        layout = self.layout

        #frame rate properties
        layout.prop(scene.render, "fps_base", text="FPS Base")
        layout.prop(scene.render, "fps", text="FPS")
        layout.menu("RENDER_MT_framerate_presets", text="Presets", icon="SCENE")

def draw_frame_rate_menu(self, context):
    layout = self.layout

def register():

    # lets add the menu to Make Links menu

def unregister():

    # remove custom menu from Make Links menu

if __name__ == "__main__":

Further information you can find here: https://blender.stackexchange.com/a/34490/3710

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.