Area :: Header
Autodesk University
The future of making things
Discussion Groups

Python

Reply
Valued Contributor
spark
Posts: 52
Registered: ‎01-09-2007

map scripts to input device?

164 Views, 3 Replies
08-31-2010 05:43 PM
If I plug in a joystick is it possible to map scripts to various buttons and whatnot on the joystick?
Please use plain text.
Active Member
Trizoy
Posts: 6
Registered: ‎08-23-2010

Re: map scripts to input device?

09-01-2010 04:53 PM in reply to: spark
It sure is :smileyhappy:

1)First, drop a 'Script' device into the scene.
2)Next, create a relation constraint, and add the script device as the receiver.
3)Now you'll want to add the script you've made to your scene.
4)At this point, you'll see the script appear as an item within the 'script device'; you'll be able to connect things to it as you would any kBox.
5)Finally, drop your joystick device into the relation constraint, and connect your script with the desired button on the joystick.

Note: Keep in mind that the script event will trigger when a boolean value of 1 is reached from the joystick (how most joysticks indicate a button press).

Please use plain text.
Valued Contributor
spark
Posts: 52
Registered: ‎01-09-2007

Re: map scripts to input device?

03-21-2012 03:18 PM in reply to: spark
As a follow-up to this, I'd like to map camera controls to a joystick, but I'm at a complete loss as to where to start.

If I drag a created Camera into the Relations or Expression constraint pane, I only get the camera's TRS.

For example, if I plugged in an XBox controller in and hit the "A" button, I'd like for that to toggle the "Lock Interest Navigation" checkbox.

If I move the right stick left or right I want to rotate around the interest point, etc.

As it is, the only values I can seemingly constrain are the camera's TRS?

Put simply, I want CTRL-SHIFT-LMB to get mapped to the right analog stick of the 360 controller.

Is that even possible?
Please use plain text.
Active Contributor
omnized
Posts: 26
Registered: ‎05-07-2008

Re: map scripts to input device?

03-21-2012 03:31 PM in reply to: spark
This might be what you want, or at least set on you on the right path to getting there :smileywink:

http://gware.blogspot.com/2010/03/fps-camera-in-motion-builder-using.html
Please use plain text.