PyUnity is a Python implementation of the Unity Engine, written in C++

Overview

PyUnity

Documentation Status License PyPI version Python version Language grade: Python Total alerts Build status Discord Gitter GitHub Repo stars

Version 0.7.0 (in development)

PyUnity is a Python implementation of the Unity Engine, written in C++. This is just a fun project and many features have been taken out to make it as easy as possible to create a scene and run it.

Installing

To install PyUnity for Linux distributions based on Ubuntu or Debian, use:

> pip3 install pyunity

To install PyUnity for other operating systems, use pip:

> pip install pyunity

Alternatively, you can clone the repository to build the package from source. Then use setup.py to build. Note that it will install Cython to compile.

> python setup.py install

Its only dependencies are PyOpenGL, PySDL2, GLFW, Pillow and PyGLM.

Importing

To start using pyunity, you must import it. A standard way to import is like so:

>>> from pyunity import *

Debug information is turned on by default. If you want to turn it off, set the PYUNITY_DEBUG_MODE environment variable to "0". This is the output with debugging:

Loaded config
Trying GLFW as a window provider
GLFW doesn't work, trying PySDL2
Using window provider PySDL2
Loaded PyUnity version 0.7.0

If debugging is off, there is no output:

>> from pyunity import * >>> # No output ">
>>> import os
>>> os.environ["PYUNITY_DEBUG_MODE"] = "0"
>>> from pyunity import *
>>> # No output

Scenes

All PyUnity projects start with a scene. To add a scene, do this:

>>> scene = SceneManager.AddScene("Scene 1")

Then, let's move the camera backwards 10 units.

>>> scene.mainCamera.transform.position = Vector3(0, 0, -10)

Finally, add a cube at the origin:

>> renderer = cube.AddComponent(MeshRenderer) >>> renderer.mesh = Mesh.cube(2) >>> renderer.mat = Material(Color(255, 0, 0)) >>> scene.Add(cube) ">
>>> cube = GameObject("Cube")
>>> renderer = cube.AddComponent(MeshRenderer)
>>> renderer.mesh = Mesh.cube(2)
>>> renderer.mat = Material(Color(255, 0, 0))
>>> scene.Add(cube)

To see what you have added to the scene, call scene.List():

>>> scene.List()
/Main Camera
/Light
/Cube

Finally, to run the scene, call scene.Run(). The window that is created is one of FreeGLUT, GLFW or PySDL2. The window is selected on module initialization (see Windows subheading).

Behaviours

To create your own PyUnity script, create a class that inherits from Behaviour. Usually in Unity, you would put the class in its own file, but Python can't do something like that, so put all of your scripts in one file. Then, to add a script, just use AddComponent(). Do not put anything in the __init__ function, instead put it in Start(). The Update() function receives one parameter, dt, which is the same as Time.deltaTime.

Windows

The window is provided by one of three providers: GLFW, PySDL2 and FreeGLUT. When you first import PyUnity, it checks to see if any of the three providers work. The testing order is as above, so FreeGLUT is tested last.

To create your own provider, create a class that has the following methods:

  • __init__: initiate your window and check to see if it works.
  • start: start the main loop in your window. The first parameter is update_func, which is called when you want to do the OpenGL calls.

Check the source code of any of the window providers for an example. If you have a window provider, then please create a new pull request.

Examples

To run an example, import it like so:

>>> from pyunity.examples.example1 import main
Loaded config
Trying FreeGLUT as a window provider
FreeGLUT doesn't work, trying GLFW
GLFW doesn't work, trying PySDL2
Using window provider PySDL2
Loaded PyUnity version 0.7.0
>>> main()

Or from the command line:

> python -m pyunity 1

The 1 just means to load example 1, and there are 9 examples. To load all examples one by one, do not specify a number. If you want to contribute an example, then please create a new pull request.

Comments
  • ModuleNotFoundError: No module named 'vector3'

    ModuleNotFoundError: No module named 'vector3'

    I am a new user to pyunity.. i installed it with pip install pyunity

    I was trying out the examples.. python -m pyunity 1 it resulted in error: Error log:

    PS C:\Users\Lenovo> python -m pyunity 1
    Loaded config
    Trying GLFW as a window provider
    Using window provider GLFW
    Traceback (most recent call last):
      File "C:\Program Files\Python38-32\lib\runpy.py", line 185, in _run_module_as_main
        mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
      File "C:\Program Files\Python38-32\lib\runpy.py", line 144, in _get_module_details
        return _get_module_details(pkg_main_name, error)
      File "C:\Program Files\Python38-32\lib\runpy.py", line 111, in _get_module_details
        __import__(pkg_name)
      File "C:\Program Files\Python38-32\lib\site_packages\pyunity\__init__.py",  line 131, in <module>
        from .audio import *
      File "audio.py", line 13, in init pyunity.audio
      File "core.py", line 1, in init pyunity.core
    ModuleNotFoundError: No module named 'vector3'
    

    I have tried whatever i can do.. but i can't fix it nor find any module with name "vector3" on the internet..

    Specs (if you need):

    Python Version: Python 3.8.9
    OS: Windows 7 SP 1
    Processor: Intel core i3 (x86)
    
    opened by whmsft 16
  • Convert stubs to inline type hints

    Convert stubs to inline type hints

    The current approach makes it hard to maintain the project's types since the docstrings and stub files has to be in sync so I think the project should convert to inline type hints as defined in PEP 448 and note that a py.typed file will need to be added to /pyunity for PEP 561.

    Since pyunity only supports Python3.6+ there will be no compatibility issues what's however.

    I would like to know your opinion on this :)

    opened by FaresAhmedb 11
  • Importing issue

    Importing issue

    Cannot import pyunity due to error below:

    Loaded config
    Trying GLFW as a window provider
    Using window provider GLFW
    Traceback (most recent call last):
      File "C:\Users\raych\AppData\Local\Programs\Python\Python39-32\lib\runpy.py", line 188, in _run_module_as_main
        mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
      File "C:\Users\raych\AppData\Local\Programs\Python\Python39-32\lib\runpy.py", line 147, in _get_module_details
        return _get_module_details(pkg_main_name, error)
      File "C:\Users\raych\AppData\Local\Programs\Python\Python39-32\lib\runpy.py", line 111, in _get_module_details
        __import__(pkg_name)
      File "C:\Users\raych\AppData\Local\Programs\Python\Python39-32\lib\site-packages\pyunity\__init__.py", line 156, in <module>
        from .audio import *
      File "audio.py", line 13, in init pyunity.audio
      File "core.py", line 1, in init pyunity.core
    ModuleNotFoundError: No module named 'vector3'
    
    Type: Bug Meta: Invalid 
    opened by rayzchen 10
  • Feature/saving

    Feature/saving

    TODO:

    • [x] Move Color and MeshRenderer to meshes.py
    • [x] Subclass SavesProjectID for savable assets
    • [x] Customize saving of assets in class not in Loader
    • [x] Save class as struct-like representation
    • [x] Clean up Loader.Save* functions and remove weird parameters
    • [x] Create prefab mechanics
    • [ ] Fix Behaviour saving (only write when needed)
    • [x] Callback saving
    Type: Enhancement Topic: Module Meta: Awaiting Response OS: Any 
    opened by rayzchen 5
  • [BUG] Cannot import from egg

    [BUG] Cannot import from egg

    Describe the bug

    Trying to import PyUnity from an egg file errors out.

    To Reproduce

    Run cython=0 python setup.py bdist_egg Go to dist folder Run code

    Expected behavior

    Successful import

    Code

    import sys
    sys.path.insert(0, "pyunity-0.9.0-py3.9.egg")
    import pyunity
    

    System info

    ##############################
             VERSION INFO
    ##############################
    PyUnity version: v0.9.0
    Python version: v3.9.4-final
    Operating system: Windows 10
    Architecture: 32bit
    Requirements:
    - pyopengl version: 3.1.5
    - pillow version: 9.0.1
    - pysdl2 version: 0.9.11
    - pysdl2-dll version: 2.0.20
    - pyglm version: 2.5.7
    - importlib-resources version: None
    - glfw version: 2.5.0
    

    Traceback

    Traceback (most recent call last):
      File "C:\Users\raych\AppData\Local\Programs\Python\Python39-32\lib\importlib\_common.py", line 35, in _tempfile
        os.write(fd, reader())
      File "C:\Users\raych\AppData\Local\Programs\Python\Python39-32\lib\zipfile.py", line 2322, in read_bytes
        with self.open('rb') as strm:
      File "C:\Users\raych\AppData\Local\Programs\Python\Python39-32\lib\zipfile.py", line 2306, in open
        stream = self.root.open(self.at, zip_mode, pwd=pwd)
      File "C:\Users\raych\AppData\Local\Programs\Python\Python39-32\lib\zipfile.py", line 1502, in open
        zinfo = self.getinfo(name)
      File "C:\Users\raych\AppData\Local\Programs\Python\Python39-32\lib\zipfile.py", line 1429, in getinfo
        raise KeyError(
    KeyError: "There is no item named 'pyunity/shaders/skybox/textures/' in the archive"
    During handling of the above exception, another exception occurred:
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
      File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
      File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
      File "<frozen zipimport>", line 259, in load_module
      File "pyunity-0.9.0-py3.9.egg\pyunity\__init__.py", line 209, in <module>
        from .render import __all__ as _render_all
      File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
      File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
      File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
      File "<frozen zipimport>", line 259, in load_module
      File "pyunity-0.9.0-py3.9.egg\pyunity\render.py", line 324, in <module>
        skyboxes["Water"] = Skybox(stack.enter_context(as_file(ref / "skybox/textures")))
      File "C:\Users\raych\AppData\Local\Programs\Python\Python39-32\lib\contextlib.py", line 429, in enter_context
        result = _cm_type.__enter__(cm)
      File "C:\Users\raych\AppData\Local\Programs\Python\Python39-32\lib\contextlib.py", line 117, in __enter__
        return next(self.gen)
      File "C:\Users\raych\AppData\Local\Programs\Python\Python39-32\lib\importlib\_common.py", line 52, in as_file
        with _tempfile(path.read_bytes, suffix=path.name) as local:
      File "C:\Users\raych\AppData\Local\Programs\Python\Python39-32\lib\contextlib.py", line 117, in __enter__
        return next(self.gen)
      File "C:\Users\raych\AppData\Local\Programs\Python\Python39-32\lib\importlib\_common.py", line 40, in _tempfile
        os.remove(raw_path)
    PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\raych\\AppData\\Local\\Temp\\tmpbrwljrmttextures'
    

    Additional context Add any other context about the problem here.

    Type: Bug Topic: Module OS: Any 
    opened by rayzchen 3
  • Memory leaks

    Memory leaks

    Sometimes MemoryError is encountered when copying the scene at runtime, especially with shaders and skyboxes duplicated (which they aren't meant to be).

    Type: Bug Meta: Invalid 
    opened by rayzchen 3
  • Cannot import when built with Cython

    Cannot import when built with Cython

    In the current state, importing PyUnity will cause this error:

    Loaded config
    Traceback (most recent call last):
      File "C:\Users\Ray\AppData\Local\Programs\Python\Python38-32\lib\runpy.py", line 184, in _run_module_as_main
        mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
      File "C:\Users\Ray\AppData\Local\Programs\Python\Python38-32\lib\runpy.py", line 143, in _get_module_details
        return _get_module_details(pkg_main_name, error)
      File "C:\Users\Ray\AppData\Local\Programs\Python\Python38-32\lib\runpy.py", line 110, in _get_module_details
        __import__(pkg_name)
      File "C:\Users\Ray\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pyunity\__init__.py", line 125, in <module>
        from .audio import *
      File "audio.py", line 12, in init pyunity.audio
      File "config.py", line 17, in init pyunity.config
      File "C:\Users\Ray\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pyunity\window\__init__.py", line 34, in <module>
        from .glutWindow import Window as glutWindow
    ImportError: DLL load failed while importing glutWindow: The specified module could not be found.
    
    Type: Bug Meta: Invalid 
    opened by rayzchen 3
  • [OBSERVATION] Cool idea, but the name will likely get C&D'd....

    [OBSERVATION] Cool idea, but the name will likely get C&D'd....

    Cool idea for a project :) I suspect that as far as the name there are two situations:

    1. no-one is using your project, and it sits below the radar, and Unity themselves don't notice, or do anything
    2. your project starts to become popular. I suspect your name will then get cease and desisted, by Unity, at that point

    I suppose you could just change the name at that point, but, might be as easy to just change the name now? (e.g. Mono, which Unity uses, didn't call themselves "Linux .Net Framework", they called themselves "mono", and everyone knew that it was a cross platform version of the windows .net framework).

    this would also avoid having to state twice, in the first two paragraphs of your front page, that pyunity is not a wrapper around unity :)

    (And it's natural to assume pyunity is a wrapper. My pytorch project, https://github.com/hughperkins/pytorch (which predates the Facebook pytorch by a year or two), was a wrapper around Facebook's lua torch)

    opened by hughperkins 2
  • [FEATURE] Move main loop to SceneManager, or have a custom main loop runner

    [FEATURE] Move main loop to SceneManager, or have a custom main loop runner

    Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] The main loop code in the window providers is almost exactly the same thing: run some init, create a clock, infinite loop, quit etc. but it's hard to create something like VSync that can be toggled on and off. This really shouldn't be handled by the window providers.

    Describe the solution you'd like A clear and concise description of what you want to happen. The main loop code should be either in SceneManager.__loadScene or (more preferably) another ABCMeta that can be subclassed and implemented, given an update function and set to chug along nicely.

    Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

    Additional context Add any other context or screenshots about the feature request here.

    Type: Enhancement Topic: Module OS: Any 
    opened by rayzchen 2
  • RenderTarget.canvas nested rendering

    RenderTarget.canvas nested rendering

    If RenderTarget.canvas is true, it may try to render itself in PreRender. Whether this is wanted or not, there needs to be a limit to the depth of recursion.

    Type: Bug 
    opened by rayzchen 2
  • Example 8

    Example 8

    Loading example 8 always gives an error:

    Traceback (most recent call last):
      File "C:\Users\Ray\AppData\Local\Programs\Python\Python39-32\lib\runpy.py", line 197, in _run_module_as_main
        return _run_code(code, main_globals, None,
      File "C:\Users\Ray\AppData\Local\Programs\Python\Python39-32\lib\runpy.py", line 87, in _run_code
        exec(code, run_globals)
      File "D:\Ray\python\pyunity\__main__.py", line 2, in <module>
        examples.show()
      File "D:\Ray\python\pyunity\examples\__init__.py", line 32, in show
        example.main()
      File "D:\Ray\python\pyunity\examples\example8\__init__.py", line 9, in main     
        source = scene.mainCamera.AddComponent(AudioSource)
      File "D:\Ray\python\pyunity\core.py", line 327, in AddComponent
        return self.gameObject.AddComponent(component)
      File "D:\Ray\python\pyunity\core.py", line 186, in AddComponent
        component = componentClass(self.transform)
      File "D:\Ray\python\pyunity\audio.py", line 58, in __init__
        mixer.Mix_AllocateChannels(channels)
    OSError: exception: access violation reading 0x00000074
    

    This doesnt happen when I run python -m pyunity 8, only when I run all examples. This happens on the develop branch.

    Type: Bug 
    opened by rayzchen 2
  • [FEATURE] `Config` class that is set per project

    [FEATURE] `Config` class that is set per project

    Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

    Instead of having global variables under pyunity/config.py, using a class that can be modified is more portable. This way we can separate flags and actual configs, whereas right now config.audio can be modified.

    Describe the solution you'd like A clear and concise description of what you want to happen.

    Config class created that can be loaded and saved from the .pyunity file in projects

    Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

    Additional context Add any other context or screenshots about the feature request here.

    Type: Enhancement Topic: Module 
    opened by rayzchen 0
  • [BUG] ctypes.ArgumentError: argument 2: <class 'KeyboardInterrupt'>

    [BUG] ctypes.ArgumentError: argument 2:

    Is there an existing issue for this?

    • [X] I have searched the existing issues

    System info

    Loaded config
    Detected settings.json entry
    Using window provider GLFW
    Loaded PyUnity version 0.9.0
    ##############################
             VERSION INFO
    ##############################
    PyUnity version: v0.9.0
    Python version: v3.9.4-final
    Operating system: Windows 10
    Machine: AMD64
    Python architecture: 32bit
    Dependencies:
    - pyopengl version: 3.1.5
    - pillow version: 9.0.1
    - pysdl2 version: 0.9.11
    - pysdl2-dll version: 2.0.20
    - pyglm version: 2.5.7
    - importlib-resources version: None
    - glfw version: 2.5.3
    

    Describe the bug

    Program quits with a large error yet KeyboardInterrupt is not raised and so cannot be caught normally by SceneManager.__loadScene.

    To reproduce

    Run examples Press Ctrl+C while an example is running Repeat until KeyboardInterrupt is raised while an OpenGL function is being called

    Code

    No response

    Traceback

    Loaded config
    Detected settings.json entry
    Using window provider GLFW
    Loaded PyUnity version 0.9.0
    
    Example 1
    /Cube
    /Floor
    /Light
    /Main Camera
    Launching window manager
    Compiling objects
    Starting scene
    Physics is on
    Scene 'Scene' has started
    
    Example 2
    Launching window manager
    Compiling objects
    Starting scene
    Physics is on
    Scene 'Scene' has started
    Traceback (most recent call last):
      File "C:\Users\raych\AppData\Local\Programs\Python\Python39-32\lib\runpy.py", line 197, in _run_module_as_main
        return _run_code(code, main_globals, None,
      File "C:\Users\raych\AppData\Local\Programs\Python\Python39-32\lib\runpy.py", line 87, in _run_code
        exec(code, run_globals)
      File "C:\Ray-Data\python\pyunity\pyunity\__main__.py", line 60, in <module>
        examples.show()
      File "C:\Ray-Data\python\pyunity\pyunity\examples\__init__.py", line 36, in show
        loadExample(i)
      File "C:\Ray-Data\python\pyunity\pyunity\examples\__init__.py", line 20, in loadExample
        module.main()
      File "C:\Ray-Data\python\pyunity\pyunity\examples\example2\__init__.py", line 55, in main
        SceneManager.LoadScene(scene)
      File "C:\Ray-Data\python\pyunity\pyunity\scenes\sceneManager.py", line 243, in LoadScene
        __loadScene(copy.deepcopy(scene))
      File "C:\Ray-Data\python\pyunity\pyunity\scenes\sceneManager.py", line 308, in __loadScene
        windowObject.start(scene.update)
      File "C:\Ray-Data\python\pyunity\pyunity\window\providers\glfw\window.py", line 145, in start
        self.updateFunc()
      File "C:\Ray-Data\python\pyunity\pyunity\scenes\scene.py", line 502, in update
        self.Render()
      File "C:\Ray-Data\python\pyunity\pyunity\scenes\scene.py", line 518, in Render
        self.mainCamera.Render(renderers, lights)
      File "C:\Ray-Data\python\pyunity\pyunity\render.py", line 732, in Render
        self.RenderScene(renderers, lights)
      File "C:\Ray-Data\python\pyunity\pyunity\render.py", line 727, in RenderScene
        self.SetupShader(lights)
      File "C:\Ray-Data\python\pyunity\pyunity\render.py", line 637, in SetupShader
        self.shader.setVec3(b"viewPos", list(
      File "C:\Ray-Data\python\pyunity\pyunity\render.py", line 292, in setVec3
        location = gl.glGetUniformLocation(self.program, var)
      File "C:\Users\raych\AppData\Local\Programs\Python\Python39-32\lib\site-packages\OpenGL\latebind.py", line 63, in __call__
        return self.wrapperFunction( self.baseFunction, *args, **named )
      File "C:\Users\raych\AppData\Local\Programs\Python\Python39-32\lib\site-packages\OpenGL\GL\VERSION\GL_2_0.py", line 430, in glGetUniformLocation
        return baseOperation( program, name )
    ctypes.ArgumentError: argument 2: <class 'KeyboardInterrupt'>:
    

    Additional context

    To do with raising KeyboardInterrupt while running an OpenGL function

    Type: Bug Topic: Module 
    opened by rayzchen 2
  • [BUG] Fix collision detection algorithm

    [BUG] Fix collision detection algorithm

    Is there an existing issue for this?

    • [X] I have searched the existing issues

    System info

    Loaded config
    Detected settings.json entry
    Using window provider GLFW
    Loaded PyUnity version 0.9.0
    ##############################
             VERSION INFO
    ##############################
    PyUnity version: v0.9.0
    Python version: v3.10.4-final
    Operating system: Windows 10
    Machine: AMD64
    Python architecture: 64bit
    Dependencies:
    - pyopengl version: 3.1.6
    - pillow version: 9.1.1
    - pysdl2 version: 0.9.11
    - pysdl2-dll version: 2.0.20
    - pyglm version: 2.5.7
    - importlib-resources version: None
    - glfw version: 2.5.3
    

    Describe the bug

    Physics is broken, when two cubes collide head-on they collide into each other Collision point is offset by 1 unit in the Z axis in example 2 Example 3, red cube has infinite inertia yet it still rotates

    To reproduce

    Run examples 2 and 3, observe For example 2 pressing Space and R starts and resets the cubes respectively

    Code

    No response

    Traceback

    No response

    Additional context

    Using GJK and EPA algorithm, pretty expensive and still doesnt work

    Type: Bug Topic: Module 
    opened by rayzchen 2
  • [BUG] 3D render is flipped left-to-right

    [BUG] 3D render is flipped left-to-right

    Is there an existing issue for this?

    • [X] I have searched the existing issues

    System info

    Loaded config
    Detected settings.json entry
    Using window provider PySDL2
    Loaded PyUnity version 0.9.0
    ##############################
             VERSION INFO
    ##############################
    PyUnity version: v0.9.0
    Python version: v3.10.4-final
    Operating system: Windows 10
    Machine: AMD64
    Python architecture: 64bit
    Dependencies:
    - pyopengl version: 3.1.6
    - pillow version: 9.1.1
    - pysdl2 version: 0.9.11
    - pysdl2-dll version: 2.0.20
    - pyglm version: 2.5.7
    - importlib-resources version: None
    - glfw version: None
    

    Describe the bug

    The skybox is flipped, rotating seems flipped along the Y-axis.

    To reproduce

    Run example 1 and watch the cube rotate anticlockwise.

    Code

    No response

    Traceback

    No response

    Additional context

    No response

    Type: Bug Meta: Invalid Topic: OpenGL 
    opened by rayzchen 3
  • [BUG] OSError with egl

    [BUG] OSError with egl

    Is there an existing issue for this?

    • [X] I have searched the existing issues

    System info

    Loaded config
    Detected settings.json entry
    Using window provider GLFW
    Loaded PyUnity version 0.9.0
    ##############################
             VERSION INFO
    ##############################
    PyUnity version: v0.9.0
    Python version: v3.9.4-final
    Operating system: Windows 10
    Machine: AMD64
    Python architecture: 32bit
    Dependencies:
    Warning: PyUnity not ran as an installed package
    - pyopengl version: 3.1.5
    - pillow version: 9.0.1
    - pysdl2 version: 0.9.11
    - pysdl2-dll version: 2.0.20
    - pyglm version: 2.5.7
    - importlib-resources version: None
    

    Describe the bug

    EGL window provider throws OSError when running multiple examples in sequence

    To reproduce

    Use PYUNITY_WINDOW_PROVIDER=egl and run python -m pyunity.

    Code

    No response

    Traceback

    Loaded config
    Trying EGL as a window provider
    Using window provider EGL
    Loaded PyUnity version 0.9.0
    Warning: Currently broken examples: 3
    
    Example 1
    /Cube
    /Floor
    /Light
    /Main Camera
    Launching window manager
    [<EGLDisplay object at 0x020F8BF8>, <pyunity.window.providers.egl.egl.EGLint_Array_13 object at 0x04F661D8>, <pyunity.window.providers.egl.egl.EGLConfig_Array_1 object at 0x04F66190>, 1, <EGLint object at 0x04F66148>]
    Compiling objects
    Starting scene
    Physics is on
    Scene 'Scene' has started
    Exiting
    
    Example 2
    Launching window manager
    [<EGLDisplay object at 0x020F8BF8>, <pyunity.window.providers.egl.egl.EGLint_Array_13 object at 0x0D2FFB20>, <pyunity.window.providers.egl.egl.EGLConfig_Array_1 object at 0x0D2FFD18>, 1, <EGLint object at 0x0D2FFF58>]
    Compiling objects
    Warning: Detected settings.json entry
    Warning: windowCache entry has been set, indicating window checking happened on this import
    Warning: settings.json entry may be faulty, removing
    Traceback (most recent call last):
      File "C:\Users\raych\AppData\Local\Programs\Python\Python39-32\lib\runpy.py", line 197, in _run_module_as_main
        return _run_code(code, main_globals, None,
      File "C:\Users\raych\AppData\Local\Programs\Python\Python39-32\lib\runpy.py", line 87, in _run_code
        exec(code, run_globals)
      File "C:\Ray-Data\python\pyunity\pyunity\__main__.py", line 60, in <module>
        examples.show()
      File "C:\Ray-Data\python\pyunity\pyunity\examples\__init__.py", line 36, in show
        load_example(i)
      File "C:\Ray-Data\python\pyunity\pyunity\examples\__init__.py", line 20, in load_example
        module.main()
      File "C:\Ray-Data\python\pyunity\pyunity\examples\example2\__init__.py", line 55, in main
        SceneManager.LoadScene(scene)
      File "C:\Ray-Data\python\pyunity\pyunity\scenes\sceneManager.py", line 244, in LoadScene
        __loadScene(copy.deepcopy(scene))
      File "C:\Ray-Data\python\pyunity\pyunity\scenes\sceneManager.py", line 282, in __loadScene
        render.compileSkyboxes()
      File "C:\Ray-Data\python\pyunity\pyunity\render.py", line 338, in compileSkyboxes
        skybox.compile()
      File "C:\Ray-Data\python\pyunity\pyunity\files.py", line 313, in compile
        gl.glTexImage2D(gl.GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, gl.GL_RGBA,
      File "src/latebind.pyx", line 39, in OpenGL_accelerate.latebind.LateBind.__call__
      File "src/wrapper.pyx", line 311, in OpenGL_accelerate.wrapper.Wrapper.__call__
    OSError: exception: access violation reading 0x00000004
    

    Additional context

    Could be caused by using a terminated display but in pyunity/window/providers/window.py eglInitialize is called every time the window provider is instantiated. Similar issues also happen when using 32-bit python on 64-bit machine.

    Type: Bug Topic: OpenGL OS: Windows 
    opened by rayzchen 1
Releases(0.8.3)
Adventure-Game - Adventure Game which is created using Python

Adventure Game 🌇 This is a Adventure Game which is created using Python. Featur

ArinjoyTheDev 1 Mar 19, 2022
A "finish the lyrics" game using Spotify, YouTube Transcript, and YouTube Search APIs, coupled with visual machine learning

Singify Introducing Singify, the party game! Challenge your friend to who knows songs better. Play random songs from your very own Spotify playlist an

Josh Wong 4 Nov 19, 2021
Pokemon game made in Python with open ended requirements from Codecademy

Pokemon game made in Python with open ended requirements from Codecademy. This is one of my first projects utilizing OOP and classes! -This game is a

Kevin Guerrero 2 Dec 29, 2021
An easy to use game engine/framework for python.

A game engine powered by python and panda3d.

Petter Amland 1.6k Jan 05, 2023
A small game I made back in think 2011

Navi Network A small game I made back in think 2011. An online game inspired by the self-hosted nature of Minecraft, made with pygame, based on the Me

Peder Bergebakken Sundt 2 Jan 19, 2022
Ultimaze est un jeu en 2.5D, réalisé dans le cadre d'un projet de NSI.

Ultimaze Ultimaze est un jeu en 2.5D, réalisé dans le cadre d'un projet de NSI. La consigne était d'utiliser la librairie pygame pour créer un jeu en

parlabarbedeMerlin 3 Sep 17, 2022
Backend application for a game to classify waste for recycling

Waste Organizer Game Backend application used in a game to classify trash for recycling. What is waste organizer game? It is a game developed during t

10 Jun 13, 2021
Bingo game now in python play as much you want :) no need to give me credit it's open as fuck

Bingo-py-game A game coded with Python Introduction This is a Terminal-based game currently in its initial stage. I am working on adding more efficien

Frey 5 Aug 12, 2021
Rock Paper Scissors Game with PyQt5

Rock-Paper-Scissors-Game rock paper scissors is a old game that all of us played it but this time let's play with computer Description This is Rock Pa

MohammadAli.HBA 4 Nov 11, 2021
An automation bot to play Myuu Discord game

Auto selfbot Myuu is a self Discordbot, meaning it will use your TOKEN to logged as your account and take commands from yourself to play the game.

6 Dec 15, 2022
Guess number game with PyQt5

Guess-Number-Project Guess number game with PyQt5 you can choose a number in your mind and then computer will guess a nummber and you guide the comput

MohammadAli.HBA 1 Nov 11, 2021
Snake game made in python with the pygame library.

Pygame snake Snake game made in python with the pygame library. Requirements pip pygame Pygame Installation On the command line, type: pip install pyg

Ayza 3 Oct 02, 2022
Rudimentary CMD based implementation of the Tic Tac Toe game

Packages used: questionary random os (Requires Python 3.8 as walrus operators are used in the script) Contains the .py file (tictactoe.py) and an exe

Ashwin 1 Oct 15, 2021
Nerdle - a nerd's approach to solving Wordle

Nerdle - a nerd's approach to solving Wordle

4 Nov 28, 2022
A minimal open source mtg-like tcg game made in python that can be played on a terminal emulator using a keyboard.

A minimal open source mtg-like tcg game made in python that can be played on a terminal emulator using a keyboard.

Amos 3 Aug 29, 2021
Simplerpg - python terminal game made from scratch.

Simplerpg - python terminal game made from scratch.

reversee 3 Sep 17, 2022
Repository for the diana chess competition. AI Lecture 21/22

Notes for Assignment 8 (Chess AI) We recommend using an IDE (like Pycharm) for working on this assignment. IMPORTANT: Please make sure you use python

Cognitive Systems Research Group 3 Jan 15, 2022
A menu for pygame. Simple, and easy to use

pygame-menu Source repo on GitHub, and run it on Repl.it Introduction Pygame-menu is a python-pygame library for creating menus and GUIs. It supports

Pablo Pizarro R. 411 Dec 27, 2022
MCTS (among other things) for 2048

2048 Created by Chad Palmer for CPSC 474, Fall 2021 Overview: This is an application which can play 2048 and simulate games of 2048 with a variety of

Chad Palmer 1 Dec 16, 2021
A small fun project to simulate Conway's Game of Life, created in Python.

A small fun project to simulate Conway's Game of Life, created in Python. Conway's Game of Life simulates a grid of cells, where the state of each cell consists of whether the cell is alive or dead.

Harrison Verrios 1 Jun 19, 2022