运行时加载USD内容的方法

Hello

我们希望打包出一个发布版的UnrealGame项目,

需要在运行时可以加载,编辑USD内容

目前发现无法直接实现

可能需要修改引擎源码。

所以想问问相关的修改路线以及注意事项。

Hello,

There are a few issues to contend with when trying to enable OpenUSD at runtime.

OpenUSD itself can currently only use the system allocator and does not support selecting a different allocator the way the engine does. It also makes use of C++ run-time type information (RTTI) which is normally disabled for the rest of the engine. When doing an editor build, the system allocator can be used and RTTI can be enabled for just the OpenUSD modules while all other engine modules can use a different allocator and have RTTI disabled. This is not possible with packaged games since they are built monolithically. Only a single allocator can be chosen for the executable, and RTTI must be either on or off for the whole project.

The UnrealUSDWrapper.Build.cs build file has some additional information about this and how to configure your project:

https://github.com/EpicGames/UnrealEngine/blob/release/Engine/Plugins/Runtime/USDCore/Source/UnrealUSDWrapper/UnrealUSDWrapper.Build.cs\#L170

So at a minimum, you will need to configure your project to use the system allocator and enable RTTI.

One thing to be aware of though is that even with OpenUSD enabled at runtime, not all of the asset creation machinery that is normally available in an editor build will be available at runtime. For example, I don’t believe it is possible to create skeletal meshes at runtime, and there are likely other asset types that can only be created and/or modified in the editor.

Hope that helps!

Thank you. I will follow the path you suggested and attempt the development.