Git Product home page Git Product logo

ue4pyserver's Introduction

UE4PyServer

Importent

This project is no longer maintained it is replaced by the UE4PyhtonBridge

Unreal Engine Python Plugin

This is a plugin dedicated to enabling communication between Python code and Unreal Engine, especially enables retrieving video from the unreal engine editor to the python environment. I am also working on a parallel project UE4PyhtonBridge which eventually will replace this project. UE4PyhtonBridge has support for stand alone games and also used by the DroneSimLab project.

Installation: (Tested only on Linux)


Prerequisites

- Unreal Engine for Linux installation: UE4
- Python 3.x installation
For the purpose of the demo, I installed Python 3.5 Anaconda Anaconda.

Prerequisites For Optical-Flow Demo

- OpenCV for Python 3
conda install -c menpo opencv3
- numpy
conda install numpy

Plugin Setup

- Create a project in unreal engine:
- Add an empty c++ class so the project will be a code project
- Close the project
- In the project dir create Plugins dir
- Clone UE4PyServer into that dir
git clone https://github.com/orig74/UE4PyServer.git
- cd to: [ProjectPath]/Plugins/UE4PyServer/Source/PyServer
- run:
python config.py --entry_point \
for the test demo run:
python config.py --entry_point track_test - run:
python build.py --ue4path=\
or (if you are using other python distribution)
python3 build.py --ue4path=\
- Open your project and enable the plugin:
goto Edit->Plugins and enable the PyServer Plugin (under other).

Running minimal example:

- Set entry point for the minimal file
python config.py --entry_point minimal
the minimal file is minimal.py
- Add "PyServerTickActor":
Press the Plugin button PyServer. PyServerTickActor will appear in the Outliner panel on the right.
- Play:
Press the play button in Play button in the Toolbar.

working in your own directory:

run:
python config.py --entry_point \< your entrypoint module \> --entry_path \< module path \>
The entry_point tells the module where the main_loop function exists. If the entrypoint file does not exists, it is created with the functions main_loop and the function kill.

Running The Demo:

The demo is "Lucas-Kanade optical flow tracking" from OpenCV library.
- Add Camera CameraActor_2 and a WindDirectionalSource:
In the Modes Pannel in the Place Tab add a Camera Actor. Change The name of the actor to "CameraActor_2".
In the Modes Pannel in the Place Tab add a WindDirectionalSource. Change The name to "WindDirectionalSource1"
- Add "PyServerTickActor":
Press the Plugin button PyServer. PyServerTickActor will appear in the Outliner panel on the right.
- Play:
Press the play button in Play button in the Toolbar. The supporting modes for this demo are: "Selected ViewPort" and "New Editor Window"
Focus on the engine window to get 30 fps!!
Watch demo on: demo
- More Demos:
This demo uses a SceneCapture2D and a Render Target to play inside an OpenCV window.
Another demo uses two SceneCapture2D one for RGB image and the other for depth image.

Contact Me:

For any help regarding the installation, please contact me at:
[email protected]

ue4pyserver's People

Contributors

orig74 avatar

Watchers

James Cloos avatar  avatar

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.