Commit Graph

78 Commits

Author SHA1 Message Date
michael balzer
37b6fe1d9b GeometryCore: Fix Non-Unity build error in dynamic mesh serialization
#rb trivial
#rnx

[CL 17565335 by michael balzer in ue5-main branch]
2021-09-18 23:39:11 -04:00
michael balzer
4f9367249f GeometryCore: Improved serialization for dynamic mesh data
This CL adds improved serialization for FDynamicMesh3 and its data structures:
- FDynamicMesh3, TDynamicVector, FRefCountVector, FSmallListSet, TDynamicMeshOverlay, ...
- Versioning using the UE5Main stream version
- Discarding redundant data
- Oodle compression
- Serialization of vertex skin weights
- Additional unit tests and benchmark

#jira UETOOL-3821
#preflight 6145b802c2c19000017e2f6f, 6145b81ea7246e00017b1a43

[CL 17563009 by michael balzer in ue5-main branch]
2021-09-18 06:27:35 -04:00
Ryan Schmidt
56045ffcd5 GeometryScripting: make RevolvePolygon and Torus support extended revolve options, add SpiralRevolvePolygon
GeometryCore: add RevolveGenerator, generates surface-of-revolution meshes for open and closed profiles, the latter w/ spirals. Port of more general code in CurveSweepOp/RevolveProperties to expose at lower levels (needs further code cleanup)
#rb none
#rnx
#jira none
#preflight 6144ca01c2c19000014c9463

[CL 17555809 by Ryan Schmidt in ue5-main branch]
2021-09-17 14:28:44 -04:00
Jimmy Andrews
68c2d65bd4 Fixes to CompactInPlace: keep ElementTriangles 1:1 with ParentMesh triangles, don't try to copy when there's no mapping, but copy back InvalidID when the (mapped) element tri is unset
#rb semion.piskarev, michael.balzer
#rnx
#preflight 6143dee9b5a4fa00017b43bb

[CL 17552321 by Jimmy Andrews in ue5-main branch]
2021-09-17 10:54:43 -04:00
Ryan Schmidt
2f9dee8aac GeometryCore: add TMeshQueries::MeshDistanceStatistics
#rb none
#rnx
#jira none
#preflight 614271693c7c670001ae4c2f

[CL 17531986 by Ryan Schmidt in ue5-main branch]
2021-09-15 21:25:05 -04:00
michael balzer
dd06e1ffc4 GeometryCore: Fix TDynamicMeshOverlay<>::CompactInPlace() not compacting ElementTriangles vector
#preflight 6141714f599fd80001483188, 6141713b3c7c6700017f4923
#rnx

[CL 17520863 by michael balzer in ue5-main branch]
2021-09-15 11:40:12 -04:00
semion piskarev
c0062e5c11 MeshModelingTools: Added a CubeGrid tool, which allows for blocky boolean operations on an orientable power-of-two grid.
#rb Jimmy.Andrews, Matija Kecman
#rnx
#jira none
#preflight 6142002f8169560001cf8b91

[CL 17520534 by semion piskarev in ue5-main branch]
2021-09-15 11:24:08 -04:00
Ryan Schmidt
f1cc11359b GeometryCore: make DynamicMesh::IsSameAs function const
#rb none
#rnx
#jira none
#preflight 6140d28630c00d0001dd6a6a

[CL 17507424 by Ryan Schmidt in ue5-main branch]
2021-09-14 14:19:31 -04:00
michael balzer
21c519cc11 GeometryCore: Fix over-allocating triangles in FDynamicMesh3::CompactInPlace()
This CL fixes an issue where we accidentally allocate three times the amount of necessary triangles during `CompactInPlace()`. I also added a test during `CheckValidity()` to make sure that if we have dense ref counts the size of the vertex/triangle vectors is identical to the number of ref counts.

#rb jimmy.andrews
#preflight 61401b977dae460001e27ebe, 61401bbc878eef000160df3d

[CL 17500874 by michael balzer in ue5-main branch]
2021-09-14 01:18:28 -04:00
lonnie li
3e4ca92862 ModelingTools: Add N-to-1 detail mesh bake tool
- Added new FindNearestHitTriangle overload with bary coords.
- Refactored BakeMeshAttributeMapsTool into common base class with new MultiMesh (N-to-1) variant.
- Extended MeshDescriptionAdapter to support UVs.
- Added new queries on IMeshSpatialWrapper for mesh attributes.

#rb ryan.schmidt
#rnx
#jira UETOOL-3395
#preflight 613fb4c3a70fa0000131ff77

[CL 17497155 by lonnie li in ue5-main branch]
2021-09-13 17:49:48 -04:00
Ryan Schmidt
2edb5b5c67 GeometryProcessing: small fixes.
- handle undefined normal attributes in Simplifier ComputeFaceQuadric()
- Add separate SetGridCellSize() / SetMeshCellSize() functions to TImplicitMorphology
- define explicit enum values in RemoveOccludedTriangles
- Add support for linear scaling along path in FGeneralizedCylinderGenerator
#rb none
#rnx
#jira none
#preflight 613e1b0705632d0001ee8e2f

[CL 17488607 by Ryan Schmidt in ue5-main branch]
2021-09-12 17:26:21 -04:00
David Hill
9301d7f6e6 GeometryTypes.h - add missing includes to fix non-unity build errors
#rb ryan.schmidt

[CL 17464140 by David Hill in ue5-main branch]
2021-09-08 17:22:09 -04:00
Ryan Schmidt
7f0a4170f2 GeometryProcessing: force UV/normal overlays to be initialized on creation inside a DynamicMeshAttributeSet.
#rb michael.balzer
#rnx
#jira none
#preflight 6138f6289c40ec00012a7289

[CL 17463301 by Ryan Schmidt in ue5-main branch]
2021-09-08 16:27:01 -04:00
David Hill
a34cb401c4 IntrinsicTriangulationMesh.cpp Adding missing include - fixing non unity build error
[CL 17461087 by David Hill in ue5-main branch]
2021-09-08 14:04:13 -04:00
David Hill
3dcae148dd GeometryCore: Add Embedded Path Tracing across FDynamicMesh surfaces and Intrinsic Triangulations of FDynamicMeshes. Also update Mesh Laplacian Code to generate Cotan Laplacians from Intrinsic Triangulation.
MeshGeodesicSurfaceTracer.{h,cpp}  -  Add embedded path tracing.
GeodesicSurfaceTracerTests.cpp     -  unit tests for embedded path tracing

IntrinsicTriangulationMesh.{h, cpp}  - Adds two Intrinsic Triangulation mesh types (the more sophisticaed requires embedded path tracing)
IntrinsicMeshTests.cpp               -  unit tests for Intrinsic mesh types.

MeshLaplacian.{h,cpp}                - Adds new enum types for Intrinsic Delaunay Triangulation (IDT)  Laplacians
LaplacianOperators.{h,cpp}           - Adds wrappers and allow enum switches to build IDT Laplacians if requested
LaplacianMatrixAssembly.h            - Actually construction of IDT Laplacian.
Laplacian.cpp                        - Added trivial unit test for construction of IDT Laplacian

#rb jimmy.andrews
#preflight 6138bca42d09b9000158c95a

[CL 17458853 by David Hill in ue5-main branch]
2021-09-08 11:15:35 -04:00
Ryan Schmidt
fb80769bfd AutoLOD:
- add support for a Settings Preset, as an explicit Asset type. UStaticMeshLODGenerationSettings contains a copy of the GenerateProcess Settings, UStaticMeshLODGenerationSettingsFactory allows this UObject to be used as an Asset in the Editor.  UGenerateStaticMeshLODAssetTool now has a Preset slot, and action buttons to Read/Write to the currently-selected Settings Asset. New Settings Asset can be created via the Asset Picker popup in the Tool, currently creating via the New Asset menu is disabled via UStaticMeshLODGenerationSettingsFactory::GetMenuCategories()
- UGenerateStaticMeshLODProcess now automatically ignores input textures that have a constant value
- UGenerateStaticMeshLODProcess now skips writing output NormalMap and MultiTexture if they are not referenced by any output Materials
- UGenerateStaticMeshLODProcess now supports configuring whether a Texture or Material will be considered for Baking. If disabled, then the source Texture/Material is used (currently the Textures are still baked, they are just ignored while configuring/writing the outputs).
- UGenerateStaticMeshLODAssetTool now exposes lists of source Texture and Materials with option to skip baking (used to configure the above options)
- wrote header comments for UGenerateStaticMeshLODProcess
- overall cleanup in  UGenerateStaticMeshLODAssetTool, ie category names, organization, etc

- add TImageBuilder::IsConstantValue(), checks if all pixels of image are the same value

#rb tyson.brochu
#rnx
#jira none
#preflight 6137ae4fd9c85a00013838c1

[CL 17449788 by Ryan Schmidt in ue5-main branch]
2021-09-07 16:48:57 -04:00
michael balzer
83841e8e75 GeometryCore: Account for loading TDynamicVector<> with inconsistent internal current block data.
#rb none
#preflight 61328085e7eda30001ad2586
#rnx
#robomerge[bot1] emt

[CL 17427612 by michael balzer in ue5-main branch]
2021-09-03 17:58:34 -04:00
michael balzer
cef5393a3e GeometryCore: Fix DynamicVector::Resize() over-allocating and assigning invalid internal indices
#preflight 61318c221a52e20001c28dc7, 613176adbf137d0001722d3a
#rb jimmy.andrews
#rnx

[CL 17421613 by michael balzer in ue5-main branch]
2021-09-03 11:16:22 -04:00
David Hill
c623797f09 DynamicMesh3 - Add direct buffer access that returns const refrence to TriangleEdges.
Also make all other direct buffer access methods that return const references, const methods

#preflight 6130f096e7eda30001750def
#rb Michael.Balzer

[CL 17407688 by David Hill in ue5-main branch]
2021-09-02 15:41:48 -04:00
Ryan Schmidt
2cae82c1e5 GeometryCore: minor DynamicMesh fixes. Change ensure to a checkSlow in DynamicMesh3::AppendTriangle. Add FDynamicMeshOverlay::GetTriangleIfValid(). Handle unset triangles in CountVertexElements().
#rb tyson.brochu
#rnx
#jira none
#preflight 612fa9a575bca200010b8148

[CL 17393286 by Ryan Schmidt in ue5-main branch]
2021-09-01 18:00:45 -04:00
Ryan Schmidt
9f156b5f20 GeometryCore: Add minimal UE::Math::TVector2<T> implementation and FVector2f/2d typedefs locally in GeometryCore VectorTypes.h. Replace existing FVector2<T> with this class, in preparation for LWC conversion. FVector2 members ::Distance() and ::DistanceSquared() moved to free functions. Update all call sites and references to FVector2.
#rb jimmy.andrews
#rnx
#jira none
#preflight 612d248c423a8f00013287f2

[CL 17359821 by Ryan Schmidt in ue5-main branch]
2021-08-30 18:02:34 -04:00
nathan mitchell
a260c66e4e UVEditor: Add support for sew action as part of the Select/Transform tool
Additionally adds a new parameter to the DynamicMesh MergeEdge method to ignore orientation discrepancies, useful in 2D mesh manipulation, and fixes a bug in the SetTriangle method where a variable was being left uninitialized.

#rb semion.piskarev
#rnx
#jira UETOOL-3112

[CL 17328444 by nathan mitchell in ue5-main branch]
2021-08-26 19:51:32 -04:00
semion piskarev
ca5544ca20 MeshModelingTools: Add boolean extrude option to PolyEdit. Fix extrusion of multiple faces via triangle normals. Add ability to extrude while keeping multiple faces parallel. Add options for side group setting on borders during extrude.
#rb Jimmy.Andrews
#jira UETOOL-3807
#rnx

[CL 17325840 by semion piskarev in ue5-main branch]
2021-08-26 16:58:00 -04:00
Ryan Schmidt
a74ccabf04 GeometryProcessing: remove T* conversions/casts from FVector2<T>
#rb none
#rnx
#jira none
#preflight 6127affdc068e50001bedd42

[CL 17325004 by Ryan Schmidt in ue5-main branch]
2021-08-26 15:56:24 -04:00
Ryan Schmidt
d33c3d7bdb GeometryProcessing: LWC Fixes. Remove GeometryCore TRay3, TSphere3, and TOrientedBox3 from ExplicitUseGeometryMathTypes.h, update call sites to fully-qualified name where necessary (in some cases handled by using declaration at class scope, or by wrapping code in UE::Geometry:: namespace)
#rb none
#rnx
#jira none
#preflight 6126b717d673c400011f438b

[CL 17316981 by Ryan Schmidt in ue5-main branch]
2021-08-26 09:30:50 -04:00