Table of Contents
Blender PhotoCreator
The Blender PhotoCreator reads in processed IGXC or OC files into Blender and creates renderings.
Requirements
Installed Blender version.
Make sure Blender Gui language is set to english
Make sure to have access to the IG.Graphics.Data.Tools (Tools) repository. If not ask the admin for help.
Inside this repository go to Importers/Blender
For correct rendering following files are required:
- PhotoCreator/BlenderVersion/CameraPosition.py
- PhotoCreator/BlenderVersion/CollectionHandling.py
- PhotoCreator/BlenderVersion/PhotoCreator.py
- PhotoCreator/BlenderVersion/PhotoCreator.blend
- Shared/BlenderVersion/IGMaterialMapping.py
- Shared/BlenderVersion/IGVelvet.py
- Shared/BlenderVersion/IGXCImporter.py
- Shared/BlenderVersion/OCImporter.py
- Shared/BlenderVersion/NormalMapCombine.py
- SceneExporter/BlenderVersion/SceneExporter.py
For correct rendering the CTM-Importer from Tools/Importers/OpenCTM/BlenderVersion must be installed as Addon in Blender.
How To
Setting up the structure
On your PC, create a folder called: Blender_PhotoCreator
Into this folder copy the listed python and blend files from the Requirements section.
Blender_PhotoCreator │ ├── PhotoCreator.blend │ ├── CameraPosition.py │ ├── CollectionHandling.py │ ├── PhotoCreator.py │ ├── IGMaterialMapping.py │ ├── IGVelvet.py │ ├── IGXCImporter.py │ ├── OCImporter.py │ ├── NormalMapCombine.py │ ├── RenderSettings.py │ └── SceneExporter.py
An index.txt file is required as well.
See the next topics for more details:
OC Zip
In case using an OC zip (downloadable from IG.Creator), unpack this file into a folder, first.
Secondly, inside the unpacked folder, create an index.txt file.
Open the index.txt file and write the file path to the scene.json inside the file.
<SomePath>\scene.json
Copy the index.txt file into the Blender_PhotoCreator directory.
IGX2GO
In case using an IGX2Go zip (downloadable from IG.Creator), unpack the zip file into a folder, first.
Secondly, inside the unpacked folder, create an index.txt file.
Open the index.txt file and write the file path of the Scene.igxc into this file.
<SomePath>\scene.json
Copy the index.txt file to the Blender_PhotoCreator directory.
IG.GFX.PhotoCreator
In case using the IG.GFX.PhotoCreator follow it's instruction to get the assets and scene descriptions first.
The IG.GFX.PhotoCreator creates a folder called Photos. Inside this folder there is an index.txt file.
Copy the index.txt file to the Blender_PhotoCreator directory.
Starting the Rendering
Inside Blender
Open the PhotoCreator.blend file in the Blender_PhotoCreator folder.
On the left side, there is a big empty area. Here the PhotoCreator.py can be opened.
Open the PhotoCreator.py file.
To run the rendering, press the Play button in the text editor or run it with the shortcut Alt+P. (The mouse must be inside the text editor area!)
The assets are loaded inside Blender and the rendering is started automatically.
Keep in mind, the rendering will take some time and Blender will not be able to answer during this task!
The saved image can be found inside the Bender_PhotoCreator/Render folder
From Commandline or Terminal
To run the Blender PhotoCreator inside the Commandline or Terminal best is to create a batch or shell script. (Depends on OS)
Name the script create and save it inside the Blender_PhotoCreator folder.
Inside this script define the following commands:
See Environment Variable
Windows
REM BLENDER -> environment variable to your installed blender verison %BLENDER% -b ./PhotoCreator.blend -P ./PhotoCreator.py
Linux or MacOS
# blender -> environment variable to your installed blender verison blender -b ./PhotoCreator.blend -P ./PhotoCreator.py
Run the file and wait until it finished.
The saved image can be found inside the Render folder.
Env.json
This file can be provided optionally with a scene description and holds blender render settings.
This file can be set for all scene files individually or can be defined as a global env.json
For individual usage the scene file and env file names must follow this naming convention:
Test-scene.igxc
Test-env.json
→ Both files need to have the same prefix (e.g. Test), followed by -scene or -env.
To use a global env.json. add the ENVIRONMENTPATH variable to the batch/shell create file and give it a directory+env.json
Windows
set ENVIRONMENTPATH=<someGobalPath>/global-env.json
Linux or Mac
export ENVIRONMENTPATH=<someGobalPath>\global-env.json
Environments
An Environment is a virtual world around the imported scene.
The id must be entered in the json file controlled by the IG.GFX.PhotoCreator or can be added manually inside the env.json
Follwing environments are defined:
- ? - Use as prefix for all following environments. If “?” is added to the environment, the image is rendered as preview with less samples and 50% pixel resolution.
- “01” - transparent background
- “02” - matt white background
- “03” - glossy white background
- “04” - matt white background without shadow
- “05” - transparent background without shadow
- “06” - matt white with xyz axis
- “07” - matt light gray background
- “igo” - preview with 100% pixel resolution
Cameras
Customizable Cameras
Camera positions (eye and target) can be set exteranlly in the Photo.json file.
The rotation is calculated automatically from the positions.
Default Cameras
Instead of using a customizable camera, it is possible to use an automatically posed camera.
The camera is placed, depending on the object's bounding box, at the following positions:
- FrontRight
- FrontLeft
- FrontCenter
- TopCenter
The positons are defined through the IG.GFX.PhotoCreator parameters appearing when the IG.GFX.PhotoCreator is started without parameters.
Additional Parameters
Additional parameters can be used within the create file inside the Commandline or Terminal.
The following parameters can be used to have extra control for the photo rendering process:
- IGPCOUTDIR (Default: None): specify this inside the batch/shell script to define another output directory. The default directory is ./Render
- ENVIRONMENTPATH: specify this to enable the usage of a globally defined *-env.json. See the section Env.json for more details.
- COLORMANAGEMENT: specify this to enable filmic color look for renderings. Values are True or False
Known Issues
Linux
Error: the drivers are not activated proparly