This should be an easy one but I am stuck. I am concatenating some strings together to give a final file path, which I will later use in the saveMaxFile command. Here is the code.
finalFile = (finalRoot + "\\" + curAsset + ".max") as string
"finalFile" ends up being a valid string such as "C:\Users\jdeehr\Documents\sandBoxForAssetBrowser\models\few\jh\kj\kj.max" I even queried the type to be extra sure and sure enough, it is a string.
However, if I call the command saveMaxFile(finalFile) it says "cannot convert undefined to type:fileName." How is it that MAX thinks finalFile is undefined?
The other strange thing is if I hardcode in saveMaxFile("C:\Users\jdeehr\Documents\sandBoxForAssetBrowser\models\few\jh\kj\kj.max") It works.
How are finalFile (which obviously is going to vary) and hardcoding in a path such as "C:\Users\jdeehr\Documents\sandBoxForAssetBrowser\models\few\jh\kj\kj.max" different in the context of saveMaxFile()? Thanks.
barigazy · 2012-05-18