Context manager to ensure balanced bind/unbind calls, even in the case of an error.
Request from @Jacques Lucke (JacquesLucke)
Details
Details
Diff Detail
Diff Detail
- Repository
- rB Blender
Event Timeline
Comment Actions
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.
Comment Actions
@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?
Comment Actions
- 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: