[QUOTE=dekorkh;701]This is a problem I’m finding as well but I’m not sure I understand your solution. I’m kinda of an uber-noob:?: at this but I try to catch on as quick as I can. Mind expanding on your solution a little more? I would be really interested and appreciate it.
I’m only on the character/animation side of things, so I cannot say for how static assets are handled, but there’s no reason it can’t be expanded.
Each asset is basically tagged with some sort of unique identifier, and this is held in the scene- we hold the attribute in the User Property Buffer, but it can also be a Custom Attribute, app data, whatever, just some way to keep the data between Max sessions and attach it to the file (maybe the first numbers of the asset name, even).
When we need to do anything with the asset- whether exporting, auto-finding or auto-loading files, etc., we pass the unique ID into a “GetDataPaths” function.
This GetDataPaths function has a case of that contains all the possible unique ID’s and their relevant paths (an array or struct). We can then return the entire array or struct, or a single member (say, we only need the directory where animation exports go). We could change the entire folder structure, and only this single function would need to change, everything is centralized into only one hard-coded spot (and even the paths don’t need to be hard-coded if there is some consistency, be smart).
So, for example, say we have a character name of “Mario”, this is what all the code would look like:
The GetDataPaths function is something like:
fn GetDataPaths charName retMember:undefined =
struct dataPaths (animExportDir, meshExportDir)
charName = charName as name --case insenstive
projDir = "C:\\proj\\"
local retStruct = case charName of
#mario: dataPaths animExportDir:(projDir + "mario\\animexport\\") meshExportDir:(projDir + "mario\\meshExport\\")
#luigi: dataPaths animExportDir:(projDir + "luigi\\animexport\\") meshExportDir:(projDir + "luigi\\meshExport\\")
if retMember == undefined then
getProperty retStruct retMember
And to actually use it:
--we need to find the anim export directory
local theCharName = getUserProp theNode "charName" --assume our user prop is named "charName"
local theExportFolder = GetDataPaths theCharName retMember:#animExportDir
--if retMember is undefined or we don't supply it, function will return the entire struct, which is useful if we are going to use multiple data paths
exportFolder equals “C:\proj\mario\animexport\”
Hope that makes things more clear. Actually I have a confession to make, ours doesn’t work as nice (we use array instead of struct), but this would be much better