Trying to make an auto obj importer

Hi everyone

I was just thinking that it would be cool to have a button that automatically imports a piece of geo into my scene without messing with dialogue boxes etc. I tried doing it looking at the maxscript listener but the listener only returns the execution of the import dialogue box so you still have to select the object etc.

In case it's not clear, here's my workflow:
When exporting geo from zbrush, modo etc I always export it to a folder on my desktop as prop.obj (I always overwrite) and I want a script that imports that exact obj into my scene without any dialogue boxes etc.

Any help would be much appreciated!

Comments

Comment viewing options

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

Thanks very much miauu, it

Thanks very much miauu, it worked perfectly!

For reference sake, is there a page in the maxscript documentation that talks about this stuff? I did have a look but what was there about the import dialogue stuff didn't make much sense. Maybe because the examples weren't very elaborate.

miauu's picture

.

In 3dsMax reference file search for "3ds Max File Loading and Saving"

Jacob9000's picture

Thanks very much miauu!

Thanks very much miauu!

miauu's picture

.

Try this:

(
	--	"the path to the EXPORT folder"
-- 	exportDirPath = @"C:\Users\YourUserName\Desktop\ZBrushExport\"
	exportedObj = "prop.obj"
	objToImport = exportDirPath + exportedObj
	if doesFileExist objToImport do importFile objToImport #noPrompt
)

Edit the exrpotDirPath to match your directory where the prop.obj is exportd from Zbrush.
I don't know why, but in my Max2014 the Import dialog apperas, while it will have to be hidden.

When new prop.obj is exported you have to run this script to import it in 3dsMax.

Comment viewing options

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