Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

script to create object animations?

Adam Marker
new scripter
Join date: 2 Jan 2004
Posts: 104
07-24-2007 13:37
I'm looking to create some animated sequences inspired by memory of some short spots from 1980s Sesame Street. The shorts told a very simple story by placing different sequences of colored dots on a black background. Sometimes the dots would meet at a corner, or retreat, or cross. The music was usually just notes on an ascending or descending scale, paced to enhance the microstory. Maybe I don't remember all of that correctly, but it's still my inspiration. update: everything is on the internet somewhere. 30 dots. And the wiki says that is from episode 1, yikes.

I'd like to have a bunch of objects move around in a preprogrammed sequence, kind of like watching an animated chess board play itself. I envision placing the objects where I want, and script to record their positions -- for some number of frames. On playback, a script would read the recorded positions and move the objects around. Once I get the animation working smoothly, I'll use Machinima techniques to record the results.

I have some scripts that do some of this stuff, but I was wondering if anyone has a package that records and plays back movement sequences like this? I don't need to generate any fancy interim frames. It is sufficient just to move from location 1 to location 2 to location 3. I've searched a bunch in this forum and elsewhere, but "animation" usually means AV animation in SL, and I haven't found the right search term.
Geuis Dassin
Filming Path creator
Join date: 3 May 2006
Posts: 565
07-24-2007 15:04
This has absolutely nothing to do with machinima. Post this in the scripting tips forum.
Lee Ponzu
What Would Steve Do?
Join date: 28 Jun 2006
Posts: 1,770
no need to be rude, Geuis...
07-24-2007 16:49
...if that is your real name8-)

Adam, I can help you, I think. When you look at an object in the Edit window, you can record its position and rotation, and how many frames you want to stay there.

Once you have all the lists, a script to play it all back will be easy.
Zen Zeddmore
3dprinter Enthusiast
Join date: 31 Jul 2006
Posts: 604
07-24-2007 17:21
Um, "nothing"? wow, i'd have thought it had everything to do with machinima.

Perhaps In Some Solitary Defifinition, who knows? To me (perhaps I'm odd) the 'filming' or 'recording' is the least significant part of it. A mear convienience for people whom can not be present to the event. But the choreography of avatars and geography and weather and sun position and yes sctipted robots too, is the phenomenon of a human expression of a messege they embrace and wish was understood/felt by others.

Of course being able to script the positions of your camera dolly doesn't impair the relevance to the OP's question either.



edit part; as soon as i can login dude i'll git ya some relevant scripts oky doke?
_____________________
A kilogram of programmable nanobots can lower the certainty of both death AND taxes.
Zen Zeddmore
3dprinter Enthusiast
Join date: 31 Jul 2006
Posts: 604
07-24-2007 22:08
first, i start by making sure log chat is checked in my prefrences
cuz we're gonna make big use of that.

place this script in an cube prim.
color the separate faces of the cube distinct colors.
name it an appropriate distinct name
move this cube (and any others)through each of the different frames' locations.
when (for any given frame) all your cubes are placed how you want them
go through and touch each one in turn
this will force the object to state it's name position and rotation

Set this object in anyplac
default
{
state_entry()
{
llSetText("touch to say position and rotation",<0,0,0>,1.0);
}

touch_start(integer total_number)
{ string svar;
rotation rvar;
vector vvar;

rvar=llGetRot();
var=(string)(rvar);

vvar=llGetPos();
var=(string)(vvar)+var;

llOwnerSay(0, var);

}
}


example run;
frame 1
output from cube 2: <113.14651, 95.15689, 107.13632><0.00000, 0.00000, -0.79866, 0.60179>
output from cube 1: <113.15215, 95.17657, 107.13632><0.00000, 0.00000, -0.79866, 0.60179>

frame 2
output from cube 1: <113.26798, 95.58041, 107.13632><0.00000, 0.00000, -0.99540, 0.09579>
output from cube 2: <112.11308, 95.45329, 106.64433><0.00000, 0.00000, -0.79866, 0.60179>

frame 3
output from cube 2: <113.20953, 100.05715, 110.74726><-0.60494, 0.32844, -0.70819, 0.15696>
output from cube 1: <113.26798, 95.58041, 106.66991><0.39228, 0.26210, 0.86853, 0.15188>

this looks to me to be a start towards the next step...
copy this data from your chat log and use it to re animate your blocks : )
more to come... stay tuned : )
_____________________
A kilogram of programmable nanobots can lower the certainty of both death AND taxes.
Adam Marker
new scripter
Join date: 2 Jan 2004
Posts: 104
07-25-2007 06:16
Thanks everyone, I appreciate your thoughts. Zen -- I think I get the idea; you don't have to code the whole solution for me, unless you're having fun!
Robustus Hax
Registered User
Join date: 4 Feb 2007
Posts: 231
07-25-2007 07:41
From: Adam Marker
Thanks everyone, I appreciate your thoughts. Zen -- I think I get the idea; you don't have to code the whole solution for me, unless you're having fun!



There's a scripting object called puppeter I beleive on Slexchange, it will do all the hard stuff for you if you wanted moving prims.
Zen Zeddmore
3dprinter Enthusiast
Join date: 31 Jul 2006
Posts: 604
07-25-2007 14:22
aye, i am having fun and will continue. The puppeteer (i have a copy) may work just like what I'm working up here. but it's no mod not visible scripts are less usefull. Although I perhaps sould at this point move this to scripters thread. ciao.
_____________________
A kilogram of programmable nanobots can lower the certainty of both death AND taxes.
Lee Ponzu
What Would Steve Do?
Join date: 28 Jun 2006
Posts: 1,770
totally non-working script...
07-25-2007 15:55
it's an interesting coincidence that last week I had started on such a script myself. here's what I have so far. The idea is that you pose all your prims, and then record that snapshot. Every prim remembers itself. later, you freeze all the data, and then play it.

CODE
 


//priminator

string helpmessage =
"Commands:\nhelp\tthis message\nreset\treset\nsetup\trecord snaps\nlist\tlist current snaps\nexecute\trespond to robo-commands\n";

list lSnap =[];
list cmdList;

rotation startrot;
vector startpos;

integer NO = -1;
integer NONE = 0;
integer PARSE = 1;
integer RESET = 2;


getCurrent()
{
startpos = llGetPos();
startrot = llGetRot();
}

integer handleMessage(string m)
{
string c = cmd(llStringTrim(m, STRING_TRIM));
if ( !member( c, cmdList) )
llOwnerSay("Cannot "+c+" now.");
if( c=="") return NONE;
if( c=="setup" )
return PARSE;
if( c=="reset") llResetScript();
if( c == "help" )
help();
if( c == "snap" )
{
lSnap += [ argv(1,m), llGetRot()/startrot, llGetPos() - startpos];
}
if( c == "list" )
sayList(lSnap);

return NONE;
}

say(integer i,list l)
{
llOwnerSay( (string)i + ": " + llList2String(l, i) + " " + llList2String(l, i+1) + " " +
llList2String( l, i+2));
}

sayList(list l)
{
integer i;
integer n = llGetListLength(l)/3;
llOwnerSay( n + "snaps taken" );
for( i=0; i < n; i+=3 )
{
say(i, l);
}
}

help()
{
llOwnerSay(helpmessage);
}

integer member( string s, list l)
{
return (llListFindList( l, ) != -1 );
}

string first( string s )
{
//return first
integer space = llSubStringIndex(s, " ";);
integer l;
if( space >= 1 )
l = space-1;
else
l = llStringLength(s);
return llGetSubString( s, 0, l);
}

string butfirst( string s )
{
//return the rest
string t =
llDeleteSubString( s, 0, llSubStringIndex(s, " ";));
return llStringTrim(t, STRING_TRIM);
}

string cmd( string m )
{
return first(m);
}

string argv( integer n, string m)
{
if(n==0)
return first(m);
else
return( argv(n-1,butfirst(m)));
}

integer channel=0;

default
{
state_entry()
{
cmdList=["setup", "help", "list"];
llListen(channel, "", llGetOwner(), "";);
}
on_rez(integer start_param)
{

}
listen(integer channel, string name, key id, string message)
{
integer action = handleMessage(message);
if( action == PARSE ) state parsing;
if( action == RESET ) llResetScript();
}
}

state parsing
{
state_entry()
{
cmdList = ["help","list","reset","execute"];
getCurrent();
}

listen(integer channel, string name, key id, string message)
{
integer action = handleMessage(message);
}

}

AWM Mars
Scarey Dude :¬)
Join date: 10 Apr 2004
Posts: 3,398
07-25-2007 19:10
Geuis... I dunno whats up dude, but going about attacking ppls and being rude isnt your 'normal' self... If ur having a bad time, best not take it out on other people.
_____________________
*** Politeness is priceless when received, cost nothing to own or give, yet many cannot afford -

Why do you only see typo's AFTER you have clicked submit? **
http://www.wba-advertising.com
http://www.nex-core-mm.com
http://www.eml-entertainments.com
http://www.v-innovate.com
skribe Forti
Dreamshaper
Join date: 20 Jun 2006
Posts: 87
07-25-2007 20:50
I have to say that I don't think much of this so-called script. The character development is poor, there is no plot resolution and the pacing is all over the place. I suggest employing a script editor to assist in sorting out these problems. :D
Geuis Dassin
Filming Path creator
Join date: 3 May 2006
Posts: 565
07-25-2007 22:35
maybe you're right AWM. I'm not feeling right recently. If I have a good night on the town with coworkers, am I supposed to be angry with everything when I get home?
Zen Zeddmore
3dprinter Enthusiast
Join date: 31 Jul 2006
Posts: 604
07-26-2007 09:47
this library script I just found is along these very same lines.

/15/c8/66959/1.html

I was having little luck getting it to position from a notecard,
but if having a template wherein you paste the time frame data works... then the question becomes is it more worth your time and effort to optimize the scripting to facilitate or just use the proscribe proceedure.

ps. skribe, very witty. ty.
_____________________
A kilogram of programmable nanobots can lower the certainty of both death AND taxes.
Adam Marker
new scripter
Join date: 2 Jan 2004
Posts: 104
my thanks
07-26-2007 09:57
Thanks for all the input. Puppeteer looks like it will work well for my current needs, and the script examples are great inspiration for the future. Waycool example from the Scripting Library Zen, I'll give it a try.

lol skribe, I hope my screenplay turns out better than theirs.