ScriptSpot home

Forum topic · Scripts Wanted

Automatic adding users paths on 3ds max start

By aleksey.sheremetov · 2018-06-03

Description

Hi everyone, I'll be very grateful if someone could help me with this.

I have a constant folder structure for my 3d projects looking like this:

D:\projects\001\textures\
D:\projects\002\textures\
...

What I need is a script which will go through all sub folders of a given root folder "D:\projects\", find folders named "textures" and add their paths to the max's user paths if there is no such path there already.

I have several PCs/NODESs for work/distributed rendering and it's very tedious to add regularly appearing new project paths to each of them. So it will be perfect if I could set this script to autostart with 3ds max and be sure that no one of my PC's will loose some textures.

Any helps appreciated, thanks!

Comments (1)
aleksey.sheremetov

Solved

This request have been solved with the help of Panteleev Sergey. Here is the script:


(
--Searching for subfolders named "textures" in a give root folder and adding them to users paths:

dir_array = getDirectories @"D:/projects/*"
for d in dir_array do
join dir_array (GetDirectories (d+"/*"))
for f in dir_array where doesFileExist (texturesDir = pathConfig.appendPath f "textures") do
mapPaths.add texturesDir
)