Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interesting examples #3

Open
bsavery opened this issue Mar 27, 2017 · 4 comments
Open

Interesting examples #3

bsavery opened this issue Mar 27, 2017 · 4 comments

Comments

@bsavery
Copy link

bsavery commented Mar 27, 2017

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!

@akloster
Copy link
Owner

I think the idea is to spread out the begin_result/end_result across the task, so you would call begin_result with every chunk received, wait for the next chunk on the network, etc. Until all rectangles are finished and you call end_result.

I wouldn't know why end_result() freezes the UI. I Can't check this without further code and explanation.

@bsavery
Copy link
Author

bsavery commented Mar 28, 2017 via email

@hedgehog-labs
Copy link

Hey is this project dead? i just found it and really like the results....is there a way you can point me in the right direction to hear from a tcp server instead of a web server??? inside of blender... i tried to implement asyncio by myself...but the ui always freeze and crashes blender

@akloster
Copy link
Owner

hm, I think the code in the repository should work. It's not meant to be a full fledged extension/API/plugin yet, but rather a set of ideas and proof-of-concepts. But the loop implementation works. Unfortunately there is only very little interest from the Blender community in general. There is a plugin for blender-cloud which uses a similar asyncio hack, but in general, they don't seem to the benefits of asyncio in Blender in the first place. Additionally, I don't have the time or energy to pursue this further at this point.

In terms of TCP servers try this example from asyncio: http://asyncio.readthedocs.io/en/latest/tcp_echo.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants