MoonDoggie, so you were able to get around the issue of getclassinstances not working with textures in bitmap slots instead of texture slots? The atsops approach should provide a workaround to this. For example, it will show the displacement modifier bitmap image (and texture image) and the render effect blur Map Mask image.
-Eric
Edit: magicm, getClassInstances bitmapTexture target:(getEffect 1).selmaskmap will return the blur mask map.
Not quite actually. The script finds missing bitmaps using two functions to produce similar results each with an advantage over the other.
The normal function used for finding missing bitmap textures is via the getClassInstances method, which is quicker than the other method enumerateFiles which is a bit quirky, but carries different functionality over getClassInstances.
For the time being, getclassinstances proved to be just fine. Special-case scenarios where plenty of additional checking for different renderers (Vray, Maxwell, MR, Brazil) ends up slowing the script down, and my main goal was speed in the end.
In the script there are two functions for building the missing maps, one uses getClassInstances, the other, EnumerateFiles. I’ll update them to include special cases and renders if it’s wanted. Meanwhile we’re stuck with a non-node based material editor and a poor way to access missing bitmaps, at least we’re in the same boat.
-Colin
edit: I’m unfamiliar with the atsops approach, care to elaborate a bit?
You may want to look at atsops.getfilebystatus #Missing &FileList. It should return any missing maps based on the FileList array in parameter. Again this is just thinking out loud I haven’t tried implementing any of these approaches.
-Eric
Colin from the Maxscript Reference:
A Core Interface providing access to the Asset Tracking System. Available in 3ds Max 8 and higher.
It looks like you can script just about everything available to Asset Tracking Dialog. Such as setting paths, changing file used, identifying status of files, handle the bitmap proxy settings, etc.
-Eric
The asset tracking system sounds interesting,awhile ago I had to write a bitmap redirection script and noticed that there were cases were getClassInstances wouldnt pick up all the bitmaps. I am sure getClassInstances does not pick up bitmaps used by the Arch and Design material.
Eric,
Thanks for the refs, I’ll take a look at both of them to improve my script and hopefully not render it obsolete More to come.
So far, I find that either
files =()
ATSOps.GetFilesByFileSystemStatus #Ok &files
-- replace #Ok with #Missing if you're after the missing bitmaps
or
fn get_names name a = append a name
files = #()
enumerateFiles get_names files #render
gives me a full list of bitmaps used, but I haven’t checked all possibilites.
If someone finds a missing spot, please let me know.
– MartinB
I’ve been looking through the ATSOps recently but cannot figure out how to get the all the information. All it seems to return are integers/indexes. Is is possible to get some path information out of it?
If would just like to build a list with all assets used in the scene (bitmaps, XRefs, Cache files, … ).
thanks
Tom
Tom,
try this:
files = #()
numOk = ATSOps.GetFilesByFileSystemStatus #Ok &files
format "Found % assets with status OK
" numOk
for i = 1 to files.count do format "Asset #% = %
" i files[i]
If you replace
#ok
with
#missing
you would get a list of all missing assets.
Note that this does not necessarily cover all external files!
– MartinB
I completely overlooked that function! It’s exactly what I need. Thanks a lot for pointing it out.
Here is a script I wrote for someone who needed the paths of a scene exported to a text file.
out_name = getSaveFileName caption:"Text File" types:"Text Files (*.txt)|*.txt|All Files (*.*)|*.*|"
if out_name != undefined then (
out_file = createfile out_name
flList = #()
ATSOps.Refresh()
ATSOps.GetFiles &flList
for inFile in 1 to flList.count do (
if ATSOps.IsInputFile flList[inFile] == true then (
format "%
" flList[inFile] to:out_file
)
)
close out_file
edit out_name
)
Basically I use the ATSOps.GetFiles &fileArray to fill an empty array with all file paths. Once done you just need to search through the fileArray using 1 to fileArray.count to get all paths. I used ATSOps.IsInputfile so that output paths will be ignored.
Hope that helps some,
-Eric
Edit:Stupid formating.
I wouldn’t trust .isInputFile any further than I can throw it; and it’s virtual, so that’s not very far.
renderers.current.ShadowMapFilename
"C:\Documents and Settings\YupItsMe\My Documents\3dsmax\sceneassets\renderassets\zort.zt"
fList = #()
ATSOps.Refresh()
ATSOps.GetFiles &fList
for i = 1 to fList.count do (
f = fList[i]
if (ATSOps.IsInputFile f) then (
format "IN : %
" f
)
else ( format "OUT: %
" f )
)
[color=Blue]IN : c: emp est.max
IN : glare_streaks_star_camera_filter.tif
OUT: C:\Documents and Settings\[/color]YupItsMe[color=Blue]\My Documents\3dsmax\sceneassets\renderassets\zort.zt
Problem is, that file is input -and- output. Now for a shadow maps file that might not be a huge deal. If it’s a large cache file – such as an irradiance cache, a pointcache, a Krakatoa cache, and so forth and so on and ATSOps goes “bah, that’s not input, no need to parse that” :shrug:
[/color]
We often have the same problems with files being too large at render so I wrote a quick script to do searching for large bitmaps and sort them by file size or dimensions, so bump:
http://www.scriptspot.com/3ds-max/find-large-bitmaps
-Colin
It’s saved me alot of time finding and troubleshooting, troublesome scenes.