• Blog
  • Work
  • Resources
    • Rigs
  • Resume
  • Contact
I do technical things...

A 3DS Max Gui you say?

1/24/2014

0 Comments

 
Wow. Almost Ten months of inactivity and two posts within a few hours!

So, recently I finished up a first pass on a GUI idea I've had for a while (though it's mainly a 'picker' at the moment).

I initially did a few prototypes using maxscript, with the dot net wrappers, and also plain c# winforms. However, I could not, easily, achieve some key features I wanted. Or, lets say, they were messier to manage when implementing these features. 
Mainly I wanted  the ability to pan and zoom around. Scale and pan functionality would allow me to really fill a gui 'page' with lots of stuff. From there the user can zoom and focus in to the area they are interested in, fingers for example. Out of the 3, WPF definitely handled 'transforming' ui elements the best.

I also wanted to be able to create and edit gui layouts inside the tool window, being able to lay out new button and edit existing ones as needed, even by an animator.

So here's what I ended up with:
In the video I'm using a default Cat Ape rig as an example, then creating and associating nodes with the gui form. 

To achieve this I used WPF for the window and buttons layout code. In fact it is all done in c#, using the .Net api to handle the Max node selections and some callbacks.

WPF uses lovely vector graphics to draw its ui elements so the implementation of my zoom functionality works pretty well, other than  the background image looking pixelated when zoomed right in!

For the 'Editing Mode' I had to implement a custom property on a class inherited from a Canvas. I had originally tried to manipulate an InkCanvas to my will, as it already has an 'Editing Mode' and the ability to move and manipulate child UI Elements. However, there were some drawing and selection issues with that that didn't fit what I wanted. 
I was dubious about the complexity on managing a 'state' like this across the drawing elements manually, as this was my first forray into WPF. It worked out pretty well in the end. Implementing it this way allowed me to control the mode changes with all the granularity I needed, and it wasn't that much work.

Again, I used the .Net api for the selection, callbacks and all max scene needs. I did, originally, plan on using maxscript for the max side stuff and exposing events through c#, then hooking them up on the other end, as outlined in this document. However, that code looked a bit messy, management wise, and didn't look like it would scale well. I really wanted to keep it all together and clean. 

After some searching, digging and trial and error I managed to get what I needed from max's .Net dll's. 
Now, it should be noted I am not doing anything fancy with the .Net API here. Mostly, I'm re-cursing the scene tree, grabbed from the Autodesk.Max.IInterface13.COREInterface13 instance, and collecting the IINodes I need. Once I have the IINodes selecting and deselecting becomes very easy.

It was a huge win to have everything in one project and codebase!
All in one VS Project!
All in one VS Project!
I inherited the ui elements I needed from basic WPF classes; buttons, canvas, tabs, etc, in to custom classes that simply add some properties and methods that store IINodes and manage the lists of IINodes.
I also implemented selection and file open callbacks to refresh and validate the nodes in the classes as needed. 

I created two 'types' of buttons the user can add to the gui, seen in the video. The first is a 'Selector', that is associated with a single node via name, and the second is an 'Executor' button, that can select multiple nodes and also run basic maxscript commands via string.  This allows me to be able to create the selection buttons and have 'selection set' and tools buttons.

I use WPF Adorners in Editing Mode to manipulate the with and height of the buttons, relative to their parent canvas. Adorners were a little tricky to get my mushy brain around, as it's basically an invisible layer on top of the ui element, and you have use the 'thumbs' in the Adorner system to drive what you want. However, once you get used to it (or as in my case got a really good example from the net and re-work it to my needs) it makes sense and really didnt need too much maintenance. 

Any 'gui layout' can be saved to loaded from xml files, that simply describe the buttons, tab and properties.

Again this is Pretty first pass stuff. There are lots of things I'd like to add to this in the future, sliders to manipulate properties and auto generate rig buttons to name a couple. For now the foundation is in and working really well. 

Also, it was really nice to use c# for a while. Damn nice language.
0 Comments

Shadows Of The Past!

1/24/2014

0 Comments

 
So recently, on the webs of the net, dropped the first gameplay video of Middle Earth : Shadow of Mordor.

Middle-earth: Shadow of Mordor

I had the great privilege of working on this title while at WB in Seattle. I was a Rigger/Technical Artist on this for around a year, mostly in pre-production... Those orcs look very familiar :D.

It's really, really great to see it, and looking damned sweet. The guys there have really taken it on leaps and bounds over the last year and I'm really excited to see what my old comrades have done, when I get to play it.  It really is such a talented team. Fond memories.
0 Comments

    Andy T.

    I do Tech things for Artist.

    Archives

    July 2014
    February 2014
    January 2014
    April 2013
    August 2012
    March 2012
    February 2012
    December 2011
    July 2010

    Categories

    All
    3ds Max C#
    3ds Max .net Api
    Animation
    Api
    Face Rig
    Maxscript
    Maya
    Mel
    Python
    Python Api
    Rigging
    Scripting
    Ui
    Work

    Links To Cool Folks

    Mic Marvin
    Alex Utting
    Rick Vicens
    Gary Talbot
    Richie Prado
    Felipe Nogueira

    RSS Feed