- Download the latest release.
- Open Blender and go to Edit → Preferences → Add-ons → Install.. (or → "∨" → Install from Disk..)
- Navigate to the downloaded ZIP file.
- Select
Install Add-on from File... - Optionally configure the Preferences of the Add-on.
- The Add-on is now installed and available in the
Propertiescontext menu in theScenetab.
Notes
- in Blender, print output is sent to system console, not to the Python console. Go to Window → Toggle System Console to open it.
- Blender 3.6 or 4.2+ or 5.0+
- ImageMagick (Windows/macOS/Linux) is needed for Super-Sampling
- fshgen for converting render output to SC4Model files (see below)
The Add-on panel is available under Properties → Scene → BAT4Blender.
-
Render Engine: Choose
Cyclesas Render Engine (Properties → Render). -
Setup: Configure the
WorldandCompositingsetup once. This loads the relevant data from the linked asset library. -
Day/Nightcollections: This is an easy way to hide some objects for the day or for the night render.- Create collections named
DayandNight(orNight.001etc.) and place your objects inside them. These collections are enabled/disabled automatically by BAT4Blender when switching between day and night.
- Create collections named
-
Night lights using Drivers (advanced): As an alternative to the
Day/Nightcollections, you can customize the night renderings using Drivers:- Right click on the
Day | MN | DNpanel and Copy as New Driver. - Right click on any property that should depend on the day/night state (e.g. Strength of a light source, or Disable in Render button) and Paste Driver.
- Right click the property and Edit Driver.
- Set Type to Scripted Expression.
- Adjust the Expression. Examples:
2.5 if night else 10.0for a Float valuenot nightfor a Boolean value1.5 if night == 2 else 2.5 if night == 1 else 10.0to distinguish between DN, MN and Day
- Copy the driver to any other property that should use the same expression.
- Right click on the
-
Super-Sampling (Properties → Scene → BAT4Blender): Enable this to render images at 2× resolution for sharper results (requires ImageMagick). As this means you render 4 times as many pixels, you may decrease the Max Samples to 25 % of your previous setting or increase the Noise Threshold (Properties → Render → Sampling) to keep the rendering time the same. Afterwards, the image is down-sampled back to the original 1× resolution, which increases the sharpness of the image.
-
Post-Processing (Properties → Scene → BAT4Blender): Enable this to automatically convert the exported LODs (OBJ files) and rendered images (PNG files) to an SC4Model file (requires fshgen). (Currently, the XML file gets generated as a separate file. You need to manually add it to the SC4Model file, using a tool like ilive's Reader.)
-
Preview: After the preview render result is complete, make sure to select the Composite image (instead of View Layer) to see the result. (Otherwise, e.g. nightlighting might not be visible.)
-
Click "Render all zooms & rotations" to render images and export LODs. They are saved in your current working directory from which Blender was launched.
- alpha version (camera positioning, LOD creation, rendering of small objects)
- slicing of rendered images if larger than 256 px
- slicing of LODs
- uv-mapping of LODs
- zoom-dependent LODs
- renderer settings (lighting/shading/materials/…)
- nightlights
- Day/Night collections
- darknite settings
- HD rendering
- conversion of LODs to S3D: Using fshgen:
This is executed automatically if Post-Processing is enabled (see above).
# Day only fshgen import --output model.SC4Model --force --with-BAT-models --format Dxt1 --gid 0xffffffff *.obj *_Day.png # Maxis Night and Dark Night fshgen import --output model-MN.SC4Model --force --with-BAT-models --format Dxt1 --gid 0xffffffff *.obj *_Day.png *_MN.png fshgen import --output model-DN.SC4Model --force --with-BAT-models --format Dxt1 --gid 0xffffffff *.obj *_Day.png *_DN.png # Alternatively, append MN/DN textures to existing SC4Model files fshgen import --output model-MN.SC4Model --append --format Dxt1 --gid 0xffffffff *_MN.png fshgen import --output model-DN.SC4Model --append --format Dxt1 --gid 0xffffffff *_DN.png
- showing progress while rendering: Go to the Rendering workspace to see the current image. Press ESC to cancel rendering.
- super-sampling (for sharper renderings)
- generate
SC4PLUGINDESCXML file
Bundling a new release:
- copy the files from
sourceinto a new folderBAT4Blender - restore the latest
BAT4Blender/assetsfolder from the previous release - zip the folder
BAT4Blender(the files inside the zip should end up inside a BAT4Blender subfolder)