cheind / pytorch-blender

:sweat_drops: Seamless, distributed, real-time integration of Blender into PyTorch data pipelines
MIT License
568 stars 44 forks source link

Dataloader with mesh from scene #27

Closed yihao19 closed 1 week ago

yihao19 commented 1 week ago

I am wondering if it is possible to make dataloader return the actual mesh I created instead of the image?

cheind commented 1 week ago

Yes, that should work ... it hasn't been done, but you would just need to pass along the mesh vertices / faces from blender.

If you take this example and line https://github.com/cheind/pytorch-blender/blob/a5b819f04ff5c7145b7164b48abd1a3fe69f0db4/examples/compositor_normals_depth/compositor_normals_depth.blend.py#L23 you would need to publish the mesh instead of the image. The publisher should be able to send around any pickleable object: https://github.com/cheind/pytorch-blender/blob/develop/pkg_blender/blendtorch/btb/publisher.py

yihao19 commented 1 week ago

Thank you