Notifications
Clear all

[Closed] fixing bitmaps without causing Max to load them

The only case you need to know where the asset comes within a scene is if you have 2 (or more) objects referencing one asset, and you only want to update explicit versions (in other words not all instances at once). That can be done with the ATSOps.RetargetAssets, which expects a MaxObject (specific Bitmap Object), oldpath, and newpath. Using this you can have C: exture.tga changed to C:\some other path exture.tga, or c: exture2.tga for that instance of the path.

The question is do you want to repath all references to that asset all at once, or separately based on the usage in the scene.

Hope that makes sense,
-Eric

Is it possible to use “AssetUser” for repathing?
I see [i].getFileName/i method, but I can not find .setFileName method…

also I tried

– Get all files
atsops.GetFiles &fileList
– Get missing files
missingFiles = for val in fileList where ((atsops.GetFileSystemStatus val)[1] == #missing) collect val
– Desired new path
newPath = “”
– Select missing files
atsops.selectfiles missingFiles
– Retarget selection to new path
atsops.setpathonselection newPath

But, “atsops.setpathonselection newPath” did not work for broken path.

Try adding an atsops.refresh() at the end to force a refresh of the dialog. In a simple test I did my code worked fine on missing files that needed to be repathed. Now if you need to change the file type, ie somefile.jpg to somefile.tga you will need to do it per missing entry, not all at once.

Assetuser only allows get functions, you will need to use the asset metadata stream to fix it. See “MAX File Asset Metadata Stream Access” and setMAXFileAssetMetadata.

-Eric

Page 2 / 2