Commit Graph

397 Commits

Author SHA1 Message Date
Ryan Schmidt
75a21c9bb9 ModelingTools: add support for creating Volumes directly from DrawPolygon, DrawRevolve, DrawPolyPath, and AddPrimitive, CombineMeshes, CutMeshWithMesh, PlaneCut, BaseCreateFromSelected Tools. Improve support for Editing volumes, eg handling mesh/volume interactions, and add configurable auto-simplification for volumes to avoid painful Editor hangs.
- Move ToolTarget implementations, DynamicMeshToVolume to ModelingComponentsEditorOnly module
- move VolumeToDynamicMesh, DynamicMeshProvider/Commiter interfaces to ModelingComponents module
- Add UCreateMeshObjectTypeProperties property set to expose mesh/volume options
- Add FCreateMeshObjectParams::TypeHintClass to allow AVolume type (or other UClass hints) to be passed to creation APIs
- Add UE::ToolTarget::ConfigureCreateMeshObjectParams() util function in ModelingToolTargetUtil, tries to determine output type in a FCreateMeshObjectParams based on input ToolTarget
- Add UEditorModelingObjectsCreationAPI::CreateVolume() implementation
- Add UEditorModelingObjectsCreationAPI::FilterMaterials() that strips out any internal materials and replaces with WorldGridMaterial. This occurs when (eg) subtracting a Volume from a StaticMesh, because the temporary volume mesh gets assigned internal materials, but the Tools don't know this. Use in EditorModelingObjectsCreationAPI when creating new objects. UStaticMeshComponentToolTarget also does this filtering in ::CommitMaterialSetUpdate().
- Add ::ComponentTypeSupportsCollision() function to ComponentCollisionUtil, use to avoid checks/ensures for Volume targets
- Add support for automatic mesh simplification in DynamicMeshToVolume. Add CVar to VolumeDynamicMeshToolTarget.h to control max triangle count (default 500). Apply auto-simplify when creating or updating an AVolume. This prevents the Editor from blocking for long periods on meshes that are too high-res for volumes (even 500 is quite high).
- DynamicMeshToVolume now emits polygroup-faces that contain holes (ie multiple boundary loops) as a set of triangles, rather than emitting separate overlapping faces for each boundary loop

#rb none
#rnx
#jira none
#preflight 60ba50632c42ea0001cb54c5

[CL 16561742 by Ryan Schmidt in ue5-main branch]
2021-06-04 16:04:03 -04:00
lonnie li
9adceca042 ModelingTools: Update BakeMeshAttributeMapsTool to the new baking framework.
#rb jimmy.andrews
#rnx
#jira UETOOL-3397
#preflight 60b8f8d439e5b70001bd4610

[CL 16551457 by lonnie li in ue5-main branch]
2021-06-03 15:29:38 -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
7b214c4a33 MeshModeling: add ModelingObjectsCreationAPI, replaces existing usage of IToolsContextAssetAPI in Modeling Tools/Mode
- add new UModelingObjectsCreationAPI and associated data structures, provides abstract API for creating mesh and texture objects from Tools that is not specifically tied to StaticMesh Actors/Assets
- new helper functions in UE::Modeling:: namespace to simplify usage of an implementation of this API registered in a ContextObjectStore
- add new UEditorModelingObjectsCreationAPI implementation of above, supports hooks for higher level to provide custom paths
- add ModelingModeAssetUtils.h, provides several functions in UE::Modeling:: namespace to be used to implement those hooks (various existing path-determination code is moved here)
- ModelingToolsEditorMode now registers an instance of UEditorModelingObjectsCreationAPI in ContextObjectStore and connects up callbacks to these path functions
- AssetGenerationUtil functions and ModelingModeAssetAPI deleted
- All Tools that previously used IToolsContextAssetAPI updated to use this new system

#rb jimmy.andrews
#rnx
#jira none
#preflight 60b7c2ddae46a1000162729b

[CL 16538450 by Ryan Schmidt in ue5-main branch]
2021-06-02 15:58:00 -04:00
tyson brochu
25fc95c902 Fix some property comments
#rnx
#rb ryan.schmidt
#preflight 60b65684ae46a10001235bfa

[CL 16516779 by tyson brochu in ue5-main branch]
2021-06-01 13:11:56 -04:00
Ryan Schmidt
451511406d GeometryProcessing: Improve cylinder projection in FDynamicMeshUVEditor.
ModelingTools: Replace local code in UVProjectionOp with calls to FDynamicMeshUVEditor. Major rewrite of UVProjectionTool to support ExpMap projection, improve property handling, support world-space dimensions, support re-using previous projection to simplify world-space tiling, support input selections coming from PolyEdit/TriEdit, support ctrl+click and ctrl+shift+click interactions to reposition projection primitive.
#rb none
#rnx
#jira none
#preflight 60b57761f51cd90001f9676c

[CL 16511543 by Ryan Schmidt in ue5-main branch]
2021-05-31 22:15:32 -04:00
Jimmy Andrews
f7785c64bd try to match the number of UV layers in the source mesh(es) when duplicating / combining meshes
#rb david.hill
#rnx
#preflight 60b00c8c7e4e6a00018b13d3

[CL 16493195 by Jimmy Andrews in ue5-main branch]
2021-05-27 18:34:25 -04:00
lonnie li
04eedbdd12 ModelingTools: Refactor new bake path to bake evaluators.
Add support for variable float size and bake results per evaluator.

#rb jimmy.andrews michael.balzer
#rnx
#jira UETOOL-3397
#preflight 60aea5a35f6905000159e87b

[CL 16475935 by lonnie li in ue5-main branch]
2021-05-26 17:14:57 -04:00
lonnie li
56cb500376 ModelingTools: Fix selection after fill hole op in TriEd.
#rb jimmy.andrews
#rnx
#jira UE-114975
#preflight 60ad791a1d78490001f018b9

[CL 16458580 by lonnie li in ue5-main branch]
2021-05-25 19:29:53 -04:00
Ryan Schmidt
fdb2bab149 GeometryProcessing: Move MeshConversion module from GeometryProcessing plugin to Runtime. Transfer necessary additional files from DynamicMesh to GeometryCore. Move functions from MeshIndexUtil and MeshAdapterUtil namespaces to UE::Geometry namespace.
#rb none
#rnx
#jira none
#preflight 60a7e75e7d6b060001c61f47

[CL 16428413 by Ryan Schmidt in ue5-main branch]
2021-05-22 01:32:46 -04:00
Ryan Schmidt
623e4f96fe GeometryCore: create new GeometryCore Module. Move GeometricObjects code from GeometryProcessing plugin to this new module, as well as core FDynamicMesh3 classes (attributes, aabbtree/octree, change tracking). Update module Build.cs files that reference GeometricObjects.
#rb none
#rnx
#jira none
#preflight 60a713700569f300014a064a

[CL 16415082 by Ryan Schmidt in ue5-main branch]
2021-05-21 01:04:38 -04:00
Ryan Schmidt
ebb5a89ce3 PolyEdit: add Duplicate operation
#rb jimmy.andrews
#rnx
#jira none
#preflight 60a6e28aa5fa6d00018453de

[CL 16412745 by Ryan Schmidt in ue5-main branch]
2021-05-20 19:44:37 -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
semion piskarev
24e3ede218 Move IDynamicMeshProvider and IDynamicMeshCommitter out of the dynamic mesh module so that it can remain devoid of UThings. Add comments to avoid this in the future.
#rb Ryan.Schmidt
#jira none
#rnx

[CL 16388181 by semion piskarev in ue5-main branch]
2021-05-19 12:39:42 -04:00
semion piskarev
34ba053cd6 MeshModelingTools: Add channel selection to displace tool.
#rb Lonnie.Li
#rnx
#jira none

[CL 16386689 by semion piskarev in ue5-main branch]
2021-05-19 11:21:56 -04:00
halfdan ingvarsson
2a61423f30 Simple skin binding tool. Supports closest distance and geodesic voxel skinning methods.
#jira UE-93689
#preflight 60a473704c32030001eae3b2

[CL 16380959 by halfdan ingvarsson in ue5-main branch]
2021-05-18 23:23:00 -04:00
tyson brochu
50cf569720 Normal Flow Remesh improvements:
- add scalar damping to vertex projection and normal fitting
- detect areas that cover holes in the target mesh and don't project in those regions
- expose smoothing parameters for these areas

#jira UETOOL-3554
#ushell-cherrypick of 16170772 by Ryan.Schmidt
#rb ryan.schmidt
#preflight 60a2d17e4f034a000184b785

[CL 16359473 by tyson brochu in ue5-main branch]
2021-05-17 17:27:58 -04:00
lonnie li
bbab3ea643 ModelingTools: 1st pass Mesh Texture bake refactor w/ multisampling support.
#rb tyson.brochu jimmy.andrews semion.piskarev michael.balzer
#rnx
#jira UETOOL-3397
#preflight 60a2b8b7292e3200011a6bf1

[CL 16357743 by lonnie li in ue5-main branch]
2021-05-17 16:01:01 -04:00
halfdan ingvarsson
a18ed490c0 Fix static analysis warnings in the skin weights paint tool.
#jira none
#trivial
#rnx

[CL 16329036 by halfdan ingvarsson in ue5-main branch]
2021-05-14 09:37:41 -04:00
halfdan ingvarsson
7e6645e305 A primitive skin weights paint tool for skeletal meshes.
#jira UE-93689
#rb ryan.schmidt
#preflight 60942eeb4a6341000184add9

[CL 16321464 by halfdan ingvarsson in ue5-main branch]
2021-05-13 19:06:22 -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
31562adb63 MeshModelingToolset: fix incorrect ClampMin
#rb none
#rnx
#jira none

[CL 16245344 by Ryan Schmidt in ue5-main branch]
2021-05-09 18:24:46 -04:00
tyson brochu
d72d9d1a3b ProjectToTarget tool: enable world space projection option. Currently projection happens in local space for both the "mesh" and the "projection target". The new WorldSpace option transforms the mesh vertices into world coordinates, then into the coordinates of the projection target before projecting. This is similar to transforming both the mesh and target (an associated acceleration structure) into world coordinates and then doing the projection query.
#rb ryan.schmidt
#jira UETOOL-3458
#preflight 60955aad754924000197e2b9

[CL 16238325 by tyson brochu in ue5-main branch]
2021-05-07 12:01:34 -04:00
Ryan Schmidt
e577ba63dc ModelingTools: fix backface-hit issues w/ VSculpt and DSculpt. Behavior is now consistent between the tools, and when backface-hit is disabled, the brush will not be able to jump to back-facing surfaces during the stroke. The Nearest-hit is now always computed, and then rejected if it is back-facing, instead of filtering out backfaces during the raycast (which allowed "hidden" front-facing surfaces to still be hit).
#rb none
#rnx
#jira UE-114694
#preflight 609459b04185130001cea0d5

[CL 16227051 by Ryan Schmidt in ue5-main branch]
2021-05-06 18:29:00 -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