playMaker

Author Topic: Playmaker 1.9.4.f2 in Unity 2019.3 and prefab preprocess/build errors  (Read 2252 times)

lukew

  • Playmaker Newbie
  • *
  • Posts: 42
Unity 2019.3.12
Playmaker 1.9.4.f2

Hi,

After upgrading Playmaker to the latest version (1.9.4.f2) I'm seeing some weird behaviour and errors with preprocessing prefabs/fsms (when building an app and when using the tools).

I've tested this on my main project, another project and one new clean project.

When I try to build the player the player is built but the editor is not responding after the build process (editor window needs to be moved/resized to refresh the gui after any action)
and just after the prefab preprocess log entry there are errors like:

Assertion failed on expression: '!AssetInterface::Get().IsLocked()'
Assertion failed on expression: 'GetApplication().MayUpdate()'
Assertion failed on expression: '!performAutorepaint || GetApplication().MayUpdate()'

After this I need to restart the editor so it works again.

Same things happen when I try to use 'Preprocess all prefabs in build' option. Editor freezes same as while building the app (but without any console errors).

I've tested this on a completely new and clean project and it's same. It just needs literally one prefab with FSM in the project to trigger this.

Edit: just tested it again on a new project. It doesn't need any templates/prefabs. It freezes the editor while trying to use 'Preprocess All Prefab FSMs' on a completely fresh project, just after installing Playmaker.

I've tested this on Unity 2021.2 and 1.9.4.f2 and I can't replicate this. I want to update my project to Unity 2021.2 but first I would like to know what's wrong.

Is this a known issue by any chance and 2019.3 has this problem with 1.9.4.f2?
« Last Edit: February 07, 2022, 03:52:33 PM by lukew »

lukew

  • Playmaker Newbie
  • *
  • Posts: 42
Re: Playmaker 1.9.4.f2 in Unity 2019.3 and prefab preprocess/build errors
« Reply #1 on: February 07, 2022, 12:08:58 PM »
Tested it again on another new and clean project. Same results with just one simple prefab with FSM (I've created new prefab with FSM component and added few empty states to it):

Here's the console after building. Editor is not responsive (Unity window needs to be moved/resized to refresh after any action). Same behaviour as I mentioned earlier. It's still combination of Unity 2019.3.12 and Playmaker 1.9.4.f2

« Last Edit: February 07, 2022, 03:52:52 PM by lukew »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: Playmaker 1.9.4.f2 in Unity 2019.3 and prefab preprocess/build errors
« Reply #2 on: February 07, 2022, 04:39:33 PM »
Hi.
I have send a message to Alex to have a look at this.

lukew

  • Playmaker Newbie
  • *
  • Posts: 42
Re: Playmaker 1.9.4.f2 in Unity 2019.3 and prefab preprocess/build errors
« Reply #3 on: February 08, 2022, 06:23:34 PM »
Hi djaydino,

Thanks for the update.

I was trying to find any hints that could be helpful but I didn't find anything new. I hope that Alex can find a solution/fix for this :)
« Last Edit: February 08, 2022, 06:29:08 PM by lukew »

lukew

  • Playmaker Newbie
  • *
  • Posts: 42
Re: Playmaker 1.9.4.f2 in Unity 2019.3 and prefab preprocess/build errors
« Reply #4 on: February 11, 2022, 10:30:04 AM »
I'm mostly concerned about two things regarding this issue.

1. Is it possible that this error did/can do any 'damage' to prefabs or templates? I don't see any problems for now both in the play mode and while looking at the files (prefabs and templates) in the text editor.

2. Can I safely upgrade from 2019.3 to 2021.2 now before this error is fixed/solution is known? Is there any chance that this issue is somehow problematic for the update?

I have found this problem during the preparation for the update from 2019.3 to 2021.2. I always update Playmaker to the latest version before upgrading Unity (as suggested). Now the Unity upgrade is on hold because of this problem.

I could just upgrade Unity and check how it goes but my project has 200+ Playmaker templates and 100+ prefabs that use fsms/templates so I'm generally careful with plugin and editor updates to avoid situations when something wrong is found many weeks/months after upgrade.  :)

BTW.
I've noticed that after this error happens during the build process Unity is re-importing some prefabs (prefabs which were preprocessed by Playmaker while building) after relaunching the editor.

Thanks
« Last Edit: February 11, 2022, 11:02:32 AM by lukew »

lukew

  • Playmaker Newbie
  • *
  • Posts: 42
Re: Playmaker 1.9.4.f2 in Unity 2019.3 and prefab preprocess/build errors
« Reply #5 on: March 04, 2022, 05:37:01 AM »
I found what is causing the problem.

PlayMakerProjectTools.cs and DoPreprocessPrefabFSMsInBuild function:

1.9.0.p20


Code: [Select]
    AssetDatabase.StartAssetEditing();

    report += DoPreprocessPrefabFSMs(prefabs);

    AssetDatabase.StopAssetEditing();


1.9.4.f2

Code: [Select]
try
{
    AssetDatabase.StartAssetEditing();

    report += DoPreprocessPrefabFSMs(prefabs);
}
finally
{
    StopAssetEditing();
}

and

Code: [Select]
private static void StopAssetEditing()
{
    if (EditorApplication.isUpdating)
    {
        EditorApplication.delayCall += StopAssetEditing;
        return;
    }
           
    AssetDatabase.StopAssetEditing();
}


It's about 'EditorApplication.delayCall += StopAssetEditing;'.

Unity 2019.3.12 has some problems when using 'EditorApplication.delayCall' with 'AssetDatabase.StopAssetEditing' and makes the editor unresponsive. It works fine if I just skip it. Older Playmaker version wasn't using delayCall there.

It's possible that it's only related to 2019.3.12 or versions that were released in similar time as I don't see any similar bug reports.
« Last Edit: March 04, 2022, 06:09:45 AM by lukew »