Commit Graph

233 Commits

Author SHA1 Message Date
matija kecman
f0b24deb05 Fix StructProperty FGeometryScriptRenderCaptureCamera::ViewPosition is not initialized properly
#jira UE-194794,UE-194795
#rb lonnie.li
#rnx

[CL 27687709 by matija kecman in ue5-main branch]
2023-09-07 16:46:15 -04:00
jimmy andrews
3207475515 add more point set functions for Geometry Script:
1. OffsetTransforms to offset the location of all transforms in an array, e.g. to move them all along their local Z if you want to move mesh samples along their normal
2. DownsamplePoints to downsample points to a fixed number of samples, optionally with priority weighting and approximate uniform spacing

#rb rinat.abdrashitov

[CL 27681518 by jimmy andrews in ue5-main branch]
2023-09-07 14:38:38 -04:00
matija kecman
fccb4f9aff Scene sampling using a Render Capture approach
#rb jimmy.andrews
#jira UE-193152,UE-194653

[CL 27637471 by matija kecman in ue5-main branch]
2023-09-06 11:39:40 -04:00
ryan bickell
329715468a Fix PostEditUndo not called when undo is used on a BP derived from GeneratedDynamicMeshActor that has added components.
#rb jimmy.andrews
#jira UE-193404

[CL 27594602 by ryan bickell in ue5-main branch]
2023-09-05 09:34:32 -04:00
matija kecman
f1975cde6c Fix crash in BakeTextureFromRenderCaptures Geometry Script node
#rb lonnie.li, semion.piskarev
#jira UE-193161
#lockdown julien.marchand

[CL 27144893 by matija kecman in ue5-main branch]
2023-08-16 13:15:34 -04:00
rinat abdrashitov
910b049dcd Fixed a bug where we didn't include the inpaint mask name in the transfer node.
#rb tyson.brochu
#jira UE-193051
#rnx
#lockdown julien.marchand

[CL 27141200 by rinat abdrashitov in ue5-main branch]
2023-08-16 11:27:18 -04:00
ryan schmidt
f733d6432d GeometryScript: add new functions AddUVElementToMesh, SetMeshTriangleUVElementIDs, GetMeshTriangleUVElementIDs, GetMeshUVElementPosition, SetMeshUVElementPosition
#rb jimmy.andrews

[CL 27110666 by ryan schmidt in ue5-main branch]
2023-08-15 13:47:57 -04:00
ryan schmidt
1af747c294 GeometryScript: support reading from HiRes LOD in CopyMeshFromStaticMesh
#rb rinat.abdrashitov

[CL 26984894 by ryan schmidt in ue5-main branch]
2023-08-10 01:36:03 -04:00
jimmy andrews
6e47422884 Add K-Means clustering to GeometryCore
Add initial PointSetFunctions to Geometry Script, including: K-Means Clustering, Flatten/Unflatten, Make Bounding Box, Transforms -> Points
Add a custom For Each-style macro to provide a more convenient interface for working with the clustering result

#rb semion.piskarev, ryan.schmidt, david.hill

[CL 26785428 by jimmy andrews in ue5-main branch]
2023-08-02 15:56:15 -04:00
jimmy andrews
c557e9c1c5 Change the Geometry Script plugin from Experimental to Beta
#rb david.hill

[CL 26587075 by jimmy andrews in ue5-main branch]
2023-07-25 16:21:08 -04:00
matija kecman
00ca171680 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 26569987 by matija kecman in ue5-main branch]
2023-07-25 08:46:23 -04:00
rinat abdrashitov
b0e1560231 -GeometryScript: When creating a new SkeletaMesh asset, provide an option to use the bone attributes of the dynamic mesh to set the reference skeleton of the skeletal mesh.
-Added a convenience function for getting an array of bone names from a reference skeleton.
-Added MeshBones.h/cpp that contain utility functions to deal with dynamic mesh bone attributes

#rb halfdan.ingvarsson

[CL 26233377 by rinat abdrashitov in ue5-main branch]
2023-06-26 10:17:13 -04:00
ryan schmidt
7188f2a7e9 GeometryScript: add GetVertexConnectedTriangles, GetVertexConnectedVertices, GetAllSplitUVsAtVertex
#rb none

[CL 26110737 by ryan schmidt in ue5-main branch]
2023-06-19 20:18:33 -04:00
rinat abdrashitov
ff7ec68b3e Fixed a bug where the GetBoneChildren will return the whole skeleton and not just the children.
#rb trivial
#jira none

[CL 26071260 by rinat abdrashitov in ue5-main branch]
2023-06-16 17:27:56 -04:00
ryan schmidt
2e4543a767 GeometryScript: add SelectMeshElementsInBoxWithBVH, allows efficient range query on large meshes. Fix issue in FGeometryScriptMeshSelection::ConvertToMeshIndexArray where if converting from vertex to triangle selection, it was emitting a list with duplicate triangles.
#rb none

[CL 26056773 by ryan schmidt in ue5-main branch]
2023-06-16 12:28:46 -04:00
ryan schmidt
1a69e04b7e GeometryScript: Add DynamicMeshComponent NotifyMeshModified and NotifyMeshVertexAttributesModified functions (functions are called 'Updated' in BP, via DisplayName, because NotifyMeshUpdated already exists as C++ function). These allow a DynamicMeshComponent's rendering to be updated after the underlying DynamicMesh has been modified with deferred notifications (eg while setting many vertex positions, etc).
Add RecomputeNormalsForMeshSelection, allows subset of normals to be recomputed. Add bDeferChangeNotifications option to RecomputeNormals.

Add ComputeMeshLocalUVParam, computes expmap parameterization on bounded-geodesic-radius area of mesh

#rb none

[CL 26034446 by ryan schmidt in ue5-main branch]
2023-06-15 22:53:04 -04:00
rinat abdrashitov
618dec5913 Added new mesh bone weight functions for getting information about individual bones or the skeleton.
Added InpaintWeights option to the TransferBoneWeightsFromMesh function


#rb halfdan.ingvarsson
#jira none

[CL 26031663 by rinat abdrashitov in ue5-main branch]
2023-06-15 20:38:30 -04:00
rinat abdrashitov
4ef78ca57e -Added an operator for smoothing overlays of any dimension containing any scalar data
-Added a function for computing per-edge cotangent weights
-Added a function for computing edge lengths
-Added a geometry script function for bluring colors

#rb david.hill
#jira none

[CL 26029009 by rinat abdrashitov in ue5-main branch]
2023-06-15 18:19:32 -04:00
ryan schmidt
13ceaa9f8b Add support for ISMC's to CopyMeshFromComponent
#rb none

[CL 25936081 by ryan schmidt in ue5-main branch]
2023-06-12 15:57:06 -04:00
kirill zorin
b6ee3a6c64 Fix UE_LOG callsites that have format string-related UB
#rb trivial
#preflight 647107780a6634dbb236a0a6

[CL 25651638 by kirill zorin in ue5-main branch]
2023-05-26 15:52:39 -04:00
rinat abdrashitov
7291b58cca Added a new transfer weight method to the FTransferBoneWeights operator.
#rb halfdan.ingvarsson
#jira none
#rnx
#preflight 645d32072965f6ea8ea7b487

[CL 25432672 by rinat abdrashitov in ue5-main branch]
2023-05-11 14:46:46 -04:00
halfdan ingvarsson
67a3b6d37c Skelmesh Converter: Fix setting multiple LODs
#jira UE-182276
#rnx
#preflight 644ae6e5401d328ad9d28205

[CL 25238008 by halfdan ingvarsson in ue5-main branch]
2023-04-28 15:34:02 -04:00
ryan schmidt
765780023d GeometryScript: add primitive function AppendBoundingBox, which takes an FBox instead of box parameters. Add MarkForMeshRebuild() function to GeneratedDynamicMeshActor, allows other BP code/etc to force a rebuild w/o re-running construction script.
#rb none
#preflight 644a92ecb208f61af81a8b4e

[CL 25219850 by ryan schmidt in ue5-main branch]
2023-04-27 14:06:39 -04:00
ryan schmidt
b7d82e290e CombineMeshInstances: change generation of Voxel LODs to have consistent UVs, by generating UVs at first voxel LOD and allowing them to carry through simplification.
- bring over DoSimplifyMesh function from geo script, really should move this to a centralized location
- add ComputeVoxWrapMeshAutoUV, uses XAtlas, again similar to geo script function
- refactor InitializeAttributes function into separate InitializeNormalsFromAngleThreshold and ProjectAttributes functions
- disable replacement of voxel LODs with approximation LODs if triangle count is larger. Currently no way to communicate this upwards and will break attempts to bake textures for voxel LODs at a higher level.

GeometryScript: remove restriction in CopyMeshToStaticMesh that only allows modifying materials when updating LOD0. There is no reason for this (howerver updating materials when writing hires LOD is still prevented)

#rb none
#preflight 6446e4ebf030f684d5f1f6ea

[CL 25197843 by ryan schmidt in ue5-main branch]
2023-04-26 10:28:07 -04:00
ryan schmidt
ecae20d82f GeometryScript: expose texture filtering options in BakeTexture node
#rb lonnie.li
#preflight 644848ba4977a25a15723632

[CL 25197833 by ryan schmidt in ue5-main branch]
2023-04-26 10:27:55 -04:00