分支合并

This commit is contained in:
Sch 2023-09-28 10:35:31 +08:00
parent 3cf55af0c7
commit 49ba27ebb6
9 changed files with 121 additions and 21 deletions

View File

@ -67,9 +67,6 @@ void FSchUtilsModule::LogValue(const FString& Name)
case EDebugToolDataType::Vector:
{
UE_LOG(LogTemp, Warning, TEXT("SchDebug: %s = %s"), *Name, *reinterpret_cast<FVector*>(DebugOffsetMap[Name].Data)->ToString())
break;
}
default:
@ -100,6 +97,11 @@ void FSchUtilsModule::SetDebugValue(const FString& Name, const FString& Value)
*reinterpret_cast<FVector*>(DebugOffsetMap[Name].Data) = FVector::ZeroVector;
break;
}
case EDebugToolDataType::Bool:
{
*reinterpret_cast<bool*>(DebugOffsetMap[Name].Data) = FCString::ToBool(*Value);
break;
}
default:
{
*reinterpret_cast<FString*>(DebugOffsetMap[Name].Data) = Value;

View File

@ -9,19 +9,22 @@
#define SCH_DEBUG_FLOAT(x, Name) x
#define SCH_DEBUG_INT32(x, Name) x
#define SCH_DEBUG_Vector(x, Name) x
#define SCH_DEBUG_BOOL(x, Name) x
#elif
#define SCH_DEBUG_FLOAT(x, Name) FSchUtilsModule::DebugValue(x, L##Name, EDebugToolDataType::Float)
#define SCH_DEBUG_INT32(x, Name) FSchUtilsModule::DebugValue(x, L##Name, EDebugToolDataType::Int32)
#define SCH_DEBUG_Vector(x, Name) FSchUtilsModule::DebugValue(x, L##Name, EDebugToolDataType::Vector)
#define SCH_DEBUG_BOOL(x, Name) FSchUtilsModule::DebugValue(x, L##Name, EDebugToolDataType::Bool)
#endif
#define SCH_LOG_OPTS(x) FSchUtilsModule::LogOpts(x)
enum class EDebugToolDataType
enum class EDebugToolDataType : uint8
{
Float,
Int32,
Vector,
Bool,
};
struct FDebugToolsByteOffsetStruct

View File

@ -415,7 +415,8 @@ FEncodeVideoInfo FUtils::TrackEncodeAudio(const FTrackData& TrackData, const FSt
FPlatformFileManager::Get().GetPlatformFile().CreateDirectoryTree(*FPaths::GetPath(ExportPath));
TArray<FClipData> ClipData = TrackData.ClipData;
ClipData.Sort([](const FClipData& A, const FClipData& B) {return A.ClipStartFrame < B.ClipStartFrame; });
FEncodeVideoInfo EncodeVideoInfo;
FClipData SavedClipData;
int32 AudioCount = 0;
@ -532,6 +533,7 @@ FEncodeVideoInfo FUtils::TrackEncodeAudio(const FTrackData& TrackData, const FSt
FEncodeVideoInfo FUtils::CombineAudio(const FEncodeVideoInfo& LeftEncodeData,
const FEncodeVideoInfo& RightEncodeData, const FString& ExportPath)
{
FString LeftPathName = "";
FString RightPathName = "";
if (FPaths::FileExists(LeftEncodeData.EncodedVideoName))
@ -610,6 +612,8 @@ TArray<FEncodeVideoInfo> FUtils::ExportPsaf(FTrackData TrackData, const FString&
EncodeVideoInfo.TrackData = TrackData;
EncodeVideoInfo.ClipData = TempClipData;
EncodeVideoInfos.Add(EncodeVideoInfo);
i++;
}
}
return EncodeVideoInfos;

View File

@ -400,7 +400,17 @@ TSharedPtr<SWidget> SEffectCard::GetPropertiesWidget()
})
.OnTextCommitted_Lambda([this](const FText& InText, ETextCommit::Type InCommitType)
{
CardProperty->ID = FCString::Atoi(*InText.ToString());
for (int32 i = 0; i < CardGroupPtr->EffectCardPanel->EffectCardGroups.Num(); i++)
{
for (int32 j = 0; j < CardGroupPtr->EffectCardPanel->EffectCardGroups[i].Cards.Num(); j++)
{
if (CardProperty->Guid == CardGroupPtr->EffectCardPanel->EffectCardGroups[i].Cards[j].Guid)
{
CardGroupPtr->EffectCardPanel->EffectCardGroups[i].Cards[j].ID = FCString::Atoi(*InText.ToString());
}
}
}
})
]
]

View File

@ -718,6 +718,16 @@ void SCutMainWindow::Tick(const FGeometry& AllottedGeometry, const double InCurr
TotalTime = 0;
}
TotalTime += InDeltaTime;
// for (int32 i = 0; i < EffectCardsPanel->EffectCardGroups.Num(); i++)
// {
// for (int32 j = 0; j < EffectCardsPanel->EffectCardGroups[i].Cards.Num(); j++)
// {
// if (EffectCardsPanel->EffectCardGroups[i].Cards[j].Name == TEXT("鲨鱼"))
// {
// GEngine->AddOnScreenDebugMessage(-1, 10.0f, FColor::Red, FString::Printf(TEXT("TestVar: %d"), EffectCardsPanel->EffectCardGroups[i].Cards[j].ID));
// }
// }
// }
SCH_DEBUG_INT32(114514, "TestVar");
@ -1223,6 +1233,23 @@ void SCutMainWindow::ExportProject(const FString& ExportPath)
{
for (int32 j = 0; j < EffectCardsPanel->EffectCardGroups[i].Cards.Num(); j++)
{
// 检测组合卡里是否有这个卡
bool bIsExist = false;
for (const FEffectCardGroup& CardGroup : EffectCardsPanel->EffectCardGroups)
{
if (CardGroup.bIsDedicated == true)
continue;
if (CardGroup.Cards.Contains(EffectCardsPanel->EffectCardGroups[i].Cards[j]))
{
bIsExist = true;
}
}
if (bIsExist)
continue;
FExportCard ExportCard;
int32 TypeID = 0;
if (EffectCardsPanel->EffectCardGroups[i].Cards[j].JumpStepCurtains.Guid.IsValid())
@ -1263,7 +1290,7 @@ void SCutMainWindow::ExportProject(const FString& ExportPath)
{
FExportCard ExportCard;
ExportCard.CardName = EffectCardsPanel->EffectCardGroups[i].GroupName;
ExportCard.CardID = EffectCardsPanel->EffectCardGroups[i].ID;
ExportCard.CardID = -1;
int32 TypeID = 2;
if (EffectCardsPanel->EffectCardGroups[i].JumpStepCurtains.Guid.IsValid())
{
@ -1316,7 +1343,16 @@ void SCutMainWindow::ExportProject(const FString& ExportPath)
for (int32 i = 0; i < ExportCards.Num(); i++)
{
tinyxml2::XMLElement* Card = CardList->InsertNewChildElement("Card");
Card->InsertNewChildElement("ID")->InsertNewText(TCHAR_TO_UTF8(*FString::FromInt(ExportCards[i].CardID)));
tinyxml2::XMLElement* ID = Card->InsertNewChildElement("ID");
if (ExportCards[i].CardID != -1)
{
ID->InsertNewText(TCHAR_TO_UTF8(*FString::FromInt(ExportCards[i].CardID)));
}
else
{
ID->InsertNewText("");
}
Card->InsertNewChildElement("Type")->InsertNewText(TCHAR_TO_UTF8(*FString::FromInt(ExportCards[i].CardType)));
Card->InsertNewChildElement("Times")->InsertNewText(TCHAR_TO_UTF8(*FString::FromInt(ExportCards[i].Times)));
Card->InsertNewChildElement("Step")->InsertNewText(TCHAR_TO_UTF8(*FString::FromInt(ExportCards[i].Step)));
@ -2432,17 +2468,17 @@ tinyxml2::XMLElement* SCutMainWindow::GetProcessB(tinyxml2::XMLElement* Parent,
for (int32 i = 0; i < EffectCardsPanel->EffectCardGroups.Num(); i++)
{
if (!EffectCardsPanel->EffectCardGroups[i].bIsDedicated)
{
if (EffectCardsPanel->EffectCardGroups[i].UsedCurtains.Contains(Curtain->CurtainUUID) ||
EffectCardsPanel->EffectCardGroups[i].UsedCurtains.Contains(FStringWithGUID()))
{
tinyxml2::XMLElement* SerialNumber = EnableCard->InsertNewChildElement("SerialNumber");
SerialNumber->InsertNewText(TCHAR_TO_UTF8(*FString::FromInt(EffectCardsPanel->EffectCardGroups[i].ID)));
Count++;
}
continue;
}
// if (!EffectCardsPanel->EffectCardGroups[i].bIsDedicated)
// {
// if (EffectCardsPanel->EffectCardGroups[i].UsedCurtains.Contains(Curtain->CurtainUUID) ||
// EffectCardsPanel->EffectCardGroups[i].UsedCurtains.Contains(FStringWithGUID()))
// {
// tinyxml2::XMLElement* SerialNumber = EnableCard->InsertNewChildElement("SerialNumber");
// SerialNumber->InsertNewText(TCHAR_TO_UTF8(*FString::FromInt(EffectCardsPanel->EffectCardGroups[i].ID)));
// Count++;
// }
// continue;
// }
for (int32 j = 0 ; j < EffectCardsPanel->EffectCardGroups[i].Cards.Num(); j++)
{
@ -2850,6 +2886,38 @@ FGuid SCutMainWindow::GetCurrentSelectCurtain() const
return FGuid();
}
bool SCutMainWindow::GetSelectIsGlobal(const FGuid& Guid)
{
for (FCurtainGroup& CurtainGroup : CurtainPanel->Groups)
{
for (FCurtain& Curtain : CurtainGroup.Curtains)
{
if (Curtain.CurtainUUID == Guid)
{
return Curtain.IsGlobal;
}
}
}
for (FEffectCardGroup& Group : EffectCardsPanel->EffectCardGroups)
{
if (!Group.bIsDedicated)
{
if (Group.Guid == Guid)
{
return Group.bIsActive;
}
}
for (FEffectCardProperty& Property : Group.Cards)
{
if (Property.Guid == Guid)
{
return Property.bIsActive = true;
}
}
}
return true;
}
void SCutMainWindow::SetActive(FGuid& Guid) const
{
for (FCurtainGroup& CurtainGroup : CurtainPanel->Groups)

View File

@ -149,6 +149,9 @@ public:
FTimelineInfo GetSelectTimelineInfoByGuid(const FGuid& Guid) const;
FString GetSelectNameByGuid(const FGuid& Guid) const;
FGuid GetCurrentSelectCurtain() const;
bool GetSelectIsGlobal(const FGuid& Guid);
void SetActive(FGuid& Guid) const;
FTimelineInfo GetCurrentSelectCurtainTimelineInfo() const;
bool IsSelectCurtain() const;

View File

@ -699,8 +699,8 @@ int32 STimelineClip::OnPaint(const FPaintArgs& Args, const FGeometry& AllottedGe
const int32 Interval = (CropEndDataOffset - CropStartDataOffset) / NeedDrawCount;
GEngine->AddOnScreenDebugMessage(-1, 0.0f, FColor::Red, FString::FromInt(NeedDrawCount));
GEngine->AddOnScreenDebugMessage(-1, 0.0f, FColor::Green, FString::FromInt(Interval));
// GEngine->AddOnScreenDebugMessage(-1, 0.0f, FColor::Red, FString::FromInt(NeedDrawCount));
// GEngine->AddOnScreenDebugMessage(-1, 0.0f, FColor::Green, FString::FromInt(Interval));
if (CropStartFrameOffset != -1 || NeedDrawCount != -1)
{

View File

@ -0,0 +1 @@
#include "SaveConverterBase.h"

View File

@ -0,0 +1,9 @@
#pragma once
class FSaveConverterBase
{
public:
};