ShigureTokisaki

  • Feb 7, 2024
  • Joined Jul 15, 2022
  • Harald
    Hello Harald, thanks for you help!
    When I use sharedMaterial can run perfect, sharedMaterial will change unity local material file, we use SVN to manage project, it's a trouble for us. So i want to create a runtime material instance and change it's stencil value.But by this way, the spine character start blink.That's the main problem.
    I have try CustomMaterialOverride. But it's seems no effect.
    Here is the code

    public static void ChangeCustomMaterialOverride(GameObject gameObject)
    {
        SkeletonAnimation skeletonAnimation = gameObject.GetComponent<SkeletonAnimation>();
        if (skeletonAnimation != null)
        {
            foreach(AtlasAssetBase Base in skeletonAnimation.SkeletonDataAsset.atlasAssets)
            {
                Material orgMat = Base.PrimaryMaterial;
                Debug.LogWarning(orgMat.GetInstanceID());
                Material newMat = Material.Instantiate(orgMat);
                Debug.LogWarning(newMat.GetInstanceID());
                skeletonAnimation.CustomMaterialOverride[orgMat] = Material.Instantiate(newMat);
            }
        }
    }

    Now I still use sharedMaterial, the ID value between orgMat and newMat are different, but it's still change unity local material file
    ; ;

    • YES! That's exactly what I want!
      In these past few days, I've been trying to replicate my issue, but there's a peculiar bug affecting my judgment. This bug appears and disappears occasionally. However, it seems that what you said is correct; we indeed don't want to modify the shared material. So, making modifications to materials caused this problem. This is what I wanted to mention in the additional information. We will try "CustomMaterialOverride" or other functions. I will sharing our progress!

    • Nate Okay, thank you~ Actually my description was a bit confusing. I will post the information I know later about this bug. If technical experts is back, they can help with the investigation. We had found some ways to solve this question.

      • Oh. Sad ;; I try to do this in another Online PC, I failed. I will try to find some different between the two PC. By the way, I use Spine URP package and I change shader to URP2D

        • I'm sorry for the first question, the time scale can run correctly, it seems just a progrem bug. lol

        • Hi Spine2D team. I use Spine animation in my unity programe, but there are some problems. I hope you can help me. Thanks a lot.
          First I use Spine 4.0 runtime and Unity version is 2021.3.19f1

          1. I create a prefab(SkeletonAnimaiton) by Spine SkeletonData and I want to change the play scale of animation by "Time Scale", but no matter how I adjust this value, it has no effect in runtime. I can only change the Unity engine's TimeScale, I wan't do that.
          2. Here is my spine character, he can blink his eyes. (ScreenShoot 1)I change attach Region's visibility to achieve this. And I use Unity material stencil to cut a part of this character in games. well. boom! when the character blink his eye, the prefeb change the spine material to (material) and the new material's stencil comparison is different with default instance material, so the character is blink like a star XD, you can see Video 1.I try to cancle attach Region in animation by spine editor and everything looks like right.

          ScreenShoot 1:

          Video 1:

          • I understand what you mean. I just need to activate it on my new computer. Once I reach the maximum of two machines, the old one will be pushed out according to the activation time. Right? :

            • 我之前在公司一个电脑上安装了spine并且用专业版激活了。然后这台电脑出了问题被重装系统了。现在的问题是,一个spine许可证只允许两台电脑激活。我怎么可以释放这个电脑的激活许可,以便我可以在另一台电脑上使用

              • Mario wrote

                I did, and that too works as intended. My guess is that your Android build has an issue. It's hard for me to say what that issue is. Possibly some cached object files from previous compiles of an older version.

                Well, get it. Last week, I updated my plugin and spine date to 4.1, and it's run perfecte.
                I just want to know why 4.0 version can't be work perfectly. But it's unimportant. I will try 4.0 plugin next time , accurately maybe i did wrong with some step.
                Thx for your work!! 🙂

              • Mario wrote

                I've tried to reproduce your issue, but can not. The exported files load fine in spine-ue4, spine-cpp, spine-sfml, and spine-libgdx. Are you sure you are using the correct version of spine-ue4 and spine-cpp? Please make sure you are using spine-ue4 and spine-cpp from this branch:
                https://github.com/EsotericSoftware/spine-runtimes/tree/4.0

                Remember you have to copy spine-cpp to the spine-ue4 plugin as described here:
                spine-ue4 Runtime Documentation

                oh..I'm sure, I download only 4.0 plugin from github. If the plugin and runtime version is different, the json files can't be load, I can run perfectly in PC too. But are you try to packaged play in anroid device? I guess something happend when package...maybe :think:

              • I use the latest spine plugin in my project, and i can't beleive it will be crashed in mobile package! :scared:
                it's seems that the crash timing is when the widget start to load and some data is missing.
                My game engine is Unreal 4.26.
                Here is the logcat in android device.
                😢 😢 😢
                I really really really really really need help!!

                2022-07-14 14:29:03.152 24370-24370/? A/DEBUG:       #00 pc 0000000007f90d58  /data/app/~~wCvI8k5lHjmR_nVXHmhv9Q==/MyProject==/lib/arm64/libUE4.so (spine::HashMap<spine::AnimationStateData::AnimationPair, float>::find(spine::AnimationStateData::AnimationPair const&)+28) (BuildId: 6e04cbc103d5837f143e6475077ad16ece8332a2)
                2022-07-14 14:29:03.152 24370-24370/? A/DEBUG:       #01 pc 0000000007f495cc  /data/app/~~wCvI8k5lHjmR_nVXHmhv9Q==/MyProject==/lib/arm64/libUE4.so (spine::AnimationStateData::setMix(spine::Animation*, spine::Animation*, float)+84) (BuildId: 6e04cbc103d5837f143e6475077ad16ece8332a2)
                2022-07-14 14:29:03.152 24370-24370/? A/DEBUG:       #02 pc 0000000007f36eb8  /data/app/~~wCvI8k5lHjmR_nVXHmhv9Q==/MyProject==/lib/arm64/libUE4.so (USpineSkeletonDataAsset::SetMixes(spine::AnimationStateData*)+912) (BuildId: 6e04cbc103d5837f143e6475077ad16ece8332a2)
                2022-07-14 14:29:03.152 24370-24370/? A/DEBUG:       #03 pc 0000000007f22948  /data/app/~~wCvI8k5lHjmR_nVXHmhv9Q==/MyProject==/lib/arm64/libUE4.so (USpineSkeletonDataAsset::GetSkeletonData(spine::Atlas*)+1036) (BuildId: 6e04cbc103d5837f143e6475077ad16ece8332a2)
                2022-07-14 14:29:03.152 24370-24370/? A/DEBUG:       #04 pc 0000000007f3c88c  /data/app/~~wCvI8k5lHjmR_nVXHmhv9Q==/MyProject==/lib/arm64/libUE4.so (USpineWidget::CheckState()+100) (BuildId: 6e04cbc103d5837f143e6475077ad16ece8332a2)
                2022-07-14 14:29:03.152 24370-24370/? A/DEBUG:       #05 pc 0000000007f3b4dc  /data/app/~~wCvI8k5lHjmR_nVXHmhv9Q==/MyProject==/lib/arm64/libUE4.so (USpineWidget::SynchronizeProperties()+60) (BuildId: 6e04cbc103d5837f143e6475077ad16ece8332a2)
                2022-07-14 14:29:03.152 24370-24370/? A/DEBUG:       #06 pc 000000000b88051c  /data/app/~~wCvI8k5lHjmR_nVXHmhv9Q==/MyProject==/lib/arm64/libUE4.so (UWidget::TakeWidget_Private(TFunctionRef<TSharedPtr<SObjectWidget, (ESPMode)1> (UUserWidget*, TSharedRef<SWidget, (ESPMode)1>)>)+1340) (BuildId: 6e04cbc103d5837f143e6475077ad16ece8332a2)
                2022-07-14 14:29:03.152 24370-24370/? A/DEBUG:       #07 pc 000000000b8350d4  /data/app/~~wCvI8k5lHjmR_nVXHmhv9Q==/MyProject==/lib/arm64/libUE4.so (UCanvasPanelSlot::BuildSlot(TSharedRef<SConstraintCanvas, (ESPMode)1>)+264) (BuildId: 6e04cbc103d5837f143e6475077ad16ece8332a2)
                2022-07-14 14:29:03.152 24370-24370/? A/DEBUG:       #08 pc 000000000b8356e4  /data/app/~~wCvI8k5lHjmR_nVXHmhv9Q==/MyProject==/lib/arm64/libUE4.so (UCanvasPanel::RebuildWidget()+720) (BuildId: 6e04cbc103d5837f143e6475077ad16ece8332a2)
                2022-07-14 14:29:03.152 24370-24370/? A/DEBUG:       #09 pc 000000000b880090  /data/app/~~wCvI8k5lHjmR_nVXHmhv9Q==/MyProject==/lib/arm64/libUE4.so (UWidget::TakeWidget_Private(TFunctionRef<TSharedPtr<SObjectWidget, (ESPMode)1> (UUserWidget*, TSharedRef<SWidget, (ESPMode)1>)>)+176) (BuildId: 6e04cbc103d5837f143e6475077ad16ece8332a2)
                2022-07-14 14:29:03.152 24370-24370/? A/DEBUG:       #10 pc 000000000b8350d4  /data/app/~~wCvI8k5lHjmR_nVXHmhv9Q==/MyProject==/lib/arm64/libUE4.so (UCanvasPanelSlot::BuildSlot(TSharedRef<SConstraintCanvas, (ESPMode)1>)+264) (BuildId: 6e04cbc103d5837f143e6475077ad16ece8332a2)
                2022-07-14 14:29:03.152 24370-24370/? A/DEBUG:       #11 pc 000000000b8356e4  /data/app/~~wCvI8k5lHjmR_nVXHmhv9Q==/MyProject==/lib/arm64/libUE4.so (UCanvasPanel::RebuildWidget()+720) (BuildId: 6e04cbc103d5837f143e6475077ad16ece8332a2)
                2022-07-14 14:29:03.152 24370-24370/? A/DEBUG:       #12 pc 000000000b880090  /data/app/~~wCvI8k5lHjmR_nVXHmhv9Q==/MyProject==/lib/arm64/libUE4.so (UWidget::TakeWidget_Private(TFunctionRef<TSharedPtr<SObjectWidget, (ESPMode)1> (UUserWidget*, TSharedRef<SWidget, (ESPMode)1>)>)+176) (BuildId: 6e04cbc103d5837f143e6475077ad16ece8332a2)
                2022-07-14 14:29:03.152 24370-24370/? A/DEBUG:       #13 pc 000000000b8a65d8  /data/app/~~wCvI8k5lHjmR_nVXHmhv9Q==/MyProject==/lib/arm64/libUE4.so (UUserWidget::RebuildWidget()+292) (BuildId: 6e04cbc103d5837f143e6475077ad16ece8332a2)
                2022-07-14 14:29:03.152 24370-24370/? A/DEBUG:       #14 pc 000000000b880090  /data/app/~~wCvI8k5lHjmR_nVXHmhv9Q==/MyProject==/lib/arm64/libUE4.so (UWidget::TakeWidget_Private(TFunctionRef<TSharedPtr<SObjectWidget, (ESPMode)1> (UUserWidget*, TSharedRef<SWidget, (ESPMode)1>)>)+176) (BuildId: 6e04cbc103d5837f143e6475077ad16ece8332a2)
                2022-07-14 14:29:03.152 24370-24370/? A/DEBUG:       #15 pc 000000000b8350d4  /data/app/~~wCvI8k5lHjmR_nVXHmhv9Q==/MyProject==/lib/arm64/libUE4.so (UCanvasPanelSlot::BuildSlot(TSharedRef<SConstraintCanvas, (ESPMode)1>)+264) (BuildId: 6e04cbc103d5837f143e6475077ad16ece8332a2)
                2022-07-14 14:29:03.152 24370-24370/? A/DEBUG:       #16 pc 000000000b8356e4  /data/app/~~wCvI8k5lHjmR_nVXHmhv9Q==/MyProject==/lib/arm64/libUE4.so (UCanvasPanel::RebuildWidget()+720) (BuildId: 6e04cbc103d5837f143e6475077ad16ece8332a2)
                2022-07-14 14:29:03.152 24370-24370/? A/DEBUG:       #17 pc 000000000b880090  /data/app/~~wCvI8k5lHjmR_nVXHmhv9Q==/MyProject==/lib/arm64/libUE4.so (UWidget::TakeWidget_Private(TFunctionRef<TSharedPtr<SObjectWidget, (ESPMode)1> (UUserWidget*, TSharedRef<SWidget, (ESPMode)1>)>)+176) (BuildId: 6e04cbc103d5837f143e6475077ad16ece8332a2)
                2022-07-14 14:29:03.152 24370-24370/? A/DEBUG:       #18 pc 000000000b8a65d8  /data/app/~~wCvI8k5lHjmR_nVXHmhv9Q==/MyProject==/lib/arm64/libUE4.so (UUserWidget::RebuildWidget()+292) (BuildId: 6e04cbc103d5837f143e6475077ad16ece8332a2)
                2022-07-14 14:29:03.152 24370-24370/? A/DEBUG:       #19 pc 000000000b880090  /data/app/~~wCvI8k5lHjmR_nVXHmhv9Q==/MyProject==/lib/arm64/libUE4.so (UWidget::TakeWidget_Private(TFunctionRef<TSharedPtr<SObjectWidget, (ESPMode)1> (UUserWidget*, TSharedRef<SWidget, (ESPMode)1>)>)+176) (BuildId: 6e04cbc103d5837f143e6475077ad16ece8332a2)
                2022-07-14 14:29:03.152 24370-24370/? A/DEBUG:       #20 pc 000000000b8a7eb0  /data/app/~~wCvI8k5lHjmR_nVXHmhv9Q==/MyProject==/lib/arm64/libUE4.so (UUserWidget::AddToScreen(ULocalPlayer*, int)+2604) (BuildId: 6e04cbc103d5837f143e6475077ad16ece8332a2)
                2022-07-14 14:29:03.152 24370-24370/? A/DEBUG:       #21 pc 000000000b9731ec  /data/app/~~wCvI8k5lHjmR_nVXHmhv9Q==/MyProject==/lib/arm64/libUE4.so (UUserWidget::execAddToViewport(UObject*, FFrame&, void*)+124) (BuildId: 6e04cbc103d5837f143e6475077ad16ece8332a2)
                2022-07-14 14:29:03.152 24370-24370/? A/DEBUG:       #22 pc 00000000092afe38  /data/app/~~wCvI8k5lHjmR_nVXHmhv9Q==/MyProject==/lib/arm64/libUE4.so (UFunction::Invoke(UObject*, FFrame&, void*)+124) (BuildId: 6e04cbc103d5837f143e6475077ad16ece8332a2)
                2022-07-14 14:29:03.152 24370-24370/? A/DEBUG:       #23 pc 00000000094896b4  /data/app/~~wCvI8k5lHjmR_nVXHmhv9Q==/MyProject==/lib/arm64/libUE4.so (UObject::ProcessEvent(UFunction*, void*)+3900) (BuildId: 6e04cbc103d5837f143e6475077ad16ece8332a2)
                2022-07-14 14:29:03.152 24370-24370/? A/DEBUG:       #24 pc 0000000007df2744  /data/app/~~wCvI8k5lHjmR_nVXHmhv9Q==/MyProject==/lib/arm64/libUE4.so (FFunctionDesc::CallUE(lua_State*, int, void*)+680) (BuildId: 6e04cbc103d5837f143e6475077ad16ece8332a2)
                2022-07-14 14:29:03.152 24370-24370/? A/DEBUG:       #25 pc 0000000007df2298  /data/app/~~wCvI8k5lHjmR_nVXHmhv9Q==/MyProject==/lib/arm64/libUE4.so (Class_CallUFunction(lua_State*)+136) (BuildId: 6e04cbc103d5837f143e6475077ad16ece8332a2)
                2022-07-14 14:29:03.152 24370-24370/? A/DEBUG:       #26 pc 000000000da17798  /data/app/~~wCvI8k5lHjmR_nVXHmhv9Q==/MyProject==/lib/arm64/libUE4.so (BuildId: 6e04cbc103d5837f143e6475077ad16ece8332a2)
                2022-07-14 14:29:03.152 24370-24370/? A/DEBUG:       #27 pc 000000000da3a61c  /data/app/~~wCvI8k5lHjmR_nVXHmhv9Q==/MyProject==/lib/arm64/libUE4.so (BuildId: 6e04cbc103d5837f143e6475077ad16ece8332a2)
                2022-07-14 14:29:03.152 24370-24370/? A/DEBUG:       #28 pc 000000000da179b0  /data/app/~~wCvI8k5lHjmR_nVXHmhv9Q==/MyProject==/lib/arm64/libUE4.so (BuildId: 6e04cbc103d5837f143e6475077ad16ece8332a2)
                2022-07-14 14:29:03.152 24370-24370/? A/DEBUG:       #29 pc 000000000da169d4  /data/app/~~wCvI8k5lHjmR_nVXHmhv9Q==/MyProject==/lib/arm64/libUE4.so (BuildId: 6e04cbc103d5837f143e6475077ad16ece8332a2)
                2022-07-14 14:29:03.152 24370-24370/? A/DEBUG:       #30 pc 000000000da18104  /data/app/~~wCvI8k5lHjmR_nVXHmhv9Q==/MyProject==/lib/arm64/libUE4.so (BuildId: 6e04cbc103d5837f143e6475077ad16ece8332a2)
                2022-07-14 14:29:03.152 24370-24370/? A/DEBUG:       #31 pc 000000000da089e8  /data/app/~~wCvI8k5lHjmR_nVXHmhv9Q==/MyProject==/lib/arm64/libUE4.so (lua_pcallk+256) (BuildId: 6e04cbc103d5837f143e6475077ad16ece8332a2)
                2022-07-14 14:29:03.152 24370-24370/? A/DEBUG:       #32 pc 0000000008a26598  /data/app/~~wCvI8k5lHjmR_nVXHmhv9Q==/MyProject==/lib/arm64/libUE4.so (FLuaUtils::CallLuaOverride(UFunction*, void*, int, int)+1732) (BuildId: 6e04cbc103d5837f143e6475077ad16ece8332a2)
                2022-07-14 14:29:03.152 24370-24370/? A/DEBUG:       #33 pc 0000000007b3b368  /data/app/~~wCvI8k5lHjmR_nVXHmhv9Q==/MyProject==/lib/arm64/libUE4.so (void TScriptDelegate<FWeakObjectPtr>::ProcessDelegate<UObject>(void*) const+136) (BuildId: 6e04cbc103d5837f143e6475077ad16ece8332a2)
                2022-07-14 14:29:03.153 24370-24370/? A/DEBUG:       #34 pc 0000000008a21e14  /data/app/~~wCvI8k5lHjmR_nVXHmhv9Q==/MyProject==/lib/arm64/libUE4.so (UGameAssetMgr::OnOneSoftPathAssetLoaded(FName)+980) (BuildId: 6e04cbc103d5837f143e6475077ad16ece8332a2)
                2022-07-14 14:29:03.153 24370-24370/? A/DEBUG:       #35 pc 0000000008a7f5d8  /data/app/~~wCvI8k5lHjmR_nVXHmhv9Q==/MyProject==/lib/arm64/libUE4.so (TBaseUObjectMethodDelegateInstance<false, UGameAssetMgr, void (), FDefaultDelegateUserPolicy, FName>::ExecuteIfSafe() const+52) (BuildId: 6e04cbc103d5837f143e6475077ad16ece8332a2)
                2022-07-14 14:29:03.153 24370-24370/? A/DEBUG:       #36 pc 000000000cc42a68  /data/app/~~wCvI8k5lHjmR_nVXHmhv9Q==/MyProject==/lib/arm64/libUE4.so (FStreamableDelegateDelayHelper::Tick(float)+552) (BuildId: 6e04cbc103d5837f143e6475077ad16ece8332a2)
                2022-07-14 14:29:03.153 24370-24370/? A/DEBUG:       #37 pc 000000000ccccef0  /data/app/~~wCvI8k5lHjmR_nVXHmhv9Q==/MyProject==/lib/arm64/libUE4.so (FTickableGameObject::TickObjects(UWorld*, int, bool, float)+2512) (BuildId: 6e04cbc103d5837f143e6475077ad16ece8332a2)
                2022-07-14 14:29:03.153 24370-24370/? A/DEBUG:       #38 pc 000000000c350650  /data/app/~~wCvI8k5lHjmR_nVXHmhv9Q==/MyProject==/lib/arm64/libUE4.so (UGameEngine::Tick(float, bool)+9168) (BuildId: 6e04cbc103d5837f143e6475077ad16ece8332a2)
                2022-07-14 14:29:03.153 24370-24370/? A/DEBUG:       #39 pc 0000000007af2048  /data/app/~~wCvI8k5lHjmR_nVXHmhv9Q==/MyProject==/lib/arm64/libUE4.so (FEngineLoop::Tick()+34556) (BuildId: 6e04cbc103d5837f143e6475077ad16ece8332a2)
                2022-07-14 14:29:03.153 24370-24370/? A/DEBUG:       #40 pc 0000000007ae8118  /data/app/~~wCvI8k5lHjmR_nVXHmhv9Q==/MyProject==/lib/arm64/libUE4.so (AndroidMain(android_app*)+4192) (BuildId: 6e04cbc103d5837f143e6475077ad16ece8332a2)
                2022-07-14 14:29:03.153 24370-24370/? A/DEBUG:       #41 pc 0000000007af8c9c  /data/app/~~wCvI8k5lHjmR_nVXHmhv9Q==/MyProject==/lib/arm64/libUE4.so (android_main+160) (BuildId: 6e04cbc103d5837f143e6475077ad16ece8332a2)
                2022-07-14 14:29:03.153 24370-24370/? A/DEBUG:       #42 pc 0000000007b25744  /data/app/~~wCvI8k5lHjmR_nVXHmhv9Q==/MyProject==/lib/arm64/libUE4.so (BuildId: 6e04cbc103d5837f143e6475077ad16ece8332a2)
                2022-07-14 14:29:03.153 24370-24370/? A/DEBUG:       #43 pc 00000000000eb868  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+64) (BuildId: a790cdbd8e44ea8a90802da343cb82ce)
                2022-07-14 14:29:03.153 24370-24370/? A/DEBUG:       #44 pc 000000000008ba88  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: a790cdbd8e44ea8a90802da343cb82ce)
                

                Spine character version is 4.0.17. Just now i used SpineViewer APP in my mobile, and this app crash too and hint error message

                com.badlogic.gdx.utils.SerializationException:Error reading animation: move
                

                is my spine animation data has some wrong? how can i fix this problem? :think:


                By the way, plugin version is 4.0. According to github, it's will be ok. but... you know.....