Open file

I'm having trouble with something I thought would be easy. I'm trying to open a directory with the right path. I loads fine but just wont actually open the file when I click the open button.

	on btnOpenSce pressed do (
		--local lightmapTex = getOpenFileName caption: "Select the Lightmap" filename: maxFilepath types: "Images (*.dds, *.jpg, *.png, *.tga)|*.dds;*.jpg;*.png;*.tga"
			saveloc = ((PROJECTS[ProjectList.selection][2]+cats[objList.selection][2]+dirdd.selected)+"\\02_3D\\"+"")
			save01 = getOpenFileName filename:saveloc ()
 
)

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
johncrawshaw's picture

Max File

I'm just trying to create a shortcut to a folder. Then open any of the max files in that directory. Do you have to specify a file for it to load?

Anubis's picture

this is a different story then :)

The getSavePath displays a folder selection dialog where to select your folder. For example:

maxFiles = #()
dir = getSavePath caption:"My Cation" initialDir:(getDir #scene)
if dir != undefined do -- if the user not Cancel
maxFiles = GetDirectories (dir + "/*.max")
print maxFiles

And use loadMaxFile function to load the .max file.

my recent MAXScripts RSS (archive here)

fajar's picture

display bitmap ?....or

display bitmap ?....or display save01...

Anubis's picture

open bitmap?

getOpenFileName() is just a file selector that not load anything, it just return a String (the selected file name). openBitMap() and selectBitMap() will load a bitmap.

my recent MAXScripts RSS (archive here)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.