[Bf-cycles] realtime preview

Nathan Letwory nathan at mcneel.com
Thu Nov 12 13:31:34 CET 2015


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

And hi again,

I wanted to illustrate what I'm doing with some links into the source
of RhinoCycles. It might help see how it could be done. (And I'm
assuming here I understood Cycles session management properly ;)

Links interspersed in message below.

On 12/11/2015 14:19, Nathan Letwory wrote:
> Hi,
> 
> On 12/11/2015 13:55, Mohamed Sakr wrote:
>> Hi,
> 
>> this crashes at some point, any ideas about the general logic 
>> here? note that I'm working with background = true
> 
> With my work on RhinoCycles integration I have found that modifying
> a running render session with background=true isn't very easy to
> do. You'll have to first cancel the running session, push your
> changes, then reset and restart.

Not so long ago I was still using background-rendering in RhinoCycles.
The update and render cycle look like this:

https://github.com/mcneel/RhinoCycles/blob/5a04498c14779533395bbb59b649e33dec4e0f0d/RenderEngines/ViewportRenderEngine.cs#L150

This worked together with a check for changes (and possible upload) here:

https://github.com/mcneel/RhinoCycles/blob/5a04498c14779533395bbb59b649e33dec4e0f0d/RenderEngine.cs#L150

- From CheckFlushQueue() you can see that I cancel the session before
starting upload to Cycles.

> If you render with background=false you can first pause the
> session, then lock, update, reset and unpause.

Simple start for the render session in RhinoCycles happens here:



https://github.com/mcneel/RhinoCycles/blob/master/RenderEngines/ViewportRenderEngine.cs#L153



Up until this basic session, scene and their parameters have been
created and connected.



CheckFlushQueue() checks if there are any changes in the changequeue,
which at this point will be true. Synchronize() will pause the
session, push the data, reset and unpause.



Similarly, while the interactive render session is running I
periodically check for new changes, which I do in the class governing
that:
https://github.com/mcneel/RhinoCycles/blob/master/Viewport/RenderedViewport.cs
, more specifically in the UiUpdate() function here
https://github.com/mcneel/RhinoCycles/blob/master/Viewport/RenderedViewport.cs#L125


Hopefully this helped.

/Nathan


> 
> 
>> cheers, Mohamed Sakr
> 
> 
> 

- -- 
Nathan Letwory
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJWRIamAAoJEKtfN7KsE0TtIkMH/3BJb+0PTMvNqzLdkEngOaXJ
UL7WqqyQ6ZgTfS8DYN9cnIqhM9TbLHvm9i3E/Xag7wO8F7nAQozAF1VQGJx+5jMM
AGqFL6/rXQQf+Vhy12FQ3dLUzsBVdDB/jRubvQXnm20Be1cgBEUQXWSenv0jQ4bg
1QLC89D+kvTFtctwAZDouu/ZPl6jpkJydJf9JxUhoUiXQ8PBY1TR70Lz/sGfgw9w
uhOFkETOOl7PcAik6Vqfo6g7Rm33icKOPVtbkVf2nwbUHnbDnwmrqBX34kAeWrGK
3BxdvEb7YcqneIFWdXGc8NYtsioyCzimx/Wl4+eTl2P9Z1lvpt6TiCJMS1jKHBU=
=Ducn
-----END PGP SIGNATURE-----


More information about the Bf-cycles mailing list