Control Unity from Python!
Project description
Peaceful Pie
Connect Python with Unity for reinforcement learning!
CI
Examples
- see examples
Installation
You need to install both into Unity project, and into your Python environment.
In Unity
- In Unity, go to Window | Package Manager
- change the dropdown in top left to 'Packages: In Project'
- check that Newtonsoft Json appears
- if Newtonsoft Json is not already in your project:
- click on the '+' in the top left, and choose 'Add package by name...'
- put the name
com.unity.nuget.newtonsoft-json
, then click 'Add'
- In Unity, in your project's "Assets" folder, create a "Plugins" folder, if it doesn't already exist
- First install AustinHarris.JsonRPC:
- Download https://www.nuget.org/api/v2/package/AustinHarris.JsonRpc/1.2.3
- rename to have filename suffix be
.zip
(you might need to turn on options to see all file extensions) - unzip the resulting zip file
- copy
lib/netstandard2.1/AustinHarris.JsonRpc.dll
into yourPlugins
folder - select the file, in your Plugins, and in 'Inspector' unselect 'validate references', and click 'Apply'
- Click on 'Releases', on the right of the github page
- in the most recent release, download
PeacefulPie.dll
- in the most recent release, download
- Copy
PeacefulPie.dll
into your Unity project'sPlugins
folder - If on Mac silicon:
- in Unity, goto Plugins, click on
PeacefulPie.dll
- in Inspector, change 'CPU' setting from 'Intel' to 'Any CPU', then click 'Apply'
- do the same for
AustinHarris.JsonRpc.dll
- in Unity, goto Plugins, click on
You should be good to go :)
In Python
pip install -U peaceful-pie
Requirements
- currently tested with:
- python 3.10
- Unity 2021.3.16.f1
- please create an issue if your preferred platform is not supported (I'm guessing I might need to downgrade Python a little? Let me know!)
Dev
I'm usng Visual Studio for Mac to write this.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
peaceful_pie-2.0.0.tar.gz
(6.6 kB
view details)
Built Distribution
File details
Details for the file peaceful_pie-2.0.0.tar.gz
.
File metadata
- Download URL: peaceful_pie-2.0.0.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dbbf3b0ca73f62b87e6e73b74d5f213a1fb5e43f52d658d1aa615a3530a25c61 |
|
MD5 | 7dce00e2643b6fef2750fea8686b4004 |
|
BLAKE2b-256 | 384c81d1dc3edbc8f33610f03463cc4a04f4edb5fc4780d11fd1f55c1fcc9ec8 |
File details
Details for the file peaceful_pie-2.0.0-py3-none-any.whl
.
File metadata
- Download URL: peaceful_pie-2.0.0-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4571820a4e1db39ef40d7c6fc93ec88453de3b6d23810df6c499af6ae5ae2aa3 |
|
MD5 | 03fbb9bd116a1dec1014feb7fa18d229 |
|
BLAKE2b-256 | 3e723c6fdd61e005a69a7e6ea3ab05388048ae711f4952385e5aa4bf5e754c2f |