Files
UnrealEngineUWP/Engine/Source/Runtime/InteractiveToolsFramework/Public/TargetInterfaces/MeshDescriptionProvider.h
nathan mitchell d817f21d71 Modeling Tools: Provide support for the IMeshDescriptionProvider to provide "empty" MeshDescriptions, for cases where such instances are desired such as changing topology. This change creates extendable infrastructure parallel to the existing MeshDescription provider implementations so clients of the empty MeshDescription instances do not need localized specialization based on ToolTarget subclasses.
This change addresses the errors found with applying certain modeling tools to skeletal meshes due to the old code not using the appropriately setup MeshDescription for skeletal meshes.

#rb Ryan.Schmidt
#rnx
#jira UE-138420
#preflight 61d8dbc4430de36baa5fd904

#ROBOMERGE-AUTHOR: nathan.mitchell
#ROBOMERGE-SOURCE: CL 18588220 in //UE5/Release-5.0/... via CL 18588227 via CL 18588243
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Test -> Main) (v899-18417669)

[CL 18588249 by nathan mitchell in ue5-main branch]
2022-01-12 14:53:07 -05:00

49 lines
1.7 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "UObject/Interface.h"
#include "TargetInterfaces/MeshTargetInterfaceTypes.h"
#include "MeshDescription.h"
#include "MeshDescriptionProvider.generated.h"
UINTERFACE()
class INTERACTIVETOOLSFRAMEWORK_API UMeshDescriptionProvider : public UInterface
{
GENERATED_BODY()
};
class INTERACTIVETOOLSFRAMEWORK_API IMeshDescriptionProvider
{
GENERATED_BODY()
public:
/**
* Access the MeshDescription available through this Provider. Note that this MeshDescription may or may not
* be owned by the provider and should not be modified directly. Use IMeshDescriptionCommitter for writes.
* @return pointer to MeshDescription
*/
virtual const FMeshDescription* GetMeshDescription(const FGetMeshParameters& GetMeshParams = FGetMeshParameters()) = 0;
/**
* Returns an empty mesh description appropriate for the provider, i.e. configured with appropriate mesh
attributes but otherwise devoid of topology or element data.
Note: Some of our code expects at least FStaticMeshAttributes to be registered with the provided
mesh description, and will break if some of the attributes that FStaticMeshAttributes uses are not present.
The only reason we don't provide a default implementation here that is identical to the one used in
StaticMeshToolTarget.cpp is to avoid a dependency on the static mesh description module in ITF.
*/
virtual FMeshDescription GetEmptyMeshDescription() = 0;
/**
* Get a copy of the MeshDescription available through this Provider.
*/
virtual FMeshDescription GetMeshDescriptionCopy(const FGetMeshParameters& GetMeshParams)
{
return *GetMeshDescription(GetMeshParams);
}
};