Closed JeffreyWardman closed 4 months ago
I think it's a good idea to do it in the constructor.
For objects
and actors
they are normal python lists everywhere else.
In fact you can already unpack by name via __getitem__()
:
msh = my_assembly["my_mesh"]
the same should happen in class Group
, but it's lacking right now.
(the difference between the 2 is that the assembly can be rotated and moved in 3d space, whereas groups are more generic)
I've added dictionary as an input for both Group and Assembly. Did not resolve being able to index Group. Tested with a dictionary of one and two. Both work as intended. See #1057.
Merged.
Will implement once decided on how it's handled.
For a vedo.Assembly, you can unpack via name, however name has to be set via:
I recommend being able to handle
vedo.Assembly({"mesh": mesh, "mesh2": mesh2})
where it just allocates the name upon initialisation if the input argument is a dictionary:It'd be nice to convert
self.actors
andself.objects
such that you can then doassembly["mesh2"]
. Did you have any thoughts on if this should/shouldn't be implemented @marcomusy? If so, what's your preferred approach for the indexing?