This function sets the value of a specified expression variable within a particular layer.
It is useful for dynamically changing the properties of a layer at runtime.
Experimental API
- Result LottieAnimation::assign(const char* layer, uint32_t ix, const char* variable, float value)
- Tvg_Result tvg_lottie_animation_assign(Tvg_Animation* animation, const char* layer, uint32_t ix, const char* var, float val)
- modify the concept of AABB to apply only to transformed shapes.
- transform points before computing the bounding box min/max
to obtain a more compact shape region.
- trimmming memory by removing the cached matrix, about 36kb
of memory has been reduced per paint instance.
The Emscripten header was previously used because the WebGPU initialization logic was in WgContext::initialize.
Now, initialization occurs at the binding/application level.
added 2 more APIs for user convenience to allow backtracking tree traversal.
API Additions:
- const Paint* Paint::scene() const
- const Tvg_Paint* tvg_paint_get_scene(const Tvg_Paint* paint)
When the datas are copied with deep copy, memory issue caused (SEGV on unknown address) due to these reasons:
1. `mimeType` is nullptr when it's not embedded(base64) data
2. datas(b64Data, mimeType) should not be clear, it's used for next slot copy in same pair.
If the svg contained an unsupported element with <stop> elements,
they were incorrectly assigned to the last loaded gradient. Now fixed.
@Issue: https://github.com/thorvg/thorvg/issues/3321
In member function ‘constexpr LottieGenericProperty<LottieScalarFrame<float>, float>& LottieGenericProperty<LottieScalarFrame<float>, float>::ope> inlined from ‘LottieFloat& LottieStroke::dashValue()’ at ../src/loaders/lottie/tvgLottieModel.h:60:104,
inlined from ‘void LottieParser::parseStrokeDash(LottieStroke*)’ at ../src/loaders/lottie/tvgLottieParser.cpp:623:82:
../src/loaders/lottie/tvgLottieProperty.h:297:8: warning: ‘<anonymous>.LottieGenericProperty<LottieScalarFrame<float>, float>::value’ may be used> 297 | struct LottieGenericProperty : LottieProperty
| ^~~~~~~~~~~~~~~~~~~~~
../src/loaders/lottie/tvgLottieModel.h: In member function ‘void LottieParser::parseStrokeDash(LottieStroke*)’:
../src/loaders/lottie/tvgLottieModel.h:60:104: note: ‘<anonymous>’ declared here
60 | for (uint8_t i = 0; i < dashattr->size; ++i) newValues[i] = LottieFloat(dashattr->values[i]);
|
../src/renderer/wg_engine/tvgWgRenderer.cpp:623:78: runtime error: downcast of address 0x5040005b7010 which does not point to an object of type 'RenderEffectFill'
0x5040005b7010: note: object is of type 'tvg::RenderEffectTint'
00 00 00 00 80 07 5d 35 c9 7f 00 00 20 60 23 00 30 50 00 00 00 00 00 00 00 00 00 00 00 00 00 00
^~~~~~~~~~~~~~~~~~~~~~~
vptr for 'tvg::RenderEffectTint'
../src/renderer/wg_engine/tvgWgRenderer.cpp:624:85: runtime error: downcast of address 0x5040005b7050 which does not point to an object of type 'RenderEffectFill'
0x5040005b7050: note: object is of type 'tvg::RenderEffectTritone'
00 00 00 00 a0 07 5d 35 c9 7f 00 00 40 5e 23 00 30 50 00 00 00 00 00 00 00 00 00 00 00 00 00 00
^~~~~~~~~~~~~~~~~~~~~~~