Last week the USD Team released USD for 3ds Max 0.8 that included several new capabilities. Among them are:
You can get this update in your Autodesk Account. See the complete release notes on USD for 3ds Max 0.8 here.
Yes it still creates the NodeGraphs, but the materials dont connect to them, instead connecting directly in the contained shader(s) - we tested it in unreal 5.3.2 - and textures started working on import. Did not for you?
Yes it still creates the NodeGraphs, but the materials dont connect to them, instead connect to shaders contained in them directly, we tested it in unreal 5.3.2 and that fixed the material import (because Unreal doesnt need to understand NodeGraphs anymore), did it not for you?
It imports in with a blank texture. It imports as if I didn't run the script at all.
The structure looks like this before max changes it when max exports it.
Do you see this printed out in the max listener as the export runs?
"Running Unreal UsdPreviewSurface fix chaser..."
Also, can you try to export just a simple box with a texture to rule out issues that could be model specific?
And what max version are you using? Different 3dsmax versions build against different USD version, could impact the script i guess..
If you can zip up a small sample to reproduce with i can look at it monday. Also don't know if the unreal version can matter, we were successful in 5.3.2.
" Running Unreal UsdPreviewSurface fix chaser...
Chaser ERROR : name 'UsdShade' is not defined" is what the listener window is telling me. I'm guessing this is the problem.
Hmm, try just adding :
from pxr import UsdShade
At the top of the script, not sure why it wasnt needed for us.. 3 people tried it. What version of 3dsmax?
I have gotten the script to work on max 2023, have to try on my home computer with 2024 next with your fix. I have noticed another issue though in my testing: Unreal imports the model I exported from max and prioritizes my baked material over the material I created in Unreal. If I'm working on a large scene and want to update it in Unreal after I've made my changes in max I will have to manually switch to my unreal materials every time. Here's an object I exported from Unreal. Notice after you export from max it sets the materials up on export in such a way that Unreal automatically selects the baked option.
Any help would be appreciated. The main reason I use usd over datasmith is because I can work back and forth using the same file between applications and retain the same look of my assets and datasmith only goes one way. Because max changes the USD material structure it seems to be interfering with unreal's memory of the work I do in the engine. Bringing the usds back to Unreal after making changes in max results in the baked material as a priority in Unreal
It's been a few months since I have tested in Unreal, but here is a video covering some of the concepts that might improve your thinking on USD. I start displaying some Max/Maya/Houdini/Unreal interchange workflows around the 20-minute mark.
The reason to point you to this is to introduce you to the USD paradigm that is not about import/export. Importing and exporting do play a role, but should only be a limited starting point. For Max, you can export your assets as needed into USD. But once you put something into USD, it's best to just stay in USD Land. In the video, notice how the editing between the apps is not doing import/export once the assets are already in USD.
I will try to find some time to explore the current state of Unreal and give an update on the workflows, but until then try to explore the paradigm demonstrated in the video above.
I'll point out this isn't happening with Blender or Maya and it's not happening if I export a USD from Unreal and open it again in Unreal so max is handling USD in such a way that makes a typical workflow between it and Max impossible unless you value using it to handle texturless models or baked textures between both applictions. MaterialX isn't the solution I'm looking for either. What max is doing to the unreal materials is causing this. If I do nothing to a functioning USD with unreal materials but export it from max, 3ds max breaks the materials I spent time on in Unreal, they need to be re-applied manually which isn't an option in as large a scene as I have. Which should be retained when I re-import them back to Unreal. Exporting the same USD from Blender preserves the work I've done in Unreal (even if I edit the position and location of the model in Blender.) Max is unique in this regard so I'm no expert in all the inner workings of this but I do know Max handles USDs differently. I don't know what can be done specifically in max to prevent max from breaking the memory of the materials I created in Unreal. Currently there's nothing I can do in Unreal, maybe max isn't exporting the USD in their entirety enough to preserve the materials from Unreal or it's converting them somehow.
The importance of this working is this: I have a massive level I'm making in Max and I need to be able to work fluently by being able to seemlessly work on my floating USD file between applications which means being able to position all my objects in max, save the USD and open the scene in Unreal and view it in realtime, make my changes to the materials and objects (for example) then save in Unreal. Open the same file in max and adjust the scene further by adding new objects - save the scene in max. Open in unreal again, set up materials in unreal on the new assets i just added to the scene in max and work back and forth. I can't do this because max keeps interfering with the materials. This will work fine for previewing purposes if I only care to see the baked materials in both applications but if I want to view and save unreal materials it's impossible after they exit max. Unreal materials gone and need re-applied. P.S. I'll watch your video tonight but it is an issue specific to 3ds max. My workflow handles fine with other software.
I am a bit confused by what you are doing, opening the model you shared- it is empty - seems there is a missing reference in it :
Missing this : @assets/Game/CoD/xmodels/berlin_com_office_chair_black.usdc@@
So this seems like a complex asset....
When you import it in max, what exactly are you importing? The scene? one chair? Or are you referencing it in as a USD Stage object? And when you export are you re-exporting the whole thing? Import/export is definitely lossy - but it is similarly lossy in maya, in maya what are you doing exactly? Importing the whole scene? a subset? Loading a USD stage?
If you can provide a small subset of the scene that has a full repro case, and detailed steps (import of what, export of what, to what, etc.) it will help.
Many things come into play, where are the material bindings authored from unreal? on what USD layer? If i can see how the materials are setup, what you import in 3dsMax, and then what layer you overwrite (i assume?) on export, it should be easier to tell.
If you import the entire scene in 3dsMax and re-export to a single layer, that will be an entirely new thing, definitely.
I'm only trying to export a single model. File > export selected. I'm simply doing the same export and import process for both. I select the individual model, export it individually as usdc and I import it into max. Hopefully the model I'm exporting here of a billboard can demonstrate the hierarchy in the USD explorer-which completely changes once I export it from max whether I make changes to it or not. So take the file I'm giving you. If you open it in Unreal Engine in the USD explorer it will show up with all its native Unreal materials intact. Take the file I uploaded and export it from max and see what happens to its paths.
Notice the USD layout in my first image. If I open this in Unreal as it is the Unreal materials and everything will be laid out as they belong.
and here is what happens to it after max. This I believe is the problem. Max is destroying the structure I established. Even if I don't do anything to the usd, if I simply export it from max the hierarchy is ruined and Unreal no longer recognizes it since the paths are messed up.
The other applications aren't doing this to my USDs. They export with their original USD hierarchies intact.
That model in the zip is also empty. Likely referencing another layer which is not in the zip.
When you import, the usd content is converted to 3dsmax, there is no longer any USD involved, when you reexport there is no guaranty of preserving the initial hierarchy - the rules of max and usd are not the same, conversion can be lossy, especially on schemas max nothing about, like unreal shaders. If the material binding set in unreal was a collection based binding, and the material lived elsewhere, you wouldn't have this problem. We dont export materials inside geometry to ease reuse.
What exactly are you doing in maya/blender? maya import + export is definitely lossy as well, and i just tried in blender (latest public downloaded just now) and it does not preserve the hierarchy either on import + export :
I am not sure you are actually import/exporting (in the same sense as the max import/export - i.e. "import" means something different in unreal vs 3dsmax) anything to/from unreal, just loading/saving a layer - which itself carries nothing, elsewhere, given your zips are void of any geometry. I.e. I guess it's not converting to unreal data and converting back to USD.
This is what your unreal "export" looks like :
#usda 1.0
(
defaultPrim = "Root"
metersPerUnit = 0.009999999776482582
upAxis = "Z"
)
def Xform "Root" (
assetInfo = {
asset identifier = @../../../../../../Users/proto/Desktop/billboard.usdc@
string name = "Untitled_1"
dictionary unreal = {
string assetType = "World"
string contentPath = "/Temp/Untitled_1.Untitled_1"
string engineVersion = "5.4.4-35576357+++UE5+Release-5.4"
string exportTime = "2024.09.12-20.30.07"
}
string version = "F1D847C14E4DEDBC97DBE2E0B2B9D186392581DC"
}
)
{
def Mesh "SM_Billboard_SIde_Long_03" (
prepend references = /Game/Cyberpunk/Meshes/Props/BillBoard/SM_Billboard_SIde_Long_03.usdc@
)
{
token visibility = "inherited"
matrix4d xformOp:transform = ( (1, -0, 0, 0), (0, 1, -0, 0), (0, 0, 1, 0), (620, 550, 0, 1) )
uniform token[] xformOpOrder = ["xformOp:transform"]
}
}
You can see it doesnt itself carry anything, only a reference to `prepend references = @assets/Game/Cyberpunk/Meshes/Props/BillBoard/SM_Billboard_SIde_Long_03.usdc@`
Something can definitely be done with some scripting, or by structuring the assets and where the bindings are done differently - if the material is not "under" the prim you need to import, and the binding is done on a different/stronger layer than where the mesh lives, you should be able to then import/export the mesh layer, a preserve the material in the scene that references that mesh.
With a working scene sample it would be easier to see what the "no scripting" options are - if any.
Perhaps I'm mistaken when I exported the file out of blender but I thought I recalled the materials in Unreal being un-affected.
Are you telling me the files exported as USD from Unreal carry no geometry, only references to what's in my Unreal Project, references to unreal geometry? I'm not certain what all this really means as far as a workflow with Max. I want to be able to create a scene in max and work back and forth with Unreal. What do I need to do to make this possible? I want to be able to utilize all the tools max has while being able to view them rendered in Unreal using USD.
The zips you shared both contain one .usdc file, the snippet i shared in my last reply is the billboard usdc file, converted to ascii - you can see that it itself contains no geometry, it has a reference to another file :
asset identifier = @../../../../../../Users/proto/Desktop/billboard.usdc@
Which is a relative path that will resolve to something on your PC, but not on mine.
There's two ways, generally speaking, to deal with USD in a host application :
1) Converting to the application's data model entirely -> this is what our importer does
2) Creating a "reference" to a USD file, i.e. if the usd file changes on disk, its reflected -> this is what the stage object does, and I think this is closer to what the "import" in unreal, works.
I understand what you are trying to do,
The issue is that your materials bindings are destroyed when you import a mesh, and then re-export. If the material bindings where defined on another, stronger layer, in an override, or via collection based bindings, you could swap the mesh layer via import export, and not touch the material bindings at all as they wouldnt go through 3dsmax, only the mesh would be imported. I dont know what is possible from unreal, if you can tell it where to output the materials, or if you can tell it what the edit target should be. In an ideal world you would not need to import in 3dsmax at all, and the max tools would just work on prims selected in a UsdStage object, but we are not there - right now you can move prims and edit properties, but not work on the geometry - but this is something we want to do. Setting the edit target (target usd layer) is also not accessible from the UI, only via scripting (we currently default to the session layer).
To achieve what you want, you need to setup a USD layer architecture for the scene that separates the materials / bindings / meshes - having all that in one layer (and the materials being below the mesh in the hierarchy) causes Unreal materials to go through 3dsmax's import/export, which will definitely not preserve them - as mentioned above, if you import in max, it means converting to max's data model, and there is no notion of Unreal materials in there. It would be possible via scripting to handle that conversion, but it doesnt come "free". It's the same for maya and blender imports. Maya has the proxy shape workflow, which is not an import as defined above (more like 2)), using that it preserves everything in USD and you can make native USD edits to it on a live stage - similar to the USDStageObject in max, but it is more advanced / has alot more control/features. Maybe blender has something similar, i dont know.
There are probably 50 other ways to "fix" the materials using python, maybe simply reconnecting materials automatically after re-import..
Shawn's video above presents a way to achieve the kind of thing you want to do. USD is extremely flexible, and quite complex, there are alot of rules to understand how stage assembly / composition works and it's usually necessary to think ahead about the layer structure. We do not have good tools from 3dsMax at this time to build USD layer architectures that very are flexible - all of the USD python API are available however and run from 3dsMax / over the USDStageObject.
It seems like there's a lot of information to unpack then. It looks like the reference file is referencing another usdc? I exported a usdc with unreal, imported to max and exported over the usdc from unreal with max so now it's gone now because the file I exported from max NEEDED that unreal usdc as reference so because I saved over it the file cannibalized itself. Am I understanding this right? This is why the file was empty. So max's usd exports need to reference other usds to function so they're not standalone files, usds aren't an all-in-one file solution like I assumed- or perhaps this is what makes them so light-weight, because they need other files to reference to contain information.
Let's say I have an fbx scene that I export to usd. I'm guessing to utilize usd properly I still need these original files that it's referencing. I need to keep the FBX in its same location and everything, or does it only reference other usds?
For materials I need the USD to contain references to them.
What you mention in your second paragraph about max not requiring import (or at least that's the goal later on), I think that's what unreal is capable of doing because I only open the USD, if I import USD into my level in Unreal it actually places the contents into my project which is a different thing. This would offer the perfect workflow I'm looking for maybe. This explains why in max the usd never had the same usd hierarchy controls that unreal has. I've been working with apples and oranges.
I watched Shawn's video last night at work and I've read extensively about usd going from Unreals usd to the autodesk documentation on it as well as the nvidia and pixar documentation and videos and I still consider it fairly confusing but I'm starting to get it based on what you're telling me. It seems like at the moment it can't do a whole lot for materials but what about materialx? I don't expect you to speak to every materialx implementation but is this the best I have in this moment without scripting together something? Is materialx at a good point which would allow me to seamlessly carry over materials between applications or is it still not there? I have attempted to get it working between applications but have had the same sort of continuity issues between max and unreal or perhaps I was doing something wrong.
Thanks for sharing your adventure. USD is an extensive topic to unpack for sure. Our docs team is working on providing some new help content around USD in Max and Maya. I don't have an ETA on when we will get that out; We hope this will help many in the community start using USD effectively.
I have plans also to share some more walk throughs on using USD across multiple applications. When I can produce those I will share in the forums.
One thing to remember is that USD is not just a file format. It does come with a data format, but more importantly it comes with an entire paradigm/workflow for authoring content and collaborating. Its real power comes in the composition arcs that allow data from many directions to come together to create the final scene. Understanding Layers, Inherits, Variants, References, Payloads and Specializes arcs will help you start realizing the full potential of USD. A USD scene composes itself through these arcs, and the way those arcs are brought into a scene or asset determines how the scene/asset can be worked on independently across multiple applications or departments at a time. A well formatted asset or scene will be broken into as many layers or references as are needed for the different departments or applications to work independently on the aspect for which they are responsible. That's a lot to digest, and the rabbit hole will keep going deeper as you learn more and more about USD.
In terms of MaterialX, yes, it is certainly at a state to help you effectively collaborate across multiple DCCs. The last time I tested there were limitations in Unreal, but I expect that to change if it already hasn't. I still need to bring myself up to speed on where Unreal is today; when I do, I will share some more insights into this particular topic.
I can definitely use more USD help resources considering I've been over the max documentation a million times trying to figure out USD which is why I'm here, it's fairly limited. I just had this main question related to my situation though that I think is very important to me using USD. If when I save my USDs and try to upload them is resulting in them being empty, where are its contents being saved? Is there a way to view what it's referencing? If I have a saved max scene file and I export out the scene as a USD and I want to upload it for example, what else do I need to include with it exactly?
It depends on the method and setup of the scenes. There is no simple answer.
In our exporter, we create 1 or 2 USD files by default (one with the main scene hierarchy and meshes; the materials will go to that main file or to a second material file if the export settings say so and that material info will be sublayered into the other file). In that second case, there will be two files. But if you exported a scene with a USD Stage Object, that stage object will be referenced into the USD file--in which case there could be an arbitrarily long list of files that will be required to make your scene.
That is just the export workflow. Each release we are improving the native USD workflow within a USD Stage Object. In that workflow, the files needed are again completely arbitrary--the stage can have any number of USD files sublayered and referenced--and each of those can sublayer and reference other arbitrary files.
Okay so the materials are still being referenced in their original locations. If assets in my USD file are referencing textures and I move those textures and my asset goes black because the paths changed for my USD file materials, unlike re-accompanying objects with their textures in a project by adding an external path, how would I re-introduce my USD assets to its textures once said textures have been moved? The USD file has no option to add a path as I would a project without manually re-connecting every texture to its material in the material editor. How do I do this with a USD scene for example?
Can't find what you're looking for? Ask the community or share your knowledge.