Loop through scene graph in RealityKit

Could I loop through the scene graph of a .usdz file in RealityKit? Just like SCNNode, we can access all child nodes in the scene graph.

Thans

Accepted Reply

When you import a USDZ with RealityKit it seems that the ModelEntity has no child Entities, so doesn't look like you can see the individual parts that way.


If you want to change one or multiple materials though this is possible by taking `<ModelEntity>.model?.materials`.



But all the mesh data seems to be combined inside a single mesh (part of the ModelComponent).

Replies

When you import a USDZ with RealityKit it seems that the ModelEntity has no child Entities, so doesn't look like you can see the individual parts that way.


If you want to change one or multiple materials though this is possible by taking `<ModelEntity>.model?.materials`.



But all the mesh data seems to be combined inside a single mesh (part of the ModelComponent).

Hey Max

Thank you for your replay. So I guess I cannot set transform and position for the individual joint in a 3D model? Apple default robot.usdz for example, set the transform only for the left_upLeg_joint.