Posts

Showing posts with the label learning

Nuke's Colour Selection Scheme

Image
In these last months I've had the opportunity to become more involved in compositing in Nuke. This involves a lot of working with colours. One of the things that had me curious for while was the sliders on the right side of the standard nuke colour picker.  I am talking about the vertical sliders on the right of the image above.  After investing some time in reading the Nuke documentation, I came to the appropriate page  that indicates that this is the TMI colour scheme that allows the user to pick a colour by colour temperature.  Nuke also allows for a more comprehensive colour picker by ctrl/cmd-clicking on the colour wheel icon (to the left of the "4" icon on the right of the image above). Nuke calls it the alternative colour picker. Activating it this way will create a floating colour picker panel that you can interact with. In this panel, you can use the top buttons to toggle the visibility of the TMI, HSV and RGB colour schemes to work with whichever way that i...

Great Article: Matthew Merkovich Says To Stop With The Crazy Tracking Markers

Matthew Merkovich Says To Stop With The Crazy Tracking Markers Today I came across a great interview with Matthew Merkovich on LesterBanks dated 2 years ago. He's a very experienced CG artist. Having spent many years doing matchmove, he gave some of his insights into the quirkiness surrounding the craft and many misunderstood practices that may not be applicable given the capabilities and accuracy of the software tools available to us in the present day. One of the points he raised is relating to the practice of placing red/orange crosses for markers during location shooting simply because they are told it is the best way to do things. On top of this, in the interview he also has a list of matchmoving dos and don'ts, advice and tips! Matthew also has a series of videos showing many matchmove tutorials. Follow him on Vimeo ! Tracking Marker Guidelines from MattMerk on Vimeo . As an artist that has been doing matchmoving for no small number of years, I am gla...

Foundary Post: How Data Analysis is Improving Matchmoving

Image
Today I came across a post on Foundary's website about data analysis and matchmoving . Alastair Barber tries to improve and speed up the pipeline with data analysis and algorithms while working with DNEG . Matchmoving is something close to my heart. I started my Hollywood film career as a matchmove artist. I'm also quite interested in machine learning, data analysis and artificial intelligence. Thus this article grabbed my attention. It seems that DNEG is a great choice for data analysis, having accumulated 20 years of production data. The article does not have specific mention of how the result of the analysis is helping to speed up the process of matchmoving, but we know for sure that something is happening in the field of data and the VFX production process. Graph source:  https://www.foundry.com/trends/business/matchmoving-big-data However there is one concrete thing I find fascinating in the article. This graph in the article actually gives an overview ...

pymel.core Versus maya.cmds

Is PyMel slower than Maya's cmds module? PyMel is an alternative to Maya's native maya.cmds. It was developed and maintained by Luma Pictures . It is open source, and lives in GitHub here:  https://github.com/LumaPictures/pymel Pymel was so intuitive and successful that Autodesk has shipped with pymel alongside its maya.cmds. Today I stumbled across a discussion: https://groups.google.com/forum/#!topic/python_inside_maya/n8WUdQHhw1k Someone was asking if pymel performs as quickly as native maya.cmds. Another person referenced this article:  http://www.macaronikazoo.com/?p=271 The author (Hamish McKenzie) did a comparison with his following code: import time import maya.cmds as cmd MAX = 1000 start = time.clock() for n in xrange( MAX ): cmd.ls() print 'time taken %0.3f' % (time.clock()-start) from pymel.core import ls start = time.clock() for n in xrange( MAX ): ls() #NOTE: this is using pymel’s wrapping of the ls command print 'time taken %0.3f' ...

New Documentary: Hollywood's Greatest Trick

Image
I just became aware of a 2-day old article about a documentary available in full, showing the current situation of visual effects workers in Hollywood's film industry. Hollywood's Greatest Trick It talks about how the industry has been able to continue to raise the bar on the quality and increased number of visual effects shots in an average Hollywood film. The revenue generated by these films are also discussed. This is put in context when compared to the overheads and marginal profits that can be made from film to film. The documentary then shows that on top of struggling just to break even, what visual effects vendors and companies are up against when bidding for movies to be awarded to them from a limited and fixed pool of client studios. At the artists level, the film talks about how artists are expected to work long hours, and their passion for their work was being taken for granted, oftentimes for the benefit of the clients. More and more companies are hiring...

Python Sorting Part 2: Classes and Attributes

Python Sorting with Classes and Attributes # Here we define a class, containing student names # each student contains an list attribute of varying from 1 to 7 in length # populated by random integer values from 0 to 500 import random # imports the random module # declares the class object class myClass(object):     def __init__(self, inputName):          self.myName = inputName # creates a myName attribute         # create a list of random length         self.myList = [random.randint(0,500) \                         for x in range(random.randint(1, 7))]              def greet(self):         # prints out name and list of values the instance holds         print 'Hi I am {}, my list is {}'.format(self.myName, self.myList) random.seed(0) # providing a seed to genera...

Python Sorting Part 1: Dictionary Keys

Sorting Python Dictionary Keys Recently I ran into the need to perform more involved operations on Python dictionaries and sorting of ordered lists. This led me to a deeper understanding of a side of the sorted() function that I used to shy away from.  The biggest area that I had to learn about was sorting values by a key -- how it works and the practical applications. So the following lines of code are my 'journal' in this little learning journey through dictionary operations and sorting.  # Here's a dictionary d that has strings as keys, and a list of integers for each key's value. d = {'m': [23, 42, 63], 'm800': [32, 53, 743, 8], 'm23': [3324,425,21], 'a132': [2, 2, 53, 64]} # Here's a dictionary  e  that has integers as keys, and a list of integers for each key's value. e = {1: [42, 43, 52], 200: [3, 53, 63, 2], 60: [4, 62, 96], 30: [63, 89], 500: [32]} print d # Result: {'a132': [2, 2, 53, 64], 'm8...

PyMel: Creating and Accessing the Notes Attribute in an Object

Today I find myself wondering how I can access the 'notes' section of a Maya object using script. I searched the internet and found out that to access the notes in an object are stored in an attribute called 'notes'. No surprises. What surprised me, was when I went through the attributes of a newly created Maya object, I could not find that attribute! So I do the following experiment. Consider myObject which is a newly created object in the scene (an empty group). from pymel.core import * myObject = group(empty=True) At this point, it does not contain the attribute 'notes'. The following list comprehension looks through each of myObject's attributes, and only includes attributes with 'notes' in its name  in the resulting list : [x for x in myObject.listAttr() if 'notes' in x.lower()] This returned an empty list. It means that the attribute does not exist. # Result: [] # However, if I enter something into t...

Finding the Centre Position of a Polygon Face: Maya Python API

In the past few days I found myself having to find the position of face centres of a polygon. Looking through the Maya documentations I find no MEL or Python commands that can do this. So I had to do a Google search the answer. The most useful solution I found was from a discussion in Google Groups, in a reply by Justin Israel (who works in Weta Digital according to his Google+ profile ): https://groups.google.com/d/msg/python_inside_maya/UoMVxr0deVo/OJ2K8IpevxQJ Here is an excerpt of Justin's answer: import pymel.core as pm import maya.OpenMaya as OpenMaya face = pm.MeshFace("pCube1.f[64]") pt = face.__apimfn__().center( OpenMaya.MSpace.kWorld) centerPoint = pm.datatypes.Point(pt) Here is another interesting article discussing how we can go about finding the centre position of a face:  http://mayastation.typepad.com/maya-station/2009/11/where-is-the-center-of-a-polygon.html

The Zen of Python: Import This

I have been coding quite a bit in Python these few months. In the midst of research and reading up, I revisited the Zen of Python . This is a set of 20 software principles that influenced the development of the language. Having read this a few years back (it was first written around 1999), now I am seeing some of the principles in a new light. I'm still learning and finding my way around so I decided to learn more about what these principles mean to different people. Here's a great presentation I found on Slideshare.net  when I dug deeper into how different people explain each of these 20 principles in their own ways. An Introduction to the Zen of Python from doughellmann Incidentally I just found out that the Zen of Python is coded into the language itself. You can get Python to display this by entering this line of code: import this It will return the following result, right inside your interpreter: The Zen of Python, by Tim Peters Beautiful is bette...

Houdini (and TouchDesigner) Proceduralism

Image
Recently I've been spending more time with Derivative's TouchDesigner . Unlike Houdini which is more towards pre-rendered and simulated content for TV, Broadcast and Film, TouchDesigner is more for interactive applications, like reactive Video projections, installation content, where the visuals react in accordance to data collected in real-time (from sensors, game-pads, Kinect devices, or even information from websites). TouchDesigner, like most software geared towards real-time applications, has less processor intensive operators for geometry manipulation and shading (raytracing!) operations, Nevertheless, the amount of flexibility it can achieve with realtime signal processing data manipulation is still very amazing. This is especially easy on interatctive visual designers when it uses node based visual programming and the Python scripting language. I was recently trying to explain the idea of proceduralism in CG / VFX / Interactive applications to a friend, and I ke...

Search Algorithms for Game Play: Going from A to B

Image
From a blog post on Packt.com, my favourite resource for software development related books, I came across an article that talks about Search Algorithms. In the post,  Daan van Berkel talks about the processing, logic and steps involved in navigating a character from point A to point B in a game engine. Having no previous knowledge of path-finding, I find this immensely intriguing and an enjoyable read. I am definitely interested to find out more! Read the article here! https://www.packtpub.com/books/content/search-algorithms-game-play-going-b?mc_cid%3D703b00980b&hl=en

Fight Through It!

Image
For all the struggling artists or people picking up a new skill, here's a video to inspire you to keep up the good work, and never give up!

Why Learning to Code is So Damn Hard!

Image
 Today I stumbled upon an interesting chart while browsing through Quora posts. This brought me to the following page that seems to be the originating post with the full story behind this. http://www.vikingcodeschool.com/posts/why-learning-to-code-is-so-damn-hard It is talking about the stages of a programmer's learning journey to when he becomes industry-ready and lands himself a job.The confidence versus actual competency charted into a curve. In the course of the article, I was introduced to 2 more graphs which represented the scarcity of resources available online, and the scope of knowledge that needs to be acquired at the various learning stages. Finally, the the completed graph (which is all 3 graphs combined) looks something like this: Something in the article resonated with me. I have found myself to be in a learning situation for a quite a few things in my careers (CG, VFX, scripting/coding, composing, audio engineering). I see a similar pattern in my le...

Excluding Ambient Occlusion in Selected Objects

Image
Here's a short but very useful article on how to exclude ambient occlusion from selected objects in your ambient occlusion renders in Maya's Mental Ray renders. Neal Bürger is an amazing programmer and computer graphics artist. On Neal's amazing website , he gives instructions on how to go about setting up objects so the ambient occlusion shader excludes them from AO computations.   http://nealbuerger.com/2012/10/snippets-ambient-occlusion-exclude-objects/ Ambient Occlusion calculates and creates shading of shadows based on a open un-occluded lighting situation of an object placed in the open, the environment is then like a hemisphere of light-casting dome, contributing to the illumination of the object. Each pixel, sample region is then shaded based on the percentage of blocked by neighbouring objects versus an entirely unblocked situation. In a standard rendering scenario when I set up an AmbOcc or AO pass in Maya, I will either add a Mental Ray Pass or cre...

How Differential Gear Works

Image
I've been thinking about how cars' wheels are rigged up to move at different speeds in real life, and yet be able to be driven by a power source at the same time. This video is the perfect answer to my question. The solution is ingenious and the video explains it really well! My good friend +William Lin   further shared these videos on my Facebook post: And finally a video which was referenced from this link on Reddit .

Distance Between 2 Positions in 3D Space

The ability to find the distance between 2 points in 3D space is a really important function I need to use time and again. I found this website that is really helpful with clear explanations on the use of the formula. http://darkvertex.com/wp/2010/06/05/python-distance-between-2-vectors/ From the webpage I learnt the formula for the distance d between points A (expressed as Ax, Ay, Az) and B (expressed as Bx, By, Bz), would be expressed as such: d = √   Ax-Bx 2  + Ay-By 2  + Az-Bz 2    I was going to use the distance function on an expression in Maya, so I had to write it with MEL commands: vector $a = `xform -q -ws -a -rp "objA"`; vector $b = `xform -q -ws -a -rp "objB"`; // doing the additions and squaring first $myDist = `pow ($a.x-$b.x) 2` + `pow ($a.y-$b.y) 2` + `pow ($a.z-$b.z) 2`;  // applying the square root $myDist = `sqrt $myDist`;  I hope you it helps if you are looking for the same information. Additional notes: I am w...

Adding ObjectID Pass to Render Output in Maya Part 2: The Script

In my previous post , Autodesk's article showed us how to create an ObjectId pass in our scene. In the last post I also posted a snippet of PyMel script that creates a unique Id number for each object so each one will turn up a uniquely different colour from its neighbour in the objectId pass. However the process still needed us to manually create a Mental Ray Output Pass in the camera's Mental Ray section. Since then I have gone on to write a PyMel script to automate the process. So here is the script. # -- code start -- from pymel.core import * def uniqObjIdAssign():     # Written by Patrick Woo     # usage:        # - make sure mental ray is loaded, and set as your current renderer     # - select the camera     # - then select all the objects to give unique objectIDs to, and run this script     # for more info go to:     # http://patrickvfx.blogspot.com/2014/11/adding-objectid-pass-to-ren...