Razorbill
Operations

Asset Operations

CreatePrimitive

Generate a primitive mesh and optionally create an entity with Transform and MeshComponent.

ParameterTypeRequiredDescription
primitive_typeenumYesCube, Sphere, Plane, or Cylinder
entity_namestringNoName for auto-created entity
parent_guidstringNoParent entity GUID
positionarrayNoInitial position [x, y, z] (default: [0,0,0])
segmentsintegerNoSegment count for sphere/cylinder (default: 32)
{
  "op": "CreatePrimitive",
  "params": {
    "primitive_type": "Sphere",
    "entity_name": "Ball",
    "position": [0, 5, 0],
    "segments": 48
  }
}

CreatePBRMaterial

Apply a PBR material to an entity. Replaces any existing UnlitMaterial.

ParameterTypeRequiredDescription
entity_guidstringNoTarget entity GUID (use this OR entity_name)
entity_namestringNoTarget entity name
material_namestringNoDisplay name (default: "PBRMaterial")
base_colorarrayNoRGBA color [r, g, b, a] in sRGB, 0-1 range (default: [1,1,1,1])
metallicnumberNoMetallic factor 0-1 (default: 0.0)
roughnessnumberNoRoughness factor 0-1 (default: 0.5)
albedo_texture_guidstringNoAlbedo texture asset GUID
normal_texture_guidstringNoNormal map texture GUID
ao_texture_guidstringNoAmbient occlusion texture GUID
{
  "op": "CreatePBRMaterial",
  "params": {
    "entity_name": "Floor",
    "material_name": "TileFloor",
    "base_color": [0.8, 0.8, 0.75, 1.0],
    "metallic": 0.0,
    "roughness": 0.3
  }
}

ImportMesh

Import a glTF/glb file into the project. Creates mesh metadata and cooked data in the Library.

ParameterTypeRequiredDescription
source_pathstringYesPath to the .gltf or .glb file
forcebooleanNoForce re-import even if asset exists
{
  "op": "ImportMesh",
  "params": {
    "source_path": "/path/to/character.glb",
    "force": false
  }
}

ImportTexture

Import an image file as a texture asset.

ParameterTypeRequiredDescription
source_pathstringYesPath to image file (PNG, JPG, BMP, TGA)
forcebooleanNoForce re-import even if asset exists
{
  "op": "ImportTexture",
  "params": {
    "source_path": "/path/to/brick_diffuse.png"
  }
}

Example: Textured PBR Entity

Import a texture, then apply it as the albedo on a PBR material:

[
  {
    "op": "ImportTexture",
    "params": { "source_path": "/textures/wood.png" }
  },
  {
    "op": "CreatePrimitive",
    "params": { "primitive_type": "Cube", "entity_name": "WoodCrate" }
  },
  {
    "op": "CreatePBRMaterial",
    "params": {
      "entity_name": "WoodCrate",
      "albedo_texture_guid": "<texture-guid-from-import>",
      "roughness": 0.7,
      "metallic": 0.0
    }
  }
]

On this page