Giter Site home page Giter Site logo

mlveggo / unreallivelinkcinterface Goto Github PK

View Code? Open in Web Editor NEW

This project forked from patrickpalmer/unreallivelinkcinterface

0.0 0.0 0.0 26 KB

C interface API to the Unreal Live Link Message Bus API

License: MIT License

CMake 1.68% Batchfile 0.47% C# 3.26% C++ 30.57% C 64.01%

unreallivelinkcinterface's Introduction

Unreal Live Link C interface

Version 1.5.0

For Unreal v4.23 or greater.

Overview

This small library provides a C Interface to the Unreal Live Link Message Bus API. This allows for third party packages to stream to Unreal Live Link without requiring to compile with the Unreal Build Tool (UBT). This is done by exposing the Live Link API via a C interface in a shared object compiled using UBT. This shared object is loaded via an API and exposed functions can be called with a light weight interface.

The Unreal Live Link Message Bus API is fully exposed except the per frame metadata scene time is limited to just SMPTE timecode.

Building the Unreal DLL

Building the Unreal Live Link C Interface plugin DLL requires the Unreal Engine source code. Download the source code from github.

Windows

  • copy the UnrealLiveLinkCInterface directory from this repository to [UNREAL_ENGINE_SRC_LOCATION]\Engine\Source\Programs
  • copy the file include/UnrealLiveLinkCInterfaceTypes.h from this repository to [UNREAL_ENGINE_SRC_LOCATION]\Engine\Source\Programs\UnrealLiveLinkCInterface directory
  • cd [UNREAL_ENGINE_SRC_LOCATION]
  • run "GenerateProjectFiles.bat", this creates UE4.sln Visual Studio Solution File
  • load UE4.sln in Visual Studio 2017
  • build
  • the DLL can be found at [UNREAL_ENGINE_SRC_LOCATION]\Engine\Binaries\Win64\UnrealLiveLinkCInterface.dll

Design considerations

I wanted to use C language (C89) for the API as it has the smallest requirements to interface with any language. ANSI standard C89 was choosen because it is compatible with Microsoft Visual Studio. Boolean types between C and C++ standards are not 100% compatible so I chose to avoid using bool type. I'm on the fence about creating a custom bool type so the function signatures and structures provide explicit declarations but for now, booleans are passed as ints and contain values 0 and 1. The code treats boolean types as 0 and not 0 for all tests.

This middleware code adds an extra layer between the third party software the Unreal Live Link. In doing so, it adds at least 1 additional memory copy for all data (both the initialization and the per frame data). In my case of a few thousand float values updating at 60Hz wasn't a concern.

The Maya Unreal Live Link DLL provided much inspiration.

Examples

To try the Circling Transform example, build with the example cmake option turned on (BUILD_EXAMPLES=ON). Within Unreal, add the Live Link plugin to the current project and restart. Run the Circling Tranform example program and while it is running, add the CirclingTransform Provider in the Unreal Live Link Manager Window. Create a cube and add a Live Link component with the subject set to "CirclingTransform". The cube should be circling in the viewport.

Future work

  • linux testing
  • OSX support

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.