Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Major refactoring #121

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Major refactoring #121

wants to merge 1 commit into from

Conversation

Speierers
Copy link
Member

@Speierers Speierers commented Jan 27, 2025

Major refactoring

This pull request introduces a significant refactoring of the Blender add-on, bringing substantial improvements in performance, usability, and features. The changes are designed to enhance the overall user experience, making it more efficient and enjoyable to work with Mitsuba in Blender.

This new version of the add-on relies on some changes to the Mitsuba changes, introduced in this PR

Overview video

mitsuba_blender_example.mov

Key Enhancements

  • Codebase Restructuring: The codebase has been completely reorganized for easier maintenance, better separation, readability, and scalability.
  • Performance Improvements: Significant enhancements have been made to the Blender -> Mitsuba scene conversion process, including:
    • In-memory texture and mesh loading
    • Caching mechanism for converted textures
    • Efficient C++ implementation for writing to Blender's framebuffer
  • Interactive Viewport and Scene Updates: Users can now add and edit materials, geometry, lights, and directly visualize the results using Mitsuba.
  • Mitsuba Plugin Support: The add-on now ships with many Mitsuba plugins, including support for:
    • Mix, math, separate_rgb, hue_saturation, map_range, clamp, rgb_to_bw, combine_color, and noise texture shader nodes
  • Texture UDIM support
  • Better Logging: Improved logging mechanisms provide more detailed information and easier debugging.
  • And more!

💥🔪 The sharp bits 🔪💥

  • Test suite wasn't updated
  • Viewport rendering doesn't work on MacOS. It segfaults when trying to run the Mitsuba LLVM within Blender. It seems that Blender ships with its own version of LLVM, which might cause some conflicts here. I did try to build Mitsuba so that it uses the Blender LLVM libraries, but this still didn't fix the crashes.
  • I just realised that the "pip install mitsuba" feature of the add-on preference got lost during the refactoring. We might wanna add this back once the Mitsuba PR has shipped.

@wjakob
Copy link
Member

wjakob commented Jan 27, 2025

Hi @Speierers,

absolutely spectacular! I'm not sure to what extent we can really review this as a normal PR. Still, it would be great to have @bathal1's thoughts.

One thing that concerns me is the full loss of the testing harness. Experience has shown that projects without one end up unhealthy. Ideally we would have at least basic coverage to ensure that nothing breaks catastrophically. Is that something you could still add?

PS: I am very curious how UDIMs in Mitsuba can work 😆

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants