[Closed] Remove all references of a Bitmap?
I haven’t seen a script/method that does this yet for Max?
I find that even if I clear Bitmaps Path in the Material Editor, the Asset Tracker still holds onto them/shows them. How are we supposed to go about permanently clearing a bitmap/s ?
asset tracker does not update unless you click the refresh button. there’s probably a mxs equivalent in the reference somewhere if you need it.
I’m sure deleting all bitmaptextures with a given filename has been discussed before but i can’t remember the outcome. Meanwhile i would probably try using refs.dependents and setting any sub properties of those which contain the bitmaptexture to undefined.
Also DenisT often seems to use getclassinstances bitmaptexture asTrackViewPick:true
may be some relevance here
Yeah, I know how to collect them, but I guess I can try the undefined method. But I removed them in the Material Editor, which might be differen’t from that. Also refreshing the Tracker didn’t matter.
The asset tracker can also show maps that exist in other parts of the Max file as well. E.g some scene modifiers like Uvwunwrap can hold a reference to a bitmap. R ur bitmaps definitely in the material editor.
When you manually choose a Bitmap/File to load into a material.
I tried to repro the issue, but now it works ok. But I have other max files where certain bitmaps won’t go away and I cant find them without using maxscript.
I don’t have a good answer for you, but it is a question that comes up a lot.
I usually:
- Condense the material editor (the asset tracker will list assets in the scene even if they are not used on geo)
- Use the new slate editor to examine exactly what materials are used and the maps connected to those materials. You can often delete them right there.
- Sometimes uvedit modifier can hold onto materials – if you are able to collapse these stacks, you may find fewer stragglers.
The Asset Tracker, for me, provides the easiest identification of which textures and shaders are being used, but actually clearing them out requires further examination.
there is no really a problem to find any bitmap texture. just give a clear picture of what you want to get.
I have some functions that try and get all scene bitmaps and show them in a UI, along with any objects that use them. But if no objects exist, then it just lists bitmaps.
I could use those functions possibly to get a certain bitmap filepath and set undefined, or I think you had one Dennis that uses the trackview/ or something like that?
fn allUsedMaps = (
sceneMaps = usedMaps()
for m in meditmaterials do join sceneMaps (usedMaps m)
sceneMaps
) -- end helpfile
what do you finally want to do?
the way how to collect texture files (or bitmaps, or bitmaptextures) depends on your final goal.
for example is very easy to get all textures using enumerateFiles, but it doesn’t give the target where the textures used.
using getclassinstances you can collect all bitmaptextures, but you can’t collect bitmaps.
so i’m repeating my question again: What do you want to do with texture files (or bitmaps, or bitmaptextures)?
I want to remove the reference to a bitmap in the scene, clearing the bitmap texture.
I found this, but it didn’t work.
fn wipeBitmapTextures file:"" useFullPath:off =
(
if useFullPath do file = pathConfig.mapPaths.getFullFilePath file
for tx in (getclassinstances bitmaptexture asTrackViewPick:on) where iskindof tx.anim.filename String do
(
f = tx.anim.filename
if useFullPath do f = pathConfig.mapPaths.getFullFilePath f
if (pathConfig.pathsResolveEquivalent f file) do
(
for s=1 to tx.client.numsubs where tx.client[s].value == tx.anim do tx.client[s].value = undefined
)
)
)
wipeBitmapTextures file:@"e:\models_nodropbox\belair_coupe_57 extures\badges_d.tga"
yes. this is my function. if this function is not working it means that the searched texture is stored not in any bitmaptexture.
texture might be placed in bitmap, CA, modifier, viewport background, etc. there are many places different than bitmaptexture.