material editor for multiple selection ?

Issue #956 resolved
Alessandro Padovani created an issue

This is a request in the daz forum.

https://www.daz3d.com/forums/discussion/563081/

One weak point of blender is editing materials and the material editor comes very handy for this. But it works on one selected object. May it be possible to make it work on multiple selection ? So for example to change the color to red in all the selected objects ?

Have no idea if this is doable at all. Please Thomas let us know what you think. I’ll close if this is an “excessive“ request.

Comments (20)

  1. Midnight Arrow

    For that to work the materials need to be standardized. Otherwise there’s no way for the program to know which colors should be red. You would need to create your own uber shader that encapsulates all the different nodes Diffeomorphic currently uses and exposes them through a unified interface like typical OOP polymorphism to ensure the program knows what you want it to do when you select an object. One of the biggest failings of the current material editor is it breaks when the node tree isn’t like how it expects.

    Personally I think it’s a good idea for the bridge to move towards an uber shader but it’d probably take a lot of work though.

  2. Alessandro Padovani reporter

    I agree with you about the “standardized“ materials and indeed I have no idea how Thomas manages to do that. That’s why I talked about “excessive“ request.

    Maybe the material editor should be limited to the principled option that’s “standardized“ enough.

  3. Midnight Arrow

    What I mean is, you need to create one single node group that handles all materials and has every kind of node group inside it. Then have all the material operations happen on that. Since the node group will be the same for every material, you only need to code one kind of operation and run it on every selected material.

  4. Alessandro Padovani reporter

    Yes I understand that, the current approach is to only convert what’s needed that results in much “simpler“ materials that personally I like more. And if it was for me I’d drop the dual output as well Thomas knows that. To design a “daz uber shader“ and a “daz pbrskin shader“ and possibly a “daz default shader“ both in bsdf and principled options would be a huge work and much less optimized.

  5. Midnight Arrow

    On the other hand implementing a material editor that is capable of parsing non-standardized node trees is also a huge work since it has to handle so many different cases and there are so many failure points. I think it’s either one or the other. I’d prefer a standardized uber shader but I’m not the one that has to code it, so…

  6. Alessandro Padovani reporter

    And that’s why the material editor could be limited to principled to simplify it. The bsdf option is anyway intended for a high quality and complex iray conversion not fitted to material editing. If the user wants simple materials to edit then there’s the principled option. So again the material editor could be limited to principled this makes sense, at least to me.

  7. Thomas Larsson repo owner

    It wouldn’t be very hard to extend the editor as it is to all selected meshes. The main difficulty would probably be to make a nice UI, since adding a checkbox for each material for each selected mesh could easily blow out of hand. Perhaps one could add an option to affect all materials in the selected meshes.

    However, note that the edit will only affect materials which already have the relevant node groups; adding new node groups is beyond the scope of this tool. So if all materials are selected and translucency is changed, the change will only affect the skin materials that already have a translucency group, but not the eye materials that don’t.

  8. Alessandro Padovani reporter

    Thank you Thomas. I guess what you propose will work fine, I mean affect all selections and limited to material nodes. For principled all the sockets are always available anyway so will work even better. Again you may consider simplifying the editor for principled only if this makes things easy for you.

  9. Thomas Larsson repo owner

    Implemented option that affects all materials in all selected meshes. However, I’m unsure how useful this is, because it changes all channels, not only the ones that have been edited. Remember that the main purpose of the tool is to change the tint consistently, whereas the textures are unchanged.

  10. Alessandro Padovani reporter

    daz studio 4.15.0.30, blender 3.1.2, diffeomorphic 1.6.2.0957

    Commit 36f09ca doesn’t seem to work here. I can’t edit the materials, for example the diffuse box doesn’t open. Also the editor disappears as soon as I take the mouse pointer away. Test scene provided colors.duf.

    Also it’s not useful to modify all the channels. Only the edited channels should be affected. We may provide a check box in the channels to affect/unaffect for example, or assume only the dropped boxes will affect.

    steps:

    1. import colors.duf with the principled option
    2. select all objects, cube + cilynder + cone
    3. open the material editor, check all materials, drop the diffuse box

  11. Thomas Larsson repo owner

    The diffuse channel is only available if you import the file with the bsdf method - it corresponds to a diffuse bsdf node. Otherwise you edit the principled channel instead.

    The changes only take effect when you press the Update Materials button at the bottom of the dialog window. In this way you can keep editing the materials without launching the editor again, but unfortunately it also means that the window closes when the mouse moves away. Not sure how to avoid that.

    I agree that it is not very useful that unchanged channels are updated too; I noticed this in my previous comment. It sort of makes sense for the original purpose, to consistently change the tint of skin textures.

    Finally, it is not enough just to be able to edit the principled node. Recall that the material editor grew out of a tool for modifying the bump distance for 3dlight materials converted to iray.

  12. Alessandro Padovani reporter

    Then commit 36f09ca works as intended, thank you Thomas for the explanation.

    May it be possible to add checkmarks to the principled channels so to only affect some of them ? Also if possible would be useful to group principled and bsdf into two main categories. So to open only principled or only bsdf as needed. Makes sense since we have a principled/bsdf workflow.

  13. Alessandro Padovani reporter

    Commit b4ed8d0 works great. A couple notes.

    1. The principled option misses the emission strength and alpha channels.
    2. Having checkboxes for the modified channels would be better, otherwise you must be careful what you touch. But this is minor.
    3. It is very easy to go out of the editor window and make it disappear. Seems like it’s a tooltip. This doesn’t happen with the other windows as “import units“ or “convert to rigify“ or “make hair“ for example, where you have to press esc to quit the window.

  14. Thomas Larsson repo owner

    1 and 3 have been fixed. I’m not sure that checkboxes would actually be an improvement, so I’ll skip that for the time being.

  15. Alessandro Padovani reporter

    Commit 9ad11f4 works great.

    I’ll leave this open for @juvesatriani at the daz forum to test since was his request, then mark as resolved. In my opinion it would be useful to have some visual feedback when a channel is modified, for example the label could turn red. But a checkbox would be better to allow multiple different material updates within the same session. But again this is minor.

  16. Alessandro Padovani reporter

    p.s. Thomas please let me know what you think as for #947 that’s always to handle a set of materials that the blender tools can’t.

  17. Log in to comment