Mayabatch And Path Woes

I'm running mayabatch from a makefile, to do batch importing and exporting of files.

Unfortunately,

"mayabatch file -typ "mayaBinary" -pr -ea mbs/testfile.mb"

Will save testfile.mb in
"C:/Documents and Settings/Administrator/My Documents/maya/projects/default/mb/"

instead of "$(CURRENTDIR)/mb/", which is, IMHO, more sensible behaviour.

Is there any way of getting maya to not behave like this without resorting to using absolute paths? I really don't want to use absolute paths as that just plain sucks for various reasons.

Cheers,

MrHTFord.

Mayabatch works exactly like a normal maya does. Its project directory is defined to the same default as a normal maya. So yes and no its a smarter way to work, because thetway youd be in same kind of environ as in maya, on the drwaback you have this problem.

But you cab specify the current project with the -proj flag.

For example in tested in zsh theese 2 methods work:

mayabatch -proj $PWD ...

or alternatively

mayabatch -proj pwd ...

most other unix type shells have similliar batcticking oprations and system var stuff so ithis would be the methodology id use in linux and osx

On windows the sytem war is named cd so

mayabatch -proj "%cd%" ...

its quoted because otherwise maya would get the wrong end of the stick if your path had space in its name

Thanks very much, I've got it all working now; except for one thing...

If I don't qoute the proj string, it works fine (provided my path has no spaces in it), but if I do quote the string, then maya gives the error:-

"c:/Program Files/Alias/Maya6.0/scripts/startup/initialStartup.mel line 69: Cannot open project: "c:/work/quake4""

I tested this in both MSDOS and MSYS and both report the same error in initialStartup.mel.

FYI, here's how I'm passing it in (copied from the makefile).

CODE
# msys paths aren't UNC paths.
ifeq ($(OSTYPE),msys)
 MAYA_DIR = /c/"Program Files"/Alias/Maya6.0/bin
 CURDIR2 = $(shell pwd -W)
else
 MAYA_DIR = c:/"Program Files"/Alias/Maya6.0/bin
 CURDIR2 = $(CURDIR)
endif

mb/%_anim.mb : %.md5anim
       mkdir -p $(dir $@)
       $(MAYA_DIR)/mayabatch -proj \"$(CURDIR2)\" -command ...etc...etc...

MrHTFord.

from the error it seems your passing one extra quotation mark (") sequnce wich may be caused by teh fact that pwd might return a allready quoted string in wich case youd have on extra quote around. Or alternatively msys want you to use ' quotes instead of " quotes.

use c:\Progra~1\ instead
also c:\Docume~1\

QUOTE(drBlacksnake @ 10/24/05, 11:01 AM)
use c:\Progra~1\ instead
also c:\Docume~1\
[snapback]218003[/snapback]

"Program Files" works fine dude; the problem was:

CODE
   $(MAYA_DIR)/mayabatch -proj \"$(CURDIR2)\"

should have been:

CODE
   $(MAYA_DIR)/mayabatch -proj "$(CURDIR2)"

All fixed now and working; thanks alot you guys!