Archive for June, 2009

SALA work complete tonight!

Tuesday, June 30th, 2009

30062009

after weeks of cutting stencils with precision, a windy night and poor lighting and poor workmanship have left my artwork for SALA not quite matching my expectations in my mind

at least I can resuse the stencils and have another go

But not before I leave for New Zealand

Sam

length of a curve in Maya

Tuesday, June 9th, 2009

I found a reasonable solutionhere:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//=================================
// curveLength v1.0 (08/2004)
// by Edvard Toth
// 
// The script is freeware. Non-commercial redistribution is permitted as long as this header remains included and unmodified.
// Your feedback is always appreciated - if you find the script useful or if you have questions, comments, suggestions, requests, 
// bug-reports, if you created an updated version, to check for updates or to make a donation please contact me at:
//
// http://www.edvardtoth.com
// 
//==================================
// INSTALLATION: Copy the script into your Maya script-directory and start it with the curveLength; command.
//
// COMPATIBILITY NOTE: Tested with Maya 4.0 - 4.5 - 5.0 - 6.0 - 7.0
//
// DESCRIPTION:
// This tiny but very straightforward utility measures the length of a curve without all the hassle that comes with 
// using Maya's implementation of the "Arc Length Tool".
//
 
global proc curveLength ()
{
 
string $CL_curve[] = `ls -sl`;
 
	if (size($CL_curve[0]) == 0)
    {
	confirmDialog -t "Oops..." -m "Please select a valid curve." -b Continue;
	return;
	}
 
	string $CL_curvea[] = `ls -l $CL_curve[0]`;
	string $CL_curveb[] = `listRelatives -f -ni -s $CL_curvea[0]`;
 
	if (nodeType($CL_curveb[0])!="nurbsCurve")
    {
	confirmDialog -t "Oops..." -m "Please select a valid curve." -b Continue;
	return;
	}    
 
        int $CL_spans = `getAttr ($CL_curve[0] + ".spans")`;
 
        string $CL_arclengthnode = `arcLengthDimension ($CL_curve[0] + ".u[" + $CL_spans + "]")`;
        string $CL_nodeparent[] = `listRelatives -p $CL_arclengthnode`;
 
        float $CL_curvelength = `getAttr ($CL_arclengthnode + ".al")`;
 
        delete $CL_nodeparent;
 
        confirmDialog -t $CL_curve[0] -m ("curvelength:  " + $CL_curvelength) -b OK;    
}

but since I hate Mel I have ported it to python

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
 
def lengthOfCurve(dagPathToCurve):
	"""
	Assume that the Shape path is given, error checking is for upstream
	"""
	import maya
	numSpans = maya.cmds.getAttr("%s.spans" % dagPathToCurve)
	arcLengthTemp= maya.cmds.arcLengthDimension("%s.u[%s]" % (dagPathToCurve,numSpans))
 
	nodeParent = maya.cmds.listRelatives(arcLengthTemp,parent=True)
	curveLength = maya.cmds.getAttr ("%s.al" % arcLengthTemp)
	maya.cmds.delete(nodeParent)
	return curveLength
 
 
for i in maya.cmds.ls(selection=True):
	shapeNodes = maya.cmds.listRelatives(i,shapes=True)
	for shape in shapeNodes:
		if maya.cmds.nodeType(shape) == "nurbsCurve":
			print "Curve: %s is %s units long" % (shape, lengthOfCurve(shape))
		else:
			print "Wrong: %s is a %s" % (shape, maya.cmds.nodeType(shape))

As Nick so rightly pointed out the following makes a lot more sense

sometimes rtfm > google

arclen docs

1
2
3
4
5
6
7
8
9
import maya
 
for i in maya.cmds.ls(selection=True):
	shapeNodes = maya.cmds.listRelatives(i,shapes=True)
	for shape in shapeNodes:
		if maya.cmds.nodeType(shape) == "nurbsCurve":
			print "Curve: %s is %s units long" % (shape, arcLen(shape,constuctionHistory=False))
		else:
			print "Wrong: %s is a %s" % (shape, maya.cmds.nodeType(shape))

RSP Talks at Conjecture 2009 (previously known as Phantom)

Monday, June 8th, 2009

On Sunday, at 11:30 in the morning I presented to a group of about 30 hardcore sci fi fans about the visual effect production process.

It was basically a matter of telling the audience what goes into making visual effects, from the business, direction and technical.

They seemed to be fairly interested.

Overall I could have paced myself a bit better, but I probably could have played the reel for an hour and they would have been happy with that too

Terminator Screening

Friday, June 5th, 2009

Last night we all trundled along to see the forth Terminator movie “Terminator Salvation”

Having worked on it from January through to the start of april for 12 weeks it was good to see our work on film for the first time.

My main gig was shader work as well as technical support, and lighting of the shots while the hunter killer laid on its side.

I was so busy scouting around the credits for people I knew, I missed my own name, so if you see it let me know.

I saw a few others that I knew from around the traps, Spanner, animating at ILM and Noah Vice at ILM

If you worked on T4 and know me reply to this message