User Tools

Site Tools


ig:gfx:assetloader

IG.GFX.AssetLoader

The IG.GFX.AssetLoader is a tool, to upload Assets into the Creator

Getting the IG.GFX.AssetLoader

The IG.GFX.AssetLoader is located inside the IG.Graphics.Data.Tools repo. Ask the admin for access if needed. Save the latest Zip Version on your PC and unzip it.

Setting up the IG.GFX.AssetLoader

Running the IG.GFX.AssetLoader for the first time

As soon as the Zip is unpacked, the execution file can be run from the command line or the terminal.

Open a command line or terminal inside the IG.GFX.AssetLoader folder and run the excecution file by typing it into the command line:

Command for Windows cmd

 <SomePath>\IG.GFX.AssetLoader> AssetLoader.exe 

Command for Linux or Mac terminal

 <SomePath>/IG.GFX.AssetLoader> mono AssetLoader.exe 

Because nothing is setup, the program will return all available parameters.

Command Line Arguments:
        -service=<SERVICE> - Address of the IG.GFX.AssetServer incl. protocol prefix, required
        -address=<ADDRESS> - Address of the IG.GFX Database, relative to the AssetServer, no protocol prefix, optional. Default: localhost
        -domain=<DOMAIN> - IG.GFX Domain, required
        -subdomain=<SUB DOMAIN> - IG.GFX Sub Domain, required
        -user=<USER> - User Id, deprecated. Use environment variable IG_GFX_USER instead.
        -password=<PASSWORD> - Password, deprecated. Use environment variable IG_GFX_PWD instead.


        -asset=<MODE> - The AssetLoader mode, one of the following, default: Geometry
                Geometry: Upload of Standard IG.GFX Geometry Files
                Texture: Upload of Standard IG.GFX Texture Files
                Material: Upload of material definitions
                OFMLMaterial: Upload (and conversion) of OFML material definitions
                Preview: Upload of product preview images
                PbrTexture (XXXLTexture): Upload of special PBR Texture Files
                IGMatDatabase: Upload of Materials to IG.MAT Database
                ActiveOnline: Upload of Materials and Textures, based on ActiveOnline format
                IGXD: Upload of Products, Geometries and Materials based on IGXD
        Note. In some asset modes, some settings are ignored or do not apply.


        -resolution={All, Standard, HighRes, LowRes, Preview} - The resolution(s) to be considered, default: All
        -format={All, CTM, FBX, OBJ, 3DS, DWG, OFF, ODB (3DS + DWG + OFF), JPEG, PNG} - The format(s) to be considered, specific to Asset type! Default: All
        -geometry-prefix=<PREFIX> - Optional prefix for geometry assets.
        -material-prefix=<PREFIX> - Optional prefix for material assets.
        -texture-prefix=<PREFIX> - Optional prefix for texture assets.
        -no-ofml-scope-prefix - Skip OFML Scope prefix *_D2/3_
        -reset-geometries - Before any upload, delete all geometries incl. their files.
        -synchronize - After upload of the files of an asset, remove all deprecated files. Currently only supported for Geometry.
        Note. Works only if there's at least one file in the asset on client side.
\t-checkUV1 - Checks availability of UV set 1 (Tile UV) on the provided geometries
with the formats OBJ and/or OpenCTM and adds $UV1 to the end of the geometry description if it is missing in at least one of them
\t-normal-strength=<VALUE> - Injects the specified value as geometry parameter
Normal Map Strength for each geometry that will be uploaded. <VALUE> must be number from 0.01 to 100.0, 1.0 is regular strength.
        -material-index=<FILE> - path to specific material index file (XXXLTexture only)
IG.MAT Mode:
        -supplier=<SUPPLIER> - The supplier name. If not provided, it will be taken from the directory.
        -auto-register - In case the material is not known in the IG.MAT DB, register it via the info.json
        -auto-register-update - like above, but update registration information.
        -auto-accept - Set the Material's status after upload to Available.


IGXD Mode:
        -catalog-id=<IDM Catalog ID> - This id will be used as prefix for the IDM product identification.


        -source=<SOURCE DIRECTORY> - Absolute or relative path to the source directory, otherwise the current directory
        -recurse - Recursive processing of sub directories
        -no-new-assets - Do not create Assets but add Files
        -no-new-files - Do not create Files but update them
        -auto-material - In Texture Mode, automatically created Materials too
        -log-file=<FILE> - Log to specified file, otherwise to console.
        -log-details - Log details
        -copyright=<COPYRIGHT> - Copyright information to be added to JPEGs and PNGs.
        -simulate - Simulate the activities but do not change the database


        -help or ? - Print this information.


[WARNG] Asset Mode unset or invalid. Using default: Geometry
[INFO_] Asset Loader Mode: Geometry
Specify the service using the -service option
[ERROR] Specify the DB credentials: -address, -domain, -subdomain, and user and password via environment or cmd line
[WARNG] Resolution unset or invalid. Using default: All
[WARNG] Format unset or invalid. Using default: All
[ERROR] Please specify valid used and password. For help use option "-help" or "?"

Running the IG.GFX.AssetLoader inside a project with batch or shell

The IG.GFX.AssetLoader can be used inside a geometries.bat/sh or a textures.bat/sh file. To run the IG.GFX.AssetLoader you need to link to the programm itself and specify the global parameters. This is done through an (environment) variable either in the system or inside the batch/shell script. Additionaly a server address, to where the assets are uploaded, is needed too. As last, a lizence for uploading assets is needed. The lizence is unlocked by the administrator. To verify yourselfe a user and password is needed.

for Windows

REM Path to IG.GFX.AssetLoader executable
SET IG_GFX_ASSET_LOADER=<SomePath>/IG.GFX.AssetLoader/AssetLoader.exe
REM Address to where the assets are uploaded
SET IG_GFX_ASSET_SERVICE=https://ig5.intelligentgraphics.biz/Creator/cr/Asset/

REM user login
SET IG_GFX_USER=SomeUser
SET IG_GFX_PWD=SomePassword

for Linux or Mac

# Path to IG.GFX.AssetLoader executable
IG_GFX_ASSET_LOADER=<SomePath>/IG.GFX.AssetLoader/AssetLoader.exe
#Address to where the assets are uploaded
IG_GFX_ASSET_SERVICE=https://ig5.intelligentgraphics.biz/Creator/cr/Asset/
 
# user login
IG_GFX_USER=SomeUser
IG_GFX_PWD=SomePassword

These files are saved inside a project folder. Next to them, this folder structure can be build up:

Project
    Geometries
    Textures
    geometries.bat
    textures.bat

To upload either geometries or textures the batch or shell scripts needs to be run inside the command line or terminal.

Setting up geometries.bat/sh

These are the basic setups to upload geometries into the IG.Creator. Have a look into the parameters from the first call, to see a description or add extra parameters.

for Windows

REM Path to IG.GFX.AssetLoader executable
SET IG_GFX_ASSET_LOADER=<SomePath>/IG.GFX.AssetLoader/AssetLoader.exe
REM Address to where the assets are uploaded
SET IG_GFX_ASSET_SERVICE=https://ig5.intelligentgraphics.biz/Creator/cr/Asset/

REM user login
SET IG_GFX_USER=SomeUser
SET IG_GFX_PWD=SomePassword
 
%IG_GFX_ASSET_LOADER% -service=%IG_GFX_ASSET_SERVICE% -address=localhost -domain=IG -subdomain=Test -user=%IG_GFX_USER% -password=%IG_GFX_PWD% -asset=Geometry -format=All -source=Geometries -log-details -log-file=geometry.log

for Linux or Mac

# Path to IG.GFX.AssetLoader executable
IG_GFX_ASSET_LOADER=<SomePath>/IG.GFX.AssetLoader/AssetLoader.exe
#Address to where the assets are uploaded
IG_GFX_ASSET_SERVICE=https://ig5.intelligentgraphics.biz/Creator/cr/Asset/
 
# user login
IG_GFX_USER=SomeUser
IG_GFX_PWD=SomePassword
 
$IG_GFX_ASSET_LOADER -service=$IG_GFX_ASSET_SERVICE -address=localhost -domain=IG -subdomain=Test -user=$IG_GFX_USER -password=$IG_GFX_PWD -asset=Geometry -format=All -source=Geometries -log-details -log-file=geometry.log

Setup textures.bat/sh

These are the basic setups to upload textures into the IG.Creator. Have a look into the parameters from the first call, to see a description or add extra parameters.

for Windows

REM Path to IG.GFX.AssetLoader executable
SET IG_GFX_ASSET_LOADER=<SomePath>/IG.GFX.AssetLoader/AssetLoader.exe
REM Address to where the assets are uploaded
SET IG_GFX_ASSET_SERVICE=https://ig5.intelligentgraphics.biz/Creator/cr/Asset/

REM user login
SET IG_GFX_USER=SomeUser
SET IG_GFX_PWD=SomePassword
 
%IG_GFX_ASSET_LOADER% -service=%IG_GFX_ASSET_SERVICE% -address=localhost -domain=IG -subdomain=Test -user=%IG_GFX_USER% -password=%IG_GFX_PWD% -asset=Texture -format=PNG -source=Textures -log-details -log-file=texture.log -recurse 

for Linux or Mac

# Path to IG.GFX.AssetLoader executable
IG_GFX_ASSET_LOADER=<SomePath>/IG.GFX.AssetLoader/AssetLoader.exe
#Address to where the assets are uploaded
IG_GFX_ASSET_SERVICE=https://ig5.intelligentgraphics.biz/Creator/cr/Asset/
 
# user login
IG_GFX_USER=SomeUser
IG_GFX_PWD=SomePassword
 
$IG_GFX_ASSET_LOADER -service=$IG_GFX_ASSET_SERVICE -address=localhost -domain=IG -subdomain=Test -user=$IG_GFX_USER -password=$IG_GFX_PWD -asset=Texture -format=PNG -source=Textures -log-details -log-file=texture.log -recurse 

Additional to the textures upload, the asset server can tell the database to automaticaly add materials as long as they don't exist. This is done with the -auto-material parameter.

:!: Textures and materials will have the same name than. To differ between both a material and textures prefix from the parameters list can be added as well. :!:

for Windows

%IG_GFX_ASSET_LOADER% -service=%IG_GFX_ASSET_SERVICE% -address=localhost -domain=IG -subdomain=Test -user=%IG_GFX_USER% -password=%IG_GFX_PWD% -asset=Texture -format=PNG -source=Textures -log-details -log-file=texture.log -recurse -auto-material

for Linux or Mac

$IG_GFX_ASSET_LOADER -service=$IG_GFX_ASSET_SERVICE -address=localhost -domain=IG -subdomain=Test -user=$IG_GFX_USER -password=$IG_GFX_PWD -asset=Texture -format=PNG -source=Textures -log-details -log-file=texture.log -recurse -auto-material

Material setups.json for textures

To speed up the material creation a setup.json can be created. The usage of this requries the IG.GFX.AssetLoader version 1.1.15 or higher. This setup.json holds information how to set the material parameters and assigne metamaterials.

:!: This file only works in case the -auto-material parameter is added inside the textures.bat/sh :!:

folder structure

Project
    Textures
        cordBlue.tex
        cordRed.tex
        fabric.Blue.tex
        setups.json
    textures.bat
    
{
	"$schema": "https://archive.intelligentgraphics.biz/schemas/gfx/material.json",
	"mapping": {
		"cord*": "MetaMaterialId"
	},
	"setups": {
		"MetaMaterialId": {
			"metaMaterial": "Fabric_Rough",
			"specular": {
				"red": 0.5,
				"green": 0.5,
				"blue": 0.5
			},
			"shininess": 1
		}
	}
}
  • $schema: Link to the schema json that supports writing the file.
  • mapping: List of textures from the textures folder that should get a specific meta material from the setups section. The keys can be full strings or shorten by a *
  • setups: List of all meta material setups.
  • mataMaterial: The meta material specified inside the IG.Creator.
  • specular: The specular color for all the materials.
  • shininess: The shininess for all the materials. Default is 1. The higher the number, the higher the shine.

While using the setups.json, the source inside the textures.bat is usually set to -source=Textures. This indicates the program to use the Textures folder. Next to this parameter value there can be a supplier sources. E.G.: -source=SupplierTexture
This activates an other Assest Loader mode that does pre-conversion to the uploaded files.
Following SupplierTextures are supported:

SchnellTexture:

Texture upload for texures provided by Schnell Media.

Name conventions: MaterialName_TextureKind Minimum folder structure:

Textures
  │  ├── MaterialName
  │  │ ├── MaterialName_Diffuse.jpg
  │  │ ├── MaterialName_Normal.jpg
  │  │ └── MaterialName_Glossiness.jpg

Texture kinds:

  • *_Diffuse.jpg
  • *_Glossiness.jpg
  • *_Normal.jpg
  • *_Specular.jpg

:!: Note: Delta maps are not supported! :!:

3CTexture:

Texture upload for texures provided by Schnell Media.

ig/gfx/assetloader.txt · Last modified: 2024/04/04 08:04 by 127.0.0.1