feat(Android): Scripting support (#11438) 9112280455 Adds the build flags required to enable scripting. Adds two samples, one for legacy, one for Compose, using the Blinko example. Also patches the command server to accept script assets and not crash for unrecognized assets. Co-authored-by: Erik <erik@rive.app>
diff --git a/.rive_head b/.rive_head index b014ec4..e1626a4 100644 --- a/.rive_head +++ b/.rive_head
@@ -1 +1 @@ -e7142dcfedf6710265bd49fe031c26e663b37f99 +9112280455e25db4649d446601f443c763151649
diff --git a/src/command_server.cpp b/src/command_server.cpp index 19c059d..0510916 100644 --- a/src/command_server.cpp +++ b/src/command_server.cpp
@@ -4,12 +4,13 @@ #include "rive/command_server.hpp" -#include "rive/file.hpp" -#include "rive/assets/image_asset.hpp" +#include "rive/animation/state_machine_instance.hpp" #include "rive/assets/audio_asset.hpp" #include "rive/assets/font_asset.hpp" +#include "rive/assets/image_asset.hpp" +#include "rive/assets/script_asset.hpp" +#include "rive/file.hpp" #include "rive/viewmodel/runtime/viewmodel_runtime.hpp" -#include "rive/animation/state_machine_instance.hpp" namespace rive { @@ -73,9 +74,20 @@ } } + else if (asset.is<ScriptAsset>()) + { + // Script assets cannot currently be added externally. + // Let the file loader handle it. + return false; + } + else { - RIVE_UNREACHABLE(); + fprintf(stderr, + "ERROR: CommandFileAssetLoader::loadContents - Unsupported" + " asset type for asset: '%s'\n", + asset.uniqueFilename().c_str()); + return false; } return false;