Post

Replies

Boosts

Views

Activity

How to make an animation stop at the last frame after playing with xcode+RCP
This is my animation playback method, there are two issues. 1.How to make the animation stop until the last frame after playing once when isLoop=false? When I specify the name of an animClipName animation clip, I cannot play the corresponding animation name. How do I set it up? The animation structure is shown in the figure. PlayAnim(animEntityName: "Book",animClipName: "Open",isLoop: false) private func PlayAnim(animEntityName: String,animClipName: String? = nil,isLoop:Bool = true,transitionDuration: Double = 0.5){ guard let XR = XR else { return } guard let entity = XR.findEntity(named: animEntityName) else { return } let availableAnims = entity.availableAnimations let targetAnimResource: AnimationResource? if let clipName = animClipName { targetAnimResource = availableAnims.first(where: { $0.name == clipName }) } else { targetAnimResource = availableAnims.first } guard let animClip = targetAnimResource else { return } let anim = animClip.repeat(count: isLoop ? 0 : 1) entity.playAnimation(anim,transitionDuration: transitionDuration) }
1
0
311
2w
Work with Reality Composer Pro content in Xcode
May I ask if there is a complete source code project for this instructional video that needs to be learned. Work with Reality Composer Pro content in Xcode
Replies
5
Boosts
0
Views
541
Activity
23h
How to make RCP start playing Timeline from scratch when receiving OnNotification.
How to make RCP start playing Timeline from scratch when receiving OnNotification. At present, I have only played the timeline once after receiving the OnNotification, and cannot replay it again after receiving the OnNotification again.
Replies
1
Boosts
0
Views
142
Activity
2w
How to make an animation stop at the last frame after playing with xcode+RCP
This is my animation playback method, there are two issues. 1.How to make the animation stop until the last frame after playing once when isLoop=false? When I specify the name of an animClipName animation clip, I cannot play the corresponding animation name. How do I set it up? The animation structure is shown in the figure. PlayAnim(animEntityName: "Book",animClipName: "Open",isLoop: false) private func PlayAnim(animEntityName: String,animClipName: String? = nil,isLoop:Bool = true,transitionDuration: Double = 0.5){ guard let XR = XR else { return } guard let entity = XR.findEntity(named: animEntityName) else { return } let availableAnims = entity.availableAnimations let targetAnimResource: AnimationResource? if let clipName = animClipName { targetAnimResource = availableAnims.first(where: { $0.name == clipName }) } else { targetAnimResource = availableAnims.first } guard let animClip = targetAnimResource else { return } let anim = animClip.repeat(count: isLoop ? 0 : 1) entity.playAnimation(anim,transitionDuration: transitionDuration) }
Replies
1
Boosts
0
Views
311
Activity
2w
How to trigger hover events in UI in RealityView 3D space
attachments: { Attachment(id: "UI_Book_01") { Button { print("Tap...") } label: { Text("Tap me") .padding() .background(.ultraThinMaterial) }.hoverEffect { effect, isActive, _ in if isActive { print("hover...") //Unable to trigger } return effect } } }
Replies
2
Boosts
0
Views
1.6k
Activity
4w