Material Libraries

Tutorial 8 in the Basics of Twilight Render V2 Series

Twilight Render material editing has always been straightforward and simple to use by using Templates to represent different categories of materials.  Using the Deep Editor, Pro users can take materials much further by creating custom materials.  In addition to this, Twilight Render has always provided a way to use existing packages of materials, called Material Libraries.  Material Libraries contain Twilight Render materials that are usually unique or special purpose, often created by members of the Twilight Render community. Because Twilight Render is built on the Kerkythea render engine, the material libraries available for Kerkythea can also be used for Twilight Render!  Both Twilight Render V2 Hobby and Pro support material libraries.  Licensed Pro users can even edit existing libraries or create their own!

education

 

The use of Material Libraries in Twilight Render has evolved over the years.  In V1, libraries were preloaded from a fixed file folder, and only the name of the material (and the library it came from) was stored in the SketchUp model.  While this was fairly simple to use, it was also very limited.  Shared SketchUp models required the receiving user to have all the same material libraries in order to correctly render the model.  Libraries could not be edited within Twilight Render; users had to use the legacy Kerkythea editor which can be cumbersome and confusing.  Additionally, all libraries had to be loaded by the render engine up front whether the user needed them or not, which consumed considerable memory resources.

Beginning with V2, Twilight Render significantly changed the use of material libraries.  Instead of relying on the render engine, Twilight Render took over all management of libraries internally.  This allows users to edit and create their own custom material libraries and removed the need to pre-load libraries in the render engine.  It also allows Twilight Render to store material data directly in the SketchUp model whenever a user imports a material from a library, allowing that model to be shared without worrying about sharing the material library with it.

As management of material libraries has matured, there have been a few variations in how users interact with libraries.  This tutorial is intended to give you the most up to date information on how to import materials, edit those materials, and export materials to existing or new libraries.

Importing

import

Using a material library starts with importing.  The material data stored in a material library is read by Twilight Render, stored in the SketchUp model, and used when rendering.  Importing is available from both the Template Material editor and the Deep Material editor, under Tools -> Import Library.

warning Important: Material information is stored inside a SketchUp material.  Before you can import material data, you must choose a SketchUp material that will store the new library information and use it during rendering.  By importing material data, you will be erasing all Twilight Render material data previously stored in the selected SketchUp material!

 

Once you have selected 'Import Library', the Library Import window will open.  Note that you may get a warning popup asking you to confirm that you want to replace the current material data with new material information.  You must hit 'Yes' to continue.

lib importer

The Material Library Import window opens with a list of available material libraries.  Twilight Render V2 comes installed with a set of material libraries (found under the Legacy folder of the Twilight Render V2 install directory).  These are the exact same libraries that were installed with V1 and include a variety of architectural, metal, and plastic materials, among others.  In addition, if you had Twilight Render V1 previously installed for SketchUp, any other material libraries installed for V1 will also be available.  We will show you further on how to add new libraries to the list.

To see what materials are included in a library, simply click on a selection in the list on the left side.  The available materials will appear in the main display list.

lib import select

If the material library has been properly made, you should see a nice preview of each material in the library.  Note that previews may be missing for some libraries in which case they will be replaced with a placeholder image.

Once you have found the material you want to use, select it and click 'Import'.  The imported material will be saved into your SketchUp scene and the new material information will be used in your render.  It's as simple as that!

Now, depending on whether you are using a licensed version of Twilight Render Pro or using the Hobby version, how the imported material is displayed will be different. 

If you are using the Hobby version, the Template Material editor will render a preview of the new material, just like normal.  Instead of editing controls, however, you will see a message that your selected material can only be edited using the Deep Material editor, available only to licensed Pro users.  You must upgrade to Twilight Render V2 Pro to make any edits to an imported material.

If you are using a licensed Pro version, the Deep Material editor will automatically open (unless it was already open) and your imported material data will be displayed in the editor.  From there you can make any edits to the imported material.  Note that any edits you make will only affect your current SketchUp scene; edits do not affect the original material library!

Importing is very simple and can open up a lot of very unique and useful materials.

So now, how do you add new material libraries...?

Adding Material Libraries

Material libraries are available from several locations on the internet.  We recommend libraries available from our user forum (obviously) as well as libraries from the Kerkythea website.  Please note that we can not maintain, repair, or update any libraries from any place (including the Kekythea website) other than our forum and website.  Libraries can (and some do) contain badly created materials, enormous texture files, and other issues that make the library difficult or impossible to use.

Once you have downloaded a material library, you need to decide where to put it.  Unlike V1, where libraries where required to be in a specific system folder, you can place your libraries anywhere, and organize them however you like.  For best performance, we recommend placing material libraries in an easy-to-find location, in a folder separate from other files.  On Windows, a location like "C:\Users\your user name\Documents\Twilight_Materials" would work great.

Place your download library in the folder you have chosen.  If your library is a ZIP file (the file extension is .zip), you must unzip the file before you can use it!  Typically on Windows, right click and choose 'Extract All'.  On OSX, typically you can double click the file to extract it.

import dir

 

That's all it takes to get the material library ready to use.  But before we can use it, we have to tell Twilight Render where to find it.  To do that, we go back to SketchUp, click on Extensions -> Twilight Render V2, and choose Options.  In the Options window, select Directories.

import paths

On this Option's page, you can add multiple folder locations where Twilight Render will search for Material Libraries.  To add a folder, click on the '+' button, navigate to the folder and select it.  To remove a folder, select it from the list and click the 'X' button.

warning   Twilight Render will search through all the subdirectories / subfolders of the folders you add.  If you organize your materials into subdirectories, such as 'Metal', 'Wood', 'Kerkythea', etc. you only need to add the main folder, not each subfolder separately.  However, do yourself a favor, do not select a directory the has a lot of unrelated files in it (such as 'C:' or 'C:\your user name\Documents'); this will cause Twilight Render to search through all the files in those folders and may take an excessive amount of time (or even cause SketchUp to crash).

Now the next time you open the Material Import window, any material libraries in the newly added directories (and subdirectories) will be available.

Editing

Editing imported materials requires the Deep Material editor, available only to licensed Pro users.

This tutorial is not intended to show how to use the Deep Material editor (the Deep Material Editor guide can be found here).  However, it is worth noting that using imported materials is a great way to get started with editing your own, as well as leveraging existing materials as a basic starting point.

As mentioned above, if you are a licensed Pro user, the Deep Material editor will automatically open after importing a material.  From there you can make any tweaks or changes necessary.  As also mentioned above, remember that any changes you make will not affect the original material library.

Exporting

Now that you know how to bring materials into SketchUp, let's show you how to export them out.  Exporting requires the Deep Material editor and is only available to licensed Pro users.

First, open your material in the Deep Material editor.  Then select 'Tools -> New Export'.  As the name implies, this will create a new material library, and add our material to it.  When asked, navigate to a good location (probably the folder you set up to store your Twilight Render materials above!), and enter the name of the new material library.  Please note that the new file must end with the '.xml' file extension.  Select 'Save' and your material will be added to a new material library.  Please note, if you choose an existing material library, the previous data in that library will be erased!

To add a material to an existing material library, choose 'Tools -> Add Export'.  When asked, navigate to the existing material library (it will be a file ending in the .xml extension) and click 'Open'.  Your material will be added to the existing material library.  Your material should not overwrite any existing materials in the library, even if they share the same name.  Please note, it may be necessary to restart SketchUp in order to see changes to existing material libraries in the Material Importer.

When exporting a material (to a new library or existing), the name your material is saved under is always the name of the first node under Root -> Materials, in the Deep Material editor.

import name

 

It's also important to note that the Preview image saved in the library is whatever was last displayed for that material in the Deep Material editor.

That's all there is to it.  Once you get your work environment set up with the right directories, you will find it is incredibly simple to add and use any of the many available material libraries for Twilight Render.

Friday, January 20, 2017

We use cookies for the basic operation of our website and forum. To continue using this site normally, please accept the use of cookies. .