How can I stop the output from Snap SVG Animator from looping? - jquery-animate

I've used Animate CC with the Snap SVG Animator plugin to generate an animated SVG, but can't seem to find anything in the docs to stop the animation from automatically playing and automatically looping.
I would have thought these would have been options that would be passed into the SVGAnim(json, width, height, fps) object.
Currently I can somewhat solve the issue of autoplaying by calling stop() on the root movie clip located on the instance of SVGAnim straight after initialising the object.
For example: _anim.mc.stop()
Letting it start in the first place and then having to stop it doesn't feel like best practice.

Related

Godot 4: rotating child around parent

I've set up a SpringArm3d with a meshinstance as its child. The spring is set to 30m. Now, I want to rotate the child around the SpringArm3d by mouse motion. The easiest way to achieve this would be to rotate the parent, right? So I tried:
if event is InputEventMouseMotion:
$SpringArm3d.rotate_y(-event.relative.x * mouse_sensitivity)
While this does rotate the SpringArm, the child gets moved to the SpringArms position and is rotated there. I don't understand why the initial offset is not being kept? Do I need to use some other method for rotation?
I also tried the same setup, but with a Spatial3d instead of the SpringArm3d, and the child meshinstance just moved away in the viewport to create an offset. Same thing.
Any suggestions would be very welcome!
[I've asked the same question over at the Godot forums as well: https://godotforums.org/d/31388-rotating-child-around-parent-moves-child-to-parent]
EDIT: It seems this was caused by having to scripts using the same rotate_y(-event.relative.x * mouse_sensitivity) method, so eliminating it in one script seems to have solved the issue. (although I don't really see why that would be a problem in the first place)

No keyframes are visible but the object still moves

I'm using Blender 2.8 and I just have 2 objects: hand and gun and I want to create animations for them. So, for instance, I want to create a simple firing animation. What I do:
1. I create animation for gun
2. I create animation for hand
But if I switch somehow incorrectly I "lose" the first animation I've created. I tried creating fake users and stuff. I just don't get why I select the armature for which I've just created the animation, it plays, but there are no keyframes.
Here's the vid, here's the file.
Ask me questions if you have any.
The movement may be cached in Blender, you may need to reset the movement cache.
Alternatively, you should look at both the Track Controller and Dopesheet(action editor) - the animation may be stored in both.
The movement could be related to parenting ( to an object that is moving )
The movement could also be caused by physics simulation of a rigid body.
Hopefully with the help of the above, you find the problem.
I had the same problem. In the Animation mode (horizontal tabs across the top of the window), click on the object to animate.
The keyframes will appear.
If the object is not selected, the keyframes disappear.
Just leaving this here so that nobody spends 30 minutes trying to work this out, like i just did.

Blender border render internals

I would like to know how Blender's border render works internally. How can Blender compute lights if it has not information about the lights in the tiles he won't render? I have not found any reference (source code excluded) on how this feature of blender works. Can somebody explain it (or give me some reference)?
The render border setting only alters what part of the image is rendered, it does not alter what data is sent to the render engine to generate the image.
You can test this by placing an object with a reflective surface in front of the camera and another object behind the camera, the object behind the camera will show in the reflection. The border setting doesn't change the reflection in the object, it only changes what part of the image is rendered.
Rendering an image starts at the pixel that will be visible in the final image and sends a "ray" into the scene to determine what colour the specific pixel will be. Each ray will bounce around in the scene from object to object to light source based on render settings to calculate the final result. While the render border will reduce the pixels used as the starting point for each ray, it does not reduce the objects or lights in the scene that each ray may come into contact with. Each ray going through the scene will see every visible object and light in the scene that can influence the final result for each pixel.
This conference video explains ray types and might give you a better grasp of how a ray goes through a scene to get the final image.

How can I get shadows in blender game engine?

I'm making a very simple game in blender and for some reason shadows don't work. I tried every kind of light source, including objects with emisions. 'Cast shadow' and 'recieve shadow' check boxes are checked for ol the objects. I tryed all teh methods to dysplay objects. Is there an easy way to get shadows in the game?
Away to create shadows is like so:
-Switch Muiltitexture to GLSL
Now, you must understand that only certain lights cast shadows. I believe that the only two are the Sun, and Spotlight, however spotlight only casts partial.
While in GLSL Mode, you must change the Solid Mode to Textured Mode for lighting to work. Then, select the sun(angled at your prefered angle) and scroll down in the objects tab. Look for Shadows, and make sure the box is checked. Then play it. The Shadows should automatically appear in the Scene view as well because GLSL has support for realtime shadows.
WAY NUMBER 2:
Another way is to Bake a scene or object. This means that you place lighting in render mode, and capture all the lighting and textures(with lighting) and make a texture. This works really well, but doesn't have realtime shadows. Look it up for more imformation.
Hope this Helped!
In the Viewport press N and in the rendering options switch from multitexture to GLSL and then switch to Texture mode,
You don't have to tweak the settings. you can try this by creating a new blend file.
Hope this helps

Animating a marker pin on Bing Maps for Metro apps

I have a Bing Map control and I want to animate the location of a pin drawn on the map.
Ideally I'd want to write code like this:
// Image myPin = some Image on the map layer;
var sb = new Storyboard();
var duration = DurationHelper.FromTimeSpan(System.TimeSpan.FromMilliseconds(1000));
sb.Duration = duration;
LocationAnimation ani = new LocationAnimation();
ani.To = new Location(33.3, 11.1); // destination lat, lng
ani.Duration = duration;
sb.Children.Add(ani);
Storyboard.SetTarget(ani, myPin);
Storyboard.SetTargetProperty(ani, "MapLayer.Position");
Resources.Add("moveMyPin", sb);
sb.Begin();
Of course there is no LocationAnimation class in the framework. There are a couple similar: PointAnimation works with the Point type, while DoubleAnimation works with individual double values.
I assumed I have to implement my Timeline-derived class but the documentation I found so far is not helpful in this regard and I don't know where to start.
How to animate a property for which there is no *Animation class ready? Am I missing something?
Update: I think I can do something like
// let aniX and aniY be two DoubleAnimation objects
StoryBoard.SetTargetProperty(aniX, "(MapLayer.Position).Latitude")
StoryBoard.SetTargetProperty(aniY, "(MapLayer.Position).Longitude")
but now I have another problem as I don't see how to animate the attached property and always get an exception like "Cannot resolve TargetProperty (MapLayer.Position).Latitude on specified object."
So I guess the question now becomes: how to specify a property path for an attached property?
Further update: I may be on a wrong lead with the "SetTargetProperty" thing as that would make a dependent animation (see link in comments). Could there be a better way to animate a marker pin to a coordinate destination?
Update 3: as Jared pointed out I could try to animate RenderTransform, or use a transition to achieve my result. I had already gone this way and it doesn't seem to be my solution. This is what I found out:
Using RepositionThemeAnimation, it seems I have to give the new pixel position of the pin. This is problematic for a couple reasons: first, I know the lat/lng destination of the pin, but would have to work out the projection (as far as I can tell there is no public interface to work with projection). Secondly the projection itself can change as the map zooms/pans. The pixel destination at the time of the end of the animation could not be the same as the initial pixel destination. In my scenario it's a major problem as it's very likely the map is moving while the animation is occurring.
Using RepositionThemeTransition all the weird pixel/projection problems went away. It's the only way so far I was able to see the animation I expected. I just set the transition and set the new lat/lng position of the tag (via MapLayer.SetPosition). It has two major problems though. I can't set the duration (nor the easing functions) for the animation. And most importantly I can see no way to execute code when the pin gets to its final position.
Attached properties can be animated, but you must enclose their names in parenthesis. See an example here:
http://www.charlespetzold.com/blog/2007/09/080231.html
However, I believe this only works for setting the whole value (Location) and potentially not sub properties (Latitude and Longitude).
I'm wondering if you can provide more information about what you're trying to do. Is this a temporary animation? i.e. are you wanting the pin to animate in on entrance or departure? If so you can just do an animation on the RenderTransform X and Y instead. You won't actually be changing the location of the pin but you can use the RenderTransform to temporarily change where it's being drawn.
Even better, you might be able to get away with the free animations now built into the framework. You don't even need a storyboard to use them, you just set them right on the element like this:
<Button Content="Transitioning Button">
<Button.Transitions>
<TransitionCollection>
<EntranceThemeTransition/>
</TransitionCollection>
</Button.Transitions>
</Button>
For more examples of the animation library and even video previews for many of the animations, see:
http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh452703.aspx
Okay, man, your problem isn't related to Bing Maps. It's related to dependency properties that can't be animated UNLESS you specify that they can. Here's how: http://blog.jerrynixon.com/2012/06/windows-8-animated-pie-slice.html
That link in the other answer with Charles' site is not up to date.