Thursday, February 26, 2015

Nuke - Read Node - Image Sequence Length

Useful thing to display on read node the length of the image sequence. I guess the easiest way to do that is to use a TCL expression:

 [ expr [value last] - [value first] ]  

You can do it fancy way:

 length: [ expr [value last] - [value first] ]f  



On read node it will look like this.



How wonderful it is.

Monday, February 23, 2015

Maya Bug - displayColor in maya 2015

Let's call it bug. Before maya 2015 SP5 we used maya 2012 in the studio. I don't know which version is the first where this "feature" was added to maya.
If I run this line it produces RuntimeError:


 cmds.displayColor("headsUpDisplayLabels", 16, dormant = 1)  

The funny thing is it changes the color but produces error. So I can handle it with exception.


 try:  
   cmds.displayColor("headsUpDisplayLabels", 16, dormant = 1)  
 except RuntimeError:  
   pass  

I know what you are thinking: Holy crap!

So is there something I don't know? Or what?

Thursday, February 19, 2015

Maya (2013+) - imagePlane issue

I had trouble with imagePlane in maya 2015. As far as I know it is changed around maya 2013. ImagePlane now has a transform node so it looks like a standard object. You can create it from the menu: Create / Free Image Plane.


The strange thing is that when it is attached to a camera. It looks like a hierarchy (see below)


but it can't be unparent or reparent. So there is a special connection. In nodeEditor it also looks like a typical hierarchy where the transform node does not have any connection.


Only thing which can refer to some special condition is found in the scriptEditor when the imagePlane is selected:

select -r CameraShape->imagePlane1 ;

I experienced this syntax with positionMarkers. Actually I wrote about it before.

That is how I find out there is a term of underworld nodes in maya. You can read about it here or a more here. Consider underworld node as a component like a NURBS CV and it will explain why it can't be unparented for eg.

So...we can create an imagePlane with MEL command (since maya 2013) like this:

imagePlane -name "myImagePlane" -camera "CameraShape";

And we can redirect" an existing imagePlane to another camera with the edit flag:

imagePlane -edit -camera "NewCameraShape" "myImagePlane";

I found the easiest way to get the imagePlane from the camera is to call this:

listRelatives -allDescendents "cameraShape"