marcomusy / vedo

A python module for scientific analysis of 3D data based on VTK and Numpy
https://vedo.embl.es
MIT License
2.05k stars 266 forks source link

Adding item to Group #1161

Closed smoothumut closed 4 months ago

smoothumut commented 4 months ago

Hi Marco, this line of code looks like it needs to be changed

in assembly>Group class

def __iadd__(self, obj):
    """
    Add an object to the group
    """
    if not vedo.utils.is_sequence(obj):
        obj = [obj]
    for a in obj:
        if a:
            self.AddPart(a)   ### here
    return self

needs to be

def __iadd__(self, obj):
    """
    Add an object to the group
    """
    if not vedo.utils.is_sequence(obj):
        obj = [obj]
    for a in obj:
        if a:
            try:
                self.AddPart(a.actor)  ### here
            except:
                self.AddPart(a)
    return self

like in Distance_Tool

If I come across more, I will let you know Best Regards

marcomusy commented 4 months ago

Sure would you mind making a PR?

smoothumut commented 4 months ago

Of course I dont mind, but I havent done anything like that before : ) Please let me try and I will let you know...