261 Commits

Author SHA1 Message Date
nathan mitchell
ba3a736bf5 ModelingTools: Fix crash issue in the Simple Collision Editor when undoing a delete operation.
#rb Jimmy.Andrews
#jira UE-190149

[CL 26708416 by nathan mitchell in 5.3 branch]
2023-07-31 12:04:45 -04:00
matija kecman
81883823f4 Fix ensure in BakeRC tool which occured when disabling a capture channel after cancelling a previous scene capture
#rb lonnie.li
#jira UE-191193

[CL 26609454 by matija kecman in 5.3 branch]
2023-07-26 11:49:00 -04:00
matija kecman
7f8c027b13 Fix horde issue 337708 related to text conflicts in LOCTEXT
#rb trivial
#horde 337708

[CL 26601084 by matija kecman in 5.3 branch]
2023-07-26 04:48:13 -04:00
nathan mitchell
d8ae1a8b6c Modeling Mode: Fix issue where weightmaps are loaded with invalid values for a target when tools' settings are loaded with a preset.
#rb Jimmy.Andrews
#jira UE-188052

[CL 26590451 by nathan mitchell in 5.3 branch]
2023-07-25 17:45:47 -04:00
matija kecman
327ba56de1 Fix crashes in BakeRC tool, improved the scene capture progress bar, improved and simplified the scene capture cancellation behavior
* Fixed a crash that occurred in the baking step when cancelling a scene capture which was triggered by changing an option which invalidated all photo sets (i.e., render capture resolution or capture anti aliasing). This was occurring because the baking step proceeded after the scene capture cancellation and the needed photosets were empty.

* Fixed a crash which can happen if you have no channel enabled, change cleanup tolerance from 0 to 1 and then enable the BaseColor channel. This was fixed by changing the behavior of the Cleanup Threshold property, if its positive the DeviceDepth capture is enabled and its disabled otherwise, previously we also required that another channel was enabled which led to the crash in the baking step. The new semantics are easier to understand in the code and and is probably an improvement to the UX as well since the Cleanup Threshold property behavior does not depend on other properties.

* Improved the scene capture cancellation: Users can now cancel the scene capture when the tool is starting up which is better UX since if they picked slow settings they don't intend to reuse, the capture can be cancelled, also, the code is simpler. Changed the behavior of the BakeRC tool properties so that after cancellation the completed captures with the desired settings are enabled. The old behavior where cancellation was documented to restore old results was broken and cannot be made to work unless we store the old results in a separate scene capture but for high capture resolutions that would require a lot of memory. When the SceneCapture is cancelled the channels which were pending and didn't complete are logged in the Output Log in case the user forgets which ones were enabled.

* Simplified the code in various places: Added `operator[](ERenderCaptureType)` to structs with per-capture data, and use it to simplify many places where we previously checked channels individually. Added conversion functions from tool properties/geometry script parameters to the render capture parameters. Removed old confusing logic that determined if a capture had been updated by tracking the number of photos in each photoset with a new system based on a new per-capture pending state. Deprecated a bunch of functions which are no longer useful or which used the wrong types (e.g., `FRenderCaptureUpdate` was added because I hadn't noticed `FRenderCaptureTypeFlags`). Changed the defaults in `FSceneCapturePhotoSet` so that the DeviceDepth capture is off, its an advanced feature and the defaults are intended to make the class friendly to new developers

#rb lonnie.li

[CL 26568190 by matija kecman in 5.3 branch]
2023-07-25 05:08:58 -04:00
Jimmy Andrews
100f536469 make the 'simple collision editor' tool show hidden lines so that it is usable for collision that is hidden inside solid shapes
#jira none
#rb rinat.abdrashitov

[CL 26440213 by Jimmy Andrews in 5.3 branch]
2023-07-18 14:03:24 -04:00
Jimmy Andrews
5199a08744 Fix meshes that have 'recompute tangents' enabled not displaying with correct tangents after conversion to dynamic mesh + enable tangents on sculpt tools so 'original material' mode renders correctly when normal maps are used
#jira UE-189344
#rb rinat.abdrashitov

[CL 26408215 by Jimmy Andrews in 5.3 branch]
2023-07-17 11:20:10 -04:00
tyson brochu
1a2839428a Mesh Topology Selection Mechanic: enable/disable different selection modes in the details customization
#rb semion.piskarev

[CL 26318931 by tyson brochu in 5.3 branch]
2023-06-29 13:23:55 -04:00
matija kecman
14fba36010 Fix horde issue 323832 about a warning caused by #inlcude "Engine.h", fixed by using #include "Engine/Engine.h" instead
#rb none

[CL 26181652 by matija kecman in 5.3 branch]
2023-06-22 10:19:24 -04:00
matija kecman
77a219bd26 Add a reusable geometry selection visualization system intended to be used in modeling tools with minimal boilerplate
This CL was reviewed here: https://p4-swarm.epicgames.net/reviews/26051575 but needs to be merged into //Fortnite/Release-26.00, not //Fortnite/Main

#jira UE-183457
#rb ryan.schmidt, nathan.mitchell

[CL 26180612 by matija kecman in 5.3 branch]
2023-06-22 09:26:09 -04:00
ryan schmidt
8d4f038af9 ModelingMode: selection system bugfixes & improvements.
Add DynamicMeshSelector::UpdateAfterGeometryEdit API. StaticMeshSelector implementation updates static mesh after an Edit instead of emitting MeshChange on temporary DynamicMesh.
Delete and Retriangulate Commands now use this API instead of directly emitting transaction, so now these commands work properly on Static Meshes.

FStaticMeshComponentSelectorFactory::CanBuildForTarget now only allows UStaticMeshComponent specifically, filtering out subclasses. This is not ideal but I don't know what else we can do for now, there are many subclasses like ISMC, SplineMeshComponent, etc, that will not work w/ the Selection system. Also now filtering out Engine assets and cooked assets.

ModelingToolsEditorMode now listens for blueprint pre-compiles, and when this occurs, clears the active selection and selection targets. This is necessary because if the selection Component was part of a BP, on recompile it is re-instanced and the old pointer goes stale. Possibly can handle this better or at a more granular level, but clearing the selection is safest. This currently results in things not being undoable because the FChange transactions are on the "old" UDynamicMesh that no longer exists.

UModelingToolsEditorMode::UpdateSelectionManagerOnEditorSelectionChange now does a more thorough job of inspecting the current Actor/Component selection to find Components that could work w/ the selection system.

#rb lonnie.li

[CL 26133442 by ryan schmidt in 5.3 branch]
2023-06-20 16:31:27 -04:00
nathan mitchell
4900bd9806 Modeling Mode: Added a new tool to assist with the editing of simple collision primitives for static and dynamic meshes.
This tool mostly encapsulates the basic collision editing behaviors found within the Static Mesh Editor, but exists as a tool within Modeling Mode to work along side existing collision tools, such as Collision to Mesh and Mesh to Collision.

Initial features include:

* Support for selecting and transforming collision primitives, including primitive aware transforms (such as explicit length and radius controls on capsule shapes).
* Adding new simple shapes (spheres, boxes, and capsules)
* Duplicating existing shapes
* Deleting some or all collision geometry

#rb Ryan.Schmidt
#jira UE-182341

[CL 26067060 by nathan mitchell in 5.3 branch]
2023-06-16 15:54:13 -04:00
semion piskarev
c9de10f9cf MeshModelingTools: Various volume conversion fixes:
- Fix conversion sometimes making degenerate tris and firing an ensure.
- Fix volume conversion sometimes creating cracks in volumes when dealing with non-convex faces (by deleting necessary colinear verts)
- Make simplification preserve group boundaries when asked.
- Remove colinear verts along group boundaries without losing boundaries when preserving groups.
- Break up faces that have holes into convexes rather than emitting per-triangle faces.
- Make mesh to volume tool use same path for conversion as tool targets, and add controls for preserving groups and simplifying
- Revert to ear clipping if delaunay triangulation fails in converting back from volume

#rb Jimmy.Andrews
#jira UE-173272, UE-152032
#prelfight 6470ccbf5b1dc793b715d66b

[CL 26002669 by semion piskarev in ue5-main branch]
2023-06-14 23:43:43 -04:00
semion piskarev
00d95585b1 MeshModelingTools: Fix nonunity build errors from missing includes for Draw Spline Tool.
#rb none

[CL 25993733 by semion piskarev in ue5-main branch]
2023-06-14 16:22:00 -04:00
semion piskarev
b4529d4548 MeshModelingTools: Create Draw Spline Tool for drawing splines and spline-based blueprints.
#rb Jimmy.Andrews
#jira UE-182356

[CL 25991352 by semion piskarev in ue5-main branch]
2023-06-14 15:47:10 -04:00
nickolas drake
a97a2b32d4 ModelingToolset: Make Pattern Tool emit correct actors using a new CreateNewActor function.
Added a CreateNewActor function to EditorModelingObjectsCreationAPI which finds a factory capable of producing actors of the same type as a provided template actor to create the new actor without needing to create entirely new assets as would have been necessary with the existing functions in EditorModelingObjectsCreationAPI.

#rb lonnie.li

[CL 25963642 by nickolas drake in ue5-main branch]
2023-06-13 17:05:45 -04:00
zach bethel
a9a5fa39db Deprecated non-command list variant of InitResource and UpdateResource. Patched the engine to pass command lists through. Follow-up CL's will refactor individual locations to thread command lists through the various callstacks, but that was done very judiciously in this CL to reduce risk.
#rb mihnea.balta, christopher.waters

[CL 25953623 by zach bethel in ue5-main branch]
2023-06-13 11:46:40 -04:00
ryan schmidt
3a37357aa3 ModelingTools: add new Vertex Painting Tool
Add UMeshVertexPaintTool, subclass of UMeshSculptToolBase. Paints Mesh Vertex Colors (ie Asset colors, not instance colors). Provides many interactions similar to GroupPaintTool (ie brush paint, click-to-fill, poly-lasso, volumetric vs connected brush ROI, UV/Normal seams, visibility filter, etc. Supports painting split-vertex colors, or smooth per-vertex colors (bHardEdges setting). Supports various brush types (paint, smooth, "blend" = average split values). Painting supports custom color-blend modes (ie "over" mode, does stroke compositing like pixel painting tools). Can show vertex color under cursor. Supports showing vertex color or original materials. Ability to filter channels for visibility/painting. Actions buttons to fill current-color/black/white. "Utility" panel for common operations (blend all seams, fill channels, invert channels, copy channel to channel, swap channels, copy from weight map, copy to all/single LOD).

Internally supports seam painting by splitting all colors on startup (ie to create per-triangle-vertex color) and then welding on shutdown.

Current auto-RGBA conversions are inverted, internally the tool works in Linear colors, preview DynamicMeshComponent is configured to convert to SRGB in color buffers (similar to static mesh).

Vertex color brush ops added in MeshVertexPaintBrushOps.h, deriving from new FMeshVertexColorBrushOp. Various color-blending functions implemented there, should be moved to centralized place eventually.

Expose MeshVertexPaintTool in ModelingMode
Add FModelingToolsColorChannelFilter, for toggling R/G/B/A filtering state, and a details customization that shows these four checkboxes in a horizontal row. Use in MeshVertexPaintTool, Register in Modeling Mode.

#rb none
#preflight 646cfc50205f5d23d53f80f1

[CL 25592458 by ryan schmidt in ue5-main branch]
2023-05-23 18:18:39 -04:00
ryan schmidt
0ff893f0f2 Modeling Tools: minor changes in prepration for future CL. Add UE::Geometry::Lerp for TVector4 types. Refactor code MeshGroupPaintTool code for polylasso post-process to static function UPolyLassoMarqueeMechanic::ApproximateSelfClipPolyline(). Make brush flow rate configurable via overridable UMeshSculptToolBase::GetStampTemporalFlowRate().
#rb none
#preflight 646cbf4064351d76f31f6841
#rnx

[CL 25592096 by ryan schmidt in ue5-main branch]
2023-05-23 18:10:55 -04:00
matija kecman
ae026188f8 Render Capture Baking: Make BakeRC tool output a new material configured with the generated textures
This change also extends UModelingObjectsCreationAPI to support materials by duplicating a given material

#rb ryan.schmidt
#jira UE-182349
#preflight 6467649a573c1da15838e005

[CL 25548119 by matija kecman in ue5-main branch]
2023-05-19 13:50:08 -04:00
ryan schmidt
4061f31c7c ModelingTools: Add IMeshDescriptionProvider::GetMeshDescriptionLOD() which returns current LOD for a ToolTarget. Implement in StaticMesh Tool Targets. Add UE::ToolTarget::GetTargetMeshDescriptionLOD() which wraps this function
#rb jimmy.andrews
#preflight 646631103660522200164f0c

[CL 25529470 by ryan schmidt in ue5-main branch]
2023-05-18 13:52:35 -04:00
kiaran ritchie
ca07aefee4 Fixing compile error from 25482982
#rb none
#JIRA none
#preflight none

[CL 25483177 by kiaran ritchie in ue5-main branch]
2023-05-15 20:01:48 -04:00
tyson brochu
9f9432863e Adding a two-sided vertex color material. Same as MeshVertexColorMaterial but with "Two Sided" checked.
Use the new two-sided material in the cloth weight map paint tool so that we can paint on the "back" side of the 2D panels

#rb ryan.schmidt
#preflight 645beaef8b3e445e810aa6ef

[CL 25414150 by tyson brochu in ue5-main branch]
2023-05-10 15:35:50 -04:00
matija kecman
87ee9970e8 Fix GetElapsedComputeTime so that the preview material kicks in after the proper delay
#jira UE-183810
#preflight 644a77c66b589f8b36ee29a9
#rb jimmy.andrews

[CL 25299633 by matija kecman in ue5-main branch]
2023-05-02 07:51:43 -04:00
ryan schmidt
8937f914fa ModelingMode: avoid a crash on shutdown when DynamicMeshActor is selected, due to TargetCache being modified during iteration
#rb none
#preflight 644af8701150e908d05a0976

[CL 25238944 by ryan schmidt in ue5-main branch]
2023-04-28 16:01:06 -04:00