View Full Version : Asset Metadata Stream Acces help wanted

03-17-2010, 02:57 PM

I'm new on this forum so if I'm making any forum-guidline mistakes, I'm sorry.

My reason for joining is because I'm interested in making scripts but of course this goes hand in hand with questions... Currently I've got the assignment of making a Maxscript for school, some kind of Semesterexcercise.
The script is the following: An Auto Asset-tracking tool which makes it possible for students to format the paths of the assets in relative filenames. This prevents problems when the max file and assets are loaded onto another computer. Also, the users will be able to rename the files with prefixes ( if they need to put their name, classnumber or schoolname in front of every file, it happens) and move the assets to a new folder.

The problem is the following, I'm using the Asset Metadata Stream Acces functions and I'm trying to overwrite the filenames with the new, relative, paths. This is an extract from my script where the problems start.

FileAssets =#()
FileAssets = getMAXFileAssetMetadata SceneFilename

--Controling AssetData
for i=1 to Namelist.count do --Namelist is an array with all the assets, including their new relative paths & possibly new names
NameAsset = NameList[i]
PathAsset = getFilenamePath NameAsset
NameAsset = filenameFromPath NameAsset

--Using ToRelative function of pathconfig, also, SceneFilename
PathAsset = pathConfig.convertPathToRelativeTo PathAsset SceneFilename
PathAsset = (PathAsset + NameAsset)
NameList[i] = PathAsset
FileAssets[i].filename = NameList[i]

SetMaxFileAssetMetaData SceneFilename FileAssets

The problem here is the error I get:

FileAssets[i].filename = NameList[i] -> Unknown property: "filename" in undefined <<

When I replace the FileAssets[i].filename with just for example FileAssets[1].filename then the error doesn't show but still,

the assets in the Asset Manager won't change to the new paths... (they stay absolute paths)

Hope Somebody is able to help me!



CGTalk Moderation
03-17-2010, 02:57 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.