Situation: I customized CreateSceneProxy in MYMeshComponent (which inherits from UMeshComponent) to render a mesh from C++. In the proxy class that inherits from FPrimitiveSceneProxy and overrides GetDynamicMeshElements, I use FDynamicMeshBuilder’s GetMesh to draw. I load the material at /Script/Engine.Material’/MyPlugin/Materials/MyMat.MyMat’ using StaticLoadObject and pass that material proxy into GetMesh.
Issue: My custom material MyMat does not show up in the editor. The default MD_Surface material draws correctly with the same code. I confirmed in CreateSceneProxy that the material proxy is loaded and assigned without error.
Checks performed:
– Verified the material’s blend mode is set to opaque rather than translucent
– Confirmed in GetViewRelevance that main-pass and translucency flags are correct
– Added a log just before GetMesh to make sure the material proxy is actually passed in
Figures: Figure 1 shows the attempted MyMat result (nothing visible). Figure 2 shows MD_Surface working as expected. The blue lines in the screenshots are unrelated.
Is there any special step I’m missing to get a custom material to render from within a scene proxy? Any guidance would be greatly appreciated.