Download

Color widget

So i need switch colors for furniture.
I have made Line Trace for furniture and when am in radius i can press E and widget shows up.

I am stuck with colors.

How can i make widget that only shows assigned colors to change for each furniture?
So i dont need to make widget for every furniture.

Look into arrays, and blueprintable components.

Make blueprintable component that holds arrays of colors, and when you pick furniture that component can tell your pawn what colors it stores.
Then make enumerator, and make all those components set their colors based of enumerator you gave them when you place them in level.

I tried to make that component, but there are serious trouble with handling materials trough it. So I will try to make actor that handles all that and you can inherit it and make variations, should be much simpler code.

Thank you for the reply.
Will look into blueprintable components.
I made Struct with item info and image. I seted info and image for each Furniture now i need to display that image on button when color widget opens and set desired color to furniture.

I am making whole project for this, and i kind of got carried by it. All that stuff (that i think you need) is not that simple.

Edit 2:
I cleared project a bit. However there is some bug either i am doing something wrong or its 4.21 build fault.
For some reason setting vector parameter for material in array does not work. I tried same code in 4.20 and it works.
Will continue tomorrow, probably migrate it all to 4.20 without starter content.

here is today link: https://www.dropbox.com/s/33fvwgypmd…eared.rar?dl=0

What is left is fixing that bug, then updating widgets with working arrays.

I will check it today!

Welp i am noob but this is complex.
I will upload my project on Monday so you can see what i want and need.
I was thinking. Is it possible to make automatic code Like= Master_item it is furniture item. Add Material to it by Struct or Enum. Choose how many materials you want and which ones. And Script automatically makes script to that item and sets colors so you dont need to make code for each material. And new materials are added also on widget. And when you are near Actor, furniture, just click and opens widget with those specific materials you choose for that furniture. And so on for any item.

I just need to figure out how to add script to any item so it generates color script. hope you understand this :smiley:

I done that with materials. You submit materials and colors then script makes array of every possible combination of material and color. And i think i have almost what you described. I recreated project under 4.20, and it is cleaner than yesterday.

There is no really advanced stuff inside. Just communication, some basic things with widgets, and creating dynamic materials.

I will update when i finish widgets.

EDIT:
It is done : https://www.dropbox.com/s/3sqv2uukc2…s_420.rar?dl=0
user interface needs more work, but this is simplest version of what you tried to make, should be good starting point.
stuff it has:

  • creating variants of material for given colors and base materials, it makes colors * materials array
  • two basic widgets to display single material information
  • detecting proximity of furniture and changing those 2 small widgets
  • one grid widget that can display whole created collection

There is plenty of work to do with user interface, grid widget is really dumb, etc.

Ok. i went through it. Well good job.
So when i make base material like wood and i add it to My Base Material i Have to add color or it will not go trough. At least thats what i get. What i need is to add The base color just like client wants and than add different options he can choose from, Dark wood, green wood what he likes. And change them in game.https://youtube.com/watch?v=4NAioiZvVoQLike this

You have two widgets that show furniture colors and materials. Code is quite simple (that is why i did not add any more functionality).
It is very simple to add events for mouse wheel up and down and cycle color variations from array.
And that would be basically what you asked for in first post (with some extra code that i am guessing you will need next.)

https://docs.unrealengine.com/en-US/…MaterialLayers

Also look into “Layered Materials”, they are much beter suited for archvis.

Thank you very much for this!