Code Monkey home page Code Monkey logo

blender-asyncio's Introduction

Asyncio for Blender Python API

This is an experimental project to explore the use of Asyncio in Blender. With asyncio it is possible to run clients and servers from inside a Blender instance.

  • "BlendSite" is a fledgling framework to build aiohttp-based web-interfaces and REST API endpoints to interact with a running Blender instance
  • A couple of examples explore how to use dialogs, events and handlers asynchronously

Nothing of this is currently meant to for inclusion into mainstream Blender.

Installation / Running

To run the examples use this command:

> PYTHONPATH=./ blender -P blender_async/examples/dialogs1.py

This project uses quite a few dependencies, so there is a dependency_utils module which makes them available to the PYTHONPATH. Something of an improvised package manager, if you will.

blender-asyncio's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

blender-asyncio's Issues

A typo

There's '_test.blend' (not '_tests.blend'), therefore this command from readme.md doesn't work:
blender async_tests.blend --python async_tests.py

So, is this code suitable for having external editor to send python code to blender and to autocomplete bpy.commands inside the external editor?

using as an addon

I struggled getting asyncio to work not knowing about this bridge, mainly because I did not understand coroutines in python.

Is this bridge still necessary in blender 2.77? if so, I will try and add the asyncio_bridge.py as an addon and if needed add a pull request here. essentially this seems so general, it should eventually move into blender, no?

Interesting examples

Came across this from the blender-contribs list. Here's an example of something I've been looking at, if you could point me to the code here where I should start looking, that would be appreciated!

So imagine you have some network rendering solution, you hit render in blender, and it starts the rendering remotely or even in a separate process. As tiles/buckets of the render are done it would receive those over the network (asynchronously), and write to the renderresult. If you take a look at the RenderEngine plugin example this might make more sense : https://docs.blender.org/api/blender_python_api_current/bpy.types.RenderEngine.html

It seems like the correct thing would be to start the server which would receive rendered tiles in the render_scene method in the linked example. So I did that, just wasn't sure if there was some way we should be grabbing the correct event loop, it also seems like the blender ui freezes when end_result() is called.

Thoughts? Thanks for the example!

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.