The Best Way to Render Wireframe in Maya

A quick google for render wireframe in Maya will get you some sound results. Unfortunately, I tried them and they didn’t consistently produce the results I needed. So here is the most consistent, and thus in my opinion best way to do wireframe in Maya.

Method 1: “The Best Way” – Mental Ray Contours

Why is it the best?

It does not tessellate your objects. It can be applied to multiple objects without having to do new UV Snapshots. It can render in smooth shaded. It is quick and easy. And it uses the power of mental ray, and can look sweet if you do it right.

Process

  1. Assuming you have something to render, create a new material (can be anything that has a shader group – lambert, blinn, phong, etc.). In this example, I will be creating a lambert.
  2. Call the new material WireFrameMTRL and the shading group WireFrameSG. Who doesn’t like being a little organized ;) ?
    Note: If you clicked somewhere else and can’t get to the shading group easily, you can just go to the Hypershade and find the tab Shading Groups to find it.
  3. Go to the newly created lambert’s shading group WireFrameSG.
  4. Open the mental ray -> Contours tab.
    Note: If it isn’t there, you need to enable mental ray in your plug-ins Manager. Mental ray is called “Mayatomr.dll” so find it and load it.
  5. Click Enable Contour Rendering.
  6. Set the color to something you’d like. I like white.
  7. Set the width to something like 0.2 – 1.0. This setting is the absolute width of the wire frame lines. You can comeback and play with this later.
  8. Apply the material to the object.
  9. Open Render Settings
  10. Select render using Mental Ray (if it’s not there, go see the note for #4).
  11. Find the Contours Tab (it is under the features tab in 2009)
  12. Select Enable Contour Rendering
  13. Open the Draw By Property Difference Tab
  14. Select Around All Poly Faces
  15. Render!

And that is the easiest and most consistent way to get wireframe without the flaws of the other methods.

Here’s a shot of the result from one of my recent projects (with render settings fine tuned):

Rendering Wireframe with Mental Ray

The Worse Ways

For full disclosure, here are some other not so good ways to render wireframe.

Method 2: UV Snapshot

I don’t feel like doing the process for this one. It is somewhat of a pain to explain without pictures and frankly I don’t want to take them since it isn’t a method I’d advise. So here is a pretty decent video that does: http://www.youtube.com/watch?v=ZUFAtkVJdpg&NR=1

Method 3: Maya Vector

Rendering in Maya Vector is fairly painless to test. Unfortunately, Maya needs to tessellate all quads whose vertices do not fall on the same plane.  There is a way to find these planes if you have a few but in my case, almost all my quads are non-planar so there was no point trying to fix them.  So here we go on the process:

Process

  1. Assuming you have objects to render, open up your render settings dialog.
  2. Render using Maya Vector.
  3. Go to the Maya Vector settings.
  4. You can select Fill objects if you’d like. It will fill the object with a color you can select through the settings or leave it fill-less. For the example below, I unchecked fill objects.
  5. Un-check show back faces.
  6. Select Include Edges in the Edge Options Tab
  7. Choose an edge weight. I chose 0.5 for the example below.
  8. Choose Entire Mesh for Edge Style.
    Note: Outlines gives you a pretty cool effect. So try that too :)
  9. Render!

Wireframe render using Maya Vector. Oh boy look at the tessellation.

Method 4: Hardware Buffer

Hardware buffer is another painless way to render out in wire frame. Unfortunately, it doesn’t look nearly as cool as the previous two images. Anyways, here’s the process:

Process

  1. Open up the Hardware Rendering Buffer from Window > Rendering Editors.
  2. In the Hardware Rendering Buffer, open Render > Attributes.
  3. In the Attribute Editor, change the Rendering Mode > Draw Style to Wireframe.
  4. Render!

This one looked terrible so I didn’t capture an image of it. I couldn’t figure out how to do back-face culling so this quickly became the worst of the techniques.

Method 5: Toon Shader

The second best method to render wireframes in maya is to use the toon shader. I personally like the mental ray method better for the control and power of mental ray but this one seems just as good for simplicity’s sake.

http://www.artbycrunk.com/blog/2008/09/rendering-wireframe-using-toonshader/

Japanese Visemes and Phonemes

I’m currently working on an interesting project that involves Japanese speech lip-syncing of a 3D character. Since it was difficult to find resources on this from an English speaker, I decided to write on it.

Firstly, visemes are the unique facial positions required to produce phonemes, which are basic sounds from a particular language. Each language has multiple phonemes and visemes and each viseme can have multiple phonemes. In the English language, there are about 10 basic phonemes (a-i, e, o, u, c-d-g-k-n-r-s-y-z, f-v,th,l,m-b-p,w-oo-q) with one viseme each totaling 10 visemes.

When I first began looking into Japanese visemes and had luck finding resources, I decided to try to develop my own solution with my understanding of the language. In my view, the Japanese language is composed of some very basic sounds that are construed to make more sounds. Although the phonemes begin to add up, the actual visemes are almost exact. Combinations like じゃ(jya) can be formed accurately by combining their similar visemes  い (i) and あ (a). The following diagram depicts the 5 visemes:

Yours truly making visemes for animation

Again, I believe that with these 5 basic visemes, it will allow you to construct every mouth pose required for Japanese speech. Unfortunately, the character I am using lip-syncing for will most likely never have a tongue. This is important because, in Japanese speech,  the tongue is used more often than other languages (I’m thinking of English, but similar Latin-based languages fall in that category) and requires less movement of the lips to make the language’s basic phonemes.

Finally, near the end of my researching for this particular topic, I found this webpage that explains everything I just did and more: http://www.ordix.com/pfolio/research/

I don’t particular like the visemes for the first two sounds as the character’s teeth stick out far too much for my liking. It is entirely possible that the character is making the correct sound, but when I try the phoneme in her pose, it feels quite strange.

Japan: New Years Celebrations

It’s been awhile since I’ve written on Japan. This has been because of mostly the fact I’ve been here before for an extended period of time and simply ran out of things to write about. There are some things that have crossed my mind that could be interesting topics, but I’ll save those for later. This post however is on a new topic that I never got to experience the first time I was here. This time I truly got to experience Japanese life in regards to Christmas and New Years.

Christmas

Christmas isn’t much different in Japan than the North American version. You still get presents for your friends and family and they still get presents for you (or else would it really be Christmas?). Unfortunately for us, and I still don’t know if this is common, we didn’t have a Christmas tree. Instead, we used some makeshift plant as a tree and put presents around it. Hooray. The stores were their usual self playing Christmas music with Christmas decorations galore. It was interesting to see the local KFC with their statue of Colonel Sanders dressed up in a Santa outfit and to see at the local mall not Santa but guess who? Ultraman. Who needs jolly old saint Nick anyway? Why not a super hero sent from space to defend Earth from aliens? Way cooler.

Ultraman @ AEON mall


New Years

The most interesting Japanese holiday traditions involve New Years. I was kind of surprised at how important it is here in Japan after experiencing how similar Christmas was. Firstly, Japanese people support the Chinese astrology and subsequently the animals of the Chinese Zodiac. The new year brings the tiger to replace the cow so likewise, you see images of tigers and stuffed fluffy tigers everywhere. Secondly, New Years brings the most fun and interesting concept to shops: fukubukoro! Fukubukoro is a Japanese New Years tradition at shops where shops include random goods into a sealed container and sell it for one flat price. They tempt you with what could be in the boxes like for example some electronic stores package $500 worth of stuff into a $250 fukubukoro and hide it randomly among other lower valued fukubukoro. I did end up buying one as I’ve looked forward to this all year long. I got a Police fukubukoro for $50 that contained a necklace, bracelet, and a hat. If you know Police, you know that’s a steal. Thank god more people don’t know Police here or that price would go through the roof.

Among other things, Japanese people tend to have a very specific diet on New Years. They generally start eating a prepared meal of raw fish and traditional Japanese foods in the morning. From there, I think it’s up to the family. Specifically, we had sushi for lunch and sukiyaki for dinner, which are both still very traditional Japanese meals. Also during this time, older people are expected to give money to younger people in the amount of generally more than $100. No it’s not an early birthday gift or late Christmas gift; it’s extra.

Another interesting tradition for New Years is one I took part in early New Year’s morning. Not all Japanese do this but many have done it at least once in their lifetime. The tradition is to climb the local highest mountain, visit the mountain’s temple before sunrise, and then view the sunrise with everyone on the summit. As it can be very cold during January and at 5 – 7 am, it’s understandable people don’t do this every year. However, it is a thrilling experience when you climb a mountain in the dark and see the sun break from the clouds in the freezing cold.

Peaceful sunrise on New Years Day

Getting Things Done: The Personal Wiki

One application of David Allen’s Getting Things Done principles is the personal wiki (google Monkey GTD). Although the book is on my reading list and I have yet to touch it, there’s no reason to start ‘working on it’ early, eh? Well, I’ve been using a personal wiki for a few weeks now and let me tell you it is the best think since peanut butter. A personal wiki allows you to share knowledge with the most important person in your life — you! No, it’s not egotistical, it’s brain centric. Humans are notorious for forgetting things. If we stop, we forget. If we forget, we might lose information or skills that are necessary down the road. A personal wiki is beyond that. It is exactly like any wiki — it is searchable, indexes items, and can be used from any computer and certain mobile devices. If you know you are going to forget something, or want to write something down that could be important or interesting, why not save it in your own wiki? I don’t advocate being dependent on a machine to look up content you forgot or writing everything you read down; I’d rather you remember. However, as it’s impossible to remember everything, it could be a good source of knowledge kept just forgotten. Here’s an example of how I use it. Currently, I use it for is for writing book reviews to myself — at least for now. I remember a lot of details from books I read and yet I still forget a lot of the good stuff. The great stuff sticks, but it’s those one-liners and unique examples that might be peripheral to the solution but could really interest me down the road and allow me to remember complicated discussions and some of the reasons to support theories. Too bad I forget those the most. So, lately, I’ve been writing book reviews and keeping track of valuable information chapter by chapter — in my own words. I write a post to myself, indicating the main points of chapters and in a language I’m comfortable with. I don’t edit it as much as I edit assignments or work projects; it’s for my eyes only so that I can revisit it without having to read the whole book again. I also use it for jargon, definitions within my problem domain, that would otherwise be forgotten in a few hours if not minutes after look up. It’s a useful tool that maybe won’t pay off immediately, but in the long run for sure.

As for recommended personal wikis, I use TiddlyWiki. It is a 1 file HTML page that can be stored locally, on a jump drive, or on a server. It needs write permissions on the local drive to run but that’s certainly worth it considering how valuable it is. There are a ton of plugins for it if you know where to look. Goto this page to find them. All you need to do is download the index.html file and load it up in your personal wiki and it automatically detects the plugins and transfers it over. Neat eh? I was impressed on how powerful that one file is. I would hate to be working on it with a team of developers, but I can’t complain because it fits my needs perfectly. Anyways, I can’t express how useful this will be if you start using it. It might take some time getting used to but it can be like your own private journal — except this has a search function you might need 2 years down the road.

Productivity and Motivational Tip: Time Cost Table

I’m not sure if this is a standard tool, but I created it for myself to start seeing where my time was going and thought it could be valuable to others. Your personal time is valuable. And like anything valuable, you need to know what’s happening on a regular basis. It may not seem sensible at first, but I suggest creating what I call a time cost table. At the heart of it is knowledge — knowledge of where your valuable time is going. It is flexible in that you can use it in a relaxed or a strict way and still receive the benefits of using it.

So here’s what it looks like:

Start Time End Time Duration Item
7:02 pm 8:15 pm 1 hr 13 min Studied for GMAT – quantitative section
8:16 pm 8:45 pm 30 min Ate Dinner
8:46 pm 10:32 pm 1 hr 46 min Studied again for GMAT
- - - Total for the day:  2 hr 59 min GMAT // 30 min break

To use it, simply create your own in a word processing suite etc.  using the full page and the column headers in the example and start writing down start time and end times for work and break blocks. If you are working on homework, write it down. If you are watching TV, write it down. I try to imagine that I’m being paid for work or a goal for a certain day, say studying for GMAT for example, and that I have to work 7 hours for example on a free Saturday. By writing down the time, I can see where I take breaks, how long I take it, when I wake up, how long I actually study and subsequently how much I should be ‘paid’ for my time. Lawyers and other professionals use the concept of billable hours and a plan like this makes it easy to see how many hours are you billing per day. Imagine billing 9 hours per day for a goal, can you do it? What about 13? Now that’s hard.

Hopefully this helps make you more productive, procrastinate less, and reach and plan your goals accordingly.

Self-Service: Subservient Video AS3 Flex 3

As my first self-service application, the Subservient Video AS3 application allows users to build a fun, creative, and interesting interface for their website guests. This application is an upgrade to the popular AS2 subservient chicken open source application I released a few years ago. Since it was time for a revamp, I created this self-service counter and home for a new AS3 version – powered by Adobe Flex. If you aren’t familiar with my AS2 subservient application, check it out here.

What is Subservient Video?

Subservient video is a powerful video application that allows you, in a sense, to have a conversation with a video. While using the application, a user would enter in text in the form of sentences, keywords, or the like, and the video application will respond to these queries by playing pre-configured videos that match with the words being searched. All of this is fronted by a powerful Adobe Flex layout using skins, allowing the site owner to easily modify the look and feel of the application.

Sample showing subservient video teleport action

Sample showing subservient video teleport action

Try the demo online now

Licensing

The application is sold by the license. Please purchase the one you need. If you need assistance, please email me at ayan [at] ayanray.com.

Buy Now

With the power of PayPal, you can purchase a license now and receive the software and appropriate license via email/YouSendIt with instructions after payment.

License #1 $200 USD Single Character License for 1 site Includes manual, getting started guide, application files, two skins, sample application, and 30 day support (limited)
License #2 $400 USD Single Character License for 1 site no credit link Includes manual, getting started guide, application files, two skins, sample application, and 30 day support (limited)
License #3 $500 USD Site wide license for 1 site unlimited characters Includes manual, getting started guide, application files, two skins, sample application, and 30 day support (limited)
License #4 $900 USD Site wide license for 1 site unlimited characters no credit link Includes manual, getting started guide, application files, two skins, sample application, and 90 day support (extended)
Extras $200 USD + any license Source code included with any license Purchase a license and have the option of purchasing the source code for an extra fee

Note: There are different pricing available for NGOs and NPOs and for bulk license purchasing. Please contact me at ayan [at] ayanray.com for more information. Custom tuning is also available by request.

Definitions
Limited Support – Questions only.
Extended Support – I will help setup your application and answer questions. I won’t implement it but I will help configure it.


Feature Requests/Road Map:

None planned yet.

What is Subservient Video?

Coming Soon – SWFWindow AS3 Framework

They are a dime a dozen – a framework for Flash/Flex and AS3. It’s really quite simple making your own framework. You come up with what you want to accomplish and you develop general classes to accomplish that. It is very much like building a product. SWFWindow was my first attempt at building a framework that I designed and I used on a couple of well-known websites (global leaders in their industries). Now, I am finally planning on releasing it so people can pick at it and enjoy it while it’s still applicable. I won’t be supporting this framework as much as I have supported AssetLoader but I will nonetheless provide the documentation, example code, and code base required to get up and running in SWFWindow projects.

More on this later :)

Ayan

Code Agitation – The Perils of Duplication

Recently, I noticed something funny in a code base that I view seldomly. I was scrimmaging through the code of a maintained code base and noticed something sour – duplicated code. Duplicated code is not bad, when it is in the form of syntax of a language (haha)! And that isn’t real duplication! What I noticed was something that frustrates me, and surprisingly, wouldn’t have frustrated me 4 months ago. The duplication was basically 10 duplicated functions that were essentially identical to each other with hard-coded differences that should have been parameters and were written when the quantity of functions were low and the purpose was minor. What really irritates me is that this code has been updated many times and someone, in the words of Andy Hunt and David Thomas, did not fix the broken window. I’m not writing this post to complain, but to rather preach.

If you see something you know just isn’t right, take ownership of the code and fix the problem. It is easy to say it’s not yours or that you can do it next time or that the code base is so old it will be replaced. Well those excuses may or may not be true. But chances are, you will have to look at it again, or someone will, and you should fix it now while you know. If you aren’t familiar with this or it sounds familiar, it’s basically the principle of controlling the entropy within your project, which is preached within 3 of the 4 programming books I’ve read in the last 4 months. Whether it’s building an application, playing a game of pool, or anything for that matter, you should try to control the chaos and be pro-active and decisive with reason.

Thankfully, I fixed the problem. This is something that I do regularly and consistently now that I’ve gone through quite a learning curve. I refactor, refactor, and refactor some more. Perfection isn’t what you can add, it’s what you can take away.

AssetLoader Updates – we have video!

As promised, I’ve updated the AssetLoader and pulled it into the 21st century. It is a lot more… flex-ible if you get what I mean (of course you do). Anyways, as a reminder, you can sync up with the following repository to get the code: http://assetloader.googlecode.com/svn/trunk

A word of warning: the new repository is now a home for all my code related to AssetLoader and that means it’s larger and more complex. What could be in there other than the value-added loading code you might ask? Well, I’ve got loader tests, which include examples to prove to myself that video, sound, images, and xml work (I assume images and xml work since it’s been working since the beginning) and I’ve got unit tests (with hamcrest and flex unit 4). Although the tests and the unit tests are not complete, I will be adding more as I get more experience using video in flash and more experience using flex unit.

A note about the video loading: Take a look at the video example in the AssetLoaderTests folder. You will notice that I have to save a reference to the netStream. In order to close out the AssetLoader and remove all references (clean up for garbage collection), I must null all variables created within the AssetLoader. Thus, if you try to add the video without storing a reference to the netStream, you will either see a blank screen or a frame of the video (however far it got until the netStream was deleted). So, keep a reference of the netStream for all videos you load and show (you can delete the references if you don’t need it of course) in order to get around this issue.

If you really only care about the source code, and I expect most of you to fall into that category, sync up with this repo: http://assetloader.googlecode.com/svn/trunk/AssetLoaderSource

It’s got everything you need to get up and running.

And finally, if you really just want the source to play around, you can download the SWC source from google repository: http://code.google.com/p/assetloader/source/browse/#svn/trunk/AssetLoaderSource/bin

or the zip file here: http://www.ayanray.com/downloads/assetloader_v1.3.8

Comments, feature requests, and feedback are always appreciated! I’m making this class available to help you! If it doesn’t do something that you think it should, hit me back.

Roadmap


1.5  -> Array Support

1.6 -> Perhaps I’ll do support for wave files and other embeddable but not loadable files (through ByteArray)

AssetLoader has a new home

As promised, I am going to fix up AssetLoader so it delivers all that it originally promised. As I have been using flex lately, I realize that the AssetLoader class is more valuable than I originally intended. Flex itself has some rather bloated but powerful loading mechanisms and yet still has various interfaces to load different media at run-time. This new AssetLoader will intend to solve these issues and continue to be the light-weight, production safe utility class as it has always been.

Planned Features:
1) Add Array as an accepted method of loading assets (solves inability to load duplicate media issues)
2) Add Video and fix Sound Loaders
3) Automate ASDocs documentation for up-to-date documentation
4) Distribute AssetLoader.swc as the supported library package

Anyways, like the title says, AssetLoader has a new home. And it’s at GoogleCode – http://code.google.com/p/assetloader/

REMINDER: If you are using an AssetLoader below version 1.2, please sync up now so you have the most recent AssetLoader code. It truly is better than anything below 1.2.

Return top

About the Author

My name is Ayan Ray and I'm a creative technologist from Ottawa, Canada with a Bachelors in Information Technology. My expertise is in creating unique user experiences using computer science and design principles to develop intuitive applications that people can use effortlessly. I also have experience with 3D modeling, texturing, and animation for short animated clips and game design. I have completed projects for some of the world's top companies such as Adobe Systems, Salomon Sports, Wilson, Suunto, and Yokohama Tires. I've also read some of the most influential books in investing and computer science and share some of the lessons they teach throughout this blog.

Fatal error: Class 'Services_JSON' not found in /home/ayanray/blog.ayanray.com/wp-content/plugins/twitter-tools/twitter-tools.php on line 718