skybrush-io / studio-blender

Skybrush Studio for Blender - a Blender addon for designing and validating drone shows
https://skybrush.io
GNU General Public License v3.0
43 stars 30 forks source link

[feature request] - light effect : drones color based on mesh formation vertex colors #20

Open NelloF opened 5 months ago

NelloF commented 5 months ago

would be useful to have a light effect mode that inherit the color of the drones from the vertex colors attribute of the formation (if a mesh is used in the formation). So for example if you have a formation mesh with shape of a bird you could have the bird colors on the drones without need of keyframe them

image

ntamas commented 5 months ago

This could work (I did not know that Blender meshes can have vertex colors). But we need to clarify a few things:

  1. What shall we do if a vertex has different colors in different faces of the mesh? I believe this was a possibility with the old vertex_colors attribute in Blender, not sure how the new attribute system works. Does a vertex always have a single color only in the new system?
  2. It looks like we have "Color" and "Byte Color" data types -- I guess we would need to handle both, right?
  3. What if there are multiple color attributes for a mesh, how do we decide which one to use?
  4. What if there are no color attributes for the mesh but the user selects this coloring mode? Shall we use white unconditionally? Or black?
  5. What shall the color of a drone should be in frames when it is transitioning from one formation to another and it does not belong to any of the formations?

From the implementation side, I think this should be a separate "Effect Type". Right now we have "Color Ramp", "Image" and "Function". In the output of this mode, neither the color ramp nor the image would take any part, and it would not involve a custom function either, so I think a new effect type named "Vertex Color" would be appropriate.

NelloF commented 5 months ago

this is my opinion about 1: i think the color could be the average value for all the color data from that vertex

about 2: not sure but maybe the old "Face Corner + Byte Color" is more compatible if you import a colored mesh from an external software. In any case i think one data type is sufficient to handle this kind of effect even without too many options

about 3: maybe only the first mesh color attribute could be used only (at least for a first version of this feature)

about 4 and 5: i think black should be used to avoid any undesired light both if color info is missing or during transitions. If someone needs another color can add another light effect in the stack for that moment

n1ente commented 5 months ago

We have been asking for this possibility for well over a year! And it opens up many new possibilities, two important aspects I would like to be sure can be integrated:

  1. If I have a mesh with X vertices, this approach must be able to retrieve X individual colors

  2. Vertex colors on the mesh can be animated, so color retrieval must be evaluated on each new frame