Commit Graph

77 Commits

Author SHA1 Message Date
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
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
matija kecman
a5329ddfbb Fix computation of edge collapse lerp parameter to fix (for example) artefacts in the UV layer when remeshing the stairs primitive
#jira UE-141937
#preflight 64008a1bc63aaf1e13565ace
#rb ryan.schmidt,david.hill

[CL 24499685 by matija kecman in ue5-main branch]
2023-03-03 11:21:38 -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
3a53d123a9 remove deprecated timestamp concept and fix const correctness for geometrycore curve and point set classes
#rb rinat.abdrashitov
#preflight 63f63ef7b91d7b0a12b9c945

[CL 24370918 by jimmy andrews in ue5-main branch]
2023-02-22 17:27:21 -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
ryan schmidt
5a61c6b75c GeometryProcessing: add MakeSelectAllSelection(), MakeSelectAllConnectedSelection(), MakeBoundaryConnectedSelection(), CombineSelectionInPlace() utility functions. Some of this is ported from geometry script selection code, which should be replaced with calls to these util functions (after testing). Minor necessarily additions to FGeometrySelection and FGeometrySelectionEditor.
#rb none
#preflight 63c02b711e5ee71dc373f692

[CL 23665656 by ryan schmidt in ue5-main branch]
2023-01-12 12:50:34 -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
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
henrik karlsson
2b3ad519a5 Fixed compile error surfaced when orphaned headers got compiled (they were never included in their own module so compiler warning settings was never applied)
Changes include
* Removed #pragma once in cpp files
* Removed dll export on templated types
* Fixed code in headers that didn't compile (probably never included anywhere
* Added casting for code going from int to float. Header was never compiled in the owning module that had warnings as errors

#preflight 637b10c6fa348e848054bd0d
#rb none (devin.doucette for a couple files)

[CL 23218414 by henrik karlsson in ue5-main branch]
2022-11-21 03:22:34 -05:00
rinat abdrashitov
1da1ecb3f0 -Added a new flag (bBlendZeroInfluence) to the FBoneWeightSettings to allow control over how zero-influence bones are treated during the blend. The Blend method will now consider the flag when performing the interpolation.
-Added a Blend function overload that handles barycentric interpolation of 3 skin weights.
-Refactored SetBoneWeightsFromBary (in DynamicVertexSkinWeightsAttribute.h) and ConstructVertexSkinWeightsAttribute (in SelectiveTessellate.cpp) functions to use the newly added Blend function for barycentric interpolation.
-Since the default Blend behavior has changed, make sure that unit tests in BoneWeightTests.cpp are refactored. Added more tests for cases when bBlendZeroInfluence is set to true and when using Blend for barycentric interpolation.

#rb halfdan.ingvarsson
#jira None
#preflight 6361de120c2e7c8f91668a75

[CL 22921407 by rinat abdrashitov in ue5-main branch]
2022-11-02 13:53:31 -04:00
tyson brochu
2e19cd43f6 Cloth Editor: enable adding/deleting weight maps directly in the weight map paint tool. (Currently the user has to go through the Attribute Editor tool to do this.)
#rb david.hill rinat.abdrashitov
#preflight 633f3fd52a0a2c1ead43571b

[CL 22383750 by tyson brochu in ue5-main branch]
2022-10-06 16:57:39 -04:00
Jimmy Andrews
19ee47937c fix lattice tool for negative scales
#rb tyson.brochu
#rb david.hill
#preflight 63091651dd33b8a5238b2dfb

[CL 21602609 by Jimmy Andrews in ue5-main branch]
2022-08-26 19:59:59 -04:00
Jimmy Andrews
68c7126a7c make more mesh creation tools generate tangents for their created meshes
(PolyExt, PathExt, PathRev, and BdryRev)

#jira UE-141656

#rb david.hill
#preflight 6307950c6f3401e0225dfa29

[CL 21566086 by Jimmy Andrews in ue5-main branch]
2022-08-25 11:51:02 -04:00
Ryan Schmidt
f3f44f9dfd GeometryCore: make FDynamicMesh3::GetMeshInfoString() const
GeometryScript: add SplitMeshBowties, RepairMeshDegenerateGeometry, and GetMeshInfoString functions
#rb none
#preflight 630387dec85b7fef224a1dcd

[CL 21483407 by Ryan Schmidt in ue5-main branch]
2022-08-22 10:38:15 -04:00
Ryan Schmidt
430d6c4107 GeometryCore: add TConstObjectSharedAccess and FSharedConstDynamicMesh3 typedef for FDynamicMesh3. This template provides a way for an "owner" of an object to share it with background threads. The owner may have a TSharedPtr or some other ownership model in which it can provide a raw pointer, the TConstObjectSharedAccess can work with either. Receivers of the TConstObjectSharedAccess use a function AccessSharedObject() to access and process the shared object. See header comments for more details
#rb david.hill
#preflight 62fbd1410f2aefc97a75c0de

[CL 21414137 by Ryan Schmidt in ue5-main branch]
2022-08-16 16:55:42 -04:00
Bryan sefcik
b4a6e947d8 Ran IWYU on Public headers under Engine/Source/Runtime/...
Headers are updated to contain any missing #includes needed to compile and #includes are sorted.  Nothing is removed.

#ushell-cherrypick of 21065896 by bryan.sefcik
#preflight 62d4b1a5a6141b6adfb0c892
#jira

#ROBOMERGE-OWNER: Bryan.sefcik
#ROBOMERGE-AUTHOR: bryan.sefcik
#ROBOMERGE-SOURCE: CL 21150156 via CL 21151754 via CL 21154719
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v972-20964824)
#ROBOMERGE-CONFLICT from-shelf

[CL 21181076 by Bryan sefcik in ue5-main branch]
2022-07-20 11:31:36 -04:00
Ryan Schmidt
715e1d357f GeometryCore:
Add FDynamicMesh3::EnableMatchingAttributes(), to expose AttributeSet::EnableMatchingAttributes() at the Mesh level
Add FDynamicMesh3::GetTriEdgeIDFromEdgeID(), helper to simplify construction of FMeshTriEdgeID identifiers
Add FRotator conversions for TQuaternion
Add TTransformSRT3::GetRotator()
Add UE::Geometry::Lerp variant for TFrame3
#rb rinat.abdrashitov
#preflight 62cc4a23f22e9d4fdf5da0f2

[CL 21047483 by Ryan Schmidt in ue5-main branch]
2022-07-11 17:10:51 -04:00
David Hill
769f6e10fd GeometryCore: DynamicVertex Attributes. fixing type promotion warnings.
#preflight 62c84de1e060ecd065bc8918
#rb Jimmy.Andrews

[CL 21011298 by David Hill in ue5-main branch]
2022-07-08 14:28:51 -04:00
Ryan Schmidt
c5e859dbdc GeometryCore: Add FColliderMesh::FindNearestHitTriangle() and FColliderMesh::FindNearestTriangle() wrappers around AABBTree functions. Replace most calls to these functions via AABBTree w/ calls to FColliderMesh functions. Rename ::GetAABBTree() to ::GetRawAABBTreeUnsafe() to discourage usage (intention long-term is to encapsulate the spatial data structure, so it is not exposed)
#rb jimmy.andrews
#preflight 62b5f31a3646551b1139502e

[CL 20813267 by Ryan Schmidt in ue5-main branch]
2022-06-24 14:08:36 -04:00
Ryan Schmidt
ae58db0625 GeometryCore:
- Add FDynamicMesh3::EnumerateEdgeTriangles() function, same API as ::EnumerateVertexTriangles()
- add function UE::Geometry::TrianglesToOverlayElements() in MeshIndexUtil.h, collects elements from triangles in a mesh attribute overlay
- minor change in TPolyline3::DistanceSquared to consistently use UE::Geometry:: function
#rb jimmy.andrews
#preflight 62b12cd64c538079d665150c

[CL 20750718 by Ryan Schmidt in ue5-main branch]
2022-06-20 22:42:29 -04:00
Ryan Schmidt
2e3f49e8bd GeometryCore: add FMeshEdgeTriID struct that identifies an edge in a mesh by a 30-bit triangle ID and a 2-bit edge-index. This allows an edge to be represented on meshes that do not have explicit edge IDs, or on a FDynamicMesh3 after add/remove changes (as edge IDs are currently not stable across such operations).
GeometryProcessing: add functions to FGroupTopology to query some information by FMeshEdgeTriID

#rb davd.hill, jimmy.andrews
#preflight 62b0dec89c1686e7e7eecbe2

[CL 20745548 by Ryan Schmidt in ue5-main branch]
2022-06-20 17:41:52 -04:00