Make Animated Mesh model for Secondlife and Opensim with Blender -A VERY SLOW Blender Tutorial


https://i.ytimg.com/vi/HayC32mAaE0/hqdefault.jpg



I just need some 6 minutes of your whole life for this tutorial on how to animate your mesh :))
Here in this tutorial for my friends, respected senior citizens and my dear subscribers and viewers, I’ve shown the easiest way to make animated mesh for Secondlife and Opensim with Blender 2.67.
I’ve covered almost everything here in this tutorial— from making your model to upload and animating your model to give you a comprehensive idea of the total process.

I’ve written the very small LSL script here in real time and explained in detail what I’ve done step by step, so that you can follow easily in case you are a total newcomer in the world of scripting or a not-so-advanced scripter.
.
The script, that I wrote here, is the best and optimized way to animate your meshes in Opensim or in Secondlife ( instead of using multi-line laggy llSleep() function and a big script).
And more you can smartly change your animation speed just by altering the value of the timer only in one place i.e. llSetTimerEvent() in the state_entry();
Use pause or rewind when you need it.
Here is the full and functional script if you are still lost. Youtube removed the formatting.
But still a copy and paste of the following should work impeccably.

////———Script starts here —- copy from here

float animation_speed = 0.5;
integer total_prims;
integer link_counter;

default
{ state_entry() { total_prims = llGetNumberOfPrims(); llSetTimerEvent(animation_speed ); } timer() { link_counter++; llSetLinkAlpha(LINK_SET, 0.0, ALL_SIDES); llSetLinkAlpha( link_counter,1.0, ALL_SIDES); if( link_counter == total_prims) { link_counter = 0; } }
}

//// ——– end of script — copy up to here.

Should I start a series on LSL scripting here ? 🙂

Animate your mesh. Unleash your creativity.
I’m sure that you are a very good artist with great imagination 🙂
I will be really very happy to see your creations. Post your video response here if you can. 🙂
One thing for sure. That will inspire me to make more advanced tutorials on blender for you all :))
Thanks for watching. :))
*****************************************************************************************************
Update:
As per the request of Pikangie, I’ve just written the quick script for randomized mesh animation . I’m yet to test in SL. But it’s working in Opensim. Kindly check this out and let me know. 🙂
Warm regards. 🙂

Script starts below this line —————————————————–

float randomized_time = 7.0; // experiment with this time
float animation_speed = 0.5;
integer total_prims;
integer link_counter;

action()
{
llSetLinkAlpha(LINK_SET, 0.0, ALL_SIDES);
llSetLinkAlpha( link_counter,1.0, ALL_SIDES);
}

default
{
state_entry()
{
total_prims = llGetNumberOfPrims();
state warmup;
}
}

state warmup
{
state_entry()
{
state trigger;
}

changed( integer c)
{
if ( c & CHANGED_LINK)
{
llResetScript();
}
}
}

state trigger
{
state_entry()
{
llSetTimerEvent(animation_speed);
}

timer()
{
link_counter++;
action();
if( link_counter == total_prims)
{
link_counter = 0;
state wait;
}
}
}

state wait
{
state_entry()
{
llSetTimerEvent(llFrand(randomized_time));
}

changed( integer c)
{
if ( c & CHANGED_LINK)
{
llResetScript();
}
}

timer()
{
state warmup;
}
}

Script ends above this line——————————————————

*****************************************************************************

Here is another script if you don’t want to animate the root Prim in the link Set.

link_counter counts the prim in a linkset one by one.
Root Prim number is 1 in a linkset. And 2 is the number of the first child prim if we link the prims sequentially . Hence I set the initial value of the link_counter to 2. so that it will ignore number 1 ( which is the root prim) ;

/// Script starts here

float animation_speed = 0.25; // change as per your need
integer link_counter = 2; // 2 is the first childprim number in a linkset
integer total_prims;
set_alpha()
{
llSetLinkAlpha(LINK_SET, 0.0,-1);
llSetLinkAlpha( LINK_ROOT,1.0,-1);
llSetLinkAlpha( link_counter,1.0, -1);
}
default
{
state_entry()
{
total_prims = llGetNumberOfPrims();
llSetLinkAlpha(LINK_SET, 1.0,-1);
llSetTimerEvent(animation_speed );
state forward;
}
}
state forward
{
timer()
{
link_counter++;
set_alpha();
if( link_counter == total_prims)
{
state reverse;
}
}
}
state reverse
{
timer()
{
link_counter–;
set_alpha();
if( link_counter == 2)
{
state forward;
}
}
}

/// script ends here

source


42 responses to “Make Animated Mesh model for Secondlife and Opensim with Blender -A VERY SLOW Blender Tutorial”

  1. Hi Som, I knew how to make looped animations already and your osgrid post taught me how to insert a random effect to it, but I have 2 questions for you,
    -1 : Using the random script (edited it to exclude the root) how can I get repeated sequences (finite loops) before it stops? or do I have to make the loops manually (repeat the meshes in sequence)
    -2: Still using the random script base, how can I make it work for it to randomly pick between sequences, say I have 3 animations for an object ( let's say 4 frames each ) and I want the final product to randomly start and stop, picking from the 3 DIFFERENT "sets" of animations at random every time (the kind of scripting I see people use on their mesh pets)?

    Thanks in advance!

  2. okay, i gotcha. from my perspective also though, you never know what anyone knows, so when i post tips in a comment im usually hoping that multiple people will see it. one small trick in blender can make a huge headeache of doing something extremely repetitive, go a whole lot easier, ive learned most my tricks by accident, and wished i could have found some sooner, lol

  3. Hey man, couldn't help but notice you could use a few hotkeys for what you were doing."A" will deselect and select everything, in object mode, or edit mode, and if you have an object selected you can hit "tab" to go in to edit mode, and hit it again to go back to object mode.

  4. Ok so, these are fairly old now but hopefully there is a chance of response as this was very helpful. How would I make sure this animation goes more ordered. For example I want a tail wag, currently it will play Position 1, 2, then 3, but go back to 1.. so its not fluid. I need it to go 1 2 3 2 1 , and repeat in that manner. How would I achieve this?

  5. Thank you ever so much for the tutorial! Great! and the scripts as well – and yes… I think you should add a tutorial on scripts 😛 I found yours very congruent and easy to follow!

  6. Thank you very much for script. I made mesh hat with some small wheels on it. I used your script. i want wear that hat and when i stay (idle) wheels make one pack of animation using your script. Then when i start to walk wheels start second pack of animation. Same with running ( 3rd pack of animation). I try to write this script very long time but i don't understand how i can can make it:( Maybe you have some idea?

  7. Omg finally found ur video that helpful the scripts for mesh. I had no idea how to animate mesh because I'm suck at script. Thank u so much I can't wait to try it out!
    -Updated-

    When i created the script i dont see that convert tabs space under the edit? How i make it appear?

  8. Hi. These scripts are amazing. Thank you!

    I am wondering..is it possible to change script with root prim, with some kind of timer? Lets say i have 3 prims (root+1+2). And i want to make 2nd prim to be visible shorter time than it is invisible.

  9. Here is another script for you. Suppose you need to make the root prim and some child prims visible during the animation.  Just change the number_of_visible_prims  in this script and see the fun. I tested in SL.

    ///Script starts here

    float animation_speed = 0.5;
     integer number_of_visible_prims = 2; // how many prims to make visible in your linkset during animation
    /*
        example:
        1 = the root prim only
        2 = root prim+ first child prim
        3 = root Prim+ childprim 1 + child prim 2 etc
    */
    integer link_counter ;
    integer total_prims;set_visible()
    {
        integer c;
        while( c<= number_of_visible_prims)
        {
           llSetLinkAlpha( c,1.0, -1);
           ++c;
        } 
    }
    set_alpha()
    {
        llSetLinkAlpha(LINK_SET, 0.0,-1);
        set_visible();
        llSetLinkAlpha( link_counter,1.0, -1);
    }

    default
    {
        state_entry()
        {
            link_counter = number_of_visible_prims;
            total_prims = llGetNumberOfPrims();
            llSetLinkAlpha(LINK_SET,1.0,-1);
            llSetTimerEvent(animation_speed );
            state forward;
        }
    }

    state forward
    {
        timer()
        {
            set_alpha();
            link_counter++;
            if( link_counter == total_prims)
            {
                state reverse;
            }
        }
    }

    state reverse
    {
        timer()
        {
           set_alpha();
           link_counter–;
           if( link_counter == number_of_visible_prims + 1)
           {
                state forward;
           }  
        }
    }

    ///script ends here

  10. Hi, can the script be adjusted so that the animated object can be linked to other mesh without them also animating? For example, an animated frog sitting on a water lilly leaf. The frog animating while attached to the leaf but the leaf not animating?

  11. Hello Som.You saved my life with this tutorial.I've been searching for something like this for days.thank you so much.My question is how to make this script work only for a part of the prims linked.for example if there is a bird and has 3 prims with wing texture on them and i want the script to animate just the wings and not the bird texture too how should I do?if you have time and can help please I would really appreciate.And if it's needed I can pay for this modification.

  12. Hello Som, thank you for your wonderful tutorials, honestly the very best I have watched.  I meant to post this on the mesh hud animation tut page, but can't find it again.  I have one small question, how can I (and please forgive if this is a stupid question..the ole brain doesn't work as well as it once did) do the mesh animation with pairs of prims selected in unison (i.e a pair of legs or set of arms).  Thank you in advance for your kind attention.

  13. THANK YOU! Very helpful and makes it a little easier to understand how to animate in SL (good ol'fashioned stop animation!)

    Can the same be applied to Avatars via fitted meshes with independent moving body parts? (tails, tentacles, breasts, fingers, etc)

  14. Fantastic Som! I do have a question though. I did several iterations of wing positions, and while I can get the script I have to move in one direction (it uses alpha cycling through the positions) it wont reverse. Meaning it will go – (object) A – B – C – D and even when I call it to return as D – C – B – A it doesnt. I get this long alpha pause and it starts at the beginning

    list ORDER = [ "A", "B", "C", "D", "E", "F", "G", "H", "G", "F", "E", "D", "C", "B", "A" ];

    list frames;

    integer current_frame = 1;.  

    The script is longer, but I am not sure why it will follow to H and not return even though the script calls for it. Any thoughts?

  15. Som C, i wonder if you could help me. first thank you for creating the random animating mesh script , you have helped to make a dream creation come true for me, and you did it for free. my hats off to you.

    i dont know if this is possible, but how can fade be added to the random mesh animator script? i'm trying to get a natrual transition where the first mesh slowly fades out while the 2nd mesh slowly fades in, then 2nd mesh slowly fades out while the third mesh slowy fades in….and so on.

    also, is it possible to have one link in the set visable allways and just have the rest of them move?

    i am brand new at scripting so i dont know where to add it and what to add. if you know the answer and can help me then i would be thankful, but either way thank you for the help you have giving freely.

  16. Hi Som! Thanks for posting this tutorial, it's helped me a lot. However, I had a question out of curiosity. I'm trying to use this script to animate a mesh tail I've built, so it'll wag back and forth — however, what'll happen is it'll go from left to middle then jump to the right then go right to middle, then jump to left, etc, instead of smoothly going from left to right and right to left. Is there any way I could tweak the script so it doesn't do that?

    Thanks so much for your time, and, I hope I made sense lol. sometimes I'm bad at articulating.

  17. Awww. I don't think I can make it within a week due to RL constraint right now. I'm sorry.

    Meanwhile, you can politely and respectfully request our most respected "takni Resident", the scripting goddess of SL, to help you.
    She offers regular free scripting classes too, to teach and help innumerable people, from the absolute beginners to the extremely advanced scripters. With her, your language will not be a problem.

    All the very best.

  18. Thank you, but unfortunately I prefer to wait for your help. I do not speak English and I find it hard to explain! I think you understood my problem, if you can write the script for me within a week I'd be really grateful. Greetings 🙂

  19. If you are not in a hurry, I can write the script for you. I just need some time as I am in the midst of an insanely big electronics project right now which is eating up my RL time to a great extent.
    I'ill post the updated script in the description soon.

    Alternatively, for ur urgent need, u can show my scripts to any SL scripting group and ask for help there. I'm sure someone will help u.
    There are many helpful and knowledgeable people there and this is just a basic script.
    All the best. 🙂

  20. I use 5 mesh for the animation of the eyes with your script, then for the mouth I use the same script but with 4 mesh. if I wanted to unite all the mesh keeping this animation how do I change the script? I have to use one only guess, but I have no idea of how to write a script only

  21. sure! once you plan from which child prim to start with and where to end.
    You can do it with a single script ( the more complicated way) or with multiple scripts in the child prims ( my preferred way) using link_message command in LSL.
    🙂

Leave a Reply