PDA

View Full Version : Copying files through MEL


StephG
11-21-2006, 12:26 AM
One of the problems that I'm trying to fix is a problem with reading fbx files from our server through our importer.

Currently using Maya 6.5. FBX plugin version 2005.08. Windows XP.

The problem we've had is that the fbx files come in incomplete from the server, but if we copy it to our local machine, it will load properly.

No one can figure out why this is, but I figured I could duct tape it by creating my own loader that would open a file requester, get the file name, then copy it to the local machine, and load that file.

Butt...

I can't even get this to work:

system ("copy c:/junk/test.txt c:/temp" )

or

system ("copy c:\junk\test.txt c:\temp" );


I've tried every combination of forward and backslash for the directories.

Anyone have any experience with this sort of thing?

Also, if anyone is familiar with the fbx problem, was it fixed in 7? It's not trivial to switch over to a newer version in the heat of production but if that solves the problem it might be worth it.

Thanks in advance.

--
Steph Greenberg

Robert Bateman
11-21-2006, 12:59 AM
sysFile -cp "c:/temp/test.txt" "c:/junk/test.txt"

StephG
11-21-2006, 01:48 AM
sysFile -cp "c:/temp/test.txt" "c:/junk/test.txt"

Thanks Robert. Worked perfectly for local files. But I can't get it working for the network stuff. I get a "// Result: 0"

Sigh. I've tried mapping as well as using the default //servername/productionname/directory/filename.fbx.

my computer hates me.

Edit: Maya's backwards way of stating things sometimes bites me in the butt again. I had the source first and destination second. It's got to be destination first. DOH!

grantimus
11-21-2006, 02:41 AM
I can't tell you why is wasn't working with the sysFile command. But, I can tell you why it wasn't working with the system command. If you're using windows xp, windows only likes it when you use the backslash for file paths. The only problem mel uses the backslash as an escape character. So to represent one backslash you really need two. So your system command should look like this:

system("copy c:\\junk\\test.txt c:\\temp" );

Look at the documentation for the encoe command it takes string like this "copy c:\junk\test.txt c:\temp" and returns this "copy c:\\junk\\test.txt c:\\temp". Its very helpful.

StephG
11-21-2006, 03:19 AM
I can't tell you why is wasn't working with the sysFile command. But, I can tell you why it wasn't working with the system command. If you're using windows xp, windows only likes it when you use the backslash for file paths. The only problem mel uses the backslash as an escape character. So to represent one backslash you really need two. So your system command should look like this:

system("copy c:\\junk\\test.txt c:\\temp" );

Look at the documentation for the encoe command it takes string like this "copy c:\junk\test.txt c:\temp" and returns this "copy c:\\junk\\test.txt c:\\temp". Its very helpful.

Good to know for some other things I might have to do. I got sysFile working. The reason it wasn't was because I was a dumbass and did it the way you normally would with something like cp in Unix: cp sourcefile destinationfile.

In sysFile cp, it's sysFile destinationfile sourcefile. It took me like an hour to realize that.

I need one of those machines that would let me kick my own ass for that.

CGTalk Moderation
11-21-2006, 03:19 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.