I wanted to create a new optimization tool for Unreal Engine 5 that would allow the user in a scene to search and select assets in a level that are above a specific tri count to allow developers to easily find which ones are the heaviest.
I decided on the tool; instead of using a slider or text box, I would use checkboxes with default values on them. I attempted in the past to use text boxes and sliders, but each of them would require complex blueprinting that would result in the Python script not working or requiring more just to get them working, resulting in many errors that would conflict with the Execute Python Command node.
To keep the widget simple and straightforward, I pretty much copied the checkbox layout that I used in my rotation code from previous widgets and changed it so that they had specific values starting at 100, then going up by another zero until 100,000.
In order to get the checkboxes to work properly and have the tool search for assets based on certain values, I need to create multiple execute python command nodes that were connected to branches with booleans for each checkbox attached that would determine whether or not the value is checked or not.
The Python script is designed so that when the button is pressed and reaches the Execute Python Command node, it will immediately check actors in the level and look at the meshes to see what their tri count is. At the bottom, where it says "if tri_count > 100:", tells the code to select assets that are above that value. For each Execute Python Command Node, the value is changed to match the checkbox it's calling.