Skip to content

Commit

Permalink
UE5 compilation with otio 0.16.0 libs
Browse files Browse the repository at this point in the history
  • Loading branch information
mvanneutigem committed Jul 24, 2023
1 parent f5a02e4 commit 674bcfd
Show file tree
Hide file tree
Showing 141 changed files with 27,810 additions and 5,495 deletions.
28 changes: 28 additions & 0 deletions OpenTimelineIO/OpenTimelineIO.uplugin
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"FileVersion": 3,
"Version": 1,
"VersionName": "1.0",
"FriendlyName": "OpenTimelineIO",
"Description": "OpenTimelineIO library.",
"Category": "Other",
"CreatedBy": "Marieke van Neutigem",
"CreatedByURL": "https://mariekevanneutigem.nl/",
"DocsURL": "",
"MarketplaceURL": "",
"SupportURL": "",
"CanContainContent": true,
"IsBetaVersion": true,
"IsExperimentalVersion": true,
"Installed": false,
"Modules": [
{
"Name": "OpenTimelineIO",
"Type": "Runtime",
"LoadingPhase": "Default",
"WhitelistPlatforms": [
"Win64"
]
}
],
"Plugins": []
}
Binary file added OpenTimelineIO/Resources/Icon128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
OpenTimelineIO
Copyright Contributors to the OpenTimelineIO project.
All rights reserved.
This product includes software developed at:
Pixar (http://www.pixar.com/).
OpenTimelineIO
Copyright Contributors to the OpenTimelineIO project.
All rights reserved.

This product includes software developed at:

Pixar (http://www.pixar.com/).
Original file line number Diff line number Diff line change
@@ -1,71 +1,82 @@
// Copyright Epic Games, Inc. All Rights Reserved.

using UnrealBuildTool;

public class opentimelineio : ModuleRules
{
public opentimelineio(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;

PublicIncludePaths.AddRange(
new string[] {
// ... add public include paths required here ...
"$(PluginDir)/Source/ThirdParty/opentimelineio/include",
"$(PluginDir)/Source/ThirdParty/opentimelineio/include/opentimelineio/deps",
}
);


PrivateIncludePaths.AddRange(
new string[] {
// ... add other private include paths required here ...
}
);


PublicDependencyModuleNames.AddRange(
new string[]
{
"Core",
"Projects"
// ... add other public dependencies that you statically link with here ...
}
);


PrivateDependencyModuleNames.AddRange(
new string[]
{
"CoreUObject",
"Engine",
"Slate",
"SlateCore",
// ... add private dependencies that you statically link with here ...
}
);


DynamicallyLoadedModuleNames.AddRange(
new string[]
{
// ... add any modules that your module loads dynamically here ...
}
);

if (Target.Platform == UnrealTargetPlatform.Win64)
{
// Add the import library
PublicAdditionalLibraries.Add("$(PluginDir)/Source/ThirdParty/opentimelineio/opentimelineio.lib");
PublicAdditionalLibraries.Add("$(PluginDir)/Source/ThirdParty/opentimelineio/opentime.lib");

// Delay-load the DLL, so we can load it from the right place first
PublicDelayLoadDLLs.Add("opentimelineio.dll");
PublicDelayLoadDLLs.Add("opentime.dll");

// Ensure that the DLL is staged along with the executable
RuntimeDependencies.Add("$(PluginDir)/Source/ThirdParty/opentimelineio/opentimelineio.dll");
RuntimeDependencies.Add("$(PluginDir)/Source/ThirdParty/opentimelineio/opentime.dll");
}
}
}
// Copyright Epic Games, Inc. All Rights Reserved.

using UnrealBuildTool;

public class OpenTimelineIO : ModuleRules
{
public OpenTimelineIO(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;

PublicIncludePaths.AddRange(
new string[] {
// ... add public include paths required here ...
"$(PluginDir)/Source/ThirdParty/OpenTimelineIO/include",
"$(PluginDir)/Source/ThirdParty/OpenTimelineIO/include/Imath",
"$(PluginDir)/Source/ThirdParty/OpenTimelineIO/include/opentimelineio/deps",
// "$(PluginDir)/Source/ThirdParty/OpenTimelineIO/public_include",
//"$(PluginDir)/Source/ThirdParty/OpenTimelineIO/public_include/Imath",
//"$(PluginDir)/Source/ThirdParty/OpenTimelineIO/public_include/opentimelineio/deps",
}
);


PrivateIncludePaths.AddRange(
new string[] {
// ... add other private include paths required here ...
}
);


PublicDependencyModuleNames.AddRange(
new string[]
{
"Core",
"Projects"
// ... add other public dependencies that you statically link with here ...
}
);


PrivateDependencyModuleNames.AddRange(
new string[]
{
"CoreUObject",
"Engine",
"Slate",
"SlateCore",
// ... add private dependencies that you statically link with here ...
}
);


DynamicallyLoadedModuleNames.AddRange(
new string[]
{
// ... add any modules that your module loads dynamically here ...
}
);


if (Target.Platform == UnrealTargetPlatform.Win64)
{

//// Add the import library
PublicAdditionalLibraries.Add("$(PluginDir)/Source/ThirdParty/OpenTimelineIO/opentimelineio.lib");
PublicAdditionalLibraries.Add("$(PluginDir)/Source/ThirdParty/OpenTimelineIO/opentime.lib");
PublicAdditionalLibraries.Add("$(PluginDir)/Source/ThirdParty/OpenTimelineIO/Imath-3_2.lib");


//// Add runtime dependency
RuntimeDependencies.Add("$(PluginDir)/Source/ThirdParty/OpenTimelineIO/opentimelineio.dll");
RuntimeDependencies.Add("$(PluginDir)/Source/ThirdParty/OpenTimelineIO/opentime.dll");


//// Delay-load the DLL
PublicDelayLoadDLLs.Add("opentimelineio.dll");
PublicDelayLoadDLLs.Add("opentime.dll");


}
}
}
62 changes: 62 additions & 0 deletions OpenTimelineIO/Source/ThirdParty/OpenTimelineIO/OpenTimelineIO.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// Copyright Epic Games, Inc. All Rights Reserved.

#include "OpenTimelineIO.h"
#include "Core.h"
#include "Modules/ModuleManager.h"
#include "Interfaces/IPluginManager.h"

//otio
#include "opentimelineio/timeline.h"
#include "opentimelineio/stack.h"
#include "opentimelineio/track.h"
#include "opentimelineio/clip.h"
#include "opentimelineio/externalReference.h"

#include <string>

namespace otio = opentimelineio::OPENTIMELINEIO_VERSION;

#define LOCTEXT_NAMESPACE "FOpenTimelineIOModule"

void FOpenTimelineIOModule::StartupModule()
{
// This code will execute after your module is loaded into memory; the exact timing is specified in the .uplugin file per-module

// Get the base directory of this plugin
FString BaseDir = IPluginManager::Get().FindPlugin("OpenTimelineIO")->GetBaseDir();

// Add on the relative location of the third party dll and load it
FString LibraryPath;
LibraryPath = FPaths::Combine(*BaseDir, TEXT("Source/ThirdParty/OpenTimelineIO/opentimelineio.dll"));

opentimelineioLibraryHandle = !LibraryPath.IsEmpty() ? FPlatformProcess::GetDllHandle(*LibraryPath) : nullptr;

if (opentimelineioLibraryHandle)
{
FMessageDialog::Open(EAppMsgType::Ok, LOCTEXT("ThirdPartyLibraryError", "Succesfully loaded otio library"));
}
else {
FMessageDialog::Open(EAppMsgType::Ok, LOCTEXT("ThirdPartyLibraryError", "Failed to load otio library"));
}

}

void FOpenTimelineIOModule::DoSomething() {
auto name = std::string("SomeName");

auto newtimeline = otio::SerializableObject::Retainer<otio::Timeline>(new otio::Timeline(name));
}

void FOpenTimelineIOModule::ShutdownModule()
{
// This function may be called during shutdown to clean up your module. For modules that support dynamic reloading,
// we call this function before unloading the module.

// Free the dll handle
FPlatformProcess::FreeDllHandle(opentimelineioLibraryHandle);
opentimelineioLibraryHandle = nullptr;
}

#undef LOCTEXT_NAMESPACE

IMPLEMENT_MODULE(FOpenTimelineIOModule, OpenTimelineIO)
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
// Copyright Epic Games, Inc. All Rights Reserved.

#pragma once

#include "Modules/ModuleManager.h"

class FopentimelineioModule : public IModuleInterface
{
public:

/** IModuleInterface implementation */
virtual void StartupModule() override;
virtual void ShutdownModule() override;

private:
/** Handle to the test dll we will load */
void* ExampleLibraryHandle;
};
// Copyright Epic Games, Inc. All Rights Reserved.

#pragma once

#include "Modules/ModuleManager.h"

class FOpenTimelineIOModule : public IModuleInterface
{
public:

/** IModuleInterface implementation */
virtual void StartupModule() override;
virtual void ShutdownModule() override;
void DoSomething();

private:
/** Handle to the test dll we will load */
void* opentimelineioLibraryHandle;

};
Loading

0 comments on commit 674bcfd

Please sign in to comment.