assign files from folder to material
sorry for my bad english, it´s not my native. I need your help. i need a script todo the following.
i have 5 folders with around 40-50 textures, in every folder is a seperate file too, this file is used as bump map. I have a objectgroup in the scene. I build this script, parts are here from the forum, thx miauu
( global rol_worwhite try(destroyDialog rol_worwhite)catch() rollout rol_worwhite "miauu" ( local matDir = undefined local bumpFile = undefined button btn_browsebump "select bump map" button btn_browse "select folder with textures" button btn_render "RENDER" enabled:false on btn_browse pressed do ( dir = getSavePath caption:"select folder with textures" if dir != undefined do ( matDir = dir btn_browse.tooltip = matDir btn_render.enabled = true ) ) on btn_browsebump pressed do ( file = getOpenfileName caption:"select bump map" if file != undefined do ( bumpFile = file btn_browsebump.tooltip = bumpFile btn_render.enabled = false ) ) on btn_render pressed do ( local curObj = getCurrentSelection() local matFiles = getFiles (matDir + "\\*.jpg") local scenename = getFilenameFile maxfilename renderSceneDialog.close() selectedCamera = viewport.getCamera() local originalOutPath = rendOutputFileName for m = 1 to matFiles.count do ( curObj.material = standardMaterial diffuseMap: (Bitmaptexture fileName:matFiles[m]) showInViewport:true texturename = ( getFilenameFile matFiles[m]) cameraName = selectedCamera.name outputPath = (getfilenamepath originalOutPath) + ( getFilenameFile(filenamefrompath originalOutPath)) + "_" + scenename + "_" + cameraName + "_" + texturename + "_" + (getFilenameType originalOutPath) rendOutputFileName = outputPath rendSaveFile = true rendShowVFB = false max quick render ) ) ) createdialog rol_worwhite ) /<code> what i do, i select the object and i point to the folder, where the textures are and 3dsmax render each frame with the texture. Put the cameraname, filename and texture name into the filepath. That works great so far. The thing is now, i want to add the textures as Multi/Sub object, every texture has it´s own ID and add to the material the bump map. So every bump map has it´s own 30-40 textures. After this, i need the used bumpmap and the used texture and the name of the selected object as filename.