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] - Using a collection of meshes for LED effect #17

Open MartinMerkl opened 5 months ago

MartinMerkl commented 5 months ago

Would it be possible to allow using a collection of mesh objects instead of a single object for the "Mesh" option of LED effect? This would reduce the copying of LED effects for me and allow for better organization of LED effects. Joining multiple mesh objects into a single object is not a solution because then they can't be animated independently. image

ntamas commented 5 months ago

Related to #16 as both would require a redesign of how a mesh is associated to a light effect.

ntamas commented 5 months ago

In theory this could be solved in three ways (not sure which one is possible with Blender's Python API):

  1. We could change the type of the associated mesh to accept either a single mesh or a Blender collection containing meshes. When the associated object is a collection, the lgiht effect evaluator would need to iterate over all meshes contained in the collection and evaluate containment for all of them. We need to keep open the possibility of letting the user choose between a containment test for all meshes vs any of the meshes as both options would have valid use-cases.
  2. If associating a collection or a mesh to a single Blender property is not possible, we would need to add another property to the light effect that lets the user pick a collection instead of a single mesh. Otherwise it would be the same as option 1 but with the added inconvenience of having two separate props, one for a single mesh and one for a collection.
  3. We could host a collection of meshes in the light effect itself. This is a backwards-incompatible change if we remove the single-mesh property and it would not allow the user to re-use the same mesh collection in multiple light effects.
ntamas commented 5 months ago

@mrkvel If we added an option to select a collection instead of a single mesh only, would that solve the problem for you? This way we would not need to add widgets to manage the contents of the collection as you could build the collection in the Outliner.

MartinMerkl commented 5 months ago

@ntamas Thanks for looking into this. ad 1.) My idea was only to expand the single-mesh option to a collection of meshes by iterating the input collection. Right now I don't see any benefit in testing the containment for all meshes. ad 2.) I don't know how "painful" it would be for other users but could this be solved by forcing the user to use a collection? And then the containment test would be done against any of the meshes inside the collection. There would be more collections inside the outliner but it would also force the user to have a better "bookkeeping" of the meshes ad 3.) I would not go this way.

MartinMerkl commented 5 months ago

@mrkvel If we added an option to select a collection instead of a single mesh only, would that solve the problem for you? This way we would not need to add widgets to manage the contents of the collection as you could build the collection in the Outliner.

yes, this would work.