Building a superior materials editor with Swing within the SDK

Hello everyone,
I’m excited to share a prototype that streamlines material editing within the 3D modeling environment. This approach leverages Java Swing to create custom windows and graphic components directly inside a running BaseAppState.

Here’s the breakdown:

  1. Injected BaseAppState: By injecting the BaseAppState into the scene, we gain access to the application’s core functionalities.
  2. Reflection & Unsafe for Scene Manipulation: Reflection and sun.misc.Unsafe mechanisms (used cautiously) provide access to the 3D scene tree, allowing for manipulation of materials and potentially other elements.
  3. Advanced Material Editor: This approach paves the way for a more powerful Material Editor, potentially supporting new JSON and YAML material formats.
  4. Simplified Plugin Creation: The goal is to simplify plugin development for the SDK by lowering the learning curve for IDE tools.

Benefits:

  • Enhanced Material Editing Experience: A more intuitive and feature-rich Material Editor.
  • Streamlined Plugin Development: Easier creation of plugins for the SDK.
  • Reduced Learning Curve: Lower barrier to entry for developers working with the IDE.

Project Status and Next Steps:

This project is currently under development with a lot of potential for further exploration. If there’s interest from the community, I’d be happy to consider making it publicly available.

Feel free to share your thoughts and feedback!

Options Tab

Textures & Colors Tab

NB: To optimize the space occupied by the graphic components, the color of the buttons represents the color assigned to the material parameters.

Additional RenderState Tab

Here is the project I wrote to support json and yaml formats of Material in jme:
Explore the new JSON and YAML Materials

14 Likes

Updates:

  • The editor is now executable also in desktop mode with configurable LookAndFeel.

  • Clean and compact UI.

  • New menu with “Open File” and “Save” options.
    image

  • Now the texture preview is visible.

  • New function for add/remove textures with useful tooltips on icons.
    image

    image

For comparison this is my previous work with the imgui library:

9 Likes