Post

Replies

Boosts

Views

Activity

Reply to Warning code: 00000006 will affect background survival
You need to throttle 3D rendering as soon as the scene phase changes. Try killing whatever timer is supporting your rendering loop as soon as the app is no longer active, don't try to manipulate the scene in any way, it needs to happen immediately. I've seen this specific error occur in SceneKit on iOS and it causes shader issues, like models rendered entirely in green until the app is killed and restarted. It is caused by the app sending frames to the GPU while inactive or suspended, it shouldn't affect other background tasks like scanning for Bluetooth beacons. It's Apple's way of aggressively protecting the device battery life.
Aug ’25
Reply to BlendShapes don’t animate while playing animation in RealityKit
I've only been able to get simultaneous animations playing on a rigged model by using hard-coded FromToByAnimations and ensuring that the animations do not have any collisions in terms of which joints they are animating. Then when using playAnimation, passing a blend layer offset to the each animation group. But I have not tried this approach of using Blend shapes from Blender
Topic: Graphics & Games SubTopic: RealityKit Tags:
Jul ’25
Reply to Struggles with attaching a ModelEntity to the skeleton joints of another ModelEntity
Is there any precedent for a GeometricPin not getting properly attached to a rig despite being passed the correct joint name? I've tried setting a pin on the hand joint of several Blender-exported rigs using both the full joint name and just the suffix, and no matter which joint name I use, the position for the pin is coming back nil, which the docs suggest is a failure to map to an existing joint name. When trying to set the position of an equipped object directly, the chain matrix multiplication logic from pinEntity provides transforms with odd positioning with respect to the hand joint. I noticed that while this was off, it was only a transformation away from having the orientation match. I had to rotate the anchored entity over the z-axis to get the object onto the proper side of the model, and then its orientation matches the orientation of the hand but even after rolling the transform of the anchor entity for the object, it is aways some incalculable offset away from where it should be: It's close-ish but it's not quite right and I'm not able to retrieve any offset information from failed GeometricPin:
Topic: Graphics & Games SubTopic: RealityKit Tags:
Jul ’25
Reply to Struggles with attaching a ModelEntity to the skeleton joints of another ModelEntity
Thanks for your response! The other day, I tried to chain together the translations from each joint transform and noticed using multiple different rigs that the translation sum for a peripheral joint like the wrist still comes out to some number very close to zero. I will try using matrix multiplication as it is demonstrated in pinEntity and see if I have more success with that. I can write something up for Feedback Assistant as well, as it would be cool to have work out of the box. I have another question about jointTransforms and AnimationResources if you're up for it: I am trying to play two separate pose-based joint animations at once and was hoping to restrict each animation to only the joint names and transforms I want animated (in the constructor of FromToByAnimation and then using its fromValue and toValue properties). Long story short, I notice that when excluding upper body joints from an animation, they still seem to experience scale and rotation animations for the first keyframe or so. It almost seems like the first joint in the chain that is excluded from the animation experiences a zeroed out Transform and before returning to its base resting transform. Here is a code sample for retrieving joint transforms from a map of joints and orientations: func transformsForPose(_ pose: Pose, exclude excludedBones: [Bone]) -> [(String, Transform)] { var updatedTransforms = restPose // initial model.jointTransforms let excludedBoneNames = excludedBones.map({ $0.rawValue }) for bone in pose.keys { guard let boneIndex = getBoneIndex(bone), let boneRotation = pose[bone] else { continue } updatedTransforms[boneIndex].rotation = boneRotation } return updatedTransforms.indices.compactMap({ let name = model.jointNames[$0] let transform = updatedTransforms[$0] let suffix = name.getSuffix(separator: "/").lowercased() if excludedBoneNames.contains(suffix) { return nil } else { return (name, transform) } }) } And then creating an animation from those joint names and transforms: static func animationForPoseIndex(_ index: Int, poses: [Pose], exclude: [Bone], durations: [TimeInterval], for characterEntity: CharacterEntity, named name: String) -> AnimationResource? { let pose = poses[index] let fromTransforms = characterEntity.transformsForPose(index > 0 ? poses[index-1] : poses[poses.count-1], exclude: exclude) let duration = durations[index] var animation = FromToByAnimation(jointNames: fromTransforms.map({ $0.0 })) animation.name = name + index.description animation.fromValue = JointTransforms(fromTransforms.map( {$0.1} )) let toTransforms = characterEntity.transformsForPose(pose, exclude: exclude) animation.toValue = JointTransforms(toTransforms.map( {$0.1} )) animation.bindTarget = .jointTransforms animation.blendLayer = 100 animation.duration = duration animation.isRotationAnimated = true animation.fillMode = .forwards return try? AnimationResource.generate(with: animation) } When I don't exclude any joints (i.e include every joint name and transform) and use a rest pose to fill in the remaining transforms for the joints that won't be active, I don't see the issue. I am wondering if I am missing something obvious or if there is a bug here?
Topic: Graphics & Games SubTopic: RealityKit Tags:
Jul ’25