Jump to content
  • 0

llSetKeyframedMotion() giving error: "Error, failed to play animation. Does your linkset exceed the complexity limit for keyframing?"


Bubblesort Triskaidekaphobia
 Share

You are about to reply to a thread that has been inactive for 329 days.

Please take a moment to consider if this thread is worth bumping.

Question

I have a simple box prim, with one script in it.  Inside the script, I have a function that should use keyframed animation to move the box up along the z axis 1m, out along the x axis 0.5m, and rotate it 90 degrees about the z axis.  That's it.  A single key frame, for now, just to figure out how it works.  I keep getting this error over and over, though:

Error, failed to play animation. Does your linkset exceed the complexity limit for keyframing?

I have tried linking the simple box prim to another box prim to see if it needs to be in a linkset of more than one prim to work, and that didn't change the outcome.

Here is a link to the lsl wiki page on llSetKeyframedMotion().

Here's a copy of my experiments to try to make this work.  Don't let the length of the code fool you, it's all a series of commented out touch_start() events, becasue they all produce the same error, except the first touch_start() event.  The first touch_start() works, and I put it in there to show what I'm trying to do with llSetKeyframedMotion(), except in the first one I do it with llSetPos() and llSetRot().  llSetPos() and llSetRot() won't do exactly what I want, but they are close enough that you can see what I"m trying to do.  I really need keyframing features for what I'm trying to do, and I don't understand why it isn't working.  Most of these touch_start experiments are from me trying to grab snippets from the LSL library and use them, but none of them seem to work.

It probably doesn't matter, but I'm doing all this in a premium sandbox.

Also, early on in the process, when I was just throwing random math at the problem, and trying to do this in a more complex script, I got a few errors about trying to rotate to NaN, and trying to move the object too fast, but I can't replicate those errors with simple code, so I'm not that worried about it.  I'll fight those bugs once I figure out what the hell this linkset complexity garbage is.  The wiki doesn't say anything about linkset complexity, at all.  I'll have to update it when I solve this problem.
 

default
{
    state_entry(){
        llSay(0, "Hello, Avatar!");
    }
    //This works, almost exactly as I want keyframing to work.  The first time I click it, it does what I want keyframing to do (then it repeats the motion on subsequent clicks, which is not what I want keyframing to do).  I can't control the damping time it takes to move the prim like this, so keyframing would be more useful to me.
    touch_start(integer total_number){
        llOwnerSay("I am moving 1m up the z axis and 0.5m up the x axis, and rotating 90 degrees about the z axis.");
        llSetPos(llGetPos() + <0.5,0.0,1.0>);
        rotation z90 = llGetRot()*llEuler2Rot(<0.0,0.0,90.0>*DEG_TO_RAD); //the rotation that rotates about the z axis by 90 degrees
        llSetRot(z90);
    }

    /*Error in question:  Error, failed to play animation. Does your linkset exceed the complexity limit for keyframing?
    
    The following blocks of touch_start code produced this same error, whether the script is in a single, plain, non-physical cube prim or a linked set of two cube prims, with the script in the root prim.  The prim is not selected when it gives these errors:
    
    
    touch_start(integer total_number)
    {
        llOwnerSay("I am moving 1m up the z axis and 0.5m up the x axis, and rotating 90 degrees about the z axis.");
        list keyframes = [<0.5,0.0,1.0>,llEuler2Rot(<0.0, 0.0, 90.0> * DEG_TO_RAD), 5.0];
        list options = []; //go with default options
        llSetKeyframedMotion(keyframes, options);
    }
    touch_start(integer total_number)
    {
        llOwnerSay("I am moving 1m up the z axis and 0.5m up the x axis, and rotating 90 degrees about the z axis.");
        list keyframes = [<0.5,0.0,1.0>,llEuler2Rot(<0.0, 0.0, 90.0> * DEG_TO_RAD), 5.0];
        //lets try making the default options explicit
        list options = [KFM_MODE, KFM_FORWARD, KFM_DATA, KFM_ROTATION|KFM_TRANSLATION];
        llSetKeyframedMotion(keyframes, options);
    }
    touch_start(integer total_number)
    {
        llOwnerSay("I am moving 1m up the z axis and 0.5m up the x axis, and rotating 90 degrees about the z axis.");
        list keyframes = [<0.5,0.0,1.0>,llEuler2Rot(<0.0, 0.0, 90.0> * DEG_TO_RAD), 5.0];
        //lets try making the default options explicit
        list options = [KFM_MODE, KFM_FORWARD, KFM_DATA, KFM_ROTATION|KFM_TRANSLATION];
        //other scripts using keyframed motion seem to set the primitive position to it's current position, so lets try that:
        llSetPrimitiveParams([PRIM_POSITION, llGetPos(), PRIM_ROTATION, llGetRot()]);
        llSetKeyframedMotion(keyframes, options);
    }
    touch_start(integer total_number)
    {
        llOwnerSay("I am moving 1m up the z axis and 0.5m up the x axis, and rotating 90 degrees about the z axis.");
        list keyframes = [<0.5,0.0,1.0>,llEuler2Rot(<0.0, 0.0, 90.0> * DEG_TO_RAD), 5.0];
        //lets try making the default options explicit
        list options = [KFM_MODE, KFM_FORWARD, KFM_DATA, KFM_ROTATION|KFM_TRANSLATION];
        //here's something else other scripts do:
        llSetKeyframedMotion( [], []);
        llSleep(0.2);
        //other scripts using keyframed motion seem to set the primitive position to it's current position, so lets try that:
        llSetPrimitiveParams([PRIM_POSITION, llGetPos(), PRIM_ROTATION, llGetRot()]);
        llSetKeyframedMotion(keyframes, options);
    }
    touch_start(integer total_number)
    {
        llOwnerSay("I am moving 1m up the z axis and 0.5m up the x axis, and rotating 90 degrees about the z axis.");
        //forget the rotation and just move.
        list keyframes = [<0.5,0.0,1.0>,ZERO_ROTATION, 5.0];
        list options = []; //go with default options
        llSetKeyframedMotion(keyframes, options);
    }
    touch_start(integer total_number)
    {
        llOwnerSay("I am moving 1m up the z axis and 0.5m up the x axis, and rotating 90 degrees about the z axis.");
        //forget the rotation and just move.
        //change time to an integer multiple of 45, because the wiki reccommends this:
        list keyframes = [<0.5,0.0,1.0>,ZERO_ROTATION, 90.0/45.0];
        list options = []; //go with default options
        llSetKeyframedMotion(keyframes, options);
    }
    touch_start(integer total_number)
    {
        llOwnerSay("I am moving 1m up the z axis and 0.5m up the x axis, and rotating 90 degrees about the z axis.");
        list keyframes = [llGetPos() - <0.5,0.0,1.0>, llGetRot()*llEuler2Rot(<0.0,0.0,90.0>*DEG_TO_RAD), 5.0];
        list options = []; //go with default options
        llSetKeyframedMotion(keyframes, options);
    }
    */
}

 

Link to comment
Share on other sites

16 answers to this question

Recommended Posts

  • 1
2 hours ago, elleevelyn said:

But as you say the wiki should expand on this to say that the Prim Equivalency system in this context means set Features \ Physics Shape Type = Convex Hull

You can also force the prim equivalency system by using material textures, (shininess or normal-map) or have a mesh object in the linkset.

Edited by Quistess Alpha
Link to comment
Share on other sites

  • 0

I figured it out!  The wiki says nothing about convex hull, but if you try to use llSetKeyframedMotion() in a prim that is not set as a convex hull, then it will give you the error, "Error, failed to play animation. Does your linkset exceed the complexity limit for keyframing?"

It took me a while to notice that most scripts set convex hull with llSetPrimitiveParams() or llSetLinkPrimitiveParamsFast().  Once I noticed it, though, everything started working as expected.

I would update the wiki, but I am not sure I completely understand why this is.  I should probably update it anyway, and let somebody who knows more than me explain it later on if they want to.

  • Like 2
Link to comment
Share on other sites

  • 0
5 minutes ago, Bubblesort Triskaidekaphobia said:

I would update the wiki, but I am not sure I completely understand why this is.  I should probably update it anyway, and let somebody who knows more than me explain it later on if they want to.

agree the wiki should be edited.  The wiki does say: "This function requires the linkset to use the Prim Equivalency system." But as you say the wiki should expand on this to say that the Prim Equivalency system in this context means set Features \ Physics Shape Type = Convex Hull

  • Like 2
Link to comment
Share on other sites

  • 0
8 minutes ago, elleevelyn said:

agree the wiki should be edited.  The wiki does say: "This function requires the linkset to use the Prim Equivalency system." But as you say the wiki should expand on this to say that the Prim Equivalency system in this context means set Features \ Physics Shape Type = Convex Hull

What is the prim equivalency system?  I mean, doesn't everything use LI instead of prims now?  I don't understand how that has anything do do with scripting movement.  If your land doesn't have enough LI for the object, then obviously you can't run scripts in the object that you can't rez.

Link to comment
Share on other sites

  • 0
1 hour ago, Bubblesort Triskaidekaphobia said:

What is the prim equivalency system?  I mean, doesn't everything use LI instead of prims now?  I don't understand how that has anything do do with scripting movement.  If your land doesn't have enough LI for the object, then obviously you can't run scripts in the object that you can't rez.

by default (as you found out) when we rezz a box prim then its physic shape is set to PRIM and the prim's Land Impact is 1.  When we rez another box prim and link it to the first then the Land Impact is 2

when we set the linked object to CONVEX_HULL then we are using the Prim Equivalency system and the Land Impact of the 2 linked prims is now 1

Why Linden called it Prim Equivalency rather than Mesh Equivalency I dunno

 

 

Edited by elleevelyn
box
  • Like 1
Link to comment
Share on other sites

  • 0

I think I see why the wiki is written so badly.  Nobody took the time to write it well, because nobody can use it, because keyframed motion is broken garbage.  Whoever implemented this LSL 'feature' should be embarrassed of themselves, and whoever triages things on JIRA should be embarrassed that they can't fix it.

Even once you figure out the the stupid convex hull, or prim equivalency tricks... the thing breaks because it uses frames.  The wiki says to fix this by doing float division by 45.0, but that doesn't fix it.  Using the 40.0/45.0 or 45.0/45.0 gives me the error, "Delta times must be >0.1s," which makes no sense at all!  If the problem is frames, why didn't LL put that in the error message?  Maybe the wiki is being inscrutable again, and the problem isn't frames?  Maybe it takes quaternions for time or something stupid?  I have no idea.  Being required to use something like convex hull is as random as I can imagine, so nothing would surprise me at this point.

https://wiki.secondlife.com/wiki/LlSetKeyframedMotion

When I don't have problems with timing, the problem is drifting.  You want 30 degrees?  How about 32?  How bout 34.2167?  How about negative 236.41?  This type of drifting reminds me of the problems path finding had when I tested it shortly after it was released (path finding was totally broken then, too, but I haven't gone back to see if it's fixed yet).

This is not difficult.  This is simple math.  Math is what programmers do with computers.  So why can't it just move things how I tell it?  Isn't that the entire point of key framed motion?  If I wanted a brownian motion machine, this would be perfect, but I don't think anybody wanted that when they implemented this.

Link to comment
Share on other sites

  • 0
17 minutes ago, Bubblesort Triskaidekaphobia said:

Using the 40.0/45.0 or 45.0/45.0 gives me the error, "Delta times must be >0.1s," which makes no sense at all!

Works for me, and those numbers are well above any minimum required values. Your issue is somewhere else in your script.

The caveats also mention that the real minimum frametime should be 0.13333 (so 6 sim-frames) instead of "over 0.10000".

 

Also, about the reason why KFM works the way it does:

On 11/12/2011 at 11:22 PM, Falcon Linden said:

I have a hunch that the cause of the drift is related to the simulator's fixed time step and the fact that llSetKeyframedMotion is implemented in terms of frames and not real time. This decision was made in order to produce more deterministic results. Before giving up on this method of animation, can you try changing your delta times to be integer multiples of 1/45s? Let me know if this resolves the issue. If not, please file a jira.

Edited by Wulfie Reanimator
  • Thanks 1
Link to comment
Share on other sites

  • 0
21 minutes ago, Bubblesort Triskaidekaphobia said:

keyframed motion is broken garbage. 

No, it's not. Keyframed motion works quite well. My NPCs run on keyframed motion. Janet's trains at Lexicolo run on keyframed motion. Both work reliably. (Pathfinding motion, though. That's broken.) You're just moving a single standalone cube, right? Then this isn't a linkset complexity problem. That's just a bad error message. Or are you doing something more complicated? Try putting a keyframe motion script into a fresh cube. Keyframe motion is to some extent a prim property, and the prim may be in a messed up state.

  • Like 1
Link to comment
Share on other sites

  • 0
19 hours ago, Quistess Alpha said:

You can also force the prim equivalency system by using material textures, (shininess or normal-map) or have a mesh object in the linkset.

yes.... but is just that if the wiki said set the prims physics shape to convex hull then Bubblesort would not have needed to post

  • Like 1
Link to comment
Share on other sites

  • 0
4 hours ago, elleevelyn said:

yes.... but is just that if the wiki said set the prims physics shape to convex hull then Bubblesort would not have needed to post

This is kind of off-topic, but the 'point' of the wiki isn't necessarily to be directly helpful for certain situations, but to give an accurate and as-complete-as-is-reasonable description of the functionality. If it's going to suggest a method of circumventing some problem, it should mention all such methods.

Adding a blank shininess or normal texture might be more appropriate for some use-cases (like, if your key-framed thing needs to be a torus for some reason) And in-fact, in many cases, setting the physics shape of non-essential child prims to physics-type none would probably be more appropriate.

  • Like 1
Link to comment
Share on other sites

  • 0
On 6/6/2023 at 12:03 PM, Quistess Alpha said:

This is kind of off-topic, but the 'point' of the wiki isn't necessarily to be directly helpful for certain situations, but to give an accurate and as-complete-as-is-reasonable description of the functionality. If it's going to suggest a method of circumventing some problem, it should mention all such methods.

Adding a blank shininess or normal texture might be more appropriate for some use-cases (like, if your key-framed thing needs to be a torus for some reason) And in-fact, in many cases, setting the physics shape of non-essential child prims to physics-type none would probably be more appropriate.

I tried adding a low shiny to my cube and it still gave the same prim complexity error, so it looks like materials don't fix it (why would they write the error like that, anyway?).  It won't let me set none as a physics type on a single prim.  I haven't tried making mesh for it yet, but I will.  I'm tinkering with it, learning the system.  I still say it's broken, and LL should do better, but I'm getting used to it.  When I am more comfortable using keyframed motion, I'll go edit the wiki into something helpful.

Link to comment
Share on other sites

  • 0
13 minutes ago, Bubblesort Triskaidekaphobia said:

I tried adding a low shiny to my cube and it still gave the same prim complexity error

It needs to be a texture, not the low shininess setting. I recommend TEXTURE_BLANK and setting the color parameter of the shininess map to a dark grey, like 64,64,64.

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

  • 0
8 hours ago, Quistess Alpha said:

It needs to be a texture, not the low shininess setting. I recommend TEXTURE_BLANK and setting the color parameter of the shininess map to a dark grey, like 64,64,64.

Thank you! That did get it working!  In the texture picker I hit the blank button and then set a gray color like you said, and it runs fine like that, with a prim physics shape.

  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 329 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...