-
FBApplication ExecuteScript
Posted on 10 April 2009 Neill No commentsIn the version below MoBu 2009y, a function call ExecuteScript class FBApplication does not even score anything. However, when developing their tools, even Today can be very usefull of a call to a script.
Out of this situation is as follows.Заносим в список пользовательских скриптов нужные файлы ActionScript.txt
[ScriptFiles]
Script1 = NewCamera.py
…Назначаем для скриптов клавиатурные комбинации в текущий файл конфигурации (в моем случае это Maya.txt)
action.global.script1 = {SHFT:F1*DN}
Теперь для вызова скрипта можно использовать функцию WinAPI, имитируя нажатие клавиш на клавиатуре. Например:
//– hold shift key
keybd_event( VK_SHIFT, MapVirtualKey( VK_SHIFT, 0 ), 0, 0 );//– press F2
keybd_event( VK_F5, MapVirtualKey( VK_F5, 0), 0, 0 ); // key_down event
keybd_event( VK_F5, MapVirtualKey( VK_F5, 0), KEYEVENTF_KEYUP | 0, 0 ); // key_up event//– release shift key
keybd_event( VK_SHIFT, MapVirtualKey( VK_SHIFT, 0 ), KEYEVENTF_KEYUP, 0 );Вот такой трюк, удачи!
Enlisted on custom scripts necessary files ActionScript.txt
[ScriptFiles]
Script1 = NewCamera.py
…Assign keyboard combinations for scripts in the current configuration file (in my case it Maya.txt)
action.global.script1 = {SHFT:F1*DN}
Now, to call a script you can use the WinAPI, simulating pressing keys on the keyboard. For example:
//– hold shift key
keybd_event( VK_SHIFT, MapVirtualKey( VK_SHIFT, 0 ), 0, 0 );//– press F2
keybd_event( VK_F5, MapVirtualKey( VK_F5, 0), 0, 0 ); // key_down event
keybd_event( VK_F5, MapVirtualKey( VK_F5, 0), KEYEVENTF_KEYUP | 0, 0 ); // key_up event//– release shift key
keybd_event( VK_SHIFT, MapVirtualKey( VK_SHIFT, 0 ), KEYEVENTF_KEYUP, 0 );Here’s a trick, good luck!
MotionBuilder SDK, ToolLeave a Reply
You must be logged in to post a comment.

English
Russian
Recent Comments