Files
UnrealEngineUWP/Engine/Source/Developer/Datasmith/DatasmithFacade/Private/DatasmithFacadeActorMesh.cpp
ryan durand 471d972e62 Updating copyright for Engine Developer.
#rnx
#rb none


#ROBOMERGE-SOURCE: CL 10869240 via CL 10869516 via CL 10869902
#ROBOMERGE-BOT: (v613-10869866)

[CL 10870584 by ryan durand in Main branch]
2019-12-26 15:32:37 -05:00

51 lines
1.2 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "DatasmithFacadeActorMesh.h"
FDatasmithFacadeActorMesh::FDatasmithFacadeActorMesh(
const TCHAR* InElementName,
const TCHAR* InElementLabel
) :
FDatasmithFacadeActor(InElementName, InElementLabel)
{
}
void FDatasmithFacadeActorMesh::SetMesh(
const TCHAR* InMeshName
)
{
MeshName = InMeshName;
// Prevent the Datasmith mesh actor from being removed by optimization.
KeepActor();
}
TSharedPtr<IDatasmithActorElement> FDatasmithFacadeActorMesh::CreateActorHierarchy(
TSharedRef<IDatasmithScene> IOSceneRef
) const
{
if (MeshName.IsEmpty())
{
// Create and initialize a Datasmith actor hierarchy.
return FDatasmithFacadeActor::CreateActorHierarchy(IOSceneRef);
}
else
{
// Create a Datasmith mesh actor element.
TSharedPtr<IDatasmithMeshActorElement> MeshActorPtr = FDatasmithSceneFactory::CreateMeshActor(*ElementName);
// Set the Datasmith mesh actor base properties.
SetActorProperties(IOSceneRef, MeshActorPtr);
// Set the static mesh used by the Datasmith mesh actor.
MeshActorPtr->SetStaticMeshPathName(*MeshName);
// Add the hierarchy of children to the Datasmith actor.
AddActorChildren(IOSceneRef, MeshActorPtr);
return MeshActorPtr;
}
}