|
Hey users and staffers,
In 3dsmax 2009,
Since loadMaterialLibrary function does not accept a .max file argument string (although the material editor allows it),
as a work around, I wrote a function that:
* adds a file as an xref scene using xrefs.addNewXRefFile
* reads in its materials
* deletes that xref scene.
Unfortunately, if I employ this in a loop over a large list of scenes, I end up with my original scene
having a copy of every layer from every xrefscene I referenced and deleted.
In some simple tests, layermanager.count is as high as 76 (76 empty layers) when I am done.
But I am sure in my production environment, our staff could find a way to make that much higher.
I have 4 questions:
1. is there a built in, documented or undocumented method, by which I can load a .max file as a material library?
(if so, I can skip using my function)
2. is there a way to disable automatic importing of layers when I xrefscene a .max file?
(if so, I can disable that and continue happy).
3. if neither 1 nor 2, are the left-over empty layers considered a bug or a feature of the layermanager and xrefscene nodes?
4. if neither 1 nor 2, is there a better work around? Since I have to pay most of the cost of loading the scene anyways, I am open to ideas.
Best regards,
-epu
|