About this site
ScriptSpot is a diverse online community of artists and developers who come together to find and share scripts that empower their creativity with 3ds Max. Our users come from all parts of the world and work in everything from visual effects to gaming, architecture, students or hobbyists.
Comments
This is my stab at it. I
This is my stab at it. I have no idea if this code works at all but it should be a good starting point:
function changeFile file = (
fileHandle = openFile file mode:r
position = skipToString fileHandle "./occlusion02.mtl"
if position == undefined then (
-- This string isn't in the file
close fileHandle
return true
) else (
-- Now you know where the string is in the file, and you can output
-- a copy of the file with the new string in that location
)
close fileHandle
return true
)
files = getFiles "c:\\foo\\*.obj"
for f in files do (changeFile f)
So, if I replace that
So, if I replace that string, everything else will stay unchanged?
Only if an obj file is text
Only if an obj file is text and not binary. I don't know if it is or not. You may just want to import it into max and adjust the textures before exporting it again.
Hi, Just open the .obj
Hi,
Just open the .obj file in a text editor (notepad) and change the line.
I need to do this with
I need to do this with maxscript, because I have several hundres of OBJ models.
Anyone?
Anyone?