Download

How to create custom UStaticMesh?

Hi,

I’m trying to create custom UStaticMesh for editor, with some extra properties. This should derive from UStaticMesh because there won’t be any changes with the geometry, importing or any other stuff, just couple of this that will be set after asset is imported. I need it to act as normal UStaticMesh in every other place.

You can add new class from editor and choose UStaticMesh as parent but if I try to compile the code, there are some error LNK2001: unresolved external symbol.
I believe this is because MinimalAPI is used in base class and methods are not exported outside of Engine. Deriving from USkeletalMesh which extends the same IInterface_AssetUserData interface but have ENGINE_API for entire class and no MinimalAPI used, creates no errors.

Is there a solution for this issue that don’t require customizing entire engine?
If not, what is the purpose of not exporting everything and why this class can be derived from editor if it actually can’t be derived at all?

I would appreciate if someone could provide me an answer.

No solution aside from custom engine if you need to access elements of a class that aren’t exported. Best you can do is submit a Github pull request to export what you need, and then pray that it gets seen and acted on (unlikely, recently).

The reasoning is basically just compile time optimizations - restricting what is exported in theory reduces build times, though I’m not sure in practice how significant it is. Dealing with non-exported engine types is a constant pain.

I was afraid that is the case. Thank’s for the response.