Created
September 27, 2018 07:50
-
-
Save jaforsgren/2b854e0063691ce0240fa97def6e015b to your computer and use it in GitHub Desktop.
repoints paths to the location of the max files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- swiped from https://forums.cgsociety.org/t/getting-a-list-of-scene-bitmap-paths/1545447/8 | |
gc() -- just for this example, to make sure everything is nice and clean | |
-- find the scene root. The rootnode, medit, etc are references off this scene root | |
sceneroot = (for r in (refs.dependents rootnode) where (classof r == Scene) collect r)[1] | |
-- collect all the assets | |
origAssets = for i = 1 to AssetManager.GetNumAssets() collect (AssetManager.GetAssetByIndex i) | |
-- for each of the assets... | |
for AUIO in origAssets do | |
( | |
-- dump info on the asset | |
local AID = AUIO.GetAssetId() --get the Assets ID | |
local AType = AUIO.getType() --get the Assets Type | |
local AFile = AUIO.getfilename() --get the Assets File Name | |
format "ID:% Type:% File:% | |
" AID AType AFile --format the info | |
-- generate new filename, prepend "XXXX_" | |
local lFile = filenameFromPath AFile | |
local lPath = getFileNamePath AFile | |
local lNewName = lPath + "\\" + "XXXX_" + lFile | |
-- do the retargetting | |
atsops.RetargetAssets sceneroot AFile lNewName CreateOutputFolder:false | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment