Installing Foundry Mari on openSUSE 11.3

MARI is a creative texture-painting tool that can handle extreme projects. MARI was developed at Weta Digital to handle the massively complex, highly detailed look development work demanded of the texture department by projects such as DISTRICT 9, THE LOVELY BONES, and AVATAR.

This is how the installation directory looks like. You can add symlink to the mari* shell script in the bin folder if you want. In case you are not executing the script from the same directory, you need to make slight modification to the script to make it accessible.

 #!/bin/bash
 # This version is intended to launch Mari from the directory this
 # script is located in, does not require Mari to be installed

#export presentScriptPath=`dirname $0`
 export presentScriptPath="/usr/local/Mari1.0v4"
 export currentPath=`cd $presentScriptPath; pwd`
 export binDir=$currentPath"/bin/"
 export PATH=${PATH}:$binDir
 export mariLog=$MARI_LOG_FILE
 if [ "$mariLog" == "" ] ; then
 export mariLog=/scratch/logs/MariLog.txt
 fi

# Look for options
 for p in "$@"
 do
 case "$p" in
 "--verbose")
 # turn off the log output
 export mariLog=
 ;;
 *)
 ;;
 esac
 done

if [ "$mariLog" == "" ] ; then
 $currentPath/bin/MriBin $@
 else
 $currentPath/bin/MriBin $@ &> ${mariLog}
 fi
 

I have commented out the line

 export presentScriptPath=`dirname $0`
 

and replaced with

 export presentScriptPath="/usr/local/Mari1.0v4"
 

which is the installation directory for Mari

Disclaimer: Please support the developers as I do not in any way support piracy. Go out and purchase the softwares if you like them.

Setting up python2.5 for Massive Prime

Python can be used in Massive by typing commands directly in the textport and from scripts. The textport is accessed from the Options menu. Scripts can be run from the textport using the execfile() function and from the commandline using the -script commandline option.

Three versions of python are supported by massive ver<4.0, Python1.5, Python2.2, and Python2.5. For ver<4.0 Python2.5 is selected by default while starting massive. You can  specify a particular version of Python by entering one of the following in the textport

 #!pyscript15
 #!pyscript22
 #!pyscript25
 

openSUSE 11.3 comes with pre-installed Python2.6.5. Hence in case you want to use Python2.5 with massive you need to install Python2.5 can be downloaded from here. Massive will need the shared library for python to be in the $PYTHONHOME in order to support the specific python version. If you are building python yourself, you can get that done by specifying

./configure   –enable-shared   –prefix=/usr

I missed that step while building and I didn’t wanted to build it all over again. Instead found a workaround for the same. Since I had Foundry Nuke installed on my machine, which comes with a shared library for Python2.5 (libpython2.5.so.1.0), it was just a matter of creating a symlink to the shared library path on /usr/lib64 for libpython2.5.so.1.0

ln -s   /usr/local/nukeVersion/libpython2.5.so.1.0   libpython.2.5.so.1.0

If these operations have been successful, you will be able to access Python2.5 modules within massive.Else you will be getting an error echoed in the console like this

libpython2.5.so.1.0: cannot open shared object file: No such file or directory

Installing Massive Prime on openSUSE 11.3

Massive is the premier simulation and visualization solution system for generating and visualizing realistic crowd behaviors and autonomous agent driven animation for a variety of industries, including film, games, television, architecture, transportation, engineering, and robotics. Using Massive, an animator, engineer or robot developer designs characters with a set of actions and reactions to what is going on around them.

The installation manual that comes along with massive is sufficient for a noob to get massive running on your machine. But if you are planning to run massive on a Linux machine, you better go through the Troubleshooting section too. Even after getting the mhost server running you may still get an error “could not open connection” while executing massive from the shell. If u are using Fedora, you will be happy to see the following section under the Troubleshooting section

I am on Fedora and get a “could not open connection” error message when trying to start Massive.

The “could not open connection” error you’re getting is because the X server on Fedora has TCP connections disabled by default. Massive is trying to connect to the X server over TCP and failing. If you add the following line to the [security] section of your /etc/X11/gdm/gdm.conf it should remedy the problem.

DisallowTCP=false

But under openSUSE running on KDE, you wont find a gdm installation at all. Hence in order to enable TCP/IP sockets for X11, you need to follow the instructions below.

  • Set DISPLAYMANAGER_XSERVER_TCP_PORT_6000_OPEN=”yes” in the /etc/sysconfig/displaymanager file
  • Running /sbin/SuSEconfig to propagate that setting
  • Restart your display manager through /usr/sbin/rcxdm restart

Disclaimer: Please support the developers as I do not in any way support piracy. Go out and purchase the softwares if you like them.

File Handling in MEL – Part2


Problem:
To perform a set of file operations including creation, deletion and listing of files and directories
Solution:

Creating  folders using sysFile command

 sysFile -makeDir "/home/user/mayaFolder"; //unix
 sysFile -makeDir "C:/Documents and Settings/MayaFolder"; //windows
 

Get the list of mel scripts in the  maya scripts directory

 getFileList -folder "/home/user/maya/scripts" -filespec "*.mel";
 

Stripping a file path in to directory name and base name.

 $filePath = "/home/user/maya/2011-x64/scripts/userSetup.mel";
 $dirName = dirname($filePath);
 $baseName = basename($filePath , "/");
 

Commands:
sysFile, dirname, basename
Discussion:
The sysFile command can be used to create, delete or rename files and directories from within Maya. The dirname and basename commands can be used to strip a file path in to the absolute path and filename. Using a combination of these three commands its possible to perform a variety of OS level operations from within the Maya workspace itself.

Cecelia-The Balcony Girl from DNA Inc

The last among the short films from DNA Inc in which I played the role of a mentor is out on Youtube now. The film brings back to screen Alex, the protagonist of the film “Feel the Punch“, which was the most recent film from DNA Inc. The film had won several awards including the prestigious TASI Viewer’s Choice Award in the year 2010. It brings me great joy to see the remarkable achievements DNA Inc has made in a span of one year.  Wishing DNA Inc a bright future ahead…

File Handling in MEL – Part1

In this tutorial, we will be covering the file handling functionality provided by MEL.
Problem:
Writing out to and reading from file formats other than maya ascii and binary.
Solution:
Write the file location of texture maps used in a scene

 $fileId = `fopen "/home/user/textureList.txt" "w"`;
 $fileNodes = `ls -type "file"`;
 if( size($fileNodes)==0 ) {
 fprint $fileHandle "No File Nodes found in scene";
 }
 else {
 for ($each in `ls -type "file"`) {
 fprint $fileHandle (getAttr ($each + ".fileTextureName") + "n");
 }
 }
 fclose $fileHandle;
 

Read the contents of the written file and print the contents of each line.

 $fileHandle = `fopen "/home/user/textureList.txt" "r"`;
 while (! `feof $fileHandle`) {
 $eachLine = `fgetline $fileHandle`;
 print $eachLine;
 }
 fclose $fileHandle;
 


Commands:

fopen,fprint,fgetline,fclose,getAttr

Discussion:

The first code block writes the file paths of all the texture maps in the scene to a text file names textureList.txt. The fopen command returns a file identifier which can be used to write in to or read from the file specified in the command.An additional string can also be mentioned to denote whether to open the file for read,write or append operation(r ,w or a). Data can be written to the file using fprint command. Its advised to close the file handle once the read, write or append operation is finished. This can be done using the command fclose.

Data can be read by opening the file handle in “r” mode. The fgetline command reads the contents of the file line by line, which is then printed on to the screen.

Adding Maya Panels to MEL GUIs

Problem:
Adding default scripted panels(Visor, Reference Editor etc) in Maya to custom UIs created using MEL
Solution:

 if(!`scriptedPanelType -exists visorPanel1`)
 scriptedPanelType
 -createCallback "createVisorPanel"
 -initCallback "initVisorPanel"
 -addCallback "addVisorPanel"
 -removeCallback "removeVisorPanel"
 -saveStateCallback "saveStateVisorPanel"
 -deleteCallback "deleteVisorPanel"
 -unique true
 visorPanel1;

if (`window -exists myWindow`)deleteUI myWindow;
 {
 window -t "My Window" myWindow;
 frameLayout -lv false -bv false myLayout;
 scriptedPanel -e -p myLayout -type visorPanel1 visorPanel1;
 showWindow myWindow;
 }
 

Commands:
scriptedPanelType, scriptedPanel, getMayaPanelTypes

Discussion:

Default Scripted panels can be added to your custom GUIs using the scriptedPanel command. Before specifying the command the scripted panel should be defined using the command scriptedPanelType. By specifying the type of scripted panel using the -type flag in scriptedPanel command creates an instance of the specific scripted panel. You can also get a list of the default scripted panels in Maya using the command getMayaPanelTypes(1). In the above example an instance of Visor panel is created and then added to the custom UI myWindow.

The query regarding this functionality in MEL was raised by one of the visitors to this blog. Hence I thought it would be great to include this as a tutorial just in case some of you might find it useful. You may feel free to mail me in case you have any topics which you feel could be included in the Tutorials section. I am not guaranteeing a quick reply, but whenever I get free time from my work schedule I would try to include those topics too (provided I know the answer to your question).

PyQt4 for Maya2011 on Windows XP x64

Finally got some time to get back to python after a long break, only to find that I don’t have a working copy of PyQt4. Instead of spending time on google trying to figure out whether anyone has decided to share a copy of PyQt built against Qt4.5.3, decided to build one myself. Having Windows SDK already installed on my XP proved out to be handy since the Visual Studio version I was running was still 32-bit one. Downloaded SIP4.12 source and Qt4.5.3 SDK and within few seconds the PyQt4 module was successfully added to the site-packages.

Thought of sharing the build for those of you who are planning ahead to design awesome GUIs in Maya.You may download it here

Rhythm & Hues wins Academy Award for render management system ‘Queue‘

The Academy of Motion Picture Arts and Sciences announced that 10 scientific and technical achievements represented by 22 individual award recipients will be honored at its annual Scientific and Technical Awards Presentation at the Beverly Wilshire on Saturday, February 12, 2011.

Chris Allen, Gautham Krishnamurti, Mark A. Brown and Lance Kimes are amongst the 22 individual award recipients for the same. They are being awarded for the development of Queue which is a robust, scalable approach to render queue management. Queue was one of the first systems that allowed for statistical analysis and process introspection, providing a framework for the efficient use of render farms.

This would be the 4th Scientific & Technical Achievement Academy Award for R&H. They have earlier been awarded in 1994, 1998, and most recently in 2008 for their proprietary system of fluid dynamic tools.

Queue has been used at R&H since 1996. It is a proprietary tool used only within R&H. However it is also used across all of the studio‘s various International facilities and allows to share render resources across all of its various studios. The queue has been used on all of R&H projects since its inception. This should be well over 100 Hollywood feature films as well as hundreds of TV commercials and other special venue projects.”

Being part of the Technology team at R&H, I am so delighted to share this news with you all.