Assign Vertex Color in Material editor

I need to be able to assign vertex color information dynamically, and programmatically in a way that is accessible to Blueprint… The idea i am working on is to use the Material editor to assign Vertex color, then use the vertex color as the source in blueprint.

There is only one catch, with this… i can’t find a way to assign vertex color in the editor(other than the Vertex paint tool, which won’t work for my game) Is this possible? are there alternatives ways to assign and store material information that is blueprint accessible?

Edit: To clarify, this is to identify odd shaped boundaries in textures(e.g. the insides of a line drawing) on on mesh so that components placed on top of that mesh change their behavior and/or properties

Hello magnetomage,

I believe what you are looking for is a ‘Material Parameter Collection.’ This is a parameter given to a material set by the user, and is accessible by Blueprints.

Here is some documentation on how to go about creating and using ‘Material Parameter Collections.’

Material Parameter Documentation

I hope this is what you were looking for, but if not please let me know and we can explore a different approach.

Cheers,

not quite what i am after. I need a way to determine area boundaries on the underlying mesh to procedurally generate items on top of it… and vertex colors is a fairly low cost way to do it.

The other options i have explored are:

  • keeping an multidimensional array of boundary location. this isn’t a good fit since I would have to manually create and somehow store these arrays;
  • place colliders(or some other component) on the screen and test if i hit them… again I would have to manually set these up, and with a small team and hundreds of them to do, this isn’t really feasible either;
  • the last option is the create the underlying mesh to exactly the shape of each boundary… this is by far the most work, having to create hundreds of specific shaped meshes, and then there is the issue of Polys and performance…

so, If you have any ideas I am open to suggestion. Vertex colors was the first sane option I could come up with.

p.s. i have added an edit to the original question to help clarify things

Hey again Magnetomage,

I read the edit you made and your response and now think I have a better understanding of what you are trying to do. The first option you suggested for yourself would actually be fairly straight forward. Creating a series of multidimensional arrays within your Level Blueprint.

There are a few bounds commands within Blueprint that you could use that would definitely help you with this idea as well.

Get Actor Array Bounds
Find the bounds of an Array of Actors

Get Actor Bounds
Returns the bounding box of all Components for this Actor

Get Component Bounds
Get bounds of Component

Get Local Bounds
Gets local bounds of a Static Mesh

I also found some documentation on different topics related to the ‘Bounds’ of actors.

Property Matrix

Out of Bounds Pixels

Hopefully this information helps you find the appropriate solution to your question. I would suggest posting this question on the Forums as well because there are a ton of really helpful and insightful individuals who might have the exact answer you are looking for. If you still need some direction I can continue to assist you as best I can.

Cheers,

I think i have this sorted. I am posting my solution so if anyone else needs to something like this, they might be able to use it as a starting point. Here how i am doing it:

  1. Storing some information in a data-table. Things like area name, scaling bounds and area center point.
  2. On the start of the level I do a look-up for that area’s info, spawn a temp cube and set it’s scale and center point from the data.
  3. When procedurally generating items on top of the area use the bounds of the temp cube to determine placement and availability.
  4. Once the generation is complete, the temp cube is destroyed and in-memory data is cleaned up.

Pros: functionality is available; Data is stored in one place; Data only has to be entered once.
Cons: Scaling and center point data have to be determined and set manually; More memory is required at start of level; Bounds are not precise to area shape(which is fine in my case)

Thank you for the response and pointing me in a feasible direction.