GPU OffsCreen to Python: New `bind_unbind` method to work in the with-block context.
ClosedPublic

Authored by Germano Cavalcante (mano-wii) on Thu, Nov 8, 5:54 PM.

Details

Diff Detail

Repository
rB Blender
This revision is now accepted and ready to land.Fri, Nov 9, 5:10 AM

Note, we could make bind perform both bind and bind/undbind context manager, just as open(..) does for Python, apply this to matrix.push_pop.

@Germano Cavalcante (mano-wii): Can you implement the suggested changes and commit it please, so that I can update the API examples before the beta?

  • Make bind perform the bind/undbind context manager, just as open(..) does for Python;

    Also, the __enter__ and __exit__ methods have been added to the original GPUOffscreen object type. This avoids allocating more objects and is useful if you want to do something like:
with offscreen.bind() as ofs:
This revision was automatically updated to reflect the committed changes.