5 4.2 Scene file format
mt1006 edited this page 2026-03-09 20:41:08 +01:00

Scene file format

Motion Capture saves scenes in JSON format. Scene files can be found in (world directory)/mocap_files/scenes and have .mcmocap_scene extension.

Like recording format, scene format aims to be backwards compatible. It doesn't aim to be forward compatible but because of how it is interpreted in current version of Motion Capture (unknown fields are just ignored) it should be forward compatible to some extent.

Before Motion Capture 1.4 different scene file format was used. It was also text format but not JSON-based. It's described here. (TODO: add link)

Types

JSON format doesn't distinguish between integers and floating-point numbers and doesn't save their precision. This documentation will include data types in code, so precision of given fields is known. If specific field was described and integer and floating-point number is passed instead, it's not defined how it should be interpreted.

Root object

Root JSON object consists of two elements - integer version and subscenes which is array of objects, each representing scene element. Both fields are required.

Version number and file format history

Version is stored on signed 32-bit integer, so number shouldn't exceed its range.

Possible values and their meaning:

  • 0 - undefined version number (as in not defined in file, but it's valid and should be read)
  • >= 1 - stable version number
  • <= -1 - experimental version number of a corresponding stable version

Version history:

  • 1 - Motion Capture 1.0 - 1.1.1 (legacy scene format)
  • 2 - Motion Capture 1.2 - 1.2.1 (legacy scene format)
  • 3 - Motion Capture 1.3 - 1.3.9 (legacy scene format)
  • 4 - Motion Capture 1.4 and later

JSON-based scene file format shouldn't use version number 1, 2, 3 as these versions were using completely different format.

Subscenes

(TODO: add links to each modifier) Each subscene consists of name, which is a name of a recording/scene a scene element points to, and optional modifiers (if one is not present, default modifier value is used):

  • player_name - string, value of player_name modifier
  • player_skin - object, contains data for player_skin modifier:
    • skin_source - string - "default", "from_player", "from_file", or "from_mineskin"
    • skin_path - string - data for player_skin modifier, check out its documentation for more details
  • transformations - object, contains data for transformations modifier:
    • rotation - double, in degrees
    • mirror - string - "none", "x", "z", or "xz"
    • offset - array of 3 doubles (x, y, z)
    • scale - object:
      • player_scale - double
      • scene_scale - double
    • config - object - transformations configuration (check transformations modifier documentation for more details):
      • round_block_pos - boolean
      • recording_center - string - "auto", "block_center", "block_corner", or "actual"
      • scene_center - object:
        • type - string - "common_first", "common_last", "common_specific", or "individual"
        • specific_str - string - used when type equals "common_specific", otherwise not present/ignored
      • center_offset - array of 3 doubles (x, y, z)
  • player_as_entity - object, contains data for player_as_entity modifier:
    • id - string, entity type ID in Minecraft format
    • nbt - string, SNBT of entity to use
  • time - object, contains data for time modifier:
    • start_delay - double, in seconds
    • wait_on_start - double, in seconds
    • wait_on_end - double, in seconds
    • wait_for_parent_end - boolean
    • loop - boolean
  • entity_filter - string, value of entity_filter modifier