PDA

View Full Version : Deleting/changing parts of savenames (basic user)


biggyninja
08-22-2007, 01:04 AM
Hi guys, this seems like a fairly straightforward thing to do, but ive been tearing my hair over it. (am only a maxscript casual user...)

you can save your max files and add to the name by using (example)+"addmetext.max". How can you delete parts of the filename.

For example, if i wanted to import .obj files, delete the ".obj" before adding the ".max" to the fillename.
(I would also be handy if someone could tell me how you can import files and use their names for the maxfiles without the file extension, although iam thinking i will need to know how to delete parts of a filename anyway...)

Cheers guys...

ofer_z
08-22-2007, 01:49 AM
there are a couple of ways to do this. first, there's the general purpose substring function, which you can use like:

filename = "c:\\somedir\\somefile.ext"
substring filename 1 (filename.count - 4)


there are some functions that deal specifically with file names: getFilenamePath, getFilenameFile and getFilenameType, so you can use this code to the same effect as the above code:

filename = "c:\\somedir\\somefile.ext"
getFilenamePath filename + getFilenameFile filename



for more detailed information, check out the maxscript help file.

hOpe this helps,
o

biggyninja
08-22-2007, 02:50 AM
thanks, yeah, just needed a gentle push in the right direction.

CGTalk Moderation
08-22-2007, 02:50 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.