2022-09-26 15:12:13 -04:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
2022-10-01 02:06:09 -04:00
|
|
|
#include "MuT/ASTOpMeshExtractLayoutBlocks.h"
|
2022-10-02 10:56:02 -04:00
|
|
|
|
2023-09-26 04:43:37 -04:00
|
|
|
#include "MuT/ASTOpSwitch.h"
|
|
|
|
|
#include "MuT/ASTOpConditional.h"
|
2023-12-01 04:46:27 -05:00
|
|
|
#include "MuT/ASTOpMeshAddTags.h"
|
|
|
|
|
#include "MuT/ASTOpMeshMorph.h"
|
|
|
|
|
#include "MuT/ASTOpMeshRemoveMask.h"
|
|
|
|
|
#include "MuT/ASTOpMeshClipMorphPlane.h"
|
[mutable] Convert the following nodes to modifiers: EditMaterial, ExtendMaterial, RemoveMesh, RemoveMeshBlocks, MorphMaterial.
- Rename some existing modifier nodes to actually be prefixed "Modifier" instead of "Mesh".
- Added additional entry points for modifiers during code generation. Now there are 4: right after generating a mesh constant, right after all mesh operations have been generated, right after a texture block has been generated and right after a texture has been generated.
- Fix bug with mesh clip with UV mask when layout blocks were used.
- For legacy data conversion autogenerated tags are created and assigned to the material nodes and the new modifier nodes.
- MorphMaterial code generation has been redesigned passing all morphs to the MutableTools layer.
#jira UE-221279
#jira UE-221278
#rnx
[REVIEW] [at]genis.sole, [at]gerard.martin, [at]pere.rifa
#rb genis.sole, gerard.martin, pere.rifa
[CL 35952198 by jordi rovira in ue5-main branch]
2024-09-02 04:15:31 -04:00
|
|
|
#include "MuT/ASTOpMeshApplyPose.h"
|
2022-10-02 10:56:02 -04:00
|
|
|
#include "MuR/ModelPrivate.h"
|
|
|
|
|
#include "MuR/RefCounted.h"
|
|
|
|
|
#include "MuR/Types.h"
|
2023-12-01 04:46:27 -05:00
|
|
|
#include "Misc/AssertionMacros.h"
|
2022-09-26 15:12:13 -04:00
|
|
|
|
2022-10-18 04:42:25 -04:00
|
|
|
namespace mu
|
2022-09-26 15:12:13 -04:00
|
|
|
{
|
2022-10-18 04:42:25 -04:00
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------
|
|
|
|
|
//---------------------------------------------------------------------------------------------
|
|
|
|
|
//---------------------------------------------------------------------------------------------
|
|
|
|
|
ASTOpMeshExtractLayoutBlocks::ASTOpMeshExtractLayoutBlocks()
|
2023-09-26 04:43:37 -04:00
|
|
|
: Source(this)
|
2022-10-18 04:42:25 -04:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ASTOpMeshExtractLayoutBlocks::~ASTOpMeshExtractLayoutBlocks()
|
|
|
|
|
{
|
|
|
|
|
// Explicit call needed to avoid recursive destruction
|
|
|
|
|
ASTOp::RemoveChildren();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool ASTOpMeshExtractLayoutBlocks::IsEqual(const ASTOp& otherUntyped) const
|
|
|
|
|
{
|
2024-01-18 03:27:38 -05:00
|
|
|
if (otherUntyped.GetOpType() == GetOpType())
|
2022-10-18 04:42:25 -04:00
|
|
|
{
|
2024-01-18 03:27:38 -05:00
|
|
|
const ASTOpMeshExtractLayoutBlocks* other = static_cast<const ASTOpMeshExtractLayoutBlocks*>(&otherUntyped);
|
2024-08-05 03:50:33 -04:00
|
|
|
return Source == other->Source && LayoutIndex == other->LayoutIndex && Blocks == other->Blocks;
|
2022-10-18 04:42:25 -04:00
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mu::Ptr<ASTOp> ASTOpMeshExtractLayoutBlocks::Clone(MapChildFuncRef mapChild) const
|
|
|
|
|
{
|
|
|
|
|
Ptr<ASTOpMeshExtractLayoutBlocks> n = new ASTOpMeshExtractLayoutBlocks();
|
2023-09-26 04:43:37 -04:00
|
|
|
n->Source = mapChild(Source.child());
|
2024-08-05 03:50:33 -04:00
|
|
|
n->LayoutIndex = LayoutIndex;
|
2023-09-26 04:43:37 -04:00
|
|
|
n->Blocks = Blocks;
|
2022-10-18 04:42:25 -04:00
|
|
|
return n;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ASTOpMeshExtractLayoutBlocks::Assert()
|
|
|
|
|
{
|
2023-09-26 04:43:37 -04:00
|
|
|
check(Blocks.Num() < std::numeric_limits<uint16>::max());
|
2022-10-18 04:42:25 -04:00
|
|
|
ASTOp::Assert();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ASTOpMeshExtractLayoutBlocks::ForEachChild(const TFunctionRef<void(ASTChild&)> f)
|
|
|
|
|
{
|
2023-09-26 04:43:37 -04:00
|
|
|
f(Source);
|
2022-10-18 04:42:25 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uint64 ASTOpMeshExtractLayoutBlocks::Hash() const
|
|
|
|
|
{
|
2023-09-26 04:43:37 -04:00
|
|
|
uint64 res = std::hash<size_t>()(size_t(Source.child().get()));
|
2022-10-18 04:42:25 -04:00
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2023-07-28 04:00:17 -04:00
|
|
|
void ASTOpMeshExtractLayoutBlocks::Link(FProgram& program, FLinkerOptions*)
|
2022-10-18 04:42:25 -04:00
|
|
|
{
|
|
|
|
|
// Already linked?
|
|
|
|
|
if (!linkedAddress)
|
|
|
|
|
{
|
|
|
|
|
linkedAddress = (OP::ADDRESS)program.m_opAddress.Num();
|
|
|
|
|
|
|
|
|
|
program.m_opAddress.Add((uint32)program.m_byteCode.Num());
|
|
|
|
|
AppendCode(program.m_byteCode, OP_TYPE::ME_EXTRACTLAYOUTBLOCK);
|
2023-09-26 04:43:37 -04:00
|
|
|
OP::ADDRESS sourceAt = Source ? Source->linkedAddress : 0;
|
2022-10-18 04:42:25 -04:00
|
|
|
AppendCode(program.m_byteCode, sourceAt);
|
2024-08-05 03:50:33 -04:00
|
|
|
AppendCode(program.m_byteCode, (uint16)LayoutIndex);
|
2023-09-26 04:43:37 -04:00
|
|
|
AppendCode(program.m_byteCode, (uint16)Blocks.Num());
|
2022-10-18 04:42:25 -04:00
|
|
|
|
2024-05-13 03:20:24 -04:00
|
|
|
for (uint64 Id : Blocks)
|
2022-10-18 04:42:25 -04:00
|
|
|
{
|
2024-05-13 03:20:24 -04:00
|
|
|
AppendCode(program.m_byteCode, Id);
|
2022-10-18 04:42:25 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
[mutable] Convert the following nodes to modifiers: EditMaterial, ExtendMaterial, RemoveMesh, RemoveMeshBlocks, MorphMaterial.
- Rename some existing modifier nodes to actually be prefixed "Modifier" instead of "Mesh".
- Added additional entry points for modifiers during code generation. Now there are 4: right after generating a mesh constant, right after all mesh operations have been generated, right after a texture block has been generated and right after a texture has been generated.
- Fix bug with mesh clip with UV mask when layout blocks were used.
- For legacy data conversion autogenerated tags are created and assigned to the material nodes and the new modifier nodes.
- MorphMaterial code generation has been redesigned passing all morphs to the MutableTools layer.
#jira UE-221279
#jira UE-221278
#rnx
[REVIEW] [at]genis.sole, [at]gerard.martin, [at]pere.rifa
#rb genis.sole, gerard.martin, pere.rifa
[CL 35952198 by jordi rovira in ue5-main branch]
2024-09-02 04:15:31 -04:00
|
|
|
|
|
|
|
|
mu::Ptr<ASTOp> ASTOpMeshExtractLayoutBlocks::OptimiseSink(const FModelOptimizationOptions&, FOptimizeSinkContext& Context) const
|
2023-09-26 04:43:37 -04:00
|
|
|
{
|
[mutable] Convert the following nodes to modifiers: EditMaterial, ExtendMaterial, RemoveMesh, RemoveMeshBlocks, MorphMaterial.
- Rename some existing modifier nodes to actually be prefixed "Modifier" instead of "Mesh".
- Added additional entry points for modifiers during code generation. Now there are 4: right after generating a mesh constant, right after all mesh operations have been generated, right after a texture block has been generated and right after a texture has been generated.
- Fix bug with mesh clip with UV mask when layout blocks were used.
- For legacy data conversion autogenerated tags are created and assigned to the material nodes and the new modifier nodes.
- MorphMaterial code generation has been redesigned passing all morphs to the MutableTools layer.
#jira UE-221279
#jira UE-221278
#rnx
[REVIEW] [at]genis.sole, [at]gerard.martin, [at]pere.rifa
#rb genis.sole, gerard.martin, pere.rifa
[CL 35952198 by jordi rovira in ue5-main branch]
2024-09-02 04:15:31 -04:00
|
|
|
mu::Ptr<ASTOp> NewOp = Context.MeshExtractLayoutBlocksSinker.Apply(this);
|
|
|
|
|
return NewOp;
|
|
|
|
|
}
|
2023-09-26 04:43:37 -04:00
|
|
|
|
[mutable] Convert the following nodes to modifiers: EditMaterial, ExtendMaterial, RemoveMesh, RemoveMeshBlocks, MorphMaterial.
- Rename some existing modifier nodes to actually be prefixed "Modifier" instead of "Mesh".
- Added additional entry points for modifiers during code generation. Now there are 4: right after generating a mesh constant, right after all mesh operations have been generated, right after a texture block has been generated and right after a texture has been generated.
- Fix bug with mesh clip with UV mask when layout blocks were used.
- For legacy data conversion autogenerated tags are created and assigned to the material nodes and the new modifier nodes.
- MorphMaterial code generation has been redesigned passing all morphs to the MutableTools layer.
#jira UE-221279
#jira UE-221278
#rnx
[REVIEW] [at]genis.sole, [at]gerard.martin, [at]pere.rifa
#rb genis.sole, gerard.martin, pere.rifa
[CL 35952198 by jordi rovira in ue5-main branch]
2024-09-02 04:15:31 -04:00
|
|
|
|
2024-10-01 18:10:37 -04:00
|
|
|
FSourceDataDescriptor ASTOpMeshExtractLayoutBlocks::GetSourceDataDescriptor(FGetSourceDataDescriptorContext* Context) const
|
|
|
|
|
{
|
|
|
|
|
if (Source)
|
|
|
|
|
{
|
|
|
|
|
return Source->GetSourceDataDescriptor(Context);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return {};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
[mutable] Convert the following nodes to modifiers: EditMaterial, ExtendMaterial, RemoveMesh, RemoveMeshBlocks, MorphMaterial.
- Rename some existing modifier nodes to actually be prefixed "Modifier" instead of "Mesh".
- Added additional entry points for modifiers during code generation. Now there are 4: right after generating a mesh constant, right after all mesh operations have been generated, right after a texture block has been generated and right after a texture has been generated.
- Fix bug with mesh clip with UV mask when layout blocks were used.
- For legacy data conversion autogenerated tags are created and assigned to the material nodes and the new modifier nodes.
- MorphMaterial code generation has been redesigned passing all morphs to the MutableTools layer.
#jira UE-221279
#jira UE-221278
#rnx
[REVIEW] [at]genis.sole, [at]gerard.martin, [at]pere.rifa
#rb genis.sole, gerard.martin, pere.rifa
[CL 35952198 by jordi rovira in ue5-main branch]
2024-09-02 04:15:31 -04:00
|
|
|
//---------------------------------------------------------------------------------------------
|
|
|
|
|
mu::Ptr<ASTOp> Sink_MeshExtractLayoutBlocksAST::Apply(const ASTOpMeshExtractLayoutBlocks* root)
|
|
|
|
|
{
|
|
|
|
|
m_root = root;
|
|
|
|
|
|
|
|
|
|
OldToNew.Reset();
|
|
|
|
|
|
|
|
|
|
m_initialSource = m_root->Source.child();
|
|
|
|
|
mu::Ptr<ASTOp> newSource = Visit(m_initialSource, m_root);
|
|
|
|
|
|
|
|
|
|
// If there is any change, it is the new root.
|
|
|
|
|
if (newSource != m_initialSource)
|
2023-09-26 04:43:37 -04:00
|
|
|
{
|
[mutable] Convert the following nodes to modifiers: EditMaterial, ExtendMaterial, RemoveMesh, RemoveMeshBlocks, MorphMaterial.
- Rename some existing modifier nodes to actually be prefixed "Modifier" instead of "Mesh".
- Added additional entry points for modifiers during code generation. Now there are 4: right after generating a mesh constant, right after all mesh operations have been generated, right after a texture block has been generated and right after a texture has been generated.
- Fix bug with mesh clip with UV mask when layout blocks were used.
- For legacy data conversion autogenerated tags are created and assigned to the material nodes and the new modifier nodes.
- MorphMaterial code generation has been redesigned passing all morphs to the MutableTools layer.
#jira UE-221279
#jira UE-221278
#rnx
[REVIEW] [at]genis.sole, [at]gerard.martin, [at]pere.rifa
#rb genis.sole, gerard.martin, pere.rifa
[CL 35952198 by jordi rovira in ue5-main branch]
2024-09-02 04:15:31 -04:00
|
|
|
return newSource;
|
2023-09-26 04:43:37 -04:00
|
|
|
}
|
|
|
|
|
|
[mutable] Convert the following nodes to modifiers: EditMaterial, ExtendMaterial, RemoveMesh, RemoveMeshBlocks, MorphMaterial.
- Rename some existing modifier nodes to actually be prefixed "Modifier" instead of "Mesh".
- Added additional entry points for modifiers during code generation. Now there are 4: right after generating a mesh constant, right after all mesh operations have been generated, right after a texture block has been generated and right after a texture has been generated.
- Fix bug with mesh clip with UV mask when layout blocks were used.
- For legacy data conversion autogenerated tags are created and assigned to the material nodes and the new modifier nodes.
- MorphMaterial code generation has been redesigned passing all morphs to the MutableTools layer.
#jira UE-221279
#jira UE-221278
#rnx
[REVIEW] [at]genis.sole, [at]gerard.martin, [at]pere.rifa
#rb genis.sole, gerard.martin, pere.rifa
[CL 35952198 by jordi rovira in ue5-main branch]
2024-09-02 04:15:31 -04:00
|
|
|
return nullptr;
|
|
|
|
|
}
|
2023-09-26 04:43:37 -04:00
|
|
|
|
[mutable] Convert the following nodes to modifiers: EditMaterial, ExtendMaterial, RemoveMesh, RemoveMeshBlocks, MorphMaterial.
- Rename some existing modifier nodes to actually be prefixed "Modifier" instead of "Mesh".
- Added additional entry points for modifiers during code generation. Now there are 4: right after generating a mesh constant, right after all mesh operations have been generated, right after a texture block has been generated and right after a texture has been generated.
- Fix bug with mesh clip with UV mask when layout blocks were used.
- For legacy data conversion autogenerated tags are created and assigned to the material nodes and the new modifier nodes.
- MorphMaterial code generation has been redesigned passing all morphs to the MutableTools layer.
#jira UE-221279
#jira UE-221278
#rnx
[REVIEW] [at]genis.sole, [at]gerard.martin, [at]pere.rifa
#rb genis.sole, gerard.martin, pere.rifa
[CL 35952198 by jordi rovira in ue5-main branch]
2024-09-02 04:15:31 -04:00
|
|
|
mu::Ptr<ASTOp> Sink_MeshExtractLayoutBlocksAST::Visit(const mu::Ptr<ASTOp>& at, const ASTOpMeshExtractLayoutBlocks* currentSinkOp)
|
|
|
|
|
{
|
|
|
|
|
if (!at) return nullptr;
|
|
|
|
|
|
|
|
|
|
// Already visited?
|
|
|
|
|
const Ptr<ASTOp>* Cached = OldToNew.Find({ at, currentSinkOp });
|
|
|
|
|
if (Cached)
|
|
|
|
|
{
|
|
|
|
|
return *Cached;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
mu::Ptr<ASTOp> newAt = at;
|
|
|
|
|
switch (at->GetOpType())
|
2023-09-26 04:43:37 -04:00
|
|
|
{
|
|
|
|
|
|
[mutable] Convert the following nodes to modifiers: EditMaterial, ExtendMaterial, RemoveMesh, RemoveMeshBlocks, MorphMaterial.
- Rename some existing modifier nodes to actually be prefixed "Modifier" instead of "Mesh".
- Added additional entry points for modifiers during code generation. Now there are 4: right after generating a mesh constant, right after all mesh operations have been generated, right after a texture block has been generated and right after a texture has been generated.
- Fix bug with mesh clip with UV mask when layout blocks were used.
- For legacy data conversion autogenerated tags are created and assigned to the material nodes and the new modifier nodes.
- MorphMaterial code generation has been redesigned passing all morphs to the MutableTools layer.
#jira UE-221279
#jira UE-221278
#rnx
[REVIEW] [at]genis.sole, [at]gerard.martin, [at]pere.rifa
#rb genis.sole, gerard.martin, pere.rifa
[CL 35952198 by jordi rovira in ue5-main branch]
2024-09-02 04:15:31 -04:00
|
|
|
case OP_TYPE::ME_APPLYLAYOUT:
|
2023-09-26 04:43:37 -04:00
|
|
|
{
|
[mutable] Convert the following nodes to modifiers: EditMaterial, ExtendMaterial, RemoveMesh, RemoveMeshBlocks, MorphMaterial.
- Rename some existing modifier nodes to actually be prefixed "Modifier" instead of "Mesh".
- Added additional entry points for modifiers during code generation. Now there are 4: right after generating a mesh constant, right after all mesh operations have been generated, right after a texture block has been generated and right after a texture has been generated.
- Fix bug with mesh clip with UV mask when layout blocks were used.
- For legacy data conversion autogenerated tags are created and assigned to the material nodes and the new modifier nodes.
- MorphMaterial code generation has been redesigned passing all morphs to the MutableTools layer.
#jira UE-221279
#jira UE-221278
#rnx
[REVIEW] [at]genis.sole, [at]gerard.martin, [at]pere.rifa
#rb genis.sole, gerard.martin, pere.rifa
[CL 35952198 by jordi rovira in ue5-main branch]
2024-09-02 04:15:31 -04:00
|
|
|
Ptr<ASTOpFixed> newOp = mu::Clone<ASTOpFixed>(at);
|
|
|
|
|
newOp->SetChild(newOp->op.args.MeshApplyLayout.mesh, Visit(newOp->children[newOp->op.args.MeshApplyLayout.mesh].child(), currentSinkOp));
|
|
|
|
|
newAt = newOp;
|
2023-09-26 04:43:37 -04:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
[mutable] Convert the following nodes to modifiers: EditMaterial, ExtendMaterial, RemoveMesh, RemoveMeshBlocks, MorphMaterial.
- Rename some existing modifier nodes to actually be prefixed "Modifier" instead of "Mesh".
- Added additional entry points for modifiers during code generation. Now there are 4: right after generating a mesh constant, right after all mesh operations have been generated, right after a texture block has been generated and right after a texture has been generated.
- Fix bug with mesh clip with UV mask when layout blocks were used.
- For legacy data conversion autogenerated tags are created and assigned to the material nodes and the new modifier nodes.
- MorphMaterial code generation has been redesigned passing all morphs to the MutableTools layer.
#jira UE-221279
#jira UE-221278
#rnx
[REVIEW] [at]genis.sole, [at]gerard.martin, [at]pere.rifa
#rb genis.sole, gerard.martin, pere.rifa
[CL 35952198 by jordi rovira in ue5-main branch]
2024-09-02 04:15:31 -04:00
|
|
|
case OP_TYPE::ME_SETSKELETON:
|
2023-09-26 04:43:37 -04:00
|
|
|
{
|
[mutable] Convert the following nodes to modifiers: EditMaterial, ExtendMaterial, RemoveMesh, RemoveMeshBlocks, MorphMaterial.
- Rename some existing modifier nodes to actually be prefixed "Modifier" instead of "Mesh".
- Added additional entry points for modifiers during code generation. Now there are 4: right after generating a mesh constant, right after all mesh operations have been generated, right after a texture block has been generated and right after a texture has been generated.
- Fix bug with mesh clip with UV mask when layout blocks were used.
- For legacy data conversion autogenerated tags are created and assigned to the material nodes and the new modifier nodes.
- MorphMaterial code generation has been redesigned passing all morphs to the MutableTools layer.
#jira UE-221279
#jira UE-221278
#rnx
[REVIEW] [at]genis.sole, [at]gerard.martin, [at]pere.rifa
#rb genis.sole, gerard.martin, pere.rifa
[CL 35952198 by jordi rovira in ue5-main branch]
2024-09-02 04:15:31 -04:00
|
|
|
Ptr<ASTOpFixed> newOp = mu::Clone<ASTOpFixed>(at);
|
|
|
|
|
newOp->SetChild(newOp->op.args.MeshSetSkeleton.source, Visit(newOp->children[newOp->op.args.MeshSetSkeleton.source].child(), currentSinkOp));
|
|
|
|
|
newAt = newOp;
|
2023-09-26 04:43:37 -04:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
2023-12-01 04:46:27 -05:00
|
|
|
case OP_TYPE::ME_ADDTAGS:
|
|
|
|
|
{
|
[mutable] Convert the following nodes to modifiers: EditMaterial, ExtendMaterial, RemoveMesh, RemoveMeshBlocks, MorphMaterial.
- Rename some existing modifier nodes to actually be prefixed "Modifier" instead of "Mesh".
- Added additional entry points for modifiers during code generation. Now there are 4: right after generating a mesh constant, right after all mesh operations have been generated, right after a texture block has been generated and right after a texture has been generated.
- Fix bug with mesh clip with UV mask when layout blocks were used.
- For legacy data conversion autogenerated tags are created and assigned to the material nodes and the new modifier nodes.
- MorphMaterial code generation has been redesigned passing all morphs to the MutableTools layer.
#jira UE-221279
#jira UE-221278
#rnx
[REVIEW] [at]genis.sole, [at]gerard.martin, [at]pere.rifa
#rb genis.sole, gerard.martin, pere.rifa
[CL 35952198 by jordi rovira in ue5-main branch]
2024-09-02 04:15:31 -04:00
|
|
|
Ptr<ASTOpMeshAddTags> newOp = mu::Clone<ASTOpMeshAddTags>(at);
|
|
|
|
|
newOp->Source = Visit(newOp->Source.child(), currentSinkOp);
|
|
|
|
|
newAt = newOp;
|
2023-12-01 04:46:27 -05:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case OP_TYPE::ME_CLIPMORPHPLANE:
|
|
|
|
|
{
|
[mutable] Convert the following nodes to modifiers: EditMaterial, ExtendMaterial, RemoveMesh, RemoveMeshBlocks, MorphMaterial.
- Rename some existing modifier nodes to actually be prefixed "Modifier" instead of "Mesh".
- Added additional entry points for modifiers during code generation. Now there are 4: right after generating a mesh constant, right after all mesh operations have been generated, right after a texture block has been generated and right after a texture has been generated.
- Fix bug with mesh clip with UV mask when layout blocks were used.
- For legacy data conversion autogenerated tags are created and assigned to the material nodes and the new modifier nodes.
- MorphMaterial code generation has been redesigned passing all morphs to the MutableTools layer.
#jira UE-221279
#jira UE-221278
#rnx
[REVIEW] [at]genis.sole, [at]gerard.martin, [at]pere.rifa
#rb genis.sole, gerard.martin, pere.rifa
[CL 35952198 by jordi rovira in ue5-main branch]
2024-09-02 04:15:31 -04:00
|
|
|
Ptr<ASTOpMeshClipMorphPlane> newOp = mu::Clone<ASTOpMeshClipMorphPlane>(at);
|
|
|
|
|
newOp->source = Visit(newOp->source.child(), currentSinkOp);
|
|
|
|
|
newAt = newOp;
|
|
|
|
|
break;
|
|
|
|
|
}
|
2023-12-01 04:46:27 -05:00
|
|
|
|
[mutable] Convert the following nodes to modifiers: EditMaterial, ExtendMaterial, RemoveMesh, RemoveMeshBlocks, MorphMaterial.
- Rename some existing modifier nodes to actually be prefixed "Modifier" instead of "Mesh".
- Added additional entry points for modifiers during code generation. Now there are 4: right after generating a mesh constant, right after all mesh operations have been generated, right after a texture block has been generated and right after a texture has been generated.
- Fix bug with mesh clip with UV mask when layout blocks were used.
- For legacy data conversion autogenerated tags are created and assigned to the material nodes and the new modifier nodes.
- MorphMaterial code generation has been redesigned passing all morphs to the MutableTools layer.
#jira UE-221279
#jira UE-221278
#rnx
[REVIEW] [at]genis.sole, [at]gerard.martin, [at]pere.rifa
#rb genis.sole, gerard.martin, pere.rifa
[CL 35952198 by jordi rovira in ue5-main branch]
2024-09-02 04:15:31 -04:00
|
|
|
case OP_TYPE::ME_MORPH:
|
|
|
|
|
{
|
|
|
|
|
Ptr<ASTOpMeshMorph> NewOp = mu::Clone<ASTOpMeshMorph>(at);
|
|
|
|
|
NewOp->Base = Visit(NewOp->Base.child(), currentSinkOp);
|
|
|
|
|
NewOp->Target = Visit(NewOp->Target.child(), currentSinkOp);
|
|
|
|
|
newAt = NewOp;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case OP_TYPE::ME_MERGE:
|
|
|
|
|
{
|
|
|
|
|
Ptr<ASTOpFixed> newOp = mu::Clone<ASTOpFixed>(at);
|
|
|
|
|
newOp->SetChild(newOp->op.args.MeshMerge.base, Visit(newOp->children[newOp->op.args.MeshMerge.base].child(), currentSinkOp));
|
|
|
|
|
newOp->SetChild(newOp->op.args.MeshMerge.added, Visit(newOp->children[newOp->op.args.MeshMerge.added].child(), currentSinkOp));
|
|
|
|
|
newAt = newOp;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case OP_TYPE::ME_APPLYPOSE:
|
|
|
|
|
{
|
|
|
|
|
Ptr<ASTOpMeshApplyPose> NewOp = mu::Clone<ASTOpMeshApplyPose>(at);
|
|
|
|
|
NewOp->base = Visit(NewOp->base.child(), currentSinkOp);
|
|
|
|
|
newAt = NewOp;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case OP_TYPE::ME_INTERPOLATE:
|
|
|
|
|
{
|
|
|
|
|
Ptr<ASTOpFixed> newOp = mu::Clone<ASTOpFixed>(at);
|
|
|
|
|
newOp->SetChild(newOp->op.args.MeshInterpolate.base, Visit(newOp->children[newOp->op.args.MeshInterpolate.base].child(), currentSinkOp));
|
|
|
|
|
|
|
|
|
|
for (int32 t = 0; t < MUTABLE_OP_MAX_INTERPOLATE_COUNT - 1; ++t)
|
2023-12-01 04:46:27 -05:00
|
|
|
{
|
[mutable] Convert the following nodes to modifiers: EditMaterial, ExtendMaterial, RemoveMesh, RemoveMeshBlocks, MorphMaterial.
- Rename some existing modifier nodes to actually be prefixed "Modifier" instead of "Mesh".
- Added additional entry points for modifiers during code generation. Now there are 4: right after generating a mesh constant, right after all mesh operations have been generated, right after a texture block has been generated and right after a texture has been generated.
- Fix bug with mesh clip with UV mask when layout blocks were used.
- For legacy data conversion autogenerated tags are created and assigned to the material nodes and the new modifier nodes.
- MorphMaterial code generation has been redesigned passing all morphs to the MutableTools layer.
#jira UE-221279
#jira UE-221278
#rnx
[REVIEW] [at]genis.sole, [at]gerard.martin, [at]pere.rifa
#rb genis.sole, gerard.martin, pere.rifa
[CL 35952198 by jordi rovira in ue5-main branch]
2024-09-02 04:15:31 -04:00
|
|
|
if (newOp->children[newOp->op.args.MeshInterpolate.targets[t]])
|
|
|
|
|
{
|
|
|
|
|
newOp->SetChild(newOp->op.args.MeshInterpolate.targets[t], Visit(newOp->children[newOp->op.args.MeshInterpolate.targets[t]].child(), currentSinkOp));
|
|
|
|
|
}
|
2023-12-01 04:46:27 -05:00
|
|
|
}
|
|
|
|
|
|
[mutable] Convert the following nodes to modifiers: EditMaterial, ExtendMaterial, RemoveMesh, RemoveMeshBlocks, MorphMaterial.
- Rename some existing modifier nodes to actually be prefixed "Modifier" instead of "Mesh".
- Added additional entry points for modifiers during code generation. Now there are 4: right after generating a mesh constant, right after all mesh operations have been generated, right after a texture block has been generated and right after a texture has been generated.
- Fix bug with mesh clip with UV mask when layout blocks were used.
- For legacy data conversion autogenerated tags are created and assigned to the material nodes and the new modifier nodes.
- MorphMaterial code generation has been redesigned passing all morphs to the MutableTools layer.
#jira UE-221279
#jira UE-221278
#rnx
[REVIEW] [at]genis.sole, [at]gerard.martin, [at]pere.rifa
#rb genis.sole, gerard.martin, pere.rifa
[CL 35952198 by jordi rovira in ue5-main branch]
2024-09-02 04:15:31 -04:00
|
|
|
newAt = newOp;
|
2023-12-01 04:46:27 -05:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
[mutable] Convert the following nodes to modifiers: EditMaterial, ExtendMaterial, RemoveMesh, RemoveMeshBlocks, MorphMaterial.
- Rename some existing modifier nodes to actually be prefixed "Modifier" instead of "Mesh".
- Added additional entry points for modifiers during code generation. Now there are 4: right after generating a mesh constant, right after all mesh operations have been generated, right after a texture block has been generated and right after a texture has been generated.
- Fix bug with mesh clip with UV mask when layout blocks were used.
- For legacy data conversion autogenerated tags are created and assigned to the material nodes and the new modifier nodes.
- MorphMaterial code generation has been redesigned passing all morphs to the MutableTools layer.
#jira UE-221279
#jira UE-221278
#rnx
[REVIEW] [at]genis.sole, [at]gerard.martin, [at]pere.rifa
#rb genis.sole, gerard.martin, pere.rifa
[CL 35952198 by jordi rovira in ue5-main branch]
2024-09-02 04:15:31 -04:00
|
|
|
case OP_TYPE::ME_REMOVEMASK:
|
|
|
|
|
{
|
|
|
|
|
// TODO: Make mask smaller?
|
|
|
|
|
Ptr<ASTOpMeshRemoveMask> newOp = mu::Clone<ASTOpMeshRemoveMask>(at);
|
|
|
|
|
newOp->source = Visit(newOp->source.child(), currentSinkOp);
|
|
|
|
|
newAt = newOp;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case OP_TYPE::ME_CONDITIONAL:
|
|
|
|
|
{
|
|
|
|
|
Ptr<ASTOpConditional> newOp = mu::Clone<ASTOpConditional>(at);
|
|
|
|
|
newOp->yes = Visit(newOp->yes.child(), currentSinkOp);
|
|
|
|
|
newOp->no = Visit(newOp->no.child(), currentSinkOp);
|
|
|
|
|
newAt = newOp;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case OP_TYPE::ME_SWITCH:
|
|
|
|
|
{
|
|
|
|
|
Ptr<ASTOpSwitch> newOp = mu::Clone<ASTOpSwitch>(at);
|
|
|
|
|
newOp->def = Visit(newOp->def.child(), currentSinkOp);
|
|
|
|
|
for (ASTOpSwitch::FCase& c : newOp->cases)
|
|
|
|
|
{
|
|
|
|
|
c.branch = Visit(c.branch.child(), currentSinkOp);
|
|
|
|
|
}
|
|
|
|
|
newAt = newOp;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// If we reach here it means the operation type has not bee optimized.
|
2023-09-26 04:43:37 -04:00
|
|
|
default:
|
[mutable] Convert the following nodes to modifiers: EditMaterial, ExtendMaterial, RemoveMesh, RemoveMeshBlocks, MorphMaterial.
- Rename some existing modifier nodes to actually be prefixed "Modifier" instead of "Mesh".
- Added additional entry points for modifiers during code generation. Now there are 4: right after generating a mesh constant, right after all mesh operations have been generated, right after a texture block has been generated and right after a texture has been generated.
- Fix bug with mesh clip with UV mask when layout blocks were used.
- For legacy data conversion autogenerated tags are created and assigned to the material nodes and the new modifier nodes.
- MorphMaterial code generation has been redesigned passing all morphs to the MutableTools layer.
#jira UE-221279
#jira UE-221278
#rnx
[REVIEW] [at]genis.sole, [at]gerard.martin, [at]pere.rifa
#rb genis.sole, gerard.martin, pere.rifa
[CL 35952198 by jordi rovira in ue5-main branch]
2024-09-02 04:15:31 -04:00
|
|
|
if (at != m_initialSource)
|
|
|
|
|
{
|
|
|
|
|
mu::Ptr<ASTOpMeshExtractLayoutBlocks> newOp = mu::Clone<ASTOpMeshExtractLayoutBlocks>(currentSinkOp);
|
|
|
|
|
newOp->Source = at;
|
|
|
|
|
newAt = newOp;
|
|
|
|
|
}
|
2023-09-26 04:43:37 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
[mutable] Convert the following nodes to modifiers: EditMaterial, ExtendMaterial, RemoveMesh, RemoveMeshBlocks, MorphMaterial.
- Rename some existing modifier nodes to actually be prefixed "Modifier" instead of "Mesh".
- Added additional entry points for modifiers during code generation. Now there are 4: right after generating a mesh constant, right after all mesh operations have been generated, right after a texture block has been generated and right after a texture has been generated.
- Fix bug with mesh clip with UV mask when layout blocks were used.
- For legacy data conversion autogenerated tags are created and assigned to the material nodes and the new modifier nodes.
- MorphMaterial code generation has been redesigned passing all morphs to the MutableTools layer.
#jira UE-221279
#jira UE-221278
#rnx
[REVIEW] [at]genis.sole, [at]gerard.martin, [at]pere.rifa
#rb genis.sole, gerard.martin, pere.rifa
[CL 35952198 by jordi rovira in ue5-main branch]
2024-09-02 04:15:31 -04:00
|
|
|
OldToNew.Add({ at, currentSinkOp }, newAt);
|
|
|
|
|
|
|
|
|
|
return newAt;
|
2023-09-26 04:43:37 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2022-09-26 15:12:13 -04:00
|
|
|
}
|