Setup Projects from Command Line with XML
This feature is deprecated and will be removed in a future version. Use the LUA Script API to setup projects from command line.
ShaderMap allows project nodes and materials to be setup from command line using an XML script. The file passed to the command line must have the
extension .XML to work. Below is an example XML Command Line script that loads a single source Color Map and generates a Displacement Map from it:
<?xml version="1.0" encoding="utf-8" ?>
<shadermap_cl_setup>
<node_count v="2" />
<node_0 plugin="src_color_texture" file="C:\color_map.jpg" mask="C:\color_map_mask.png"
property_values="0;0;" row_col="0;0;" />
<node_1 plugin="map_diff_to_disp_2" inputs="0;"
property_values="0;21;100;20;20;0;96;96;99;1;5;0;0;1;1;0;" row_col="1;1;"
save_path="C:\color_map_mask_DISP" save_format="11" />
<material_count v="1" />
<material_0 plugin="0.standard" maps="0;1;#D;#D;" is_default="1" />
</shadermap_cl_setup>
The XML document must include the
shadermap_cl_setup section with
node_count and the
material_count tags inside. For every node
a
node_(NUMBER 0-N) tag must be included. Likewise for every material a
material_(NUMBER 0-N) tag must be included. Below is a list
and description of all node_# and material_# attributes. All attributes marked with * are required.
Tag <node_# />
- plugin * - The name of the node plugin. This is the name of the plugin binary file without the extension. For a complete list of included node plugin names, scroll down the page.
- file - If the node is a source map or source model then this is required. It is the full file path location of the file to use as source.
- mask - The file path to a Mask image associated with the map node.
- inputs - If the node requires inputs then this attribute is required. It sets a list of node ids to use as inputs. Node IDs are separated by semicolons. Input Nodes should already be defined.
- property_values - If the node has properties then a list of property values is listed. A special value of #D can be listed to force a default value. Property values are listed from top to bottom and are divided by a semicolon. For a list of allowed property types and values, scroll down the page.
- row_col - A list of two numbers representing the position of the node in the Project Grid. Row;Column;
- save_path - The file path to a save location for a map node. The filename should not have an extension on it.
- save_format - A number value representing the output format. To view a complete list of output formats, scroll down the page.
- cage - Only valid for plugin type 3d_model. It is the file path location to a 3D Cage Model.
Tag <material_# />
- plugin * - The name of the material plugin. This is the name of the plugin file without the extension. For a complete list of included material plugin names, scroll down the page.
- maps - If the material uses maps then list the map node IDs separated by a semicolon. The map node IDs are listed from top to bottom. A special value of #D can be used to force a default map to be passed to the material.
- is_default - If set to 1 then the material is applied to all default geometry in the Material Visualizer.
Node Plugin Names:
Name | Description |
3d_model | A source 3D Model |
|
|
src_color_texture | Source Color Map / Texture |
src_disp_map | Source Displacement Map |
src_norm_map | Source Normal Map |
|
|
map_blank_norm | Blank Normal Map |
map_blend | Blend Map (A, B) |
map_blend_norm | Blend Normal Map (A, B) |
map_diff_to_albedo | Albedo (Diffuse) |
map_diff_to_disp | Displacement (Diffuse) - Deprecated |
map_diff_to_disp_2 | Displacement (Diffuse) |
map_disp_to_ao | Ambient Occlusion (Displacement) - Deprecated |
map_disp_to_ao_2 | Ambient Occlusion (Displacement) |
map_disp_to_dudv | DUDV (Displacement) |
map_disp_to_norm | Normal Map (Displacement) - Deprecated |
map_disp_to_norm_2 | Normal Map (Displacement) |
map_disp_to_spec | Specular (Displacement) |
map_model_to_ao | Ambient Occlusion (3D Model) |
map_model_to_color_id | Color ID (3D Model) |
map_model_to_curve | Curve Map (3D Model) |
map_model_to_disp | Displacement (3D Model) |
map_model_to_ts_norm | Tangent Space Normal Map (3D Model) |
map_model_to_ws_norm | World Space Normal Map (3D Model) |
map_norm_to_cavity | Cavity (Normal Map) |
map_norm_to_curve | Curve (Normal Map) |
map_norm_to_disp | Displacement (Normal Map) |
map_norm_to_norm | Normal Map (Normal Map) |
Material Plugin Names:
Name | Description |
0.standard | Standard Material |
01.displace | Displacement Material |
1.parallax | Parallax Offset Material |
2.cel | Cell Shading Material |
Property Type Values:
Property Type | Value Description |
Page List | An integer in a zero based index representing the selected list item. Always the first property. A page list will modify the properties underneath it. Ex. Map nodes with two rendering modes use Page List properties. |
File | A full file path to the file location. |
Checkbox | 0 for unchecked, 1 for checked. |
List | An integer in a zero based index representing the selected list item. |
Numberbox | Either an integer or floating point value, depending on the type set. |
Colorbox | A color packed into a 32 bit unsigned integer. Each color channel is a byte packed into the first 24 bytes in order R (0), G (8), B (16). See the Windows RGB Macro. |
Slider | An integer number representing the position of the slider. |
Coordinate System | An unsigned integer where X, Y, and Z directions are combined with a bitwise OR operator. Below are the direction definitions:
- MAP_COORDSYS_X_POS_LEFT 0x00000001
- MAP_COORDSYS_X_POS_RIGHT 0x00000002
- MAP_COORDSYS_Y_POS_UP 0x00000004
- MAP_COORDSYS_Y_POS_DOWN 0x00000008
- MAP_COORDSYS_Z_POS_NEAR 0x00000010
- MAP_COORDSYS_Z_POS_FAR 0x00000020
|
Output File Formats:
ID | Description |
0 | MAP_FORMAT_BMP_INDEX_8 |
1 | MAP_FORMAT_BMP_RGB_8 |
2 | MAP_FORMAT_BMP_RGBA_8 |
|
|
3 | MAP_FORMAT_DDS_DXT1 |
4 | MAP_FORMAT_DDS_DXT3 |
5 | MAP_FORMAT_DDS_DXT5 |
|
|
6 | MAP_FORMAT_JPEG |
|
|
7 | MAP_FORMAT_PCX_INDEX_8 |
8 | MAP_FORMAT_PCX_RGB_8 |
|
|
9 | MAP_FORMAT_PNG_INDEX_8 |
10 | MAP_FORMAT_PNG_RGB_8 |
11 | MAP_FORMAT_PNG_RGBA_8 |
12 | MAP_FORMAT_PNG_RGB_16 |
13 | MAP_FORMAT_PNG_RGBA_16 |
|
|
14 | MAP_FORMAT_PSD_INDEX_8 |
15 | MAP_FORMAT_PSD_RGB_8 |
16 | MAP_FORMAT_PSD_RGB_16 |
|
|
17 | MAP_FORMAT_TGA_INDEX_8 |
18 | MAP_FORMAT_TGA_RGB_8 |
19 | MAP_FORMAT_TGA_RGBA_8 |
|
|
20 | MAP_FORMAT_TIF_RGB_8 |
21 | MAP_FORMAT_TIF_RGBA_8 |
22 | MAP_FORMAT_TIF_RGB_16 |
23 | MAP_FORMAT_TIF_RGBA_16 |
|
|
24 | MAP_FORMAT_EXR_16F |
25 | MAP_FORMAT_EXR_RGB_16F |
26 | MAP_FORMAT_EXR_RGBA_16F |
27 | MAP_FORMAT_EXR_32F |
28 | MAP_FORMAT_EXR_RGB_32F |
29 | MAP_FORMAT_EXR_RGBA_32F |
|
|
30 | MAP_FORMAT_HDR_RGB_32F |