Home Unreal Engine

Batch rename and similar operations in the material graph?

grand marshal polycounter
Offline / Send Message
Alex_J grand marshal polycounter
This is sort of like a cross-over post with a question I asked here: 
https://forums.unrealengine.com/t/a-quick-way-to-rename-parameters-in-material-graph/1706116

But my broader question for polycount is, are there any tools or methods to improve QOL with the unreal material graph? 

Renaming a bunch of parameters, recateogrizing and organizing parameter groupings... do you ever make base materials in c++ just to make that sort of thing easier? Does your team use any custom tools?


edit: 
this video pretty much answers the question about c++
https://www.youtube.com/watch?v=Fd56hSN83mk
looks like it is possible to entirely build a material in c++, and then renaming/categorizing parameters would be faster.


Replies

  • poopipe
    Offline / Send Message
    poopipe grand marshal polycounter
    You can build materials with blueprint if you're feeling masochistic enough - you just have to start with an empty one and modify it. 

    you can make tools to rename params, redirect noodles, replace textures, add nodes etc.  but generally speaking there are far better ways to solve the problem.
    The only time I've ever found it actually necessary was when converting decal actors to meshes or when i needed a shit load of uninstanceable materials to write into RVT

    99.9% of the materials in your project should be material instances and everything should make heavy use of material functions so this sort of thing should almost never be needed



  • Alex_J
    Offline / Send Message
    Alex_J grand marshal polycounter
    @poopipe
    the motivation was a landscape material, where there is a bunch of layers and I use some mask for variation in each layer. 
    I think that I have used material functions as much as I can, but there still is a need for like 10+ unique parameters, seen here: 


    Renaming ten parameters in blueprint graph isn't a huge deal, but during course of development you refactor things and so on and then when you have to click each parameter node and f2 every time, it gets old. In the regular blueprint graph you can go through variables or functions in myblueprint tab and rename it all with keyboard only which is better, but usually I put my variables in c++ now just so that if i want to give a ton of things different naming convention I can do a Find and Replace in Rider. 

    For something like this, would you consider just manually renaming them to be acceptable level of tedium to just deal with? 





    Edit: adding another example: 
    This is definition for a landscape layer. The parameters have to be unique

    and then each of these, I just used a collapsed graph because the contents have to be unique. But each time I duplicate, I have to rename all the parameters manually. :

  • poopipe
    Offline / Send Message
    poopipe grand marshal polycounter
    tbh, I'd probably just suck it up and do the work by hand if it was just for my own benefit

    however, if you did want a tool I dont think there's much to choose in terms of work between doing it in c++ vs blueprint.
    I choose BP for most of my tools (even if it's more arseache) because it's easier to distribute new resources to an art team than to have them wait for a new editor build.

    however again...
    Your landscape layer could be made more re-usable . You can move the logic into a generic layer material function and use function inputs to pass parameters and textures in. 




    then plug the unique stuff in the containing material


    this isn't necessarily the best setup - instead of using texture2d objects you could use standard texture samples and pass them through as v4 

    I'm aware that I used the wrong datatype for the tint in the first picture, couldn't be arsed fixing the screenshot
    I'm also aware that I need to tell the containing material to use material attributes


  • Alex_J
    Offline / Send Message
    Alex_J grand marshal polycounter
Sign In or Register to comment.