Commit Graph

173 Commits

Author SHA1 Message Date
ryan schmidt
fd2127d075 GeometryCore: add ability to store and fetch 'debug' FDynamicMesh3 via UE::Geometry::Debug::StashDebugMesh() and FetchDebugMesh(). CVar geometry.DynamicMesh.EnableDebugMeshes controls this support, defaults to disabled. Console command geometry.DynamicMesh.ClearDebugMeshes added to allow clearing entire debug mesh set.
GeometryScript: expose above capability to Geometry Scripting
#rb none
#preflight 643fe92c090323f9a3f2a10d

[CL 25107977 by ryan schmidt in ue5-main branch]
2023-04-19 11:47:17 -04:00
michael balzer
0f950b69d1 GeometryCore: Fix potential buffer overrun in FSmallListSet
#jira UE-172848
#preflight 643dd646db681113a4c89986
#rb jimmy.andrews

[CL 25081758 by michael balzer in ue5-main branch]
2023-04-18 00:12:45 -04:00
david hill
b3a71a15e2 Mesh Modeling Tools: Improve Weld Mesh Edges tool to optionally merge attributes.
Geometry Core: Adding Split Attribute Welder.

#jira UE-182345
#rb ryan.schmidt
#preflight 643d6fc8211b661dc4f47c6a

[CL 25072473 by david hill in ue5-main branch]
2023-04-17 15:22:49 -04:00
nick edwards
442653b187 Uses of ::Sort/::StableSort replaced with Algo versions.
#preflight 6422f8d3710ec8400fc7471c
#jira none
#rb steve.robb

[CL 24818983 by nick edwards in ue5-main branch]
2023-03-28 10:56:46 -04:00
jimmy andrews
4d92d0a2cc fix invalid mesh state caused by not merging some neighboring edges in FDynamicMesh3's EdgeMerge, when mesh has bowties
+ add a test to cover this case

#jira UE-179649
#rb david.hill, ryan.schmidt
#preflight 640f34d20e1f02786bdf510c

[CL 24621295 by jimmy andrews in ue5-main branch]
2023-03-13 16:46:20 -04:00
jimmy andrews
94621fd27d Expose Delaunay Triangulation to Geometry Script
#rb ryan.schmidt, rinat.abdrashitov, matija.kecman
#preflight 64064a28c13b7130d2fd04da

[CL 24531512 by jimmy andrews in ue5-main branch]
2023-03-06 17:00:31 -05:00
rinat abdrashitov
a3fd902926 -DynamicMeshEditor.cpp: Handle bone data when appending two meshes and use it to reindex the the combined skinning weights.
-DynamicMeshAttributeSet.cpp:  Fixed a bug where we were resetting the bone attributes when matching.
-DynamicVertexSkinWeightsAttribute.h: Added a function that allows to reindex bone indices with respect to a new skeleton.
-SkeletalMeshLODModle.cpp: Handle bone attributes when FSkeletalMeshLODModel::GetMeshDescription is called.

#rb halfdan.ingvarsson
#preflight 640150b91d304a54717f810c

[CL 24523731 by rinat abdrashitov in ue5-main branch]
2023-03-06 11:22:59 -05:00
rinat abdrashitov
13a3f391cb Reverting the accidental removal of the fix for CheckBoneValidty()
#rb trivial
#preflight 63fe1fb3c63aaf1e1368707b

[CL 24450167 by rinat abdrashitov in ue5-main branch]
2023-02-28 15:45:44 -05:00
rinat abdrashitov
86f75d8c02 Fix static analysis error.
#rb trivial
#preflight 63fd74f3dd78dd50f6cfe048

[CL 24438973 by rinat abdrashitov in ue5-main branch]
2023-02-28 00:24:00 -05:00
jimmy andrews
999722e77c fix validity check for boneless meshes
(fixes geometry processing unit tests)

#rb rinat.abdrashitov
#preflight 63fd49692b1a2765f9a994aa

[CL 24437945 by jimmy andrews in ue5-main branch]
2023-02-27 22:36:45 -05:00
rinat abdrashitov
ff5c6e3d72 Added a new class to store per-bone data.
Added bone attributes (name, color, parent index, pose) to the dynamic mesh attribute set.

#rb halfdan.ingvarsson
#rb ryan.schmidt
#preflight 63fcd62dc35a141980f8429f

[CL 24432083 by rinat abdrashitov in ue5-main branch]
2023-02-27 16:20:20 -05:00
jimmy andrews
d6daff005b Make mesh elements visualizer distinguish between normal and tangent seams like the mesh inspector does
#rb david.hill
#preflight 63ee4e7d500c05a6244b020b

[CL 24270353 by jimmy andrews in ue5-main branch]
2023-02-16 17:39:45 -05:00
jimmy andrews
08cdafff34 add a merge-only api to convex decomposition
#preflight 63d9872265738ba951f5058e
#rb david.hill

[CL 23943754 by jimmy andrews in ue5-main branch]
2023-01-31 21:58:48 -05:00
Jimmy Andrews
5bae2ab300 make sparse dynamic octree use range iteration to find relevant root cells for point containment and range queries, when there are enough root cells for this to make sense
#rb david.hill
#preflight 63bf9c094b018bfa80e42e39

[CL 23670550 by Jimmy Andrews in ue5-main branch]
2023-01-12 17:26:31 -05:00
Jimmy Andrews
d7b600d398 Add BRIO point ordering and update Delaunay2/3 to use it, to improve performance e.g. for grids of points
#rb rinat.abdrashitov
#rb tyson.brochu
#preflight 63b8a33b221aab21e09c6756

[CL 23607591 by Jimmy Andrews in ue5-main branch]
2023-01-07 13:23:14 -05:00
jimmy andrews
f8055de684 Fix "FDynamicMeshAttributeSet::EnableMatchingAttributes" losing generic attributes w/ bClearAttributes=true
(fixes crash in executing fracture w/ fracture mode)

#rb trivial
#preflight 639d673f35203bc7aa0172c9

[CL 23544294 by jimmy andrews in ue5-main branch]
2022-12-17 03:47:09 -05:00
michael balzer
a172cc38ca DynamicMesh: Fix skin weight attributes serialization and comparison, and add to serialization unit tests
#jira UE-169545
#preflight 639ce1422540a78d27562982

[CL 23543767 by michael balzer in ue5-main branch]
2022-12-16 19:15:23 -05:00
ryan schmidt
c96676ceac GeometryCore: improve FDynamicMeshAttributeSet::EnableMatchingAttributes() function. SkinWeights and Generic attributes now are only reset/discarded if bClearExisting=true. Added bDiscardExtraAttributes flag which results in removal of any attributes not in target attribute set, but does not clear existing attributes. Also added bDiscardExtraAttributes flag to FDynamicMesh3::EnableMatchingAttributes(). GeoScript Mesh Append functions use this flag now when matching "source" attributes, and behave properly in default (combine) mode for Skin Weights.
#rb jimmy.andrews
#preflight 639a5dd4776b61ba3bcbaee2

[CL 23523594 by ryan schmidt in ue5-main branch]
2022-12-14 22:06:48 -05:00
brandon schaefer
f77afc5a1d Fix lifetime issues, all of these are undefined behaviour
#jira UE-172308
#rb Jimmy.Andrews
[FYI] Steve.Robb
#preflight 63922e890d013d47efae9480

[CL 23460229 by brandon schaefer in ue5-main branch]
2022-12-08 21:22:12 -05:00
ryan schmidt
75e6db7be8 GeometryCore: add ability to return TriangleIDs of sample points in MeshSurfacePointSampling, and also add optional computation of barycentric coordinates for each sample
GeometryScripting: add return of TriangleIDs to geo-script point sampling functions. Add utility function GetRayStartEnd and MakeBoxFromCenterExtents to simplify common BP operations, improve some display names.
#preflight 638e01b89549ddaa28f8a4ed
#rb none

[CL 23394664 by ryan schmidt in ue5-main branch]
2022-12-05 13:19:41 -05:00
nathan mitchell
ff0aaf7feb UVEditor: Implement functionality to allow the Seam tool to now remove seams, as well as add them.
* Provides a mode selection for the Seam tool, switching between seam cutting mode and seam joining mode.
* Seam joining mode has an optional behavioral flag to have the path finding preferentially follow existing seams, making it easier to trace seam edges.
* DynamicMeshOverlay now supports merging elements, providing a method to merge one element to another, if they share the same parent, collapsing any references from the first element into references to the second.
* DynamicMeshUVEditor now supports removing seams from edges, providing a method to remove (via the new DynamicMeshOverlay functionality) seams from an edge collection by iteratively merging elements together.

#rb semion.piskarev
#preflight 6387e2e07b4bd3f057375770

[CL 23343534 by nathan mitchell in ue5-main branch]
2022-11-30 18:25:46 -05:00
ryan schmidt
fbe740f799 GeometryCore and GeometryProcessing additions to support selection and new extrude operator
- Add TMeshQueries::GetTrianglesBounds() and ::GetVerticesBounds()
- Add FMeshNormals::RecomputeOverlayTriNormals() and ::RecomputeOverlayElementNormals(). Update ComputeOverlayNormal() to take area and angle weight parameters.
- Add new FMeshTriOrderedEdgeID type, and util functions ConvertLoopToTriOrderedEdgeLoop / ConvertTriOrderedEdgeLoopToLoop. This type is similar to the TPair-tuple used by FDynamicMeshEditor::ConvertLoopToTriVidPairSequence, but formalized and providing a function to decode back into a vertex/edge ID loop
#rb matija.kecman
#preflight 638799f73377450900d2dc39

[CL 23338151 by ryan schmidt in ue5-main branch]
2022-11-30 14:29:45 -05:00
David Hill
91e7948122 Mesh Modeling and Dynamic Mesh. Provide ability to store and read a vertex mapping with a DynamicMesh inthe case that the source data is non-manifold.
ModelingTools - MeshAttributePaintTool and SkinWeightsPaintTool.  Use non-maniforld vertex ids when provided.  fixes a crash
SplitMeshesTool - removed an unsed mesh conversion.
ModelingComponents - ModelingToolTargetUtil  - request non-manifold vertex Ids on dynamic meshes when converted for tools.
DynamicMeshViaMeshDescription - request non-manifold vertex Ids on dynamic meshes when converted for tools.
ModelingObjectCreation - make sure to strip the any src vertex IDs from a dynamic mesh during object creation.

#rb Ryan.Schmidt
#preflight 63867a97f213a116eb4e9ed1

MeshConversions - MeshDescriptionToDynamicMesh - Add ability to capture non-manifold source veretx IDs in the form of a vertex attribute.

[CL 23330671 by David Hill in ue5-main branch]
2022-11-30 10:38:46 -05:00
ryan schmidt
e3cd7a186c GeometryCore: add FMeshSurfacePointSampling, which generates sample points on the surface of a mesh with various strategies (currently focused on an approximate-Poisson sampling strategy).
GeometryScript: add ComputePointSampling, ComputeNonUniformPointSampling, and ComputeVertexWeightedPointSampling functions
#rb none
#preflight 637fe2e0fa348e8480a0bb09f

[CL 23267475 by ryan schmidt in ue5-main branch]
2022-11-25 12:18:30 -05:00
ryan schmidt
2a75179958 GeometryCore: Add TSparseGrid3::RangeIteration, that iterates over any allocated cells in sub-region of sparse grid. Remove default bAllocateIfMissing=true on ::Get() to avoid accidental grid expansion. Add FVector3i::operator< to allow sorting of integer vectors.
Various improvements to FSparseDynamicPointOctree:
- replaced FSmallListSet with new TSparseListSet<int>
- removed ValidPointIDs flag array, can be inferred from PointIDToCellMap
- replaced checks with checkSlow
- added some variants of internal functions for box center, width, etc, that can work off level/index directly, instead of requiring a cell
- range query functinos use new TSparseGrid3::RangeIteration to avoid iterating over all root cells
- added ::ParallelInsertDensePointSet() which can do parallel octree build into fully-expanded leaf nodes
- added ::ConfigureFromPointCountEstimate() which can estimate MaxDepth and RootDimension given an estimate of point count, useful primarily with ParallelInsertDensePointSet()
- added ::RemovePointUnsafe() which skips various range checking etc

#rb jimmy.andrews
#preflight 37e92f8cc307d6fa52d41c7

[CL 23258977 by ryan schmidt in ue5-main branch]
2022-11-24 09:52:08 -05:00