Re: [clutter] clutter_actor_animate: assertion `duration > 0' failed
Thank neil for the pointer I tried the suggested function but I get exactly the same Assertion. Clutter-CRITICAL **: clutter_actor_animatev: assertion `duration > 0' failed (we except for the v) here is my code: public Animation Animate(ClutterAnimationMode mode, uint duration, string property1, float val1, string property2, float val2, string property3, float val3) { var values = new float[]{val1,val2,val3}; IntPtr pointer = GCHandle.Alloc(values,GCHandleType.Pinned).AddrOfPinnedObject(); Console.WriteLine(duration); IntPtr nativeAnimation = clutter_actor_animatev(_clutterActorNative, (ulong)mode, duration, 3, new string[]{property1, property2, property3}, pointer); return new Animation( nativeAnimation ); } [DllImport ("libclutter-glx-1.0.so.0")] private static extern IntPtr clutter_actor_animatev(IntPtr actor,ulong mode, uint duration,int n_properties, string[] properties, IntPtr values); On Wed, Jun 23, 2010 at 10:11 PM, Neil Roberts wrote: > > Daniel Hughes wrote: > >> I am playing around with clutter and am using if from c#. >> >> Because the c# bindings are in a poor state I am having to create my >> own bindings as I go. >> >> clutter_actor_animate is a hard call to interop because it has a >> variable number of arguments (something not supported in c#). > > Are you literally binding the clutter_actor_animate function? That's not > recommended. I think the idea is that bindings would bind the > clutter_actor_animatev function instead which does not take a variable > number of arguments. clutter_actor_animate is intended as the C > 'binding' for clutter_actor_animatev which just provides a convenient > interface. Other languages are expected to bind clutter_actor_animatev > separately using whatever method makes sense. For example, the Ruby > bindings take a hash as the last argument which it then converts into > two separate arrays (one for the property names and one for the values) > to pass to clutter_actor_animatev. Calling it from Ruby then looks like > this: > > some_actor.animate(Clutter::LINEAR, 1000, > "x" => 100, > "y" => 100) > > Maybe if C# supports array literals or hash literals it could do > something similar. > >> However I have something which I think will work, (based on the >> example code I have seen). >> >> But when I try to use it I am getting the following assertion. >> >> [clutter] clutter_actor_animate: assertion `duration > 0' failed >> >> I have debugged it and checked that I am passing a value for duration >> which is valid ( greater then zero). >> >> So before I spend a lot of time trying to debug the interop I wanted >> to check that their was not a known issue with the >> clutter_actor_animate function. > > I don't think there are any known problems with the duration. You may > want to try posting a code snippet of your binding and someone with > knowledge of C# may be able to help. > > Regards, > - Neil > -- To unsubscribe send a mail to clutter+unsubscr...@o-hand.com
Re: [clutter] clutter_actor_animate: assertion `duration > 0' failed
Daniel Hughes wrote: > I am playing around with clutter and am using if from c#. > > Because the c# bindings are in a poor state I am having to create my > own bindings as I go. > > clutter_actor_animate is a hard call to interop because it has a > variable number of arguments (something not supported in c#). Are you literally binding the clutter_actor_animate function? That's not recommended. I think the idea is that bindings would bind the clutter_actor_animatev function instead which does not take a variable number of arguments. clutter_actor_animate is intended as the C 'binding' for clutter_actor_animatev which just provides a convenient interface. Other languages are expected to bind clutter_actor_animatev separately using whatever method makes sense. For example, the Ruby bindings take a hash as the last argument which it then converts into two separate arrays (one for the property names and one for the values) to pass to clutter_actor_animatev. Calling it from Ruby then looks like this: some_actor.animate(Clutter::LINEAR, 1000, "x" => 100, "y" => 100) Maybe if C# supports array literals or hash literals it could do something similar. > However I have something which I think will work, (based on the > example code I have seen). > > But when I try to use it I am getting the following assertion. > > [clutter] clutter_actor_animate: assertion `duration > 0' failed > > I have debugged it and checked that I am passing a value for duration > which is valid ( greater then zero). > > So before I spend a lot of time trying to debug the interop I wanted > to check that their was not a known issue with the > clutter_actor_animate function. I don't think there are any known problems with the duration. You may want to try posting a code snippet of your binding and someone with knowledge of C# may be able to help. Regards, - Neil -- To unsubscribe send a mail to clutter+unsubscr...@o-hand.com
[clutter] clutter_actor_animate: assertion `duration > 0' failed
I am playing around with clutter and am using if from c#. Because the c# bindings are in a poor state I am having to create my own bindings as I go. clutter_actor_animate is a hard call to interop because it has a variable number of arguments (something not supported in c#). However I have something which I think will work, (based on the example code I have seen). But when I try to use it I am getting the following assertion. [clutter] clutter_actor_animate: assertion `duration > 0' failed I have debugged it and checked that I am passing a value for duration which is valid ( greater then zero). This is now the only thing from the tuxradar tutorial which I havn't got going. http://www.tuxradar.com/content/clutter-beginners-tutorial So before I spend a lot of time trying to debug the interop I wanted to check that their was not a known issue with the clutter_actor_animate function. I'm using the version of clutter in ubuntu 10.04. -- To unsubscribe send a mail to clutter+unsubscr...@o-hand.com
RE: [clutter] clutter_actor_animate ()
Emmanuele, Many thanks for the reply and I now understand. I have tried what you suggest and it works perfectly. Ian -Original Message- From: Emmanuele Bassi [mailto:eba...@linux.intel.com] Sent: Thursday, August 13, 2009 9:31 AM To: clutter@o-hand.com Subject: RE: [clutter] clutter_actor_animate () On Thu, 2009-08-13 at 12:04 -0400, Ian Walberg wrote: > What I was trying to ask was can you set the animation to be looping by > passing it as one of the parameters to the clutter_actor_animate > function? no, since: - there is no boolean argument for looping - the list of variable arguments are for (name, value) pairs - the (name, value) pairs refer to the actor's properties, not to the animation properties (which is all said in the documentation, by the way). if you want to loop, get the Animation returned by the animate() method and set it looping with clutter_animation_set_loop(): animation = clutter_actor_animate (actor, ...); clutter_animation_set_loop (animation, TRUE); obviously, a looping animation will not fire the ::completed signal, so you'll need to set it as not looping when done. ciao, Emmanuele. -- Emmanuele Bassi, Senior Engineer| emmanuele.ba...@intel.com Intel Open Source Technology Center | http://oss.intel.com -- To unsubscribe send a mail to clutter+unsubscr...@o-hand.com -- To unsubscribe send a mail to clutter+unsubscr...@o-hand.com
RE: [clutter] clutter_actor_animate ()
On Thu, 2009-08-13 at 12:04 -0400, Ian Walberg wrote: > What I was trying to ask was can you set the animation to be looping by > passing it as one of the parameters to the clutter_actor_animate > function? no, since: - there is no boolean argument for looping - the list of variable arguments are for (name, value) pairs - the (name, value) pairs refer to the actor's properties, not to the animation properties (which is all said in the documentation, by the way). if you want to loop, get the Animation returned by the animate() method and set it looping with clutter_animation_set_loop(): animation = clutter_actor_animate (actor, ...); clutter_animation_set_loop (animation, TRUE); obviously, a looping animation will not fire the ::completed signal, so you'll need to set it as not looping when done. ciao, Emmanuele. -- Emmanuele Bassi, Senior Engineer| emmanuele.ba...@intel.com Intel Open Source Technology Center | http://oss.intel.com -- To unsubscribe send a mail to clutter+unsubscr...@o-hand.com
RE: [clutter] clutter_actor_animate ()
Emmanuele, What I was trying to ask was can you set the animation to be looping by passing it as one of the parameters to the clutter_actor_animate function? Thanks Ian -Original Message- From: Emmanuele Bassi [mailto:eba...@linux.intel.com] Sent: Thursday, August 13, 2009 8:55 AM To: clutter@o-hand.com Subject: RE: [clutter] clutter_actor_animate () On Thu, 2009-08-13 at 11:51 -0400, Ian Walberg wrote: > I am happy to pass 'sensible stuff' and I am just working out what can > be passed. > > How do I make the animation loop? by reading the documentation: http://www.clutter-project.org/docs/clutter/stable/clutter-Implicit-Anim ations.html ciao, Emmanuele. (and, by the way: quote properly) -- Emmanuele Bassi, Senior Engineer| emmanuele.ba...@intel.com Intel Open Source Technology Center | http://oss.intel.com -- To unsubscribe send a mail to clutter+unsubscr...@o-hand.com -- To unsubscribe send a mail to clutter+unsubscr...@o-hand.com
RE: [clutter] clutter_actor_animate ()
On Thu, 2009-08-13 at 11:51 -0400, Ian Walberg wrote: > I am happy to pass 'sensible stuff' and I am just working out what can > be passed. > > How do I make the animation loop? by reading the documentation: http://www.clutter-project.org/docs/clutter/stable/clutter-Implicit-Animations.html ciao, Emmanuele. (and, by the way: quote properly) -- Emmanuele Bassi, Senior Engineer| emmanuele.ba...@intel.com Intel Open Source Technology Center | http://oss.intel.com -- To unsubscribe send a mail to clutter+unsubscr...@o-hand.com
RE: [clutter] clutter_actor_animate ()
I am happy to pass 'sensible stuff' and I am just working out what can be passed. How do I make the animation loop? Thanks Ian -Original Message- From: Emmanuele Bassi [mailto:eba...@linux.intel.com] Sent: Thursday, August 13, 2009 8:30 AM To: clutter@o-hand.com Subject: Re: [clutter] clutter_actor_animate () On Thu, 2009-08-13 at 10:25 -0500, Uday Verma wrote: > If you use variables to pass these values to clutter_actor_animate and > if any of these variables is of incorrect type, the function just > segfaults. > > gint angle = 360; // instead of a double > clutter_actor_animate (myactor, CLUTTER_EASE_IN, 100, > "rotation-angle-z", x, NULL); // will segfault yes, it's expected; and there's nothing Clutter can do, since it's we're using variable length arguments to read the property (name, value) pairs. it's the burden of C developers to pass sensible stuff to the functions or expect a segmentation fault. if you want type safety for variable list of arguments I can suggest you use Python or Perl: the Clutter 1.0 bindings are quite good. ciao, Emmanuele. > -- > > On Thu, Aug 13, 2009 at 3:50 AM, Samuel Degrande wrote: > > On 13/08/2009 01:41, Ian Walberg wrote: > >> > >> Neil, > >> > >> Thanks that helps. > >> > >> However I am getting this following error :- > >> > >> 'Cannot bind property '' objects of type 'ClutterTexture' do not have > >> this property' > >> > >> When I try the rotation example :- > >> > >> clutter_actor_animate (actor, CLUTTER_EASE_IN, 100, > >> "rotation-angle-z", 360, > >> "fixed::rotation-center-z",¢er, > >> NULL); > >> Thanks > >> > >> Ian > >> > > > > I was caught by such an error several times !! > > > > You have to take care to provide the right type of values. > > So you need, for example > > > > clutter_actor_animate (actor, CLUTTER_EASE_IN, 100, > > "rotation-angle-z", 360.0, > > "fixed::rotation-center-z",¢er, > > NULL); > > > > This is rather very annoying, because we are so used to implicit > > type conversion... > > > > -- > > Samuel Degrande LIFL - UMR8022 CNRS - INRIA Futurs - Bat M3 > > Phone: (33)3.28.77.85.30 USTL - Universite de Lille 1 > > (33)3.62.53.15.70 59655 VILLENEUVE D'ASCQ CEDEX - FRANCE > > [CA certs: http://igc.services.cnrs.fr/CNRS-Standard/recherche.html ] > > -- > > To unsubscribe send a mail to clutter+unsubscr...@o-hand.com > > > > > > > > -- > Uday > http://soundc.de/ -- Emmanuele Bassi, Senior Engineer| emmanuele.ba...@intel.com Intel Open Source Technology Center | http://oss.intel.com -- To unsubscribe send a mail to clutter+unsubscr...@o-hand.com -- To unsubscribe send a mail to clutter+unsubscr...@o-hand.com
Re: [clutter] clutter_actor_animate ()
On Thu, 2009-08-13 at 10:25 -0500, Uday Verma wrote: > If you use variables to pass these values to clutter_actor_animate and > if any of these variables is of incorrect type, the function just > segfaults. > > gint angle = 360; // instead of a double > clutter_actor_animate (myactor, CLUTTER_EASE_IN, 100, > "rotation-angle-z", x, NULL); // will segfault yes, it's expected; and there's nothing Clutter can do, since it's we're using variable length arguments to read the property (name, value) pairs. it's the burden of C developers to pass sensible stuff to the functions or expect a segmentation fault. if you want type safety for variable list of arguments I can suggest you use Python or Perl: the Clutter 1.0 bindings are quite good. ciao, Emmanuele. > -- > > On Thu, Aug 13, 2009 at 3:50 AM, Samuel Degrande > wrote: > > On 13/08/2009 01:41, Ian Walberg wrote: > >> > >> Neil, > >> > >> Thanks that helps. > >> > >> However I am getting this following error :- > >> > >> 'Cannot bind property '' objects of type 'ClutterTexture' do not have > >> this property' > >> > >> When I try the rotation example :- > >> > >> clutter_actor_animate (actor, CLUTTER_EASE_IN, 100, > >> "rotation-angle-z", 360, > >> "fixed::rotation-center-z",¢er, > >> NULL); > >> Thanks > >> > >> Ian > >> > > > > I was caught by such an error several times !! > > > > You have to take care to provide the right type of values. > > So you need, for example > > > > clutter_actor_animate (actor, CLUTTER_EASE_IN, 100, > > "rotation-angle-z", 360.0, > > "fixed::rotation-center-z",¢er, > > NULL); > > > > This is rather very annoying, because we are so used to implicit > > type conversion... > > > > -- > > Samuel Degrande LIFL - UMR8022 CNRS - INRIA Futurs - Bat M3 > > Phone: (33)3.28.77.85.30 USTL - Universite de Lille 1 > > (33)3.62.53.15.70 59655 VILLENEUVE D'ASCQ CEDEX - FRANCE > > [CA certs: http://igc.services.cnrs.fr/CNRS-Standard/recherche.html ] > > -- > > To unsubscribe send a mail to clutter+unsubscr...@o-hand.com > > > > > > > > -- > Uday > http://soundc.de/ -- Emmanuele Bassi, Senior Engineer| emmanuele.ba...@intel.com Intel Open Source Technology Center | http://oss.intel.com -- To unsubscribe send a mail to clutter+unsubscr...@o-hand.com
Re: [clutter] clutter_actor_animate ()
If you use variables to pass these values to clutter_actor_animate and if any of these variables is of incorrect type, the function just segfaults. gint angle = 360; // instead of a double clutter_actor_animate (myactor, CLUTTER_EASE_IN, 100, "rotation-angle-z", x, NULL); // will segfault -- On Thu, Aug 13, 2009 at 3:50 AM, Samuel Degrande wrote: > On 13/08/2009 01:41, Ian Walberg wrote: >> >> Neil, >> >> Thanks that helps. >> >> However I am getting this following error :- >> >> 'Cannot bind property '' objects of type 'ClutterTexture' do not have >> this property' >> >> When I try the rotation example :- >> >> clutter_actor_animate (actor, CLUTTER_EASE_IN, 100, >> "rotation-angle-z", 360, >> "fixed::rotation-center-z",¢er, >> NULL); >> Thanks >> >> Ian >> > > I was caught by such an error several times !! > > You have to take care to provide the right type of values. > So you need, for example > > clutter_actor_animate (actor, CLUTTER_EASE_IN, 100, > "rotation-angle-z", 360.0, > "fixed::rotation-center-z",¢er, > NULL); > > This is rather very annoying, because we are so used to implicit > type conversion... > > -- > Samuel Degrande LIFL - UMR8022 CNRS - INRIA Futurs - Bat M3 > Phone: (33)3.28.77.85.30 USTL - Universite de Lille 1 > (33)3.62.53.15.70 59655 VILLENEUVE D'ASCQ CEDEX - FRANCE > [CA certs: http://igc.services.cnrs.fr/CNRS-Standard/recherche.html ] > -- > To unsubscribe send a mail to clutter+unsubscr...@o-hand.com > > -- Uday http://soundc.de/ -- To unsubscribe send a mail to clutter+unsubscr...@o-hand.com
RE: [clutter] clutter_actor_animate ()
Sanuel, That works thanks, I am not sure if I can update the documents but if some one can do that it would help future questions. Thanks Ian -Original Message- From: Samuel Degrande [mailto:samuel.degra...@lifl.fr] Sent: Thursday, August 13, 2009 1:51 AM To: Ian Walberg Cc: Neil Roberts; clutter@o-hand.com Subject: Re: [clutter] clutter_actor_animate () On 13/08/2009 01:41, Ian Walberg wrote: > Neil, > > Thanks that helps. > > However I am getting this following error :- > > 'Cannot bind property '' objects of type 'ClutterTexture' do not have > this property' > > When I try the rotation example :- > > clutter_actor_animate (actor, CLUTTER_EASE_IN, 100, > "rotation-angle-z", 360, > "fixed::rotation-center-z",¢er, > NULL); > Thanks > > Ian > I was caught by such an error several times !! You have to take care to provide the right type of values. So you need, for example clutter_actor_animate (actor, CLUTTER_EASE_IN, 100, "rotation-angle-z", 360.0, "fixed::rotation-center-z",¢er, NULL); This is rather very annoying, because we are so used to implicit type conversion... -- Samuel Degrande LIFL - UMR8022 CNRS - INRIA Futurs - Bat M3 Phone: (33)3.28.77.85.30 USTL - Universite de Lille 1 (33)3.62.53.15.70 59655 VILLENEUVE D'ASCQ CEDEX - FRANCE [CA certs: http://igc.services.cnrs.fr/CNRS-Standard/recherche.html ] -- To unsubscribe send a mail to clutter+unsubscr...@o-hand.com
Re: [clutter] clutter_actor_animate ()
On 13/08/2009 01:41, Ian Walberg wrote: Neil, Thanks that helps. However I am getting this following error :- 'Cannot bind property '' objects of type 'ClutterTexture' do not have this property' When I try the rotation example :- clutter_actor_animate (actor, CLUTTER_EASE_IN, 100, "rotation-angle-z", 360, "fixed::rotation-center-z",¢er, NULL); Thanks Ian I was caught by such an error several times !! You have to take care to provide the right type of values. So you need, for example clutter_actor_animate (actor, CLUTTER_EASE_IN, 100, "rotation-angle-z", 360.0, "fixed::rotation-center-z",¢er, NULL); This is rather very annoying, because we are so used to implicit type conversion... -- Samuel Degrande LIFL - UMR8022 CNRS - INRIA Futurs - Bat M3 Phone: (33)3.28.77.85.30 USTL - Universite de Lille 1 (33)3.62.53.15.70 59655 VILLENEUVE D'ASCQ CEDEX - FRANCE [CA certs: http://igc.services.cnrs.fr/CNRS-Standard/recherche.html ] -- To unsubscribe send a mail to clutter+unsubscr...@o-hand.com
RE: [clutter] clutter_actor_animate ()
Neil, Thanks that helps. However I am getting this following error :- 'Cannot bind property '' objects of type 'ClutterTexture' do not have this property' When I try the rotation example :- clutter_actor_animate (actor, CLUTTER_EASE_IN, 100, "rotation-angle-z", 360, "fixed::rotation-center-z", ¢er, NULL); Thanks Ian -Original Message- From: Neil Roberts [mailto:n...@linux.intel.com] Sent: Wednesday, August 12, 2009 3:23 PM To: Ian Walberg Cc: clutter@o-hand.com Subject: Re: [clutter] clutter_actor_animate () On Wed, 2009-08-12 at 17:32 -0400, Ian Walberg wrote: > Can anyone point me to the list of 'properties' (and their values) that can be used with clutter_actor_animate (). clutter_actor_animate can animate any gobject property of an actor so to get the list you can look at the 'Properties' section in the docs for any ClutterActor subclass. All actors support at least the properties listed here: http://is.gd/2e6Nh But other actor subclasses may add more properties, such as the 'border-color' property of ClutterRectangle. These can be used with clutter_actor_animate as well. - Neil -- To unsubscribe send a mail to clutter+unsubscr...@o-hand.com
Re: [clutter] clutter_actor_animate ()
On Wed, 2009-08-12 at 17:32 -0400, Ian Walberg wrote: > Can anyone point me to the list of 'properties' (and their values) that > can be used with clutter_actor_animate (). clutter_actor_animate can animate any gobject property of an actor so to get the list you can look at the 'Properties' section in the docs for any ClutterActor subclass. All actors support at least the properties listed here: http://is.gd/2e6Nh But other actor subclasses may add more properties, such as the 'border-color' property of ClutterRectangle. These can be used with clutter_actor_animate as well. - Neil -- To unsubscribe send a mail to clutter+unsubscr...@o-hand.com
[clutter] clutter_actor_animate ()
Can anyone point me to the list of 'properties' (and their values) that can be used with clutter_actor_animate (). This shows some examples but I cannot find all the properties. file:///C:/temp/BeagleBoard/Clutter/1.0.0/doc/reference/clutter/html/clu tter-Implicit-Animations.html#clutter-actor-animate Thanks Ian -- To unsubscribe send a mail to clutter+unsubscr...@o-hand.com