Hi @sfjohnston were you able to figure this one out? I’ve also seen your other posts about the project.target.cs, and like you was able to compile the the game successfully. I’ve tried playing around with the the different USD setter-nodes, but I haven’t been successful in getting any data in.
Thanks for your reply @UE_FlavienP . I think I’ve been travelling the same path as sfjohnston. Based on sparse comments on this topic, my only choice to try now is to build the engine from source.
Just for future notes:
Modifying Project.Target.cs with FORCE_ANSI_ALLOCATOR=1 yields a log error like this:
[2023.11.18-19.42.14:974][474]LogPlayLevel: UAT: CPP_001 modifies the value of GlobalDefinitions. This is not allowed, as CPP_001 has build products in common with UnrealGame.
[2023.11.18-19.42.14:985][475]LogPlayLevel: UAT: Remove the modified setting, change CPP_001 to use a unique build environment by setting 'BuildEnvironment = TargetBuildEnvironment.Unique;' in the CPP_001Target constructor, or set bOverrideBuildEnvironment = true to force this setting on.
When the instructions in the log are followed (adding the vars into Project.Target.cs), I get this error:
LogPlayLevel: UAT: Targets with a unique build environment cannot be built with an installed engine.
Which has led me to understand that I need to build the UE from scratch and I’m in fact currently doing this.
However, I don’t know if this is the only thing that I need to do? Or do I need to edit UnrealGame.Target.cs to add the FORC_ANSI_ALLOCATOR var? At any rate, I will try both the engine’s target and the project.
Following the instructions in this doc, I download the source, and executed the ‘setup’ and ‘generate’ scripts.
I opened the UE5.sln in VS, and built UE5. The docs say it might take an hour at most, but for me it lasted for 18 hours. Not sure why.
From VS, I ran UE5 editor (without debugger).
Added USD Importer plugin. Shut down editor. Ran editor again from VS.
In the editor, I created a C++ project, which generated the target.cs files from the get-go.
Added FORCE_ANSI_ALLOCATOR=1 to Project.Target.cs only.
Added UsdStageActor.
Used Level Blueprint: added UsdStageActor’s Set Root Layer node and inputted a USD file.
Compiled the game and saw the USD displayed.
I would like to suggest that the UE docs to mention need to build the engine from source. Without this warning, the current instruction in docs is only half true.
Following these steps , did you manage to import USD at runtime in the editor or in a build/package?
For me it works in the editor but not in the build.
Explore alternative solutions like Alembic for runtime asset import, which might have better standalone support.
Investigate if there are any unofficial workarounds or community patches for USD runtime import in Unreal Engine.