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

Update Material when MatDef changes on disk #452

Open
neph1 opened this issue Jan 19, 2023 · 2 comments
Open

Update Material when MatDef changes on disk #452

neph1 opened this issue Jan 19, 2023 · 2 comments

Comments

@neph1
Copy link
Contributor

neph1 commented Jan 19, 2023

From @grizeldi 's wishlist:

"The preview as it is, is rather useless for shader development, as it doesn’t have live refresh. If I change my shader file on disk, the preview should refresh, so I don’t need to reopen the material window every time I do a small shader tweak. Lack of this functionality sadly prevents me from undocking the material editor, putting it somewhere else in the UI and just start coding."

I see two ways of doing this:

  • As the scenecomposer does it for materials, through a listener/provider on the Shader editor
  • As the scenecomposer does it for models, listening for changes on the file itself.

The first creates a nice integration with the other editors, encouraging usage. It however requires using them, and I figure a lot of people will be editing text files.
The second allows for external editing, but it's complicated a bit by being multiple files (at least 3, matdef, vertex and frag shaders)

Given that, the first one is probably easier to implement.

@neph1
Copy link
Contributor Author

neph1 commented Jan 20, 2023

If this is going to work in other instances (ie the scenecomposer) using the listener pattern is probably best. Then we can use it wherever we want)

@neph1
Copy link
Contributor Author

neph1 commented Sep 26, 2023

I just found out I had already made a listener while working on the Shader Editor, I presume :P

class MatStructChangeListener implements PropertyChangeListener {

Edit: NM, it was for the structure of the MatDef. But it got me started!

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

No branches or pull requests

1 participant