Video Tutorials: https://youtu.be/CzjDl0cq6D0 (For any questions, feel free to leave a comment below. I'm always happy to help!)
The Simple Mesh Widget plugin is a lightweight and efficient solution for rendering StaticMesh, SkeletalMesh, and Blueprints containing StaticMeshComponent or SkeletalMeshComponent directly into UI. Designed for simplicity and performance, this plugin allows you to seamlessly integrate 3D models into your UI without the need for SceneCapture or complex render targets.
Key Features:
Render StaticMesh and SkeletalMesh in UI: Easily render static and skeletal meshes directly into UI, perfect for inventory systems, character previews, and more.
Blueprint Support: Render Blueprints that include StaticMeshComponent or SkeletalMeshComponent directly in your UI.
Lightweight and Efficient: Avoid the performance overhead of SceneCapture or render targets, ensuring smooth integration into your project.
Limitations:
Material Type Restriction: Only UserInterface material types are supported due to Slate UI Widget rendering.
Mesh Complexity Restriction: Since UserInterface materials lack depth information, the plugin performs CPU-side triangle culling and sorting. As a result, meshes with highly complex or internal intersecting triangles may not render correctly.
Usage:
Add Simple Mesh Widget to UI
Drag and drop a Simple Mesh Widget from the palette into your UI Designer. This creates a widget that can render 3D meshes within the UI.
Select Mesh Resource
Choose a StaticMesh, SkeletalMesh, or a Blueprint containing a StaticMeshComponent or SkeletalMeshComponent.
Ensure the AllowCPUAccess property of the mesh is set to true. This is required for the plugin to access and render the mesh in the UI.
Assign the selected resource to the ResourceObject property.
Set User Interface Materials
Assign User Interface materials to the Materials property for each material slot of the mesh. This ensures the mesh is rendered correctly within the UI context.
Adjust World Position and Rotation
Use the World Position Root Transform to adjust the mesh's position and rotation in 3D camera space.
The camera is assumed to be at (0, 0, 0) and facing (1, 0, 0).
For orthographic projection, typically only adjust the Rotation.
For perspective projection, adjust the Location (especially the X-axis) to position the mesh correctly.
Control Mesh Pivot and Render Size
Use the Mesh Pivot and Mesh Render Size properties to fine-tune the mesh's position and scale within the widget.
Click the FitMeshToWidget button to automatically calculate an initial size and position that fits the mesh within the widget.
Demo path: WidgetBlueprint'/SimpleMeshWidget/Demo/DemoUI.DemoUI'
Important Note:
Ensure the AllowCPUAccess property of the mesh is enabled (true) in the mesh settings. This is necessary for the plugin to access the mesh data and render it in the UI.