Commit Graph

296 Commits

Author SHA1 Message Date
Jimmy Andrews
483735ed38 #jira UE-117587
fixes for potential crash / invalid operations on radial fracture of pillar
 - make 'embed surface path' find the intended start vertex for its path when it's known
 - guard against path being empty before accessing element 0
 - guard against invalid edge collapse in mesh boolean that was triggered by this example

#rb david.hill
#rnx

#ushell-cherrypick of 16760529 by Jimmy.Andrews
#preflight 60d49b4557b30200011a0594

[CL 16775195 by Jimmy Andrews in ue5-main branch]
2021-06-24 12:29:49 -04:00
Ryan Schmidt
7393d0f0f5 ModelingTools: Fix various issues related to Tangents. FDynamicMeshEditor was using hardcoded 0 index instead of loop-variable NormalLayerIndex in several places. FDynamicMeshTangents did not handle invalid overlay triangles. UEditorModelingObjectsCreationAPI::CreateDynamicMeshActor() was not enabling Tangents on new DynamicMeshComponents. UDynamicMeshComponentToolTarget was not transferring tangents between FDynamicMesh3 and FMeshDescription when converting.
#rb none
#rnx
#jira none
preflight 60d25e9678c3b000012438cc

[CL 16751529 by Ryan Schmidt in ue5-main branch]
2021-06-22 19:34:47 -04:00
Ryan Schmidt
52ab1f5537 ModelingTools: Clean up AutoUV Tools and add support for Polygroup Layers.
- Refactor recompute-UVs-for-groups/islands out of ParameterizeMeshOp/Tool into RecomputeUVsOp/Tool. RecomputeUVsTool supports selection of active PolygroupLayer when applicable. Add support for auto-repacking.
- Clean up ParameterizeMeshOp/Tool, remove functionality related to recomputation that was moved to Recompute tool, add separate property sets for UVAtlas and XAtlas
- Add FDynamicMeshUVEditor::QuickPack() function to compute UV layout
- Add support for Polygroup Layer selection in SetCollisionGeometryTool, if only one source object is in use

#rb none
#rnx
#jira none
#preflight 60ced4b0be81e800012cc135

[CL 16724375 by Ryan Schmidt in ue5-main branch]
2021-06-20 16:57:02 -04:00
michael balzer
fd81a24cf6 GeometryProcessing: Reset existing UVs before Unwrap
#jira UE-116883
#rb ryan.schimdt
#rnx

[CL 16710839 by michael balzer in ue5-main branch]
2021-06-17 16:27:03 -04:00
michael balzer
cddece3632 GeometryProcessing: Fix crash when trying to access UV overlay with parent vertex index of -1.
[CL 16682804 by michael balzer in ue5-main branch]
2021-06-15 20:37:01 -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
lonnie li
450820cda6 ModelingTools: Fix synchronization issues in BakeTexture when modifying bake targets during a background compute.
#rb michael.balzer
#rnx
#jira none
#preflight 60c1280079a7fe0001317aaa

[CL 16614097 by lonnie li in ue5-main branch]
2021-06-09 18:10:23 -04:00
tyson brochu
9d2b0fdde3 Move ConvexHull2, ConvexHull3, and exact predicates into GeometryCore/CompGeom. Change them all to use the UE::Geometry namespace. Copy associated TPS files as needed.
#ushell-cherrypick of 16542896 by swarm
#rb ryan.schmidt

[CL 16575323 by tyson brochu in ue5-main branch]
2021-06-07 15:02:12 -04:00
lonnie li
febb75cece ModelingTools: Fix post op selection for TriEdit: Extrude, Offset, Cut Faces & Duplicate.
#rb michael.balzer
#rnx
#jira UE-114975
#preflight 60baa85f2c42ea0001d65f32

[CL 16562738 by lonnie li in ue5-main branch]
2021-06-04 19:26:45 -04:00
tyson brochu
baf3935886 Adding parallel transform-reduce
#rnx
#rb ryan.schmidt michael.balzer
#preflight 60b906136c4454000193e6bd

[CL 16550787 by tyson brochu in ue5-main branch]
2021-06-03 15:00:25 -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
Ryan Schmidt
9c6498f498 GeometryProcessing: add various functions to FDynamicMeshUVEditor. New SetTriangleUVsFromExpMap() variant can specify a specific target frame, supports normal blending and smoothing internally. Ported box and cylinder projection from UVProjectionOp to SetTriangleUVsFromBoxProjection() and SetTriangleUVsFromCylinderProjection(). Cylinder projection currently has been modified to create two islands for cylinder, instead of one (should eventually make this optional)
#rb david.hill
#rnx
#jira none
#preflight 60b01ab23c6c4e0001d04895

[CL 16494256 by Ryan Schmidt in ue5-main branch]
2021-05-27 19:37:34 -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
Ryan Schmidt
8fd2394228 GeometryProcessing:
- Add MakeBoundsFromIndices() utility functions to TAxisAlignedBox3 to simplify computing bounding-box of point sets
- FDynamicMesh3::GetVertexFrame() can now take an externally-provided normal, and so now can be used without computing VertexNormals attribute
- Add FModuloIteration to IteratorUtil for doing quasi-random-ish iterations over index ranges
- Add CollectVertexPositions() to MeshIndexUtil.h, for creating arrays/sets of vertex positions as a one-liner
- Add FMeshWeights::CotanWeightsBlendSafe() to support cotan-based smoothing of arbitrary properties
- Add TMinVolumeBox3::SolveSubsample() which will (quasi-randomly) subsample a set of the input points to reduce cost of box computation
#rb david.hill
#rnx
#jira none

[CL 16450731 by Ryan Schmidt in ue5-main branch]
2021-05-25 12:13:39 -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
tyson brochu
6081aaecca More optimization of FNormalFlowRemesher:
- for temp buffers, don't pre-initialize all their values, just make sure their size is big enough
- parallelize the decision of choosing which edges should be queued for later processing

#jira UETOOL-3457
#rb ryan.schmidt
#preflight 60a55930a5fa6d00012f75f7

[CL 16390755 by tyson brochu in ue5-main branch]
2021-05-19 15:25:30 -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
ryan schmidt
d884513784 GeometryProcessing:
- Skip full-mesh normals computation in OffsetMeshRegion if using vertex normals.
- Add operator[] to MeshConnectedComponents.
- Add FSparseDynamicOctree3::ContainmentQuery() to allow for single-point range query.
- Add FMeshFaceSelection::IsSelectionBoundaryEdge() and optimize ExpandToOneRingNeighbours() and ContractBorderByOneRingNeighbours(), now significantly faster for very large selections. Convert VtxTrianglesItr calls to EnumerateVtxTriangles
- Use TestAnyHitTriangle() instead of FindNearestHitTriangle() in TRemoveOccludedTriangles. Reduces cost from 6.4s to 1.2s on a 64-core threadripper for a large-scale (1.4m triangles) visibility-based removal problem
- Optimize FMarchingCubes implementation for large thread counts. Replace single FCriticalSection with indexed sets of FCriticalSection to reduce thread contention. Instead of directly writing to mesh, accumulate mesh vertices and triangles in separate blocks (hashed on grid coordinates) and then build output mesh after generation completes. Add bEnableValueCaching option to skip caching of corner values, which causes lots of thread contention if Implicit function is very cheap (eg a grid-based SDF evaluation). Enable this option in Morphology meshing. Reduces marching cubes cost from ~3.5s to <500ms on a 64-core threadripper for a large-scale (1.4m triangles) Morphology problem.

#rb jimmy.andrews
#rnx
#jira none

#ROBOMERGE-SOURCE: CL 16370702 in //UE5/Private-Frosty/...
#ROBOMERGE-BOT: STARSHIP (Private-Frosty -> Main) (v804-16311228)

[CL 16372561 by ryan schmidt in ue5-main branch]
2021-05-18 14:33:08 -04:00
lonnie li
92cd1b0c41 Fix MeshResampleImageBaker preevaluate initialization.
#rb trivial
#rnx

[CL 16366221 by lonnie li in ue5-main branch]
2021-05-18 09:35:14 -04:00
lonnie li
ec9abc8893 Fix static analysis warnings in MeshResampleImageBaker.
#rb trivial
#rnx

[CL 16363311 by lonnie li in ue5-main branch]
2021-05-17 22:00:42 -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
semion piskarev
b999806285 MeshModelingTools: Add DynamicMesh provider/committer interfaces and update existing targets to support them. Move interface target files.
#rb Lonnie.Li
#rnx
#jira none

[CL 16315070 by semion piskarev in ue5-main branch]
2021-05-13 13:22:55 -04:00
Ryan Schmidt
6783e1ee61 GeometryProcessing:
Add FDynamicMeshEditor::AppendMesh() variant that takes a TTriangleMeshAdapter<double>
Add FMeshDescriptionMeshAdapterd that wraps FMeshDescriptionTriangleMeshAdapter in TTriangleMeshAdapter<double> API
Add TTransform3::HasNonUniformScale()
#rb david.hill
#rnx
#jira none
#preflight 609a0a570ba7b600013cce27

[CL 16278551 by Ryan Schmidt in ue5-main branch]
2021-05-11 15:50:30 -04:00