PDA

View Full Version : raKeyPressed: A command plugin for MEL scripting


rokandic
03-20-2006, 06:25 PM
A plugin to aid MEL scripting when trying to check if certain keys are pressed (more precisely esc, shift, alt, ctrl). It's a command plugin that returns a string array of those keys that are currently pressed.

How does it work (for instance if you hold down 'esc' key):
string $keysPressed[] =raKeyPressed(); //$keysPressed[0] will have a string value "esc".


I wrote it mainly for breaking "for" loops in MEL or GUI interaction for shift key. Hope it also helps some other MEL scripters :)

One note though, the plugin is currently compiled only for Maya 7 on Windows but it comes with source code so you can compile it yourself if you're on different platform or using different version of Maya.

Link:
http://www.rokandic.com/tools/plugins/raKeyPressed.zip

-rok

A_New_Hope
03-21-2006, 09:04 AM
cool :)
wanting something like this for a while.
while try it later to night :)

Segmoria
03-23-2006, 09:06 PM
This sounds really usefull!
But I'm afraid I'm having trouble installing it. I get the following error as I try to activate it within the Plug-in Manager:

Error: line 1: Unable to dynamically load : D:/Program Files/Alias/Maya7.0/bin/plug-ins/raKeyPressed.mll
This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem.

Anyone else with this? I'm using Maya7.0 on Windows

rokandic
03-24-2006, 07:55 AM
Error: line 1: Unable to dynamically load : D:/Program Files/Alias/Maya7.0/bin/plug-ins/raKeyPressed.mll
This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem.
I think I know what the problem might be here. I compiled this one with Visual C++ Express 2005 which uses new version of libraries so that might cause problem if you don't have it installed. I'll try to compile with Visual C++ toolkit 2003 and see if it works.

Cheers,
Rok

Segmoria
03-24-2006, 01:19 PM
You can also check this thread, it suggests what is probably causing this error:
http://forums.cgsociety.org/showthread.php?t=239891&goto=nextnewest

rokandic
03-24-2006, 01:59 PM
You can also check this thread, it suggests what is probably causing this error:
http://forums.cgsociety.org/showthr...goto=nextnewest (http://showthread.php?t=239891&goto=nextnewest)
Thanks Segmoria, will definitely check it out :thumbsup:

-rok

rokandic
03-27-2006, 07:19 AM
I have recompiled the plugin so I think it shouldn't cause any problem anymore. Just redownload the file for new version. I have also included the source code if anyone on Mac, Linux or different version of Maya would like to use it and wants to compile it.

Cheers,
Rok

Segmoria
03-28-2006, 02:05 PM
Yeap, works perfectly well now! Thanks.

blodulv
03-30-2006, 06:42 PM
that error is usually caused by not including the .manifest file that's created when you compile the application using vs2005. there's a new application distribution format in place that you should take note of, it's on msdn right now though i don't have the link handy

beau.

CGTalk Moderation
03-30-2006, 06:42 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.