5. Actors The second step in telling LD4DStudio how to animate your models is creating an actor. During this chapter I'm assuming you're using the package we edit the excavator parts in. All that work wasn't for nothing, we are going to make an actor with them. Creating actors is actually quite simple if you followed my point naming tips. We'll start with creating a new Actor object. This can be done from the "Actors" object. Select the actors object and press the new button (picture below). Don't worry about the need "minifig head" and "tree" buttons. Those will be explained later. A dialog will pop up, asking you to select a "mainpart" and "center" for the new actor. The mainpart can be any of the prepared parts, but it's quite important to select the most appropriate one. You could compare the mainpart of an actor with the roots of a tree. The position of the root determines where the whole tree goes. It's the same with the mainpart; wherever you place the mainpart all attached joints (tree branches) will follow. For our excavator model the frame is the most logical choice to use as mainpart, because it's the 'base' of the vehicle. After setting the main part you need to choose a point from this part to use as the actor's (rotation) center. Again you may choose any point from the list but again you should choose wisely. For now let's use the "Cabin" point. Close the dialog by clicking on the "Ok" button. A new object will be added to the object tree "Actor 1". Also a confirmation dialog will appear asking you if you would like to open an editor. Click "Yes" and an actor editor will be opened automatically for the new actor object. You can open this editor anytime by double clicking on the "Actor 1" object. The actor editor After the edit window opens you're screen should be something like the picture below. Let's examine the actor editor window. You'll notice that it's very similar to the part editor. For starters the upper toolbar is exactly the same in function and appearance. Also the 3D area is the same with one big difference - you can't select individual LDraw parts. Within the Actor editor you're working with the LD4DStudio parts, so you'll be selecting them as a whole. Further more they aren't called "Parts" but "Joints" (excluding the mainpart). At the left side of the 3D area you'll find a big slider. This slider is used to test a joint's movement in order to fine tune it (or just play with it). The second toolbar is unique to the actor editor, so I'll go over the buttons one by one:
The actor object Before we go into editing/adding joints, lets examine the actor object itself. The object has three properties, an info page and a note. The first property is "Name". Currently the actor is called "Actor 1", lets change that to "Excavator". The second property is "Default move first", this has to do with position and rotation of the actor. By default a actor is placed at it's target position first afterwards it's rotated the desired way. By setting the property to 'false' it will be done the other way around. More on this in the character chapter. The other two properties state the mainpart and center point names you gave in the new actor dialog. You can change them if needed by clicking the small button behind the field. But it's not recommended to change an actors mainpart all the time. Changing it will affect existing animations. The same goes for the center point. Last are the groups "Default visible" and "Default recursive hide" these are used to set some defaults used with characters. Therefore I will discuss them in the character chapter. Adding joints Enough small talk let's create our very first joint. Because there are no existing joints clicking on the append button will append the new joint to the mainpart by default. Click on the "Append joint" button. A dialog will open asking all kinds of stuff. The dialog has three groups of fields: "From", "To" and "Enabled axis". In the "From" group you'll have to choose the 'parent' part and the point within it to use for connecting to the target ("To") part and thus creating a joint. The part will be preset and can't be changed, you choose it indirectly before pressing the append button. The on the other hand you may change. By default it will show the alphabetically first one (note passive points are not listed). Go ahead and select a random point from the list. You'll notice when you change this point the fields in the "To" group will change to. What you see is the result of 'good' point naming. The joint adding dialog tries to guess the "To" information based upon the "From" point name. It will do this correctly if you applied the naming conventions I pointed out in earlier chapters. As a result of this you don't have to change anything in the "To" group. We want to add the cabin first so select the cabin point in the "From" group. The "To" group will change to part='cabin' and point='frame'. But You could choose to override these 'guesses' if needed. The third group "Enabled axis" determines how the new joint may bend/move. The concept of a moving joint might be weird but it's very useful. For example, with it you can create pistons or sliding doors. The cabin part only needs to rotate around the Y axis, so check the Angle Y checkbox. After this you can click the 'Ok' button. You will see the cabin part has been added to the actor and sits on top of the frame part. Also the test slider will be enabled now. Move the slider around and see what happens. The slider will be enabled for any selected joint with at least one enabled axis. The new joint also appears in the object tree it will be named "Cabin" another result of 'good' point naming. The name for new joints is by default the name of the 'from point'. You might want to recenter/reset the view to get a better look at the combined frame and cabin parts. Let's add more joints to the actor. To complete the frame we need the four wheels. Select the frame (or the black background) and click the append joint button again (or use the INSERT key after selection. Select 'leftWheelFront' as the 'From point'. "To" will change to "leftWheel" and "frame" automatically. All wheels need to rotate around the Z axis, so enable the Angle Z axis and click the 'Ok' button. A new joint will be created and a wheel will appear on the frame. You can spin it around with the test slider. Try to add the other three wheels yourself. Just repeat the leftWheelFront procedure with from points: "leftWheelRear", "rightWheelFront" and "rightWheelRear". Don't forget to use the "rightWheel" part for the last two joints. By now you'll have noticed how easy it is to create joints. You just need to select the 'parent' followed by setting the 'From point' and choose an 'enabled axis'. Therefore I'm not going to hold your hand for the remaining joints. Try to create them yourself. Here are some pointers:
After adding them all followed by centering the actor and playing with the test slider, you should be able to end up with something like the picture below. Part point orientation (revisited) Now you're more familiar with creating joints it might be a good time to explain some of the mysteries surrounding the part point orientation. Up till now I avoided this issue because it's hard to explain without referring to joints. The thing is by creating a joint you combine two parts. LD4DStudio does this by aligning the part based upon the orientation of the two connecting points. It will rotate the 'To part' in such a way it's 'to point' marker will align, color wise, with the the 'From point' in the 'From part'. In the excavator example all part points have a zero based orientation, so no rotating will occur. This is because all the parts for the model are drawn in the same 'global space'. This means 'front' is 'front' in all parts alike. When not all parts are drawn the same you may want to correct for this by using a non zero point orientation. Point orientation can also be used to force a joint's motion behavior. For example think about the torso of a minifig. An arm needs to rotate along the one axis but this gives problems because of the A-shape of the torso. So you need to 'tilt' the part point in such a way moving along one axis follows the slope of the torso. I hope the goal of part point orientation has been cleared up a bit. I know it can be a very confusing concept. My advice is to use it with caution and avoid it where possible. Using non-zero orientations can give 'weird' or 'unexpected' results in the actor editor, but it can be a powerful tool when creating complex actors. One thing to do in order to minimize the use of non-zero orientations, is to design your submodels using the same global space. This means, although the parts are in different files they still can be combined without rotation to form the complete model. One way to check this is by using the main model in a MPD to 'pre-combine' your model. This should be possible without rotating the submodels. The joint object Visually joints appear the same as the used "To" part, but internally it represents the connection between two parts. By selecting any Joint (Lets use the cabin for now) you'll be able to inspect it. The property page (like for most objects) is the most important. With it you can edit all aspects set by the "Append joint" dialog up to now. The list of properties starts with the main branch, displaying the 'name', 'from point', 'to part' and 'to point' properties. The later three are read only in the property editor. All three do have an 'edit' button, clicking it will result in an Joint edit dialog (the same one for each three properties). This dialog is almost identical to the 'New joint' dialog and can be used to make major changes. Be careful while making changes as they will affect animations using this actor. There's also a "default move first" property. This is much the same as with the one in the actor object. It determines if a joint will be moved before 'bend' or the other way around. More on this in the character chapter. Then there are the groups "Default visible" and "Default recursive hide" these are used to set some defaults used with characters. Therefore I will discuss them in the character chapter. Next in the list of properties you'll find groups Angles and Movement. Both contain a X, Y and Z group of properties. These control the motion freedom of the joint. Till now we selected only angle movements for joints and only one at that. Nobody stops you from enabling all six axes, but due to real world physics you rarely need more then two enabled axes in any joint. Each axis group has four properties, namely: "Enabled", "Rangemode", "Min" and "Max". Enabled is the one you checked (=true) during the joint creating process. Min and Max can be used to restrict the value (angle or movement) of the axis. How they restrict motions depends on the value of rangemode. The possible values and explanations are:
The default values for the min, max and rangemode properties depend on the kind of axis (angle or movement). For angles min will be -180, max will be 180 and rangemode will be modulo. For movement axis min will be -9999, max will be 9999 and the rangemode will be unrestricted. Do note even when rangemode is unrestricted the min and max values will be used in the application. The will be used to restrict eg sliders. You can't have an infinite large slider, so it has to begin and end somewhere. But do note internally (animation wise) no constrains are present. Restricting the excavator joints During the creation of our actor all joints kept default values concerning their restrictions. But you might have noticed during playing with the slider some parts can go right through others while posing. To prevent this during testing and animating it's a good idea to restrict them to their physical minimum and maximum values. The cabin and wheels are just fine the way they are now, but take the doors for example. They should not be able to go 'through' the cabin or their 'real world' limitations. Select the left door and examine it's movement. A test value of above zero will put it inside the cabin so lets start with setting max to 0 in the property editor. Moving the slider below -90 will make the door rotate past it's real life maximum, so set the min property to -90. We also don't want the modulo function for this kind of joint so change the rangemode to "Min and max". The right door is almost the same, you just need to 'mirror' the values. A test value of below zero will put the door in the cabin so we need to set the min propery to 0. From this a max of 90 will follow logically. The digging arm must be restricted as well, you can do this on the go while moving the test slider around. Give it a try yourself. I ended up with the table below.
That's it. The excavator actor is ready for action. Don't forget to close the editor window when you're done playing and ready to continue the manual. Springs You might have noticed the 'springs' branch in the object list below the actor. You can use that to add fully automatic springs between any two points in the actor. The spring will automatically bridge the changing distance between the two points like a real-life spring would do. All this gives you a very simple and handy way of animating things like technic shocks. Clicking the "add spring" (#7) button opens the following dialog. This dialog let's you pick two points in the actor between which the spring will be drawn. The points can come from any of the parts/joints used in the actor. Therefore both 'from' and 'to' have two drop down boxes. One for choosing the joint (and thus part) of the point and one for choosing a point in the corresponding part. When both points are set to your liking, a spring with default properties will be added and shown in the current actor. Once added you can select it just like the joints and change it's properties. Below you'll see a preview of a completely configured spring (it's from the pneumaticDemo sample.) The 'spring' object has quite a few options, so lets go over them one by one.
Springs can be great to have in your models, but keep in mind they might cause a significant slowdown of rendering if an actor uses lots of them at (very) high quality settings. Single part actors Above steps for creating an actor are necessary for movable actors. But some actors are made of a single part, like a background house or small collection of trees. Those kind of actors can be tiresome to create by adding first adding a part followed by defining a center for it and finally creating an actor with only that part for a mainpart. To save you all this boring work there is the "Single part actor" generator. You open it by clicking on the below button of the actors object. This will open the below dialog asking for some information concerning the new actor. First thing you need to supply is a LDraw model you want to use for main part of the actor. You can select this by clicking the '...' button next the filename edit box. This will open the file browser and lets you locate you model. If the file is a mpd you will be given the chance to create an actor for some or all of the sub models instead of using the mpd as a whole. You do this by checking the "Use sub models" checkbox (only posible if you have a mpd selected in filename). This will enabled the 'sub model' panel. Next is the 'name' edit box (or prefix when you checked the above checkbox). Here you give the name you want for the new actor. When want to create multiple actors from the sub models this field will be used as an prefix instead and the names of the sub models will be used a base actor names instead. Next is the list of sub models present in the mpd (if one is selected). With it you can select which sub models you want to use for creating actors. In the last panel you need to give information concerning the center point for the generated part(s). First is the name which defaults to 'center'. And last is the position of the center point, this defaults to 0, 0, 0 and will be used for all parts generated. When all information is set you're ready to generate the actor(s). After this is done the new actors will appear in the actors branch and can be used like any other actor. There will also be one or more parts added to the parts branch. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Best viewed with Firefox 2, Seamonkey or IE 7 at 1024x768 or higher resolution. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Copyright Roland Melkert 2008-2017, all rights reserved. LEGO is a registered trademark of the LEGO Group, which does not sponsor, endorse, or authorize this website. |