Reputation: 21
I have succesfully loaded an USDZ file and are able to transformations on the whole model. Now I want to highlight a part of the object when you tap on it.
Issue is that I can not get the USDZ file to get separated parts under root.
Goal is to perform transformations like color change on separate parts by tapping or looking at them.
This should be the outcome:
But this is my debug outcome:
I tried changing the hierarchie to set all objects under root with Reality Composer Pro like this:
Also tried with Blender.
The code for debugging the hierarchy in code:
func printEntityHierarchy(_ entity: Entity, level: Int = 0) {
let prefix = String(repeating: " ", count: level)
print("\(prefix)🔹 \(entity.name) - \(type(of: entity))")
for child in entity.children {
printEntityHierarchy(child, level: level + 1)
}
}
// Call this function after loading the model
if let modelEntity = modelEntity {
printEntityHierarchy(modelEntity)
}
Can anyone help me to better understand how I can check the real hierarchy of the USDZ file? Or a way to generate an USDZ with the correct hierachy?
Upvotes: 1
Views: 43