Replace Static mesh components with Hierarchical
- Exposure: public
- UE Version: 4.25
1 comment
-
This was created to deal with draw calls on static mesh components created inside a blueprint.
First you need to select a group of static mesh actors in the world. -- Or enter into a current blueprint with static mesh components. Make sure they have the same static mesh and materials exactly. (All SMs will take the first actors materials and mesh). Then, convert it to a blueprint ("Blueprints" heading at top of viewport > "Convert selection to blueprint") -- Make sure to "Harvest components".
1.) Create a new "Hierarchical instanced static mesh component" per static mesh actor type, and name according to the mesh (eg. sidewalk). 2.) Replace reference to "Hierarchical instanced static mesh component" variable in event graph. 3.) In event graph, make an array of all static mesh components of one static mesh actor type (eg. sidewalk). 4.) Compile and save. 5.) Go to blueprint in the world and activate the call in editor event "Replace SM's". 6.) Click "Edit blueprint" - "Apply instance changes to blueprint". 7.) Delete:
- "Hierarchical instanced static mesh component" variable from the event graph.
- All "Static mesh component" variables from the event graph.
- The "Make array".
- All "Static mesh components" that were just replaced. 8.) Rinse and repeat on the next "Hierarchical instanced static mesh component" for the next static mesh actor type. 9.) Delete all logic before moving out of this blueprint.
PROUWL
April 11, 2021, 9:59 am