2020-04-18 18:42:59 -04:00
// Copyright Epic Games, Inc. All Rights Reserved.
# include "MeshVertexSculptTool.h"
# include "InteractiveToolManager.h"
# include "InteractiveGizmoManager.h"
# include "Async/ParallelFor.h"
# include "Async/Async.h"
2021-03-02 19:23:29 -04:00
# include "Selections/MeshConnectedComponents.h"
2020-04-18 18:42:59 -04:00
# include "MeshWeights.h"
2021-05-22 01:32:46 -04:00
# include "DynamicMesh/MeshNormals.h"
# include "DynamicMesh/MeshIndexUtil.h"
2020-04-18 18:42:59 -04:00
# include "Util/BufferUtil.h"
2021-01-31 20:16:41 -04:00
# include "AssetUtils/Texture2DUtil.h"
2021-12-06 15:44:16 -05:00
# include "ToolSetupUtil.h"
# include "BaseGizmos/BrushStampIndicator.h"
# include "PreviewMesh.h"
# include "Generators/RectangleMeshGenerator.h"
2020-04-18 18:42:59 -04:00
# include "Changes/MeshVertexChange.h"
2020-09-01 14:07:48 -04:00
# include "Sculpting/KelvinletBrushOp.h"
2020-04-18 18:42:59 -04:00
# include "Sculpting/MeshSmoothingBrushOps.h"
# include "Sculpting/MeshInflateBrushOps.h"
# include "Sculpting/MeshMoveBrushOps.h"
# include "Sculpting/MeshPlaneBrushOps.h"
# include "Sculpting/MeshPinchBrushOps.h"
# include "Sculpting/MeshSculptBrushOps.h"
ModelingTools: Ongoing Sculpting improvements:
- new UMeshSculptBrushOpProps baseclass for per-BrushOp Property Sets, added such a PropertySet for each BrushOp
- separate Strength/Depth/Falloff for each BrushOp so that they can have different settings. Currently cannot be in a shared base PropSet class because of different UProp Category strings
- UMeshSculptToolBase now supports registering BrushOp factory paired w/ ToolProps, rewrote VertexSculpt to use this to handle switching active BrushOp and visible PropSet
- removed UPlaneBrushProperties, vertex sculpt no longer uses USculptMaxBrushProperties (still used by dynamic sculpt)
- moved UMeshSurfacePointTool implementation up to UMeshSculptToolBase
- UMeshSculptToolBase now has OnBeginStroke() / OnEndStroke()API for subclasses to use to handle stroke (instead of overriding drag functions)
- Moved some setup to UMeshSculptToolBase. It can now initializes the target Component, can apply to Simple or Octree variants,
- moved Primary/Secondary BrushOp and active Falloff to UMeshSculptToolBase
- Support for various falloff types implemented in StampFalloffs.h, new EMeshSculptFalloffType exposed in VertexSculpt properties
- moved target component Transforms to UMeshSculptToolBase
- moved Brush Frames to UMeshSculptToolBase. Now storing Frames instead of Point+Normal, moved functions to update position for various stamp types
- UMeshSculptToolBase now has API for hit-testing against Sculpt and Base mesh, VertexSculpt implements
- UMeshSculptToolBase now has APIs for accessing transforms, current DMesh and BaseMesh, active stroke Depth/Strength/Falloff properties,
- moved Brush Target Plane (eg for Move), Stamp Plane (eg for Flatten), and StrokePlane (eg for Plane brushes) to UMeshSculptToolBase, and relevant calcuation APIs
- base USculptBrushProperties now has Lazyness parameter, implemented lazy-brush in base sculpt tool
#rb none
#rnx
#ROBOMERGE-SOURCE: CL 13044097 via CL 13044098 via CL 13044099
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v686-13045012)
[CL 13048205 by ryan schmidt in Main branch]
2020-04-27 12:51:59 -04:00
# include "Sculpting/StampFalloffs.h"
2020-04-18 18:42:59 -04:00
# include "Sculpting/MeshSculptUtil.h"
2021-03-18 17:20:32 -04:00
# include "TargetInterfaces/PrimitiveComponentBackedTarget.h"
2022-03-17 14:59:48 -04:00
# include "TargetInterfaces/MaterialProvider.h"
2021-03-18 17:20:32 -04:00
2021-03-09 19:33:56 -04:00
using namespace UE : : Geometry ;
2020-04-18 18:42:59 -04:00
# define LOCTEXT_NAMESPACE "UMeshVertexSculptTool"
namespace
{
// probably should be something defined for the whole tool framework...
# if WITH_EDITOR
static EAsyncExecution VertexSculptToolAsyncExecTarget = EAsyncExecution : : LargeThreadPool ;
# else
static EAsyncExecution VertexSculptToolAsyncExecTarget = EAsyncExecution : : ThreadPool ;
# endif
}
/*
* ToolBuilder
*/
UMeshSurfacePointTool * UMeshVertexSculptToolBuilder : : CreateNewTool ( const FToolBuilderState & SceneState ) const
{
UMeshVertexSculptTool * SculptTool = NewObject < UMeshVertexSculptTool > ( SceneState . ToolManager ) ;
SculptTool - > SetWorld ( SceneState . World ) ;
return SculptTool ;
}
/*
* Tool
*/
void UMeshVertexSculptTool : : Setup ( )
{
UMeshSculptToolBase : : Setup ( ) ;
2021-02-08 17:02:09 -04:00
SetToolDisplayName ( LOCTEXT ( " ToolName " , " Sculpt " ) ) ;
2020-04-18 18:42:59 -04:00
// create dynamic mesh component to use for live preview
2021-11-18 14:37:34 -05:00
check ( TargetWorld ) ;
FActorSpawnParameters SpawnInfo ;
PreviewMeshActor = TargetWorld - > SpawnActor < AInternalToolFrameworkActor > ( FVector : : ZeroVector , FRotator : : ZeroRotator , SpawnInfo ) ;
DynamicMeshComponent = NewObject < UDynamicMeshComponent > ( PreviewMeshActor ) ;
InitializeSculptMeshComponent ( DynamicMeshComponent , PreviewMeshActor ) ;
2020-04-18 18:42:59 -04:00
// assign materials
FComponentMaterialSet MaterialSet ;
2021-03-18 17:20:32 -04:00
Cast < IMaterialProvider > ( Target ) - > GetMaterialSet ( MaterialSet ) ;
2020-04-18 18:42:59 -04:00
for ( int k = 0 ; k < MaterialSet . Materials . Num ( ) ; + + k )
{
DynamicMeshComponent - > SetMaterial ( k , MaterialSet . Materials [ k ] ) ;
}
2021-06-10 18:37:57 -04:00
DynamicMeshComponent - > SetInvalidateProxyOnChangeEnabled ( false ) ;
2020-04-18 18:42:59 -04:00
OnDynamicMeshComponentChangedHandle = DynamicMeshComponent - > OnMeshVerticesChanged . AddUObject ( this , & UMeshVertexSculptTool : : OnDynamicMeshComponentChanged ) ;
2021-03-02 19:23:29 -04:00
FDynamicMesh3 * SculptMesh = GetSculptMesh ( ) ;
FAxisAlignedBox3d Bounds = SculptMesh - > GetBounds ( true ) ;
2020-04-18 18:42:59 -04:00
2021-03-02 19:23:29 -04:00
// initialize dynamic octree
TFuture < void > InitializeOctree = Async ( VertexSculptToolAsyncExecTarget , [ SculptMesh , Bounds , this ] ( )
{
if ( SculptMesh - > TriangleCount ( ) > 100000 )
{
Octree . RootDimension = Bounds . MaxDim ( ) / 10.0 ;
Octree . SetMaxTreeDepth ( 4 ) ;
}
else
{
Octree . RootDimension = Bounds . MaxDim ( ) / 2.0 ;
Octree . SetMaxTreeDepth ( 8 ) ;
}
Octree . Initialize ( SculptMesh ) ;
//Octree.CheckValidity(EValidityCheckFailMode::Check, true, true);
//FDynamicMeshOctree3::FStatistics Stats;
//Octree.ComputeStatistics(Stats);
//UE_LOG(LogTemp, Warning, TEXT("Octree Stats: %s"), *Stats.ToString());
} ) ;
// find mesh connected-component index for each triangle
TFuture < void > InitializeComponents = Async ( VertexSculptToolAsyncExecTarget , [ SculptMesh , this ] ( )
{
TriangleComponentIDs . SetNum ( SculptMesh - > MaxTriangleID ( ) ) ;
FMeshConnectedComponents Components ( SculptMesh ) ;
Components . FindConnectedTriangles ( ) ;
int32 ComponentIdx = 1 ;
for ( const FMeshConnectedComponents : : FComponent & Component : Components )
{
for ( int32 TriIdx : Component . Indices )
{
TriangleComponentIDs [ TriIdx ] = ComponentIdx ;
}
ComponentIdx + + ;
}
} ) ;
// currently only supporting default polygroup set
TFuture < void > InitializeGroups = Async ( VertexSculptToolAsyncExecTarget , [ SculptMesh , this ] ( )
{
ActiveGroupSet = MakeUnique < UE : : Geometry : : FPolygroupSet > ( SculptMesh ) ;
} ) ;
2020-04-18 18:42:59 -04:00
// initialize target mesh
2021-03-02 19:23:29 -04:00
TFuture < void > InitializeBaseMesh = Async ( VertexSculptToolAsyncExecTarget , [ this ] ( )
{
UpdateBaseMesh ( nullptr ) ;
bTargetDirty = false ;
} ) ;
// initialize render decomposition
TFuture < void > InitializeRenderDecomp = Async ( VertexSculptToolAsyncExecTarget , [ SculptMesh , & MaterialSet , this ] ( )
{
TUniquePtr < FMeshRenderDecomposition > Decomp = MakeUnique < FMeshRenderDecomposition > ( ) ;
FMeshRenderDecomposition : : BuildChunkedDecomposition ( SculptMesh , & MaterialSet , * Decomp ) ;
Decomp - > BuildAssociations ( SculptMesh ) ;
//UE_LOG(LogTemp, Warning, TEXT("Decomposition has %d groups"), Decomp->Num());
DynamicMeshComponent - > SetExternalDecomposition ( MoveTemp ( Decomp ) ) ;
} ) ;
// Wait for above precomputations to finish before continuing
InitializeOctree . Wait ( ) ;
InitializeComponents . Wait ( ) ;
InitializeGroups . Wait ( ) ;
InitializeBaseMesh . Wait ( ) ;
InitializeRenderDecomp . Wait ( ) ;
2020-04-18 18:42:59 -04:00
// initialize brush radius range interval, brush properties
ModelingTools: Ongoing Sculpting improvements:
- new UMeshSculptBrushOpProps baseclass for per-BrushOp Property Sets, added such a PropertySet for each BrushOp
- separate Strength/Depth/Falloff for each BrushOp so that they can have different settings. Currently cannot be in a shared base PropSet class because of different UProp Category strings
- UMeshSculptToolBase now supports registering BrushOp factory paired w/ ToolProps, rewrote VertexSculpt to use this to handle switching active BrushOp and visible PropSet
- removed UPlaneBrushProperties, vertex sculpt no longer uses USculptMaxBrushProperties (still used by dynamic sculpt)
- moved UMeshSurfacePointTool implementation up to UMeshSculptToolBase
- UMeshSculptToolBase now has OnBeginStroke() / OnEndStroke()API for subclasses to use to handle stroke (instead of overriding drag functions)
- Moved some setup to UMeshSculptToolBase. It can now initializes the target Component, can apply to Simple or Octree variants,
- moved Primary/Secondary BrushOp and active Falloff to UMeshSculptToolBase
- Support for various falloff types implemented in StampFalloffs.h, new EMeshSculptFalloffType exposed in VertexSculpt properties
- moved target component Transforms to UMeshSculptToolBase
- moved Brush Frames to UMeshSculptToolBase. Now storing Frames instead of Point+Normal, moved functions to update position for various stamp types
- UMeshSculptToolBase now has API for hit-testing against Sculpt and Base mesh, VertexSculpt implements
- UMeshSculptToolBase now has APIs for accessing transforms, current DMesh and BaseMesh, active stroke Depth/Strength/Falloff properties,
- moved Brush Target Plane (eg for Move), Stamp Plane (eg for Flatten), and StrokePlane (eg for Plane brushes) to UMeshSculptToolBase, and relevant calcuation APIs
- base USculptBrushProperties now has Lazyness parameter, implemented lazy-brush in base sculpt tool
#rb none
#rnx
#ROBOMERGE-SOURCE: CL 13044097 via CL 13044098 via CL 13044099
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v686-13045012)
[CL 13048205 by ryan schmidt in Main branch]
2020-04-27 12:51:59 -04:00
UMeshSculptToolBase : : InitializeBrushSizeRange ( Bounds ) ;
2020-04-18 18:42:59 -04:00
// initialize other properties
SculptProperties = NewObject < UVertexBrushSculptProperties > ( this ) ;
2021-10-28 13:24:28 -04:00
SculptProperties - > Tool = this ;
2021-01-31 20:16:41 -04:00
2020-04-18 18:42:59 -04:00
// init state flags flags
ActiveVertexChange = nullptr ;
InitializeIndicator ( ) ;
// initialize our properties
AddToolPropertySource ( UMeshSculptToolBase : : BrushProperties ) ;
ModelingTools: Ongoing Sculpting improvements:
- new UMeshSculptBrushOpProps baseclass for per-BrushOp Property Sets, added such a PropertySet for each BrushOp
- separate Strength/Depth/Falloff for each BrushOp so that they can have different settings. Currently cannot be in a shared base PropSet class because of different UProp Category strings
- UMeshSculptToolBase now supports registering BrushOp factory paired w/ ToolProps, rewrote VertexSculpt to use this to handle switching active BrushOp and visible PropSet
- removed UPlaneBrushProperties, vertex sculpt no longer uses USculptMaxBrushProperties (still used by dynamic sculpt)
- moved UMeshSurfacePointTool implementation up to UMeshSculptToolBase
- UMeshSculptToolBase now has OnBeginStroke() / OnEndStroke()API for subclasses to use to handle stroke (instead of overriding drag functions)
- Moved some setup to UMeshSculptToolBase. It can now initializes the target Component, can apply to Simple or Octree variants,
- moved Primary/Secondary BrushOp and active Falloff to UMeshSculptToolBase
- Support for various falloff types implemented in StampFalloffs.h, new EMeshSculptFalloffType exposed in VertexSculpt properties
- moved target component Transforms to UMeshSculptToolBase
- moved Brush Frames to UMeshSculptToolBase. Now storing Frames instead of Point+Normal, moved functions to update position for various stamp types
- UMeshSculptToolBase now has API for hit-testing against Sculpt and Base mesh, VertexSculpt implements
- UMeshSculptToolBase now has APIs for accessing transforms, current DMesh and BaseMesh, active stroke Depth/Strength/Falloff properties,
- moved Brush Target Plane (eg for Move), Stamp Plane (eg for Flatten), and StrokePlane (eg for Plane brushes) to UMeshSculptToolBase, and relevant calcuation APIs
- base USculptBrushProperties now has Lazyness parameter, implemented lazy-brush in base sculpt tool
#rb none
#rnx
#ROBOMERGE-SOURCE: CL 13044097 via CL 13044098 via CL 13044099
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v686-13045012)
[CL 13048205 by ryan schmidt in Main branch]
2020-04-27 12:51:59 -04:00
UMeshSculptToolBase : : BrushProperties - > bShowPerBrushProps = false ;
UMeshSculptToolBase : : BrushProperties - > bShowFalloff = false ;
2021-01-31 20:16:41 -04:00
SculptProperties - > RestoreProperties ( this ) ;
2020-04-18 18:42:59 -04:00
AddToolPropertySource ( SculptProperties ) ;
ModelingTools: Ongoing Sculpting improvements:
- new UMeshSculptBrushOpProps baseclass for per-BrushOp Property Sets, added such a PropertySet for each BrushOp
- separate Strength/Depth/Falloff for each BrushOp so that they can have different settings. Currently cannot be in a shared base PropSet class because of different UProp Category strings
- UMeshSculptToolBase now supports registering BrushOp factory paired w/ ToolProps, rewrote VertexSculpt to use this to handle switching active BrushOp and visible PropSet
- removed UPlaneBrushProperties, vertex sculpt no longer uses USculptMaxBrushProperties (still used by dynamic sculpt)
- moved UMeshSurfacePointTool implementation up to UMeshSculptToolBase
- UMeshSculptToolBase now has OnBeginStroke() / OnEndStroke()API for subclasses to use to handle stroke (instead of overriding drag functions)
- Moved some setup to UMeshSculptToolBase. It can now initializes the target Component, can apply to Simple or Octree variants,
- moved Primary/Secondary BrushOp and active Falloff to UMeshSculptToolBase
- Support for various falloff types implemented in StampFalloffs.h, new EMeshSculptFalloffType exposed in VertexSculpt properties
- moved target component Transforms to UMeshSculptToolBase
- moved Brush Frames to UMeshSculptToolBase. Now storing Frames instead of Point+Normal, moved functions to update position for various stamp types
- UMeshSculptToolBase now has API for hit-testing against Sculpt and Base mesh, VertexSculpt implements
- UMeshSculptToolBase now has APIs for accessing transforms, current DMesh and BaseMesh, active stroke Depth/Strength/Falloff properties,
- moved Brush Target Plane (eg for Move), Stamp Plane (eg for Flatten), and StrokePlane (eg for Plane brushes) to UMeshSculptToolBase, and relevant calcuation APIs
- base USculptBrushProperties now has Lazyness parameter, implemented lazy-brush in base sculpt tool
#rb none
#rnx
#ROBOMERGE-SOURCE: CL 13044097 via CL 13044098 via CL 13044099
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v686-13045012)
[CL 13048205 by ryan schmidt in Main branch]
2020-04-27 12:51:59 -04:00
CalculateBrushRadius ( ) ;
2021-01-31 20:16:41 -04:00
AlphaProperties = NewObject < UVertexBrushAlphaProperties > ( this ) ;
AlphaProperties - > RestoreProperties ( this ) ;
AddToolPropertySource ( AlphaProperties ) ;
2020-04-18 18:42:59 -04:00
ModelingTools: Ongoing Sculpting improvements:
- new UMeshSculptBrushOpProps baseclass for per-BrushOp Property Sets, added such a PropertySet for each BrushOp
- separate Strength/Depth/Falloff for each BrushOp so that they can have different settings. Currently cannot be in a shared base PropSet class because of different UProp Category strings
- UMeshSculptToolBase now supports registering BrushOp factory paired w/ ToolProps, rewrote VertexSculpt to use this to handle switching active BrushOp and visible PropSet
- removed UPlaneBrushProperties, vertex sculpt no longer uses USculptMaxBrushProperties (still used by dynamic sculpt)
- moved UMeshSurfacePointTool implementation up to UMeshSculptToolBase
- UMeshSculptToolBase now has OnBeginStroke() / OnEndStroke()API for subclasses to use to handle stroke (instead of overriding drag functions)
- Moved some setup to UMeshSculptToolBase. It can now initializes the target Component, can apply to Simple or Octree variants,
- moved Primary/Secondary BrushOp and active Falloff to UMeshSculptToolBase
- Support for various falloff types implemented in StampFalloffs.h, new EMeshSculptFalloffType exposed in VertexSculpt properties
- moved target component Transforms to UMeshSculptToolBase
- moved Brush Frames to UMeshSculptToolBase. Now storing Frames instead of Point+Normal, moved functions to update position for various stamp types
- UMeshSculptToolBase now has API for hit-testing against Sculpt and Base mesh, VertexSculpt implements
- UMeshSculptToolBase now has APIs for accessing transforms, current DMesh and BaseMesh, active stroke Depth/Strength/Falloff properties,
- moved Brush Target Plane (eg for Move), Stamp Plane (eg for Flatten), and StrokePlane (eg for Plane brushes) to UMeshSculptToolBase, and relevant calcuation APIs
- base USculptBrushProperties now has Lazyness parameter, implemented lazy-brush in base sculpt tool
#rb none
#rnx
#ROBOMERGE-SOURCE: CL 13044097 via CL 13044098 via CL 13044099
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v686-13045012)
[CL 13048205 by ryan schmidt in Main branch]
2020-04-27 12:51:59 -04:00
this - > BaseMeshQueryFunc = [ & ] ( int32 VertexID , const FVector3d & Position , double MaxDist , FVector3d & PosOut , FVector3d & NormalOut )
{
return GetBaseMeshNearest ( VertexID , Position , MaxDist , PosOut , NormalOut ) ;
} ;
2020-04-18 18:42:59 -04:00
2021-10-28 13:24:28 -04:00
RegisterBrushType ( ( int32 ) EMeshVertexSculptBrushType : : Smooth , LOCTEXT ( " SmoothBrush " , " Smooth " ) ,
ModelingTools: Ongoing Sculpting improvements:
- new UMeshSculptBrushOpProps baseclass for per-BrushOp Property Sets, added such a PropertySet for each BrushOp
- separate Strength/Depth/Falloff for each BrushOp so that they can have different settings. Currently cannot be in a shared base PropSet class because of different UProp Category strings
- UMeshSculptToolBase now supports registering BrushOp factory paired w/ ToolProps, rewrote VertexSculpt to use this to handle switching active BrushOp and visible PropSet
- removed UPlaneBrushProperties, vertex sculpt no longer uses USculptMaxBrushProperties (still used by dynamic sculpt)
- moved UMeshSurfacePointTool implementation up to UMeshSculptToolBase
- UMeshSculptToolBase now has OnBeginStroke() / OnEndStroke()API for subclasses to use to handle stroke (instead of overriding drag functions)
- Moved some setup to UMeshSculptToolBase. It can now initializes the target Component, can apply to Simple or Octree variants,
- moved Primary/Secondary BrushOp and active Falloff to UMeshSculptToolBase
- Support for various falloff types implemented in StampFalloffs.h, new EMeshSculptFalloffType exposed in VertexSculpt properties
- moved target component Transforms to UMeshSculptToolBase
- moved Brush Frames to UMeshSculptToolBase. Now storing Frames instead of Point+Normal, moved functions to update position for various stamp types
- UMeshSculptToolBase now has API for hit-testing against Sculpt and Base mesh, VertexSculpt implements
- UMeshSculptToolBase now has APIs for accessing transforms, current DMesh and BaseMesh, active stroke Depth/Strength/Falloff properties,
- moved Brush Target Plane (eg for Move), Stamp Plane (eg for Flatten), and StrokePlane (eg for Plane brushes) to UMeshSculptToolBase, and relevant calcuation APIs
- base USculptBrushProperties now has Lazyness parameter, implemented lazy-brush in base sculpt tool
#rb none
#rnx
#ROBOMERGE-SOURCE: CL 13044097 via CL 13044098 via CL 13044099
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v686-13045012)
[CL 13048205 by ryan schmidt in Main branch]
2020-04-27 12:51:59 -04:00
MakeUnique < TBasicMeshSculptBrushOpFactory < FSmoothBrushOp > > ( ) ,
NewObject < USmoothBrushOpProps > ( this ) ) ;
2021-10-28 13:24:28 -04:00
RegisterBrushType ( ( int32 ) EMeshVertexSculptBrushType : : SmoothFill , LOCTEXT ( " SmoothFill " , " SmoothFill " ) ,
ModelingTools: Ongoing Sculpting improvements:
- new UMeshSculptBrushOpProps baseclass for per-BrushOp Property Sets, added such a PropertySet for each BrushOp
- separate Strength/Depth/Falloff for each BrushOp so that they can have different settings. Currently cannot be in a shared base PropSet class because of different UProp Category strings
- UMeshSculptToolBase now supports registering BrushOp factory paired w/ ToolProps, rewrote VertexSculpt to use this to handle switching active BrushOp and visible PropSet
- removed UPlaneBrushProperties, vertex sculpt no longer uses USculptMaxBrushProperties (still used by dynamic sculpt)
- moved UMeshSurfacePointTool implementation up to UMeshSculptToolBase
- UMeshSculptToolBase now has OnBeginStroke() / OnEndStroke()API for subclasses to use to handle stroke (instead of overriding drag functions)
- Moved some setup to UMeshSculptToolBase. It can now initializes the target Component, can apply to Simple or Octree variants,
- moved Primary/Secondary BrushOp and active Falloff to UMeshSculptToolBase
- Support for various falloff types implemented in StampFalloffs.h, new EMeshSculptFalloffType exposed in VertexSculpt properties
- moved target component Transforms to UMeshSculptToolBase
- moved Brush Frames to UMeshSculptToolBase. Now storing Frames instead of Point+Normal, moved functions to update position for various stamp types
- UMeshSculptToolBase now has API for hit-testing against Sculpt and Base mesh, VertexSculpt implements
- UMeshSculptToolBase now has APIs for accessing transforms, current DMesh and BaseMesh, active stroke Depth/Strength/Falloff properties,
- moved Brush Target Plane (eg for Move), Stamp Plane (eg for Flatten), and StrokePlane (eg for Plane brushes) to UMeshSculptToolBase, and relevant calcuation APIs
- base USculptBrushProperties now has Lazyness parameter, implemented lazy-brush in base sculpt tool
#rb none
#rnx
#ROBOMERGE-SOURCE: CL 13044097 via CL 13044098 via CL 13044099
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v686-13045012)
[CL 13048205 by ryan schmidt in Main branch]
2020-04-27 12:51:59 -04:00
MakeUnique < TBasicMeshSculptBrushOpFactory < FSmoothFillBrushOp > > ( ) ,
NewObject < USmoothFillBrushOpProps > ( this ) ) ;
2021-10-28 13:24:28 -04:00
RegisterBrushType ( ( int32 ) EMeshVertexSculptBrushType : : Move , LOCTEXT ( " Move " , " Move " ) ,
ModelingTools: Ongoing Sculpting improvements:
- new UMeshSculptBrushOpProps baseclass for per-BrushOp Property Sets, added such a PropertySet for each BrushOp
- separate Strength/Depth/Falloff for each BrushOp so that they can have different settings. Currently cannot be in a shared base PropSet class because of different UProp Category strings
- UMeshSculptToolBase now supports registering BrushOp factory paired w/ ToolProps, rewrote VertexSculpt to use this to handle switching active BrushOp and visible PropSet
- removed UPlaneBrushProperties, vertex sculpt no longer uses USculptMaxBrushProperties (still used by dynamic sculpt)
- moved UMeshSurfacePointTool implementation up to UMeshSculptToolBase
- UMeshSculptToolBase now has OnBeginStroke() / OnEndStroke()API for subclasses to use to handle stroke (instead of overriding drag functions)
- Moved some setup to UMeshSculptToolBase. It can now initializes the target Component, can apply to Simple or Octree variants,
- moved Primary/Secondary BrushOp and active Falloff to UMeshSculptToolBase
- Support for various falloff types implemented in StampFalloffs.h, new EMeshSculptFalloffType exposed in VertexSculpt properties
- moved target component Transforms to UMeshSculptToolBase
- moved Brush Frames to UMeshSculptToolBase. Now storing Frames instead of Point+Normal, moved functions to update position for various stamp types
- UMeshSculptToolBase now has API for hit-testing against Sculpt and Base mesh, VertexSculpt implements
- UMeshSculptToolBase now has APIs for accessing transforms, current DMesh and BaseMesh, active stroke Depth/Strength/Falloff properties,
- moved Brush Target Plane (eg for Move), Stamp Plane (eg for Flatten), and StrokePlane (eg for Plane brushes) to UMeshSculptToolBase, and relevant calcuation APIs
- base USculptBrushProperties now has Lazyness parameter, implemented lazy-brush in base sculpt tool
#rb none
#rnx
#ROBOMERGE-SOURCE: CL 13044097 via CL 13044098 via CL 13044099
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v686-13045012)
[CL 13048205 by ryan schmidt in Main branch]
2020-04-27 12:51:59 -04:00
MakeUnique < TBasicMeshSculptBrushOpFactory < FMoveBrushOp > > ( ) ,
NewObject < UMoveBrushOpProps > ( this ) ) ;
2021-10-28 13:24:28 -04:00
RegisterBrushType ( ( int32 ) EMeshVertexSculptBrushType : : Offset , LOCTEXT ( " Offset " , " SculptN " ) ,
ModelingTools: Ongoing Sculpting improvements:
- new UMeshSculptBrushOpProps baseclass for per-BrushOp Property Sets, added such a PropertySet for each BrushOp
- separate Strength/Depth/Falloff for each BrushOp so that they can have different settings. Currently cannot be in a shared base PropSet class because of different UProp Category strings
- UMeshSculptToolBase now supports registering BrushOp factory paired w/ ToolProps, rewrote VertexSculpt to use this to handle switching active BrushOp and visible PropSet
- removed UPlaneBrushProperties, vertex sculpt no longer uses USculptMaxBrushProperties (still used by dynamic sculpt)
- moved UMeshSurfacePointTool implementation up to UMeshSculptToolBase
- UMeshSculptToolBase now has OnBeginStroke() / OnEndStroke()API for subclasses to use to handle stroke (instead of overriding drag functions)
- Moved some setup to UMeshSculptToolBase. It can now initializes the target Component, can apply to Simple or Octree variants,
- moved Primary/Secondary BrushOp and active Falloff to UMeshSculptToolBase
- Support for various falloff types implemented in StampFalloffs.h, new EMeshSculptFalloffType exposed in VertexSculpt properties
- moved target component Transforms to UMeshSculptToolBase
- moved Brush Frames to UMeshSculptToolBase. Now storing Frames instead of Point+Normal, moved functions to update position for various stamp types
- UMeshSculptToolBase now has API for hit-testing against Sculpt and Base mesh, VertexSculpt implements
- UMeshSculptToolBase now has APIs for accessing transforms, current DMesh and BaseMesh, active stroke Depth/Strength/Falloff properties,
- moved Brush Target Plane (eg for Move), Stamp Plane (eg for Flatten), and StrokePlane (eg for Plane brushes) to UMeshSculptToolBase, and relevant calcuation APIs
- base USculptBrushProperties now has Lazyness parameter, implemented lazy-brush in base sculpt tool
#rb none
#rnx
#ROBOMERGE-SOURCE: CL 13044097 via CL 13044098 via CL 13044099
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v686-13045012)
[CL 13048205 by ryan schmidt in Main branch]
2020-04-27 12:51:59 -04:00
MakeUnique < FLambdaMeshSculptBrushOpFactory > ( [ this ] ( ) { return MakeUnique < FSurfaceSculptBrushOp > ( BaseMeshQueryFunc ) ; } ) ,
NewObject < UStandardSculptBrushOpProps > ( this ) ) ;
2021-10-28 13:24:28 -04:00
RegisterBrushType ( ( int32 ) EMeshVertexSculptBrushType : : SculptView , LOCTEXT ( " SculptView " , " SculptV " ) ,
ModelingTools: Ongoing Sculpting improvements:
- new UMeshSculptBrushOpProps baseclass for per-BrushOp Property Sets, added such a PropertySet for each BrushOp
- separate Strength/Depth/Falloff for each BrushOp so that they can have different settings. Currently cannot be in a shared base PropSet class because of different UProp Category strings
- UMeshSculptToolBase now supports registering BrushOp factory paired w/ ToolProps, rewrote VertexSculpt to use this to handle switching active BrushOp and visible PropSet
- removed UPlaneBrushProperties, vertex sculpt no longer uses USculptMaxBrushProperties (still used by dynamic sculpt)
- moved UMeshSurfacePointTool implementation up to UMeshSculptToolBase
- UMeshSculptToolBase now has OnBeginStroke() / OnEndStroke()API for subclasses to use to handle stroke (instead of overriding drag functions)
- Moved some setup to UMeshSculptToolBase. It can now initializes the target Component, can apply to Simple or Octree variants,
- moved Primary/Secondary BrushOp and active Falloff to UMeshSculptToolBase
- Support for various falloff types implemented in StampFalloffs.h, new EMeshSculptFalloffType exposed in VertexSculpt properties
- moved target component Transforms to UMeshSculptToolBase
- moved Brush Frames to UMeshSculptToolBase. Now storing Frames instead of Point+Normal, moved functions to update position for various stamp types
- UMeshSculptToolBase now has API for hit-testing against Sculpt and Base mesh, VertexSculpt implements
- UMeshSculptToolBase now has APIs for accessing transforms, current DMesh and BaseMesh, active stroke Depth/Strength/Falloff properties,
- moved Brush Target Plane (eg for Move), Stamp Plane (eg for Flatten), and StrokePlane (eg for Plane brushes) to UMeshSculptToolBase, and relevant calcuation APIs
- base USculptBrushProperties now has Lazyness parameter, implemented lazy-brush in base sculpt tool
#rb none
#rnx
#ROBOMERGE-SOURCE: CL 13044097 via CL 13044098 via CL 13044099
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v686-13045012)
[CL 13048205 by ryan schmidt in Main branch]
2020-04-27 12:51:59 -04:00
MakeUnique < FLambdaMeshSculptBrushOpFactory > ( [ this ] ( ) { return MakeUnique < FViewAlignedSculptBrushOp > ( BaseMeshQueryFunc ) ; } ) ,
NewObject < UViewAlignedSculptBrushOpProps > ( this ) ) ;
2021-10-28 13:24:28 -04:00
RegisterBrushType ( ( int32 ) EMeshVertexSculptBrushType : : SculptMax , LOCTEXT ( " SculptMax " , " SculptMx " ) ,
ModelingTools: Ongoing Sculpting improvements:
- new UMeshSculptBrushOpProps baseclass for per-BrushOp Property Sets, added such a PropertySet for each BrushOp
- separate Strength/Depth/Falloff for each BrushOp so that they can have different settings. Currently cannot be in a shared base PropSet class because of different UProp Category strings
- UMeshSculptToolBase now supports registering BrushOp factory paired w/ ToolProps, rewrote VertexSculpt to use this to handle switching active BrushOp and visible PropSet
- removed UPlaneBrushProperties, vertex sculpt no longer uses USculptMaxBrushProperties (still used by dynamic sculpt)
- moved UMeshSurfacePointTool implementation up to UMeshSculptToolBase
- UMeshSculptToolBase now has OnBeginStroke() / OnEndStroke()API for subclasses to use to handle stroke (instead of overriding drag functions)
- Moved some setup to UMeshSculptToolBase. It can now initializes the target Component, can apply to Simple or Octree variants,
- moved Primary/Secondary BrushOp and active Falloff to UMeshSculptToolBase
- Support for various falloff types implemented in StampFalloffs.h, new EMeshSculptFalloffType exposed in VertexSculpt properties
- moved target component Transforms to UMeshSculptToolBase
- moved Brush Frames to UMeshSculptToolBase. Now storing Frames instead of Point+Normal, moved functions to update position for various stamp types
- UMeshSculptToolBase now has API for hit-testing against Sculpt and Base mesh, VertexSculpt implements
- UMeshSculptToolBase now has APIs for accessing transforms, current DMesh and BaseMesh, active stroke Depth/Strength/Falloff properties,
- moved Brush Target Plane (eg for Move), Stamp Plane (eg for Flatten), and StrokePlane (eg for Plane brushes) to UMeshSculptToolBase, and relevant calcuation APIs
- base USculptBrushProperties now has Lazyness parameter, implemented lazy-brush in base sculpt tool
#rb none
#rnx
#ROBOMERGE-SOURCE: CL 13044097 via CL 13044098 via CL 13044099
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v686-13045012)
[CL 13048205 by ryan schmidt in Main branch]
2020-04-27 12:51:59 -04:00
MakeUnique < FLambdaMeshSculptBrushOpFactory > ( [ this ] ( ) { return MakeUnique < FSurfaceMaxSculptBrushOp > ( BaseMeshQueryFunc ) ; } ) ,
NewObject < USculptMaxBrushOpProps > ( this ) ) ;
2021-10-28 13:24:28 -04:00
RegisterBrushType ( ( int32 ) EMeshVertexSculptBrushType : : Inflate , LOCTEXT ( " Inflate " , " Inflate " ) ,
ModelingTools: Ongoing Sculpting improvements:
- new UMeshSculptBrushOpProps baseclass for per-BrushOp Property Sets, added such a PropertySet for each BrushOp
- separate Strength/Depth/Falloff for each BrushOp so that they can have different settings. Currently cannot be in a shared base PropSet class because of different UProp Category strings
- UMeshSculptToolBase now supports registering BrushOp factory paired w/ ToolProps, rewrote VertexSculpt to use this to handle switching active BrushOp and visible PropSet
- removed UPlaneBrushProperties, vertex sculpt no longer uses USculptMaxBrushProperties (still used by dynamic sculpt)
- moved UMeshSurfacePointTool implementation up to UMeshSculptToolBase
- UMeshSculptToolBase now has OnBeginStroke() / OnEndStroke()API for subclasses to use to handle stroke (instead of overriding drag functions)
- Moved some setup to UMeshSculptToolBase. It can now initializes the target Component, can apply to Simple or Octree variants,
- moved Primary/Secondary BrushOp and active Falloff to UMeshSculptToolBase
- Support for various falloff types implemented in StampFalloffs.h, new EMeshSculptFalloffType exposed in VertexSculpt properties
- moved target component Transforms to UMeshSculptToolBase
- moved Brush Frames to UMeshSculptToolBase. Now storing Frames instead of Point+Normal, moved functions to update position for various stamp types
- UMeshSculptToolBase now has API for hit-testing against Sculpt and Base mesh, VertexSculpt implements
- UMeshSculptToolBase now has APIs for accessing transforms, current DMesh and BaseMesh, active stroke Depth/Strength/Falloff properties,
- moved Brush Target Plane (eg for Move), Stamp Plane (eg for Flatten), and StrokePlane (eg for Plane brushes) to UMeshSculptToolBase, and relevant calcuation APIs
- base USculptBrushProperties now has Lazyness parameter, implemented lazy-brush in base sculpt tool
#rb none
#rnx
#ROBOMERGE-SOURCE: CL 13044097 via CL 13044098 via CL 13044099
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v686-13045012)
[CL 13048205 by ryan schmidt in Main branch]
2020-04-27 12:51:59 -04:00
MakeUnique < TBasicMeshSculptBrushOpFactory < FInflateBrushOp > > ( ) ,
NewObject < UInflateBrushOpProps > ( this ) ) ;
2021-10-28 13:24:28 -04:00
RegisterBrushType ( ( int32 ) EMeshVertexSculptBrushType : : Pinch , LOCTEXT ( " Pinch " , " Pinch " ) ,
ModelingTools: Ongoing Sculpting improvements:
- new UMeshSculptBrushOpProps baseclass for per-BrushOp Property Sets, added such a PropertySet for each BrushOp
- separate Strength/Depth/Falloff for each BrushOp so that they can have different settings. Currently cannot be in a shared base PropSet class because of different UProp Category strings
- UMeshSculptToolBase now supports registering BrushOp factory paired w/ ToolProps, rewrote VertexSculpt to use this to handle switching active BrushOp and visible PropSet
- removed UPlaneBrushProperties, vertex sculpt no longer uses USculptMaxBrushProperties (still used by dynamic sculpt)
- moved UMeshSurfacePointTool implementation up to UMeshSculptToolBase
- UMeshSculptToolBase now has OnBeginStroke() / OnEndStroke()API for subclasses to use to handle stroke (instead of overriding drag functions)
- Moved some setup to UMeshSculptToolBase. It can now initializes the target Component, can apply to Simple or Octree variants,
- moved Primary/Secondary BrushOp and active Falloff to UMeshSculptToolBase
- Support for various falloff types implemented in StampFalloffs.h, new EMeshSculptFalloffType exposed in VertexSculpt properties
- moved target component Transforms to UMeshSculptToolBase
- moved Brush Frames to UMeshSculptToolBase. Now storing Frames instead of Point+Normal, moved functions to update position for various stamp types
- UMeshSculptToolBase now has API for hit-testing against Sculpt and Base mesh, VertexSculpt implements
- UMeshSculptToolBase now has APIs for accessing transforms, current DMesh and BaseMesh, active stroke Depth/Strength/Falloff properties,
- moved Brush Target Plane (eg for Move), Stamp Plane (eg for Flatten), and StrokePlane (eg for Plane brushes) to UMeshSculptToolBase, and relevant calcuation APIs
- base USculptBrushProperties now has Lazyness parameter, implemented lazy-brush in base sculpt tool
#rb none
#rnx
#ROBOMERGE-SOURCE: CL 13044097 via CL 13044098 via CL 13044099
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v686-13045012)
[CL 13048205 by ryan schmidt in Main branch]
2020-04-27 12:51:59 -04:00
MakeUnique < TBasicMeshSculptBrushOpFactory < FPinchBrushOp > > ( ) ,
NewObject < UPinchBrushOpProps > ( this ) ) ;
2021-10-28 13:24:28 -04:00
RegisterBrushType ( ( int32 ) EMeshVertexSculptBrushType : : Flatten , LOCTEXT ( " Flatten " , " Flatten " ) ,
ModelingTools: Ongoing Sculpting improvements:
- new UMeshSculptBrushOpProps baseclass for per-BrushOp Property Sets, added such a PropertySet for each BrushOp
- separate Strength/Depth/Falloff for each BrushOp so that they can have different settings. Currently cannot be in a shared base PropSet class because of different UProp Category strings
- UMeshSculptToolBase now supports registering BrushOp factory paired w/ ToolProps, rewrote VertexSculpt to use this to handle switching active BrushOp and visible PropSet
- removed UPlaneBrushProperties, vertex sculpt no longer uses USculptMaxBrushProperties (still used by dynamic sculpt)
- moved UMeshSurfacePointTool implementation up to UMeshSculptToolBase
- UMeshSculptToolBase now has OnBeginStroke() / OnEndStroke()API for subclasses to use to handle stroke (instead of overriding drag functions)
- Moved some setup to UMeshSculptToolBase. It can now initializes the target Component, can apply to Simple or Octree variants,
- moved Primary/Secondary BrushOp and active Falloff to UMeshSculptToolBase
- Support for various falloff types implemented in StampFalloffs.h, new EMeshSculptFalloffType exposed in VertexSculpt properties
- moved target component Transforms to UMeshSculptToolBase
- moved Brush Frames to UMeshSculptToolBase. Now storing Frames instead of Point+Normal, moved functions to update position for various stamp types
- UMeshSculptToolBase now has API for hit-testing against Sculpt and Base mesh, VertexSculpt implements
- UMeshSculptToolBase now has APIs for accessing transforms, current DMesh and BaseMesh, active stroke Depth/Strength/Falloff properties,
- moved Brush Target Plane (eg for Move), Stamp Plane (eg for Flatten), and StrokePlane (eg for Plane brushes) to UMeshSculptToolBase, and relevant calcuation APIs
- base USculptBrushProperties now has Lazyness parameter, implemented lazy-brush in base sculpt tool
#rb none
#rnx
#ROBOMERGE-SOURCE: CL 13044097 via CL 13044098 via CL 13044099
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v686-13045012)
[CL 13048205 by ryan schmidt in Main branch]
2020-04-27 12:51:59 -04:00
MakeUnique < TBasicMeshSculptBrushOpFactory < FFlattenBrushOp > > ( ) ,
NewObject < UFlattenBrushOpProps > ( this ) ) ;
2021-10-28 13:24:28 -04:00
RegisterBrushType ( ( int32 ) EMeshVertexSculptBrushType : : Plane , LOCTEXT ( " Plane " , " PlaneN " ) ,
ModelingTools: Ongoing Sculpting improvements:
- new UMeshSculptBrushOpProps baseclass for per-BrushOp Property Sets, added such a PropertySet for each BrushOp
- separate Strength/Depth/Falloff for each BrushOp so that they can have different settings. Currently cannot be in a shared base PropSet class because of different UProp Category strings
- UMeshSculptToolBase now supports registering BrushOp factory paired w/ ToolProps, rewrote VertexSculpt to use this to handle switching active BrushOp and visible PropSet
- removed UPlaneBrushProperties, vertex sculpt no longer uses USculptMaxBrushProperties (still used by dynamic sculpt)
- moved UMeshSurfacePointTool implementation up to UMeshSculptToolBase
- UMeshSculptToolBase now has OnBeginStroke() / OnEndStroke()API for subclasses to use to handle stroke (instead of overriding drag functions)
- Moved some setup to UMeshSculptToolBase. It can now initializes the target Component, can apply to Simple or Octree variants,
- moved Primary/Secondary BrushOp and active Falloff to UMeshSculptToolBase
- Support for various falloff types implemented in StampFalloffs.h, new EMeshSculptFalloffType exposed in VertexSculpt properties
- moved target component Transforms to UMeshSculptToolBase
- moved Brush Frames to UMeshSculptToolBase. Now storing Frames instead of Point+Normal, moved functions to update position for various stamp types
- UMeshSculptToolBase now has API for hit-testing against Sculpt and Base mesh, VertexSculpt implements
- UMeshSculptToolBase now has APIs for accessing transforms, current DMesh and BaseMesh, active stroke Depth/Strength/Falloff properties,
- moved Brush Target Plane (eg for Move), Stamp Plane (eg for Flatten), and StrokePlane (eg for Plane brushes) to UMeshSculptToolBase, and relevant calcuation APIs
- base USculptBrushProperties now has Lazyness parameter, implemented lazy-brush in base sculpt tool
#rb none
#rnx
#ROBOMERGE-SOURCE: CL 13044097 via CL 13044098 via CL 13044099
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v686-13045012)
[CL 13048205 by ryan schmidt in Main branch]
2020-04-27 12:51:59 -04:00
MakeUnique < TBasicMeshSculptBrushOpFactory < FPlaneBrushOp > > ( ) ,
NewObject < UPlaneBrushOpProps > ( this ) ) ;
2021-10-28 13:24:28 -04:00
RegisterBrushType ( ( int32 ) EMeshVertexSculptBrushType : : PlaneViewAligned , LOCTEXT ( " PlaneViewAligned " , " PlaneV " ) ,
ModelingTools: Ongoing Sculpting improvements:
- new UMeshSculptBrushOpProps baseclass for per-BrushOp Property Sets, added such a PropertySet for each BrushOp
- separate Strength/Depth/Falloff for each BrushOp so that they can have different settings. Currently cannot be in a shared base PropSet class because of different UProp Category strings
- UMeshSculptToolBase now supports registering BrushOp factory paired w/ ToolProps, rewrote VertexSculpt to use this to handle switching active BrushOp and visible PropSet
- removed UPlaneBrushProperties, vertex sculpt no longer uses USculptMaxBrushProperties (still used by dynamic sculpt)
- moved UMeshSurfacePointTool implementation up to UMeshSculptToolBase
- UMeshSculptToolBase now has OnBeginStroke() / OnEndStroke()API for subclasses to use to handle stroke (instead of overriding drag functions)
- Moved some setup to UMeshSculptToolBase. It can now initializes the target Component, can apply to Simple or Octree variants,
- moved Primary/Secondary BrushOp and active Falloff to UMeshSculptToolBase
- Support for various falloff types implemented in StampFalloffs.h, new EMeshSculptFalloffType exposed in VertexSculpt properties
- moved target component Transforms to UMeshSculptToolBase
- moved Brush Frames to UMeshSculptToolBase. Now storing Frames instead of Point+Normal, moved functions to update position for various stamp types
- UMeshSculptToolBase now has API for hit-testing against Sculpt and Base mesh, VertexSculpt implements
- UMeshSculptToolBase now has APIs for accessing transforms, current DMesh and BaseMesh, active stroke Depth/Strength/Falloff properties,
- moved Brush Target Plane (eg for Move), Stamp Plane (eg for Flatten), and StrokePlane (eg for Plane brushes) to UMeshSculptToolBase, and relevant calcuation APIs
- base USculptBrushProperties now has Lazyness parameter, implemented lazy-brush in base sculpt tool
#rb none
#rnx
#ROBOMERGE-SOURCE: CL 13044097 via CL 13044098 via CL 13044099
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v686-13045012)
[CL 13048205 by ryan schmidt in Main branch]
2020-04-27 12:51:59 -04:00
MakeUnique < TBasicMeshSculptBrushOpFactory < FPlaneBrushOp > > ( ) ,
NewObject < UViewAlignedPlaneBrushOpProps > ( this ) ) ;
2021-10-28 13:24:28 -04:00
RegisterBrushType ( ( int32 ) EMeshVertexSculptBrushType : : FixedPlane , LOCTEXT ( " FixedPlane " , " PlaneW " ) ,
ModelingTools: Ongoing Sculpting improvements:
- new UMeshSculptBrushOpProps baseclass for per-BrushOp Property Sets, added such a PropertySet for each BrushOp
- separate Strength/Depth/Falloff for each BrushOp so that they can have different settings. Currently cannot be in a shared base PropSet class because of different UProp Category strings
- UMeshSculptToolBase now supports registering BrushOp factory paired w/ ToolProps, rewrote VertexSculpt to use this to handle switching active BrushOp and visible PropSet
- removed UPlaneBrushProperties, vertex sculpt no longer uses USculptMaxBrushProperties (still used by dynamic sculpt)
- moved UMeshSurfacePointTool implementation up to UMeshSculptToolBase
- UMeshSculptToolBase now has OnBeginStroke() / OnEndStroke()API for subclasses to use to handle stroke (instead of overriding drag functions)
- Moved some setup to UMeshSculptToolBase. It can now initializes the target Component, can apply to Simple or Octree variants,
- moved Primary/Secondary BrushOp and active Falloff to UMeshSculptToolBase
- Support for various falloff types implemented in StampFalloffs.h, new EMeshSculptFalloffType exposed in VertexSculpt properties
- moved target component Transforms to UMeshSculptToolBase
- moved Brush Frames to UMeshSculptToolBase. Now storing Frames instead of Point+Normal, moved functions to update position for various stamp types
- UMeshSculptToolBase now has API for hit-testing against Sculpt and Base mesh, VertexSculpt implements
- UMeshSculptToolBase now has APIs for accessing transforms, current DMesh and BaseMesh, active stroke Depth/Strength/Falloff properties,
- moved Brush Target Plane (eg for Move), Stamp Plane (eg for Flatten), and StrokePlane (eg for Plane brushes) to UMeshSculptToolBase, and relevant calcuation APIs
- base USculptBrushProperties now has Lazyness parameter, implemented lazy-brush in base sculpt tool
#rb none
#rnx
#ROBOMERGE-SOURCE: CL 13044097 via CL 13044098 via CL 13044099
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v686-13045012)
[CL 13048205 by ryan schmidt in Main branch]
2020-04-27 12:51:59 -04:00
MakeUnique < TBasicMeshSculptBrushOpFactory < FPlaneBrushOp > > ( ) ,
NewObject < UFixedPlaneBrushOpProps > ( this ) ) ;
2021-10-28 13:24:28 -04:00
RegisterBrushType ( ( int32 ) EMeshVertexSculptBrushType : : ScaleKelvin , LOCTEXT ( " ScaleKelvin " , " Scale " ) ,
2020-09-01 14:07:48 -04:00
MakeUnique < TBasicMeshSculptBrushOpFactory < FScaleKelvinletBrushOp > > ( ) ,
NewObject < UScaleKelvinletBrushOpProps > ( this ) ) ;
2021-10-28 13:24:28 -04:00
RegisterBrushType ( ( int32 ) EMeshVertexSculptBrushType : : PullKelvin , LOCTEXT ( " PullKelvin " , " Grab " ) ,
2020-09-01 14:07:48 -04:00
MakeUnique < TBasicMeshSculptBrushOpFactory < FPullKelvinletBrushOp > > ( ) ,
NewObject < UPullKelvinletBrushOpProps > ( this ) ) ;
2021-10-28 13:24:28 -04:00
RegisterBrushType ( ( int32 ) EMeshVertexSculptBrushType : : PullSharpKelvin , LOCTEXT ( " PullSharpKelvin " , " GrabSharp " ) ,
2020-09-01 14:07:48 -04:00
MakeUnique < TBasicMeshSculptBrushOpFactory < FSharpPullKelvinletBrushOp > > ( ) ,
NewObject < USharpPullKelvinletBrushOpProps > ( this ) ) ;
2021-10-28 13:24:28 -04:00
RegisterBrushType ( ( int32 ) EMeshVertexSculptBrushType : : TwistKelvin , LOCTEXT ( " TwistKelvin " , " Twist " ) ,
2020-09-01 14:07:48 -04:00
MakeUnique < TBasicMeshSculptBrushOpFactory < FTwistKelvinletBrushOp > > ( ) ,
NewObject < UTwistKelvinletBrushOpProps > ( this ) ) ;
ModelingTools: Ongoing Sculpting improvements:
- new UMeshSculptBrushOpProps baseclass for per-BrushOp Property Sets, added such a PropertySet for each BrushOp
- separate Strength/Depth/Falloff for each BrushOp so that they can have different settings. Currently cannot be in a shared base PropSet class because of different UProp Category strings
- UMeshSculptToolBase now supports registering BrushOp factory paired w/ ToolProps, rewrote VertexSculpt to use this to handle switching active BrushOp and visible PropSet
- removed UPlaneBrushProperties, vertex sculpt no longer uses USculptMaxBrushProperties (still used by dynamic sculpt)
- moved UMeshSurfacePointTool implementation up to UMeshSculptToolBase
- UMeshSculptToolBase now has OnBeginStroke() / OnEndStroke()API for subclasses to use to handle stroke (instead of overriding drag functions)
- Moved some setup to UMeshSculptToolBase. It can now initializes the target Component, can apply to Simple or Octree variants,
- moved Primary/Secondary BrushOp and active Falloff to UMeshSculptToolBase
- Support for various falloff types implemented in StampFalloffs.h, new EMeshSculptFalloffType exposed in VertexSculpt properties
- moved target component Transforms to UMeshSculptToolBase
- moved Brush Frames to UMeshSculptToolBase. Now storing Frames instead of Point+Normal, moved functions to update position for various stamp types
- UMeshSculptToolBase now has API for hit-testing against Sculpt and Base mesh, VertexSculpt implements
- UMeshSculptToolBase now has APIs for accessing transforms, current DMesh and BaseMesh, active stroke Depth/Strength/Falloff properties,
- moved Brush Target Plane (eg for Move), Stamp Plane (eg for Flatten), and StrokePlane (eg for Plane brushes) to UMeshSculptToolBase, and relevant calcuation APIs
- base USculptBrushProperties now has Lazyness parameter, implemented lazy-brush in base sculpt tool
#rb none
#rnx
#ROBOMERGE-SOURCE: CL 13044097 via CL 13044098 via CL 13044099
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v686-13045012)
[CL 13048205 by ryan schmidt in Main branch]
2020-04-27 12:51:59 -04:00
// secondary brushes
2021-10-28 13:24:28 -04:00
RegisterSecondaryBrushType ( ( int32 ) EMeshVertexSculptBrushType : : Smooth , LOCTEXT ( " Smooth " , " Smooth " ) ,
ModelingTools: Ongoing Sculpting improvements:
- new UMeshSculptBrushOpProps baseclass for per-BrushOp Property Sets, added such a PropertySet for each BrushOp
- separate Strength/Depth/Falloff for each BrushOp so that they can have different settings. Currently cannot be in a shared base PropSet class because of different UProp Category strings
- UMeshSculptToolBase now supports registering BrushOp factory paired w/ ToolProps, rewrote VertexSculpt to use this to handle switching active BrushOp and visible PropSet
- removed UPlaneBrushProperties, vertex sculpt no longer uses USculptMaxBrushProperties (still used by dynamic sculpt)
- moved UMeshSurfacePointTool implementation up to UMeshSculptToolBase
- UMeshSculptToolBase now has OnBeginStroke() / OnEndStroke()API for subclasses to use to handle stroke (instead of overriding drag functions)
- Moved some setup to UMeshSculptToolBase. It can now initializes the target Component, can apply to Simple or Octree variants,
- moved Primary/Secondary BrushOp and active Falloff to UMeshSculptToolBase
- Support for various falloff types implemented in StampFalloffs.h, new EMeshSculptFalloffType exposed in VertexSculpt properties
- moved target component Transforms to UMeshSculptToolBase
- moved Brush Frames to UMeshSculptToolBase. Now storing Frames instead of Point+Normal, moved functions to update position for various stamp types
- UMeshSculptToolBase now has API for hit-testing against Sculpt and Base mesh, VertexSculpt implements
- UMeshSculptToolBase now has APIs for accessing transforms, current DMesh and BaseMesh, active stroke Depth/Strength/Falloff properties,
- moved Brush Target Plane (eg for Move), Stamp Plane (eg for Flatten), and StrokePlane (eg for Plane brushes) to UMeshSculptToolBase, and relevant calcuation APIs
- base USculptBrushProperties now has Lazyness parameter, implemented lazy-brush in base sculpt tool
#rb none
#rnx
#ROBOMERGE-SOURCE: CL 13044097 via CL 13044098 via CL 13044099
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v686-13045012)
[CL 13048205 by ryan schmidt in Main branch]
2020-04-27 12:51:59 -04:00
MakeUnique < TBasicMeshSculptBrushOpFactory < FSmoothBrushOp > > ( ) ,
NewObject < USecondarySmoothBrushOpProps > ( this ) ) ;
2020-04-18 18:42:59 -04:00
2021-10-28 13:24:28 -04:00
// falloffs
RegisterStandardFalloffTypes ( ) ;
2020-04-18 18:42:59 -04:00
AddToolPropertySource ( UMeshSculptToolBase : : GizmoProperties ) ;
SetToolPropertySourceEnabled ( UMeshSculptToolBase : : GizmoProperties , false ) ;
AddToolPropertySource ( UMeshSculptToolBase : : ViewProperties ) ;
// register watchers
ModelingTools: Ongoing Sculpting improvements:
- new UMeshSculptBrushOpProps baseclass for per-BrushOp Property Sets, added such a PropertySet for each BrushOp
- separate Strength/Depth/Falloff for each BrushOp so that they can have different settings. Currently cannot be in a shared base PropSet class because of different UProp Category strings
- UMeshSculptToolBase now supports registering BrushOp factory paired w/ ToolProps, rewrote VertexSculpt to use this to handle switching active BrushOp and visible PropSet
- removed UPlaneBrushProperties, vertex sculpt no longer uses USculptMaxBrushProperties (still used by dynamic sculpt)
- moved UMeshSurfacePointTool implementation up to UMeshSculptToolBase
- UMeshSculptToolBase now has OnBeginStroke() / OnEndStroke()API for subclasses to use to handle stroke (instead of overriding drag functions)
- Moved some setup to UMeshSculptToolBase. It can now initializes the target Component, can apply to Simple or Octree variants,
- moved Primary/Secondary BrushOp and active Falloff to UMeshSculptToolBase
- Support for various falloff types implemented in StampFalloffs.h, new EMeshSculptFalloffType exposed in VertexSculpt properties
- moved target component Transforms to UMeshSculptToolBase
- moved Brush Frames to UMeshSculptToolBase. Now storing Frames instead of Point+Normal, moved functions to update position for various stamp types
- UMeshSculptToolBase now has API for hit-testing against Sculpt and Base mesh, VertexSculpt implements
- UMeshSculptToolBase now has APIs for accessing transforms, current DMesh and BaseMesh, active stroke Depth/Strength/Falloff properties,
- moved Brush Target Plane (eg for Move), Stamp Plane (eg for Flatten), and StrokePlane (eg for Plane brushes) to UMeshSculptToolBase, and relevant calcuation APIs
- base USculptBrushProperties now has Lazyness parameter, implemented lazy-brush in base sculpt tool
#rb none
#rnx
#ROBOMERGE-SOURCE: CL 13044097 via CL 13044098 via CL 13044099
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v686-13045012)
[CL 13048205 by ryan schmidt in Main branch]
2020-04-27 12:51:59 -04:00
SculptProperties - > WatchProperty ( SculptProperties - > PrimaryBrushType ,
[ this ] ( EMeshVertexSculptBrushType NewType ) { UpdateBrushType ( NewType ) ; } ) ;
2020-04-18 18:42:59 -04:00
ModelingTools: Ongoing Sculpting improvements:
- new UMeshSculptBrushOpProps baseclass for per-BrushOp Property Sets, added such a PropertySet for each BrushOp
- separate Strength/Depth/Falloff for each BrushOp so that they can have different settings. Currently cannot be in a shared base PropSet class because of different UProp Category strings
- UMeshSculptToolBase now supports registering BrushOp factory paired w/ ToolProps, rewrote VertexSculpt to use this to handle switching active BrushOp and visible PropSet
- removed UPlaneBrushProperties, vertex sculpt no longer uses USculptMaxBrushProperties (still used by dynamic sculpt)
- moved UMeshSurfacePointTool implementation up to UMeshSculptToolBase
- UMeshSculptToolBase now has OnBeginStroke() / OnEndStroke()API for subclasses to use to handle stroke (instead of overriding drag functions)
- Moved some setup to UMeshSculptToolBase. It can now initializes the target Component, can apply to Simple or Octree variants,
- moved Primary/Secondary BrushOp and active Falloff to UMeshSculptToolBase
- Support for various falloff types implemented in StampFalloffs.h, new EMeshSculptFalloffType exposed in VertexSculpt properties
- moved target component Transforms to UMeshSculptToolBase
- moved Brush Frames to UMeshSculptToolBase. Now storing Frames instead of Point+Normal, moved functions to update position for various stamp types
- UMeshSculptToolBase now has API for hit-testing against Sculpt and Base mesh, VertexSculpt implements
- UMeshSculptToolBase now has APIs for accessing transforms, current DMesh and BaseMesh, active stroke Depth/Strength/Falloff properties,
- moved Brush Target Plane (eg for Move), Stamp Plane (eg for Flatten), and StrokePlane (eg for Plane brushes) to UMeshSculptToolBase, and relevant calcuation APIs
- base USculptBrushProperties now has Lazyness parameter, implemented lazy-brush in base sculpt tool
#rb none
#rnx
#ROBOMERGE-SOURCE: CL 13044097 via CL 13044098 via CL 13044099
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v686-13045012)
[CL 13048205 by ryan schmidt in Main branch]
2020-04-27 12:51:59 -04:00
SculptProperties - > WatchProperty ( SculptProperties - > PrimaryFalloffType ,
[ this ] ( EMeshSculptFalloffType NewType ) { SetPrimaryFalloffType ( NewType ) ; } ) ;
2020-04-18 18:42:59 -04:00
2021-01-31 20:16:41 -04:00
SculptProperties - > WatchProperty ( AlphaProperties - > Alpha ,
[ this ] ( UTexture2D * NewAlpha ) { UpdateBrushAlpha ( AlphaProperties - > Alpha ) ; } ) ;
ModelingTools: Ongoing Sculpting improvements:
- new UMeshSculptBrushOpProps baseclass for per-BrushOp Property Sets, added such a PropertySet for each BrushOp
- separate Strength/Depth/Falloff for each BrushOp so that they can have different settings. Currently cannot be in a shared base PropSet class because of different UProp Category strings
- UMeshSculptToolBase now supports registering BrushOp factory paired w/ ToolProps, rewrote VertexSculpt to use this to handle switching active BrushOp and visible PropSet
- removed UPlaneBrushProperties, vertex sculpt no longer uses USculptMaxBrushProperties (still used by dynamic sculpt)
- moved UMeshSurfacePointTool implementation up to UMeshSculptToolBase
- UMeshSculptToolBase now has OnBeginStroke() / OnEndStroke()API for subclasses to use to handle stroke (instead of overriding drag functions)
- Moved some setup to UMeshSculptToolBase. It can now initializes the target Component, can apply to Simple or Octree variants,
- moved Primary/Secondary BrushOp and active Falloff to UMeshSculptToolBase
- Support for various falloff types implemented in StampFalloffs.h, new EMeshSculptFalloffType exposed in VertexSculpt properties
- moved target component Transforms to UMeshSculptToolBase
- moved Brush Frames to UMeshSculptToolBase. Now storing Frames instead of Point+Normal, moved functions to update position for various stamp types
- UMeshSculptToolBase now has API for hit-testing against Sculpt and Base mesh, VertexSculpt implements
- UMeshSculptToolBase now has APIs for accessing transforms, current DMesh and BaseMesh, active stroke Depth/Strength/Falloff properties,
- moved Brush Target Plane (eg for Move), Stamp Plane (eg for Flatten), and StrokePlane (eg for Plane brushes) to UMeshSculptToolBase, and relevant calcuation APIs
- base USculptBrushProperties now has Lazyness parameter, implemented lazy-brush in base sculpt tool
#rb none
#rnx
#ROBOMERGE-SOURCE: CL 13044097 via CL 13044098 via CL 13044099
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v686-13045012)
[CL 13048205 by ryan schmidt in Main branch]
2020-04-27 12:51:59 -04:00
// must call before updating brush type so that we register all brush properties?
UMeshSculptToolBase : : OnCompleteSetup ( ) ;
2020-04-18 18:42:59 -04:00
UpdateBrushType ( SculptProperties - > PrimaryBrushType ) ;
2021-01-31 20:16:41 -04:00
SetPrimaryFalloffType ( SculptProperties - > PrimaryFalloffType ) ;
UpdateBrushAlpha ( AlphaProperties - > Alpha ) ;
ModelingTools: Ongoing Sculpting improvements:
- new UMeshSculptBrushOpProps baseclass for per-BrushOp Property Sets, added such a PropertySet for each BrushOp
- separate Strength/Depth/Falloff for each BrushOp so that they can have different settings. Currently cannot be in a shared base PropSet class because of different UProp Category strings
- UMeshSculptToolBase now supports registering BrushOp factory paired w/ ToolProps, rewrote VertexSculpt to use this to handle switching active BrushOp and visible PropSet
- removed UPlaneBrushProperties, vertex sculpt no longer uses USculptMaxBrushProperties (still used by dynamic sculpt)
- moved UMeshSurfacePointTool implementation up to UMeshSculptToolBase
- UMeshSculptToolBase now has OnBeginStroke() / OnEndStroke()API for subclasses to use to handle stroke (instead of overriding drag functions)
- Moved some setup to UMeshSculptToolBase. It can now initializes the target Component, can apply to Simple or Octree variants,
- moved Primary/Secondary BrushOp and active Falloff to UMeshSculptToolBase
- Support for various falloff types implemented in StampFalloffs.h, new EMeshSculptFalloffType exposed in VertexSculpt properties
- moved target component Transforms to UMeshSculptToolBase
- moved Brush Frames to UMeshSculptToolBase. Now storing Frames instead of Point+Normal, moved functions to update position for various stamp types
- UMeshSculptToolBase now has API for hit-testing against Sculpt and Base mesh, VertexSculpt implements
- UMeshSculptToolBase now has APIs for accessing transforms, current DMesh and BaseMesh, active stroke Depth/Strength/Falloff properties,
- moved Brush Target Plane (eg for Move), Stamp Plane (eg for Flatten), and StrokePlane (eg for Plane brushes) to UMeshSculptToolBase, and relevant calcuation APIs
- base USculptBrushProperties now has Lazyness parameter, implemented lazy-brush in base sculpt tool
#rb none
#rnx
#ROBOMERGE-SOURCE: CL 13044097 via CL 13044098 via CL 13044099
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v686-13045012)
[CL 13048205 by ryan schmidt in Main branch]
2020-04-27 12:51:59 -04:00
SetActiveSecondaryBrushType ( ( int32 ) EMeshVertexSculptBrushType : : Smooth ) ;
2021-01-31 20:16:41 -04:00
StampRandomStream = FRandomStream ( 31337 ) ;
2020-04-18 18:42:59 -04:00
}
void UMeshVertexSculptTool : : Shutdown ( EToolShutdownType ShutdownType )
{
if ( DynamicMeshComponent ! = nullptr )
{
DynamicMeshComponent - > OnMeshChanged . Remove ( OnDynamicMeshComponentChangedHandle ) ;
}
SculptProperties - > SaveProperties ( this ) ;
2021-01-31 20:16:41 -04:00
AlphaProperties - > SaveProperties ( this ) ;
ModelingTools: Ongoing Sculpting improvements:
- new UMeshSculptBrushOpProps baseclass for per-BrushOp Property Sets, added such a PropertySet for each BrushOp
- separate Strength/Depth/Falloff for each BrushOp so that they can have different settings. Currently cannot be in a shared base PropSet class because of different UProp Category strings
- UMeshSculptToolBase now supports registering BrushOp factory paired w/ ToolProps, rewrote VertexSculpt to use this to handle switching active BrushOp and visible PropSet
- removed UPlaneBrushProperties, vertex sculpt no longer uses USculptMaxBrushProperties (still used by dynamic sculpt)
- moved UMeshSurfacePointTool implementation up to UMeshSculptToolBase
- UMeshSculptToolBase now has OnBeginStroke() / OnEndStroke()API for subclasses to use to handle stroke (instead of overriding drag functions)
- Moved some setup to UMeshSculptToolBase. It can now initializes the target Component, can apply to Simple or Octree variants,
- moved Primary/Secondary BrushOp and active Falloff to UMeshSculptToolBase
- Support for various falloff types implemented in StampFalloffs.h, new EMeshSculptFalloffType exposed in VertexSculpt properties
- moved target component Transforms to UMeshSculptToolBase
- moved Brush Frames to UMeshSculptToolBase. Now storing Frames instead of Point+Normal, moved functions to update position for various stamp types
- UMeshSculptToolBase now has API for hit-testing against Sculpt and Base mesh, VertexSculpt implements
- UMeshSculptToolBase now has APIs for accessing transforms, current DMesh and BaseMesh, active stroke Depth/Strength/Falloff properties,
- moved Brush Target Plane (eg for Move), Stamp Plane (eg for Flatten), and StrokePlane (eg for Plane brushes) to UMeshSculptToolBase, and relevant calcuation APIs
- base USculptBrushProperties now has Lazyness parameter, implemented lazy-brush in base sculpt tool
#rb none
#rnx
#ROBOMERGE-SOURCE: CL 13044097 via CL 13044098 via CL 13044099
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v686-13045012)
[CL 13048205 by ryan schmidt in Main branch]
2020-04-27 12:51:59 -04:00
2021-11-18 14:37:34 -05:00
if ( PreviewMeshActor ! = nullptr )
{
PreviewMeshActor - > Destroy ( ) ;
PreviewMeshActor = nullptr ;
}
ModelingTools: Ongoing Sculpting improvements:
- new UMeshSculptBrushOpProps baseclass for per-BrushOp Property Sets, added such a PropertySet for each BrushOp
- separate Strength/Depth/Falloff for each BrushOp so that they can have different settings. Currently cannot be in a shared base PropSet class because of different UProp Category strings
- UMeshSculptToolBase now supports registering BrushOp factory paired w/ ToolProps, rewrote VertexSculpt to use this to handle switching active BrushOp and visible PropSet
- removed UPlaneBrushProperties, vertex sculpt no longer uses USculptMaxBrushProperties (still used by dynamic sculpt)
- moved UMeshSurfacePointTool implementation up to UMeshSculptToolBase
- UMeshSculptToolBase now has OnBeginStroke() / OnEndStroke()API for subclasses to use to handle stroke (instead of overriding drag functions)
- Moved some setup to UMeshSculptToolBase. It can now initializes the target Component, can apply to Simple or Octree variants,
- moved Primary/Secondary BrushOp and active Falloff to UMeshSculptToolBase
- Support for various falloff types implemented in StampFalloffs.h, new EMeshSculptFalloffType exposed in VertexSculpt properties
- moved target component Transforms to UMeshSculptToolBase
- moved Brush Frames to UMeshSculptToolBase. Now storing Frames instead of Point+Normal, moved functions to update position for various stamp types
- UMeshSculptToolBase now has API for hit-testing against Sculpt and Base mesh, VertexSculpt implements
- UMeshSculptToolBase now has APIs for accessing transforms, current DMesh and BaseMesh, active stroke Depth/Strength/Falloff properties,
- moved Brush Target Plane (eg for Move), Stamp Plane (eg for Flatten), and StrokePlane (eg for Plane brushes) to UMeshSculptToolBase, and relevant calcuation APIs
- base USculptBrushProperties now has Lazyness parameter, implemented lazy-brush in base sculpt tool
#rb none
#rnx
#ROBOMERGE-SOURCE: CL 13044097 via CL 13044098 via CL 13044099
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v686-13045012)
[CL 13048205 by ryan schmidt in Main branch]
2020-04-27 12:51:59 -04:00
// this call will commit result, unregister and destroy DynamicMeshComponent
UMeshSculptToolBase : : Shutdown ( ShutdownType ) ;
2020-04-18 18:42:59 -04:00
}
void UMeshVertexSculptTool : : OnPropertyModified ( UObject * PropertySet , FProperty * Property )
{
CalculateBrushRadius ( ) ;
}
2021-12-06 15:44:16 -05:00
UPreviewMesh * UMeshVertexSculptTool : : MakeBrushIndicatorMesh ( UObject * Parent , UWorld * World )
{
UPreviewMesh * PlaneMesh = NewObject < UPreviewMesh > ( Parent ) ;
PlaneMesh - > CreateInWorld ( World , FTransform : : Identity ) ;
FRectangleMeshGenerator RectGen ;
RectGen . Width = RectGen . Height = 2.0 ;
RectGen . WidthVertexCount = RectGen . HeightVertexCount = 1 ;
FDynamicMesh3 Mesh ( & RectGen . Generate ( ) ) ;
FDynamicMeshUVOverlay * UVOverlay = Mesh . Attributes ( ) - > PrimaryUV ( ) ;
// configure UVs to be in same space as texture pixels when mapped into brush frame (??)
for ( int32 eid : UVOverlay - > ElementIndicesItr ( ) )
{
FVector2f UV = UVOverlay - > GetElement ( eid ) ;
UV . X = 1.0 - UV . X ;
UV . Y = 1.0 - UV . Y ;
UVOverlay - > SetElement ( eid , UV ) ;
}
PlaneMesh - > UpdatePreview ( & Mesh ) ;
BrushIndicatorMaterial = ToolSetupUtil : : GetDefaultBrushAlphaMaterial ( GetToolManager ( ) ) ;
if ( BrushIndicatorMaterial )
{
PlaneMesh - > SetMaterial ( BrushIndicatorMaterial ) ;
}
return PlaneMesh ;
}
void UMeshVertexSculptTool : : InitializeIndicator ( )
{
UMeshSculptToolBase : : InitializeIndicator ( ) ;
// want to draw radius
BrushIndicator - > bDrawRadiusCircle = true ;
}
2021-10-28 13:24:28 -04:00
void UMeshVertexSculptTool : : SetActiveBrushType ( int32 Identifier )
{
EMeshVertexSculptBrushType NewBrushType = static_cast < EMeshVertexSculptBrushType > ( Identifier ) ;
if ( SculptProperties - > PrimaryBrushType ! = NewBrushType )
{
SculptProperties - > PrimaryBrushType = NewBrushType ;
UpdateBrushType ( SculptProperties - > PrimaryBrushType ) ;
SculptProperties - > SilentUpdateWatched ( ) ;
}
// this forces full rebuild of properties panel (!!)
//this->NotifyOfPropertyChangeByTool(SculptProperties);
}
void UMeshVertexSculptTool : : SetActiveFalloffType ( int32 Identifier )
{
EMeshSculptFalloffType NewFalloffType = static_cast < EMeshSculptFalloffType > ( Identifier ) ;
if ( SculptProperties - > PrimaryFalloffType ! = NewFalloffType )
{
SculptProperties - > PrimaryFalloffType = NewFalloffType ;
SetPrimaryFalloffType ( SculptProperties - > PrimaryFalloffType ) ;
SculptProperties - > SilentUpdateWatched ( ) ;
}
// this forces full rebuild of properties panel (!!)
//this->NotifyOfPropertyChangeByTool(SculptProperties);
}
void UMeshVertexSculptTool : : SetRegionFilterType ( int32 Identifier )
{
SculptProperties - > BrushFilter = static_cast < EMeshVertexSculptBrushFilterType > ( Identifier ) ;
}
ModelingTools: Ongoing Sculpting improvements:
- new UMeshSculptBrushOpProps baseclass for per-BrushOp Property Sets, added such a PropertySet for each BrushOp
- separate Strength/Depth/Falloff for each BrushOp so that they can have different settings. Currently cannot be in a shared base PropSet class because of different UProp Category strings
- UMeshSculptToolBase now supports registering BrushOp factory paired w/ ToolProps, rewrote VertexSculpt to use this to handle switching active BrushOp and visible PropSet
- removed UPlaneBrushProperties, vertex sculpt no longer uses USculptMaxBrushProperties (still used by dynamic sculpt)
- moved UMeshSurfacePointTool implementation up to UMeshSculptToolBase
- UMeshSculptToolBase now has OnBeginStroke() / OnEndStroke()API for subclasses to use to handle stroke (instead of overriding drag functions)
- Moved some setup to UMeshSculptToolBase. It can now initializes the target Component, can apply to Simple or Octree variants,
- moved Primary/Secondary BrushOp and active Falloff to UMeshSculptToolBase
- Support for various falloff types implemented in StampFalloffs.h, new EMeshSculptFalloffType exposed in VertexSculpt properties
- moved target component Transforms to UMeshSculptToolBase
- moved Brush Frames to UMeshSculptToolBase. Now storing Frames instead of Point+Normal, moved functions to update position for various stamp types
- UMeshSculptToolBase now has API for hit-testing against Sculpt and Base mesh, VertexSculpt implements
- UMeshSculptToolBase now has APIs for accessing transforms, current DMesh and BaseMesh, active stroke Depth/Strength/Falloff properties,
- moved Brush Target Plane (eg for Move), Stamp Plane (eg for Flatten), and StrokePlane (eg for Plane brushes) to UMeshSculptToolBase, and relevant calcuation APIs
- base USculptBrushProperties now has Lazyness parameter, implemented lazy-brush in base sculpt tool
#rb none
#rnx
#ROBOMERGE-SOURCE: CL 13044097 via CL 13044098 via CL 13044099
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v686-13045012)
[CL 13048205 by ryan schmidt in Main branch]
2020-04-27 12:51:59 -04:00
void UMeshVertexSculptTool : : OnBeginStroke ( const FRay & WorldRay )
2020-04-18 18:42:59 -04:00
{
2021-02-03 02:52:36 -04:00
WaitForPendingUndoRedo ( ) ; // cannot start stroke if there is an outstanding undo/redo update
ModelingTools: Ongoing Sculpting improvements:
- new UMeshSculptBrushOpProps baseclass for per-BrushOp Property Sets, added such a PropertySet for each BrushOp
- separate Strength/Depth/Falloff for each BrushOp so that they can have different settings. Currently cannot be in a shared base PropSet class because of different UProp Category strings
- UMeshSculptToolBase now supports registering BrushOp factory paired w/ ToolProps, rewrote VertexSculpt to use this to handle switching active BrushOp and visible PropSet
- removed UPlaneBrushProperties, vertex sculpt no longer uses USculptMaxBrushProperties (still used by dynamic sculpt)
- moved UMeshSurfacePointTool implementation up to UMeshSculptToolBase
- UMeshSculptToolBase now has OnBeginStroke() / OnEndStroke()API for subclasses to use to handle stroke (instead of overriding drag functions)
- Moved some setup to UMeshSculptToolBase. It can now initializes the target Component, can apply to Simple or Octree variants,
- moved Primary/Secondary BrushOp and active Falloff to UMeshSculptToolBase
- Support for various falloff types implemented in StampFalloffs.h, new EMeshSculptFalloffType exposed in VertexSculpt properties
- moved target component Transforms to UMeshSculptToolBase
- moved Brush Frames to UMeshSculptToolBase. Now storing Frames instead of Point+Normal, moved functions to update position for various stamp types
- UMeshSculptToolBase now has API for hit-testing against Sculpt and Base mesh, VertexSculpt implements
- UMeshSculptToolBase now has APIs for accessing transforms, current DMesh and BaseMesh, active stroke Depth/Strength/Falloff properties,
- moved Brush Target Plane (eg for Move), Stamp Plane (eg for Flatten), and StrokePlane (eg for Plane brushes) to UMeshSculptToolBase, and relevant calcuation APIs
- base USculptBrushProperties now has Lazyness parameter, implemented lazy-brush in base sculpt tool
#rb none
#rnx
#ROBOMERGE-SOURCE: CL 13044097 via CL 13044098 via CL 13044099
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v686-13045012)
[CL 13048205 by ryan schmidt in Main branch]
2020-04-27 12:51:59 -04:00
UpdateBrushPosition ( WorldRay ) ;
2020-04-18 18:42:59 -04:00
ModelingTools: Ongoing Sculpting improvements:
- new UMeshSculptBrushOpProps baseclass for per-BrushOp Property Sets, added such a PropertySet for each BrushOp
- separate Strength/Depth/Falloff for each BrushOp so that they can have different settings. Currently cannot be in a shared base PropSet class because of different UProp Category strings
- UMeshSculptToolBase now supports registering BrushOp factory paired w/ ToolProps, rewrote VertexSculpt to use this to handle switching active BrushOp and visible PropSet
- removed UPlaneBrushProperties, vertex sculpt no longer uses USculptMaxBrushProperties (still used by dynamic sculpt)
- moved UMeshSurfacePointTool implementation up to UMeshSculptToolBase
- UMeshSculptToolBase now has OnBeginStroke() / OnEndStroke()API for subclasses to use to handle stroke (instead of overriding drag functions)
- Moved some setup to UMeshSculptToolBase. It can now initializes the target Component, can apply to Simple or Octree variants,
- moved Primary/Secondary BrushOp and active Falloff to UMeshSculptToolBase
- Support for various falloff types implemented in StampFalloffs.h, new EMeshSculptFalloffType exposed in VertexSculpt properties
- moved target component Transforms to UMeshSculptToolBase
- moved Brush Frames to UMeshSculptToolBase. Now storing Frames instead of Point+Normal, moved functions to update position for various stamp types
- UMeshSculptToolBase now has API for hit-testing against Sculpt and Base mesh, VertexSculpt implements
- UMeshSculptToolBase now has APIs for accessing transforms, current DMesh and BaseMesh, active stroke Depth/Strength/Falloff properties,
- moved Brush Target Plane (eg for Move), Stamp Plane (eg for Flatten), and StrokePlane (eg for Plane brushes) to UMeshSculptToolBase, and relevant calcuation APIs
- base USculptBrushProperties now has Lazyness parameter, implemented lazy-brush in base sculpt tool
#rb none
#rnx
#ROBOMERGE-SOURCE: CL 13044097 via CL 13044098 via CL 13044099
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v686-13045012)
[CL 13048205 by ryan schmidt in Main branch]
2020-04-27 12:51:59 -04:00
if ( SculptProperties - > PrimaryBrushType = = EMeshVertexSculptBrushType : : Plane | |
SculptProperties - > PrimaryBrushType = = EMeshVertexSculptBrushType : : PlaneViewAligned )
2020-04-18 18:42:59 -04:00
{
ModelingTools: Ongoing Sculpting improvements:
- new UMeshSculptBrushOpProps baseclass for per-BrushOp Property Sets, added such a PropertySet for each BrushOp
- separate Strength/Depth/Falloff for each BrushOp so that they can have different settings. Currently cannot be in a shared base PropSet class because of different UProp Category strings
- UMeshSculptToolBase now supports registering BrushOp factory paired w/ ToolProps, rewrote VertexSculpt to use this to handle switching active BrushOp and visible PropSet
- removed UPlaneBrushProperties, vertex sculpt no longer uses USculptMaxBrushProperties (still used by dynamic sculpt)
- moved UMeshSurfacePointTool implementation up to UMeshSculptToolBase
- UMeshSculptToolBase now has OnBeginStroke() / OnEndStroke()API for subclasses to use to handle stroke (instead of overriding drag functions)
- Moved some setup to UMeshSculptToolBase. It can now initializes the target Component, can apply to Simple or Octree variants,
- moved Primary/Secondary BrushOp and active Falloff to UMeshSculptToolBase
- Support for various falloff types implemented in StampFalloffs.h, new EMeshSculptFalloffType exposed in VertexSculpt properties
- moved target component Transforms to UMeshSculptToolBase
- moved Brush Frames to UMeshSculptToolBase. Now storing Frames instead of Point+Normal, moved functions to update position for various stamp types
- UMeshSculptToolBase now has API for hit-testing against Sculpt and Base mesh, VertexSculpt implements
- UMeshSculptToolBase now has APIs for accessing transforms, current DMesh and BaseMesh, active stroke Depth/Strength/Falloff properties,
- moved Brush Target Plane (eg for Move), Stamp Plane (eg for Flatten), and StrokePlane (eg for Plane brushes) to UMeshSculptToolBase, and relevant calcuation APIs
- base USculptBrushProperties now has Lazyness parameter, implemented lazy-brush in base sculpt tool
#rb none
#rnx
#ROBOMERGE-SOURCE: CL 13044097 via CL 13044098 via CL 13044099
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v686-13045012)
[CL 13048205 by ryan schmidt in Main branch]
2020-04-27 12:51:59 -04:00
UpdateROI ( GetBrushFrameLocal ( ) . Origin ) ;
2021-01-31 20:16:41 -04:00
UpdateStrokeReferencePlaneForROI ( GetBrushFrameLocal ( ) , TriangleROIArray ,
ModelingTools: Ongoing Sculpting improvements:
- new UMeshSculptBrushOpProps baseclass for per-BrushOp Property Sets, added such a PropertySet for each BrushOp
- separate Strength/Depth/Falloff for each BrushOp so that they can have different settings. Currently cannot be in a shared base PropSet class because of different UProp Category strings
- UMeshSculptToolBase now supports registering BrushOp factory paired w/ ToolProps, rewrote VertexSculpt to use this to handle switching active BrushOp and visible PropSet
- removed UPlaneBrushProperties, vertex sculpt no longer uses USculptMaxBrushProperties (still used by dynamic sculpt)
- moved UMeshSurfacePointTool implementation up to UMeshSculptToolBase
- UMeshSculptToolBase now has OnBeginStroke() / OnEndStroke()API for subclasses to use to handle stroke (instead of overriding drag functions)
- Moved some setup to UMeshSculptToolBase. It can now initializes the target Component, can apply to Simple or Octree variants,
- moved Primary/Secondary BrushOp and active Falloff to UMeshSculptToolBase
- Support for various falloff types implemented in StampFalloffs.h, new EMeshSculptFalloffType exposed in VertexSculpt properties
- moved target component Transforms to UMeshSculptToolBase
- moved Brush Frames to UMeshSculptToolBase. Now storing Frames instead of Point+Normal, moved functions to update position for various stamp types
- UMeshSculptToolBase now has API for hit-testing against Sculpt and Base mesh, VertexSculpt implements
- UMeshSculptToolBase now has APIs for accessing transforms, current DMesh and BaseMesh, active stroke Depth/Strength/Falloff properties,
- moved Brush Target Plane (eg for Move), Stamp Plane (eg for Flatten), and StrokePlane (eg for Plane brushes) to UMeshSculptToolBase, and relevant calcuation APIs
- base USculptBrushProperties now has Lazyness parameter, implemented lazy-brush in base sculpt tool
#rb none
#rnx
#ROBOMERGE-SOURCE: CL 13044097 via CL 13044098 via CL 13044099
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v686-13045012)
[CL 13048205 by ryan schmidt in Main branch]
2020-04-27 12:51:59 -04:00
( SculptProperties - > PrimaryBrushType = = EMeshVertexSculptBrushType : : PlaneViewAligned ) ) ;
2020-04-18 18:42:59 -04:00
}
ModelingTools: Ongoing Sculpting improvements:
- new UMeshSculptBrushOpProps baseclass for per-BrushOp Property Sets, added such a PropertySet for each BrushOp
- separate Strength/Depth/Falloff for each BrushOp so that they can have different settings. Currently cannot be in a shared base PropSet class because of different UProp Category strings
- UMeshSculptToolBase now supports registering BrushOp factory paired w/ ToolProps, rewrote VertexSculpt to use this to handle switching active BrushOp and visible PropSet
- removed UPlaneBrushProperties, vertex sculpt no longer uses USculptMaxBrushProperties (still used by dynamic sculpt)
- moved UMeshSurfacePointTool implementation up to UMeshSculptToolBase
- UMeshSculptToolBase now has OnBeginStroke() / OnEndStroke()API for subclasses to use to handle stroke (instead of overriding drag functions)
- Moved some setup to UMeshSculptToolBase. It can now initializes the target Component, can apply to Simple or Octree variants,
- moved Primary/Secondary BrushOp and active Falloff to UMeshSculptToolBase
- Support for various falloff types implemented in StampFalloffs.h, new EMeshSculptFalloffType exposed in VertexSculpt properties
- moved target component Transforms to UMeshSculptToolBase
- moved Brush Frames to UMeshSculptToolBase. Now storing Frames instead of Point+Normal, moved functions to update position for various stamp types
- UMeshSculptToolBase now has API for hit-testing against Sculpt and Base mesh, VertexSculpt implements
- UMeshSculptToolBase now has APIs for accessing transforms, current DMesh and BaseMesh, active stroke Depth/Strength/Falloff properties,
- moved Brush Target Plane (eg for Move), Stamp Plane (eg for Flatten), and StrokePlane (eg for Plane brushes) to UMeshSculptToolBase, and relevant calcuation APIs
- base USculptBrushProperties now has Lazyness parameter, implemented lazy-brush in base sculpt tool
#rb none
#rnx
#ROBOMERGE-SOURCE: CL 13044097 via CL 13044098 via CL 13044099
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v686-13045012)
[CL 13048205 by ryan schmidt in Main branch]
2020-04-27 12:51:59 -04:00
else if ( SculptProperties - > PrimaryBrushType = = EMeshVertexSculptBrushType : : FixedPlane )
{
UpdateStrokeReferencePlaneFromWorkPlane ( ) ;
}
// initialize first "Last Stamp", so that we can assume all stamps in stroke have a valid previous stamp
LastStamp . WorldFrame = GetBrushFrameWorld ( ) ;
LastStamp . LocalFrame = GetBrushFrameLocal ( ) ;
LastStamp . Radius = GetCurrentBrushRadius ( ) ;
LastStamp . Falloff = GetCurrentBrushFalloff ( ) ;
LastStamp . Direction = GetInInvertStroke ( ) ? - 1.0 : 1.0 ;
LastStamp . Depth = GetCurrentBrushDepth ( ) ;
LastStamp . Power = GetActivePressure ( ) * GetCurrentBrushStrength ( ) ;
LastStamp . TimeStamp = FDateTime : : Now ( ) ;
2021-03-02 19:23:29 -04:00
InitialStrokeTriangleID = - 1 ;
InitialStrokeTriangleID = GetBrushTriangleID ( ) ;
ModelingTools: Ongoing Sculpting improvements:
- new UMeshSculptBrushOpProps baseclass for per-BrushOp Property Sets, added such a PropertySet for each BrushOp
- separate Strength/Depth/Falloff for each BrushOp so that they can have different settings. Currently cannot be in a shared base PropSet class because of different UProp Category strings
- UMeshSculptToolBase now supports registering BrushOp factory paired w/ ToolProps, rewrote VertexSculpt to use this to handle switching active BrushOp and visible PropSet
- removed UPlaneBrushProperties, vertex sculpt no longer uses USculptMaxBrushProperties (still used by dynamic sculpt)
- moved UMeshSurfacePointTool implementation up to UMeshSculptToolBase
- UMeshSculptToolBase now has OnBeginStroke() / OnEndStroke()API for subclasses to use to handle stroke (instead of overriding drag functions)
- Moved some setup to UMeshSculptToolBase. It can now initializes the target Component, can apply to Simple or Octree variants,
- moved Primary/Secondary BrushOp and active Falloff to UMeshSculptToolBase
- Support for various falloff types implemented in StampFalloffs.h, new EMeshSculptFalloffType exposed in VertexSculpt properties
- moved target component Transforms to UMeshSculptToolBase
- moved Brush Frames to UMeshSculptToolBase. Now storing Frames instead of Point+Normal, moved functions to update position for various stamp types
- UMeshSculptToolBase now has API for hit-testing against Sculpt and Base mesh, VertexSculpt implements
- UMeshSculptToolBase now has APIs for accessing transforms, current DMesh and BaseMesh, active stroke Depth/Strength/Falloff properties,
- moved Brush Target Plane (eg for Move), Stamp Plane (eg for Flatten), and StrokePlane (eg for Plane brushes) to UMeshSculptToolBase, and relevant calcuation APIs
- base USculptBrushProperties now has Lazyness parameter, implemented lazy-brush in base sculpt tool
#rb none
#rnx
#ROBOMERGE-SOURCE: CL 13044097 via CL 13044098 via CL 13044099
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v686-13045012)
[CL 13048205 by ryan schmidt in Main branch]
2020-04-27 12:51:59 -04:00
FSculptBrushOptions SculptOptions ;
//SculptOptions.bPreserveUVFlow = false; // SculptProperties->bPreserveUVFlow;
SculptOptions . ConstantReferencePlane = GetCurrentStrokeReferencePlane ( ) ;
TUniquePtr < FMeshSculptBrushOp > & UseBrushOp = GetActiveBrushOp ( ) ;
UseBrushOp - > ConfigureOptions ( SculptOptions ) ;
UseBrushOp - > BeginStroke ( GetSculptMesh ( ) , LastStamp , VertexROI ) ;
AccumulatedTriangleROI . Reset ( ) ;
// begin change here? or wait for first stamp?
BeginChange ( ) ;
2020-04-18 18:42:59 -04:00
}
ModelingTools: Ongoing Sculpting improvements:
- new UMeshSculptBrushOpProps baseclass for per-BrushOp Property Sets, added such a PropertySet for each BrushOp
- separate Strength/Depth/Falloff for each BrushOp so that they can have different settings. Currently cannot be in a shared base PropSet class because of different UProp Category strings
- UMeshSculptToolBase now supports registering BrushOp factory paired w/ ToolProps, rewrote VertexSculpt to use this to handle switching active BrushOp and visible PropSet
- removed UPlaneBrushProperties, vertex sculpt no longer uses USculptMaxBrushProperties (still used by dynamic sculpt)
- moved UMeshSurfacePointTool implementation up to UMeshSculptToolBase
- UMeshSculptToolBase now has OnBeginStroke() / OnEndStroke()API for subclasses to use to handle stroke (instead of overriding drag functions)
- Moved some setup to UMeshSculptToolBase. It can now initializes the target Component, can apply to Simple or Octree variants,
- moved Primary/Secondary BrushOp and active Falloff to UMeshSculptToolBase
- Support for various falloff types implemented in StampFalloffs.h, new EMeshSculptFalloffType exposed in VertexSculpt properties
- moved target component Transforms to UMeshSculptToolBase
- moved Brush Frames to UMeshSculptToolBase. Now storing Frames instead of Point+Normal, moved functions to update position for various stamp types
- UMeshSculptToolBase now has API for hit-testing against Sculpt and Base mesh, VertexSculpt implements
- UMeshSculptToolBase now has APIs for accessing transforms, current DMesh and BaseMesh, active stroke Depth/Strength/Falloff properties,
- moved Brush Target Plane (eg for Move), Stamp Plane (eg for Flatten), and StrokePlane (eg for Plane brushes) to UMeshSculptToolBase, and relevant calcuation APIs
- base USculptBrushProperties now has Lazyness parameter, implemented lazy-brush in base sculpt tool
#rb none
#rnx
#ROBOMERGE-SOURCE: CL 13044097 via CL 13044098 via CL 13044099
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v686-13045012)
[CL 13048205 by ryan schmidt in Main branch]
2020-04-27 12:51:59 -04:00
void UMeshVertexSculptTool : : OnEndStroke ( )
2020-04-18 18:42:59 -04:00
{
ModelingTools: Ongoing Sculpting improvements:
- new UMeshSculptBrushOpProps baseclass for per-BrushOp Property Sets, added such a PropertySet for each BrushOp
- separate Strength/Depth/Falloff for each BrushOp so that they can have different settings. Currently cannot be in a shared base PropSet class because of different UProp Category strings
- UMeshSculptToolBase now supports registering BrushOp factory paired w/ ToolProps, rewrote VertexSculpt to use this to handle switching active BrushOp and visible PropSet
- removed UPlaneBrushProperties, vertex sculpt no longer uses USculptMaxBrushProperties (still used by dynamic sculpt)
- moved UMeshSurfacePointTool implementation up to UMeshSculptToolBase
- UMeshSculptToolBase now has OnBeginStroke() / OnEndStroke()API for subclasses to use to handle stroke (instead of overriding drag functions)
- Moved some setup to UMeshSculptToolBase. It can now initializes the target Component, can apply to Simple or Octree variants,
- moved Primary/Secondary BrushOp and active Falloff to UMeshSculptToolBase
- Support for various falloff types implemented in StampFalloffs.h, new EMeshSculptFalloffType exposed in VertexSculpt properties
- moved target component Transforms to UMeshSculptToolBase
- moved Brush Frames to UMeshSculptToolBase. Now storing Frames instead of Point+Normal, moved functions to update position for various stamp types
- UMeshSculptToolBase now has API for hit-testing against Sculpt and Base mesh, VertexSculpt implements
- UMeshSculptToolBase now has APIs for accessing transforms, current DMesh and BaseMesh, active stroke Depth/Strength/Falloff properties,
- moved Brush Target Plane (eg for Move), Stamp Plane (eg for Flatten), and StrokePlane (eg for Plane brushes) to UMeshSculptToolBase, and relevant calcuation APIs
- base USculptBrushProperties now has Lazyness parameter, implemented lazy-brush in base sculpt tool
#rb none
#rnx
#ROBOMERGE-SOURCE: CL 13044097 via CL 13044098 via CL 13044099
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v686-13045012)
[CL 13048205 by ryan schmidt in Main branch]
2020-04-27 12:51:59 -04:00
// update spatial
bTargetDirty = true ;
2020-04-18 18:42:59 -04:00
ModelingTools: Ongoing Sculpting improvements:
- new UMeshSculptBrushOpProps baseclass for per-BrushOp Property Sets, added such a PropertySet for each BrushOp
- separate Strength/Depth/Falloff for each BrushOp so that they can have different settings. Currently cannot be in a shared base PropSet class because of different UProp Category strings
- UMeshSculptToolBase now supports registering BrushOp factory paired w/ ToolProps, rewrote VertexSculpt to use this to handle switching active BrushOp and visible PropSet
- removed UPlaneBrushProperties, vertex sculpt no longer uses USculptMaxBrushProperties (still used by dynamic sculpt)
- moved UMeshSurfacePointTool implementation up to UMeshSculptToolBase
- UMeshSculptToolBase now has OnBeginStroke() / OnEndStroke()API for subclasses to use to handle stroke (instead of overriding drag functions)
- Moved some setup to UMeshSculptToolBase. It can now initializes the target Component, can apply to Simple or Octree variants,
- moved Primary/Secondary BrushOp and active Falloff to UMeshSculptToolBase
- Support for various falloff types implemented in StampFalloffs.h, new EMeshSculptFalloffType exposed in VertexSculpt properties
- moved target component Transforms to UMeshSculptToolBase
- moved Brush Frames to UMeshSculptToolBase. Now storing Frames instead of Point+Normal, moved functions to update position for various stamp types
- UMeshSculptToolBase now has API for hit-testing against Sculpt and Base mesh, VertexSculpt implements
- UMeshSculptToolBase now has APIs for accessing transforms, current DMesh and BaseMesh, active stroke Depth/Strength/Falloff properties,
- moved Brush Target Plane (eg for Move), Stamp Plane (eg for Flatten), and StrokePlane (eg for Plane brushes) to UMeshSculptToolBase, and relevant calcuation APIs
- base USculptBrushProperties now has Lazyness parameter, implemented lazy-brush in base sculpt tool
#rb none
#rnx
#ROBOMERGE-SOURCE: CL 13044097 via CL 13044098 via CL 13044099
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v686-13045012)
[CL 13048205 by ryan schmidt in Main branch]
2020-04-27 12:51:59 -04:00
GetActiveBrushOp ( ) - > EndStroke ( GetSculptMesh ( ) , LastStamp , VertexROI ) ;
2020-04-18 18:42:59 -04:00
ModelingTools: Ongoing Sculpting improvements:
- new UMeshSculptBrushOpProps baseclass for per-BrushOp Property Sets, added such a PropertySet for each BrushOp
- separate Strength/Depth/Falloff for each BrushOp so that they can have different settings. Currently cannot be in a shared base PropSet class because of different UProp Category strings
- UMeshSculptToolBase now supports registering BrushOp factory paired w/ ToolProps, rewrote VertexSculpt to use this to handle switching active BrushOp and visible PropSet
- removed UPlaneBrushProperties, vertex sculpt no longer uses USculptMaxBrushProperties (still used by dynamic sculpt)
- moved UMeshSurfacePointTool implementation up to UMeshSculptToolBase
- UMeshSculptToolBase now has OnBeginStroke() / OnEndStroke()API for subclasses to use to handle stroke (instead of overriding drag functions)
- Moved some setup to UMeshSculptToolBase. It can now initializes the target Component, can apply to Simple or Octree variants,
- moved Primary/Secondary BrushOp and active Falloff to UMeshSculptToolBase
- Support for various falloff types implemented in StampFalloffs.h, new EMeshSculptFalloffType exposed in VertexSculpt properties
- moved target component Transforms to UMeshSculptToolBase
- moved Brush Frames to UMeshSculptToolBase. Now storing Frames instead of Point+Normal, moved functions to update position for various stamp types
- UMeshSculptToolBase now has API for hit-testing against Sculpt and Base mesh, VertexSculpt implements
- UMeshSculptToolBase now has APIs for accessing transforms, current DMesh and BaseMesh, active stroke Depth/Strength/Falloff properties,
- moved Brush Target Plane (eg for Move), Stamp Plane (eg for Flatten), and StrokePlane (eg for Plane brushes) to UMeshSculptToolBase, and relevant calcuation APIs
- base USculptBrushProperties now has Lazyness parameter, implemented lazy-brush in base sculpt tool
#rb none
#rnx
#ROBOMERGE-SOURCE: CL 13044097 via CL 13044098 via CL 13044099
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v686-13045012)
[CL 13048205 by ryan schmidt in Main branch]
2020-04-27 12:51:59 -04:00
// close change record
EndChange ( ) ;
2020-04-18 18:42:59 -04:00
}
void UMeshVertexSculptTool : : UpdateROI ( const FVector3d & BrushPos )
{
2021-01-31 20:16:41 -04:00
TRACE_CPUPROFILER_EVENT_SCOPE ( VtxSculptTool_UpdateROI ) ;
2020-04-18 18:42:59 -04:00
ModelingTools: Ongoing Sculpting improvements:
- new UMeshSculptBrushOpProps baseclass for per-BrushOp Property Sets, added such a PropertySet for each BrushOp
- separate Strength/Depth/Falloff for each BrushOp so that they can have different settings. Currently cannot be in a shared base PropSet class because of different UProp Category strings
- UMeshSculptToolBase now supports registering BrushOp factory paired w/ ToolProps, rewrote VertexSculpt to use this to handle switching active BrushOp and visible PropSet
- removed UPlaneBrushProperties, vertex sculpt no longer uses USculptMaxBrushProperties (still used by dynamic sculpt)
- moved UMeshSurfacePointTool implementation up to UMeshSculptToolBase
- UMeshSculptToolBase now has OnBeginStroke() / OnEndStroke()API for subclasses to use to handle stroke (instead of overriding drag functions)
- Moved some setup to UMeshSculptToolBase. It can now initializes the target Component, can apply to Simple or Octree variants,
- moved Primary/Secondary BrushOp and active Falloff to UMeshSculptToolBase
- Support for various falloff types implemented in StampFalloffs.h, new EMeshSculptFalloffType exposed in VertexSculpt properties
- moved target component Transforms to UMeshSculptToolBase
- moved Brush Frames to UMeshSculptToolBase. Now storing Frames instead of Point+Normal, moved functions to update position for various stamp types
- UMeshSculptToolBase now has API for hit-testing against Sculpt and Base mesh, VertexSculpt implements
- UMeshSculptToolBase now has APIs for accessing transforms, current DMesh and BaseMesh, active stroke Depth/Strength/Falloff properties,
- moved Brush Target Plane (eg for Move), Stamp Plane (eg for Flatten), and StrokePlane (eg for Plane brushes) to UMeshSculptToolBase, and relevant calcuation APIs
- base USculptBrushProperties now has Lazyness parameter, implemented lazy-brush in base sculpt tool
#rb none
#rnx
#ROBOMERGE-SOURCE: CL 13044097 via CL 13044098 via CL 13044099
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v686-13045012)
[CL 13048205 by ryan schmidt in Main branch]
2020-04-27 12:51:59 -04:00
float RadiusSqr = GetCurrentBrushRadius ( ) * GetCurrentBrushRadius ( ) ;
2020-04-18 18:42:59 -04:00
FAxisAlignedBox3d BrushBox (
ModelingTools: Ongoing Sculpting improvements:
- new UMeshSculptBrushOpProps baseclass for per-BrushOp Property Sets, added such a PropertySet for each BrushOp
- separate Strength/Depth/Falloff for each BrushOp so that they can have different settings. Currently cannot be in a shared base PropSet class because of different UProp Category strings
- UMeshSculptToolBase now supports registering BrushOp factory paired w/ ToolProps, rewrote VertexSculpt to use this to handle switching active BrushOp and visible PropSet
- removed UPlaneBrushProperties, vertex sculpt no longer uses USculptMaxBrushProperties (still used by dynamic sculpt)
- moved UMeshSurfacePointTool implementation up to UMeshSculptToolBase
- UMeshSculptToolBase now has OnBeginStroke() / OnEndStroke()API for subclasses to use to handle stroke (instead of overriding drag functions)
- Moved some setup to UMeshSculptToolBase. It can now initializes the target Component, can apply to Simple or Octree variants,
- moved Primary/Secondary BrushOp and active Falloff to UMeshSculptToolBase
- Support for various falloff types implemented in StampFalloffs.h, new EMeshSculptFalloffType exposed in VertexSculpt properties
- moved target component Transforms to UMeshSculptToolBase
- moved Brush Frames to UMeshSculptToolBase. Now storing Frames instead of Point+Normal, moved functions to update position for various stamp types
- UMeshSculptToolBase now has API for hit-testing against Sculpt and Base mesh, VertexSculpt implements
- UMeshSculptToolBase now has APIs for accessing transforms, current DMesh and BaseMesh, active stroke Depth/Strength/Falloff properties,
- moved Brush Target Plane (eg for Move), Stamp Plane (eg for Flatten), and StrokePlane (eg for Plane brushes) to UMeshSculptToolBase, and relevant calcuation APIs
- base USculptBrushProperties now has Lazyness parameter, implemented lazy-brush in base sculpt tool
#rb none
#rnx
#ROBOMERGE-SOURCE: CL 13044097 via CL 13044098 via CL 13044099
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v686-13045012)
[CL 13048205 by ryan schmidt in Main branch]
2020-04-27 12:51:59 -04:00
BrushPos - GetCurrentBrushRadius ( ) * FVector3d : : One ( ) ,
BrushPos + GetCurrentBrushRadius ( ) * FVector3d : : One ( ) ) ;
2020-04-18 18:42:59 -04:00
2021-01-31 20:16:41 -04:00
// do a parallel range quer
RangeQueryTriBuffer . Reset ( ) ;
ModelingTools: Ongoing Sculpting improvements:
- new UMeshSculptBrushOpProps baseclass for per-BrushOp Property Sets, added such a PropertySet for each BrushOp
- separate Strength/Depth/Falloff for each BrushOp so that they can have different settings. Currently cannot be in a shared base PropSet class because of different UProp Category strings
- UMeshSculptToolBase now supports registering BrushOp factory paired w/ ToolProps, rewrote VertexSculpt to use this to handle switching active BrushOp and visible PropSet
- removed UPlaneBrushProperties, vertex sculpt no longer uses USculptMaxBrushProperties (still used by dynamic sculpt)
- moved UMeshSurfacePointTool implementation up to UMeshSculptToolBase
- UMeshSculptToolBase now has OnBeginStroke() / OnEndStroke()API for subclasses to use to handle stroke (instead of overriding drag functions)
- Moved some setup to UMeshSculptToolBase. It can now initializes the target Component, can apply to Simple or Octree variants,
- moved Primary/Secondary BrushOp and active Falloff to UMeshSculptToolBase
- Support for various falloff types implemented in StampFalloffs.h, new EMeshSculptFalloffType exposed in VertexSculpt properties
- moved target component Transforms to UMeshSculptToolBase
- moved Brush Frames to UMeshSculptToolBase. Now storing Frames instead of Point+Normal, moved functions to update position for various stamp types
- UMeshSculptToolBase now has API for hit-testing against Sculpt and Base mesh, VertexSculpt implements
- UMeshSculptToolBase now has APIs for accessing transforms, current DMesh and BaseMesh, active stroke Depth/Strength/Falloff properties,
- moved Brush Target Plane (eg for Move), Stamp Plane (eg for Flatten), and StrokePlane (eg for Plane brushes) to UMeshSculptToolBase, and relevant calcuation APIs
- base USculptBrushProperties now has Lazyness parameter, implemented lazy-brush in base sculpt tool
#rb none
#rnx
#ROBOMERGE-SOURCE: CL 13044097 via CL 13044098 via CL 13044099
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v686-13045012)
[CL 13048205 by ryan schmidt in Main branch]
2020-04-27 12:51:59 -04:00
FDynamicMesh3 * Mesh = GetSculptMesh ( ) ;
2021-01-31 20:16:41 -04:00
{
TRACE_CPUPROFILER_EVENT_SCOPE ( VtxSculptTool_UpdateROI_RangeQuery ) ;
Octree . ParallelRangeQuery ( BrushBox , RangeQueryTriBuffer ) ;
}
2021-03-02 19:23:29 -04:00
int32 ActiveComponentID = - 1 ;
int32 ActiveGroupID = - 1 ;
if ( SculptProperties - > BrushFilter = = EMeshVertexSculptBrushFilterType : : Component )
{
ActiveComponentID = ( InitialStrokeTriangleID > = 0 & & InitialStrokeTriangleID < = TriangleComponentIDs . Num ( ) ) ?
TriangleComponentIDs [ InitialStrokeTriangleID ] : - 1 ;
}
else if ( SculptProperties - > BrushFilter = = EMeshVertexSculptBrushFilterType : : PolyGroup )
{
ActiveGroupID = Mesh - > IsTriangle ( InitialStrokeTriangleID ) ? ActiveGroupSet - > GetGroup ( InitialStrokeTriangleID ) : - 1 ;
}
2021-01-31 20:16:41 -04:00
# if 1
// in this path we use more memory but this lets us do more in parallel
// Construct array of inside/outside flags for each triangle's vertices. If no
// vertices are inside, clear the triangle ID from the range query buffer.
// This can be done in parallel and it's cheaper to do repeated distance computations
// than to try to do it inside the ROI building below (todo: profile this some more?)
TriangleROIInBuf . SetNum ( RangeQueryTriBuffer . Num ( ) , false ) ;
{
TRACE_CPUPROFILER_EVENT_SCOPE ( DynamicMeshSculptTool_UpdateROI_TriVerts ) ;
ParallelFor ( RangeQueryTriBuffer . Num ( ) , [ & ] ( int k )
2020-04-18 18:42:59 -04:00
{
2021-03-02 19:23:29 -04:00
// check various triangle ROI filters
int32 tid = RangeQueryTriBuffer [ k ] ;
bool bDiscardTriangle = false ;
if ( ActiveComponentID > = 0 & & TriangleComponentIDs [ tid ] ! = ActiveComponentID )
{
bDiscardTriangle = true ;
}
if ( ActiveGroupID > = 0 & & ActiveGroupSet - > GetGroup ( tid ) ! = ActiveGroupID )
{
bDiscardTriangle = true ;
}
if ( bDiscardTriangle )
{
TriangleROIInBuf [ k ] . A = TriangleROIInBuf [ k ] . B = TriangleROIInBuf [ k ] . C = 0 ;
RangeQueryTriBuffer [ k ] = - 1 ;
return ;
}
const FIndex3i & TriV = Mesh - > GetTriangleRef ( tid ) ;
2021-03-30 21:25:22 -04:00
TriangleROIInBuf [ k ] . A = ( DistanceSquared ( BrushPos , Mesh - > GetVertexRef ( TriV . A ) ) < RadiusSqr ) ? 1 : 0 ;
TriangleROIInBuf [ k ] . B = ( DistanceSquared ( BrushPos , Mesh - > GetVertexRef ( TriV . B ) ) < RadiusSqr ) ? 1 : 0 ;
TriangleROIInBuf [ k ] . C = ( DistanceSquared ( BrushPos , Mesh - > GetVertexRef ( TriV . C ) ) < RadiusSqr ) ? 1 : 0 ;
2021-01-31 20:16:41 -04:00
if ( TriangleROIInBuf [ k ] . A + TriangleROIInBuf [ k ] . B + TriangleROIInBuf [ k ] . C = = 0 )
2020-04-18 18:42:59 -04:00
{
2021-01-31 20:16:41 -04:00
RangeQueryTriBuffer [ k ] = - 1 ;
2020-04-18 18:42:59 -04:00
}
2021-01-31 20:16:41 -04:00
} ) ;
}
2021-03-02 19:23:29 -04:00
// Build up vertex and triangle ROIs from the remaining range-query triangles.
2021-01-31 20:16:41 -04:00
{
TRACE_CPUPROFILER_EVENT_SCOPE ( DynamicMeshSculptTool_UpdateROI_3Collect ) ;
VertexROIBuilder . Initialize ( Mesh - > MaxVertexID ( ) ) ;
TriangleROIBuilder . Initialize ( Mesh - > MaxTriangleID ( ) ) ;
int32 N = RangeQueryTriBuffer . Num ( ) ;
for ( int32 k = 0 ; k < N ; + + k )
{
int32 tid = RangeQueryTriBuffer [ k ] ;
if ( tid = = - 1 ) continue ; // triangle was deleted in previous step
const FIndex3i & TriV = Mesh - > GetTriangleRef ( RangeQueryTriBuffer [ k ] ) ;
const FIndex3i & Inside = TriangleROIInBuf [ k ] ;
int InsideCount = 0 ;
for ( int j = 0 ; j < 3 ; + + j )
2020-04-18 18:42:59 -04:00
{
2021-01-31 20:16:41 -04:00
if ( Inside [ j ] )
{
VertexROIBuilder . Add ( TriV [ j ] ) ;
InsideCount + + ;
}
}
if ( InsideCount > 0 )
{
TriangleROIBuilder . Add ( tid ) ;
2020-04-18 18:42:59 -04:00
}
}
2021-01-31 20:16:41 -04:00
VertexROIBuilder . SwapValuesWith ( VertexROI ) ;
TriangleROIBuilder . SwapValuesWith ( TriangleROIArray ) ;
}
# else
// In this path we combine everything into one loop. Does fewer distance checks
// but nothing can be done in parallel (would change if ROIBuilders had atomic-try-add)
2021-03-02 19:23:29 -04:00
// TODO would need to support these, this branch is likely dead though
ensure ( SculptProperties - > BrushFilter = = EMeshVertexSculptBrushFilterType : : None ) ;
2021-01-31 20:16:41 -04:00
// collect set of vertices and triangles inside brush sphere, from range query result
{
TRACE_CPUPROFILER_EVENT_SCOPE ( DynamicMeshSculptTool_UpdateROI_2Collect ) ;
VertexROIBuilder . Initialize ( Mesh - > MaxVertexID ( ) ) ;
TriangleROIBuilder . Initialize ( Mesh - > MaxTriangleID ( ) ) ;
for ( int32 TriIdx : RangeQueryTriBuffer )
2020-04-18 18:42:59 -04:00
{
2021-01-31 20:16:41 -04:00
FIndex3i TriV = Mesh - > GetTriangle ( TriIdx ) ;
int InsideCount = 0 ;
for ( int j = 0 ; j < 3 ; + + j )
{
if ( VertexROIBuilder . Contains ( TriV [ j ] ) )
{
InsideCount + + ;
}
else if ( BrushPos . DistanceSquared ( Mesh - > GetVertexRef ( TriV [ j ] ) ) < RadiusSqr )
{
VertexROIBuilder . Add ( TriV [ j ] ) ;
InsideCount + + ;
}
}
if ( InsideCount > 0 )
{
TriangleROIBuilder . Add ( tid ) ;
}
2020-04-18 18:42:59 -04:00
}
2021-01-31 20:16:41 -04:00
VertexROIBuilder . SwapValuesWith ( VertexROI ) ;
TriangleROIBuilder . SwapValuesWith ( TriangleROIArray ) ;
}
# endif
2020-04-18 18:42:59 -04:00
2021-01-31 20:16:41 -04:00
{
TRACE_CPUPROFILER_EVENT_SCOPE ( DynamicMeshSculptTool_UpdateROI_4ROI ) ;
ROIPositionBuffer . SetNum ( VertexROI . Num ( ) , false ) ;
ROIPrevPositionBuffer . SetNum ( VertexROI . Num ( ) , false ) ;
ParallelFor ( VertexROI . Num ( ) , [ & ] ( int i )
{
ROIPrevPositionBuffer [ i ] = Mesh - > GetVertexRef ( VertexROI [ i ] ) ;
} ) ;
}
2020-04-18 18:42:59 -04:00
}
bool UMeshVertexSculptTool : : UpdateStampPosition ( const FRay & WorldRay )
{
2021-01-31 20:16:41 -04:00
TRACE_CPUPROFILER_EVENT_SCOPE ( VtxSculptTool_UpdateStampPosition ) ;
2020-04-18 18:42:59 -04:00
CalculateBrushRadius ( ) ;
ModelingTools: Ongoing Sculpting improvements:
- new UMeshSculptBrushOpProps baseclass for per-BrushOp Property Sets, added such a PropertySet for each BrushOp
- separate Strength/Depth/Falloff for each BrushOp so that they can have different settings. Currently cannot be in a shared base PropSet class because of different UProp Category strings
- UMeshSculptToolBase now supports registering BrushOp factory paired w/ ToolProps, rewrote VertexSculpt to use this to handle switching active BrushOp and visible PropSet
- removed UPlaneBrushProperties, vertex sculpt no longer uses USculptMaxBrushProperties (still used by dynamic sculpt)
- moved UMeshSurfacePointTool implementation up to UMeshSculptToolBase
- UMeshSculptToolBase now has OnBeginStroke() / OnEndStroke()API for subclasses to use to handle stroke (instead of overriding drag functions)
- Moved some setup to UMeshSculptToolBase. It can now initializes the target Component, can apply to Simple or Octree variants,
- moved Primary/Secondary BrushOp and active Falloff to UMeshSculptToolBase
- Support for various falloff types implemented in StampFalloffs.h, new EMeshSculptFalloffType exposed in VertexSculpt properties
- moved target component Transforms to UMeshSculptToolBase
- moved Brush Frames to UMeshSculptToolBase. Now storing Frames instead of Point+Normal, moved functions to update position for various stamp types
- UMeshSculptToolBase now has API for hit-testing against Sculpt and Base mesh, VertexSculpt implements
- UMeshSculptToolBase now has APIs for accessing transforms, current DMesh and BaseMesh, active stroke Depth/Strength/Falloff properties,
- moved Brush Target Plane (eg for Move), Stamp Plane (eg for Flatten), and StrokePlane (eg for Plane brushes) to UMeshSculptToolBase, and relevant calcuation APIs
- base USculptBrushProperties now has Lazyness parameter, implemented lazy-brush in base sculpt tool
#rb none
#rnx
#ROBOMERGE-SOURCE: CL 13044097 via CL 13044098 via CL 13044099
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v686-13045012)
[CL 13048205 by ryan schmidt in Main branch]
2020-04-27 12:51:59 -04:00
TUniquePtr < FMeshSculptBrushOp > & UseBrushOp = GetActiveBrushOp ( ) ;
2020-04-18 18:42:59 -04:00
ESculptBrushOpTargetType TargetType = UseBrushOp - > GetBrushTargetType ( ) ;
switch ( TargetType )
{
case ESculptBrushOpTargetType : : SculptMesh :
UpdateBrushPositionOnSculptMesh ( WorldRay , true ) ;
break ;
case ESculptBrushOpTargetType : : TargetMesh :
UpdateBrushPositionOnTargetMesh ( WorldRay , true ) ;
break ;
case ESculptBrushOpTargetType : : ActivePlane :
UpdateBrushPositionOnActivePlane ( WorldRay ) ;
break ;
}
if ( UseBrushOp - > GetAlignStampToView ( ) )
{
AlignBrushToView ( ) ;
}
CurrentStamp = LastStamp ;
2021-01-31 20:16:41 -04:00
//CurrentStamp.DeltaTime = FMathd::Min((FDateTime::Now() - LastStamp.TimeStamp).GetTotalSeconds(), 1.0);
CurrentStamp . DeltaTime = 0.03 ; // 30 fps - using actual time is no good now that we support variable stamps!
ModelingTools: Ongoing Sculpting improvements:
- new UMeshSculptBrushOpProps baseclass for per-BrushOp Property Sets, added such a PropertySet for each BrushOp
- separate Strength/Depth/Falloff for each BrushOp so that they can have different settings. Currently cannot be in a shared base PropSet class because of different UProp Category strings
- UMeshSculptToolBase now supports registering BrushOp factory paired w/ ToolProps, rewrote VertexSculpt to use this to handle switching active BrushOp and visible PropSet
- removed UPlaneBrushProperties, vertex sculpt no longer uses USculptMaxBrushProperties (still used by dynamic sculpt)
- moved UMeshSurfacePointTool implementation up to UMeshSculptToolBase
- UMeshSculptToolBase now has OnBeginStroke() / OnEndStroke()API for subclasses to use to handle stroke (instead of overriding drag functions)
- Moved some setup to UMeshSculptToolBase. It can now initializes the target Component, can apply to Simple or Octree variants,
- moved Primary/Secondary BrushOp and active Falloff to UMeshSculptToolBase
- Support for various falloff types implemented in StampFalloffs.h, new EMeshSculptFalloffType exposed in VertexSculpt properties
- moved target component Transforms to UMeshSculptToolBase
- moved Brush Frames to UMeshSculptToolBase. Now storing Frames instead of Point+Normal, moved functions to update position for various stamp types
- UMeshSculptToolBase now has API for hit-testing against Sculpt and Base mesh, VertexSculpt implements
- UMeshSculptToolBase now has APIs for accessing transforms, current DMesh and BaseMesh, active stroke Depth/Strength/Falloff properties,
- moved Brush Target Plane (eg for Move), Stamp Plane (eg for Flatten), and StrokePlane (eg for Plane brushes) to UMeshSculptToolBase, and relevant calcuation APIs
- base USculptBrushProperties now has Lazyness parameter, implemented lazy-brush in base sculpt tool
#rb none
#rnx
#ROBOMERGE-SOURCE: CL 13044097 via CL 13044098 via CL 13044099
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v686-13045012)
[CL 13048205 by ryan schmidt in Main branch]
2020-04-27 12:51:59 -04:00
CurrentStamp . WorldFrame = GetBrushFrameWorld ( ) ;
CurrentStamp . LocalFrame = GetBrushFrameLocal ( ) ;
CurrentStamp . Power = GetActivePressure ( ) * GetCurrentBrushStrength ( ) ;
2020-04-18 18:42:59 -04:00
2021-01-31 20:16:41 -04:00
if ( bHaveBrushAlpha & & ( AlphaProperties - > RotationAngle ! = 0 | | AlphaProperties - > bRandomize ) )
{
float UseAngle = AlphaProperties - > RotationAngle ;
if ( AlphaProperties - > bRandomize )
{
UseAngle + = ( StampRandomStream . GetFraction ( ) - 0.5f ) * 2.0f * AlphaProperties - > RandomRange ;
}
// possibly should be done in base brush...
CurrentStamp . WorldFrame . Rotate ( FQuaterniond ( CurrentStamp . WorldFrame . Z ( ) , UseAngle , true ) ) ;
CurrentStamp . LocalFrame . Rotate ( FQuaterniond ( CurrentStamp . LocalFrame . Z ( ) , UseAngle , true ) ) ;
}
2020-04-18 18:42:59 -04:00
CurrentStamp . PrevLocalFrame = LastStamp . LocalFrame ;
CurrentStamp . PrevWorldFrame = LastStamp . WorldFrame ;
FVector3d MoveDelta = CurrentStamp . LocalFrame . Origin - CurrentStamp . PrevLocalFrame . Origin ;
if ( UseBrushOp - > IgnoreZeroMovements ( ) & & MoveDelta . SquaredLength ( ) < FMathd : : ZeroTolerance )
{
return false ;
}
return true ;
}
2021-01-31 20:16:41 -04:00
TFuture < void > UMeshVertexSculptTool : : ApplyStamp ( )
2020-04-18 18:42:59 -04:00
{
2021-01-31 20:16:41 -04:00
TRACE_CPUPROFILER_EVENT_SCOPE ( VtxSculptTool_ApplyStamp ) ;
2020-04-18 18:42:59 -04:00
ModelingTools: Ongoing Sculpting improvements:
- new UMeshSculptBrushOpProps baseclass for per-BrushOp Property Sets, added such a PropertySet for each BrushOp
- separate Strength/Depth/Falloff for each BrushOp so that they can have different settings. Currently cannot be in a shared base PropSet class because of different UProp Category strings
- UMeshSculptToolBase now supports registering BrushOp factory paired w/ ToolProps, rewrote VertexSculpt to use this to handle switching active BrushOp and visible PropSet
- removed UPlaneBrushProperties, vertex sculpt no longer uses USculptMaxBrushProperties (still used by dynamic sculpt)
- moved UMeshSurfacePointTool implementation up to UMeshSculptToolBase
- UMeshSculptToolBase now has OnBeginStroke() / OnEndStroke()API for subclasses to use to handle stroke (instead of overriding drag functions)
- Moved some setup to UMeshSculptToolBase. It can now initializes the target Component, can apply to Simple or Octree variants,
- moved Primary/Secondary BrushOp and active Falloff to UMeshSculptToolBase
- Support for various falloff types implemented in StampFalloffs.h, new EMeshSculptFalloffType exposed in VertexSculpt properties
- moved target component Transforms to UMeshSculptToolBase
- moved Brush Frames to UMeshSculptToolBase. Now storing Frames instead of Point+Normal, moved functions to update position for various stamp types
- UMeshSculptToolBase now has API for hit-testing against Sculpt and Base mesh, VertexSculpt implements
- UMeshSculptToolBase now has APIs for accessing transforms, current DMesh and BaseMesh, active stroke Depth/Strength/Falloff properties,
- moved Brush Target Plane (eg for Move), Stamp Plane (eg for Flatten), and StrokePlane (eg for Plane brushes) to UMeshSculptToolBase, and relevant calcuation APIs
- base USculptBrushProperties now has Lazyness parameter, implemented lazy-brush in base sculpt tool
#rb none
#rnx
#ROBOMERGE-SOURCE: CL 13044097 via CL 13044098 via CL 13044099
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v686-13045012)
[CL 13048205 by ryan schmidt in Main branch]
2020-04-27 12:51:59 -04:00
TUniquePtr < FMeshSculptBrushOp > & UseBrushOp = GetActiveBrushOp ( ) ;
2021-01-31 20:16:41 -04:00
// compute region plane if necessary. This may currently be expensive?
2020-04-18 18:42:59 -04:00
if ( UseBrushOp - > WantsStampRegionPlane ( ) )
{
2021-01-31 20:16:41 -04:00
CurrentStamp . RegionPlane = ComputeStampRegionPlane ( CurrentStamp . LocalFrame , TriangleROIArray , true , false , false ) ;
2020-04-18 18:42:59 -04:00
}
2021-01-31 20:16:41 -04:00
// set up alpha function if we have one
if ( bHaveBrushAlpha )
{
CurrentStamp . StampAlphaFunc = [ this ] ( const FSculptBrushStamp & Stamp , const FVector3d & Position )
{
return this - > SampleBrushAlpha ( Stamp , Position ) ;
} ;
}
2020-04-18 18:42:59 -04:00
2021-01-31 20:16:41 -04:00
// apply the stamp, which computes new positions
FDynamicMesh3 * Mesh = GetSculptMesh ( ) ;
{
TRACE_CPUPROFILER_EVENT_SCOPE ( VtxSculptTool_ApplyStamp_Apply ) ;
UseBrushOp - > ApplyStamp ( Mesh , CurrentStamp , VertexROI , ROIPositionBuffer ) ;
}
// can discard alpha now
CurrentStamp . StampAlphaFunc = nullptr ;
// once stamp is applied, we can start updating vertex change, which can happen async as we saved all necessary info
TFuture < void > SaveVertexFuture ;
if ( ActiveVertexChange ! = nullptr )
{
2021-02-03 02:52:36 -04:00
SaveVertexFuture = Async ( VertexSculptToolAsyncExecTarget , [ this ] ( )
2021-01-31 20:16:41 -04:00
{
TRACE_CPUPROFILER_EVENT_SCOPE ( VtxSculptTool_SyncMeshWithPositionBuffer_UpdateChange ) ;
const int32 NumV = ROIPositionBuffer . Num ( ) ;
for ( int k = 0 ; k < NumV ; + + k )
{
int VertIdx = VertexROI [ k ] ;
ActiveVertexChange - > UpdateVertex ( VertIdx , ROIPrevPositionBuffer [ k ] , ROIPositionBuffer [ k ] ) ;
}
} ) ;
}
// now actually update the mesh, which happens
{
TRACE_CPUPROFILER_EVENT_SCOPE ( VtxSculptTool_ApplyStamp_Sync ) ;
const int32 NumV = ROIPositionBuffer . Num ( ) ;
ParallelFor ( NumV , [ & ] ( int32 k )
{
int VertIdx = VertexROI [ k ] ;
const FVector3d & NewPos = ROIPositionBuffer [ k ] ;
GeometryProcessing: clean up mesh timestamps.
- remove FDynamicMesh3::Timestamp (unused), rename Shape/Topology Timestamps to Shape/TopologyChangeStamp, change to atomic<uint32>
- add FDynamicMesh3::bEnableShapeChangeStamp, default to false, to disable ShapeChange tracking. Add ::SetShapeChangeStampEnabled() and ::HasShapeChangeStampEnabled() to configure.
- replace FDynamicMesh3::UpdateTimestamps() with UpdateChangeStamps()
- add bTrackChange param to FDynamicMesh3::SetVertex(), optionally updates ShapeChangeStamp (if enabled). Default true. Remove SetVertex_NoTimeStampUpdate(), update call sites.
- add FDynamicMesh3::GetChangeStamp(), returns combination of Shape and Topology stamps as uint64
- rename TTriangleMeshAdapter::GetTimestamp() to GetChangeStamp(), update usages
- remove TPointSetAdapter::Timestamp() (was not used in code)
- update TMeshAABBTree3 to use GetChangeStamp(), update internal checks to call IsValid() instead
- update TFastWindingTree w/ similar changes
- update calls in UVEditor, may require further updates
#rb semion.piskarev
#rnx
#jira none
#preflight 6126904c72e9eb00011434fe
#ROBOMERGE-SOURCE: CL 17310271 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v861-17282326)
[CL 17315112 by ryan schmidt in ue5-release-engine-test branch]
2021-08-26 06:57:55 -04:00
Mesh - > SetVertex ( VertIdx , NewPos , false ) ;
2021-01-31 20:16:41 -04:00
} ) ;
GeometryProcessing: clean up mesh timestamps.
- remove FDynamicMesh3::Timestamp (unused), rename Shape/Topology Timestamps to Shape/TopologyChangeStamp, change to atomic<uint32>
- add FDynamicMesh3::bEnableShapeChangeStamp, default to false, to disable ShapeChange tracking. Add ::SetShapeChangeStampEnabled() and ::HasShapeChangeStampEnabled() to configure.
- replace FDynamicMesh3::UpdateTimestamps() with UpdateChangeStamps()
- add bTrackChange param to FDynamicMesh3::SetVertex(), optionally updates ShapeChangeStamp (if enabled). Default true. Remove SetVertex_NoTimeStampUpdate(), update call sites.
- add FDynamicMesh3::GetChangeStamp(), returns combination of Shape and Topology stamps as uint64
- rename TTriangleMeshAdapter::GetTimestamp() to GetChangeStamp(), update usages
- remove TPointSetAdapter::Timestamp() (was not used in code)
- update TMeshAABBTree3 to use GetChangeStamp(), update internal checks to call IsValid() instead
- update TFastWindingTree w/ similar changes
- update calls in UVEditor, may require further updates
#rb semion.piskarev
#rnx
#jira none
#preflight 6126904c72e9eb00011434fe
#ROBOMERGE-SOURCE: CL 17310271 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v861-17282326)
[CL 17315112 by ryan schmidt in ue5-release-engine-test branch]
2021-08-26 06:57:55 -04:00
Mesh - > UpdateChangeStamps ( true , false ) ;
2021-01-31 20:16:41 -04:00
}
2020-04-18 18:42:59 -04:00
LastStamp = CurrentStamp ;
ModelingTools: Ongoing Sculpting improvements:
- new UMeshSculptBrushOpProps baseclass for per-BrushOp Property Sets, added such a PropertySet for each BrushOp
- separate Strength/Depth/Falloff for each BrushOp so that they can have different settings. Currently cannot be in a shared base PropSet class because of different UProp Category strings
- UMeshSculptToolBase now supports registering BrushOp factory paired w/ ToolProps, rewrote VertexSculpt to use this to handle switching active BrushOp and visible PropSet
- removed UPlaneBrushProperties, vertex sculpt no longer uses USculptMaxBrushProperties (still used by dynamic sculpt)
- moved UMeshSurfacePointTool implementation up to UMeshSculptToolBase
- UMeshSculptToolBase now has OnBeginStroke() / OnEndStroke()API for subclasses to use to handle stroke (instead of overriding drag functions)
- Moved some setup to UMeshSculptToolBase. It can now initializes the target Component, can apply to Simple or Octree variants,
- moved Primary/Secondary BrushOp and active Falloff to UMeshSculptToolBase
- Support for various falloff types implemented in StampFalloffs.h, new EMeshSculptFalloffType exposed in VertexSculpt properties
- moved target component Transforms to UMeshSculptToolBase
- moved Brush Frames to UMeshSculptToolBase. Now storing Frames instead of Point+Normal, moved functions to update position for various stamp types
- UMeshSculptToolBase now has API for hit-testing against Sculpt and Base mesh, VertexSculpt implements
- UMeshSculptToolBase now has APIs for accessing transforms, current DMesh and BaseMesh, active stroke Depth/Strength/Falloff properties,
- moved Brush Target Plane (eg for Move), Stamp Plane (eg for Flatten), and StrokePlane (eg for Plane brushes) to UMeshSculptToolBase, and relevant calcuation APIs
- base USculptBrushProperties now has Lazyness parameter, implemented lazy-brush in base sculpt tool
#rb none
#rnx
#ROBOMERGE-SOURCE: CL 13044097 via CL 13044098 via CL 13044099
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v686-13045012)
[CL 13048205 by ryan schmidt in Main branch]
2020-04-27 12:51:59 -04:00
LastStamp . TimeStamp = FDateTime : : Now ( ) ;
2021-01-31 20:16:41 -04:00
// let caller wait for this to finish
return SaveVertexFuture ;
2020-04-18 18:42:59 -04:00
}
2021-05-06 18:29:00 -04:00
bool UMeshVertexSculptTool : : IsHitTriangleBackFacing ( int32 TriangleID , const FDynamicMesh3 * QueryMesh )
{
if ( TriangleID ! = IndexConstants : : InvalidID )
{
FViewCameraState StateOut ;
GetToolManager ( ) - > GetContextQueriesAPI ( ) - > GetCurrentViewState ( StateOut ) ;
FVector3d LocalEyePosition ( CurTargetTransform . InverseTransformPosition ( ( FVector3d ) StateOut . Position ) ) ;
2020-04-18 18:42:59 -04:00
2021-05-06 18:29:00 -04:00
FVector3d Normal , Centroid ;
double Area ;
QueryMesh - > GetTriInfo ( TriangleID , Normal , Area , Centroid ) ;
return ( Normal . Dot ( ( Centroid - LocalEyePosition ) ) > = 0 ) ;
}
return false ;
}
2020-04-18 18:42:59 -04:00
ModelingTools: Ongoing Sculpting improvements:
- new UMeshSculptBrushOpProps baseclass for per-BrushOp Property Sets, added such a PropertySet for each BrushOp
- separate Strength/Depth/Falloff for each BrushOp so that they can have different settings. Currently cannot be in a shared base PropSet class because of different UProp Category strings
- UMeshSculptToolBase now supports registering BrushOp factory paired w/ ToolProps, rewrote VertexSculpt to use this to handle switching active BrushOp and visible PropSet
- removed UPlaneBrushProperties, vertex sculpt no longer uses USculptMaxBrushProperties (still used by dynamic sculpt)
- moved UMeshSurfacePointTool implementation up to UMeshSculptToolBase
- UMeshSculptToolBase now has OnBeginStroke() / OnEndStroke()API for subclasses to use to handle stroke (instead of overriding drag functions)
- Moved some setup to UMeshSculptToolBase. It can now initializes the target Component, can apply to Simple or Octree variants,
- moved Primary/Secondary BrushOp and active Falloff to UMeshSculptToolBase
- Support for various falloff types implemented in StampFalloffs.h, new EMeshSculptFalloffType exposed in VertexSculpt properties
- moved target component Transforms to UMeshSculptToolBase
- moved Brush Frames to UMeshSculptToolBase. Now storing Frames instead of Point+Normal, moved functions to update position for various stamp types
- UMeshSculptToolBase now has API for hit-testing against Sculpt and Base mesh, VertexSculpt implements
- UMeshSculptToolBase now has APIs for accessing transforms, current DMesh and BaseMesh, active stroke Depth/Strength/Falloff properties,
- moved Brush Target Plane (eg for Move), Stamp Plane (eg for Flatten), and StrokePlane (eg for Plane brushes) to UMeshSculptToolBase, and relevant calcuation APIs
- base USculptBrushProperties now has Lazyness parameter, implemented lazy-brush in base sculpt tool
#rb none
#rnx
#ROBOMERGE-SOURCE: CL 13044097 via CL 13044098 via CL 13044099
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v686-13045012)
[CL 13048205 by ryan schmidt in Main branch]
2020-04-27 12:51:59 -04:00
int32 UMeshVertexSculptTool : : FindHitSculptMeshTriangle ( const FRay3d & LocalRay )
2020-04-18 18:42:59 -04:00
{
2021-01-31 20:16:41 -04:00
// need this to finish before we can touch Octree
WaitForPendingStampUpdate ( ) ;
2021-05-06 18:29:00 -04:00
int32 HitTID = Octree . FindNearestHitObject ( LocalRay ) ;
if ( GetBrushCanHitBackFaces ( ) = = false & & IsHitTriangleBackFacing ( HitTID , GetSculptMesh ( ) ) )
2020-04-18 18:42:59 -04:00
{
2021-05-06 18:29:00 -04:00
HitTID = IndexConstants : : InvalidID ;
2020-04-18 18:42:59 -04:00
}
2021-05-06 18:29:00 -04:00
return HitTID ;
2020-04-18 18:42:59 -04:00
}
ModelingTools: Ongoing Sculpting improvements:
- new UMeshSculptBrushOpProps baseclass for per-BrushOp Property Sets, added such a PropertySet for each BrushOp
- separate Strength/Depth/Falloff for each BrushOp so that they can have different settings. Currently cannot be in a shared base PropSet class because of different UProp Category strings
- UMeshSculptToolBase now supports registering BrushOp factory paired w/ ToolProps, rewrote VertexSculpt to use this to handle switching active BrushOp and visible PropSet
- removed UPlaneBrushProperties, vertex sculpt no longer uses USculptMaxBrushProperties (still used by dynamic sculpt)
- moved UMeshSurfacePointTool implementation up to UMeshSculptToolBase
- UMeshSculptToolBase now has OnBeginStroke() / OnEndStroke()API for subclasses to use to handle stroke (instead of overriding drag functions)
- Moved some setup to UMeshSculptToolBase. It can now initializes the target Component, can apply to Simple or Octree variants,
- moved Primary/Secondary BrushOp and active Falloff to UMeshSculptToolBase
- Support for various falloff types implemented in StampFalloffs.h, new EMeshSculptFalloffType exposed in VertexSculpt properties
- moved target component Transforms to UMeshSculptToolBase
- moved Brush Frames to UMeshSculptToolBase. Now storing Frames instead of Point+Normal, moved functions to update position for various stamp types
- UMeshSculptToolBase now has API for hit-testing against Sculpt and Base mesh, VertexSculpt implements
- UMeshSculptToolBase now has APIs for accessing transforms, current DMesh and BaseMesh, active stroke Depth/Strength/Falloff properties,
- moved Brush Target Plane (eg for Move), Stamp Plane (eg for Flatten), and StrokePlane (eg for Plane brushes) to UMeshSculptToolBase, and relevant calcuation APIs
- base USculptBrushProperties now has Lazyness parameter, implemented lazy-brush in base sculpt tool
#rb none
#rnx
#ROBOMERGE-SOURCE: CL 13044097 via CL 13044098 via CL 13044099
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v686-13045012)
[CL 13048205 by ryan schmidt in Main branch]
2020-04-27 12:51:59 -04:00
int32 UMeshVertexSculptTool : : FindHitTargetMeshTriangle ( const FRay3d & LocalRay )
2020-04-18 18:42:59 -04:00
{
2021-05-06 18:29:00 -04:00
int32 HitTID = BaseMeshSpatial . FindNearestHitObject ( LocalRay ) ;
if ( GetBrushCanHitBackFaces ( ) = = false & & IsHitTriangleBackFacing ( HitTID , GetBaseMesh ( ) ) )
2020-04-18 18:42:59 -04:00
{
2021-05-06 18:29:00 -04:00
HitTID = IndexConstants : : InvalidID ;
2020-04-18 18:42:59 -04:00
}
2021-05-06 18:29:00 -04:00
return HitTID ;
2020-04-18 18:42:59 -04:00
}
bool UMeshVertexSculptTool : : UpdateBrushPosition ( const FRay & WorldRay )
{
ModelingTools: Ongoing Sculpting improvements:
- new UMeshSculptBrushOpProps baseclass for per-BrushOp Property Sets, added such a PropertySet for each BrushOp
- separate Strength/Depth/Falloff for each BrushOp so that they can have different settings. Currently cannot be in a shared base PropSet class because of different UProp Category strings
- UMeshSculptToolBase now supports registering BrushOp factory paired w/ ToolProps, rewrote VertexSculpt to use this to handle switching active BrushOp and visible PropSet
- removed UPlaneBrushProperties, vertex sculpt no longer uses USculptMaxBrushProperties (still used by dynamic sculpt)
- moved UMeshSurfacePointTool implementation up to UMeshSculptToolBase
- UMeshSculptToolBase now has OnBeginStroke() / OnEndStroke()API for subclasses to use to handle stroke (instead of overriding drag functions)
- Moved some setup to UMeshSculptToolBase. It can now initializes the target Component, can apply to Simple or Octree variants,
- moved Primary/Secondary BrushOp and active Falloff to UMeshSculptToolBase
- Support for various falloff types implemented in StampFalloffs.h, new EMeshSculptFalloffType exposed in VertexSculpt properties
- moved target component Transforms to UMeshSculptToolBase
- moved Brush Frames to UMeshSculptToolBase. Now storing Frames instead of Point+Normal, moved functions to update position for various stamp types
- UMeshSculptToolBase now has API for hit-testing against Sculpt and Base mesh, VertexSculpt implements
- UMeshSculptToolBase now has APIs for accessing transforms, current DMesh and BaseMesh, active stroke Depth/Strength/Falloff properties,
- moved Brush Target Plane (eg for Move), Stamp Plane (eg for Flatten), and StrokePlane (eg for Plane brushes) to UMeshSculptToolBase, and relevant calcuation APIs
- base USculptBrushProperties now has Lazyness parameter, implemented lazy-brush in base sculpt tool
#rb none
#rnx
#ROBOMERGE-SOURCE: CL 13044097 via CL 13044098 via CL 13044099
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v686-13045012)
[CL 13048205 by ryan schmidt in Main branch]
2020-04-27 12:51:59 -04:00
TUniquePtr < FMeshSculptBrushOp > & UseBrushOp = GetActiveBrushOp ( ) ;
2020-04-18 18:42:59 -04:00
ModelingTools: Ongoing Sculpting improvements:
- new UMeshSculptBrushOpProps baseclass for per-BrushOp Property Sets, added such a PropertySet for each BrushOp
- separate Strength/Depth/Falloff for each BrushOp so that they can have different settings. Currently cannot be in a shared base PropSet class because of different UProp Category strings
- UMeshSculptToolBase now supports registering BrushOp factory paired w/ ToolProps, rewrote VertexSculpt to use this to handle switching active BrushOp and visible PropSet
- removed UPlaneBrushProperties, vertex sculpt no longer uses USculptMaxBrushProperties (still used by dynamic sculpt)
- moved UMeshSurfacePointTool implementation up to UMeshSculptToolBase
- UMeshSculptToolBase now has OnBeginStroke() / OnEndStroke()API for subclasses to use to handle stroke (instead of overriding drag functions)
- Moved some setup to UMeshSculptToolBase. It can now initializes the target Component, can apply to Simple or Octree variants,
- moved Primary/Secondary BrushOp and active Falloff to UMeshSculptToolBase
- Support for various falloff types implemented in StampFalloffs.h, new EMeshSculptFalloffType exposed in VertexSculpt properties
- moved target component Transforms to UMeshSculptToolBase
- moved Brush Frames to UMeshSculptToolBase. Now storing Frames instead of Point+Normal, moved functions to update position for various stamp types
- UMeshSculptToolBase now has API for hit-testing against Sculpt and Base mesh, VertexSculpt implements
- UMeshSculptToolBase now has APIs for accessing transforms, current DMesh and BaseMesh, active stroke Depth/Strength/Falloff properties,
- moved Brush Target Plane (eg for Move), Stamp Plane (eg for Flatten), and StrokePlane (eg for Plane brushes) to UMeshSculptToolBase, and relevant calcuation APIs
- base USculptBrushProperties now has Lazyness parameter, implemented lazy-brush in base sculpt tool
#rb none
#rnx
#ROBOMERGE-SOURCE: CL 13044097 via CL 13044098 via CL 13044099
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v686-13045012)
[CL 13048205 by ryan schmidt in Main branch]
2020-04-27 12:51:59 -04:00
bool bHit = false ;
ESculptBrushOpTargetType TargetType = UseBrushOp - > GetBrushTargetType ( ) ;
switch ( TargetType )
2020-04-18 18:42:59 -04:00
{
ModelingTools: Ongoing Sculpting improvements:
- new UMeshSculptBrushOpProps baseclass for per-BrushOp Property Sets, added such a PropertySet for each BrushOp
- separate Strength/Depth/Falloff for each BrushOp so that they can have different settings. Currently cannot be in a shared base PropSet class because of different UProp Category strings
- UMeshSculptToolBase now supports registering BrushOp factory paired w/ ToolProps, rewrote VertexSculpt to use this to handle switching active BrushOp and visible PropSet
- removed UPlaneBrushProperties, vertex sculpt no longer uses USculptMaxBrushProperties (still used by dynamic sculpt)
- moved UMeshSurfacePointTool implementation up to UMeshSculptToolBase
- UMeshSculptToolBase now has OnBeginStroke() / OnEndStroke()API for subclasses to use to handle stroke (instead of overriding drag functions)
- Moved some setup to UMeshSculptToolBase. It can now initializes the target Component, can apply to Simple or Octree variants,
- moved Primary/Secondary BrushOp and active Falloff to UMeshSculptToolBase
- Support for various falloff types implemented in StampFalloffs.h, new EMeshSculptFalloffType exposed in VertexSculpt properties
- moved target component Transforms to UMeshSculptToolBase
- moved Brush Frames to UMeshSculptToolBase. Now storing Frames instead of Point+Normal, moved functions to update position for various stamp types
- UMeshSculptToolBase now has API for hit-testing against Sculpt and Base mesh, VertexSculpt implements
- UMeshSculptToolBase now has APIs for accessing transforms, current DMesh and BaseMesh, active stroke Depth/Strength/Falloff properties,
- moved Brush Target Plane (eg for Move), Stamp Plane (eg for Flatten), and StrokePlane (eg for Plane brushes) to UMeshSculptToolBase, and relevant calcuation APIs
- base USculptBrushProperties now has Lazyness parameter, implemented lazy-brush in base sculpt tool
#rb none
#rnx
#ROBOMERGE-SOURCE: CL 13044097 via CL 13044098 via CL 13044099
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v686-13045012)
[CL 13048205 by ryan schmidt in Main branch]
2020-04-27 12:51:59 -04:00
case ESculptBrushOpTargetType : : SculptMesh :
bHit = UpdateBrushPositionOnSculptMesh ( WorldRay , false ) ;
break ;
case ESculptBrushOpTargetType : : TargetMesh :
bHit = UpdateBrushPositionOnTargetMesh ( WorldRay , false ) ;
break ;
case ESculptBrushOpTargetType : : ActivePlane :
//UpdateBrushPositionOnActivePlane(WorldRay);
bHit = UpdateBrushPositionOnSculptMesh ( WorldRay , false ) ;
break ;
2020-04-18 18:42:59 -04:00
}
ModelingTools: Ongoing Sculpting improvements:
- new UMeshSculptBrushOpProps baseclass for per-BrushOp Property Sets, added such a PropertySet for each BrushOp
- separate Strength/Depth/Falloff for each BrushOp so that they can have different settings. Currently cannot be in a shared base PropSet class because of different UProp Category strings
- UMeshSculptToolBase now supports registering BrushOp factory paired w/ ToolProps, rewrote VertexSculpt to use this to handle switching active BrushOp and visible PropSet
- removed UPlaneBrushProperties, vertex sculpt no longer uses USculptMaxBrushProperties (still used by dynamic sculpt)
- moved UMeshSurfacePointTool implementation up to UMeshSculptToolBase
- UMeshSculptToolBase now has OnBeginStroke() / OnEndStroke()API for subclasses to use to handle stroke (instead of overriding drag functions)
- Moved some setup to UMeshSculptToolBase. It can now initializes the target Component, can apply to Simple or Octree variants,
- moved Primary/Secondary BrushOp and active Falloff to UMeshSculptToolBase
- Support for various falloff types implemented in StampFalloffs.h, new EMeshSculptFalloffType exposed in VertexSculpt properties
- moved target component Transforms to UMeshSculptToolBase
- moved Brush Frames to UMeshSculptToolBase. Now storing Frames instead of Point+Normal, moved functions to update position for various stamp types
- UMeshSculptToolBase now has API for hit-testing against Sculpt and Base mesh, VertexSculpt implements
- UMeshSculptToolBase now has APIs for accessing transforms, current DMesh and BaseMesh, active stroke Depth/Strength/Falloff properties,
- moved Brush Target Plane (eg for Move), Stamp Plane (eg for Flatten), and StrokePlane (eg for Plane brushes) to UMeshSculptToolBase, and relevant calcuation APIs
- base USculptBrushProperties now has Lazyness parameter, implemented lazy-brush in base sculpt tool
#rb none
#rnx
#ROBOMERGE-SOURCE: CL 13044097 via CL 13044098 via CL 13044099
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v686-13045012)
[CL 13048205 by ryan schmidt in Main branch]
2020-04-27 12:51:59 -04:00
if ( bHit & & UseBrushOp - > GetAlignStampToView ( ) )
2020-04-18 18:42:59 -04:00
{
AlignBrushToView ( ) ;
}
return bHit ;
}
2021-12-06 15:44:16 -05:00
void UMeshVertexSculptTool : : UpdateHoverStamp ( const FFrame3d & StampFrame )
{
FFrame3d HoverFrame = StampFrame ;
if ( bHaveBrushAlpha & & ( AlphaProperties - > RotationAngle ! = 0 ) )
{
HoverFrame . Rotate ( FQuaterniond ( HoverFrame . Z ( ) , AlphaProperties - > RotationAngle , true ) ) ;
}
UMeshSculptToolBase : : UpdateHoverStamp ( HoverFrame ) ;
}
2020-04-18 18:42:59 -04:00
bool UMeshVertexSculptTool : : OnUpdateHover ( const FInputDeviceRay & DevicePos )
{
2021-02-03 14:57:28 -04:00
// 4.26 HOTFIX: update LastWorldRay position so that we have it for updating WorkPlane position
UMeshSurfacePointTool : : LastWorldRay = DevicePos . WorldRay ;
2020-04-18 18:42:59 -04:00
2021-02-03 14:57:28 -04:00
PendingStampType = SculptProperties - > PrimaryBrushType ;
ModelingTools: Ongoing Sculpting improvements:
- new UMeshSculptBrushOpProps baseclass for per-BrushOp Property Sets, added such a PropertySet for each BrushOp
- separate Strength/Depth/Falloff for each BrushOp so that they can have different settings. Currently cannot be in a shared base PropSet class because of different UProp Category strings
- UMeshSculptToolBase now supports registering BrushOp factory paired w/ ToolProps, rewrote VertexSculpt to use this to handle switching active BrushOp and visible PropSet
- removed UPlaneBrushProperties, vertex sculpt no longer uses USculptMaxBrushProperties (still used by dynamic sculpt)
- moved UMeshSurfacePointTool implementation up to UMeshSculptToolBase
- UMeshSculptToolBase now has OnBeginStroke() / OnEndStroke()API for subclasses to use to handle stroke (instead of overriding drag functions)
- Moved some setup to UMeshSculptToolBase. It can now initializes the target Component, can apply to Simple or Octree variants,
- moved Primary/Secondary BrushOp and active Falloff to UMeshSculptToolBase
- Support for various falloff types implemented in StampFalloffs.h, new EMeshSculptFalloffType exposed in VertexSculpt properties
- moved target component Transforms to UMeshSculptToolBase
- moved Brush Frames to UMeshSculptToolBase. Now storing Frames instead of Point+Normal, moved functions to update position for various stamp types
- UMeshSculptToolBase now has API for hit-testing against Sculpt and Base mesh, VertexSculpt implements
- UMeshSculptToolBase now has APIs for accessing transforms, current DMesh and BaseMesh, active stroke Depth/Strength/Falloff properties,
- moved Brush Target Plane (eg for Move), Stamp Plane (eg for Flatten), and StrokePlane (eg for Plane brushes) to UMeshSculptToolBase, and relevant calcuation APIs
- base USculptBrushProperties now has Lazyness parameter, implemented lazy-brush in base sculpt tool
#rb none
#rnx
#ROBOMERGE-SOURCE: CL 13044097 via CL 13044098 via CL 13044099
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v686-13045012)
[CL 13048205 by ryan schmidt in Main branch]
2020-04-27 12:51:59 -04:00
if ( ensure ( InStroke ( ) = = false ) )
2020-04-18 18:42:59 -04:00
{
UpdateBrushPosition ( DevicePos . WorldRay ) ;
2021-12-06 15:44:16 -05:00
if ( BrushIndicatorMaterial )
{
BrushIndicatorMaterial - > SetScalarParameterValue ( TEXT ( " FalloffRatio " ) , GetCurrentBrushFalloff ( ) ) ;
switch ( SculptProperties - > PrimaryFalloffType )
{
default :
case EMeshSculptFalloffType : : Smooth :
case EMeshSculptFalloffType : : BoxSmooth :
BrushIndicatorMaterial - > SetScalarParameterValue ( TEXT ( " FalloffMode " ) , 0.0f ) ;
break ;
case EMeshSculptFalloffType : : Linear :
case EMeshSculptFalloffType : : BoxLinear :
BrushIndicatorMaterial - > SetScalarParameterValue ( TEXT ( " FalloffMode " ) , 0.3333333f ) ;
break ;
case EMeshSculptFalloffType : : Inverse :
case EMeshSculptFalloffType : : BoxInverse :
BrushIndicatorMaterial - > SetScalarParameterValue ( TEXT ( " FalloffMode " ) , 0.6666666f ) ;
break ;
case EMeshSculptFalloffType : : Round :
case EMeshSculptFalloffType : : BoxRound :
BrushIndicatorMaterial - > SetScalarParameterValue ( TEXT ( " FalloffMode " ) , 1.0f ) ;
break ;
}
switch ( SculptProperties - > PrimaryFalloffType )
{
default :
case EMeshSculptFalloffType : : Smooth :
case EMeshSculptFalloffType : : Linear :
case EMeshSculptFalloffType : : Inverse :
case EMeshSculptFalloffType : : Round :
BrushIndicatorMaterial - > SetScalarParameterValue ( TEXT ( " FalloffShape " ) , 0.0f ) ;
break ;
case EMeshSculptFalloffType : : BoxSmooth :
case EMeshSculptFalloffType : : BoxLinear :
case EMeshSculptFalloffType : : BoxInverse :
case EMeshSculptFalloffType : : BoxRound :
BrushIndicatorMaterial - > SetScalarParameterValue ( TEXT ( " FalloffShape " ) , 1.0f ) ;
}
}
2020-04-18 18:42:59 -04:00
}
2021-12-06 15:44:16 -05:00
2020-04-18 18:42:59 -04:00
return true ;
}
void UMeshVertexSculptTool : : OnTick ( float DeltaTime )
{
UMeshSculptToolBase : : OnTick ( DeltaTime ) ;
2021-01-31 20:16:41 -04:00
TRACE_CPUPROFILER_EVENT_SCOPE ( VtxSculptTool_Tick ) ;
2020-04-18 18:42:59 -04:00
// process the undo update
if ( bUndoUpdatePending )
{
// wait for updates
WaitForPendingUndoRedo ( ) ;
// post rendering update
DynamicMeshComponent - > FastNotifyTriangleVerticesUpdated ( AccumulatedTriangleROI ,
EMeshRenderAttributeFlags : : Positions | EMeshRenderAttributeFlags : : VertexNormals ) ;
GetToolManager ( ) - > PostInvalidation ( ) ;
// ignore stamp and wait for next tick to do anything else
bUndoUpdatePending = false ;
return ;
}
// if user changed to not-frozen, we need to reinitialize the target
if ( bCachedFreezeTarget ! = SculptProperties - > bFreezeTarget )
{
UpdateBaseMesh ( nullptr ) ;
bTargetDirty = false ;
}
2021-01-31 20:16:41 -04:00
if ( InStroke ( ) )
2020-04-18 18:42:59 -04:00
{
//UE_LOG(LogTemp, Warning, TEXT("dt is %.3f, tick fps %.2f - roi size %d/%d"), DeltaTime, 1.0 / DeltaTime, VertexROI.Num(), TriangleROI.Num());
2021-01-31 20:16:41 -04:00
TRACE_CPUPROFILER_EVENT_SCOPE ( VtxSculptTool_Tick_StrokeUpdate ) ;
FDynamicMesh3 * Mesh = GetSculptMesh ( ) ;
2020-04-18 18:42:59 -04:00
// update brush position
ModelingTools: Ongoing Sculpting improvements:
- new UMeshSculptBrushOpProps baseclass for per-BrushOp Property Sets, added such a PropertySet for each BrushOp
- separate Strength/Depth/Falloff for each BrushOp so that they can have different settings. Currently cannot be in a shared base PropSet class because of different UProp Category strings
- UMeshSculptToolBase now supports registering BrushOp factory paired w/ ToolProps, rewrote VertexSculpt to use this to handle switching active BrushOp and visible PropSet
- removed UPlaneBrushProperties, vertex sculpt no longer uses USculptMaxBrushProperties (still used by dynamic sculpt)
- moved UMeshSurfacePointTool implementation up to UMeshSculptToolBase
- UMeshSculptToolBase now has OnBeginStroke() / OnEndStroke()API for subclasses to use to handle stroke (instead of overriding drag functions)
- Moved some setup to UMeshSculptToolBase. It can now initializes the target Component, can apply to Simple or Octree variants,
- moved Primary/Secondary BrushOp and active Falloff to UMeshSculptToolBase
- Support for various falloff types implemented in StampFalloffs.h, new EMeshSculptFalloffType exposed in VertexSculpt properties
- moved target component Transforms to UMeshSculptToolBase
- moved Brush Frames to UMeshSculptToolBase. Now storing Frames instead of Point+Normal, moved functions to update position for various stamp types
- UMeshSculptToolBase now has API for hit-testing against Sculpt and Base mesh, VertexSculpt implements
- UMeshSculptToolBase now has APIs for accessing transforms, current DMesh and BaseMesh, active stroke Depth/Strength/Falloff properties,
- moved Brush Target Plane (eg for Move), Stamp Plane (eg for Flatten), and StrokePlane (eg for Plane brushes) to UMeshSculptToolBase, and relevant calcuation APIs
- base USculptBrushProperties now has Lazyness parameter, implemented lazy-brush in base sculpt tool
#rb none
#rnx
#ROBOMERGE-SOURCE: CL 13044097 via CL 13044098 via CL 13044099
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v686-13045012)
[CL 13048205 by ryan schmidt in Main branch]
2020-04-27 12:51:59 -04:00
if ( UpdateStampPosition ( GetPendingStampRayWorld ( ) ) = = false )
2020-04-18 18:42:59 -04:00
{
return ;
}
2021-01-31 20:16:41 -04:00
UpdateStampPendingState ( ) ;
if ( IsStampPending ( ) = = false )
{
return ;
}
// need to make sure previous stamp finished
WaitForPendingStampUpdate ( ) ;
2020-04-18 18:42:59 -04:00
// update sculpt ROI
UpdateROI ( CurrentStamp . LocalFrame . Origin ) ;
2021-01-31 20:16:41 -04:00
// Append updated ROI to modified region (async). For some reason this is very expensive,
// maybe because of TSet? but we have a lot of time to do it.
2021-02-03 02:52:36 -04:00
TFuture < void > AccumulateROI = Async ( VertexSculptToolAsyncExecTarget , [ this ] ( )
2020-04-18 18:42:59 -04:00
{
2021-01-31 20:16:41 -04:00
TRACE_CPUPROFILER_EVENT_SCOPE ( VtxSculptTool_Tick_AccumROI ) ;
for ( int32 tid : TriangleROIArray )
{
AccumulatedTriangleROI . Add ( tid ) ;
}
2020-04-18 18:42:59 -04:00
} ) ;
2021-01-31 20:16:41 -04:00
// Start precomputing the normals ROI. This is currently the most expensive single thing we do next
// to Octree re-insertion, despite it being almost trivial. Why?!?
2021-02-03 02:52:36 -04:00
bool bUsingOverlayNormalsOut = false ;
TFuture < void > NormalsROI = Async ( VertexSculptToolAsyncExecTarget , [ Mesh , & bUsingOverlayNormalsOut , this ] ( )
2021-01-31 20:16:41 -04:00
{
TRACE_CPUPROFILER_EVENT_SCOPE ( VtxSculptTool_Tick_NormalsROI ) ;
//UE::SculptUtil::PrecalculateNormalsROI(Mesh, TriangleROIArray, NormalsROIBuilder, bUsingOverlayNormals, false);
2021-02-03 02:52:36 -04:00
UE : : SculptUtil : : PrecalculateNormalsROI ( Mesh , TriangleROIArray , NormalsFlags , bUsingOverlayNormalsOut , false ) ;
2021-01-31 20:16:41 -04:00
} ) ;
// NOTE: you might try to speculatively do the octree remove here, to save doing it later on Reinsert().
// This will not improve things, as Reinsert() checks if it needs to actually re-insert, which avoids many
// removes, and does much of the work of Remove anyway.
// Apply the stamp. This will return a future that is updating the vertex-change record,
// which can run until the end of the frame, as it is using cached information
TFuture < void > UpdateChangeFuture = ApplyStamp ( ) ;
2020-04-18 18:42:59 -04:00
// begin octree rebuild calculation
2021-02-03 02:52:36 -04:00
StampUpdateOctreeFuture = Async ( VertexSculptToolAsyncExecTarget , [ this ] ( )
2020-04-18 18:42:59 -04:00
{
2021-01-31 20:16:41 -04:00
TRACE_CPUPROFILER_EVENT_SCOPE ( VtxSculptTool_Tick_OctreeReinsert ) ;
2021-02-03 02:52:36 -04:00
Octree . ReinsertTrianglesParallel ( TriangleROIArray , OctreeUpdateTempBuffer , OctreeUpdateTempFlagBuffer ) ;
2020-04-18 18:42:59 -04:00
} ) ;
2021-01-31 20:16:41 -04:00
bStampUpdatePending = true ;
//TFuture<void> OctreeRebuild = Async(VertexSculptToolAsyncExecTarget, [&]()
//{
// TRACE_CPUPROFILER_EVENT_SCOPE(VtxSculptTool_Tick_OctreeReinsert);
// Octree.ReinsertTriangles(TriangleROIArray);
//});
// TODO: first step of RecalculateROINormals() is to convert TriangleROI into vertex or element ROI.
// We can do this while we are computing stamp!
// precompute dynamic mesh update info
TArray < int32 > RenderUpdateSets ; FAxisAlignedBox3d RenderUpdateBounds ;
TFuture < bool > RenderUpdatePrecompute = DynamicMeshComponent - > FastNotifyTriangleVerticesUpdated_TryPrecompute (
TriangleROIArray , RenderUpdateSets , RenderUpdateBounds ) ;
2020-04-18 18:42:59 -04:00
// recalculate normals. This has to complete before we can update component
// (in fact we could do it per-chunk...)
{
2021-01-31 20:16:41 -04:00
TRACE_CPUPROFILER_EVENT_SCOPE ( VtxSculptTool_Tick_RecalcNormals ) ;
NormalsROI . Wait ( ) ;
2021-02-03 02:52:36 -04:00
UE : : SculptUtil : : RecalculateROINormals ( Mesh , NormalsFlags , bUsingOverlayNormalsOut ) ;
2021-01-31 20:16:41 -04:00
//UE::SculptUtil::RecalculateROINormals(Mesh, NormalsROIBuilder.Indices(), bUsingOverlayNormals);
2020-04-18 18:42:59 -04:00
}
{
2021-01-31 20:16:41 -04:00
TRACE_CPUPROFILER_EVENT_SCOPE ( VtxSculptTool_Tick_UpdateMesh ) ;
RenderUpdatePrecompute . Wait ( ) ;
DynamicMeshComponent - > FastNotifyTriangleVerticesUpdated_ApplyPrecompute ( TriangleROIArray ,
EMeshRenderAttributeFlags : : Positions | EMeshRenderAttributeFlags : : VertexNormals ,
RenderUpdatePrecompute , RenderUpdateSets , RenderUpdateBounds ) ;
2020-04-18 18:42:59 -04:00
GetToolManager ( ) - > PostInvalidation ( ) ;
}
// we don't really need to wait for these to happen to end Tick()...
2021-01-31 20:16:41 -04:00
UpdateChangeFuture . Wait ( ) ;
2020-04-18 18:42:59 -04:00
AccumulateROI . Wait ( ) ;
}
else if ( bTargetDirty )
{
2021-01-31 20:16:41 -04:00
TRACE_CPUPROFILER_EVENT_SCOPE ( VtxSculptTool_Tick_UpdateTarget ) ;
ModelingTools: Ongoing Sculpting improvements:
- new UMeshSculptBrushOpProps baseclass for per-BrushOp Property Sets, added such a PropertySet for each BrushOp
- separate Strength/Depth/Falloff for each BrushOp so that they can have different settings. Currently cannot be in a shared base PropSet class because of different UProp Category strings
- UMeshSculptToolBase now supports registering BrushOp factory paired w/ ToolProps, rewrote VertexSculpt to use this to handle switching active BrushOp and visible PropSet
- removed UPlaneBrushProperties, vertex sculpt no longer uses USculptMaxBrushProperties (still used by dynamic sculpt)
- moved UMeshSurfacePointTool implementation up to UMeshSculptToolBase
- UMeshSculptToolBase now has OnBeginStroke() / OnEndStroke()API for subclasses to use to handle stroke (instead of overriding drag functions)
- Moved some setup to UMeshSculptToolBase. It can now initializes the target Component, can apply to Simple or Octree variants,
- moved Primary/Secondary BrushOp and active Falloff to UMeshSculptToolBase
- Support for various falloff types implemented in StampFalloffs.h, new EMeshSculptFalloffType exposed in VertexSculpt properties
- moved target component Transforms to UMeshSculptToolBase
- moved Brush Frames to UMeshSculptToolBase. Now storing Frames instead of Point+Normal, moved functions to update position for various stamp types
- UMeshSculptToolBase now has API for hit-testing against Sculpt and Base mesh, VertexSculpt implements
- UMeshSculptToolBase now has APIs for accessing transforms, current DMesh and BaseMesh, active stroke Depth/Strength/Falloff properties,
- moved Brush Target Plane (eg for Move), Stamp Plane (eg for Flatten), and StrokePlane (eg for Plane brushes) to UMeshSculptToolBase, and relevant calcuation APIs
- base USculptBrushProperties now has Lazyness parameter, implemented lazy-brush in base sculpt tool
#rb none
#rnx
#ROBOMERGE-SOURCE: CL 13044097 via CL 13044098 via CL 13044099
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v686-13045012)
[CL 13048205 by ryan schmidt in Main branch]
2020-04-27 12:51:59 -04:00
check ( InStroke ( ) = = false ) ;
2020-04-18 18:42:59 -04:00
// this spawns futures that we could allow to run while other things happen...
UpdateBaseMesh ( & AccumulatedTriangleROI ) ;
AccumulatedTriangleROI . Reset ( ) ;
bTargetDirty = false ;
}
}
2021-01-31 20:16:41 -04:00
void UMeshVertexSculptTool : : WaitForPendingStampUpdate ( )
{
if ( bStampUpdatePending )
{
StampUpdateOctreeFuture . Wait ( ) ;
bStampUpdatePending = true ;
}
}
2020-04-18 18:42:59 -04:00
void UMeshVertexSculptTool : : UpdateBaseMesh ( const TSet < int32 > * TriangleSet )
{
if ( SculptProperties ! = nullptr )
{
bCachedFreezeTarget = SculptProperties - > bFreezeTarget ;
if ( SculptProperties - > bFreezeTarget )
{
return ; // do not update frozen target
}
}
ModelingTools: Ongoing Sculpting improvements:
- new UMeshSculptBrushOpProps baseclass for per-BrushOp Property Sets, added such a PropertySet for each BrushOp
- separate Strength/Depth/Falloff for each BrushOp so that they can have different settings. Currently cannot be in a shared base PropSet class because of different UProp Category strings
- UMeshSculptToolBase now supports registering BrushOp factory paired w/ ToolProps, rewrote VertexSculpt to use this to handle switching active BrushOp and visible PropSet
- removed UPlaneBrushProperties, vertex sculpt no longer uses USculptMaxBrushProperties (still used by dynamic sculpt)
- moved UMeshSurfacePointTool implementation up to UMeshSculptToolBase
- UMeshSculptToolBase now has OnBeginStroke() / OnEndStroke()API for subclasses to use to handle stroke (instead of overriding drag functions)
- Moved some setup to UMeshSculptToolBase. It can now initializes the target Component, can apply to Simple or Octree variants,
- moved Primary/Secondary BrushOp and active Falloff to UMeshSculptToolBase
- Support for various falloff types implemented in StampFalloffs.h, new EMeshSculptFalloffType exposed in VertexSculpt properties
- moved target component Transforms to UMeshSculptToolBase
- moved Brush Frames to UMeshSculptToolBase. Now storing Frames instead of Point+Normal, moved functions to update position for various stamp types
- UMeshSculptToolBase now has API for hit-testing against Sculpt and Base mesh, VertexSculpt implements
- UMeshSculptToolBase now has APIs for accessing transforms, current DMesh and BaseMesh, active stroke Depth/Strength/Falloff properties,
- moved Brush Target Plane (eg for Move), Stamp Plane (eg for Flatten), and StrokePlane (eg for Plane brushes) to UMeshSculptToolBase, and relevant calcuation APIs
- base USculptBrushProperties now has Lazyness parameter, implemented lazy-brush in base sculpt tool
#rb none
#rnx
#ROBOMERGE-SOURCE: CL 13044097 via CL 13044098 via CL 13044099
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v686-13045012)
[CL 13048205 by ryan schmidt in Main branch]
2020-04-27 12:51:59 -04:00
const FDynamicMesh3 * SculptMesh = GetSculptMesh ( ) ;
2020-04-18 18:42:59 -04:00
if ( ! TriangleSet )
{
2021-01-31 20:16:41 -04:00
TRACE_CPUPROFILER_EVENT_SCOPE ( VtxSculptTool_Target_FullUpdate ) ;
2020-04-18 18:42:59 -04:00
BaseMesh . Copy ( * SculptMesh , false , false , false , false ) ;
BaseMesh . EnableVertexNormals ( FVector3f : : UnitZ ( ) ) ;
FMeshNormals : : QuickComputeVertexNormals ( BaseMesh ) ;
BaseMeshSpatial . SetMaxTreeDepth ( 8 ) ;
BaseMeshSpatial = FDynamicMeshOctree3 ( ) ; // need to clear...
BaseMeshSpatial . Initialize ( & BaseMesh ) ;
}
else
{
BaseMeshIndexBuffer . Reset ( ) ;
for ( int32 tid : * TriangleSet )
{
FIndex3i Tri = BaseMesh . GetTriangle ( tid ) ;
BaseMesh . SetVertex ( Tri . A , SculptMesh - > GetVertex ( Tri . A ) ) ;
BaseMesh . SetVertex ( Tri . B , SculptMesh - > GetVertex ( Tri . B ) ) ;
BaseMesh . SetVertex ( Tri . C , SculptMesh - > GetVertex ( Tri . C ) ) ;
BaseMeshIndexBuffer . Add ( tid ) ;
}
2021-02-03 02:52:36 -04:00
auto UpdateBaseNormals = Async ( VertexSculptToolAsyncExecTarget , [ this ] ( )
2020-04-18 18:42:59 -04:00
{
2021-01-31 20:16:41 -04:00
TRACE_CPUPROFILER_EVENT_SCOPE ( VtxSculptTool_Target_UpdateBaseNormals ) ;
2020-04-18 18:42:59 -04:00
FMeshNormals : : QuickComputeVertexNormalsForTriangles ( BaseMesh , BaseMeshIndexBuffer ) ;
} ) ;
2021-02-03 02:52:36 -04:00
auto ReinsertTriangles = Async ( VertexSculptToolAsyncExecTarget , [ TriangleSet , this ] ( )
2020-04-18 18:42:59 -04:00
{
2021-01-31 20:16:41 -04:00
TRACE_CPUPROFILER_EVENT_SCOPE ( VtxSculptTool_Target_Reinsert ) ;
2020-04-18 18:42:59 -04:00
BaseMeshSpatial . ReinsertTriangles ( * TriangleSet ) ;
} ) ;
UpdateBaseNormals . Wait ( ) ;
ReinsertTriangles . Wait ( ) ;
}
}
bool UMeshVertexSculptTool : : GetBaseMeshNearest ( int32 VertexID , const FVector3d & Position , double SearchRadius , FVector3d & TargetPosOut , FVector3d & TargetNormalOut )
{
TargetPosOut = BaseMesh . GetVertex ( VertexID ) ;
TargetNormalOut = ( FVector3d ) BaseMesh . GetVertexNormal ( VertexID ) ;
return true ;
}
void UMeshVertexSculptTool : : IncreaseBrushSpeedAction ( )
{
2021-10-08 10:28:37 -04:00
TUniquePtr < FMeshSculptBrushOp > & UseBrushOp = GetActiveBrushOp ( ) ;
float CurStrength = UseBrushOp - > PropertySet - > GetStrength ( ) ;
float NewStrength = FMath : : Clamp ( CurStrength + 0.05f , 0.0f , 1.0f ) ;
UseBrushOp - > PropertySet - > SetStrength ( NewStrength ) ;
2021-12-10 17:49:08 -05:00
NotifyOfPropertyChangeByTool ( UseBrushOp - > PropertySet . Get ( ) ) ;
2020-04-18 18:42:59 -04:00
}
void UMeshVertexSculptTool : : DecreaseBrushSpeedAction ( )
{
2021-10-08 10:28:37 -04:00
TUniquePtr < FMeshSculptBrushOp > & UseBrushOp = GetActiveBrushOp ( ) ;
float CurStrength = UseBrushOp - > PropertySet - > GetStrength ( ) ;
float NewStrength = FMath : : Clamp ( CurStrength - 0.05f , 0.0f , 1.0f ) ;
UseBrushOp - > PropertySet - > SetStrength ( NewStrength ) ;
2021-12-10 17:49:08 -05:00
NotifyOfPropertyChangeByTool ( UseBrushOp - > PropertySet . Get ( ) ) ;
2020-04-18 18:42:59 -04:00
}
2021-01-31 20:16:41 -04:00
void UMeshVertexSculptTool : : UpdateBrushAlpha ( UTexture2D * NewAlpha )
{
if ( this - > BrushAlpha ! = NewAlpha )
{
this - > BrushAlpha = NewAlpha ;
if ( this - > BrushAlpha ! = nullptr )
{
TImageBuilder < FVector4f > AlphaValues ;
2021-02-24 16:02:48 -04:00
constexpr bool bPreferPlatformData = false ;
2021-07-20 15:48:13 -04:00
const bool bReadOK = UE : : AssetUtils : : ReadTexture ( this - > BrushAlpha , AlphaValues , bPreferPlatformData ) ;
2021-01-31 20:16:41 -04:00
if ( bReadOK )
{
BrushAlphaValues = MoveTemp ( AlphaValues ) ;
2021-07-20 15:48:13 -04:00
BrushAlphaDimensions = AlphaValues . GetDimensions ( ) ;
2021-01-31 20:16:41 -04:00
bHaveBrushAlpha = true ;
2021-12-06 15:44:16 -05:00
BrushIndicatorMaterial - > SetTextureParameterValue ( TEXT ( " BrushAlpha " ) , NewAlpha ) ;
BrushIndicatorMaterial - > SetScalarParameterValue ( TEXT ( " AlphaPower " ) , 1.0 ) ;
2021-01-31 20:16:41 -04:00
return ;
}
}
bHaveBrushAlpha = false ;
BrushAlphaValues = TImageBuilder < FVector4f > ( ) ;
BrushAlphaDimensions = FImageDimensions ( ) ;
2021-12-06 15:44:16 -05:00
BrushIndicatorMaterial - > SetTextureParameterValue ( TEXT ( " BrushAlpha " ) , nullptr ) ;
BrushIndicatorMaterial - > SetScalarParameterValue ( TEXT ( " AlphaPower " ) , 0.0 ) ;
2021-01-31 20:16:41 -04:00
}
}
2020-04-18 18:42:59 -04:00
2021-01-31 20:16:41 -04:00
double UMeshVertexSculptTool : : SampleBrushAlpha ( const FSculptBrushStamp & Stamp , const FVector3d & Position ) const
{
if ( ! bHaveBrushAlpha ) return 1.0 ;
static const FVector4f InvalidValue ( 0 , 0 , 0 , 0 ) ;
FVector2d AlphaUV = Stamp . LocalFrame . ToPlaneUV ( Position , 2 ) ;
double u = AlphaUV . X / Stamp . Radius ;
u = 1.0 - ( u + 1.0 ) / 2.0 ;
double v = AlphaUV . Y / Stamp . Radius ;
v = 1.0 - ( v + 1.0 ) / 2.0 ;
if ( u < 0 | | u > 1 ) return 0.0 ;
if ( v < 0 | | v > 1 ) return 0.0 ;
FVector4f AlphaValue = BrushAlphaValues . BilinearSampleUV < float > ( FVector2d ( u , v ) , InvalidValue ) ;
return FMathd : : Clamp ( AlphaValue . X , 0.0 , 1.0 ) ;
}
2020-04-18 18:42:59 -04:00
//
// Change Tracking
//
void UMeshVertexSculptTool : : BeginChange ( )
{
check ( ActiveVertexChange = = nullptr ) ;
ActiveVertexChange = new FMeshVertexChangeBuilder ( ) ;
}
void UMeshVertexSculptTool : : EndChange ( )
{
check ( ActiveVertexChange ) ;
TUniquePtr < TWrappedToolCommandChange < FMeshVertexChange > > NewChange = MakeUnique < TWrappedToolCommandChange < FMeshVertexChange > > ( ) ;
NewChange - > WrappedChange = MoveTemp ( ActiveVertexChange - > Change ) ;
NewChange - > BeforeModify = [ this ] ( bool bRevert )
{
this - > WaitForPendingUndoRedo ( ) ;
} ;
GetToolManager ( ) - > EmitObjectChange ( DynamicMeshComponent , MoveTemp ( NewChange ) , LOCTEXT ( " VertexSculptChange " , " Brush Stroke " ) ) ;
delete ActiveVertexChange ;
ActiveVertexChange = nullptr ;
}
void UMeshVertexSculptTool : : WaitForPendingUndoRedo ( )
{
if ( bUndoUpdatePending )
{
UndoNormalsFuture . Wait ( ) ;
UndoUpdateOctreeFuture . Wait ( ) ;
UndoUpdateBaseMeshFuture . Wait ( ) ;
bUndoUpdatePending = false ;
}
}
2021-06-12 14:30:22 -04:00
void UMeshVertexSculptTool : : OnDynamicMeshComponentChanged ( UDynamicMeshComponent * Component , const FMeshVertexChange * Change , bool bRevert )
2020-04-18 18:42:59 -04:00
{
2021-01-31 20:16:41 -04:00
// have to wait for any outstanding stamp update to finish...
WaitForPendingStampUpdate ( ) ;
2021-02-03 02:52:36 -04:00
// wait for previous Undo to finish (possibly never hit because the change records do it?)
WaitForPendingUndoRedo ( ) ;
2021-01-31 20:16:41 -04:00
ModelingTools: Ongoing Sculpting improvements:
- new UMeshSculptBrushOpProps baseclass for per-BrushOp Property Sets, added such a PropertySet for each BrushOp
- separate Strength/Depth/Falloff for each BrushOp so that they can have different settings. Currently cannot be in a shared base PropSet class because of different UProp Category strings
- UMeshSculptToolBase now supports registering BrushOp factory paired w/ ToolProps, rewrote VertexSculpt to use this to handle switching active BrushOp and visible PropSet
- removed UPlaneBrushProperties, vertex sculpt no longer uses USculptMaxBrushProperties (still used by dynamic sculpt)
- moved UMeshSurfacePointTool implementation up to UMeshSculptToolBase
- UMeshSculptToolBase now has OnBeginStroke() / OnEndStroke()API for subclasses to use to handle stroke (instead of overriding drag functions)
- Moved some setup to UMeshSculptToolBase. It can now initializes the target Component, can apply to Simple or Octree variants,
- moved Primary/Secondary BrushOp and active Falloff to UMeshSculptToolBase
- Support for various falloff types implemented in StampFalloffs.h, new EMeshSculptFalloffType exposed in VertexSculpt properties
- moved target component Transforms to UMeshSculptToolBase
- moved Brush Frames to UMeshSculptToolBase. Now storing Frames instead of Point+Normal, moved functions to update position for various stamp types
- UMeshSculptToolBase now has API for hit-testing against Sculpt and Base mesh, VertexSculpt implements
- UMeshSculptToolBase now has APIs for accessing transforms, current DMesh and BaseMesh, active stroke Depth/Strength/Falloff properties,
- moved Brush Target Plane (eg for Move), Stamp Plane (eg for Flatten), and StrokePlane (eg for Plane brushes) to UMeshSculptToolBase, and relevant calcuation APIs
- base USculptBrushProperties now has Lazyness parameter, implemented lazy-brush in base sculpt tool
#rb none
#rnx
#ROBOMERGE-SOURCE: CL 13044097 via CL 13044098 via CL 13044099
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v686-13045012)
[CL 13048205 by ryan schmidt in Main branch]
2020-04-27 12:51:59 -04:00
FDynamicMesh3 * Mesh = GetSculptMesh ( ) ;
2020-04-18 18:42:59 -04:00
2021-02-03 02:52:36 -04:00
// figure out the set of modified triangles
AccumulatedTriangleROI . Reset ( ) ;
2021-05-22 01:32:46 -04:00
UE : : Geometry : : VertexToTriangleOneRing ( Mesh , Change - > Vertices , AccumulatedTriangleROI ) ;
2020-04-18 18:42:59 -04:00
// start the normal recomputation
2021-02-03 02:52:36 -04:00
UndoNormalsFuture = Async ( VertexSculptToolAsyncExecTarget , [ this , Mesh ] ( )
2020-04-18 18:42:59 -04:00
{
2021-01-31 20:16:41 -04:00
UE : : SculptUtil : : RecalculateROINormals ( Mesh , AccumulatedTriangleROI , NormalsROIBuilder ) ;
2020-04-18 18:42:59 -04:00
return true ;
} ) ;
// start the octree update
2021-02-03 02:52:36 -04:00
UndoUpdateOctreeFuture = Async ( VertexSculptToolAsyncExecTarget , [ this , Mesh ] ( )
2020-04-18 18:42:59 -04:00
{
Octree . ReinsertTriangles ( AccumulatedTriangleROI ) ;
return true ;
} ) ;
// start the base mesh update
2021-02-03 02:52:36 -04:00
UndoUpdateBaseMeshFuture = Async ( VertexSculptToolAsyncExecTarget , [ this , Mesh ] ( )
2020-04-18 18:42:59 -04:00
{
UpdateBaseMesh ( & AccumulatedTriangleROI ) ;
return true ;
} ) ;
// note that we have a pending update
bUndoUpdatePending = true ;
}
void UMeshVertexSculptTool : : UpdateBrushType ( EMeshVertexSculptBrushType BrushType )
{
2020-05-03 16:02:33 -04:00
static const FText BaseMessage = LOCTEXT ( " OnStartSculptTool " , " Hold Shift to Smooth, Ctrl to Invert (where applicable). [/] and S/D change Size (+Shift to small-step), W/E changes Strength. " ) ;
2020-04-18 18:42:59 -04:00
FTextBuilder Builder ;
Builder . AppendLine ( BaseMessage ) ;
ModelingTools: Ongoing Sculpting improvements:
- new UMeshSculptBrushOpProps baseclass for per-BrushOp Property Sets, added such a PropertySet for each BrushOp
- separate Strength/Depth/Falloff for each BrushOp so that they can have different settings. Currently cannot be in a shared base PropSet class because of different UProp Category strings
- UMeshSculptToolBase now supports registering BrushOp factory paired w/ ToolProps, rewrote VertexSculpt to use this to handle switching active BrushOp and visible PropSet
- removed UPlaneBrushProperties, vertex sculpt no longer uses USculptMaxBrushProperties (still used by dynamic sculpt)
- moved UMeshSurfacePointTool implementation up to UMeshSculptToolBase
- UMeshSculptToolBase now has OnBeginStroke() / OnEndStroke()API for subclasses to use to handle stroke (instead of overriding drag functions)
- Moved some setup to UMeshSculptToolBase. It can now initializes the target Component, can apply to Simple or Octree variants,
- moved Primary/Secondary BrushOp and active Falloff to UMeshSculptToolBase
- Support for various falloff types implemented in StampFalloffs.h, new EMeshSculptFalloffType exposed in VertexSculpt properties
- moved target component Transforms to UMeshSculptToolBase
- moved Brush Frames to UMeshSculptToolBase. Now storing Frames instead of Point+Normal, moved functions to update position for various stamp types
- UMeshSculptToolBase now has API for hit-testing against Sculpt and Base mesh, VertexSculpt implements
- UMeshSculptToolBase now has APIs for accessing transforms, current DMesh and BaseMesh, active stroke Depth/Strength/Falloff properties,
- moved Brush Target Plane (eg for Move), Stamp Plane (eg for Flatten), and StrokePlane (eg for Plane brushes) to UMeshSculptToolBase, and relevant calcuation APIs
- base USculptBrushProperties now has Lazyness parameter, implemented lazy-brush in base sculpt tool
#rb none
#rnx
#ROBOMERGE-SOURCE: CL 13044097 via CL 13044098 via CL 13044099
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v686-13045012)
[CL 13048205 by ryan schmidt in Main branch]
2020-04-27 12:51:59 -04:00
SetActivePrimaryBrushType ( ( int32 ) BrushType ) ;
2020-04-18 18:42:59 -04:00
SetToolPropertySourceEnabled ( GizmoProperties , false ) ;
if ( BrushType = = EMeshVertexSculptBrushType : : FixedPlane )
{
Builder . AppendLine ( LOCTEXT ( " FixedPlaneTip " , " Use T to reposition Work Plane at cursor, Shift+T to align to Normal, Ctrl+Shift+T to align to View " ) ) ;
SetToolPropertySourceEnabled ( GizmoProperties , true ) ;
}
2021-01-31 20:16:41 -04:00
bool bEnableAlpha = false ;
switch ( BrushType )
{
case EMeshVertexSculptBrushType : : Offset :
case EMeshVertexSculptBrushType : : SculptView :
case EMeshVertexSculptBrushType : : SculptMax :
bEnableAlpha = true ; break ;
}
SetToolPropertySourceEnabled ( AlphaProperties , bEnableAlpha ) ;
2020-04-18 18:42:59 -04:00
GetToolManager ( ) - > DisplayMessage ( Builder . ToText ( ) , EToolMessageLevel : : UserNotification ) ;
}
# undef LOCTEXT_NAMESPACE