Another Programmer's Blog

Computer graphics, programming, and random stuff.

Subscribe to RSS feed

Sticky post

MayaFPS: First Person Camera Plugin For Maya

بسم الله الرحمن الرحيم



Introduction


MayaFPS
 is a plugin for Autodesk® Maya® which implements first person camera controls. The plugin allows controlling the perspective camera in Maya using traditional first person shooter controls (WASD for movement, mouse to look around). This is very useful and saves a lot of time for a lot of scene types, like game levels and architectural walkthroughs for example.


Please note that MayaFPS is not affiliated in any way with Opera or any of the Opera team members.


Voice work by Matthew Quinlan


Features


Here is a list of features that the plugin implements. See the online documentation for more details.

  • Traditional first person shooter controls using WASD. First person controls are engaged when you click and hold the right mouse button (RMB).
  • Keyboard modifiers for controlling the activation of first person controls. You can use any combination of CTRL, SHIFT, ALT, and the Windows Logo (WIN) key as modifiers (the default uses no modifiers at all).
  • If no keyboard modifiers are used, Maya's Marking Menu (the menu which normally shows up when you right-click the viewport) can still be easily accessed by tapping the left mouse button (LMB) while RMB is down. Once you get used to this, you will find that it's easier and faster than using keyboard modifiers.
  • Highly adjustable - tweak the plugin settings until it feels just right. Movement speed can be adjusted on the fly using the mouse wheel. Mouse sensitivity can also be adjusted using keyboard shortcuts.
  • Adjustable mouse smoothing parameters - the default settings are ideal for regular usage, but cranking the smoothing parameters higher makes rotations so smooth that recording a pleasant fly-through may no longer require key-framing the camera.
  • Ability to lock the camera movement across the horizontal plane to simulate walking instead of flying. To constrain the camera movement across the horizontal plane, simply toggle the CAPS LOCK key on. Toggle it off to free the camera.
  • Easy and intuitive user interface for modifying plugin settings.
  • Automatic updates notification. By default, the plugin will check for updates every time it's loaded in Maya.
  • Very low resource usage.


Plugin Requirements


In order to use the plugin, you will need the following:

  • A copy of Autodesk Maya which is supported by the plugin. Note that the plugin is available only for Microsoft Windows. The plugin supports the following versions of Maya. If you need the plugin for a version of Maya not listed here, please contact the author.
    Maya Version Bit-depth
    Maya 2008 for Windows 32-bit
    Maya 2009 for Windows 32-bit
    Maya 2010 for Windows 32-bit
    Maya 2011 for Windows 32-bit and 64-bit
    Maya 2012 for windows 32-bit and 64-bit
  • An active internet connection for the required one-time license generation. Once a license has been generated, no internet connection is required to use the plugin (see the licensing section in the documentation for more details).
  • A computer Mouse. Using a pen tablet or other pointing devices is not supported for first person controls.


Download


After you've reviewed the Plugin Requirements, please choose which version you want to download. Note that the free demo version has the following limitations:

  • When first person controls are engaged, the camera stops moving after some time. You'll have to release the right mouse button (RMB), then click again to continue.
  • Constraining camera movement across the horizontal plane using CAPS LOCK is disabled.
  • No keyboard modifiers for controlling when first person controls are engaged.
  • No "running" using SHIFT or "walking" using CTRL.
  • No mouse smoothing is applied, causing camera rotations to be somewhat jerky.
  • No mouse sensitivity adjustment.
  • Plugin settings do not persist between sessions.
  • No mel command.

View the End User License Agreement (EULA)

Get The Full Version
For Only $14.95
Secure Online Payments and Credit Card Processing by Plimus
With lifetime free updates


Update


Existing users of the full version please click here for update information.


Contact Information


  • Online Documentation: This is the first place to look for answers for questions you may have about the plugin and its usage.
  • General Discussion:  If you have anything to say that is even remotely related the plugin that isn't more suited in the other sections, post about it here. Post any video walkthroughs and I will embed them for everyone to view. Please be polite and respect others.
  • Feature Requests & Suggestions: Post about any ideas you have for the plugin. This can be new features, improvements, or special requests. Also, view what features are planned for the next release.
  • Bug Reports: Something is not working as it should? Post about it here. Also, view any known issues here.
  • E-mail: I will be constantly checking all posts made in the above sections, but if you'd like to contact me directly by e-mail, you can use this e-mail form, or find my e-mail address in the About page.



Copyright © 2011 Adel Amro, all rights reserved.

Search engine tags: mayafps first person shooter camera control autodesk maya plugin plug-in wasd fps perspective game level design

(C++) Event System Considerations

,


In this post I go over some considerations when deciding on the design of an event system to use in an application. The main purpose of an event system is to have some code in a part of the application (module) be called whenever an event in another module takes place. An event system is important in keeping the code modular and reduce dependencies and unnecessarily complex class hierarchies. So let's dive right in.

Read more...

Simple Paintable CGFX Material For Maya



This is a simple "paintable" cgfx material for Maya. It interpolates between different material attributes based on vertex colors. So for each vertex color channel, a different material is applied. If all the vertices of a mesh are black, the material corresponding to blackness is applied. If all are red, the material corresponding to red is applied... etc. See the screenshots.



This technique is used frequently in game engines (UDK for example), so this shader can be useful in previewing how an object would look inside the game if it had a similar material setup in the engine. It's also useful for setting the vertex colors from inside Maya in that case, instead of relying on the engine editor's painting capabilities.

Download le shader.

To use the shader:
  • Make sure the cgfx shader plugin for Maya is already loaded. It comes with Maya, but it's not auto-loaded by default.
  • Assign a new material to your object and select "cgfx shader" for the material type.
  • Load the downloaded cgfx file.
  • As I still don't know how to set up default values for shader attributes from within the shader code, you need to set up a few attributes in Maya yourself. Start by setting the "Specular Power" attributes to anything other than 0. Also, set the light position to, say, the perspective camera.
  • Set the properties for the different materials that correspond to vertex color channels. Set diffuse maps, normal maps, specular maps, specular power and color, and "bumpiness" as desired.
  • With the mesh selected, in the Polygons menu set, select Color > Paint Vertex Colors Tool
  • Bring up the tool's properties window and set the vertex colors as appropriate. By default, all vertices of a mesh will be white, so the last vertex color component's material will be used.
  • Paint away.


If you make improvements or have questions, let me know.
Textures in the screenshot are from nobiax. http://nobiax.deviantart.com/

MayaFPS: Bug Reports & Known Issues

If something is not working as it should, post about it here. Also, view any known issues here.

Read more...

MayaFPS: General Discussion

MayaFPS General Discussion.

Read more...

MayaFPS: Feature Requests & Suggestions

MayaFPS feature request and suggestions.

Read more...

Building a Dialog Box In Code

,


From the accompanying ReadMe:

This is a simple demo application to demonstrate the usage of the CDialogTemplate class (included) to build win32 dialogs in code (also called "in-memory") instead of loading the dialog from a resource. One advantage to building a dialog in code is that it allows for a solution to automate the generation of dialog boxes for editing different application structure types. Also, resource dialogs have a limit of 255 (or 256, I forget) children, while code dialogs don't have that limit. Building a dialog in code also reduces dependencies as you will not need to copy dialog resources around for use in different applications.

That said, in most cases a dialog built as a resource will likely look better (easy control arrangement), can be built faster, can be edited more easily, and otherwise more intuitive to work with. An excellent free tool to build win32 resources for your application is ResEdit (http://www.resedit.net/). Especially awesome if you have the Express version of VC which doesn't have its own resource editor.

To have your application use windows visual styles for its user interface elements, specify that your application uses version 6 of the common controls. Do that by setting the "Additional Manifest Dependencies" entry in your link options of your VC project to the following then rebuild:
"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='X86' publicKeyToken='6595b64144ccf1df'"



I clearly remember spending too much time with an MSDN sample demonstrating "dialog templates from memory" only to discover later it had a bug in it that makes it crash. Not the awesomest of memories.

Use this code however you want. A link back here or crediting me in your work would be awesome though.

Download demo and source.

Random bits of misc:
  • Hopefully very soon I will start selling the Maya FPS plugin. There are things to take care of first, like protection and testing. I hope it goes well though.
  • I maed a epic rage guy comic!!1!!11 Not so funny it seems sad
  • The last part of Half Life 2 Episode 2 where you defend the rocket base from waves of Striders accompanied by Hunters is awesome! It's so thrilling and different. I'm thinking that making a game around that concept, a co-op game especially, may not be the worst of ideas.
  • I'm detecting a lot of WIN in Kingdoms of Amalur: Reckoning. The more similar the combat is to Devil May Cry, the better it is in my books.
  • Magicka is FUN! I find it a lot easier to play with the keyboard than with a gamepad. Wish I had someone to play it with .

bbTablet Fix

,

Long time no update. Real life sucks. Anyway, bbtablet, developed by William Baxter, is a bare-bones WinTab wrapper C++ API for making the lives of Win32 programmers who wish to have tablet support in their apps a lot easier.Long story short, Curver, the application I'm working on, uses it, and it suddenly broke. I toyed around with it and I think I fixed the problem. Straight from the accompanying text file:

This is bbtablet with the modifications I made (mainly in bbTablet::initSystem() in bbtabwin.cpp) to make it run again. For some reason, after porting my project (which uses bbtablet of course) from VS2005 to vs2008 it stopped working and started crashing with a stack corruption error. Debugging revealed the call to bbTabletDevice::getInstance().initSystems() to be the culprit. Long story short, the cause was apparently that the author used code like this:

int tabnum=0;
while (0 != (ret = pfWTInfo(WTI_DEVICES+tabnum, DVC_HARDWARE, &hwFlags)))
{ tabnum++; }

to determine the number of devices. The code which works without problems is:

UINT nDevices = 0;
UINT ret = pfWTInfo(WTI_INTERFACE, IFC_NDEVICES, &nDevices);

This leads me to believe that the actual reason behind it not working anymore is not the switch from vs2005 to vs2008 but probably a coincidental tablet driver upgrade! The behavior of WTInfo() seems to have changed in a way that breaks the original code. That's why verbose debugging was reporting some 500 tablets and 400 cursors... etc (or whatever the numbers are).

Also, the code now uses the TCHAR type, and debug messages are now sent to OutputDebugString() instead of stderr.



Grab the modified source code here.(32KB)

EmuMMKB - Emulates Multimedia Keys


Another simple utility. I bought a cheap keyboard and only at home realized it doesn't have multimedia keys on it. So I wrote this simple utility for myself and decided to share it in case somebody for some reason finds it useful. Source code also included.

Download it (7KB).

Real Player, Real Alternative, and RealMedia Core Components


I bought a computer for my brother and it came with Real Player already installed in Windows 7. You should know Real Player is badware. It wouldn't uninstall properly ("uninstaller component missing" it says for some reason), causing the latest installer for Real Alternative (currently 2.0.2) to disable the checkbox that installs "RealMedia Core Components", rendering Real Alternative useless. I tried reinstalling Real Player so that it would be uninstalled properly, but to no use.

Anyway, long story short, I ended up removing both Real Player and Real Alternative and installing an older version of Real Alternative (1.9) (get it from here) which doesn't seem to care about whatever it is that Real Player left behind when it was not-so-successfully uninstalled. So it will install RealMedia Core Components anyway, and you should be able to play RealMedia files correctly.

This is meant to be one of those useful random blog posts you find while googling for a solution for some random problem. Hope it helps someone.

Edit 1: This proves to be not a windows-7-only problem.

Edit 2: Alternatively, check out this: http://www.joemanna.com/blog/how-to-uninstall-realplayer/ - contributed by anon.

Freedom



On September 27th (9 or 10 days ago), I was released from prison! I finished a 6-month sentence (for "causing a traffic accident that resulted in the death of a person"), and the day I was released was undoubtedly and by far the happiest day in my life thus far! My life outside is not particularly luxurious or exciting, but prison sucks! It certainly deserves to be called a correctional facility - after the time I spent there, I'm most certainly not going to break the law ever again. Being stuck in the same ~60-square-meter room with 45 people (mostly criminals) for a long time is not much fun.

The experience was certainly tiresome. I lost 15kg in weight (from 82 down to 67). But I feel it was useful in a number of ways. For example, I got to know some good people in there. Anyway, now that I'm out, it's time to get back to work. I'll soon start working during the day in a drug store doing accounting stuff, and afterwards I'll be working at home writing programs. I'll firstly finish up working on Curver and see how that turns out.

It's good to be free... it's good to be home.

Curver Progress

, ,


[EDIT]: Prison postponed till next week. Yay for temporary freedom!
Hi. While the development of Curver was nearing its first release milestone, it will have to be put on hold since I'll be sent to prison tomorrow following the very unfortunate car accident. I'm looking at a period of anywhere between 6 and 24 months.

I will make this short. I've improved on the construction of vertex positions to make corners in the curves look nice. See screenshot.

I've also modified the behavior of the Round Menu tool. Now instead of the user having to get the cursor inside of a button to highlight (and later select) it, now the user can highlight a button by dragging the mouse in its direction. This allows for quicker use of the tool. (Note: the line in drawn between the cursor, which is invisible in the screenshot, and the center of the round menu).

Also a new tool (the tangent tool) is added, which can be used to modify the shape of the curve in the familiar "handles" fashion. It's not finished yet though.

Plus some fixes and tweaks here and there. Shortly after I get out of prison, I'll create a limited demo version to get user feedback and start selling the thing. Good luck to everybody.

Direct3D Fluid Effect

,


There was a sample in the NVidia SDK with something like this but in OpenGL. I wanted to do it in Direct3D. It would look cool in a game's main menu or something. It's completely useless, just something to play with for a few seconds and then delete.

* Click and drag to push the liquid around.
* Press 'R' to randomize the fluid's velocity vectors.

Note: Technically it uses only one render target. Sampling from the current render target is not supported, so it's flawed. So it's quite likely it won't run on your machine or show artifacts.

Download it here (332KB).
[EDIT]: Changed picture.

First Animation (Lame)


Back in the day (some 4 years ago), I wanted to learn character animation. I made this little clip, it took a long time to make, and the result was poor, so I decided it was not my thing. It's a cool hobby though.
Uses IKJoe from rigging101.
Click on the image to download (340KB)

Speeding Rim Motion Blur Test


I made this little video a long while ago. I wanted to test Maya's motion blur and I had a model of a rim, so I said hey...
Click on the image to download the video (uses xvid codec I think, zipped since avi files are not allowed here) (~300KB).