)]}'
{
  "commit": "087a32d28ede672af7a73445011d0eda355b179c",
  "tree": "56d5ddfe07cfd2cfb2c96399e236d995f4d1a180",
  "parents": [
    "dd6586651e25fbb4ea03479b4665f820233331f8"
  ],
  "author": {
    "name": "susan101566",
    "email": "hello@rive.app",
    "time": "Mon Apr 14 15:46:54 2025 +0000"
  },
  "committer": {
    "name": "susan101566",
    "email": "hello@rive.app",
    "time": "Mon Apr 14 15:46:54 2025 +0000"
  },
  "message": "libraries: serialize library artboards as local artboards\n\nFixes https://github.com/orgs/rive-app/projects/15/views/1?pane\u003dissue\u0026itemId\u003d104718681\u0026issue\u003drive-app%7Crive%7C9356\n\nFixes https://github.com/rive-app/rive/issues/9324#issue-2966381868\n### Overview\nCurrently we do not export LibraryArtboards to runtime, as C++ won\u0027t understand them. As such, currently, if you have ArtboardX that contains  NestedArtboard_ofALibraryArtboard, a NestedArtboard that points to ArtboardX won\u0027t work.\n\nThis PR makes it such that a NestedArtboard to ArtboardX would show. Moreover, its statemachine will play too.\n\n### There are a few main changes\n1. LibraryAsset: cached library artboards in LibraryAsset are referenced by ID instead of by name. This ID is the original artboard\u0027s ID in the library asset file, and is persisted in our schema as LibraryArtboard.artboardId. Same same with caching statemachines and linear animations. I\u0027ve added LibraryStateMachine.animationId and LibraryLinearAnimation.animationId.\n2. NestedArtboard: before this PR, there was logic that checks whether the source artboard was a LibraryArtboard or just an Artboard. Now, it\u0027s just Artboard, because the runtime exporter only exports Artboards.\n3. Runtime exporter: I\u0027ve created the idea of MappedContext, which maps a library identifier to its various remaps, like globalIndexMapper, nestedIds, eventIds, etc.\n\n### The mapping\nNestedArtboard.artboardId -\u003e LibraryArtboard.id\nLibraryArtboard.artboardId -\u003e LibraryAsset\u0027s rev file\u0027s Artboard.id\n\nNestedStateMachine.animationId -\u003e LibraryStateMachine.id\nLibraryStateMachine.animationId -\u003e LibraryAsset\u0027s rev file\u0027s State Machine.id\n\n### Order of export\nCurrently, when we export we only go over the host file, and the order looks like\nBackboard_ofHost\nFileAssets_ofHost\nDataModels_ofHost\nArtboard1_ofHost\nArtboard1_components_ofHost (e.g. paints, nested artboards, state machines, etc.)\n\nNow, I\u0027m recursively also exporting the library files. So the order looks like\nBackboard_ofHost\n[XXX]\n  **--FileAssets_ofLibrary\n  --DataModels_ofLibrary\n  --Artboard1_ofLibrary\n  --Artboard1_components_ofLibrary**\nFileAssets_ofHost\nDataModels_ofHost\nArtboard1_ofHost\nArtboard1_components_ofHost\n\nBasically, we insert the indented section, which represents the library file. And if Library uses other library assets, it should go into the [XXX] section. Tho we currently don\u0027t support this, as we don\u0027t decode library assets used from a library asset.\nIf we aggregate all the artboards, [0, total count) is the range of valid artboard indices in C++.\n\n### Tests\nI\u0027ll fix the TODO\u0027s in the tests\n\nDiffs\u003d\ne75974b896 libraries: serialize library artboards as local artboards (#9419)\n\nCo-authored-by: Susan Wang \u003csusan@rive.app\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "11648ec610fde4cdb72d0e914c5dd6efcb46b5cd",
      "old_mode": 33188,
      "old_path": ".rive_head",
      "new_id": "9f3326b54ad4b02df8b0302aa9c759bde598e72a",
      "new_mode": 33188,
      "new_path": ".rive_head"
    },
    {
      "type": "modify",
      "old_id": "e1e12c79651722f924184c38c3cb51162067efb2",
      "old_mode": 33188,
      "old_path": "include/rive/nested_artboard.hpp",
      "new_id": "bf44957e6847b517f8b3d38dc7861d7bf00651cb",
      "new_mode": 33188,
      "new_path": "include/rive/nested_artboard.hpp"
    },
    {
      "type": "modify",
      "old_id": "857f5545b18539501c2506cd563f1ba1d74e4c0b",
      "old_mode": 33188,
      "old_path": "renderer/path_fiddle/path_fiddle.cpp",
      "new_id": "ff6c2b45e6004d3dae640bd1deddd5cb5cc22dd0",
      "new_mode": 33188,
      "new_path": "renderer/path_fiddle/path_fiddle.cpp"
    },
    {
      "type": "modify",
      "old_id": "222d94b49d84fff316abb337878ae3b0746af3f2",
      "old_mode": 33188,
      "old_path": "src/nested_artboard.cpp",
      "new_id": "434e1b9ca03eca8dd753ec040f911b1a92feb91f",
      "new_mode": 33188,
      "new_path": "src/nested_artboard.cpp"
    },
    {
      "type": "modify",
      "old_id": "a084c4507088254291c508995d0b4efbec611cfb",
      "old_mode": 33188,
      "old_path": "tests/unit_tests/assets/double_library_with_image.riv",
      "new_id": "2717f39ebb4d0a1e52e612ee0bb6b841241bc47f",
      "new_mode": 33188,
      "new_path": "tests/unit_tests/assets/double_library_with_image.riv"
    },
    {
      "type": "modify",
      "old_id": "2ff71147cb42983d7108ea4da721a2cacb7c0fbb",
      "old_mode": 33188,
      "old_path": "tests/unit_tests/assets/library_export_animation_test.riv",
      "new_id": "668e9b2fe5c8ce1f9b74424d50dbcde2941e9747",
      "new_mode": 33188,
      "new_path": "tests/unit_tests/assets/library_export_animation_test.riv"
    },
    {
      "type": "modify",
      "old_id": "bc7bcaff813053b42c69b285441560897a4a85a6",
      "old_mode": 33188,
      "old_path": "tests/unit_tests/assets/library_export_state_machine_test.riv",
      "new_id": "08fdedf7ac40eb4d5715a8b1f524a8108d4ff72b",
      "new_mode": 33188,
      "new_path": "tests/unit_tests/assets/library_export_state_machine_test.riv"
    },
    {
      "type": "modify",
      "old_id": "fbb3effcdbd943b56bb6c5b4a93d673261244db3",
      "old_mode": 33188,
      "old_path": "tests/unit_tests/assets/library_export_test.riv",
      "new_id": "11d925018db1ed3a19cce21a11de84312a9e9bfe",
      "new_mode": 33188,
      "new_path": "tests/unit_tests/assets/library_export_test.riv"
    },
    {
      "type": "modify",
      "old_id": "dbf32c734d2729c3cbb08d672f4d9c13203f3601",
      "old_mode": 33188,
      "old_path": "tests/unit_tests/assets/library_with_image.riv",
      "new_id": "bb0d095cf576deda984acad4288c05666a0f1f3a",
      "new_mode": 33188,
      "new_path": "tests/unit_tests/assets/library_with_image.riv"
    },
    {
      "type": "modify",
      "old_id": "8649f9c0f476378524e8779f8b2d837ad872be22",
      "old_mode": 33188,
      "old_path": "tests/unit_tests/runtime/library_asset_test.cpp",
      "new_id": "bf3d951bf064c3ac8ab1bef9e209f426b5d971d3",
      "new_mode": 33188,
      "new_path": "tests/unit_tests/runtime/library_asset_test.cpp"
    }
  ]
}
