Notifications
Clear all

[Closed] Does importfiles work?

Ok, i’ve written a simple script, sample below…, but no textures appear, when i open the processed max files.

I have tried -not- using the #noprompt and clicking ok every time…(300 times ) still no textures.

I have checked the file Obj2Max.cfg, that has Materials =1 (sample below)

If I open the obj and import it, it does … repeat does … load the texture, it takes a little while, big textures, but it does do it.

I tried to reset the views, even tried a sleep in its place, no joy.

The script does process all of the files with the script, but without textures. I am a bit of a loss of what to do…

Using Max 8.

Any help would be great.

Thanks
Kerry.

————maxscript
getFiles “C:\objs\*.obj”

for f in files do (
s = copy f

// this gets rid of the .obj so when max saves it it uses .max

num=s.count
num=num-4
newname = substring s 1 num

ImportFile f #noPrompt

// sleep 5
max views redraw

saveMaxFile newname

//tell me what one your on
print newname

resetMaxFile #noPrompt

————-Obj2Max.cfg
[Obj2Max]
Single=0
Helper=0
Grouper=0
Rotate=1
Texture=1
Normals=1
Unify=1
ObjSmooth=1
Smooth=1
Scale=100
Center=0
Materials=1
Group=obj

4 Replies

Are the textures/materials actually in the scene or are they completely missing?

Hi,

the textures are completly missing, and its the simplest of obj files, one poly, with a texture on it.

Hope that helps in trying to resolve this problem.

Kerry.

Have you checked the .mtl file ?
Open them With a text editor and make sure the path for the files are correct !

Yes, they the path / mtl’s are correct, as i said if I load one of them manually it works properly.

When it does the import thru “import files” script it does it very fast, like it not even trying to do the mtl at all (at import time), (which is why I showed the cfg file, and explained that it does work manually) or because the next statement is save, possibly it does this BEFORE the mtl is imported, thru async io, not understandiing that it should wait.

Thats why I put the refresh views, and the sleep command to slow it up, but again to no avail.

I have installed SP1, agaiin to no avail.

I am getting the feeling that either there is “something else” you have to do, but by what the manual says, you should’nt need to. And the example whas taken from the maxscipt ref man.

Are they missing telling us something to make this work?

Kerry.