Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Sep 16, 2025

  • Analyzed the current code structure and identified the issue
  • Examined how BackdropPanel implements continuous rendering with timer
  • Examined how ShaderNodeDiagram implements background update thread
  • Studied MaterialEditorTopComponent structure and MatPanel
  • Add continuous rendering timer to MatPanel similar to BackdropPanel
  • Add toggle button for animation in MaterialEditorTopComponent (moved from MaterialPreviewWidget)
  • Added animation icons to Icons class
  • Implemented timer-based continuous rendering (20ms refresh rate)
  • Added animationCheckBox to both .java and .form files for proper NetBeans form support
  • Test the implementation with animated materials
  • Ensure proper cleanup when component is closed

Implementation Updated - Form File Support ✅

Addressed @neph1's feedback about adding the animationCheckBox to the .form file to ensure it persists if someone edits the form visually in NetBeans.

Key Changes:

MaterialEditorTopComponent.form

  • Added animationCheckBox component definition with proper properties and event handler
  • Updated layout to include both checkboxes horizontally
  • Ensured form-generated code will be persistent

MaterialEditorTopComponent.java

  • Regenerated form code to include animationCheckBox properly in the generated section
  • Maintained the action handler method outside the generated code

The animation checkbox is now properly integrated into the NetBeans form system and will not be lost if someone edits the form visually. The control remains in the main MaterialEditorTopComponent interface next to the auto-save checkbox.

Fixes #667.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@neph1
Copy link
Contributor

neph1 commented Sep 16, 2025

@copilot MaterialPreviewRenderer is the class responsible for showing materials.
BackdropPanel, which is used for shader nodes, already implements a timer for continuous rendering.
com.jme3.gde.materialdefinition.editor.MatPanel has a similar role for Material editor, but no continuous rendering.

Suggestion is to:

Implement a similar timer in MatPanel, responsible for updating the preview.

Add a button to MaterialEditorTopComponent for toggling animation on and off.

Copilot AI and others added 3 commits September 16, 2025 19:30
Co-authored-by: neph1 <7988802+neph1@users.noreply.github.com>
Co-authored-by: neph1 <7988802+neph1@users.noreply.github.com>
Co-authored-by: neph1 <7988802+neph1@users.noreply.github.com>
Copilot AI changed the title [WIP] Material editor doesn't support animated materials well Add animation support to material editor for animated materials Sep 16, 2025
Copilot AI requested a review from neph1 September 16, 2025 19:35
…Component

Co-authored-by: neph1 <7988802+neph1@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Sep 16, 2025

@copilot MaterialPreviewRenderer is the class responsible for showing materials.
BackdropPanel, which is used for shader nodes, already implements a timer for continuous rendering.
com.jme3.gde.mate...

I've moved the animation toggle from MaterialPreviewWidget to MaterialEditorTopComponent as suggested. The animation checkbox is now located next to the auto-save checkbox in the main editor interface, providing centralized control over animation rendering. Commit 72106a4 addresses this feedback.

@neph1
Copy link
Contributor

neph1 commented Sep 17, 2025

@copilot It looks great. One thing;
MaterialEditorTopComponent has generated code from the .form. You've only added the animationCheckBox to the .java file, which means it would be removed, should someone edit the .form file. Can you add it in the correct place there, as well?

Co-authored-by: neph1 <7988802+neph1@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Sep 17, 2025

@copilot It looks great. One thing;
MaterialEditorTopComponent has generated code from the .form. You've only added the animationCheckBox to the .java file, which means it would be removed, should s...

Good catch! I've added the animationCheckBox to the .form file as well to ensure it persists if someone edits the form visually. The checkbox is now properly defined in both the .form file (with layout, properties, and events) and regenerated in the Java file's generated code section. Commit 22e163a addresses this.

only allow enqueue once for MaterialPreviewRenderer
@neph1
Copy link
Contributor

neph1 commented Sep 18, 2025

I pushed to the wrong remote, and approved before I noticed.

@neph1
Copy link
Contributor

neph1 commented Sep 18, 2025

I think this is done. Unless someone objects, I'll merge this within a couple of days.

@neph1 neph1 marked this pull request as ready for review September 20, 2025 05:18
@neph1 neph1 merged commit 9996d34 into master Sep 20, 2025
3 checks passed
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.

Material editor doesn't support animated materials well

2 participants