[Closed] getting data from a max file without loading it
@losbellos: Ah, that is the method I was using! it’s just that after 8th byte it was a long list of zeros so I mistakenly thought I was at EOF.
@DenisT: Thanks, looks pretty cool, I will look into it.
I have already solved my problem using a different method but it is nice to know this for future reference.
Thanks again to both of your for the help.
saving all the relevant data in an object and then merging that object to the scene, getting the data from it, and deleting it.
and how you getting that data out without opening the max fle in max?
I am opening the max files in a way… as I said, I am merging an object from the scene that has the data, getting the data from it, and then deleting it.
It was not my original intent but it’s a workaround that works.
get/setMaxFileAssetMetadata is a huge time saver. I can’t wait until they release more/all of the max file data.
Here is a basic example of how to do this. First collect the metadata from the file as an array. Then modify properties of items in the array. Then set the metadata of the file to the array.
In my case, I replaced the network path to all assets in sceneassets:
oldPath = @"your old network path\sceneassets"
newPath = @"your new network path\sceneassets"
theMaxFile = @"your network path\scenes\yourScene.max"
metaArray = getMAXFileAssetMetadata theMaxFile
for x = 1 to metaArray.count do
(
fName = metaArray[x].filename
if matchpattern fName pattern:(oldPath + "*")
then
(
newFName = substituteString fName oldPath newPath
metaArray[x].filename = newFName
)
)
setMAXFileAssetMetadata theMaxFile metaArray