From 0b7997cf8b4009fdb4d60d0bb79b27e48723ab4a Mon Sep 17 00:00:00 2001 From: Valtteri Koskivuori Date: Wed, 19 Jun 2024 00:21:31 +0300 Subject: [PATCH] blender: Add a few more remarks Ideally someone more familiar with Blender would be able to point out a bunch of weirdness in my plugin implementation in 5 minutes. I constantly feel like I'm doing things the wrong way, and no amount of browsing the documentation or looking at how Cycles does things has helped with that. Cycles mostly just passes the Blender datastructures to the C++ side, and deals with it there, and I couldn't find many examples of actually fully using this bpy.types.RenderEngine to integrate a 3rd party renderer, so this has mostly been (slow) trial and error to get here. I feel like I've gotten 80% of the way there, but I'm really stuck on the last 20% --- bindings/blender_init.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bindings/blender_init.py b/bindings/blender_init.py index 5c3494ff..60fe3ddb 100644 --- a/bindings/blender_init.py +++ b/bindings/blender_init.py @@ -384,6 +384,9 @@ def partial_update_mesh(self, update): mesh = update.id print("Mesh {} was updated".format(mesh.name)) # For now, we only handle transforms. + # I find it frustrating that the only way to inspect these types is by + # dumping them at runtime. It's a really slow way to explore an API. + # Surely there is a better way? if update.is_updated_transform: # FIXME: How do I get the actual instance index from Blender? # Just grabbing the first one for now. @@ -451,7 +454,7 @@ def view_update(self, context, depsgraph): self.cr_renderer.start_interactive() def display_bitmap(self, bm): - # Get float array from libc-ray + # Get float array from libc-ray containing the raw render buffer, and then build a render result with it print("Grabbing float array from lib") start_first = time.time() float_count = bm.width * bm.height * bm.stride