24 Commits

Author SHA1 Message Date
alex mcadams
680510e10d Enable PhysicsAsset Create and setting from FBX and Datasmith Import in UEFN.
Also disabled creating constraints from the PhysicsAssetUtils level by just checking if UPhysicsConstraintTemplate are allowed to be created. This allowed me to remove the code modifying the UPhysicsAssetGenerationSettings defaults at the ValkyrieEditor level.

#rb Sergio.Gardeazabal jeanluc.corenthin

[CL 26198225 by alex mcadams in 5.3 branch]
2023-06-22 19:05:02 -04:00
Alex McAdams
71f140457e Reduce number of bad weights in SkinnedLevelSet that cause "spikes". These spikes are caused by vertices getting small weights that get renormalized to large weights, in particular because for some reason the largest influence is not set.
Firstly, improve the dirichlet weights on the surface when doing the poisson diffusion by only considering vertices with non-zero weights for the closest point calculation. Before, it was possible to get zero weights because the triangle mesh includes any triangle with non-zero weights.

Secondly, when renormalizing weights, set a higher threshold (0.1) for discarding weights.

Also added debug draw of the weights.

#preflight 63f941e4ae54ee4ce9209426

[CL 24426752 by Alex McAdams in ue5-main branch]
2023-02-27 12:48:21 -05:00
Alex McAdams
2fc19a1670 Fix unity build
#preflight 63db2d857a39a18021aebd4f
#rb trivial

[CL 23964185 by Alex McAdams in ue5-main branch]
2023-02-01 22:59:55 -05:00
Alex McAdams
613b0638b9 Add Skinned Level Set Physics type.
This adds a new Chaos Implicit Object TWeightedLatticeImplicitObject which can wrap any (bounded) rigid implicit object with a weighted lattice. The lattice deforms via Linear Blend Skinning and is used to approximate deformation of the wrapped rigid implicit object.

A new physics asset FKShapeElem type has been added: the FKSkinnedLevelSet which holds a TWeightedLatticeImplicitObject<FLevelSet>. The PhysicsAssetEditor has been updated to generate this for skeletal meshes. Skinned level sets can be generated from a subset of bones in the skeletal mesh. Weights are transferred by Poisson diffusing weights on the surface to the volumetric lattice points.

There is limited debug draw and the asset generation workflow likely will need iteration.

#preflight 63d9b7f48505ea6b1fd4abb4
#rb kriss.gossart

[CL 23950693 by Alex McAdams in ue5-main branch]
2023-02-01 12:00:49 -05:00
Alex McAdams
19983ba5a7 Use the "FullGrid" option when generating LevelSet physics assets.
Chaos cloth (the primary user of level sets) can penetrate arbitrarily deep inside the collider and still needs a good Phi and Normal value, rather than only having accurate values within a narrow band. This makes calculating the levelset more expensive (a one time cost), but in practice, it's not really noticeable.

#preflight 63bcaae80b7fcef8b094135d
#rb tyson.brochu

[CL 23630951 by Alex McAdams in ue5-main branch]
2023-01-10 14:41:05 -05:00
Bryan sefcik
80f80e7a25 Updated the underlying types for regular and namespaced enums.
#jira
#preflight 638e6d479549ddaa2822be9a

[CL 23421568 by Bryan sefcik in ue5-main branch]
2022-12-06 19:43:59 -05:00
tyson brochu
de488fdba4 SkinnedBoneTriangleCache: fix for getting the wrong bone-vertex influence.
Weights are now using uint16 but one variable was still uint8


#rb alex.mcadams
#preflight 636152b8397c7af89670c8a1

[CL 22885984 by tyson brochu in ue5-main branch]
2022-11-01 13:17:16 -04:00
tyson brochu
85c525c14e PhysicsAsset/SkeletalMesh level set collision objects:
- try to make the output grid resolution better match the specified input resolution
- don't try to render the grid if resolution is too high (debug rendering can really start to slow things down)
- fix a bug generating a mesh for solid rendering of the level set cells

#jira UE-167098
#preflight 634eee0a4d3101c0ea37ac6f

[CL 22608178 by tyson brochu in ue5-main branch]
2022-10-18 15:18:01 -04:00
tyson brochu
e84463686d SkeletalMeshEditor: add option to use level sets when running "Generate All Bodies"
#jira UE-167098
#rb kriss.gossart
#preflight 634dae93305a762e7e58bdf2

[CL 22576877 by tyson brochu in ue5-main branch]
2022-10-17 16:34:23 -04:00
halfdan ingvarsson
e2210cb024 Support for 16-bit skin weights on the skelmesh.
The main change is that FSoftSkinVertex, used by FSkeletalMeshLODModel, in now stores weights as 16-bit after conversion from the import data. This increases the size of each FSoftSkinVertex from 144 bytes to 160 bytes (about 10% increase). By default render meshes still use 8-bit skin weights, with weights downshifted from the 16-bit modeling data, so no change in GPU memory consumption there. However, the vertex buffer will automatically return a 16-bit skin weights when requested from the GPU side (e.g. for CPU skinning and viewing tangents).

This change in the model data and vertex buffer CPU-side query, resulted in many changes throughout the codebase and will have an effect on licensees who are actively reading from and writing to these two storage locations.

The GPU skin cache shader has had one more permutation added when not using unlimited skin weights. The vertex factory is not affected.

#jira UE-164386
#rb alexis.matte, josie.yang
#preflight 632c0c5ab4515b7e22b4804d

[CL 22215219 by halfdan ingvarsson in ue5-main branch]
2022-09-27 19:48:05 -04:00
steve robb
4ec08d4a96 Warning added about capturing a probably-not-trivially-relocatable std::function and handing it off to UE.
#rb trivial
#preflight none

[CL 21716509 by steve robb in ue5-main branch]
2022-08-30 23:05:17 -04:00
kriss gossart
0422ca7705 Skeletal Mesh - Replace the newly created GetSkeletalMesh function by GetSkeletalMeshAsset so it matches the setter SetSkeletalMeshAsset function (which itself couldn't be named SetSkeletalMesh due to the function already existing and doing something else).
#rb Josie.Yang
#preflight 62fa2afeae3edb54c979492e
#jira none

[CL 21385959 by kriss gossart in ue5-main branch]
2022-08-15 09:26:50 -04:00
nick brett
be3323e0db [UE][FEATURE] PhAT Constraint Transform Editing
- Enable users to view and edit the parent and child frame transforms of constraints in the PhAT details panel
- Constraint transforms are represented as a position and a rotator in the details panel (internally they are represented as a position and a pair of orthonormal vectors)
- Constraint transforms can optionally be displayed in the frame of the assocaited bone OR relative to the default (snapped) transforms
- Allow parent / child transform position / orientation componenets to be 'snapped' to defaults individually
- Support using modifier keys to manipulate only the child frame transform via a viewport widget

#jira UE-119744
#jira UE-119741
#rb [at]Thomas.Sarkanen, [at]sebastian.nordgren
#preflight 62f13b9a23003b62a3d4c277

#ROBOMERGE-AUTHOR: nick.brett
#ROBOMERGE-SOURCE: CL 21282618 via CL 21282632 via CL 21282638
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v972-20964824)

[CL 21283069 by nick brett in ue5-main branch]
2022-08-09 07:30:26 -04:00
Josie Yang
6b15506e58 Replace direct access to SkeletalMesh object from USkinnedMeshComponent with GetSkeletalMesh function
#rb kriss.gossart
#preflight 62aafc9ada0af39a4783930a

[CL 20686007 by Josie Yang in ue5-main branch]
2022-06-16 09:14:04 -04:00
fred kimberley
7fbfaf57c8 Require explicit constructors/casts when converting between FVector, FVector3d, and FVector3f.
#jira UE-122078
#rb Andrew.Davidson, Colin.McGinley
#preflight standard build

#ROBOMERGE-AUTHOR: fred.kimberley
#ROBOMERGE-SOURCE: CL 18817999 in //UE5/Release-5.0/... via CL 18818012 via CL 18822871
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v910-18824042)

[CL 18824721 by fred kimberley in ue5-main branch]
2022-02-02 07:59:31 -05:00
andrew davidson
f089ae83f4 FMatrix explicit cast fixes
#preflight 61f277cbaf74b68515c0bd64

#ROBOMERGE-AUTHOR: andrew.davidson
#ROBOMERGE-SOURCE: CL 18751911 in //UE5/Release-5.0/... via CL 18751924 via CL 18752067
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)

[CL 18752076 by andrew davidson in ue5-main branch]
2022-01-27 06:25:37 -05:00
Marc Audy
0c3be2b6ad Merge Release-Engine-Staging to Test @ CL# 18240298
[CL 18241953 by Marc Audy in ue5-release-engine-test branch]
2021-11-18 14:37:34 -05:00
aurel cordonnier
a12d56ff31 Merge from Release-Engine-Staging @ 17791557 to Release-Engine-Test
This represents UE4/Main @17774255, Release-5.0 @17791557 and Dev-PerfTest @17789485

[CL 17794212 by aurel cordonnier in ue5-release-engine-test branch]
2021-10-12 21:21:22 -04:00
richard talbotwatkin
2cfb317099 LWC-related fix for convex hull decomposition. Assume that all input points will always have float precision.
Also remove unnecessary allocations by allowing the async task to assume ownership of the vertex and index arrays passed to it.
#rb Andy.Davidson, Cedric.Caillaud
#jira UE-125187

#ROBOMERGE-AUTHOR: richard.talbotwatkin
#ROBOMERGE-SOURCE: CL 17448234 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v870-17433530)

[CL 17448242 by richard talbotwatkin in ue5-release-engine-test branch]
2021-09-07 14:54:16 -04:00
joe kirchoff
491c629000 Fixing case of //UE5/Main/Engine/Source/Developer/PhysicsUtilities/Private/SkinnedBoneTriangleCache.cpp (2/2)
#rb none
#rnx

#ROBOMERGE-SOURCE: CL 17041540 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v848-17036448)

[CL 17041555 by joe kirchoff in ue5-release-engine-test branch]
2021-08-03 19:20:18 -04:00
joe kirchoff
1fa037e24b Fixing case of //UE5/Main/Engine/Source/Developer/PhysicsUtilities/Private/SkinnedBoneTriangleCache.cpp (1/2)
#rb none
#rnx

#ROBOMERGE-SOURCE: CL 17041535 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v848-17036448)

[CL 17041549 by joe kirchoff in ue5-release-engine-test branch]
2021-08-03 19:20:12 -04:00
joe kirchoff
c4ad0f5764 Fixing case of //UE5/Main/Engine/Source/Developer/PhysicsUtilities/Private/SkinnedBoneTriangleCache.h (2/2)
#rb none
#rnx

#ROBOMERGE-SOURCE: CL 17041530 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v848-17036448)

[CL 17041542 by joe kirchoff in ue5-release-engine-test branch]
2021-08-03 19:19:34 -04:00
joe kirchoff
38702b8906 Fixing case of //UE5/Main/Engine/Source/Developer/PhysicsUtilities/Private/SkinnedBoneTriangleCache.h (1/2)
#rb none
#rnx

#ROBOMERGE-SOURCE: CL 17041529 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v848-17036448)

[CL 17041537 by joe kirchoff in ue5-release-engine-test branch]
2021-08-03 19:19:27 -04:00
alexis matte
888f708d3b Allow Physics asset to be a developper module with no dependencecies on any editor module.
#jira UETOOL-3603
#rb richard.talbotwatkin
#preflight 60d1e95f78c3b000010f6005

#ROBOMERGE-SOURCE: CL 16743468 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v835-16672529)

[CL 16743480 by alexis matte in ue5-release-engine-test branch]
2021-06-22 11:13:19 -04:00