简体   繁体   English

Maya右键单击上下文相关菜单

[英]Maya right click context sensitive menu

I am trying to edit the right click context sensitive menu from Maya. 我正在尝试从Maya编辑右键单击上下文相关菜单。 I have found how to add a menuItem but I would like to have this Item in the top of the list not at the bottom... I think in this case I need to deleteAllItems from the menu, add mine and then re-add the default Maya ones but I don't know how to re-add them. 我已经找到了如何添加menuItem的方法,但我希望此项目位于列表的顶部而不是底部...我认为在这种情况下,我需要从菜单中删除AllItems,添加我的项目,然后重新添加默认的Maya,但我不知道如何重新添加。 Where can I find it ? 在哪里可以找到它? Most of the topics say "modify Maya's source code" but that's not even an option. 大多数主题都说“修改Maya的源代码”,但这甚至不是一个选择。

Any suggestions ? 有什么建议么 ?

Thx ! 谢谢 !

Okay i think I have found a solution, that's the best I have found but this is not very handy... 好吧,我想我已经找到了解决方案,这是我找到的最好的解决方案,但这不是很方便。

create a copy of the buildobjectMenuItemsNow.mel and dagMenuProc.mel in your script folder so Maya will read those ones instead of the native ones. 在您的脚本文件夹中创建buildobjectMenuItemsNow.meldagMenuProc.mel的副本,以便Maya可以读取这些内容而不是本机内容。 Once you have done that you can modify the dagMenuProc.mel without destructing anything as you re working on a copy. 完成此操作后,您就可以修改dagMenuProc.mel,而不会在处理副本时破坏任何内容。 the proc that needs modifications is the last one : dagMenuProc (line 2240) 需要修改的proc是最后一个: dagMenuProc (第2240行)

and you can start modifying inside the loop (line 2266) 并且您可以开始在循环内进行修改(第2266行)

What I have done is make a call to a Python file that adds some more items in the menu and you can obviously remove some items by deleting few MEL lines. 我所做的是调用一个Python文件,该文件在菜单中添加了更多项目,并且您显然可以通过删除一些MEL行来删除某些项目。

I hope this can help someone. 我希望这可以帮助某人。 And if there is an other way of doing that, I would love to hear about ! 如果还有其他方法,我很想听听!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM