r/Maxscript • u/Lucas3D • Jun 16 '15
Batch import with an operation between each import.
files = getFiles "C:\Users\Name\Desktop\import test\3d\import\*.obj"
for i in files do
(
importFile i #noPrompt --Im still getting a prompt for the first import?
)
baseName = "*"
execute ("objArr = $" + basename + "* as array")
for obj in objArr do
(
addModifier obj (MultiRes ())
obj.modifiers[#MultiRes].vertexPercent = 10
obj.modifiers[#MultiRes].reqGenerate = off
)
for i in 1 to objArr.count do
(
objArr[i].modifiers[#MultiRes].reqGenerate = off
maxOps.CollapseNodeTo objArr[i] 1 off
)This imports .objs and then applies a multi res and collapses.
How could I change the operation to act like this:
- Import a file
- Multires and collapse
- Import next file
- Multires and collapse
- Import next file
etc
Because I have a lot of imports to go through (500+) and crunching each one asap is a good workflow for me.
3
Upvotes
1
u/Lucas3D Jun 16 '15
I think I should get the array and use the count to iterate through the import and operation ending in i = i+1...
1
u/Swordslayer Jun 16 '15
Not sure why you would do it that way but anyway, something like this (untested):