[Closed] Scripted material with missing bitmaps
Hi,
We have written a scripted material in max that we use to display Direct X shaders and to export to our game engine. It works great; however, when you open a max file that contains one of these shaders and are missing one or more of it’s bitmaps, max opens an error dialog for every instance of the bitmap it finds. The error reads:
>> MAXScript Scripted Plugin Handler Exception: – Runtime error: Error opening bitmap: bitmap path here.
We currently use try()catch() to keep the script running, but the error message annoyingly persists. Does anyone know if there is a solution to supressing the error?
Thanks,
Jon
Does that error appear because that texture no longer exists at that location?
If so, try/catch should do the trick, although the “proper” fix is to ensure the textures can always be found by Max. Say a texture is originally assigned from this location:
C: extures\foo.tga
The next time that scene is opened it will look for “foo.tga” in C: extures\ first. If it isn’t found there, Max proceeds to look in other locations. The search order goes like this:
- Location of original texture
- Folder the current .max file is in
- Every folder under the one the .max file is in (might not do this on DX materials, I forget offhand).
- Every folder, in order, from Max’s External Files list.
If “foo.tga” can’t be found in any of the above, it gives you an error. The key to stopping this is controlling #4, the paths listed in every user’s External Files list. Using the menus you get to this from Customize/Configure User Paths/External Files tab.
You should make sure every user on your project has the same set of folders listed, and that every texture referenced in the maxfiles is somewhere in those shared folders.
Once you’ve done that it shouldn’t matter where the texture is found or moved to, or if it still sits in the originally assigned location or not.