Beer glass scene creation
This course contains a little bit of everything with modeling, UVing, texturing and dynamics in Maya, as well as compositing multilayered EXR's in Photoshop.
# 1 16-04-2003 , 11:08 PM
Registered User
Join Date: Apr 2003
Posts: 21

taking input

hi,
i am absolutely new to maya...but i have done some programming before...and i am interested in the mel scripting feature of maya. i was wondering if there is any way to get input from the keyboard. like control an object . eg. use the arrow keys for movement, space for jump, etc. if it is possible...could someone please give me a website with a tutorial or maybe explain how to do it. i've tried a lot but couldn't find any books in all the libraries i have looked...and i don't want to buy one yet...so a website or a sample code or something like that would be really helpful...thanx a lot...appreciate the help.

# 2 17-04-2003 , 02:46 AM
M's Avatar
Subscriber
Join Date: Jan 2003
Location: BC, Canada
Posts: 2,250
Are you saying you want to know how to program a game with maya? If thats what you are saying then mike or danny could probably help there. But all i can say is i know that maya can export to videogames and do lots of stuff in that field. Within the program though, im pretty sure you cannot code it to jump.. maybe code it to play a animation on spacebar, but i dont see the acomplishment of that.. lol. If you have done programming, then yea mel is very cool... it can save tons of time user added image (not that i would know though user added image) Hopefully someone can resolve this user added image.


"I should call you sugar maple tree cause i'd totally tap that" haha

email - mattwettstein@gmail.com
# 3 17-04-2003 , 03:03 AM
Ultragames's Avatar
Registered User
Join Date: Jan 2003
Posts: 1,113
Maya does not have any kind of a gaming engine. What you want to do, is make animations of your charater jumping and so on, then bind it to a key. ( "PLay animatino" or once in a gaming engine: "Walk forward")

Mel wont help you with what you want to do, because there is no reason for doing it in Maya, and proably not posible either.

Sry if we misunderstand you.


Armitrex Studios
Now open!!
# 4 17-04-2003 , 03:21 AM
dannyngan's Avatar
Registered User
Join Date: Dec 2002
Location: Seattle, WA
Posts: 1,154
As Ultragames has already mentioned, Maya itself does not contain a game engine. Maya is used to create content that can then be exported for use in game engines such as Unreal, Quake, and RenderWare. MEL scripting is used primarily to aid in content creation in the form of automated functions, custom UI's, and unique processes not normally available as features within Maya.

To find out more about Maya and Games, check out this link:

https://www.aliaswavefront.com/en/new...amesnews.shtml

I work in the games industry, so feel free to contact me if you have further questions. My contact info is in my profile.


Danny Ngan
Animator | Amaze Entertainment
my website | my blog | my job
# 5 17-04-2003 , 05:57 AM
Registered User
Join Date: Apr 2003
Posts: 21
hi,
thanx for replying. i don't want to make any games yet. i just want to start out slow. what i meant by taking input was, for instance, if i press space bar, the object would increment its Y-axis, hence making it seem like a jump. similarly pressing the arrow keys would increment the X and Z axes. in a programming language i could have done it something like this:

cin>>key; //reads the input
if (key==up) z++;
if (key==down) z--;
if (key==left) x++;
if (key==right) x--;

apparently this won't work on maya because cin is c++. what is the equivalent code in maya's mel?...if there is one...thanx a lot.

# 6 17-04-2003 , 06:40 AM
dannyngan's Avatar
Registered User
Join Date: Dec 2002
Location: Seattle, WA
Posts: 1,154
What you can do is create some simple MEL scripts to modify an object's translate attributes, and then bind hotkeys to trigger those scripts. You'd have to get the name of the selected object, get its position, and then change that depending on which key you press. Some MEL commands that you might need:

Code:
ls -sl; //gets the name of selected objects

objectname.translateX //an object's X position attribute

getAttr objectname.translateX; //gets the object's X position

float $foo = `getAttr objectname.translateX`; //assigns the object's X position to a float variable named $foo

setAttr objectname.translateX 5; //set an object's X position to 5
If you look up the MEL commands in the help docs, it shouldn't take you too long to create the commands that you need.


Danny Ngan
Animator | Amaze Entertainment
my website | my blog | my job
Posting Rules Forum Rules
You may not post new threads | You may not post replies | You may not post attachments | You may not edit your posts | BB code is On | Smilies are On | [IMG] code is On | HTML code is Off

Similar Threads