Post

Replies

Boosts

Views

Activity

Reply to Blending walk and run animations in RealityKit
Hi Michael, Thank you for the tips. Today I tried your last recommendation but it didn't work. Let me list my process. I have got both walk and run animations as one animation in .fbx file. Then imported it to Blender. First I exported T-Pose of the entity and then exported animation in .usdz format. Started using T-Pose rabbit entity in RCP Then import that usdz animation in RCP's AnimationLibraryComponent . On the code side (as you suggested) I did clipping the timeline into two small animations as "walkClip" and "runClip". And pass those clips in order to construct a BlendTreeeAnimation. if let rabbit = await RabbitBuilder.loadRabbit() { rabbit.components.set(RabbitWalkerComponent(elapsed: 0, speed: rabbitSpeed)) RabbitWalker.entity = rabbit content.add(rabbit) let anims = rabbit.availableAnimations // ── Slice a single combined clip into walk and run ───────────── // Walk = keyframes 0–18, Run = keyframes 19–29. // trimStart / trimEnd are in seconds, so we need the frame rate. // Read the duration printed above: if 30 frames total → fps = 30/duration. let fps: Double = 31.0 // ← adjust if the print shows a different rate guard let source = anims.first else { return } let walkClip = AnimationView(source: source.definition, name: "walkClip", repeatMode: .repeat, fillMode: [], trimStart: 0.0, trimEnd: 18.0 / fps, trimDuration: nil, offset: 0, delay: 0, speed: 1.0) let runClip = AnimationView(source: source.definition, name: "runClip", repeatMode: .repeat, fillMode: [], trimStart: 19.0 / fps, trimEnd: 29.0 / fps, trimDuration: nil, offset: 0, delay: 0, speed: 1.0) guard let walkRes = try? AnimationResource.generate(with: walkClip), let runRes = try? AnimationResource.generate(with: runClip) else { print("⚠️ Failed to generate walk/run clips") return } RabbitWalker.walkAnim = walkRes RabbitWalker.runAnim = runRes } Blender; RCP But I still get the same error. Probably I will open a ticket with a sample project. Regards, Hakan
Topic: Graphics & Games SubTopic: RealityKit Tags:
2w
Reply to Blending walk and run animations in RealityKit
Hi Michael, Thank you for quick reply. Yes both animation share the same skeleton. Here are the steps that I followed; I have added T-Pose style rabbit entity to my scene I created an Animation Library and added RabbitWalk and RabbitRun animations respectively. I loaded those animations like entity.availableAnimations[0] & entity.availableAnimations[1] but I have the same error. I then created a new Timeline for the Rabbit entity Create a separate 'Walk' animation and make it recursive. Create a separate 'Run' animation and make it recursive as well. Then I loaded those last 2 animation to my blend animation function but I have the same problem again. Here is the RCP project. Am I missing something? Regards.
Topic: Graphics & Games SubTopic: RealityKit Tags:
2w
Reply to RealityKit fill the background environment
Thank you Albert so much for your explanation. It helped me a lot. I did as you suggested and the performance increased significantly. Right now I have 3 active chunks with total of around ~468,000 triangles (bushes, leaves, trunk, road and terrain). Do you think that is this a lot for a scene? Because when I take screenshot of the app, the application's frame rate drops by half. What might be the reason for that? My second question is that do you know any tool that converts EntityModels (loaded from Reality Composer Pro) into LowLevelMesh? Because the trees or the bushes that I created using LowLevelMesh doesn't look professional. (ex: I would like to see leaves a little bit with more detail, or I would like to make branches more edgy)
Topic: Graphics & Games SubTopic: RealityKit Tags:
Mar ’26
Reply to Blending walk and run animations in RealityKit
Hi Michael, Thank you for the tips. Today I tried your last recommendation but it didn't work. Let me list my process. I have got both walk and run animations as one animation in .fbx file. Then imported it to Blender. First I exported T-Pose of the entity and then exported animation in .usdz format. Started using T-Pose rabbit entity in RCP Then import that usdz animation in RCP's AnimationLibraryComponent . On the code side (as you suggested) I did clipping the timeline into two small animations as "walkClip" and "runClip". And pass those clips in order to construct a BlendTreeeAnimation. if let rabbit = await RabbitBuilder.loadRabbit() { rabbit.components.set(RabbitWalkerComponent(elapsed: 0, speed: rabbitSpeed)) RabbitWalker.entity = rabbit content.add(rabbit) let anims = rabbit.availableAnimations // ── Slice a single combined clip into walk and run ───────────── // Walk = keyframes 0–18, Run = keyframes 19–29. // trimStart / trimEnd are in seconds, so we need the frame rate. // Read the duration printed above: if 30 frames total → fps = 30/duration. let fps: Double = 31.0 // ← adjust if the print shows a different rate guard let source = anims.first else { return } let walkClip = AnimationView(source: source.definition, name: "walkClip", repeatMode: .repeat, fillMode: [], trimStart: 0.0, trimEnd: 18.0 / fps, trimDuration: nil, offset: 0, delay: 0, speed: 1.0) let runClip = AnimationView(source: source.definition, name: "runClip", repeatMode: .repeat, fillMode: [], trimStart: 19.0 / fps, trimEnd: 29.0 / fps, trimDuration: nil, offset: 0, delay: 0, speed: 1.0) guard let walkRes = try? AnimationResource.generate(with: walkClip), let runRes = try? AnimationResource.generate(with: runClip) else { print("⚠️ Failed to generate walk/run clips") return } RabbitWalker.walkAnim = walkRes RabbitWalker.runAnim = runRes } Blender; RCP But I still get the same error. Probably I will open a ticket with a sample project. Regards, Hakan
Topic: Graphics & Games SubTopic: RealityKit Tags:
Replies
Boosts
Views
Activity
2w
Reply to Blending walk and run animations in RealityKit
Hi Michael, Thank you for quick reply. Yes both animation share the same skeleton. Here are the steps that I followed; I have added T-Pose style rabbit entity to my scene I created an Animation Library and added RabbitWalk and RabbitRun animations respectively. I loaded those animations like entity.availableAnimations[0] & entity.availableAnimations[1] but I have the same error. I then created a new Timeline for the Rabbit entity Create a separate 'Walk' animation and make it recursive. Create a separate 'Run' animation and make it recursive as well. Then I loaded those last 2 animation to my blend animation function but I have the same problem again. Here is the RCP project. Am I missing something? Regards.
Topic: Graphics & Games SubTopic: RealityKit Tags:
Replies
Boosts
Views
Activity
2w
Reply to RealityKit fill the background environment
Thank you Albert so much for your explanation. It helped me a lot. I did as you suggested and the performance increased significantly. Right now I have 3 active chunks with total of around ~468,000 triangles (bushes, leaves, trunk, road and terrain). Do you think that is this a lot for a scene? Because when I take screenshot of the app, the application's frame rate drops by half. What might be the reason for that? My second question is that do you know any tool that converts EntityModels (loaded from Reality Composer Pro) into LowLevelMesh? Because the trees or the bushes that I created using LowLevelMesh doesn't look professional. (ex: I would like to see leaves a little bit with more detail, or I would like to make branches more edgy)
Topic: Graphics & Games SubTopic: RealityKit Tags:
Replies
Boosts
Views
Activity
Mar ’26