Skip to content

Model Converter Guide

Standalone tool for converting OpenSceneGraph (.osgb, .osg, .ive) models to GLB format.
AI Agent

Download Latest Version


Requirements

Tool Purpose Required?
Python 3.8+ Runs the converter script Yes
osgconv Converts OSGB/IVE → OBJ and extracts textures Yes
Blender 3.6+ Converts OBJ → GLB with texture embedding Yes

Where osgconv is found (checked in order)

  1. Download from here (Note: if you download from the link above the bin folder with osgconv will already be in your project folder)
  2. Place next to the model_converter script /bin/osgconv.exe (next to the script)

Where Blender is found (checked in order)

  1. C:\Program Files\Blender Foundation\Blender *\blender.exe (newest version)
  2. System PATH

Conversion Pipeline

┌──────────┐     osgconv      ┌──────────┐     Blender      ┌──────────┐
│  .osgb   │ ──────────────►  │   .obj   │ ──────────────►  │   .glb   │
│  .osg    │  + texture       │   .mtl   │   import OBJ     │          │
│  .ive    │  extraction      │ images/  │   export GLB     │          │
└──────────┘                  └──────────┘                   └──────────┘

Step-by-step:

  1. Direct attemptosgconv input.osgb output.glb (works if OSG has a glTF plugin)
  2. OBJ intermediateosgconv input.osgb temp.obj, then Blender converts temp.obj → output.glb
  3. Blender fallback — For formats Blender supports natively (.fbx, .obj, .dae)

Intermediate files (.obj, .mtl) are cleaned up automatically on success.

Textures

If textures don't automatically copy over you may need to manually extract them: For osgb models need to first manually save the textures

right click on the texture - go to Properties - left click on the gear icon - save as .dds in the textures folder

Once they are in the textures folder run the converter script and the .glb model will be saved into output_folder\output_folder\webxr\models folder

AI Agent


Usage — Python Import (convert_models.py)

No terminal needed. Call directly from any Python script (including Vizard scripts) Note: it is highly suggested to have one model per folder, as multiple models in the same conversion folder could cause issues:

from model_converter import convert, batch_convert, check_tools

# Check if osgconv and Blender are available
tools = check_tools()
print(tools)
# {'osgconv': 'D:\\...\\bin\\osgconv.exe', 'blender': 'C:\\...\\blender.exe'}

# Convert a single file (output defaults to same name with .glb extension)
convert("myScene.osgb")

# Convert with explicit output path
convert("myScene.osgb", "output/myScene.glb")

# Convert with a textures folder
convert("myScene.osgb", "output/myScene.glb", textures_dir="textures/")

# Batch convert a whole directory
results = batch_convert("models/", "converted/")
print(f"Succeeded: {len(results['succeeded'])}, Failed: {len(results['failed'])}")

Usage — Command Line (PowerShell / Terminal)

Convert a single model

python model_converter.py scene.osgb

Output: scene.glb in the same directory.

Specify output path

python model_converter.py scene.osgb -o output/scene.glb

Convert with a textures folder

python model_converter.py scene.osgb -t textures/

Batch convert all models in a directory

python model_converter.py models/

Converts all .osgb, .osg, and .ive files found in the directory.

Batch convert with output directory

python model_converter.py models/ -o converted/

Check available tools

python model_converter.py --check-tools

Output:

Available conversion tools:
  osgconv: D:\...\bin\osgconv.exe
  blender: C:\Program Files\Blender Foundation\Blender 4.2\blender.exe

Verbose logging

python model_converter.py scene.osgb -v

All CLI flags

Flag Description
input Input model file or directory (positional)
-o, --output Output .glb file path or directory
-t, --textures-dir Path to folder containing textures to embed
-v, --verbose Enable verbose/debug logging
--check-tools Check which tools are available and exit

API Reference

Function Description
convert(input_path, output_path=None, textures_dir=None) Convert a single model to GLB. Returns True/False.
batch_convert(input_dir, output_dir=None, extensions=None, textures_dir=None) Convert all models in a directory. Returns {'succeeded': [...], 'failed': [...]}.
check_tools() Returns {'osgconv': path_or_None, 'blender': path_or_None}.

Texture Handling

Textures are resolved in this priority order:

  1. --textures-dir / textures_dir parameter — Explicitly provided folder of textures
  2. textures/ folder next to the input model — Auto-detected
  3. images/ folder next to the input model — Auto-detected
  4. Automatic extractionosgconv -O OutputTextureFiles extracts embedded textures from .osgb/.ive files

If automatic extraction fails

Some compressed textures (e.g., DDS with GPU-specific compression) can't be extracted without an OpenGL context. In that case, manually export textures from Vizard Inspector:

  1. Open Vizard IDE → Utilities → Inspector
  2. File → Open your .osgb file
  3. In the Textures panel, click on a texture
  4. Right-click → Properties → gear icon → Export
  5. Save all textures to a textures/ folder next to your model
  6. Run the converter — it will auto-detect and embed them

Expected folder structure

my_project/
├── my_model.osgb
├── textures/
│   ├── wall_diffuse.png
│   ├── floor_diffuse.jpg
│   └── ceiling.dds

Then simply run:

python model_converter.py my_model.osgb

The textures will be found automatically and embedded into the output .glb.


Supported Formats

Input formats

Format Extension Conversion Path
OpenSceneGraph Binary .osgb osgconv → OBJ → Blender → GLB
OpenSceneGraph ASCII .osg osgconv → OBJ → Blender → GLB
OpenSceneGraph IVE .ive osgconv → OBJ → Blender → GLB
FBX .fbx Blender direct
Wavefront OBJ .obj Blender direct
COLLADA .dae Blender direct
glTF .gltf, .glb Blender direct

Output format

  • GLB (Binary glTF) — single-file format with embedded textures, widely supported

Troubleshooting

Problem Solution
osgconv.exe not found Place osgconv.exe + its DLLs in ./bin/ next to the script, or install OpenSceneGraph
Blender not found Install Blender and ensure it's in the default location or on your PATH
Missing textures in output Provide a textures/ folder via -t flag or place it next to the model
Blender conversion timed out Very large models may exceed the 5-minute timeout — try converting smaller pieces
DDS textures not extracted Use Vizard Inspector to manually export textures (see Texture Handling above)
osgconv stderr: write error Compressed textures can't be auto-extracted — use manual texture export