SceneKit collada animation - animation

I created scene and added few nodes from different *.dae files. These nodes has animations. I want to play animations for nodes independently. For example, node1 will run animation from 10th frame to 20th frame, but node2 will run animation from 30th frame to 50th frame. If i use SCNSceneSourceAnimationImportPolicyPlayUsingSceneTimeBase key and i set sceneTime value then the animations of both nodes is playing synchronously.
If i use SCNSceneSourceAnimationImportPolicyPlay key i must first stop all animation for all nodes and for all them child nodes. Then i must start all animation for all nodes and for all them child nodes with required timeOffset value. Then animation is playing, but it does not look correct
Help me please!

Related

Unity2D - Player relative animation positioning

I'm making a 2D platformer and I've come across a really annoying problem where if I move my player character GameObject to another location on the scene, my player becomes stuck and the game spazzes out, jumping from the players original location and the position I moved it to.
My player character is made up of many parts, each a separate GameObject. I know the problem is definitely in my animation, because if I disable the animator component, the problem goes away, just I don't have my animations anymore. I believe the problem may be in the player character's Idle Animation and it's position property. There is no script attached where his starting location is hard coded.
How can I make the child Gameobjects move relative to the parent Player GameObject? I cannot move the player in the scene from its original location without the game glitching up.
Here are some screenshots
[Player and it's parts in Hierarchy]http://i67.tinypic.com/bdlc1j.png
[Idle Animation]http://i64.tinypic.com/2gtp99x.png
[Player's original Location, he works if starting here] http://i66.tinypic.com/261jb6c.png
[Player is Moved, game bugs out] http://i67.tinypic.com/292a2c3.png
Try to disable "Apply Root Motion" flag in the Animator component.
The problem should be related to the fact that the animation changes the position values
My guess is that you have animated the different parts by moving then around in the editor and recording that. This meas that the animation is keeping track of the original position at which you did the animation. Try deleting those parts from the animation.
I couldn't fix the spazzy-jittering problem that occurs when I move the player character to another position on the scene, but I did find a way around it. The problem definitely lied within the Animator component and the gameObject's Rigidbody2d.
Instead of moving the player to another position, I instead made a 'Spawn Point' which the player starts from when first playing the scene, and that was able to be moved freely around. Pretty much:
void start(){
transform.position = spawnPoint.transform.position;
}

How can I get an Edge animation to stop looping with scroll effect?

I am trying to get an adobe edge animation to animate as I scroll and then stop animating when it reaches the end of the animation, but continue scrolling. I am using adobe muse and placing my .oam file and then adding the edge animate scroll effect to advance 1 second every 20px. The problem is that it is looping the animation when I want it to stop. Any ideas?

How can I smoothly transition between two separate animations in SceneKit?

I am working with a 3d model that has one CAAnimationGroup per animation, with each group containing SCNMorpher weight animations with 2 CABasicAnimations per frame (to transition from weights of 1.0 to 0.0 and 0.0 to 1.0 for each frame and the next using interpolation).
My animations are running smoothly, but the transition from one group to the next is rough and rigid, like from walking to running.
I'm pretty new to 3D model animation, and need some guidance on a SceneKit approach to building smooth transitions from ANY of the animations to the next.
I'd like to be able to stop the current running animation immediately no matter how far it is along and immediately transition to the next. I'd like to transition to an offset in the target animation that ensures the target animation maintains it's original length so that the animation audio sync is not affected.
I apologize in advance for lack of sufficient information as I am not certain what information is required to answer the question. If you ask, I will provide whatever information is required.
How can I smoothly transition from one animation to another, without waiting for the current running animation to finish and without changing the running duration of the target?
Does -removeAnimationForKey:fadeOutDuration: help?
From the documentation:
For example, the geometry loaded from a scene file for a game character may have associated animations for player actions such as walking and jumping. When the player lands from a jump, you remove the jump animation so the character continues walking. If you use the removeAnimationForKey: method to remove the jump animation, SceneKit abruptly switches from the current frame of the jump animation to the current frame of the walk animation. If you use the removeAnimationForKey:fadeOutDuration: method instead, SceneKit plays both animations at once during that duration and interpolates vertex positions from one animation to the other, creating a smooth transition.
Instance method removeAnimation(forKey:fadeOutDuration:) is deprecated since macOS_10.13/iOS_11.
func removeAnimation(forKey key: String,
fadeOutDuration duration: CGFloat)
Use new instance method removeAnimation(forKey:blendOutDuration:) instead.
func removeAnimation(forKey key: String,
blendOutDuration duration: CGFloat)

SceneKit SCNTransformConstraint

I am trying to apply some position constraints to a very simple scene. What I would like to do is have an initial node, then use a constraint to position a second node relative to the first. Then position a third node relative to the second etc. I realise I can nest the nodes but that is not what I ultimately want. Moving the first node would move all 3. What I have noticed having applied a constraint to the the second node is that the position is still 0,0,0 even though the constraint has positioned my node correctly. This has a knock on effect to the third node as the position of the second node is 0,0,0 therefore the third node is positioned relative to the first... I hope this makes sense? :-s
I have also noticed this effects the getBoundingBoxMin of the entire scene, as I need to establish the dimensions of the entire scene.
Is what I am trying to achieve even possible with constraints?
Thanks
Constraints are applied at render time, so it won't change your model (i.e it won't modify the positions of your nodes in your model tree).
That said you can retrieve the presentation positions of your nodes like this:
node.presentationNode.position

Blending animations in DirectX - is this technically possible?

I have an animated mesh in the .x format I've loaded with D3DXLoadMeshHierarchyFromX and have an animation controller for it. The mesh has two animations, one for walking and one for throwing where the walk animation.
Is it at all possible to blend the two animations in such a way that both animations can run together with the walk taking priority for frames below the hip while throwing animation takes priority for frames above it? If it is will the effect look convincing therefore worth pursuing? Do game developers typically blend animations in such a way to get all the different animations they wish or do they simply create multiple versions of the same animation, i.e. walking while throwing, standing while throwing, walking without throwing?
You can set High and low priority animation tracks with ID3DXAnimationController::SetTrackPriority. You can then blend between them using ID3DXAnimationController::SetPriorityBlend.

Resources