Skip to content

Smg/all materials#37

Merged
sfmig merged 37 commits intomainfrom
smg/all-materials
Apr 24, 2023
Merged

Smg/all materials#37
sfmig merged 37 commits intomainfrom
smg/all-materials

Conversation

@sfmig
Copy link
Copy Markdown
Collaborator

@sfmig sfmig commented Apr 24, 2023

Extended the materials panel to show a subpanel for each existing material. Closes #13

This was a modification from the initial approach, in which the materials panel only showed info for the currently active material.

Features:

  • only materials with use_nodes=True are added to the list. By default, use_nodes is set to True, but this is a convenient way to add/remove materials from the panel.
  • clicking the name of the material in a subpanel header shows its node graph. If a material is clicked and it has no slot assigned, a new slot will be created for it.
  • I separated in modules the material properties and added a config module to define parameters that need to be shared several modules.

Approach to define a subpanel and view-graph operator for each material:
I followed the example here. The idea is that I define a maximum number of subpanels (100 for now), but only display as many subpanels as materials are defined. Although some subpanels will never be used, this is more robust than defining the subpanels as needed. I applied the same method for the view-graph operators.

sfmig and others added 30 commits March 24, 2023 16:21
…: min and max values are reset when the material changes)
…removing nodes. this is done by defining a collection of sockets for each material.
* subpanels are updated when materials are added, removed, their names are edited or the use_node checkbox status changes.

* also the operator only shows if there are input nodes for that material.

* The operator per subpanel is disabled as it is not working yet.
@sfmig sfmig requested a review from ruaridhg April 24, 2023 13:12
Copy link
Copy Markdown
Collaborator

@ruaridhg ruaridhg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@sfmig sfmig merged commit 5710e39 into main Apr 24, 2023
@ruaridhg ruaridhg deleted the smg/all-materials branch September 20, 2023 15:28
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.

Show all materials in the panel

2 participants