def _create_keyframe_context_menu(self, item): keyframe_context_menu = Qt.QMenu() time_slider_start = keyframe_context_menu.addAction('Set time slider start') time_slider_start.triggered.connect(lambda: pm.playbackOptions(min=item.frame)) time_slider_end = keyframe_context_menu.addAction('Set time slider end') time_slider_end.triggered.connect(lambda: pm.playbackOptions(max=item.frame)) time_render_start = keyframe_context_menu.addAction('Set render start') time_render_start.triggered.connect(lambda: pm.PyNode('defaultRenderGlobals').startFrame.set(item.frame)) time_render_end = keyframe_context_menu.addAction('Set render end') time_render_end.triggered.connect(lambda: pm.PyNode('defaultRenderGlobals').endFrame.set(item.frame)) return keyframe_context_menu
def add_menu(text): menu = Qt.QMenu(text, self.menubar) self.menubar.addAction(menu.menuAction()) return menu