-
Менеджер меню для MoBu
Дата: Март 17th, 2010 Neill Комментарии (6)
Данный плагин предназначен для переименования и дополнения пункта Open Reality главного меню. Дополнить пункт меню можно вызовами Python скриптов.Описание
Для переименования меню Open Reality используйте пункт Title файла конфигурации. Для этого нам потребуется отредактировать файл *MACHINE NAME*.menuman.txt, в моем случае это bin/config/NEILL.menuman.txt. Данный файл я прицепил к статье.
[MainMenu]
Title = &My menu ; replace OpenReality with…
Для совместимости с МоБи 7.5 мне пришлось использовать уловку для вызова Python скриптов с клавиатуры, поэтому процесс настройки требует ряда действий.
1) Прежде всего определите список скриптов в файле ActionScript.txt, который находится в bin/config/scripts/ директории.
[ScriptFiles]Script1 = NewCamera.pyScript2 =Script3 =Script4 =Script5 =Script6 =Script7 =Script8 =Script9 =Script10 =Script11 =Script12 =2) Далее определите клавиатурные комбинации для указанных выше скриптов в файле используемой вами раскладки. Например, я использую Maya’евскую раскладку и поэтому редактирую Maya.txt в bin/config/keyboard
action.global.script1 = {SHFT:F1*DN}
action.global.script2 = {SHFT:F2*DN}
action.global.script3 = {SHFT:F3*DN}
action.global.script4 = {SHFT:F4*DN}
action.global.script5 = {SHFT:F5*DN}
action.global.script6 = {SHFT:F6*DN}
action.global.script7 = {SHFT:F7*DN}
action.global.script8 = {SHFT:F8*DN}
action.global.script9 = {SHFT:F9*DN}
action.global.script10 = {SHFT:F10*DN}
action.global.script11 = {SHFT:F11*DN}
action.global.script12 = {SHFT:F12*DN}
Клавиатуру достаточно определить один раз, назначив для скриптов комбинации с F1 по F12.
3) Теперь следует назвать скрипты в меню. Для этого нам потребуется отредактировать файл *MACHINE NAME*.menuman.txt, в моем случае это bin/config/NEILL.menuman.txt
[Python]
Python Item Name 0 = New Camera
Python Item Name 1 =
Python Item Name 2 =
Python Item Name 3 =
Python Item Name 4 =
Python Item Name 5 =
Python Item Name 6 =
Python Item Name 7 =
Python Item Name 8 =
Python Item Name 9 =
Python Item Name 10 =
Python Item Name 11 =
В этом файле вы задаете наименования для пунктов меню, где каждый пункт будет вызывать соответствующую клавиатурную комбинацию от F1 до F12.
Теперь при запуске MotionBuilder должны появится в меню указанные пункты.
Скачать
My config file – NEILL.menuman
MotionBuilder 7.5 ext.2 (32 bit) – menuman75
MotionBuilder 2009 (32 bit) – menuman2009
MotionBuilder Plugin, Python6 Responses to “Менеджер меню для MoBu”
-
Hi Neil,
Thank you very much for this very good script.
I have some trouble using it on Mobu 2009: Only the first item seems to work. In other words, clicking on other items than Python Item Name 0 never calls the related script.
Do you also have the pb on your side or is it a local pb?
Thanks a lot
-
Hi Werwack,
I’ll try to find this plugin on my machine and make a test with script calls. Are you a programmer ?
> Do you also have the pb on your side or is it a local pb?
Sorry, what do you mean by «pb» ? -
I program, but I am not familiar with MoBu API. Setup of the menuman files is not a problem though, if that’s your question. I am used to develop user scripts (mainly in maxscript).
Playing with the text files, I noticed menu item indices ([Python] section) are starting at 0 and script files ([ScriptFiles]) at 1. Could it be part of the strange behavior?
Pb means ‘problem’, shortcut I use quite often
-
I have tryed a plug, everything works properly. So I guess It’s your local pb (using your shortcut)
I’ll try to explaine in more details
1 – first of all, I have found my folder where MoBu stores config files. My path is – c:\Users\
\AppData\Local\Autodesk\MB2009\config 2 – I’m using «Maya» keyboard configuration, so I have opened Keyboard\Maya.txt and made changes to this file like in my post above
3 – Then I have added some more scripts into the Scripts\ActionScript.txt
For example – Script2 = Tree.py4 – Next step, I have added new line into the menuman configuration, for me it’s a NEILL-PC.menuman.txt file and a line
Python Item Name 1 = Tree Example5 – Now everything is ready to start MoBu. It’s easy to check my adjustments, script is binded to shortkey shift+F2, so press this key to test.
Hope that will help, please keep me updated on if it works.
-
Yesss, it works
Thanks a lot!
In fact I had only the first keyboard shortcut set and I didn’t have a deeper lot at it because, as you mentionned at the top of the article, «For compatibility with Moby 7.5 I had to use keyboard shotcuts to call Python scripts from the keyboard, so the setup process requires a series of actions.»
Well, it seems that I mis interpreted this and I thought keyboard shortcut were not mandatory.
So everything is ok. Very nice plugin
-
You’re welcome!
Добавить комментарий
-



Свежие комментарии