I'm using collection.objects
to ask for the objects in a collection, and it gives me the whole object hierarchy. How do I get just the root of the hierarchy? So for example, I have a collection named "Models" and I import a model asset which has a transform hierarchy:
In code I then want to go through my models and transform them say. But I obviously only want to transform the root objects (i.e. "Building"). If I ask for the objects in the "Models" collection I get all of the objects (building, Exterior, walls...).
Is there some way to ask for just the direct objects or to process all of the objects to get the root(s)? I can write the code to do this but it seems like there should be an easier way?