diff --git a/inc/thorvg.h b/inc/thorvg.h index 8ac91248..f84ce3e5 100644 --- a/inc/thorvg.h +++ b/inc/thorvg.h @@ -454,6 +454,15 @@ public: */ virtual Type type() const noexcept = 0; + /** + * @brief Unique ID of this instance. + * + * This is reserved to specify an paint instance in a scene. + * + * @since Experimental API + */ + uint32_t id = 0; + /** * @see Paint::type() */ diff --git a/src/loaders/lottie/tvgLottieBuilder.cpp b/src/loaders/lottie/tvgLottieBuilder.cpp index 901c0f37..aea6c5e9 100644 --- a/src/loaders/lottie/tvgLottieBuilder.cpp +++ b/src/loaders/lottie/tvgLottieBuilder.cpp @@ -1270,6 +1270,7 @@ static void _updateLayer(LottieComposition* comp, Scene* scene, LottieLayer* lay //Prepare render data layer->scene = Scene::gen().release(); + layer->scene->id = layer->id; //ignore opacity when Null layer? if (layer->type != LottieLayer::Null) layer->scene->opacity(layer->cache.opacity);