Commit Graph

53 Commits

Author SHA1 Message Date
Ryan Schmidt
da254f4c8b ModelingComponents: Add UBaseDynamicmeshComponent::SetShadowsEnabled() and UPreviewMesh::SetShadowsEnabled() wrapper, and update Tools that are directly modifying the bCastDynamicShadow variable on Components. That doesn't work as it doesn't update the SceneProxy, and is currently causing crashes. ::SetShadowsEnabled() forces a full immediate rebuild of the SceneProxy, which is very heavy but seems to be required.
#rb david.hill
#rnx
#jira UE-118344
#preflight 60cb7d3a9f12370001350352

[CL 16715096 by Ryan Schmidt in ue5-main branch]
2021-06-17 19:18:23 -04:00
Ryan Schmidt
e196c256e4 GeometryProcessing: remove forwarding headers used in GeometryCore transition, and update all affected includes.
#rb none
#rnx
#jira none
#preflight 60c52c5db9446100014da02d

[CL 16653115 by Ryan Schmidt in ue5-main branch]
2021-06-13 00:35:22 -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
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
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
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
a965e7113c ModelingTools: properly save ROI of Decompose and Merge operations in PolyEdit. Also handle case of deleting entire mesh in PolyEdit and TriSelect tools (not allowed).
#rb none
#rnx
#jira UE-112687, UE-112400

#ROBOMERGE-SOURCE: CL 15919748 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v786-15839533)

[CL 15921228 by ryan schmidt in ue5-main branch]
2021-04-05 15:05:51 -04:00
Ryan Schmidt
196be0f6d1 GeometryProcessing: replace UE::Geometry::FVector3d/FVector3f with UE Core versions based on TVector<T>. FVector3<T> is now an extension of TVector<T>. Update all affected call sites.
#rb none
#rnx
#jira none

[CL 15870068 by Ryan Schmidt in ue5-main branch]
2021-03-30 21:25:22 -04:00
lonnie li
e4b41a3d8c ModelingTools: ToolTarget refactor for Sculpt tools
#rb semion.piskarev ryan.schmidt
#jira none
#rnx

[CL 15741814 by lonnie li in ue5-main branch]
2021-03-18 17:20:32 -04:00
Ryan Schmidt
9495a8a112 GeometryProcessing: remove FTransform3f/d and FPlane3f/d from ExplicitUseGeometryMathTypes.h and clean up fallout
#rb none
#rnx
#jira none

[CL 15739090 by Ryan Schmidt in ue5-main branch]
2021-03-18 12:46:27 -04:00
Ryan Schmidt
6db97af132 GeometryProcessing: FVector2/3/4 refactoring. Move various member functions to standalone functions in UE::Geometry:: namespace, to simplify upcoming conversion to core vector types. Update all call sites.
#rb tyson.brochu, semion.piskarev
#rnx
#jira none

[CL 15732208 by Ryan Schmidt in ue5-main branch]
2021-03-17 19:32:44 -04:00
Ryan Schmidt
ffe3b401cd GeometryProcessing: move all public types in GeometryProcessing plugin into UE::Geometry:: namespace, as well as some code in MeshModelingToolset. Fix fallout in Water, Paint Mode, ChaosEditor, DataPrep, Text3D, Unit Tests, internal projects.
#rb jimmy.andrews, semion.piskarev
#jira none

[CL 15661651 by Ryan Schmidt in ue5-main branch]
2021-03-09 19:33:56 -04:00
ryan schmidt
47311d8f7e ModelingTools UX: change tool names so that label now visible in the main viewport corresponds to icon name. Update accept/cancel/complete tooltips and button styles.
#rb none
#rnx
#jira none

#ROBOMERGE-OWNER: ryan.schmidt
#ROBOMERGE-AUTHOR: ryan.schmidt
#ROBOMERGE-SOURCE: CL 15348621 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v771-15082668)
#ROBOMERGE-CONFLICT from-shelf

[CL 15360215 by ryan schmidt in ue5-main branch]
2021-02-08 17:02:09 -04:00
Ryan Schmidt
c19bc8fe27 ModelingTools: disable point highlights by default in MeshSelectionTool. Add s/d hotkeys for brush resize, similar to sculpt/grouppaint
#rb none
#rnx
#jira none

[CL 15196447 by Ryan Schmidt in ue5-main branch]
2021-01-25 21:09:02 -04:00
Ryan Schmidt
72700cc221 ModelingComponents: Add support for fast update of index buffers in decomposed buffer sets in DynamicMeshComponent/Proxy. Add support for MeshRenderDecomposition to UPreviewMesh. Add UPreviewMesh::NotifyRegionDeferredEditCompleted() functions to allow triangle subsets to be updated.
MeshSelectionTool: enable new decomposition support to improve painting performance on large meshes. Fix code that was doing repeated linear searches to remove elements from a potentially-very-large array. Make brush-ROI tri centroid point rendering optional.
#rb jimmy.andrews
#rnx
#jira none

[CL 15175542 by Ryan Schmidt in ue5-main branch]
2021-01-24 16:05:21 -04:00
Marc Audy
4c1bb11c29 Merge UE5/Release-Engine-Staging to UE5/Main @ 14548662
This represents UE4/Main @ 14525125 + cherrypicked fixes
#skipundocheck

[CL 14551026 by Marc Audy in ue5-main branch]
2020-10-22 19:19:16 -04:00
brooke hubert
e85ae49f14 The EditorToolsContext is now owned by the mode manager.
Updated Mesh Paint, geometry, arch gen, hair lab, and sample editor modes to reflect changes to the tools context ownership.

#Jira UE-96448
#rb lauren.barnes michael.daum
#fyi ryan.schmidt simon.barsky jack.greasley
#review-14189762
#review-14189796
#review-14189767
#review-14189774
#review-14189785

[CL 14247116 by brooke hubert in ue5-main branch]
2020-09-02 15:43:58 -04:00
Marc Audy
11f5b21210 Merging //UE5/Release-Engine-Staging @ 13752110 to Main (//UE5/Main)
#rnx

[CL 13753156 by Marc Audy in ue5-main branch]
2020-06-23 18:40:00 -04:00
ryan schmidt
e7f3baf1ca Edigrate Dev-Editor updates to InteractiveToolsFramework, GeometryProcessing, MeshModelingToolset, and ModelingTools Editor Mode Plugins. Update a few files in new MeshPaint Plugin for UInteractiveTool rename of ::Tick() to ::OnTick().
#rb none
#rnx

#ROBOMERGE-SOURCE: CL 12908995 via CL 12908996 via CL 12909001
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v682-12900288)

[CL 12909003 by ryan schmidt in Main branch]
2020-04-18 18:42:59 -04:00
ryan schmidt
be36fdfeb2 ModelingTools: fix issues w/ bad mesh changes being created in dynamic mesh sculpting.
Problem is that during remesh passes the affected triangle set can expand (due to splits/collapses on ROI boundary) and our tracking of it is not perfect. Remesher now tells ChangeTracker before it modifies an edge, rather than Sculpt tool trying to predict set of modified triangles up front.

In theory this allows for smaller changes, because often only a subset of triangles are modified. However ChangeTracker currently only emits modified vertices as part of modified triangles. So we still need to save the full triangle ROI. Made several MeshChangeTracker functions protected for now, because they cannot be used externally due to this limitation. Updated call sites to those functions (which were likely also buggy).

#rb jimmy.andrews
#rnx
#jira none

#ROBOMERGE-SOURCE: CL 12459928 in //UE4/Release-4.25/... via CL 12459930 via CL 12459991
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v672-12450963)

[CL 12460009 by ryan schmidt in Main branch]
2020-03-26 17:20:25 -04:00
jimmy andrews
2b83d92829 use the multi-material generate mesh function when separating triangles in the mesh selection tool, to give separated mesh pieces the same materials as the source mesh. + associated cleanup
#jira UE-90972
#rb none
#rnx

#ROBOMERGE-SOURCE: CL 12358201 in //UE4/Release-4.25/... via CL 12358202
#ROBOMERGE-BOT: RELEASE (Release-4.25Plus -> Main) (v671-12333473)

[CL 12358207 by jimmy andrews in Main branch]
2020-03-20 22:00:43 -04:00
ryan schmidt
46af79019f ModelingTools: resolve many sculpting issues & limitations
- fix broken sculpt material that went to white in many cases, replace with diffuse shading and rim light in Emissive channel / unlit texture
- add image-based sculpt materials provided by techart, expose custom variant that allows user-defined shader image
- make flat shading optional in view settings, for relevant shaders
- reorganize properties and update tooltips to be more informative
- fix broken Falloff support and expose in property set, display in brush highlight. Make this separately exposable in BaseBrush property set since we don't need Strength.
- add viewpoint-based Sculpt and Plane brush modes
- fix brush preview location when in hover, was not respecting target surface setting
#rb none
#rnx
#jira none
[FYI] JeanSebastien.Guay

#ROBOMERGE-SOURCE: CL 12164804 in //UE4/Release-4.25/... via CL 12164806
#ROBOMERGE-BOT: RELEASE (Release-4.25Plus -> Main) (v661-12148976)

[CL 12164813 by ryan schmidt in Main branch]
2020-03-13 13:40:51 -04:00
ryan schmidt
10edbe72ff ModelingTools: Improve tool info messages
#rb none
#rnx
#jira none

#ROBOMERGE-SOURCE: CL 12113495 in //UE4/Release-4.25/... via CL 12113506
#ROBOMERGE-BOT: RELEASE (Release-4.25Plus -> Main) (v657-12064184)

[CL 12113515 by ryan schmidt in Main branch]
2020-03-10 14:00:36 -04:00
ryan schmidt
112920fcb1 Enable autocalculated tangents for most mesh editing tools. This preserves appearance when editing meshes with normal maps. However these tangents are not written back to the MeshDescription, we current assume that the build settings will result in tangents being recomputed on Accept.
#rb none
#rnx
#jira UE-84211

#ROBOMERGE-SOURCE: CL 12026998 in //UE4/Release-4.25/... via CL 12027009
#ROBOMERGE-BOT: RELEASE (Release-4.25Plus -> Main) (v656-11643781)

[CL 12049347 by ryan schmidt in Main branch]
2020-03-07 10:52:46 -05:00
jimmy andrews
08c631997f make separated pieces from selection tool not persist if the tool exited by canceling
#jira UE-83365
#rb none
#rnx

#ROBOMERGE-SOURCE: CL 11452822 in //UE4/Release-4.25/...
#ROBOMERGE-BOT: RELEASE (Release-4.25 -> Release-4.25Plus) (v654-11333218)

[CL 11452823 by jimmy andrews in 4.25-Plus branch]
2020-02-14 19:26:35 -05:00