gindemit / unity-rlottie Goto Github PK
View Code? Open in Web Editor NEWUnity library that plays Lottie Animation to Texture2D
License: MIT License
Unity library that plays Lottie Animation to Texture2D
License: MIT License
Thank you for the wonderful assets. I want to manipulate the animation time, is it possible?
After importing the package into the project via git like in the Installation section of the guide, I am unable to use the AnimatedImage script, as it dose not show its fields after adding the component to an object even with RawImage on it
I also get the following errors in the console.
I am not sure if I am missing any components or have not followed the guide properly.
Hope to hear form you soon.
P/S : If possible, do make a simple tutorial video to supplement the user guide you have posted. I am sure people will appreciate it.
I tried to solve this problem but I could not
I made a Raw image and set a Animated Image Component, I gave him the method and file of the Json, but the color of my executive animation is pale
This is the original animation file
But the color of what is displayed in Unity is like this
To help create a precise application flow that depends on the animation end, this could be very helpful.
I have a situation where I have to choose between several lottie files at runtime to display. I don't think having several gameobjects in the scene and selecting between those is elegant. Would it be possible to add a "SetLottie" function to the AnimatedImage object?
There is a crash in Android build. I believe its because in LottieAnimationsPreview.cs on line 35 is used animationPreview.InitFromFile instead of initFromData. The filesystems on different platforms vary and in some (especially in Android) its not as straightforward to read/write files from native code.
Because the file paths and methods for reading files vary on every OS, I suggest to read the json on C# side and pass it to the rlottie call by rlottie::Animation::loadFromData.
The log from Android debug bridge is as follows:
2022/04/02 13:21:39.095 10606 10651 Error Unity InvalidOperationException: Failed to load file at path "jar:file:///data/app/com.DefaultCompany.LottiePlugin-01-bkWC_k3yCYRqTXfzUDg==/base.apk!/assets/jar:file:///data/app/com.DefaultCompany.LottiePlugin-01-bkWC_k3yCYRqTXfzUDg==/base.apk!/assets/alright_sticker.json", result: "ProtocolError" 2022/04/02 13:21:39.095 10606 10651 Error Unity at Support.StreamingAssets.StreamingAssetsHelper.LoadFileFromStreamingAssets (System.String streamingAssetsFilePath) [0x00000] in <00000000000000000000000000000000>:0 2022/04/02 13:21:39.095 10606 10651 Error Unity at Presentation.Utility.FilesHelper.CopyFileFromStreamingAssetsToPersistentData (System.String streamingAssetsFilePath, System.String targetFilePath) [0x00000] in <00000000000000000000000000000000>:0 2022/04/02 13:21:39.095 10606 10651 Error Unity at Presentation.Utility.FilesHelper.CopyAnimationsJsonsFromStreamingAssetsToPersistentData (System.String[] animations) [0x00000] in <00000000000000000000000000000000>:0 2022/04/02 13:21:39.095 10606 10651 Error Unity at Presentation.State.AppState.Awake () [0x00000] in <00000000000000000000000000000000>:0 2022/04/02 13:21:39.095 10606 10651 Error Unity
Plugin does not work on version Unity3d 2021 and older with processor support Apple Silicone (Macbook M1,M2)
'/Applications/Unity/Hub/Editor/2021.3.29f1/Unity.app/Contents/Frameworks/Assets/LottiePlugin/Plugins/OSX/libLottiePlugin.dylib' (no such file), '/Applications/Unity/Hub/Editor/2021.3.29f1/Unity.app/Contents/Frameworks/Assets/LottiePlugin/Plugins/OSX/libLottiePlugin.dylib' (no such file), '/usr/lib/Assets/LottiePlugin/Plugins/OSX/libLottiePlugin.dylib' (no such file, not in dyld cache), 'Assets/LottiePlugin/Plugins/OSX/libLottiePlugin.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/Users/doc/guess-please/Assets/LottiePlugin/Plugins/OSX/libLottiePlugin.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/doc/guess-please/Assets/LottiePlugin/Plugins/OSX/libLottiePlugin.dylib' (no such file), '/Users/doc/guess-please/Assets/LottiePlugin/Plugins/OSX/libLottiePlugin.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))
Getting this error after installing unity-rlottie version 0.2.2:
Multiple precompiled assemblies with the same name System.Runtime.CompilerServices.Unsafe.dll included on the current platform. Only one assembly with the same name is allowed per platform. (Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.3/lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll)
Multiple precompiled assemblies with the same name System.Runtime.CompilerServices.Unsafe.dll included on the current platform. Only one assembly with the same name is allowed per platform. (/Volumes/SamsungT7SSD/MyProject/Library/PackageCache/com.gindemit.rlottie@82e20a0008/ExternalDlls/System.Runtime.CompilerServices.Unsafe.dll)
Deleting one of the System.Runtime.CompilerServices.Unsafe.dll files did not work, any advice?
Unity version: 2021.3.19f1
LottiePlugin.cpp always return zero instead of indicating runtime problems at functions by nonzero values.
This is my personal stupid opinion, if support UI, can you support SpriteRenderer?
Hello, I followed the manual to open sample scene but get the DLL error.
This is my environment detail:
I saw there is also a similar issue: #6
How can I fixed that?
Add .so for linux builds (mostly mono editor runtimes)
Good day. While using AnimatedImage component some animations are not recognized as lottie.
This is an example of animation that is not recognized:
https://lottiefiles.com/animations/merry-christmas-rHWirI2aZ2
This one works well:
https://lottiefiles.com/animations/radar-loading-quRoUzmGZN
Hope both links are valid. Tried to create own animation with lottiefiles, but mine one either fails.
good afternoon, it is possible to make the plugin work for webgl. there is a plugin error on the build right now
DllNotFoundException: Unable to load DLL 'LottiePlugin'. Tried the load the following dynamic libraries:
I am currently creating a package which includes a set of scenes for other projects to use. Those scenes have lottie animations. Due to Unity's limitation that packages can't have git dependencies (source: https://docs.unity3d.com/Manual/upm-git.html), I really need this in an importable format for that if possible
Hi! First of all, thank you for this great library. I am using Lottie on the loading screen to display our logo. Everything is great, but I found that the logo would flicker for some unknown reason, presumably when CPU load is high. In the following video, I am getting all C# types from all loaded assemblies in another thread, and you can see the logo flickers:
(Note the UI thread hangs at 0:06 so the logo animation paused there.) The logo itself originally looks like this:
Very confused why this is happening. I have tried both Update
and UpdateAsync()
(with DrawOneFrameAsyncGetResult()
in LateUpdate()
), both suffer from the same problem. Even more curious is that this doesn't happen in the editor, only in standalone builds.
Please let me know if you have any ideas. Thanks!
Hi,
when running the sample on macos, Unity 2020.3.41 I keep getting:
DllNotFoundException: LottiePlugin
LottiePlugin.NativeBridge.LoadFromData (System.String filePath, System.String resourcesPath, System.IntPtr& animationWrapper) (at Assets/LottiePlugin/src/NativeBridge.cs:92)
It works just fine on windows.
On macos, I had to modify the dependencies and switch:
"com.unity.toolchain.linux-x86_64": "1.0.0",
to
"com.unity.toolchain.macos-x86_64-linux-x86_64": "1.0.0",
Is there anything I am missing?
I didn't give enough details:
Platform: Android
Editor OS: macos
i have lottie file that included pngs its works fine on lottiefiles.com but not working on unity no error, just empty not loaded the images
lottie file attchemnt
emote satan (1).txt
I would like to use the library, but I legally can't do that without any kind of licensing terms.
I would suggest MIT, but feel free to research for yourself if you need something more restrictive.
It would be great to add the ability to stop the animation on the last frame if the loop is set to false. Currently, the Stop method is being called there, and this method resets the frame to 0.
Hello,
The library works well in Unity environment (Windows). But when I do a Linux build and try to launch it, it doesn't work - the Unity Player.log file shows that the Lottie libraries are not included in the build:
Fallback handler could not load library /home/xyz/UV_20240220_Data/MonoBleedingEdge/x86_64/LottiePlugin
Fallback handler could not load library /home/xyz/UV_20240220_Data/MonoBleedingEdge/x86_64/libLottiePlugin.so
Fallback handler could not load library /home/xyz/UV_20240220_Data/MonoBleedingEdge/x86_64/libLottiePlugin
etc...
I tried to add the Linux libraries from the project's Plugins folder into this specific path above but the error stays.
What could be the issue?
Thanks!
I just wanted to give you information that 0.3.0-dev.112 seems to work well on any machine other than an OSX one, as its specifically missing the 'librlottie' library (libLottiePlugin is still there for OSX).
Once you get to it, please make sure its added :)
Will it be any support for WebGL ?
I have use case where I need to stop the gif at last frame but there is no straight-forward option for this would be great to add this option when we select not to loop
For Android, there exists the x86_64 libs that allow us to create a version that will run in the simulator. However, the equivalent libraries for iOS seem to be missing and so we can't make iOS simulator builds.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.