80 lines
2.6 KiB
C++
80 lines
2.6 KiB
C++
// Copyright 2020 Phyronnaz
|
|
|
|
#include "VoxelNodes/VoxelGeneratorSamplerNodes.h"
|
|
#include "CppTranslation/VoxelVariables.h"
|
|
#include "VoxelGenerators/VoxelFlatGenerator.h"
|
|
#include "VoxelGraphGenerator.h"
|
|
#include "VoxelGenerators/VoxelGeneratorInstance.inl"
|
|
#include "NodeFunctions/VoxelNodeFunctions.h"
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
UVoxelNode_SingleGeneratorSamplerBase::UVoxelNode_SingleGeneratorSamplerBase()
|
|
{
|
|
Generator = UVoxelFlatGenerator::StaticClass();
|
|
|
|
SetInputs(
|
|
{ "X", EC::Float, "X" },
|
|
{ "Y", EC::Float, "Y" },
|
|
{ "Z", EC::Float, "Z" });
|
|
}
|
|
|
|
FText UVoxelNode_SingleGeneratorSamplerBase::GetTitle() const
|
|
{
|
|
return FText::Format(
|
|
VOXEL_LOCTEXT("Generator: {0}"),
|
|
FText::FromString(UniqueName.ToString()));
|
|
}
|
|
|
|
void UVoxelNode_SingleGeneratorSamplerBase::LogErrors(FVoxelGraphErrorReporter& ErrorReporter)
|
|
{
|
|
Super::LogErrors(ErrorReporter);
|
|
|
|
if (!Generator.IsValid())
|
|
{
|
|
ErrorReporter.AddMessageToNode(this, "invalid generator", EVoxelGraphNodeMessageType::Error);
|
|
}
|
|
}
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
UVoxelNode_GetGeneratorValue::UVoxelNode_GetGeneratorValue()
|
|
{
|
|
SetOutputs({"", EC::Float, "Value"});
|
|
}
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
UVoxelNode_GetGeneratorMaterial::UVoxelNode_GetGeneratorMaterial()
|
|
{
|
|
SetOutputs({ "", EC::Material, "Material" });
|
|
}
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
UVoxelNode_GetGeneratorCustomOutput::UVoxelNode_GetGeneratorCustomOutput()
|
|
{
|
|
SetOutputs({ "", EC::Float, "Custom Output Value" });
|
|
}
|
|
|
|
FText UVoxelNode_GetGeneratorCustomOutput::GetTitle() const
|
|
{
|
|
return FText::FromString("Get Generator Custom Output: " + OutputName.ToString());
|
|
}
|
|
|