r14 - 09 Jan 2012 - 22:29:50 - MattEstelaYou are here: TWiki >  Maya Web > TWikiAdminGroup > MayaMisc

Misc

Moved all the python scripts that were cluttering this section to MayaPython.

Fixing gnome desktop taskbar how I like it

I set my gnome taskbar vertically on the left edge of my left monitor, autohide, extra wide so I can see the full text of the program names, and remove all the slidey autohide stuff so its fast as possible.

gconftool-2 --type bool --set /apps/panel/global/enable_animations false
gconftool-2 --type bool --set /apps/panel/global/tooltips_enabled false
gconftool-2 --type bool --set /apps/metacity/general/reduced_resources true
gconftool-2 --type integer --set /apps/metacity/general/auto_raise_delay 100
gconftool-2 --type string --set /apps/panel/global/panel_animation_speed panel-speed-fast
gconftool-2 --type integer --set /apps/panel/global/panel_hide_delay 100
gconftool-2 --type integer --set /apps/panel/global/panel_show_delay 100
gconftool-2 --type int --set /apps/panel/toplevels/top_panel/size 200

more hacks here (smaller icons, smaller text etc) : https://help.ubuntu.com/community/EeePC/Using

Undeleteable nodes

This look familiar?

// Error: file: Non-deletable node 'blahblah' cannot be deleted.

Nodes can be marked deleteable/undeletable with the 'lockNode' command. Select the problem nodes, run the following.

string $mp[] = `ls -sl`;
for ($each in $mp) {
   lockNode -l off $each;
   delete $each;
}

Note that if the nodes are view-select-sets, if their linked viewport still exists, you can't delete the sets. Restart maya, turn off 'restore saved layouts from file', load the scene, try running the mel snippet again.

Windows Cmdline power user

It's lightyears away from a *nix bash shell but you can still get nifty things out of your windows cmdline ('windows key + r' -> 'cmd')

I have created a batch file (.bat) in my system32 directory (but it can be anywhere specified in %PATH%) which is called 'L' and it does everything I need; here's a sample:

@ECHO OFF
GOTO %1

:EDIT
REM edits this file so I don't have to go and pick it by hand every time I add something
start notepad C:\WINDOWS\system32\l.bat
GOTO :EOF

:M
PUSHD "C:\Program Files\Autodesk\Maya2010\bin\"
start maya.exe
POPD
GOTO :EOF

:k
TASKKILL /F /IM %2*
GOTO :EOF

:ke
TASKKILL /F /IM explorer.exe
start explorer
GOTO :EOF

:mu 
PUSHD "C:\Program Files\Virtual Vertex\Muster"
start MExplorer.exe
POPD
GOTO :EOF

:np
PUSHD E:\bernie\soft_portable\notepad++
start notepad++.exe
POPD
GOTO :EOF

:bru
PUSHD E:\bernie\soft_portable\BRU_NoInstall\BRU\32-bit
"Bulk Rename Utility.exe"
POPD
GOTO :EOF

:lame
FOR /f "tokens=*" %%G IN ('dir *.wav /x /b') DO (
echo %%G
E:\bernie\soft_portable\lame\lame.exe -h -V 4 "%%G" "%%Gmp3"
) 
ren *.wavmp3 *.mp3
if %2 == del (del *.wav /Q)
GOTO :EOF

:gif
imconvert -delay 10 -dispose Background -adjoin %2* %3.gif
GOTO :EOF

For instance, to convert all waves in a folder to mp3:

C:\wavefolder>l lame del

In the bat, 'lame' is %1 and 'del' is %2

Help on the command line: http://ss64.com/nt/

Change suffix

Nice quick n dirty script:

#!/bin/sh
ls *.$1 | sed -e "s/^\(.*\)\.$1$/\1\.$1 \1\.$2/g" | xargs -n 2 mv -f

use just as chsuffix jpeg jpg

Find files containing text in linux

I'll regularly have to find an esoteric function within the default maya scripts, can never remember how to use 'find' under linux. This is the simplest take I've found:

find . | xargs grep 'miDefaultOptions'

Set the gui font for vim in the vimrc file

Set the font via the gui handler, then open the vimrc file:

:e $VIM [tab] _vimrc

and start adding the following line:

set guifont=

at which point you use the expression register to insert the guifont value, by preceding it with an & thusly:

ctrl-R=&guifont[enter]

Kill maya under linux/osx, but save the scene

A trick that works maybe half the time, but when it does, dead handy. If maya hangs (or even if X itself has hung), open a shell prompt, get the maya process id:

ps -ax | grep maya

under linux you're looking for maya.bin, on osx maya.app. Now kill the process with the SEGV flag:

kill -SEGV [process id]

You can even run this from a ssh/rlogin/telnet prompt from another machine if you're really stuck. If it works maya will save a backup scene with a date-stamped name to /usr/tmp under linux, and ~/Documents/temp under osx. It'll look like "mattestela.20070924.1433.ma".

There's no equivalent under windows that I know of, sorry.

Convert rotation to unit vector

Lots of dynamics fields and bits of ncloth have a direction expressed as 3 floats, but don't give you a way to edit it visually, nor easily keyframe it. This method allows you to drive the attribute with a directional light... This method was originally suggested from a post by Stefan Albertz.

  • create a vectorproduct node
  • connect the light's xformMatrix to vectorproduct matrix
  • connect vectorproduct to wind direction
  • set vectorproduct operation to 'vector matrix product'
  • set input1 to 0,0,-1.
  • enable 'normalize output'
  • have a gin.

Copy a folder structure, but not its files

You're copying a shot to work on it from home, but the folder structure needs to stay the same, but you only need your shot, not the other 20 gigs of misc renders... bleah... here's a quick dos command to copy a folder (and all its subfolders), but not the files. Can take a while, but it works:

xcopy topFolderOfJob f:\projects\smallLocalCopy /t /e

Shooting timelapse under windows XP

Took a bit of hunting, but found timershot, a free powertoy from microsoft. Lets you capture from most image devices (including dv) at set intervals. You have to use rname-it or similar to fix the file names afterwards, but other than that its great.

http://www.microsoft.com/windowsxp/downloads/powertoys/xppowertoys.mspx (towards the bottom)

No its not maya. Sorry. Maybe you're shooting reference, or cloud footage. See? Now its relevant!

Objects spreading in Maya

This often asked how to spread objects in Maya. Unlike many packages, Maya has not particular spread tool. That is why I decided to write up a article from my own experience and forums discussions. It is a complete overview of five methods :

  • Paint objects on surface Usage of a great hidden tool of Maya
  • Map driven spreading method A simple script to spread objects from a texture map
  • Using particle instancer Particle work can also help for complex objects spreading
  • Animation driven spreading Bake animation to have a snapshot of all object's positions
  • Melscripting issues A complete step by step analysis for beginners and trips for intermediate scripters

The link to this article : http://ndhaussy.free.fr/maya_object_spreading/

(I have decided not to add the full article to the Maya Wiki. If you think I should, please let me know)

-- NicolasdHaussy? - 06 May 2005

Maya and After Effects

Importing maya scenes in to AE works much better than I thought. Just a few simple rules:
  • It can only import .ma files
  • You should bake your camera animation, but it seems to handle sparse key data well enough. Not game to test how well it integrates though..
  • AE will only import cameras, or anything that starts with 'null'. Handy way to bring in locators to match object placement.
  • The importer is much improved in AE6.5 vs AE5.5 (the old one was incredibly slow, required lots of ram, would frequently crash mid-import). However, they bring the camera in at massively different scales, around a factor of 2000% or so. Be wary of this if you're working with comps started in an earlier version.
  • And a little tip for those just getting used to rendering 3d comps in AE; it'll render through the topmost camera that is visible. Don't do what I did and set off a render, only to find 3 hours later it used the default cam because my hero cam was hidden!

Maya 6 help troubleshooting

Many people are having problems with the maya 6 help server. I thought I'd upload this walkthough from mailing list, and update/edit it as needed. Thanks to Jason Lumsden for writing the original version.

Note that this is very much a work in progress; the latest XP hotfixes(as of 10 May) have broken the doc server again. Just so you know...

Installing from scratch

You may not have to do this, but I had messed around with so many tweaks and settings that I had no idea what the original settings were so I started from scratch:

  • Installed XP, and Service packs.
  • Ensure you have administrator priveledges. (Control Panel/Administrative Tools/Computer Management/System Tools/Local Users and Groups/Groups dbl-click Administrators - the name of the account you log into with should be there)
  • Installed Firewall, Antivirus, and utlity software. Yes, I am running a firewall, and it still works
  • Installed Java 2 runtime environment (http://www.sun.com)
  • Installed Maya. Typical install.

The reason I installed the firewall (Zonealarm) was because I needed a firewall, but it was also configured to display each network attempt, whether in or out. This allowed me to see the IP addresses being accessed in an attempt to help me debug.

Verify the help is installed

  • Look in "C:\Program Files\AliasWavefront\Maya5.0\docs\Documents\Maya5.0\en_US\index.html"
If it's there, it's installed. If not, see below "Installing the Maya Documentation" (see also the problems with the readme)

Now verify the AW help server service is started:

  • Select Control Panel/Administrative Tools/Services

  • Look at "Alias Wavefront Help Server"
  • Look at the Status. "Started" or blank (not started).
  • Look at the Startup Type "Automatic", "manual" or "Disabled".

If you do not have Maya running, it should be

Status - blank (not started)
Startup Type - "manual"

This means that it should be started by Maya when Maya is launched.

I can't remember what my thought for doing this next line was (did it yesterday) but it's just another way to launch help.

  • Open a command prompt(Start Menu, Run -> "cmd"), and navigate to "C:\Program Files\AliasWavefront\Maya5.0\docs"
  • Type startServices.bat . You should get a message stating that the service is started. You will probably get a few pings, and an IE window that says "page cannot be displayed"
  • Launch Maya.

I don't know if the services dialog updates automatically so I always just shut it down and re-open it. When you re-open the services dialog, the status should say "Started". If not, Maya is not starting the service for you. This was my case.

Set Startup to "Automatic" (Right mouse click Alias Wavefront Help Server, and select Properties, Set start up to Automatic.)

I then looked at the Wrapper.log.

open C:\Program Files\AliasWavefront\Maya5.0\docs\WRAPPER.LOG (newest entries at the bottom - check time stamp)

Mine looked like this:

STATUS | wrapper | 2004/05/08 19:56:03 | --> Wrapper Started as Service
STATUS | wrapper | 2004/05/08 19:56:04 | Launching a JVM...
INFO | jvm 1 | 2004/05/08 19:56:05 | Wrapper (Version 2.2.9)
INFO | jvm 1 | 2004/05/08 19:56:05 |
INFO | jvm 1 | 2004/05/08 19:56:05 | Initializing the help server...
INFO | jvm 1 | 2004/05/08 19:56:07 | Requesting port 4444...
INFO | jvm 1 | 2004/05/08 19:56:07 | Up and running.
INFO | jvm 1 | 2004/05/08 19:56:07 | View the online help by opening a browser window and going to
INFO | jvm 1 | 2004/05/08 19:56:07 | http://:4444/
INFO | jvm 1 | 2004/05/08 19:56:07 | or
INFO | jvm 1 | 2004/05/08 19:56:07 | http://localhost:4444/ (on this computer)

If you the log results like above, I'll get you working smile

At this point, Maya would still not open the help for me through either of the following:

  • Opening help from within Maya
  • running StartService.bat

But I could open a brand new IE browser window and paste "http://:4444/" into the address bar, and it worked. If you don't know you IP address, just take it from the wrapper log entry from above.

At this point, I had to go into Maya, select Window, Setting/Preferences, Preferences, Misc, and change "Help Location" to Remote and enter

http://:4444/Maya5.0/en_US

for the URL. (Before you all go off on me and say this is one of the steps mentioned at the alias site, I tried this before as well, and wasn't the original problem before re-install)

Other notes.

Since I have "Alias Wavefront Help Server" to start automatically, it should always be on. When my system went into stand-by mode for quite a while, when I came back, the help would not work again. I looked in Service, and the service did not restart. (Maybe a windows setting I don't know)

I just created a batch file on my desktop that says "net start AWHelpServer" and run it when ever the help does not work. And I am good to go again.

I also had a previous email posted asking if 0.0.0.0:4444 was a valid address. It is. When I start the AWHelpserver service, I then go to a command prompt and type Netstat -ANO

The lines should be something like this:

Proto Local Address Foreign Address State PID

TCP 0.0.0.0:4444 0.0.0.0:0 LISTENING 1652
TCP 127.0.0.1:1777 0.0.0.0:0 LISTENING 3356
TCP 127.0.0.1:1777 127.0.0.1:1133 ESTABLISHED 3356

  • Press Ctrl-Alt-Del to open the Task Manager.
  • Go to the processes tab, select view menu, and select "select columns".
  • Enable "PID (Process Identifier)"
  • Find the PID number for the 0.0.0.:4444 line from netstat (above the example from above, it is 1652) in the Task manager. It should be Java.Exe. The 3356 PID is Wrapper.exe.

Installing the Maya Documentation (Windows)

Here is the procedure listed in CD:\readme.html

If you installed Maya 5.0.1 without having Maya 5.0 on your machine, you will not have the Maya 5.0 documentation installed.

To install the Maya 5.0 documentation:

  • On your Maya 5.0 Windows CD, open the Windows folder within the Win32_Maya50Docs_Installer folder.
  • Double-click installMayaDocServer.exe. The installer walks you through the process of installing the Maya doc server.
  • After the installer has finished, go to the Windows folder within the Win32_M5en_US_Installer folder on your CD.
  • Double-click install_en_US_docs.exe. The installer walks you through the process of installing the Maya documentation.

Note: The documentation is installed in c:\aw\maya5.0\docs by default. If you installed Maya in a non-standard location, you should adjust the documentation installation path accordingly. i.e. If you installed Maya in f:\aw\maya5.0, you should install the documentation in f:\aw\maya5.0\docs.

A couple of problems with the readme

It states if you installed 5.0.1 without previously having 5.0 on your machine, you won't have help. Well, I installed from a clean system (without 5.0 already installed) but I did have help installed. Also, the line that states

"After the installer has finished, go to the Windows folder within the Win32_M5en_US_Installer folder on your CD" "Double-click install_en_US_docs.exe"

seems to be incorrect. I do not have this file on my CD.

Filmbox and max

  • max to maya conversion using the filmbox exporter, group and rotX = -90

-- MattEstela? - 31 May 2003

Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r14 < r13 < r12 < r11 < r10 | More topic actions
Main.MayaMisc moved from Main.MayaOneLiners on 31 May 2003 - 04:07 by MattEstela
 
Powered by TWiki
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback