15. Export

14. Scripting | | 16. Library

When your animation is done you might want to create a standalone version of it, to show to friends or place on the internet. For this there are several export facilities in LD4DStudio. All are accessed via the monitor window, using the buttons in the below picture.

Export buttons

Frame buffer export

The first group of exports are called 'frame buffer exports'. This basically lets you export the rendering of single monitor camera in different ways. You can create a collection of BMP files (1 per frame) or an animated GIF file using this export type. To do any frame buffer export you first need to put the monitor in a special 'mode', this is done by clicking the #1 button (The one with 'GL' on it). This button can only be clicked when the monitor has a single viewport. When clicked the monitor will change in something like below.

GL Export mode

As you can see the monitor will no longer show any text or selection rectangle, and all camera interaction will be disabled.

The only thing you'll see is a white rectangle encapsulating the chosen cameras current view. This rectangle is used to indicate the export picture size. You can adjust the size of the rectangle (and thus the BMP/GIF dimensions) by dragging one of the four edges. Use also can use the #2 button to set the size to it's current maximum. The current size in pixels can be inspected at the statusbar on the bottom of the window.

When the size is to your liking you must choose the export kind. This is done by ether clicking the #3 (gif) or #4 (bmp) button. Each one opens it's own dialog with a number of options.

GIF export

Clicking the 'gif' button opens below dialog, lets go over the options one by one.

GIF Export dialog

First you have to select what to export, you can choose from 'Export whole animation', 'Export current interval' and 'Export current environment'. The first two are pretty obvious. But do note both of these 'ranges' will use the current monitored camera and NOT the output camera. So if you want a 'clean' export make sure you selected an output monitor camera in the monitor before you start the export. 'Export current environment' means it will export a single frame representing the current state of the scene (No animation calculations will be done!). Do note a single frame kinda spoils the use of an animated gif file.

Second option in the dialog is 'Filename' this will determine where the resulting gif file will be stored and how it will be called. This editbox allows for 'variables' these are keywords starting and ending with ':', like :prjDir: these keywords will be replaced with the current value of some internal thing in the open workspace. Below table lists all possibilities.

:appDir:Full directory of LD4DStudio.exe location.
:prjDir:Full directory of the current project location.
:pkDir:Full directory of the current (animation's owner) package location.
:prjName:Current project's name.
:pkName:Name the current package.
:aniName:Name the current animation.

These variables can be inserted by typing them or using the pop up menu accessible by right clicking the edit box. By default the box holds ':prjDir:exportsgif:prjName:.gif'. If your current project is located in e.g. 'd:\LD4DProjects\bigMovie' and 'the project file is called e.g. 'part1.4pj' the filename for this gif export will be: 'd:\LD4DProjects\bigMovie\part1.gif'.

When needed you can also type a 'normal' full filename in the editbox, optionally using the file browser (accessible through the '..' button).

The last two options are checkboxes, the first lets you control looping. If enabled the gif animation will loop non stop. Second and last checkbox controls what to do when the output file already exists. If you check this option a confirmation dialog will be presented if the file already exists. If you disable this an existing file will be overwritten without notice.

When all options are to your liking, clicking the 'Ok' button will start the export of the selected range to an animated gif file. This process can take quit some time and, depending on the number of frames and picture size, might require a HUGE amount of memory during the whole process.

When you are running out of memory or the result file is to big, try lowering the resolution (picture size) and or the frame rate of the animation.

BMP export

Clicking the #4 (bmp) button opens below dialog, lets go over it's options one by one.

BMP Export dialog

First the 'export range' must be selected, this is identical to the gif export dialog.

Next is 'Directory' it determines where the generated bmp(s) will be placed. The export will generate a bmp file for every frame in the selected range. For this to work numbers are used for their filenames, e.g. '0.bmp', '1.bmp', '2.bmp' etc. This might be a bit bare for your taste so the next option allows you to specify a prefix. This string will be put before the numbers, so if you use 'frame' the bmp files will be named 'frame0.bmp', frame1.bmp', etc.

Last options controls how the exporter deals with overwriting files. You can choose from 'Ask before overwrite', 'Silent overwrite' and 'Clear target directory'. The first will ask for permission whenever a file to be written already exists. 'Silent overwrite' will just overwrite any existing file without notice. 'Clear target' will delete ALL FILES AND DIRECTORIES at the location specified in the 'Directory' editbox. This is potentially very dangerous , although confirmation will be asked beforehand I don't recommend using this option unless you sure you know what you're doing.

When all options are to your liking, clicking the 'Ok' button will start the export of the selected range (a) bmp file(s). This process can take quit some time and, depending on the number of frames and picture size, might require a HUGE amount of storage space at the location specified by 'Directory'.

When done exporting you might wonder what to do with all those 'loose' bmp files. They form the first step in some editing process. usually one uses movie software like Virtual Dub to combine and encode the files into an avi file.

LDR export

Frame buffer export is nice for e.g. 'quick' previewing, but for a serious movie it's quality (the LD4DStudio preview renderings) is just not good enough. So when done animating you might want to use other software to create higher quality renderings of the frames.

Export buttons

This can be done by exporting to good old LDRaw files, whom can be read by any LDraw format supporting program suitable for post processing (e.g. 'L3P' or 'LDView'). You can start an LDraw export at any time, you don't have to enter the special frame buffer export mode first. It's started by clicking the #5 (ldr) button. This will open a dialog like below.

LDR Export dialog

First option on the dialog is 'Create MPD', this controls if the result will be encapsulated in a multi part LDraw document. If checked you can also choose if you only want frames to be stored in the MPD file. If you leave 'Only put frames in MPD' disabled everything will be put in the MPD, resulting in a single file export.

Next is 'Rotate to camera view', this controls if the frame (sub)files will be rotated in such a way the 'front view' corresponds with the view as displayed in the monitor (result might still be different due to the kind of perspective the target software is using).

Next you must select a base directory, just as with the bmp export. This edit box allows usage of the above discussed variables. The resulting location will be used to store the generated frame, mpd and additional files.

'MPD filename' will only be editable if you enabled the 'Create MPD' option. It is used to specify the mpd file name. You don't need to specify a directory in this editbox, just the bare filename. You can optionally use 'variables' like ':prjName:' in this editbox.

Next is 'Frame prefix' this is used to input a phrase whom will be put before the frame identifying numbers, just like with the bmp export.

LDraw is a very modular file format and models often have many dependencies. This can easily result all kinds of problems locating parts while opening the model in other software. This is because the other software might have different LDraw search paths (The user directories editable in the configuration dialog). To try and prevent such problems the 'LDraw file copy' option gives you the possibility to add copies of any depended LDraw files to the target export directory. The amount of files to be copied is controlled by the selection, it's choices are:

Copy all non official library LDraw files.All LDraw files not located in the main library will be copied to the export location.
Copy all non library LDraw files.All LDraw files located in a non 'library' location will be copied.
Copy all non search location LDraw files.Only LDraw files not located in any 'known' user directory will be copied.

Last option is the 'Overwrite mode', this can be used exactly like described in the bmp export text above.

When all options are to your liking, clicking the 'Ok' button will start the export of the selected range to one or multiple LDraw (mpd) file(s). This process is quite fast and doesn't need much storage space in most cases.

POV-Ray export

Last but possibly the most import kind of export is the export to POV-Ray. The previous export possibilities are child's splay in comparison to the all mighty POV-Ray export. But be aware creating good looking POV-Ray exports also require additional work from you while creating an animation. For example your light placements might need a fair amount of tweaking to get things to look right in POV-Ray, because POV-Ray rendering uses things like shadows which could result in very dark areas in your scene.

Tweaking towards POV-Ray export can be done during animating using the special 'POV-Ray' property groups present in light and camera objects, so lets first handle those.

The light object's POV-Ray properties

Locate and select a 'directional light' object. In between it's properties you'll see a 'POV-Ray' group. It will not be expanded by default, so expand it to see it's contents. It holds two sub groups, namely: 'Generic' and 'Area light options'.

Lets go through the 'Generic' properties first. Please note I will presume you know at least know some basics about POV-Ray during the chapter, so I will not be going to explain all these very POV-Ray specific options in detail. For the complete package I'll refer you to the POV-Ray website there you'll find some excellent documentation on all these options. Now on to the properties.

ShadowlessThis decides if light coming from this source will cause shadows when it hits obstacles. You usually want this kept at true, but this option is very handy when you have some 'dark spots' in your scene. Using this options you can lit those spots without creating unwanted additional shadow sources.
Fade over distanceBy default light keeps it's strength no matter how far it has to go. But in the real world you can expect e.g. a torch light to be any help at 100 meter distance. Enabling this option will introduce fading behaviour for this light's rays.
Fade powerThis controls how much the light fades over distance.
Fade distanceThis controls how much the light fades over distance.
Media attenuationThis decides if the light will be influenced by fog or atmospheric media. It's disabled by default, do note enabling this is only useful if you add things like fog to the POV-Ray scene.
Media interactionThis decides if light will interact with an atmosphere added to the scene. It's enabled by default.

Next group of properties are 'Area light options'. Using these options you can turn a 'normal' lightsource into an area light source. Do note area lights will slow down the rendering speed (considerably). The properties are:

EnabledEnable / disable the area light behavior for this light.
WidthArea light is simulated by using multiple light sources instead of a single one at the chosen light position. Think of it like a stadium light, these are giant panels holding a number of 'light bulbs' in organized in a grid. This option lets you set the width of that grid.
HeightThe height of the 'grid'.
Width densityNumber of lights in the grid's width.
Height densityNumber of lights in the grid's height.
Adaptive levelSee POV-Ray documentation.
JitterDetermines the amount of noise added to the placement of the lights in the grid. 0 will make a perfect grid.
CircularIf enabled the lights will be placed in a circle patern instead of a grid.
OrientKinda hard to explain, see the POV-Ray documentation for it's details.

Do note POV-Ray uses two fully three dimensional vectors for specifying the 'grid's size and position. But I decided to simplify this in LD4DStudio by only asking for a 'width' and 'height'. These values will be used to calculate the vectors POV-Ray wants in such a way the grid of lights will always be perpendicular to the light's direction.

You might have wondered why I started with a directional light object in explain the POV-Ray properties. This is because the 'Point lights' (first in list) have less options, it only has the 'Generic' group of options. So by explaining the directional light's POV-Ray options I also explained the point light's options.

Last light type with POV-Ray options is the spotlight. It has the 'Generic' and 'Spotlight options' sub groups. The 'Generic' group has been explained above so lets concentrate on the 'Spotlight options' group's properties.

Falloff percentageUse this to specify the 'outer' radius of a spotlight. This second 'radius' is larger and usually directly related to the normal radius, so you can specify it here using a percentage. By default it's 50% meaning the spotlight's falloff radius is 50% wider then the inner radius. So if you are using a radius of 30 degrees the falloff will be set to 45 degrees.
TightnessThis is used to 'soften' the edges between the radius and falloff areas.
CylinderIf you enable this light a spotlight will act like a cylinder instead of a cone.

The camera object's POV-Ray properties

Cameras also have some POV-Ray specific options you can set using the special 'POV-Ray' property group in any camera object. All camera types have the same options so select any camera object and expand it's 'POV-Ray' property group. It will contain the subgroup 'Focal blur', it's properties are:

EnabledThis controls if you want to apply focal blur to this camera. By default it's disabled resulting in a camera showing everything in focus no matter the distance.
ApertureControls the depth of sharpness zone.
Blur samplesControls number of rays used per pixel.
Focal pointControls the location this camera is focused on.
ConfidenceControls the adaptive function, see POV-Ray documentation.
VarianceControls the adaptive function, see POV-Ray documentation.

Using a dynamic focal point (controlled by an animation element) is something I'm planning to add in a future version. For now you can use these options to create some nice 'static' focal effects.

Starting an export

In order to export to POV-Ray utilizing all options LD4DStudio need to 'know' where to find the POV-Ray main program (exe) file. In most cases this will be automaticly detected by LD4DStudio upon first start. But if for any reason this information is not present or invalid, a warning message will be shown upon opening the POV-Ray export dialog. If this happens you should first adjust the configuration. See the configuration chapter for details.

A POV-Ray export can be started from any monitor window, by clicking the #6 button in the export part of it's toolbar (see below).

Export buttons

Clicking this button will open the below dialog, it presents a whole boatload of options you can use to tweak your export.

POV-Ray Export dialog

The main purpose of the POV-Ray export is generating a pov script file, this file will hold everything you need to render your animation or single frame in POV-Ray version 3.6 (or 3.7, but this is not officially supported jet). Optionally you can also generate an ini file with render options and / or a bat file for easy starting the rendering via POV-Ray.

Because there are quite a lot options for POV-Ray exports the dialog is divided in five pages. Every page controls some rough aspect of the export. All these options will be defaulted to the configuration settings when you first open this dialog for the current project. You can reload these default at any time by clicking the 'Default' button at the bottom right (This applies to all pages at once).

I know all these options can be 'scary' but most of them are very understandable, so the best thing to do is just going over them one at a time, page by page.

The conversion options

The first page (visible after just opening the dialog, see picture above) is about the conversion of the LDraw and LD4DStudio information into the base pov script.

First you select what to export using the 'Export range' selection box. This should be familiar from the other export dialogs.

In the second edit box you most supply the base export directory. This is the place all generated files will be placed. You can use 'variables' in this edit box (see the 'GIF Export' for explanation).

Next is the plain filename for the generated pov file. This field also allows for 'variables'.

Overwrite mode controls what will be done when a file already exists, this also has been discussed before.

'LDraw file conversion' controls how the needed LDraw files will be converted to POV-Ray objects. You can choose from 'Highlevel parts' and 'One on one conversion'. 'Highlevel parts' means a single (huge) object will be generated for every highlevel LDraw part (e.g. a 2x4 brick). 'One on one' means every LDraw file (.dat, .ldr) will be converted to it's own object in POV-Ray. The first approach results in bigger files but should render slightly faster. The second approach opens the door for quality enhancements by (third party) include files.

The checkbox 'Force ratio' can be used to let the script (by default) force the aspect ratio used in the monitor. If you leave this disabled the script will calculate an aspect ratio based upon the width and height of the current render settings in POV-Ray. You should leave this disabled and control a correct aspect ratio by setting the width and height in the 'Render options' page. But in some cases (like anamorphic DVD) you could be needing this option.

Next is 'background color' this controls the color of 'empty space' in the scene.

'Light multiplier' can be used to brighten the POV-Ray rendering slightly. This option is available because (in relation to the LD4DStudio previews) POV-Ray can be considerably darker while using the same lighting settings. Do note increasing above 1.0 can cause (ugly) 'overexposure', so you probably better of placing some additional POV-Ray only (point) lights in the scene (see the Light, camera and variables chapter).

'Color prefix' can be used to change the prefix used for materials. Every used LDraw color number is converted to POV-Ray material using this prefix and the original number, for example LDraw color 4 (red) will be defined in the pov script as 'color4'. You might want want (need) to change the prefix if you (e.g.) are using some third party color definition include file.

The last option 'Spring resolution' controls the quality of springs. This is completely independent from the resolution properties in the spring object itself. Springs in POV-Ray will always look much smoother even at the default value of 250 but you might consider setting it higher if you're planning to do extreme closeups at springs. A higher value will slowdown rendering though.

Include files

The second page gives you control over include files you might want to add to the generated pov file. To manage a collection of include files the page has an overview grid and a group of buttons whom let you manage the list of files.

POV-Ray Export dialog

Every file can be added or modified by using the three top edit boxes. First in this group is 'name' this is used to specify the source of an include file, you can browse for any file using the '...' button on the right of the field or just type the filename.

After choosing a file you need to select how this file will be referenced from the main script. You may choose from 'Free string', 'Copy to destination directory', 'Absolute reference' and 'Relative reference'. 'Free string' can be used for files POV-Ray should be able to find in it's default library or search path, like for ''. 'Copy to destination directory' will copy the given include file to the export location and the reference in the main script will be done on plain filename only. 'Absolute reference' will place the full filename and it's path in the reference. And finally 'Relative reference' will convert the filename to a somewhat portable file name. Do note both Absolute and Relative can break decencies when you move the main pov script to a different location.

The last option for an include file to be used it where to place it's reference. For this you can choose from a list with important 'places' in the generated script. Which of these options is best for you might need some experimenting. You probably first want to do a 'plain' export to inspect the generated pov script in order to decide where to place your include file's reference.

When all three options are set you can add this include file to the list by clicking 'Add'. It will appear in the list, afterwards you can change the three options for a next include file or you may modify the current selected include file to the options using 'Modify'. 'Delete' removes the current selected include file from the list (not disk). And 'Up'/'Down' can be used to order the include files to meet dependencies (Only useful for files who share a equal location setting).

Quality options

Third page is all about pov script based quality settings. In most cases you get by nicely using the defaults on this page. You probably only need to change something here if you want to create extremely high quality renderings. Or if you want to change the default value for some script control (constant) variable.

POV-Ray Export dialog

First option is 'Max trace level', this controls the recursive depth to be used while ray tracing your scene. Increase this value only if you seeing unexplained 'dark spots' in your renderings. See POV-Ray documentation for more information.

'Max intersections' controls a number of POV-Ray's internal stack sizes.

'Assumed gamma' controls the applied gamma correction to your renderings. Note this option has been moved to the 'ini' controlled options in POV-Ray 3.7 and might cause all kinds of warnings during rendering in POV-Ray 3.7 if different from it's default of '2.2'.

'Disable arealights' controls the default value for a script constant whom controls if area lights will be included or not. You can change this at any time after export by editing the 'consts' area of the pov script.

'Radiosity' controls if you want to enable POV-Ray's alternative radiosity lighting model. This model can result in more realistic renderings but will slow down rendering considerably. This option also can be changed by editing the 'consts' part of the pov script.

Next collection of options are all related to radiosity, and can only be edited if it's enabled. For their exact meaning I have to refer you to the POV-Ray documentation. They can explain it better then me.

Render options

Forth page concerns rendering options. These are different from 'quality options' because they can be set without changing the main pov script (usually using a ini file or command line parameters).

POV-Ray Export dialog

Tweaking this page can radically change the results of a rendering and also greatly influences the time needed for a rendering. Depending on your goals you might want a quick draft rendering or extreme quality rendering. In such a case it's up to you finding the best balance between quality and needed render time. But the default settings produce a nice quality in a acceptable render time suitable for most 'beginners'. So you usually only need to change something like the resolution on this page. But like always I'll go over all the options one by one.

First is 'Quality level', this affects the array of algorithms POV-Ray will include in rendering your scene. The can choose from 'level 0' trough 'level 11', higher being better and consequently causing rendering to slowdown. Default is 'level 11'. But when you are just testing e.g. composition you might want to use levels as low as '2'.

Next row of options controls the target picture(s) dimensions (resolution). First you choose if you want to force this at all. If you leave this disabled POV-Ray will use the resolution set in the current quickres.ini settings. If you enable this option you also need to provide the desired width and height in pixels of your target picture. While doing this you should keep the aspect ratio in mind. The width and height fields will be colored red if your current selection results in a aspect ratio whom differs to much from the one in the monitor. For easy access you can also use the 'dimensions' button to set width and height using a list of predefined resolutions (see below picture).

Picture dimensions dialog

You can add used resolutions (works basically the same as with the include files page) to this list for later (re)use in any project. The dialog also shows the resulting aspect ratio for any width height combination (top right) and listed predefined dimensions (between '( )').

Next option on the dialog is 'Picture format', this lets you choose the format of the pictures POV-Ray will render and save to disk for you. You can choose from 'System default (bmp)', 'targa (tga)', 'compressed targa (tga)' and 'PNG'. The default is 'bmp' and should be suitable for almost any post processing software, but it will cause large files. Both 'compressed targa' and 'PNG' will result in smaller files but might limit the number of programs you can use to combine and edit the resulting frames. Do note although smaller both of these formats are lossless, so no quality is lost only disk space will be saved.

'Color depth' lets you select the number of 'bits' you want to 'spend' per pixel in the picture files. Default is '24' meaning 'True color', but you could lower this when needed. For example: if the target video format only supports 16 bits, why waste rendering time on 24 at this stage.

The last collection of options all have to do with anti aliasing. If enabled this softens the hard edges between planes and along lines which are a result of the pixalization of your scene. For the complete story on this and the meaning of the remaining options I refer you to the POV-Ray documentation. But like always the default should be usable in most cases.

Launch options

The last page is about what to do with all the generated stuff and set options.

POV-Ray Export dialog

First you can optionally let LD4DStudio generate an INI file encapsulating the options set on the 'render options' page. This way you can later adjust or reuse them without using LD4DStudio itself. You enable generation of an INI file by checking the check box. Doing this will enable you to edit the 'name' field. Use this edit box to define the 'bare' filename, use of 'variables' is allowed. Additional to the settings controlled by the 'Render options' page you can add some custom 'ini' commands to the generated file, by typing them into the 'Custom content' field.

Next two options control generation of a 'bat' file. This can be handy in launching POV-Ray with instructions to render the exported animation in a single click (again) later on.

The last set of options can be used to automatically launch POV-Ray when the export is completed. If enabled POV-Ray will be launched and instructed to render the export confirm your set options. Do note by default POV-Ray will only do this as expected if it's not already running. So you usually want to close any open POV-Ray first. Below the main option for enabling this behavior you'll find the very last options, namely: 'Exit afterwards', enabling this will instruct POV-Ray to close when done rendering the scene.


Some of these options might still be a mystery, even after reading this whole chapter. So I suggest you just try some exports using the sample projects. Most of them are optimized for POV-Ray and should produce nice renderings even with all default options in place. This should provide you with the means to experiment tweaking the options.

Like said before, for most POV-Ray specific options you might also want to study the POV-Ray documentation on They can explain things way better than me. Most if not all POV-Ray specific options have identical naming in LD4DStudio. So if you want information on a specif thing, try using the site's search page using the option name as given on the export dialog.

14. Scripting | | 16. Library
Best viewed with Firefox 2, Seamonkey or IE 7 at 1024x768 or higher resolution.
LEGO is a registered trademark of the LEGO Group, which does not sponsor, endorse, or authorize this website.