lehoang03an
Topic Author
Posts: 4
Joined: 19 Jan 2022, 08:13

DoubleAnimation on RotateTransform.Angle not working on Unreal

14 Jun 2022, 13:30

Hello,
In this xaml, I try to rotate an image when control is loaded
<ControlTemplate x:Key="PlayerInfoPanel" TargetType="{x:Type ContentControl}">
            <ControlTemplate.Resources>
                <Storyboard x:Key="EndlessRotate">
                    <DoubleAnimation
                        Storyboard.TargetProperty="(RenderTransform).(RotateTransform.Angle)" Storyboard.TargetName="Loading"
                        To="360" Duration="0:0:1.5" RepeatBehavior="Forever"/>
                </Storyboard>
            </ControlTemplate.Resources>
            <Grid>
                <Image x:Name="Loading" Visibility="Visible" 
                       Source="Dummy_Loading.png" Width="40" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,14,0" RenderTransformOrigin="0.5,0.5" >
                    <Image.RenderTransform>
                        <RotateTransform/>
                    </Image.RenderTransform>
                </Image></Grid>
            <ControlTemplate.Triggers>
                <EventTrigger RoutedEvent="Loaded">
                    <BeginStoryboard Storyboard="{StaticResource EndlessRotate}" x:Name="AnimationBeginStoryboard"/>
                </EventTrigger>
            </ControlTemplate.Triggers>
It works in Blend, but when I import it to Unreal, it shows this error:
Unable to convert '(RenderTransform).(RotateTransform.Angle)' to a valid value for property DoubleAnimation.TargetProperty.
LogNoesis: Warning: Target property not set in timeline
Can you tell me what is wrong here?
 
User avatar
sfernandez
Site Admin
Posts: 3363
Joined: 22 Dec 2011, 19:20

Re: DoubleAnimation on RotateTransform.Angle not working on Unreal

14 Jun 2022, 15:08

When using parenthesis syntax to reference a property you have to specify the owner type and the property name in Noesis:
<DoubleAnimation
  Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)"
  Storyboard.TargetName="Loading"
  To="360" Duration="0:0:1.5" RepeatBehavior="Forever"/>
The parenthesis syntax is required for attached properties, but the rest can be referenced by just the name, so the following will also work:
Storyboard.TargetProperty="RenderTransform.Angle"
 
lehoang03an
Topic Author
Posts: 4
Joined: 19 Jan 2022, 08:13

Re: DoubleAnimation on RotateTransform.Angle not working on Unreal

15 Jun 2022, 06:02

Thanks, it works. Is there any advantage or usecase using parenthesis syntax?
 
User avatar
sfernandez
Site Admin
Posts: 3363
Joined: 22 Dec 2011, 19:20

Re: DoubleAnimation on RotateTransform.Angle not working on Unreal

15 Jun 2022, 10:39

It works in Blend, but when I import it to Unreal, it shows this error
I have added ticket #2361 to our bugtracker because using "(RenderTransform)" to reference a property in WPF it is supported and we need to fix it.
Is there any advantage or usecase using parenthesis syntax?
No, both syntaxes are equivalent. As I said the only specific scenario where using parenthesis is strictly required is for attached properties, like in
"(Canvas.Left)".

Who is online

Users browsing this forum: No registered users and 4 guests