hey guys,
i was wondering if there's a free plugin/script on the net that would allow you to use an xbox360 (or any controller) inside maya? Basically, i made this character with some animation clips, which i want to walk/run with in an environment i made inside maya. I know 3dsmax has something like this ( a sort of fps view), which allows you to walk around with the WASD keys, but i want to take it a step further by using a controller. I know there's a program called craft animation studio (or something like that), but im not really interested in coughing up 800 bucks for something like this. Any suggestions? I use maya 2008.
curious to hear if there's more interest in the community!
cheers,
Allert
Replies
Maybe there are some scripts for maya that upgrade such a feature for maya
its quite easy to define with that a turnable camera using a analogue joystick
http://www.geocities.com/jlimperials/realtime.html
No idea if it still works. Keep us updated
And this one I found with google.
http://onepartcode.com/main/projects/X360_Maya.html
"Controller Server: Extremely simple program to make the inputs from an Xbox 360 controller available to Maya."
With the Left Stick you aim. Right Trigger fires. Left Trigger switches between Full Auto / Single Shot.
The graphics is LowMan rig with a simple gun geometry. The tracer rounds are from a particle emitter that is emitting instances of a polygon plane textured with a bitmap of a tracer round. The tracer particles collide with the target, which then "splits" and emits some spark particles.
Loads of fun. Recommended if you dare to mess around with a bit more "techy" stuff.
Pretty hot imo, especially the fact that you need no programmer that does stuff for you like under normal game-condition when you got no node-based-animation-editor... sry for my english
Indeed.
All my messing around was done in Maya's Script Editor with very simple programming commands. ie
if (controller.lt == 1)
{
particleShape1.rate = controller.lt * 20;
}
etc...
true
[ame]
EDIT: Updated link with minor correction.
Haha
That sounds fairly easy, should only a few connections and tweaking.
This sounds cool. Making an interactive selection is probably the biggest challenge. Getting the camera to zoom is probably done by checking the object's bounding box, and follow is no problemo.
I had a similar idea of making some kind of interactive gallery thing to show of several model/texture pieces.
Left analog : pan
Right analog : rotate with dolly locked
Analog shoulders : zoom in and out
blue : frame selected
dpad : scene hierarchy navigation
green : slection (q)
red : spacebar
yellow : ctrl spacebar
right shoulder button : hypershade toggle
left shoulder button : outliner toggle
Dashboard buton : ctrl s
Yum!
Thats a bit more than just viewport navigation
Maybe green could be used for deselect all.
(sorry to not call the buttons by their names, I never managed to wrap my head around them because of my SNES days when yellow was B, green Y, blue X and red A!!)
"defineDataServer -device xenon -server XenonController;"
but i obviously got the following respone in maya:
"Error: Could not connect to server: XenonController"
any idea what to call my controller, so the script can connect to it? I'm really looking forward to playing with this
Allert
EDIT: before you ask, yes, i plugged in my controller before maya starts :P
The way I did it was to install the ControllerServer through this binary:
http://www.ryane.com/Blog_Content/MayaControllerServerInstall.msi
1. Install the application from the link above.
2. Make sure your controller is plugged in.
3. Start the ControllerServer
4. Start Maya
5. Run the "defineDataServer -device xenon -server XenonController;"
6. You should now have a "xenon" device in your Window > Animation Editor > Device Editor.
At this point you need to connect all the xenon device outputs to attributes in Maya. For instance create a locator, add attributes to it, connect the xenon outputs to the locator attributes.
Good luck and feel free to ask questions and share your creations
EDIT:
From the comments on Ryane's blog. Just to let you know.
"Yeah I don’t think the controller plugin will work on the 64 bit version… Maybe someday I can bug dave into releasing one."
You gotta make sure the objects translate value is not a direct connection to the xenon controllers output.
Example:
pCube1.translateX = myControllerObject.xenonLeftStickX; <---- This would "snap" back when you let go of the Left Stick.
pCube1.translateX = pCube1.translateX + myControllerObject.xenonLeftStickX; <---- This would just "add" the xenon controllers output every time it evaluates the expression meaning that when you let go of the Left stick the pCube1 would just stop and not "snap" back.
Here's another issue. You might have noticed that the Left Stick / Right Stick do not exactly revert back to 0 when you let go of them, the usually end up at somewhere between 0.0-0.15. Meaning that if you were to use the expression example above your pCube1 would never actually stop entirely. So you could just filter this with a simple "IF" condition.
if (myControllerObject.xenonLeftStickX > 0.15 || myControllerObject.xenonLeftStickX < -0.15)
{
pCube1.translateX = pCube1.translateX + myControllerObject.xenonLeftStickX;
}
The "||" is an "OR" command, so if either > 0.15 OR < -0.15 are true then it will proceed with the commands contained in the "IF". There is also an "AND" command which is "&&"
Good luck
Oh yes, and use Dynamics > Solvers > Interactive Playback when testing your features like this since it forces Maya to evaluate every frame and not just when you update an input. Otherwise the example I showed above won't work well.
thanks in advance!
Allert.
ps. I'll try and make a little video which shows you what i mean
thanks for trying to help me out. The .ma file and video are located @ http://dl.getdropbox.com/u/627095/3D/Car.avi (XVID) and http://dl.getdropbox.com/u/627095/3D/Car.ma
Basically, i want the car to be able to steer and turn properly, not just skid around, like in the video. About half way in the avi, you see me switch to relative mode on the Car.rotateY attrib, which ables the car to do 360's and stuff, but other than that, the car isn't really steerable (english?) Oh, and also, how do i save the maya file, so it will remember all the mappings? Because how it is now, i have to remap everything from scratch when i reopen the file in maya, which is really annoying. Thanks again!
cheers,
Allert
I'm leaving to spend the a day or two at my gf's parents house. I tried playing around with your scene for a while and I know what issue you are referring to. I'm just not sure how to solve it... yet.
The issue is that even if you rotate the car object it's still parented under Maya's world coordinates. This means that if you rotate it in Y, and then change it's translateZ it's not going to "move forward" in the direction the car is facing. For that to happen you would have to either alter both translateZ and translateX, which doesn't make things easy. A more convenient way would be that you never actually rotate the car itself, instead you rotate it's parent (coordinate system). This would allow you to always just change the car's translateZ and it would appear to move forward in the direction it's facing, but... You need the cars parent coordinate system to follow the car's position, and I'm not sure how to force a parent object to follow the child object without cycle checks.
You can try this yourself and you will see what I am referring to.
1. Create any object, leave it at origo.
2. Group your new object.
3. Rotate the group along rotateY. The object should appear to have rotated. It hasn't, it's parent (coordinate system) has.
4. You should now be free to move the object "forward" by altering only it's translateZ value. So far so good right?
5. After you have moved the object any distance from origo, try rotating the Group again to simulate your object turning. Note the issue at hand.
Regarding attaching the controls everytime you open your scene this can be done by creating a new scriptNode in the expression editor and setting it to trigger at Open/Close. Before you do this I would advice you create some dummy object and link all the Xenons outputs to that dummy object. Then you can retrieve the values from that dummy object instead of attaching the Xenons outputs directly to your affected object.
Open the Windows > Animation Editors > Expression Editor. Under Select Filter change it to "By Script Node Name". Enter a new name for your Script Node "attachJoystick" for instance. Change the "Execute on:" to "Open/Close". Now paste your attach commands in the Script field and hit create. Voila!
happy easter !
A.
I have played around with physics as well. Works quite well. But I had the same issue there when working with the Impulse attributes.
That's cool Allert. I gotta disect his scene to find out how!
EDIT.
Ah yes, this had occurred to me. He has solved it using vectors to move the object around. Not that I fully understand how to use these though.
I hope someone has the same problem as me, cuz I hate not knowing whats wrong
Sounds like a bummer. Seems good that Maya recognizes it at all to begin with.
How are you testing it out? You say that it doesn't recognize your twiddling, what should happen if it worked? Brief us on how you go from the device editor to when you expect it to modify/transform your object.
Here's a link to a rar'd avi file, which shows you want I mean. Basically, what you see me doing there on the left is showing you my controller is indeed working correctly, but when i switch to maya, the bindings I made don't seem to work at all.
http://dl.dropbox.com/u/627095/3D/XboxController.rar
thx,
Allert
Did you install the xbox controller drivers for windows? Can't remember if this was a must, but I remember getting some kind of HUD graphics when using my controller with windows. At least a times? Maybe when I pressed the start button or smth.
I'm fresh out of ideas to be honest.
And yes, i tried several actually, and the latest driver I got from http://www.microsoft.com/hardware/download/download.aspx?category=gaming. I think the driver is fine, the controller is recognised by windows, just not in Maya for some reason. As for the HUD, do you mean this gizmo?
I also have a 64bit windows 7 installed on a different partition, which has the exact same problem, so my gut tells me it has something to do with Windows 7's architecture or something, not sure what else it could be.
Are you using Windows 7? Or Windows XP/Vista
Thanks anyway for your help
cheers,
A.
Yeah that's the small HUD-thingie I was referring to.
@ Kodde: I had a couple of questions concerning expressions (which isn't my strong suit yet). I made this character a while ago, and i hooked him up to some constraints, and now you can move him around the scene, but for some reason, he never comes to a complete standstill. I'm wondering how i should fix this. This is my script i'm using for the navigation of my character:
if (ctrl.LeftXAxis > -0.15 || ctrl.LeftXAxis < 0.15)
{
MoveCTRL.translateX = ctrl.LeftXAxis + MoveCTRL.translateX;
}
if (ctrl.LeftYAxis > -0.15 || ctrl.LeftYAxis < 0.15)
{
MoveCTRL.translateZ = ctrl.LeftYAxis + MoveCTRL.translateZ;
}
do you know of a way to add a correct parameter (or which parameter do i need to change to get him to stand still on the spot?).
Later, I also want to attach animation clips to the controller, but I have no idea how to set it up. For now, i made some poses, and connected the driven keys to the sticks/triggers.
here's a zip with my maya file + attachments. If you could try it out, and help me out, i'd appreciate it greatly!
oh, and here's a movie i made, so you can see it in action.
also, does anyone know how to tone down the sensitivity of the controller?
You have this if statement which triggers when your thumb sticks are actively moved. But when you releases the thumb sticks it won't trigger the the if statement, but Maya still remembers that the MoveCTRL.translateX is stil equal to itself + the ctrl.LeftXAxis (which you know never is 0, even when not moving the sticks).
You can add an Else statement in conjunction with your if statement. For instance
if (ctrl.LeftXAxis > -0.15 || ctrl.LeftXAxis < 0.15)
{
MoveCTRL.translateX = ctrl.LeftXAxis + MoveCTRL.translateX;
} Else {
MoveCTRL.translateX = MoveCTRL.translateX;
}
This should make it stand still since in the scenario that you do not actively move the sticks you feed the MoveCTRL the same value it already has.
Add a accelarate/speed feature. Each evaluation you let the sticks build up this accelerate value which is added to the translate to make your character move forward. Once you let go of the stick this value decrease and there by the characters movement speed as well until he comes to a stop eventually. This gives you a nice easy in easy out touch instead of instant full movement and instant stop.
Also, I haven't tried this but maybe it is possible to make your own smoothing of the controller input. If you can store a series of last input values and calculate the mean value(?) from these you get a bit smoother input instead of jagged ones. Don't overdo it as it should also add delay the more values you use I suppose?
btw, have you tried out the controller yet on your Windows 7 at home? Im curious to know if its just my setup, or a definate bug, that needs to be sorted out @ Autodesk.
thanks again
The way I handled speed as I mentioned earlier was with simple declarations of variables, if statements and some basic math. I'll try to find you some example, but I'm pretty much in a similar boat as you, I'm not that experienced with scripting.
Maya just crashes. Posts error first that Memory is low and might be "thrown" and that "XenonController". Then the program just shuts itself down.
Now I right-clicked both ControllServer and Maya and chose Run as Administrator. Now it doesn't post Low on memory but it's still saying it cannot find "XenonController".
Yeah I get that when running the define data server command. I haven't checked the device editor actually since I just assumed it wouldn't work cause of the error. I'm used to running the define string the first thing I do.
I'll check it when I'm back home tonight.
How is your project going?