Home Technical Talk

3dsmax8 - redirecting shader files paths

grand marshal polycounter
Offline / Send Message
pior grand marshal polycounter
Hi all!

Since Max8 has no notion of project files, it can be a bit annoying to properly reference texture files locations when moving folders around. Usually I go around this thanks to the popup dialog that prompts you to browse for missing textures and paths.

However I have a problem with .fx files. I still have the old folder containing them, hence my models still display fine ; but eventually I would like to move stuff to a more proper location (and prepare good backups saved to another rive altogether)

However if I move the folder containing the shaders (or just rename it), and open the max file containing objects using such fx shaders for display, I found out that the .fx materials dont point to the old location of the shaders, but to the default max default.fx shader instead. This is annoying since I cannot really 'fix' paths one by one.

Is there a way to open the max file containing the old path to the shaders, and simply update such paths to the now one, and save? I am also curious to hear if there is a way to define relative paths for shaders as opposed to absolute disk paths.

Obviously it would be great to have maya-style project folders - maybe newer versions of max have that?

Also. Ultimately I woud love to 'pack ad go' max projects to folders. Like, running a script that simply makes a new folder, and move all files and paths to that one folder using relative paths.

Any ideas?

Thanks in advance

Replies

  • sinistergfx
    Offline / Send Message
    sinistergfx polycounter lvl 18
    I forget, does Max8 have asset tracking? File > Asset Tracking
    It's fairly easy to repath stuff in there. Select, right click and Set Path.
  • Rob Galanakis
    Here is a hack script specifically for what you need. I am SURE there are 'pack and go' tools, or much better repointing tools, but I don't know them.
    myFxFile = "C:/foo/bar.fx" --make sure you use / instead of \ (or use \ instead of \\)
    for m in sceneMaterials where (classOf m == DirectX_9_Shader) do
    (
    	m.effectFile = myFxFile
    )
    
Sign In or Register to comment.