I wanted to make a widget that would allow me to change the rotations of selected assets based on the axis and degrees selected and also undo any changes made.
I wanted to give the widget a simple but straightforward design, using borders to help keep the overall widget organized. Adding in a Canvas Panel to the Stack Box allows for easier and freer adjustment of the dimensions of the widget. To have text appear on the tops of the check boxes, I used multiple vertical boxes, having the text on the top layer. I also made sure to set the check boxes and the buttons to variables since we need to access them later.
The first code I began to tackle was the rotation undo. The way it is set up is that at the beginning, which references itself and connects with a selected level actor, when clicking on the button which is triggered through the event node, the world rotation of the mesh returns to default 0,0,0 on all axis's.
Afterwords, I began working on the random rotation. Keeping the begin transaction which references itself, I then plugged it into a sequence node which then plugs into branches with the X, Y, Z checkbox buttons plugged into the conditions. The true then gets plugged into Float variables created that set the rotations for the axis's, for both the random and snap rotation, the default will start with 45 degrees.
Plugging into a Rotator variable we create, we then plug that into the get selected level actors so it only affects what's selected in the level and add actor world rotation which will officially affect the rotation of the assets.
For the snap rotation, the code is just duplicated from the random but with the addition of extra branches with the checkbox variables for the degrees plugged into the conditions. Repeated this for each degree and adjusted the values in the set floats.