Explore the process of creating practical animations in Navisworks using the Scripter tool, focusing on left and right door opening animations. Learn how to establish conditions, assign keys for triggering the animations, and manipulate keyframes for a more controlled animation sequence.
Key Insights
- The Scripter tool in Navisworks allows users to create and control custom animations, a process that includes copying existing animations, creating new animation scenes, and managing keyframes for specific controls.
- Conditions and key assignments play a crucial role in controlling animations. For instance, in the case of door opening animations, assigning a specific key like 'L' or 'R' for left and right door animations, respectively, triggers the animations.
- Users can control the start and end of animations by managing the keyframes and choosing to pause at the end of an animation. A 'current position to start' option allows animations to start from wherever they currently are, offering greater flexibility in animation control.
Note: These materials offer prospective students a preview of how our classes are structured. Students enrolled in this course will receive access to the full set of materials, including video lectures, project-based assignments, and instructor feedback.
Welcome back to the Navisworks video series. In this video we'll be continuing with Scripter and we'll be starting to create our own scripts and we'll be using the BIM361 model from Lesson 3. And once your model is loaded, turn on the Scripter tool and then go back to the Animator tab on the Scripter panel. We need to first create the animations that we want to tie to events.
Currently we have the approach animation that we made manually and then we have the cut animation of the section plane that we made manually. We're going to create a third scene that has just the left door and right doors opening, not closing, just opening. And the reason we want just those door opening animations is because we don't want to have this full length of interpolation because we don't know when we'll be triggering or untriggering our animation.
We want Scripter to decide that for us. The good news is that we have the ability to copy existing animations and we've already animated the doors opening so we don't have to use the translate rotation tool in order to make a new animation. Simply have to select the left door, right click, go to copy, and then go to paste, and then go to the right door, copy, and then paste.
And then all we need to do is make a new animation scene. So hit the plus button down here, add scene, and let's call this scene doors. And we could drag the right door animation into doors and then the left door animation into doors.
It doesn't matter which one we we drag because they both have the same titles and the same information. For this animation set, animation scene, we don't need to have a camera. So here's a right door selection set in our left door selection set, but we still have all the keyframes that we don't want.
We only want these first two. We can simply right click on each of them and go to delete, delete, delete, and delete. And so our animation for the left door and right door underneath our doors animation scene stops at the end of that second keyframe and does not continue to close.
Let's go over to the scripter tab and we're going to start a new script. First let's go to add new script and we'll call this one left door open. And then let's make a new script again and call this one right door open.
And now let's create a folder for these doors scripts. Then you can drag each of those scripts into the doors folder. Starting with the left door open, we first need to create a condition.
And we're going to be using primarily two different conditions. First we'll work on the on key press and then later we'll start to look at how the hotspot event works. So to create a new event select the on key press button and then we'll see that our condition is on key press.
And then when you select that event then you'll see that the properties panel or the properties part of the scripter panel has some information. And here's where we can assign keys. So for the left door open we want to click on the key box and then push on your keyboard L. The next part where it says trigger on, keep that a key down.
What this means is that we can assign the event to take place as the key is pressed as soon as the key is down on the keyboard or when we release the key from our keyboard. So key down is what we want for this one. And we want to assign an action to this event so when we hit L then this is going to happen and we're going to play an animation.
On the properties panel drop down the animation box and then expand doors and select left door. Left door open, this is the animation that has the left door simply opening. Make sure pause at end is checked on.
If that's not checked on then it will reset our animation after it's done playing. We're going to start at the start of animation and end at the end of the animation. And what this is asking us really is this scrubber is going to move along this line and this is the start at zero and this is the end at the highest number in that animation.
We have the ability to start at the end and end at start and also to start at a current position or a specified time and then end at any time that we want to. Let's do a similar thing to the right door open. Select the right door open script, create an on key press event.
The key this time is going to be R. It's triggering on key down and when we select R we want to play animation which is going to be the right door animation. Pause at end, starting at start, ending at end. And that's all there is to it.
So let's get a good view of our doors and I'm going to reset the doors so I'll take the scrubber and move it back to zero just so we have a good reference. And then once you're ready to see the scripts go to enable scripts. And now on your scripter tab you'll see that you can't edit anything.
It's locked. I just hit escape to deselect the doors and then practice hitting R. You'll see the door open and then hit L you'll see the left door open. Currently we don't have any buttons to make the doors close but you can restart the animation by hitting each of the buttons and you'll see that it's it will start the animation at start and end at end and then pause.
So let's create the door close scene script now. So deselect enable scripts to turn it off. You'll see that our scripter is now editable and we're going to create a new script.
Doors close. We can make a script for left door close, right door close, but for this example I want to show you how to add multiple animations in one event. So with doors close script selected, create an on key press event.
There are a couple of reserved buttons that I found by experience that don't work and C is one of those buttons that don't work. We'll use K as the close key. Now we want to play an animation whenever K is pushed and the first animation we want to play is the door's left door starting at current position and ending at start.
And I selected current position because sometimes we want to close the doors before the first open animation is all the way complete and we don't want the doors to start opening and then jump to the fully open position and then go back to the start position. We'd want it to start at wherever the animation is and then end at of course the start position. And because we want both of the doors to close, we can select another animation to play and this time it's going to be the right door animation starting at current position ending at start.
Once you have that all set go to enable scripts and let's check out whether these scripts are working. One thing I should note to you right now, in order for the scripts to start you have to select the scene first. If you have the script or panel selected then it's not going to activate any animations.
So just make sure you're in the scene. And so we're going to open the right door, open the left door, and then hit K to close. And it closes them both.
Next we're going to just check out whether the current position is working. I'm going to begin to open the right door and then hit K and for some reason the left door... oh it's because it's starting from current position. So let's open both doors and then hit close and there we go.
Okay so in the next video we'll be covering different events. We're going to be looking at the on hotspot event and we'll be using the new animations that we just created in this video. So before you save your file disable enable scripts and then you can save this file where it sits in your lesson 3 folder just by hitting the save button.
Okay I hope you enjoyed and I'll see in the next video.