Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > Avalon

Vista - Cannot animate a transform in a data template

 
 
Old 01-10-2006   #1 (permalink)
viliescu


 
 

Cannot animate a transform in a data template

Hi,

I want to make a listbox with 3D items so I have created a DataTemplate
which contains the 3D object. In the DataTemplate.Triggers I start an
animation to rotate the 3D object on mouse over.
But when I do mouse over an error is raised:
"The value of property 'Transform' in the path '(0).[0].(1).[1].(2).(3).(4)'
points an immutable instance of
'System.Windows.Media.Media3D.RotateTransform3D' which may not be
manipulated."

I have created a sample project:
http://www.valil.com/winfx/test.zip

Thank you,
Valentin Iliescu


My System SpecsSystem Spec
Old 01-10-2006   #2 (permalink)
Drew Marsh


 
 

Re: Cannot animate a transform in a data template

viliescu wrote:

> I want to make a listbox with 3D items so I have created a
> DataTemplate
> which contains the 3D object. In the DataTemplate.Triggers I start an
> animation to rotate the 3D object on mouse over.
> But when I do mouse over an error is raised:
> "The value of property 'Transform' in the path
> '(0).[0].(1).[1].(2).(3).(4)'
> points an immutable instance of
> 'System.Windows.Media.Media3D.RotateTransform3D' which may not be
> manipulated."


I don't have an immediate answer to your question, but you do know you can
make your life a lot simpler by putting an x:Name directly on the element
you want to address with the Storyboard instead of having to use such a long
and fragile property path as that, right? In your case perhaps the best approach
is probably to name the ModelVisual3D, use that as the target of the Storyboard
and build the path from there.

Just wanted to make sure you're not killing your fingers (and racking your
brain) when working with paths.

HTH,
Drew


My System SpecsSystem Spec
Old 01-10-2006   #3 (permalink)
viliescu


 
 

Re: Cannot animate a transform in a data template

Tried that before but it's not working.

For example, if I put in the sample project
<DoubleAnimation
Storyboard.TargetName="visualModel"

Storyboard.TargetProperty="(ModelVisual3D.Transform).(RotateTransform3D.Rotation).(AxisAngleRotation3D.Angle)"

I get this error: "Multi-step property paths may not be specified on an
object of type 'System.Windows.Media.Media3D.ModelVisual3D'"

Thanks anyway for caring for my fingers and for my mental health

Valentin

"Drew Marsh" wrote:

> viliescu wrote:
>
> > I want to make a listbox with 3D items so I have created a
> > DataTemplate
> > which contains the 3D object. In the DataTemplate.Triggers I start an
> > animation to rotate the 3D object on mouse over.
> > But when I do mouse over an error is raised:
> > "The value of property 'Transform' in the path
> > '(0).[0].(1).[1].(2).(3).(4)'
> > points an immutable instance of
> > 'System.Windows.Media.Media3D.RotateTransform3D' which may not be
> > manipulated."

>
> I don't have an immediate answer to your question, but you do know you can
> make your life a lot simpler by putting an x:Name directly on the element
> you want to address with the Storyboard instead of having to use such a long
> and fragile property path as that, right? In your case perhaps the best approach
> is probably to name the ModelVisual3D, use that as the target of the Storyboard
> and build the path from there.
>
> Just wanted to make sure you're not killing your fingers (and racking your
> brain) when working with paths.
>
> HTH,
> Drew
>
>
>

My System SpecsSystem Spec
Old 01-10-2006   #4 (permalink)
David Sklar


 
 

"Multi-step property paths..." error

Like my friend Viliescu (whose chess game I am currently porting to the Nov
CTP), I also am encountering the "multi-step property paths may not be
specified..." error.

In my case, the object whose property I am trying to animate is of type
GeometryModel3D.

And the property path (specified in C# not in XAML) is:
(0).(1).(2)
where the operands are:
GeometryModel3D.MaterialProperty,
DiffuseMaterial.BrushProperty,
Brush.OpacityProperty

What is the correct property path for animating the opacity of a
GeometryModel3D bearing a diffuse material?

- David Sklar




My System SpecsSystem Spec
Old 01-10-2006   #5 (permalink)
viliescu


 
 

RE: "Multi-step property paths..." error

Yes, I had the same problem in Sep CTP. It seems that you cannot use
multi-step property paths for non-FrameworkElements so what I had to do is
to go up in the tree and use a FrameworkElement as the target for the
animation.

Valentin

"David Sklar" wrote:

> Like my friend Viliescu (whose chess game I am currently porting to the Nov
> CTP), I also am encountering the "multi-step property paths may not be
> specified..." error.
>
> In my case, the object whose property I am trying to animate is of type
> GeometryModel3D.
>
> And the property path (specified in C# not in XAML) is:
> (0).(1).(2)
> where the operands are:
> GeometryModel3D.MaterialProperty,
> DiffuseMaterial.BrushProperty,
> Brush.OpacityProperty
>
> What is the correct property path for animating the opacity of a
> GeometryModel3D bearing a diffuse material?
>
> - David Sklar
>
>
>
>
>

My System SpecsSystem Spec
Old 01-10-2006   #6 (permalink)
Bob Brown[MSFT]


 
 

Re: Cannot animate a transform in a data template

The "immutable instance" error you're seeing is actually a bug with 3D and
templates used together. Unfortunately, I know of no workarounds in the Nov
CTP.

--
Bob Brown [MSFT]
This posting is provided "AS IS" with no warranties, and confers no rights.


"viliescu" <viliescu@discussions.microsoft.com> wrote in message
news:A2CA8943-82C6-439C-B582-AE8FA8888175@microsoft.com...
> Hi,
>
> I want to make a listbox with 3D items so I have created a DataTemplate
> which contains the 3D object. In the DataTemplate.Triggers I start an
> animation to rotate the 3D object on mouse over.
> But when I do mouse over an error is raised:
> "The value of property 'Transform' in the path
> '(0).[0].(1).[1].(2).(3).(4)'
> points an immutable instance of
> 'System.Windows.Media.Media3D.RotateTransform3D' which may not be
> manipulated."
>
> I have created a sample project:
> http://www.valil.com/winfx/test.zip
>
> Thank you,
> Valentin Iliescu
>



My System SpecsSystem Spec
 

Thread Tools


Similar Threads
Thread Forum
Merge 2 XML Documents using XSLT Transform .NET General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46