Manipulate objects in Reality Composer Pro

The documentation at https://developer.apple.com/documentation/visionos/designing-realitykit-content-with-reality-composer-pro states:

Reality Composer Pro treats your imported assets as read-only.

This is a huge obstacle for me, as I need to do multiple adjustments to the scene.

I somehow managed to actually import one of my assets into the scene and can manipulate it directly, but now I can't figure out how I did this.

As I have to prepare further assets and would like to do this directly in Reality Composer Pro, I'm looking for a way to actually load them into the scene.

Any idea how this can be done?

I managed to do this again, but I have still no idea why it worked now.

Same for materials.

Isn't there simple a command to resolve external references?

Hi @Kabe

EDIT: I realize you may mean you'd like to edit a USDZ file directly with Reality Composer Pro. This is indeed not possible (do you have access to a DCC like Blender or Maya that is designed for this sort of task?), although you can create a new USD using References to entities in your imported asset.

(If that's not what you meant, please keep reading!)

When you load an Entity from an asset at runtime, you are free to add, remove, and modify any Components you like.

When the documentation says "Reality Composer Pro treats your imported assets as read-only" this means that Reality Composer Pro will not modify the assets that you import into your project. It is not referring to your ability to manipulate and change entities at runtime once you have loaded them from those assets.

Here's an example of what I mean by modifying an Entity at runtime: I'll change the first material on an asset called "Robot.usdz" in realityKitContentBundle so that it is completely red:

var modelEntity = try await ModelEntity.init(named: "Robot", in: realityKitContentBundle)
var model = modelEntity.components[ModelComponent.self]!
var materials = model.materials
materials[0] = SimpleMaterial(color: .red, isMetallic: false)
model.materials = materials;
modelEntity.components.set(model)

Sorry for the confusion, let me know if this helps!

Actually, I'm using Blender for creating these entities, but there are problems with the output, i.e. Blender exports an environment light (even if lights are disabled in export), which creates issues when compiling the package).

Also, I need to assign new materials in Composer Pro, as I need universal inputs to alter textures at runtime in my scenario.

I understand references, but the funny thing is that somehow (still haven't figured out a sequence of steps how to do it) I manage to convert these references to original data within the scene. These data are kept even when removing the originally referenced *.usdz.

For me that makes stuff so much easier than dealing with the exports from Blender.

Ah, understood! For that issue you mentioned with Blender, does it go away if you disable "Convert World Material" under the "Materials" section of Blender's export to USD dialog? If you do try this out, I'd love to hear if it works for you or not.

Are the materials you are trying to assign ones created in Shader Graph inside Reality Composer Pro? These materials will exist inside the scene, and should be available for you to assign to entities after you load the scene.

... but let me get back to you on how to assign those materials, I need to take some time to think through it before I share any example code. I just wanted to mention that Blender setting since I've seen that come up before.

Manipulate objects in Reality Composer Pro
 
 
Q