Skip to main content

Asset Import / Export

Export

Pragma comes with the following export capabilities:

  • You can use Pragma to export Source Engine and Source 2 Engine assets for use in modelling programs
  • Assets in Pragma can be exported in the Source Engine model/material/texture format
    • Fake PBR can be applied automatically for use in SFM
  • Automatic generation of ambient occlusion maps (if they don't exist)
  • Automatic re-scaling of the models to meters
  • Conversion to match Blender's coordinate system
  • Includes the rig, all of the animations and morph targets of the model
  • Conversion to standard normal maps (e.g. if self-shadowed bumpmaps are used)
  • Conversion of Source 1 assets with PBR settings
  • Automatic conversion of the textures to png, bmp, tga, jpg, hdr, dds, ktx or vtf
  • Automatic conversion of the textures to a RMA format
  • Works with maps / level geometry

Exporting Assets

To use the exporter, you have to start a game in Pragma first. You can either load a map (which map doesn't matter), or run "map empty" in the console. Once the map has been loaded, you can use the following console command:

 

  • -export_images 1/0: If enabled, all textures of the asset will be converted to the specified image output format and saved alongside the asset. Default: 1
  • -normalize_texture_names 1/0: If enabled, the exported textures will be renamed according to their type (e.g. "textureName_normal") and will not keep their original name. Default: 0
  • -image_format png/bmp/tga/jpg/hdr/dds/ktx: The format to use for exported textures. Default: dds
  • -binary 1/0: If enabled, the model will be exported in the "glb" format, otherwise "glTF". Default: 0
  • -verbose 1/0: If enabled, additional information will be printed to the console during the export. Default: 1
  • -recursive 1/0: TODO
  • -game 1/0: TODO
  • -format TODO
  • -preview TODO
  • -list_animations TODO
  • -animation TODO
  • -texture TODO
  • -material TODO
  • -map TODO
  • -model TODO

Models only:

  • -export_animations 1/0: If enabled, all animations of the model will be exported as well. This may drastically increase the file size and loading times when importing the model into a modelling program. Default: 1
  • -export_morph_targets 1/0: If enabled, will export all morph targets (flexes) of the model as well. Default: 1
  • -export_skinned_mesh_data 1/0: If disabled, no skeleton, vertex weights or animations will be exported. Default: 1
  • -embed_animations 1/0: If enabled, all of the animations of the model will be embedded in the exported glTF file. When disabled, each animation will be exported as a separate file instead. Default: 1
  • -full_export 1/0: If enabled, body groups of the model will be exported as well. Default: 0
  • -scale <scale>: The value by which to scale the exported meshes. Use 1 to keep the original scale. Use 0.025 to convert the meshes to meters. Default: 0.025
  • -generate_ao 1/0: If enabled, will automatically generate ambient occlusion maps for the model if it doesn't have any. Default: 0
  • -ao_resolution <resolution>: The resolution to use for the ambient occlusion maps if "generate_ao" is enabled. Default: 512
  • -ao_samples <samples>: The number of samples to use for generating the ambient occlusion maps if "generate_ao" is enabled. Default: 40
  • -ao_device cpu/gpu: Whether to use the CPU or GPU to generate the ambient occlusion maps if "generate_ao" is enabled. Default: cpu
  • -merge_meshes_by_material 1/0: If enabled, all meshes that use the same material will be merged. Default: 1
  • -enable_extended_dds 1/0: If enabled and the image format is set to dds, will enable support for BC6 and BC7 compression using the DXT10 version of the format. Default: 0
  •  

 

  •  

 

util_export_asset ((-model <modelName> [-animation <animName>] [-list_animations]) | -map <mapName> | -material <matName> | -texture <texName>) [-verbose 1/0] [-binary 1/0] [-export_animations 1/0] [-export_skinned_mesh_data 1/0] [-export_images 1/0] [-image_format png/bmp/tga/jpg/hdr/dds/ktx] [-enable_extended_dds 1/0] [-generate_ao 1/0] [-ao_samples 32/64/128/256/512] [-ao_resolution 512/1024/2084/4096] [-scale <scale>] [-embed_animations 1/0]

 

 

 

 

Source 2

 

Source Engine Model Export

Fake PBR

 

Import