 Hello everyone and welcome to the 8.30 a.m. to 9 a.m. session of the 2023 Open Simulator Community Conference. Now we have a special note for this session, so please be prepared to alt-click on our speaker, Kelso Uxley, to see his amazing entrance. In this session, we are pleased to introduce the presentation The Art of Smoothly Moving Objects in OpenSim. Our speaker is Kelso Uxley. Kelso and his partner, Dabici Stralino, share a grid that recreates the changing seasons of Eastern Canada. Kelso puts magic in the builds through his scripting skills. Please check out the website found at OpenSimulator.org for speaker bios, details of the sessions, and the full schedule of events. This session is being live-streamed and recorded, so if you have questions or comments during the session, you may send them to atOpenSimCC with the hashtag pound OSCC 23. Welcome everyone. Alt-click our speaker and let's begin the session. Hello everyone. I'm delighted to make you this presentation The Art of Smoothly Moving Object in OpenSim. This is a showcase of scripted object. So the key frame is a concept that is borrowed from traditional cartoon animation technique, which represent the enzyme of movement to which intermediate images are subsequently added. The image that you see on the screen shows three key frames, and the illustrations that are in gray were added subsequently. In the case of 3D environments like Second Life or OpenSim, it is the simulator which calculates the intermediate images. So from the starting position and orientation, the simulator calculates how to move an object, and at what speed, to take it to the position and orientation of the next frame within a given time. So to make it shorter, today I will use the abbreviation KFM a lot, so I'm talking about the KFM function, the KFM object, or KFM script. So a single key frame looks like this at the bottom of the screen. It's a triplet of the three values. There is a vector, it's a position vector, then there is a rotation, which is the orientation of the object, and there is a timing. So when we call the function, we just, in a script, we set his name, set key frame motion, and then between the parenthesis there are two lists. There is a list of key frames. That list can be very, very long, and there is a list of options. So the way it reads is that if you want to specify a list of position, each key frame is interpreted relative to the previous transform of the object. That is, as an example, move the object one meter to the north while rotating the Y axis by 40 degrees and do that in two seconds. So what's important here is that the key MF function never refers to regions coordinate. One of the advantage of key frame motion is that it bypasses a major timer constraint in scripted motion in open sim. One problem we have in open sim for scripted movement is that the timer cannot run faster than half a second. So there are lots of scripts that move object fluidly in second life, but don't work very well in open sim. In addition, since timers consume a lot of server resources, it's always best when you can avoid them when it's possible. So the key MF function can use the server internal clock without spanning any additional timer process, and that's a big advantage. In addition, the tying of the key clock is not limited to half a second. It can go much, much faster. So this is also excellent. Caviets, when you run scripts that have the key MF function, collisions with other objects are always ignored by the simulator and by all scripts. So an object, a key FM object will pass through walls, through objects, even under the region terrain sheet. So consequently, when you want to deploy objects that move around in your region, you have to be careful in the way you lay out the trajectories. Otherwise, your script, your key MF object will go through walls. So it's not a problem when you want to deploy things like birds or fish because there's a lot of anti-space, but it's so often problematic for animals like horses, dogs, etc. So examples of use. This is the part of the talk. Well, I will need to move and so be ready to follow my avatar. So the first example that I will show you is a very simple example. It's the big red door behind me. This is the first script that I wrote with the function. It's simply an open and it closes the door. So the door opens and then after five seconds, it will close by itself. That was my first script. I think it was back in 2016 when I started to explore the use of this function. The second one, somebody clicked on it apparently. Please don't touch it. It's a double door swing and I need to reset it. So please refrain from clicking on the object. It does move. OK, we'll just run it that way. It's a double, it's a swing door. So if I click on it from here, you will see the two are opening. And if I click from the other side, somebody else clicked on it. So I guess I will have to change the script a little, prevent multiple clicking at once. So that's the ID. The next script that I want to demonstrate is the use of the ladder. So I'm moving here to this side of the screen. If I double click on this ladder, my avatar will quickly jump on the top and climb up. If I double click at the top, I'm clubbing down. Now I'll show you how it works. I will first reveal an object that is normally invisible by setting it semi-transparent and moving it sideways a little bit. Just a moment. I need to put local. It is. So you see now I have two objects. This semi-transparent trim normally covers the ladder. The ladder itself is not scripted. The object that's scripted is the invisible trim. If I click on it, you will see what's happening. The trim will shrink to about the size of a much smaller size. And then will transport me to the top. Look at this. Same things to come down. What's nice about this script is that it doesn't need to be reset if you change the position of an object and you change the size and orientation. Let me see. I will turn it sideways completely and make it a bit shorter so that I don't fall upside the stage. And bingo. You will see it's working again. So that concludes this one. The next example that I want to show are pendulums. So I'm going to the big pendulum to the right, to the left of the stage and I'm sitting on it. This object is the only one for which I have not written the script. The script is coming from the examples of the second life wiki on the function. It's a library of different types of pendulums and I thought it was great. So I'm just using it to show you. The first one that I want to show is a top swing. Nice top. The next one is a bobble head. Top. Next one is a regular swing. This one is very nice. It's a tire swing and the last one is a tangle swing. There is in this library also a script for a rocking boat. But the one I will show you, which I wrote, is much better. So we have now this big blue boat in front of the scene. You see if it's already moving a little, there are three settings. I can make it move a little bit stronger. And the last one is severe. It's almost like a storm. So I'll put it back on gentle. This can also be used for floating ice. So it's a nice example of a script that works on harmony. The next example are guided itineraries. Actually, the butterfly rider that I use when I came on the stage is an example of a guided itinerary. But it's hard to show on the screen. So I will just show you a few examples of things that we have available in the region of Alley. So you have here our KMF touring station. There are several rides. You can do a sleigh ride. You can do a cross-country ski tour. There are seven kilometers of cross-country trails all operated with KMF scripts. Here's an example of my partner Dabici and her dog doing a nice trail in the night. At night, we have a KMF chairlift. There's another bigger one for which I have no picture. But it's a way to go back. In the summer times and other seasons, we have lots of boat tours. In the fall, we have a hell of a bike ride tour. It's the fastest that I have ever made. It's really amazing. And a spectacular one, penny farting on a steel wire. There's a steel wire that is half a kilometer long on which you can travel at no risk. The next example that I want to show you now are tracker objects. So the first one here is a little tracker object, a little robot that's surfing around me. This is a classic of Second Live reinterpreted. It's from Ali Arai and she was a marvelous builder for several years in OpenSim. Sorry, in Second Life. And I would like to draw your attention to a presentation in this conference tomorrow afternoon by Kayaka Magic and Ada Radius. They're building a library of all the objects of this marvelous builder. And there is a grid dedicated to the collection. So I will donate the script for the collections because the original script from Second Life is the perfect example of a script that doesn't work in OpenSim because of the clock. So I've written a new script for that and added a few twists. For example, the little droid can scan objects. It's just scanning me now. And one important point is that there is no timer involved in making the script run. There is also no timer for the chatter sounds that it emits randomly. So it's kind of nice. Next, I want to show you a very different kind of tracker object. If you watch behind me in a few seconds, you should see a big eye. So this eye is also a follower, but instead it follows the position and the orientation of my camera. So if I go and take a look at the layer, you see the big eye following my camera. And I can go and do a tour in the region. So this is my camera traveling now and you see what's possible. The HUD that I wear allows me to raise different kind of objects. So I could replace the big eye by something like a ghost or a big flying pumpkin. I'm not going to do that now, but I will do something else. I will raise the NPC. So now I have a copy of myself that can fly around. And talk to visitors because I can communicate through chat on channel zero at any distance in the sim. Next should be, okay, next is the little robot in front of the, in the center of the stage. I suggest you click on it with your alt key so you will be able to follow it starting motion. This robot is not a follower. It decides by itself where to go. He has only instructions to move in the radius right now of eight by eight. And we're changing altitude of 1.5 meters. But it recalculates constantly new direction. And I can, I can turn the shortly ribbon trails so that you see the nice curved path that it's doing. But it's filling up your screen. So I'll probably stop it now. Next, I'm going to mention a feature that's really important, but barely documented. There are events, moving start and moving end that are not explicitly mentioned in the function documentation. And it's a pity because it took me years to discover that they existed in that context. They add tremendous flexibility to key fm scripts. It make it possible for instance to execute other blocks of commands at specific times during a run without having to resort to timers. You can change animation, change position and angle of the camera, make a comment and chat, things like these. I'll now show you how it works. The trick to make use of this is to split your list in key frames in a series of smaller lists and call them in user defined function. When they're called in sequence, each of the smaller lists will trigger a moving start and a moving end event. So instead of executing a single function, you execute several. And with the counter, you know which one to run next. Here is how the code looks like. On the top, you have a single line set key frame motions with a list of five key frames. Instead of running that, I'm doing what's in the lower part of the screen. First I define an integer I step to keep track of where I am. And the first, the step zero is only one frame. At the end of this frame, it will execute, it will increase the counter by one and execute step one. At the end of step one, it will increase again the counter by one and execute step two. So I'm going to show you how it works using the prim that is right here in front of me. I'm going to reset that. So when I will sit on this prim, my avatar will take a meditation position, hold it for three seconds, then change animation and start moving, wait for three seconds again and come back. So here it is, waiting for three seconds, changing animation, moving, waiting for three seconds and coming back. So the five key frames were executed that way. And without timer, I was able to synchronize the change of animation very precisely. I'll do it a second time, wait three seconds, change animations and fly, wait three seconds, come back and eject. So most of these objects are available in the booth, so you can get them, the scripts are free to use. Find out more. If you want to know how to build those objects and study the functions, we'll offer a series of courses initially in French on the Atlas grid. The dates will be announced later in the Francophone Groups on the OpenSim world. And if there is sufficient demand, I will offer the course in English at a later date. I'd like at this point, thanks people who have inspired me over the years by their scripts. Doragus Daphson, Kayakha Magic, Ferd Federichs and Gimiz Aceriz and Akira Komarov. All their scripts have helped me to develop my own expertise over the years. That concludes what I wanted to tell you today. If there are any questions, I'd be delighted to answer them. I have not seen any questions yet. Any questions for our speaker? And you can come by his booth in OSCC Expo Zone 3 to pick up some of these objects and to talk about the content. Well thank you Kelso for an informative and interesting presentation. You know as a reminder to our audience, we will want to check out the conference.opensimulator.org website to see what's coming up on the conference schedule. You won't want to miss our next session. We will begin at 9.30 a.m. in this keynote region and it's entitled Expanding Virtual Experiences with EEP Creations. Please enjoy a short break. Also, we encourage you to visit the OSCC Expo Poster Expo in the OSCC Expo Zone 3 region to find accompanying information on the presentations and to explore the hybrid resources in OSCC Expo 2. Along with our sponsor and crowd funder booths located throughout all of the OSCC Expo regions. Thank you again for our speaker and to you the audience.