Files
UnrealEngineUWP/Engine/Source/Editor/StaticMeshEditor/Public/StaticMeshEditorActions.h

74 lines
2.1 KiB
C
Raw Normal View History

// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
#pragma once
/**
* Unreal StaticMesh editor actions
*/
class FStaticMeshEditorCommands : public TCommands<FStaticMeshEditorCommands>
{
public:
FStaticMeshEditorCommands() : TCommands<FStaticMeshEditorCommands>
(
"StaticMeshEditor", // Context name for fast lookup
NSLOCTEXT("Contexts", "StaticMeshEditor", "StaticMesh Editor"), // Localized context name for displaying
"EditorViewport", // Parent
FEditorStyle::GetStyleSetName() // Icon Style Set
)
{
}
/**
* StaticMesh Editor Commands
*/
/** */
TSharedPtr< FUICommandInfo > SetShowWireframe;
TSharedPtr< FUICommandInfo > SetShowVertexColor;
TSharedPtr< FUICommandInfo > SetDrawUVs;
TSharedPtr< FUICommandInfo > SetShowGrid;
TSharedPtr< FUICommandInfo > SetShowBounds;
TSharedPtr< FUICommandInfo > SetShowCollision;
TSharedPtr< FUICommandInfo > ResetCamera;
TSharedPtr< FUICommandInfo > SetShowSockets;
TSharedPtr< FUICommandInfo > SetDrawAdditionalData;
// View Menu Commands
TSharedPtr< FUICommandInfo > SetShowNormals;
TSharedPtr< FUICommandInfo > SetShowTangents;
TSharedPtr< FUICommandInfo > SetShowBinormals;
TSharedPtr< FUICommandInfo > SetShowPivot;
TSharedPtr< FUICommandInfo > SetShowVertices;
// Collision Menu Commands
TSharedPtr< FUICommandInfo > CreateDOP10X;
TSharedPtr< FUICommandInfo > CreateDOP10Y;
TSharedPtr< FUICommandInfo > CreateDOP10Z;
TSharedPtr< FUICommandInfo > CreateDOP18;
TSharedPtr< FUICommandInfo > CreateDOP26;
Static mesh editor can now create Box/Sphyl and have multiple collision primitives, which can be manipulated. #ttp 334968 - TOOLS FEATURE: Add primitive collision inside the static mesh editor #branch UE4 #change GenerateSimpleCollision funcs now return true if any collision was built Moved Prompt to build collision into a func (to remove duplicate code), and modified so that the options are Yes=Replace, No=Add-To, Cancel = Cancel. Added CalcBoundingSphyl code which is loosely based on the Sphere code in that it finds the best axis to align the sphyl with (but locally rotates so it can treat the Z axis as length, regardless). It they finds the radius to best enclose the Sphyl (same as Sphere, but 2D). Then it increase the length of the Sphyl until that encapsulates all the remaining points. Replace instances of AddZeroed with Add(FKTypeElem()) so that the vtable would be created correctly if a base struct was introduced. Moved PhysX code which scales the Elems from ModifyPrimitiveSize to their own struct func (ScaleElem) so that it could be used elsewhere. Added new struct FPrimData which contains the PrimType and PrimIndex so we can look the corresponding collision Elem up in our BodySetup. The static mesh editor session which is open for a particular static mesh keeps track of these using the following: IsPrimValid û Checks to see if the prim data could be valid HasSelectedPrims û Returns true if there are any selected prims IsSelectedPrim û Check to see if the prim data is selected AddSelectedPrim û Adds prim data to our selection RemoveSelectedPrim û Removes prim data from our selection RemoveInvalidPrism - Removes any prims which are no longer valid from the selection ClearSelectedPrims û Removes all the prim data from our selection DuplicateSelectedPrims û Duplicates the selected prims TranslateSelectedPrims - Translates the selected prims by a specified amount RotateSelectedPrims - Rotates the selected prims by a specified amount ScaleSelectedPrims - Scales the selected prims by a specified amount CalcSelectedPrimsAABB - Calculates the bounding box of the selected prims DeleteSelectedPrims û Deletes the selected prims GetLastSelectedPrimTransform û Gets the transform of the last prim which was added to the selection. GetPrimTransform - Gets the transform of a specified prim SetPrimTransform - Sets the transform of a specified prim Added placeholder calls to begin/end transaction where itÆs needed whenever the bodysetup prims are modified. Added new Static Mesh Editor menu option to create a capsule/sphyl Added dedicated collision toggle flag to the Static Mesh Editor so we could manage our own handling of the draw functions in order to inject hit proxies where needed so we can test when theyÆve been clicked on in the viewport. Widget now works when selecting collision Elems. Space toggles the manipulation method. SelectedPrims can be trans/rot/scaled using the editor widget. Prims can be duplicated or deleted either using menu entries or keyboard shortcuts. Alt+drag is also supported for duplication. ProcessClick was updated so that whenever a new selection type is clicked on the previous types are deselected (sockets, prims, edges), and other code location were updated to clear the selected prims where appropriate. Modified OnFocusViewportToSelection so that it also focuses on the selected elems too Modified SetSelectedSocket so that when passing NULL it deselects all the sockets [CL 2104326 by Andrew Brown in Main branch]
2014-06-13 05:03:24 -04:00
TSharedPtr< FUICommandInfo > CreateBoxCollision;
TSharedPtr< FUICommandInfo > CreateSphereCollision;
Static mesh editor can now create Box/Sphyl and have multiple collision primitives, which can be manipulated. #ttp 334968 - TOOLS FEATURE: Add primitive collision inside the static mesh editor #branch UE4 #change GenerateSimpleCollision funcs now return true if any collision was built Moved Prompt to build collision into a func (to remove duplicate code), and modified so that the options are Yes=Replace, No=Add-To, Cancel = Cancel. Added CalcBoundingSphyl code which is loosely based on the Sphere code in that it finds the best axis to align the sphyl with (but locally rotates so it can treat the Z axis as length, regardless). It they finds the radius to best enclose the Sphyl (same as Sphere, but 2D). Then it increase the length of the Sphyl until that encapsulates all the remaining points. Replace instances of AddZeroed with Add(FKTypeElem()) so that the vtable would be created correctly if a base struct was introduced. Moved PhysX code which scales the Elems from ModifyPrimitiveSize to their own struct func (ScaleElem) so that it could be used elsewhere. Added new struct FPrimData which contains the PrimType and PrimIndex so we can look the corresponding collision Elem up in our BodySetup. The static mesh editor session which is open for a particular static mesh keeps track of these using the following: IsPrimValid û Checks to see if the prim data could be valid HasSelectedPrims û Returns true if there are any selected prims IsSelectedPrim û Check to see if the prim data is selected AddSelectedPrim û Adds prim data to our selection RemoveSelectedPrim û Removes prim data from our selection RemoveInvalidPrism - Removes any prims which are no longer valid from the selection ClearSelectedPrims û Removes all the prim data from our selection DuplicateSelectedPrims û Duplicates the selected prims TranslateSelectedPrims - Translates the selected prims by a specified amount RotateSelectedPrims - Rotates the selected prims by a specified amount ScaleSelectedPrims - Scales the selected prims by a specified amount CalcSelectedPrimsAABB - Calculates the bounding box of the selected prims DeleteSelectedPrims û Deletes the selected prims GetLastSelectedPrimTransform û Gets the transform of the last prim which was added to the selection. GetPrimTransform - Gets the transform of a specified prim SetPrimTransform - Sets the transform of a specified prim Added placeholder calls to begin/end transaction where itÆs needed whenever the bodysetup prims are modified. Added new Static Mesh Editor menu option to create a capsule/sphyl Added dedicated collision toggle flag to the Static Mesh Editor so we could manage our own handling of the draw functions in order to inject hit proxies where needed so we can test when theyÆve been clicked on in the viewport. Widget now works when selecting collision Elems. Space toggles the manipulation method. SelectedPrims can be trans/rot/scaled using the editor widget. Prims can be duplicated or deleted either using menu entries or keyboard shortcuts. Alt+drag is also supported for duplication. ProcessClick was updated so that whenever a new selection type is clicked on the previous types are deselected (sockets, prims, edges), and other code location were updated to clear the selected prims where appropriate. Modified OnFocusViewportToSelection so that it also focuses on the selected elems too Modified SetSelectedSocket so that when passing NULL it deselects all the sockets [CL 2104326 by Andrew Brown in Main branch]
2014-06-13 05:03:24 -04:00
TSharedPtr< FUICommandInfo > CreateSphylCollision;
TSharedPtr< FUICommandInfo > CreateAutoConvexCollision;
TSharedPtr< FUICommandInfo > RemoveCollision;
TSharedPtr< FUICommandInfo > ConvertBoxesToConvex;
TSharedPtr< FUICommandInfo > CopyCollisionFromSelectedMesh;
// Mesh Menu Commands
TSharedPtr< FUICommandInfo > FindSource;
TSharedPtr< FUICommandInfo > ChangeMesh;
TSharedPtr< FUICommandInfo > SaveGeneratedLODs;
/**
* Initialize commands
*/
virtual void RegisterCommands() override;
public:
};