Thursday, May 29, 2014

Gamma Correction - Nuke - Open Color IO

Hot topic. I cloud write a lot about this but the information available on the net already. I started to examine this topic because I wanted to have a solid understanding Nuke's color management.

So I found two very useful articles about it.
The first one is especially about gamma correction:
Gamma Correction

For me the most important thing to understand is the following:

Human eyes see as linear - perceptually linear
Computers / cameras see as linear - value linear


The second one is a brief overview about Nuke's color management and there is an explonation how Nuke uses gamma correction:
Color Management In Nuke (By Steve Wright)

Okay, you went through and now you understand gamma correction. So here it is the next lesson:
Since VFX industry utilize different softwares with different color management there is a need to make a standard for VFX studios. Read more about this here:
Cinematic Color

Okay, you went through the first couple of pages and you really understood the topic is quite complex. Don't panic I felt the same.
But the solution is here as the PDF says: Open Color IO


Friday, May 16, 2014

Blender For Feature Animation Film

Recently I have been thinking about Blender. Because I never used it I considering things as a professional who might want to learn and / or switch to Blender.
I think to get a job as a professional Blender user is not an option currently especially in my home country Hungary.
I have a lot of personal projects which involves CGI and VFX as well and I definitely don't want to spend money to buying softwares for those. So this motivation is pushing me toward open source softwares like Blender.
To compare 3D softwares and discuss about differences between them is a never ending story. I think it is a very complex thing to claim which software is better then the others (if it is possible).
I started to collect information about Blender and watched films like Big Buck Bunny and Tears Of Steel. For me these shorts prove that Blender can produce decent quality full CGI and VFX. I can't say those are cutting edge like VFX that ILM or other major facilities can do. But it is not just about the softwares they use.
Because I'm involved preproduction of a feature animation I raised the question (for myself): Can Blender be a choice for full CGI feature animation? I know there are current project around the world. At the Blender Conference 2013 "father of Blender" Ton Roosendaal mentioned few of them.
Worth to mention Blender community is now working on an open (online) feature animation project: Project Gooseberry

Tuesday, April 8, 2014

Maya 2015

Finally Autodesk released Maya 2015. Oh why, oh why? I don't get the idea why they release every year a new version. Maya 2015 has a lot of very cool new stuff and I can't wait to use it in the studio (as a matter of fact it will take a while). And as I'm writing these lines I realize there are really exciting features what seem very useful in everyday work. Actually I changed my mind. First I wanted to criticize but I have to say Maya 2015 is a big release. Mainly I'm disappointed about Bifröst. As we can read here current implementation is rather an eye candy (or a toy).

Another thing that bothers me is SOuP. There is no sign that Autodesk would like to start some kind of co-operation with the SOuP guys despite at the Ideas of Maya Forum this topic is the hotest. And Bifröst seems not going to be a full procedural framework (quotation from the Jedi of SOuP). Furthermore having a texture deformer in Maya 2015 proves that they really don't think that proceduralism or SOuP should be the direction.

Maya 2015 User Guide - What's news

So what do you think?

Friday, February 28, 2014

Maya Tools - Locator size by scale - Write a function

So, we saw there was a simple 4 lines script to adjust locator size by scale.
How to make a so called tool?
I have no idea whether there is a scientific approach of that. I know about writing a specification. As a matter of fact I found a good article about that: Painless Functional Specification
I simply skipped the first chapter because I knew that is important so I didn't need a tale about that :)

But before I even knew about specification I usually thought as a user because I stared my "career" as an artist not a TD.
In this case this tool  should be only one click solution: Set Locator Scale By Size. To make it clear it is not for locator type object but cameras and lights. There shouldn't have been any other things just one button to click so we can move on to technical specification.

First of all we should write a function:

 def LocatorSizeByScale(Selection):  
     for item in Selection:  
         scaleVal = cmds.getAttr(item + ".s")[0][0]   
         cmds.setAttr(item + ".s", 1, 1, 1)   
         cmds.setAttr(cmds.listRelatives(item, shapes = 1)[0] + ".locatorScale", scaleVal)  

The argument should be a Selection. In maya ls command results a list no matter whether it is one or more object so the Selection has to be a list (array). With for cycle it works more than just one object. So we can run the function like this:

 LocatorSizeByScale(cmds.ls(sl = 1))

But as I wrote before there could be a lot of error situation. I'm a visual thinker. I don't make every time flowcharts but for the sake of this demonstration I'm going through the whole process of visual design. I'm a self-taught programmer and this is my practice not a scientific approach.

First I made a sketch of a flowchart.



It took around 5 minutes and another 5 minutes to verify and add notes. After that I could start coding. I had a clear picture how it would work. Okay but I don't expect reading that from anybody. I made a better picture for this article.





This flowchart shows everything what we need. If we can draw a flowchart like this we have a clear picture how the function is going to work. So the coding is just an execution of the plan.

The result code:

 def LocatorSizeByScale(Selection):  
     '''  
     DESCRIPTION  
     Scaling camera for eg. can cause problems (Z-Depth pass can be wrong for eg.). So scale value should be transfered to the locatorScale attribute.  
     If the object (the selected node's first shape node) has locatorScale attr it will be adjusted by the transform node scale.  
     INPUT ARGUMENTS  
     list - Selection - Selected nodes  
     RETURN  
     None  
     DEPENDENCIES  
     maya.cmds  
     maya.mel  
     '''  
     if Selection:  
         for item in Selection:  
             if cmds.nodeType(item) == "transform":  
                 # Only checks scaleX attribute. That means non-uniform scale not handled.  
                 scaleXVal = cmds.getAttr(item + ".scale")[0][0]  
                 if scaleXVal != 1:  
                     # Only the first shape node considered  
                     shapeNode = cmds.listRelatives(item, shapes = 1)[0]  
                     if shapeNode:  
                         if mel.eval("attributeExists \"locatorScale\" " + shapeNode):  
                             locatorScaleVal = cmds.getAttr(shapeNode + ".locatorScale")  
                             cmds.setAttr(item + ".scale", 1, 1, 1)   
                             cmds.setAttr(shapeNode + ".locatorScale", locatorScaleVal * scaleXVal)  
                         else:  
                             raise StandardError("There is no locatorScale attribute to adjust.")  
                     else:  
                         raise StandardError("There is no shape node.")  
                 else:  
                     print "Default scale value. Skipped."  
             else:  
                 raise StandardError("Only works for transform selection.")  
     else:  
         raise StandardError("There is no selection.")  
 
Further development
Better error handling in connection with selection and selection types
Non-uniform scaled object
Option to warn non-uniform scaled object
Option to warn already set locatorScale value

We will continue...

Recent News - Kenau

I didn't have time to write during the last couple of mouths. It was quite tricky to manage my time. After all our project in the studio where I work was finished.
Kenau is historical film take place at the time of Dutch War of Independence. So at Digital Apes we handled around 300 VFX shots. There were different type effects we did. Mainly set extensions, cg cityscapes, matte paints, clean ups. There were shots we had to add arrows (usually storm of arrows), blood on swords and on amours, fire, smoke, etc. And there were more complex shots where we add a lot of elements like crowd, explosions, demolitions. And last but not least there was the opening full cg shot which was around 1000 frame long and we had to create a cg Great Black-backed Gull and a complete cg aerial view of the city of Haarlem at the time 16th century.
Personally I was glad to work on a movie what makes sense for me. We didn't have to make giant robots or dragons or demolish whole cities. As I wrote before I like movies where the VFX don't lead the story but support it. Kenau is like that. I can't wait to see it in theater.
I was involved just a couple of VFX heavy shots directly. But I supported the whole 3D crew with technical and pipeline stuff as well.
First of all I made the animatic for the opening shot. After we had to clarify our asset pipeline. Basically it meant we had to establish a naming convention for textures, shaders and Arnold StandIns. I wrote dozens of python functions to make it simple but it turned out the issue is more complex so I didn't have time to make a tool what every 3D guy could use. The next pipeline issue was the camera. The idea was that we should use Alembic camera so all the nuke and maya users would use the same asset for their shots.
My biggest challenge was to create the rig and the animation of the seagull. It took around two month. I can't say it could not be better but I like the result very much. I'm biased :) If I have time I will write a whole post about the seagull rig. To summarize I can write only common places: to have good animation, and anatomy references was crucial. Of course we could download a lot of pictures from the net but it was almost impossible to get a good quality footage about a Great Black-backed Gull flying as the camera followed it. The other problematic thing was the skeleton. I found a lot pictures about a bird skeleton but not seagull. We talked about in the studio we should catch a real seagull and did the research for ourselves (if you know what I mean).
Other major challenges were the demolition, explosion scenes. There were 4 large scale explosion in the movie I had to create. I create maya fluid effects and particle and nCloth simulations. I have lot of things to write about this topic so I'm going to continue it (soon)...

Tuesday, December 3, 2013

Naming Convention 1.

Simply it is the most important weather you are an artist or technician (so called TD) in the VFX industry. Furthermore it is the most important thing for mankind (or the universe). Naming convention is essential for everything.
Unique projects has unique naming convention. But let's pretend you won't do anything that nobody did before meaning of the process. So there are guidelines.
Naming convention is extremely important but there is another principle. As Richard Williams wrote in his book: "Keep it stupid simple." aka KISS.
Working with computer means you use operation systems like Windows and you create files which could be organized in directories. But you will find out sooner or later there are at least 2 big problem here.

Big problem 1.
One file can only belong to one directory.

Big problem 2.
More data we have that we can simply put into names, filenames for eg.

But these problems raise a lot of other issues. And this blog is more or less about to discuss those issues. Right now I simply use the KISS principle which also means (for me) do it as you can.

So we need a general solution of file naming. Before I tell you the truth I gather some ideas.

1. Importance of the order

Usually files are arranged by their names (alphabetical order).  So by giving names we can describe the order of the files.

2. Parts (tags)

We can of course combine different information usually called tags. So the question is how many tags should be there to collect the most important information?

3. Compressing information

We can say abbreviation but is more than that. Question is how can we compress more and more information into alphanumeric character. So for eg. we can use abbreviations but in that case we should establish a dictionary for those, because BG does not necessarily mean background for everybody.

4. Documentation

If you are a one person studio you might think documentation is not important. But it is. I think it is for every scale of facilities. So the naming convention should be documented. It can change over time from project to project and that means the naming convention document can have versions or can be attached to projects. It could be a simple text file.

4.1 Documentation template

Usual form to template naming convention is:
[tag1][separator][tag2][tag3][separator][tag4]

It can describe a file rules as well.

We can use explicit characters and variable names to be more clear.
[name]_[versionLetter][versionNumber]_[comment]

It could be necessary to explain the rule of the variables. We can call it file rules.
[name] Starts with capital alphabetical character and contains any alphanumeric character
[versionLetter] - Any non-capital alphabetical character

This example above use the "_" (underscore) as a constant character or tag. That means you can't change it. Usually when we describe a file path there are constant directories so they are constants as well:
e:/ Projects / [ProjectID] / 2D / ConceptArt / [AssetID] / 
[AssetID]_[versionLetter][versionNumber]_[comment]

In this example above the "Projects", "2D" and the "ConceptArt" are constant tags.

More complex when we use expressions like "AssetID", because this is not a simple variable but a concept plus and abbreviation (ID = identification). We should describe things like Asset and/or AssetID before we use it. But it is not the part of the naming convention documentation rather a documentation of the pipeline or system we utilize.

5. Character table
It is always recommended not to use special characters. That means file names contain only alphanumeric character, underscore and hyphen. We can express with regular expressions: [A-Za-z0-9_-] (see below)

So this would be my general template for file naming:
[name]_[vatriationLetter]_[versionLetter][versionNumber]_[comment]

And the rule for this pattern:
[name] - Starts with capital alphabetical character and contains any alphanumeric character
[variantLetter] - Only one capital alphabetical character
[versionLetter] - Only one non-capital alphabetical character
[versionNumber] - Two digit starts with 01
[comment] - Any alphanumeric character


Below we can see a series of examples how it looks in practice. So it is more like the explanation of the concept behind this naming convention.
Let's say I'm working on a landscape concept art. So the name part would be "Landscape". I separate the process stages like sketch, details, colors. So the version letters represent these stages (a, b, c). I can also comment where the stage starts to be more clarify.
Usually when we work on something we don't consider at the beginning there might be another variant for the subject. So if we use "A" as a base variant we won't ruin the naming convention later with adding an extra tag.

Landscape_A_a01_Sketch
Landscape_A_a02
Landscape_A_a03_Background
Landscape_A_a04
Landscape_A_a05_FGTrees
Landscape_A_b01_Details
Landscape_A_b02
Landscape_A_b03_BGMountains
Landscape_A_b04
Landscape_A_b05
Landscape_A_c01_Colors
Landscape_A_c01_SkyAndClouds

You might find the "a", "b", "c" a little bit confusion to use for versions. You are not the only one. Most people use a "v" letter like  "v01", "v02", etc. But using only one constant version letter we can't embed more information with that.


Footnotes

Regular Expressions aka Regex

Regex is a tool to analyze names. Usually it used to verify and search. If you have a basic idea how regex works you might want to establish naming convention that can be easily handled with regex.
For eg. the naming convention above can be described as regex pattern like this:
[A-Z] [A-Za-z0-9]+_[A-Z]_[a-z][0-9]{2}_[A-Za-z0-9]+

So the regular expression tells to the engine the name:
Starts with one capital alphabetical character [A-Z], followed by alphanumerical character [A-Za-z0-9], it could be one or more +, followed by an underscore _ (constant letter), followed by a capital alphabetical character [A-Z], followed by an underscore, followed by a non-capital alphabetical character [a-z], followed by any number [0-9], it has to be exactly two digit {2}, followed by underscore, followed by any alphanumerical character [A-Za-z0-9] and it could be one or more +.

The real benefit to use regex comes when you or your studio use programming languages or other tools to verify or match paths, file names, or any kind of text, etc.


Monday, November 25, 2013

Maya Discovery - Large distance from origo cause skinWeight problem?!

Achtung, achtung! Alarm, alarm! Riadó, riadó!

I found a very strange behavior of maya. I created a simple rig used smoothBind skin. Everything is fine until I place the character to large distance from the origin, let's say x: 150000, y: 80000, z: -32000 and I turn on subdivision (pressing 3 key) to see a smooth mesh.

Here are the example pictures:










I have the feeling that skinWeight normalization results this, but no idea hot to fix it.