Commit Graph

173 Commits

Author SHA1 Message Date
ryan schmidt
24095e6d33 ToolsFramework: Add UTransformProxy::AddComponentCustom(), allows adding a target Component with custom transform get/set functions. Can be used to (eg) wrap an ISMC instance.
ModelingTools: add support for ISMC instances in EditPivotTool and TransformMeshesTool. In both cases the Tool will operate on the Instances by default, rather than the Component.  Clean up TransformMeshesTool properties panel, add grid and rotation snapping.

#rb none
#rnx
#preflight 60c83c1243ec380001e252cb


#ROBOMERGE-OWNER: ryan.schmidt
#ROBOMERGE-AUTHOR: ryan.schmidt
#ROBOMERGE-SOURCE: CL 16670048
#ROBOMERGE-BOT: (v834-16658389)
#ROBOMERGE-CONFLICT from-shelf

[CL 16670125 by ryan schmidt in ue5-main branch]
2021-06-15 02:44:58 -04:00
Ryan Schmidt
b71d3f7303 ToolsFramework: support multiple saved versions of a UInteractiveToolPropertySet. Previously only a single global version of a particular UInteractiveToolPropertySet could be saved via ::SaveProperties(), despite the Tool argument. This change adds an internal map keyed on a custom string. This allows different Tools using the same PropertySet to have their own unique saved properties if desired, or share a saved version between a set of Tools. A change to initialization is also made - during the first SaveProperties() call that spawns the new saved property set, the current/initial property values are no longer ovewritten with the default values in ::SaveRestoreProperties(). This allows a Tool to customize the default values before calling Restore().
An unused ::GetPropertyCache() function was also removed.

#rb semion.piskarev
#rnx
#jira none

[CL 16669477 by Ryan Schmidt in ue5-main branch]
2021-06-15 00:27:08 -04:00
Ryan Schmidt
a8c13b57a9 ModelingComponents: make FMeshDescription returned by IMeshDescriptionProvider const, this pointer should not be modified
#rb none
#rnx
#jira none
#preflight 60c5024af7cffb0001d3fdfa
#fyi semion.piskarev, lonnie.li

[CL 16652350 by Ryan Schmidt in ue5-main branch]
2021-06-12 15:45:49 -04:00
Ryan Schmidt
fdf11b67d2 ModelingComponents: Clean up DynamicMeshComponent API. Update Component and Proxy handling of Tangents to use Attribute Overlay if available. Update affected Tools and also convert most of the affected Tools to use UE::ToolTarget helper functions.
- Add UE::ToolTarget::CommitMaterialSetUpdate() and ::CommitDynamicMeshUpdate(). ::GetDynamicMeshCopy() can now return tangents if requested.
- Add IMeshDescriptionProvider::CalculateAutoGeneratedAttributes(). Default implementation does nothing, UStaticMeshComponentToolTarget implementation initializes auto-generated MeshDescription attributes. Used in ::GetDynamicMeshCopy() to get tangents (but requires a MeshDescription copy).
- Clean up handling of Tangents in Simple/OctreeDynamicMeshComponent. Add local MakeTangentsFunc() to generate the Tangents lambda, handle different cases and no-tangents fallbacks consistently.
- UDynamicMesh: add optional info arguments to EditMesh() and ChangeInfo struct. Add support for deferring change events from Edit funcs.
- Remove UBaseDynamicMeshComponent::InitializeMesh(), ::Bake() APIs, and add ::SetMesh(). Implement in Simple/Octree implementations, update all Tools that used those APIs.
- Add USimpleDynamicMeshComponent::ProcessMesh(), EditMesh(). These are now the preferred ways to read/write mesh.
- Update USimpleDynamicMeshComponent tangents handling. Externally-computed tangents are now taken directly from the FDynamicMesh3 attribute set. Autogenerated tangents are still computed and stored in an internal FMeshTangentsf, but this is no longer exposed for external updates.
- Remove UPreviewMesh pass-through functions for Tangents access, InitializeMesh() and Bake(). Add ProcessMesh()
- Update all affected Tools. In most cases these Tools have also been converted to use ModelingToolTargetUtil functions, instead of direct ToolTarget interface casting.

#rb none
#rnx
#jira none
#preflight 60c3e71d3e1b3c00015668af

[CL 16650666 by Ryan Schmidt in ue5-main branch]
2021-06-11 22:39:18 -04:00
Zousar Shaker
b6f7dafdb1 Fixing callsites for new raw pointer to TObjectPtr upgrade pass on Engine + ShooterGame.
#rb none

[CL 16640949 by Zousar Shaker in ue5-main branch]
2021-06-11 10:09:47 -04:00
semion piskarev
657650fe05 UVEditor: Added live preview to UV editor. To support this, did major refactoring in the way that the UV editor supplies its tools with input. Also added scaling of islands and tweaked the used material to make gizmo more visible.
#rb Brooke.Hubert, Lonnie.Li, Michael.Balzer
#rnx
#jira UETOOL-3111, UETOOL-3574

[CL 16618600 by semion piskarev in ue5-main branch]
2021-06-09 23:53:59 -04:00
semion piskarev
26410ec36f MeshModelingTools: Refactored modeling tools gizmos to avoid communication between component and proxy and prevent race conditions that resulted in incorrect view information being used in hit tests. Also fixed a minor issue with view plane-parallel circle gizmos, and created option to have scaling handles align better to view.
#rb Ryan.Schmidt
#rnx
#jira UETOOL-3468

[CL 16611870 by semion piskarev in ue5-main branch]
2021-06-09 16:28:33 -04:00
semion piskarev
cf40dc417f MeshModelingTools: Tweaked tool target requirements object storage default and added a convenience function to add requirements. Also added several comments in places.
#rb Lonnie.Li, Tyson.Brochu
#rnx
#jira none

[CL 16606399 by semion piskarev in ue5-main branch]
2021-06-09 11:50:54 -04:00
Ryan Schmidt
489dbc61c7 ToolsFramework: remove the AssetAPI concept from the Interactive Tools Framework. Replaced by ModelingObjectCreationAPI in ModelingComponents.
#rb none
#rnx
#jira none
#preflight 60b7e9448a2a64000126348c
#fyi brooke.hubert

[CL 16540327 by Ryan Schmidt in ue5-main branch]
2021-06-02 18:01:32 -04:00
Ryan Schmidt
528eef40e9 InteractiveToolsFramework: change checks() to ensures() and switch to non-fatal error handling for most situations in GizmoManager and ToolManager. Add TransformGizmo::GetGizmoTransform()
#rb none
#rnx
#jira none
#preflight 60b03b4b7e4e6a0001a001f0

[CL 16499542 by Ryan Schmidt in ue5-main branch]
2021-05-28 02:04:32 -04:00
Ryan Schmidt
6c20b92bf4 ToolsFramework: add a mechanism for clients of UInteractiveToolsContext to provide alternative implementations of the core ITF objects (eg InputRouter, ToolManager, etc) without having to subclass and duplicate all the Initialize()/Shutdown() logic.
#rb brooke.hubert
#rnx
#jira none
#preflight 60b02855f51cd900016680d0

[CL 16494849 by Ryan Schmidt in ue5-main branch]
2021-05-27 20:36:47 -04:00
Ryan Schmidt
7a93eace02 ToolsFramework: add register and unregister helper functions to TransformGizmoUtil, to facilitate EdModes sharing the context object
#rb jimmy.andrews
#rnx
#jira none
#preflight 60b013ebb60e930001239ae5

[CL 16493585 by Ryan Schmidt in ue5-main branch]
2021-05-27 19:09:12 -04:00
Ryan Schmidt
4ec1b6ae3c Gizmos: refactor Modeling Mode gizmo creation out of InteractiveGizmoManager. Editor will use other "default" transform gizmo implementations, and so the UTransformGizmo creation helper functions do not belong in GizmoManager. Instead a UTransformGizmoContextObject now provides this functionality. ModelingToolsEditorMode (and any other modes/systems that want to use these gizmo convenience functions) creates an instance of UTransformGizmoContextObject and registers it with the ContextObjectStore. Calling code can spawn a new UTransformGizmo by looking this object up in the ContextStore and calling it's helper functions. Static versions of the helper functions in the UE::TransformGizmoUtil:: namespace provide a single-line interface that replaces the previous GizmoManager call sites in the MeshModelingTools library.
IntervalGizmo is now just registered and unregistered as needed by the MeshSpaceDeformerTool, as this is the only place it is currently used.

Previous implementation in InteractiveGizmoManager is left intact as there are a few uses outside of MeshModelingTools that need to be cleaned up before it can be deleted.

UTransformGizmo now requires it's Builder to tell it which sub-gizmo identifier strings to pass to the GizmoManager to create axis/plane/rotation sub-gizmos (and the code that registers the Builder must then provide these strings). This cleans up previous explicit references to UInteractiveGizmoManager static strings from UTransformGizmo.

#rb Christina.TempelaarL, david.hill
#rnx
#jira none

[CL 16409673 by Ryan Schmidt in ue5-main branch]
2021-05-20 16:39:39 -04:00
Ryan Schmidt
c0ba0d5235 ModelingMode: Add support for selection-focus and point-focus at Tool level.
- New UInteractiveToolCameraFocusAPI UInterface defines functions a Tool can implement to publish its ability to provide a focus-box and focus-point
- ModelingMode uses this API to customize behavior. Box-focus (f hotkey) will now always focus on Tool-provided focus-box if available. Point-focus (c hotkey) will focus on nearer of world-hit and Tool focus-point.
- Default implementations for PrimitiveComponentToolTarget in SingleSelectionTool and MultiSelectionTool
- Custom focus-box implementations for PolyEdit-derived and TriSelect-derived tools, to focus on active selection if available
- Custom focus-point implementations for MeshSurfacePointTool

#rnx
#jira none

[CL 16246252 by Ryan Schmidt in ue5-main branch]
2021-05-10 01:17:30 -04:00
Ryan Schmidt
bca2b32ac7 ModeingMode: restore EditingLOD functionality lost in ToolTarget transition. Port EditingLOD functionality from FStaticMeshComponentTarget/Factory to UStaticMeshComponentToolTarget/Factory. Add UToolTargetManager::FindFirstFactoryByPredicate() and FindFirstFactoryByType(). ModelingToolsEditorModeToolkit now also looks up the StaticMeshFactory and updates the EditingLOD when it changes in the UI.
EStaticMeshEditingLOD enum moved to ComponentSourceInterfaces.h to make it more widely available.

Add ToolBuilderUtil::EnumerateComponents() and ToolTargetManager::EnumerateSelectedAndTargetableComponents(), this allows ToolBuilders to do additional checks on the valid Targets without having to make local arrays/etc. Fix SetCollisionGeometryTool to not build ToolTargets every frame just to check if one is a StaticMeshComponent.

#rb lonnie.li
#rnx
#jira none
#preflight 6092e932242f6600012445b0

[CL 16213180 by Ryan Schmidt in ue5-main branch]
2021-05-05 16:43:24 -04:00
brooke hubert
94cf8c06ec Interactive tools context now has a store for arbitrary context objects, which can be accessed via tools for shared data or operations, like typed element actions.
#Jira none
#preflight 6092b7858b751d0001be9bed
#rb semion.piskarev
#fyi ryan.schmidt

[CL 16209160 by brooke hubert in ue5-main branch]
2021-05-05 12:42:29 -04:00
michael balzer
01884dcf8c MeshModelingTools: Cancel active tools on world tear down. This addresses issues where changes are saved but we cannot undo them, and it also fixes issues where accepting tool edits during world tear down breaks assumptions made in the code.
#jira UE-114559
#rb jimmy.andrews semion.piskarev
#rnx

[CL 16207816 by michael balzer in ue5-main branch]
2021-05-05 11:18:39 -04:00
halfdan ingvarsson
8e8b8790c7 Add a skeletal mesh component tool target that allows editing skeletal meshes with the regular modeling tools.
#jira UE-93689
#rb lonnie.li

[CL 16199149 by halfdan ingvarsson in ue5-main branch]
2021-05-04 16:43:57 -04:00
tyson brochu
56d8f20f4c Refactor TPropertyWatcher back into a single class. There are now two types of constructor: one that takes a custom "!=" test function, and one that uses the built in operator for the type. If the type does not have a "!=" operator available, the caller is forced to use the constructor that specifies a custom test function.
#rnx
#preflight 6091789d5f41bc0001c7cfbf

[CL 16196522 by tyson brochu in ue5-main branch]
2021-05-04 14:01:08 -04:00
tyson brochu
09b02f6d5a Property watcher class that can accept a user-defined equality test. Useful to watch types that don't have an equality operator.
#rnx
#rb semion.piskarev

[CL 16169716 by tyson brochu in ue5-main branch]
2021-04-30 12:51:04 -04:00
semion piskarev
773ecfbb6a MeshModelingTools: Allow programmatic changes to properties to update detail panel properly.
#rb Lonnie.Li
#rnx
#jira UE-103980, UE-101251, UE-96691

[CL 16127920 by semion piskarev in ue5-main branch]
2021-04-27 11:06:18 -04:00
semion piskarev
58d5cbd5cf MeshModelingTools: Adding current version of UV editor.
#rb Brooke.Hubert, Ryan.Schmidt
#rnx
#jira UETOOL-3108, UETOOL-3110

[CL 16078314 by semion piskarev in ue5-main branch]
2021-04-21 14:36:05 -04:00
Jimmy Andrews
aa12ad308c Copy the separate asset and component materials from the source mesh to the new assets generated by plane cut tool (+ generally support creating an asset with separate component and asset materials)
#jira UE-110096
#rb tyson.brochu
#rnx
#preflight 6075fefa8c3f7700019357cc

[CL 15995092 by Jimmy Andrews in ue5-main branch]
2021-04-13 17:15:34 -04:00
Christina TempelaarL
8839ad8240 Added StateTarget and TransformSource for use with UGizmoBaseObject derived classes.
#jira UETOOL-2313
#rb ryan.schmidt
#preflight 606ab5057a9a3e0001e884c8

[CL 15913920 by Christina TempelaarL in ue5-main branch]
2021-04-05 03:39:55 -04:00
Christina TempelaarL
173eb3ae07 Added support for rendering UGizmo*Objects. Also update hit target interacting state when interacting. Eventually all other sub-gizmos should be modified to support the same.
#jira UETOOL-2313
#rb ryan.schmidt
#preflight 606a95fa8952c500019750f1

[CL 15913571 by Christina TempelaarL in ue5-main branch]
2021-04-05 01:34:07 -04:00