Coder Social home page Coder Social logo

gindemit / unity-rlottie Goto Github PK

View Code? Open in Web Editor NEW
151.0 151.0 23.0 29.31 MB

Unity library that plays Lottie Animation to Texture2D

License: MIT License

CMake 1.06% C 13.09% C++ 0.93% C# 52.73% ShaderLab 23.45% Java 0.35% HLSL 2.33% Assembly 6.06%

unity-rlottie's People

Contributors

gindemit avatar konstantin-soulside avatar negascout avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

unity-rlottie's Issues

AnimatedImage script not showing its parameters after importing from git

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

image

I also get the following errors in the console.
image

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.

The color of the animation is not clear

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
image

But the color of what is displayed in Unity is like this

photo_2024-01-24_21-38-33

  • Keep in mind that it is on the top layer.

Preview image in editor

Is there a way to preview at least a image from the animation? Else it is alomst impossible to place it at the right place..

grafik

Switch out lottie files at runtime

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?

Crash on Android builds

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 support 'arm64' architecture in editor

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'))

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.

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

Loaded image is flipped 180 on the x-axis

image

After placing the a file that has been converted from .json to .txt file into the AnimationJson of AnimatedImage script, the the image is loaded and runs the animation, but it is flipped 180 on the x-axis

unity webgl

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:

UPM entry?

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

Texture flickering if CPU is under load

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:

bandicam.2023-03-18.14-06-54-380.mp4

(Note the UI thread hangs at 0:06 so the logo animation paused there.) The logo itself originally looks like this:

Warudo.Looped.Updated.mp4

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!

Issue with DLL on MacOS

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

License?

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.

Unix Build - Libraries not included

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!

Missing OSX rlottie lib in 0.3.0-dev.112

Missing OSX rlottie lib in the dev tag

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 :)

Not able stop the gif at last frame

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

iOS x86_64 libs required for simulator build

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.