Quasar Fighter

Written by mattanimation. Posted in Game Dev

My first iOS game is up in the app store as a free download here.

qf_title

This was a simple game created in cocos2D and objectiveC. This was mainly a test just to get through the whole process of getting an app together and submitting it and seeing how it was received by Apple and all that. The next game is in the works and a port to the Android platform is in the works, so I’ll be off to learn me some C++ to get it together with cocos2Dx. After that I will then move on to 3D using Unity. I have another post I haven’t finished yet that will go over how I went about getting setup to develop for Apple and getting equipment on a budget and all that fun stuff.

In a related note since I have started doing more app dev I decided to start my own company called:

ai_logo

I hope to be able to release much more content once I get that site up and running.

Cheers!

PyQt Stylesheets, Maya, and Python Oh MY!

Written by mattanimation. Posted in Maya, pyQT, Python, Tutorials, UI

Ok, so you have some tools built and you have a basic understanding of Python and Maya but you want to start customizing things a bit more, maybe the ‘plastique’ style UI just isn’t as cool as it used to be and you want your tools to have a uniform or unique style to them. This is where stylesheets come into play.

No doubt if you have searched Google you have found the post in TAO that Yasin Uludag started where he released his “darkorange” stylesheet. This is a great resource to get started, but I think there are some details still missing on how to get it setup and working so I decided to make a simple tutorial on how to get a basic application started. This tutorial features the following:

  • How to create a simple PyQt application
  • How to create and compile a .qrc file for icons
  • Edit Yasin’s stylesheet to create your own style
  • Have the application set some options to send to mayapy and create a maya file
  • maybe create your own app to compile .qrc files to .py files easier
Part 1

Part 2

QRC Code:

<RCC>
  <qresource>
    <file>images/checkbox.png</file>
    <file alias="down_arrow.png">images/down_arrow.png</file>
    <file>images/handle.png</file>
  </qresource>
</RCC>

Shell Script:

pyrcc4 icons.qrc -o icons.py

Python:
References:

http://nathanhorne.com/?p=451
http://lateral.netmanagers.com.ar/stories/BBS49.html

Useful Python Snippets Pt.1

Written by mattanimation. Posted in Python

Here are some useful python snippets I have found out on the interweb. I make no claim to them,  use them!

How to find a user’s appData folder on Windows:

def _get_appdata_path():
    """
    get the users path to appdata folder
    """
    import ctypes
    from ctypes import wintypes, windll

    CSIDL_APPDATA = 26
    _SHGetFolderPath = windll.shell32.SHGetFolderPathW
    _SHGetFolderPath.argtypes = [wintypes.HWND,
                                 ctypes.c_int,
                                 wintypes.HANDLE,
                                 wintypes.DWORD,
                                 wintypes.LPCWSTR]
    path_buf = wintypes.create_unicode_buffer(wintypes.MAX_PATH)
    result = _SHGetFolderPath(0, CSIDL_APPDATA, 0, 0, path_buf)
    return path_buf.value

How to find the dropBox path on a users computer:

def getDropBoxPath():
    """
    find the dropbox path of the system running the script regardless of
    location
    """
    from platform import system
    import base64
    import os.path

    #check system and build path to dropbox host file
    _system = system()
    if _system in ('Windows', 'cli'):
        host_db_path = os.path.join(_get_appdata_path(),
                                    'Dropbox',
                                    'host.db')
    elif _system in ('Linux', 'Darwin'):
        host_db_path = os.path.expanduser('~',
                                          '/.dropbox',
                                          '/host.db')
    else:
        raise RuntimeError('Unknown system={}'.format(_system))
        return None

    #see if path exists
    if not os.path.exists(host_db_path):
        print('NO DROPBOX INSTALLED == defaulting to c:/')
        return 'C:/'
        raise RuntimeError("Config path={0} doesn't exist".format(host_db_path))

    #open and decode the host file to reveal the path
    with open(host_db_path, 'r') as f:
    data = f.read().split()

    return base64.b64decode(data[1])

PIL issues in Maya 2013

Written by mattanimation. Posted in Python

As a follow up to the last post, for those of you who happen to be using PIL inside a Maya tool (running from within a mayapy execution) it will NOT work. Read the following post. I ran into the issue with one of my tools that was working fine in 2012 and when my client changed to 2013 to avoid and issue in 2012 we got this new one. As of now the only solution is to find a version of PIL compiled against VS2010 as of now it is VS2008 and the new Maya Python library has been compiled against VS2010. The solution I came up with for my tool at the time was to take the portion that was using PIL out from within the mayapy execution and have it run from the main application scope since the tool was outside of Maya anyway. It works for now but really is unintuitive to have to do that.

PIL for Win 7 64-bit Install Issues?

Written by mattanimation. Posted in Python

I ran into a bit of  a snag when trying to install PIL (Python Image Library) on my 64-bit Win 7 machine. I got errors with the installer saying things like “No Python dir found for 2.6″, so then I found some links on stack overflow that said to try manually creating a registry file and then that should work but it didn’t. I eventually stumbled (form this link) onto this site that has a bunch of “unoffical” realases of third party packages. They have a 32 and 64-bit version that is compiled and it WORKS! Installed fine, then rand idle and tried import Image and was successful and just to be sure I ran sys.path and sure enough the path to the new PIL lib was there.

Rigging Dojo Week 3

Written by mattanimation. Posted in Maya, pyMel, pyQT, Python, Rigging

So during week 3 it came down to finish up the base skinning and figuring out how I was going to tackle the corrective shapes and/or helper joints. My mentor showed me a video of some tools he uses that I found to be very useful so did my best to re-create them. While doing so I came up with these two tools.

Tools

  • Skin Weight Slider – I really just wanted to get out the idea that was in my head. I have seen nudge tools in the past, but as I was working I visualized a graph with colors to represent the weight values, and sliders to control them, the sliders would update as other influences changed. In a way it is just more simplified and interactive component editor. Still needs some tweaking to make the calls to get the weights smoother. It also has a button to show the influenced verts of the selected joint.
  • UV Pose Driver  – This one is like a simplified PSD tool. It creates a shape on a joint that reads the point on surface where the joint above is in relation to, by keeping a 0-1 value the info from the uv co-ords can be used to drive a corrective shape. Still updating this one as I go as well. The way the tool works is:
    • Select a blend shape from list (updates blend target list)
    • Select a blend target
    • Give pose a name
    • Create it, then position it at the angle where you want the values to be driven.
    • rinse and repeat.

 

Rigging Dojo Week 2

Written by mattanimation. Posted in Rigging

I’m a week behind but that’s better than 2 weeks behind right? This weeks focus was on joint placement and initial skinning of my character. The character’s name is Frank and he is from a short film that a friend and I have been working on, he did the modeling and character design.

Challenges

  • Frank is fat, let’s not beat around the bush. Volume preservation is probably the most important and challenging thing for this guy. His neck and wrists, oh, and that huge gut too are all in need of clever joint placement and weighting.
  • Pants are a challenge in this case due to the shape as well, making sure he keeps his butt volume when squatting down while not overly scrunching up the front of the pants is still work in progress. Most likely some corrective shapes will be in order.
  • His shirt will be skinned overtop of his body and will have some nCloth on it with the inputMeshAttract turned up so it’s just subtle enough to get some nice sliding and secondary motion on the collar and sleeves. Keeping the speed up the rig up and avoiding intersecting mesh will be…fun.

References

The references I was able to gather helped with the joint placement. If you look at the image below with the x-rays you can see how deceiving the outer flesh shell can be. The skeleton is a normal slender frame and joint placement should reflect that in a character that is larger like Frank. There another image from Wreck-it-Ralph that I thought was as great example of volume preservation in a tough pose, so I used that as a goal to get Frank into something similar.

I haven’t added any helper joints yet, that will be week 4 (technically this week), week 3 Updates soon. I think the hands and shoulders turned out the best, I hoping to make the wrists awesome too.

Learning the Maya API

Written by mattanimation. Posted in Uncategorized

A great training resource just came out by Chad Vernon that I couldn’t pass up

CLICK HERE to check it out.

So far it has been some really great info. Some of the setup involved to get started and make sure you can develop for all platforms seemed pretty tricky and would have been time consuming to figure out alone. Can’t wait to see what other great info this training is chock full of.

Rigging Dojo Week 1

Written by mattanimation. Posted in Rigging

RD Logo

 

I finally started my first 6 week session with rigging dojo! Seemed like was never gonna happen but it did, I can tell I’m going to get a lot out of this based on all the questions I’ve already got answers to, I need to think of more. I will be posting progress on what I’m working on as time permits, hopefully one a week.

This weeks focus is to first off answer a ton of questions I have, then figure out goals for the next few weeks based on specific areas of focus like deformation, mesh articulation and more…

What is Rigging Dojo? In a nutshell its a personalized course on rigging or scripting with industry professionals. Click on the image to find out more about it.