Hello everyone.

The Mixed Reality Forums here are no longer being used or maintained.

There are a few other places we would like to direct you to for support, both from Microsoft and from the community.

The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.

For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.

If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.

And always feel free to hit us up on Twitter @MxdRealityDev.
Options

UWP Storyboards do not work in 3D-hologram-view?

In my application, I want to animate some values using UWP Windows.UI.Xaml.Media.Animation.Storyboard animations (these would be "non-UI" values - properties of a class derived directly from DependencyObject). I made a simple Universal test app (Unity-based, XAML build type) in which I animate a System.Double property of a DependencyObject (not a UIElement). When the app is run on the “local machine” (my Windows 10 development machine) the property value animates. When the same app is run in the HoloLens emulator or actual HoloLens device, the property value does not animate. There are no compile errors and no exceptions occur when running the application on HoloLens; the Storyboard just doesn’t start when calling Storyboard.Begin(). Calling Storyboard.GetCurrentState() returns that the Storyboard is “Active”, but periodically calling Storyboard.GetCurrentTime() reveals that the Storyboard’s clock is not advancing (it always returns zero on HoloLens – on Desktop it returns the elapsed time). However the Storyboard animations do work for HoloLens if I force the app to run in a 2D window rather than a 3D holographic view.

I can only suppose that UWP Storyboards somehow require that a 2D View is active in order to run – or that some other required initialization step is missing when a HoloLens app runs in the holographic view… or that it is a bug in the HoloLens and/or Unity Beta tools. Other “non-UIElement” UWP functionality (like DependencyObject, DependencyProperty, CoreDispatcher, and DispatcherTimer) works properly on HoloLens, so I’m not sure at this point why Storyboards wouldn’t work since they are also not specific to UIElements.

Anyone know if this is a "limitation" or a "bug"? I'm leaning towards the notion that this is bug. I mean, the Storyboard API is not 2D-specific, so it seems to me it should work in 3D also. The MSDN documentation for UWP Storyboard animations even starts by saying: "Storyboarded animations are not just animations in the visual sense. A storyboarded animation is a way to change the value of a dependency property as a function of time." To me this implies that Storyboards should not require a 2D view in order to animate non-UI DependencyProperties - which makes me think it is a bug. Is there a formal bug reporting procedure for HoloLens?

Tagged:

Answers

  • Options

    I looked into this and found the XAML Storyboard animations do not operate when running in volumetric 3D view, but they do operate when running in a "flat" 2D view.

    I think this is because the entire XAML framework is mostly inactive when running in a volumetric 3D view, and the Storyboard component is simply not updated. If your app just runs in a basic 2D view without Unity (e.g. like Settings), then all the XAML components will work just as in any other UWP app.

    Is there a specific reason you need to use XAML Storyboards and DependancyObjects with your Unity project?

  • Options

    The reason for wanting Storyboards to work in the volumetric 3D view, is that we have an existing "animation engine" developed atop UWP Storyboards that we want to use on HoloLens. We have used it primarily for 2D animations in the past, but it also works for 3D animations - specifically, we have a working version of it applied to Unity3D in a UWP app, running on a Windows 10 PC. It is only HoloLens' 3D volumetric view where it does not work because the Storyboards' internal clocks apparently don't work in the volumetric view.
    I understand that much of the 2D UWP API would be "inactive" in the volumetric view, but it seems to me that the non-2D aspects of the API should remain active. And the Storyboard API is not inherently 2D (uses DependencyObject rather than UIElement), which is why I think it ought to work (at least in principle).

    As an aside: it would be great if the 2D UWP API was active in the 3D volumetric view, allowing you to map 2D XAML UI widgets onto 3D planes/surfaces (which is something that WPF can do). But that is another topic...

Sign In or Register to comment.