4. Parts In order to animate LDraw models you need to show LD4DStudio how your model's movable parts are interconnected. The first step in this progress is to define the separate movable parts in your model. Divide and conquer You can't just take any model and start animating. The main reason for this is LD4DStudio needs to know "what parts can bend". To this end you need to separate your models into distinct moving parts. This can be done by creating separate LDR files or by using multi part documents (MPD). But the best way of taking care of this 'problem' is to design/draw your models from the start in separate pieces. For example, If you're planning to animate a (minifig) car you need to create separate LDR files (or sub models in case of an MPD) for the following parts:
These model parts are called just that while working in LD4DStudio, "Parts". So please keep in mind that when I will be talking about parts I mean these separate (sub)models. Unless I say "LDraw part", in that case I mean a single LDraw Library Part (DAT file). It may seem 'weird' to make a separate file/sub model for a minifig car door, because it's a single LDraw part, but doing so prevents direct references to a LDraw library part while adding parts to your LD4DStudio project. A direct reference is bad because it makes the project dependent on a specific LDRaw library location. More about this in below. MPD - the preferred method of part separation LD4DStudio fully supports multi part document files (MPD), so why not take advantage of that? Also, by designing your model in a MPD-supported drawing program (e.g. MLCad), the model will be more structured. This approach also helps to keep track of large models. One thing to keep in mind while using MPD, is the fact LD4DStudio is quite strict on reading them. The first sub model in an MPD will be used as the main (assembled) model. But while using the MPD to add parts the assembled model is of no interest, only the movable parts (the other sub models) are. So when adding parts from a MPD to your project the first sub model WILL BE IGNORED. The first sub model in an MPD is only relevant when adding the whole MPD as a single part. Part management Like I stated before, LD4DStudio needs to know how your models 'bend'. The first step in telling the application this, is to add all the separate parts to a package. You can add the parts to any package, but for the purpose of this chapter let's create a new package. That way you don't need to worry about filenames etc. Also this way you can play around with parts without 'messing up' an existing package. After adding a new package, you can gain access to its part management by expanding the package object and selecting the "Parts" object. This object has only one action, the "New" action. After clicking on the New button the file browser dialog will open. With it you must locate and select at least one LDraw model to be added. If you select multiple files (by holding CTRL), every one of them will be added separately. Let's add some random LDR file(s) of your liking (MPD will be handled in a few moments). After you click "Select" in the file browser, new objects will be created under the "Parts" object, one for each of the files. These are "Part objects". Let's check one of them out by selecting the first one. A part object has two properties in it's "Properties" page: "Name" and "Filename". The filename is self explaining and read only. But the name property you can change at will. By default it will be the 'bare filename' (no directory and extension). The name you choose will be used when referring to this part throughout the application. Don't worry about name changing later on because LD4DStudio will keep all references to it in sync (within open packages). Adding parts is easy, but what about adding parts from MPD files? It's basically the same, so lets open the file browser again by clicking on the "Parts" object "New" button. But this time select a MPD file. For each MPD file in your selection LD4DStudio will ask you a question. It will ask you if you want to select sub models from the MPD. If you answer "no" the whole MPD will be used as a single part, just like LDR files. But if you answer "yes" a dialog will appear enabling you to select one or more sub models from the MPD. Like I said before, the first sub model in the MPD will be ignored when using sub models from it, so don't be looking for it in the presented list. You now can select one or more of the items in the list and click on "Ok". By default all items will be preselected, so you could just click on "Ok". After this the selected sub models will be added as part objects, just like 'normal' LDR files. The only notable difference is the filename for them will be something like "theBestCarEver.mpd?Frame.ldr". The "?" is used to separate the sub model filename from the MPD filename. Internally the name before "?" will be handled as the part's directory. But you don't need to worry about that. As far you're concerned it's just another part object. Part editing To make a joint between two parts you need to know where they connect. Therefore you need to define a location (point) in each part. This seems quite simple, but it tends to be one of the most complicated activities in creating actors. Luckily LD4DStudio tries to help you by suppling a number of tools in the "Part editor". Every part object can open such an editor by simply double clicking on it in the object tree. Before I go into part editing let's first setup an example environment. During the remainder of this chapter I will be using the excavator.mpd file for parts. If you want to work along with the text I recommend you take the following steps:
Doing this little task will also put aforementioned theory to work. I won't be telling you to save you're work all the time, you need to rember this yourself. The fastest way to save your work is to click on the .. button in the workspace toolbar, or press CTRL+S anywhere. The edit window A double click on the "Cabin" part object will open the Part editor for this part. By doing so the needed LDraw files will be loaded and the part appears in a window looking something like the picture below. If there were any problems locating LDraw files during loading you will also see a pop up dialog reporting the names of LDraw files that could not be found. If that is the case you might want to include more locations to the LDraw search locations list. See the configuration chapter on how to this. The new window has two toolbars, a status bar and a 3D display area. The display area is made out of 'viewports', 'views' and 'viewkinds'. The concept of 'views', 'viewports' and 'viewkind' can be confusing at first. But once you get a grip on it you will find it quite useful. Views and viewports In LD4DStudio 3D edit windows you can 'look' upon your work in different ways. I will start with the 3D area itself (by default the black area in the window). This area can be divided in up to four 'sub' areas. These are called the viewports. By default the whole area is used for a single viewport, but you can change that by using the 'viewport orientation' button described below. A viewport is like a television: you can set it to a specific 'channel' to view. These channels are the views, and every editor has six views. You can select a current view for each visible viewport. For example if you choose to use two viewports you can watch/edit your part from two different locations at once. Every view can be set to one of seven modes, the viewkind. Six of these modes are ortho (2D), and give you a 'flat' view of the part from ether the 'top', 'bottom', 'left', 'right', 'front' or 'back'. The seventh is the more natural 'free' mode. This mode is called the 'perspective' mode. It's best to play around with the viewports, views and viewkinds to fully grasp the power of this setup. If six views and four viewports aren't enough for you, you can always open a second (or third, fourth etc) edit window for the same part. This way you double (or triple, quadruple etc) the number of viewports and views, and you can edit your part from even more angles at once, although I recommend using a dual-screen setup for this. Basic 3D edit window control The first toolbar in the part edit window lets you control/customize the interface. It's important to understand the goal of this bar because it's present in all 3D edit windows, So lets go through the buttons one by one.
Part edit window control The second toolbar in the part edit window lets you control part-specific things. This tool bar is unique to the part edit window and you will be using it intensely, so let's go over the buttons one by one. The first five buttons control the current part editing mode.
Points Now let's (finally) get into the actual point editing. As said before the whole trick to creating animations is defining joints. To make that possible LD4DStudio most know 'where' and 'how' two parts connect. You must indicate this by defining one or more points on every part showing the location of a joint. Let's start with a simple part, the bucket. Open the part edit window for it by double clicking on it's object. You now see the bucket part in all it's glory. The bucket is a simple part because it only has one LDraw part. Connection information suggestions The only LDraw part in the model is a so called 'real life' hinge or 'native hinge'. It's called that because it has been designed to bend in combination with a collection of other parts by the Lego company itself. This fact made it a logical addition to the suggestion database. This database holds information about predefined joint location points for hundreds of LDraw parts. The database is fully editable, so you might want to extend it with custom information later on. Information about extending the connection information database will follow later on in the manual. For the moment let's use the predefined information to create a point in this part. To do this you must enable the 'suggestion mode'. While in this mode click on the LDraw part. It will turn blue (selected LDraw parts are indicated by 'inversing' it's color(s)). You will also see a big marker appear. This is the point suggestion as dictated by the connection information database. There's only one point available so it will be preselected. While in the suggestion mode there are two additional buttons available in the second toolbar of the edit window, namely:
While the marker is visible click on the "accept current suggestion" button (or press the INSERT key on your keyboard.). The suggested point will be copied to a newly added point in your LD4DModeler part. The edit window will also go to Point edit mode automatically. This way you can optionally edit the new point or give it a better name. Accepting the suggestion will also trigger a confirmation dialog with quite a little story you need to answer yes or no to. The dialog might 'frighten' you at first, but it's really quite simple. More so if you're familiar with the nature of LDraw. The thing is while defining the point in the suggestion database the XYZ axes of the point (it's orientation) were the same as the global LDraw coordinate system, but because of the placement of the part within your model this has been rotated (while drawing the model the bucket part has been rotated). So at the moment the orientation of the point differs from the global orientation. For parts where you started with a 'zero rotation' this is almost always unwanted, so the dialog asks you if you want to correct the rotation of the point back to zero. The concept of point rotation will make more sense later on but for now we are indeed better off with a zero rotation. Therefore choose 'yes' in this dialog. Actually we won't be needing non-zero rotation points for the whole excavator model, so for the remainder of this chapter you can always answer yes while accepting suggestions. I will also 'ignore' other orientation related stuff for the time being. The concept of a point orientation will be addressed in the Actors chapter. The point object As a result of the previous section you now have a single point definition in the bucket part. Examine it by rotating the part. You will notice the marker will change color, this is because it has been deselected. A selected marker will be brighter then non-selected ones. By clicking on the marker you will select it again. The marker represents the point location and orientation. Points have an associated object for them in the object tree. You will notice selecting the marker in the 3D view or selecting the object in the object tree gives the same result. The point object also has a number of properties you can edit. These properties let you edit its location and rotation by hand, but most of the time you will be using the 3D edit window and its toolbar for these tasks. The more important property to edit will be the 'name' property. By default the new point will be called 'Point 1'. This is fine for a part with only one point but it's good practice to name your points in a 'smart' way. By smart I mean give it a name that indicates it's target. In this case the bucket will be connected to the lowerArm part later on. So calling the point 'lowerArm' makes things more clear. It might seem trivial but naming points this way will simplify actor editing later on. We are done with the bucket part, so let's close the edit window for it. Closing the window isn't mandatory but it's good practice to close 3D windows you don't need at the moment to free up graphic resources (like used memory on your VGA card). The cabin part The second part of the Excavator is the "Cabin" one. This is a more central part and will have four other parts connected to it, so we will need to define four points for it. Open the part edit window for the Cabin part. Two of the four points are quite easy to see/define. It's the digging arm hinge at the front and the turntable at the bottom. Both parts have suggestion information so try to define the two points yourself. Don't forget to re-enable suggestion mode after adding the first point in order to add the second point. Like before, naming is important so, name the turntable point "frame" and the other one "upperArm". Below is a picture of what you should end up with. The last two points needed by the cabin are for the cabin doors. The doors itself have suggestion information but they 'turn' over a stud. So for the cabin we need to manually place a point in the center of those studs. Adding points manually is more work and can be quite hard, but that's what all the Edit window tools are for (Multiple views, viewkinds, etc). We start by going into point edit mode (you should already be there if you handled the first two points correctly). Point edit mode buttons You might have noticed a whole bunch of extra buttons in this mode. Up till now we didn't need those buttons, because they mutate the current selected point. I'll describe them in groups.
Like I stated before, you don't need to do anything with rotation for the Excavator model but I explained the buttons anyway to make things complete. Let's add the left door point manually. In order to add a point a LDraw part must be selected, so click on the 1x4 plate next to the minifig seat. The 'add' button will be enabled. Click on it (or press the INSERT button on your keyboard) to add a new point. The new point will be placed in the center of the LDraw part. This is not quite where it is supposed to be, so we need to move it around a bit. The door rotates around a stud, so let's first bring the point at the correct height (the bottom of the plate's studs). The easiest way to do this is by stetting the Y movement stepping to 1. Use the movement stepping button to select the first stepping in the list (X: 1; Y: 1; Z: 1). Now we can move the point by steps of 1 until the X and Z axis markers align with the LDraw plate part. Four clicks on the "Move Y in negative direction" (button #7) should do just fine. Next step is to center the point at the destination stud. The newly added point is placed at the center of the part, the four studs on the plate are also in the center of the short side. This means we only need to change the position of the point in the X direction. We need to move it exactly one and a half studs. you could do this by clicking thirty times on the "Move X in positive direction" button. But it would be easier to select a different step size first. Let's choose (X: 10; Y: 12; Z: 10). This is a very handy step size because it equates to half a LDraw 1x1 brick's size. Therefore three clicks equals one and a half studs. That's it - the manual point definition is done for the left door, you should have the same result as below. The point has the position of X=30, Y=-16 and Z=-30 (You can check this in the property editor for the new point's object). Because the cabin is drawn symmetrically we can now use these coordinates to define the right door even faster, but first give this point the proper name of "leftDoor". Select the 1x4 plate on the other side of the cabin. If you like you can rotate the cabin around to get a better view of the plate. After selecting the plate add a new point. It will once again be centered in the LDraw part. But this time we going to position it by using the property editor using the known coordinates of the left door point. Like I said, the cabin is symmetrical so the X and Y coordinates will be the same for the right door. Only the Z value differs because it's on the 'other side'. The Z value for the left door is -30, by using 30 for this point you have 'mirrored' it. But because new points are added in the center of the 'host' LDraw part, the new point's Z value is already 30 so you need only adjust X and Y to the same values as the left door's point. Enter X=30, y=-16 using the position properties of the new point's object. The point will reposition after each change. When done change the name to "rightDoor" and you're done with both the point and the cabin part. Once again let's close the editor window to free up resources. The frame part Third part and last 'more complicated' part is the "frame" part. It's complicated only because of the number of points. All points can be created using the connection information database, so it's still relatively easy. Open a part edit window for the Frame part and put it in suggestion mode. The part might be a bit 'hard' to see because it's an all black part. The frame part needs five points in order to connect four wheels and the cabin. Let's start with the easy one, the turntable on top that connects to the cabin. Clicking on it will show the only suggestion for it. Accept this suggestion and rename the new point "cabin". Return to suggestion mode to work on the wheel points. You might think "This swapping from and to suggestion mode is quite irritating during multiple point adding." If so you're right about that! That's why you can prevent the editor from going to point edit mode after accepting a suggestion. This way you can directly select the next LDraw part to copy suggestions from. To prevent the mode switch hold the CTRL key while accepting a suggestion using the INSERT key. Do note this works only while using the keyboard. Select the front wheel holder LDraw part of the frame. It will show two point suggestions. By default it will select one of them, but you can select the other by selecting it just like points in the point edit mode. Select the suggestion representing the left wheel position and accept it by using CTRL+INSERT. You will get the 'reset' dialog but afterwards things will remain the same. Because we're still in suggestion mode we can continue accepting the second point as well. Select the point suggestion for it and hit CRTL+INSERT again. The points for the rear wheels are not much different, but let's take this task to learn another handy keyboard shortcut. By selecting the rear wheel holder two suggestions will appear. We want a point for both of them so wouldn't it be nice if we could accept both at once? This can be done by using the SHIFT key while pressing INSERT. The shift key tells the editor you want to accept all suggested points for this LDraw part. The shift and ctrl keys can be used together or alone in combination with the insert key. So if you want to add all points and also don't want to go to point edit mode afterwards you press SHIFT+CTRL+INSERT. But if you want to accept all points and do want to go directly to point edit mode afterwards you'll use SHIFT+INSERT. Go ahead and accept both points at once. We're done adding points to the frame part. Go to the point edit mode (if you're not in it yet) for the last task concerning this part. The last we need to do is name the wheel points. Because there are two wheel pairs we can't name them "leftWheel" and "rightWheel" (the target part names). To prevent duplicate names we need to add something to the name, but the rule of thumb remains the same, "Always name your points based upon their target". Let's name the front ones "leftWheelFront" and "rightWheelFront". Then name the rear ones "leftWheelRear" and "rightWheelRear". You can use the picture below to help you identify which point is which. That's it! We're done with the frame part, you can close it's edit window. The remaining parts By now you should have mastered the art of adding points by using suggestions from the connection information database, so I'm not going to insult your intellect by dictating the definition of each and every point in the remaining excavator parts. You will need to complete them yourself. I'll only give you a few pointers and the names to use.
Don't forget to close the edit windows when you're done with a part to keep resource usage low Bones Bones are an optional extension to parts. The bone information is used to draw a 'skeleton' version of parts and therefore actors/characters. This is useful for large actors or animations with a lot of characters running around. This because drawing a skeleton version of things is considerably faster, so in doing so one can animate a large number of models even on slower videocards. But there is a catch; you have to supply the extra information for all parts you are planing to view in skeleton mode. If you're not planning to do large models/animations or have an insanely fast videocard, you can choose to skip bone defining all together. Bone edit mode Defining bones is not hard, but it does add to the all ready large task of preparing parts for animation. In order to create bones there must be atleast two points present in a part. Lets open the part editor window for the UpperArm part. To create a bone you need to go into bone edit mode. By doing this you'll see all LDraw parts are hidden and only the point locations are visible. Points are drawn different in bone edit mode, because we don't need the orientation information. Bone edit mode has all buttons part edit mode has extended with two new ones. These are:
Creating bones Click on any of the two points followed by the other one. Both points will be selected. This is only possible in bone edit mode, in all other modes only one point can be selected at once. As soon two points are selected the 'add bone' button will be enabled. Click on it to create the bone. A 'line' will be drawn between the two points resulting in a simple bone like shape. The new bone can be given a name, but this is completely optional cause it's never used. You can also select the bone itself by clicking on the gray line (it turns red to indicate selection). Because the UpperArm part is a simple arm a single bone is enough to represent it in skeleton mode. Lets define bone's for a more 'complicated' part. So open the editor for the Frame part. The goal of bones is to make part recognizable without drawing the LDraw stuff. To do this for the frame part is done best by 'drawing' a frame. Something like the picture below will do. You should be able to recreate it on your own. Extra "support" points Sometimes drawing bones between the existing points is not enough. For example let's edit the Cabin part again by opening it's editor and going to bone mode. You'll notice all points for this part are relatively low. Creating a frame just with these points will not do the 'real' size of the part justice. What we need are some extra points to make bones with. The thing with points is they don't have to be used for creating animations perse. You can add as many points at the most weirdest places you like, if you don't use them in the actor editor it will hinder nothing. So creating a few points just to make a better skeleton is no crime. However, it is a good idea to 'mark' these kinds of points to help keep selection lists clean. This is done by setting the 'Passive' property of a point to "true". When you do this in point edit mode the point's marker will change, the arrow direction indicators will disappear. In bone mode "Passive" points are drawn in a different color (Grey instead of green). If you create a point in bone edit mode it will be passive by default. Creating passive points for bone creating is best done in point edit mode, because you can use LDraw parts on the edge of the part to quickly add points. Try to create points like the ones in the picture below. Don't worry about naming these points because we don't need them anywhere else. And besides working with them in this editor is 100% visual. Don't forget to make them passive though. After creating and positioning these (5) points you could create something like the picture below in bone edit mode. Use your imagination Creating bones to make 'part skeletons' is quite easy and completely free. So why won't you try to do the other parts yourself. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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. |