21 August 2015
24 July 2012
timer
instead of loops. This is a step forward to making the puppeteer work on OpenSim where even handlers time-out.touch_start
event in the puppet
state).17 November 2011
15 August 2011
[K] Puppeteer Recorder
script was updated to address this and to output lines even for a few number of steps.A puppeteer is a device in Second Life meant to facilitate the animation of primitives. This is done by recording a set of positions and rotations and then replaying them in order to achieve the animation effect. This puppeteer differs from other puppeteers because it allows both the recording and the animating to be performed within Second Life. An interesting consequence is the recorded data, being saved to a notecard, can be reused for animating a different primitive.
This script can puppeteer objects or individual linked primitives, depending on what movement and rotation is recorded by the recorder script:
The puppeteer works in the following way:
◆ Mark ◆
.◆ Dump ◆
. This will dump all the recoded data on the local chat and it will look something like this:Object: ------------- BEGIN CUT ------------- Object: #<57.401940, 113.362300, 1001.491000>#<56.057780, 113.362300, 1001.491000>#<56.057780, 113.362300, 1002.707000>#<56.649890, 113.362300, 1002.707000>#<56.649890, 113.362300, 1003.624000>#<55.782050, 113.362300, 1003.624000># Object: [K] Object: #<.000000, .000000, .000000, 1>#<.000000, .000000, .000000, 1>#<.000000, .000000, .000000, 1>#<.000000, .000000, .000000, 1>#<.000000, .000000, .000000, 1>#<.000000, .000000, .000000, 1># Object: -------------- END CUT --------------
Object:
) from the data as well as the cut lines. After the cleaning, based on the previous example, the data should look like this:#<57.401940, 113.362300, 1001.491000>#<56.057780, 113.362300, 1001.491000>#<56.057780, 113.362300, 1002.707000>#<56.649890, 113.362300, 1002.707000>#<56.649890, 113.362300, 1003.624000>#<55.782050, 113.362300, 1003.624000># [K] #<.000000, .000000, .000000, 1>#<.000000, .000000, .000000, 1>#<.000000, .000000, .000000, 1>#<.000000, .000000, .000000, 1>#<.000000, .000000, .000000, 1>#<.000000, .000000, .000000, 1>#
Puppet
.Puppet
with the data you just cleaned.A: Can I use this to animate attachments?
Q: Yes, it works the same way, just create the path while that attachment is attached to yourself to grab the local coordinates.
Q: Can I use this to animate linked primitives, such as wings?
A: Yes, puppeteer each wing. If you puppeteer the root of a linked object, it will move the object itself. If you puppeteer a linked primitive, it will puppeteer just that primitive.
Q: How can I make the puppeteer loop the animation in a seamless path?
A: Suppose that you wanted to make a closed path, such as a circle or a square or a rectangle. You can loop the animation by just marking the last step close to the first one. When the puppeteer reaches the last step, it will jump to the first. However, if that last one is close to the first… It will just loop.
Q: How can I restrict or remove the toggle to turn the puppet on and off?
A: In state puppet
, you see this segment:
touch_start(integer num) { if(nDone = ~nDone ) { llSetTimerEvent(1.0); return; } llSetTimerEvent(0); }
To restrict the puppet
to the owner of the object, change the segment to:
touch_start(integer num) { if(llDetectedKey(0) != llGetOwner) return; // <-- allows only the owner to turn the puppet on and off. if(nDone = ~nDone ) { llSetTimerEvent(1.0); return; } llSetTimerEvent(0); }
To eliminate the on/off entirely, useful if the puppeteered primitive should not never be stopped, remove the entire touch_start
event handler.
Q: How do I slow it down?
A: There are two ways to slow down puppeteer:
Puppeteer processes each entry in the notecard at the rate of 1
instruction / second. You can see this in the animator code, in two different places:
llSetTimerEvent(1.0);
where 1.0
represents the number of seconds to pause between executing instructions. You can change this to any other value, higher for slower processing of instructions or less for faster execution of commands.