Events must be registered on the main thread. ERROR

Need help with Cinema Face Cap or want to help others? Check here for solutions, suggestions, etc. and help your fellow community members!

Events must be registered on the main thread. ERROR

Postby edgrimaldi » Wed Dec 07, 2016 12:38 am

Not off to a great start.

I was able to install and start Cinema Face Cap and for a short time, was able to control the point cloud and android head. When it was "working" it was incredibly jittery, and no adjustment I made to the smoothing or jitter settings helped. The results looked nothing like the video. My machine is a beast and far exceeds what was described in the tutorial video, so I doubt that is it.

Nevertheless, after attempting to map blend shapes for an iClone character, which the video seemed to suggest was compatible, I threw in the towel after guessing at about 8 or the 20 blendshapes names which all seemed to bear zero similarity with Cinema Face Cap. After doing so, the software simply stopped working. The green rect no longer appears, the point cloud no longer appears and nothing is controllable with the Kinect.


All I can contribute to helping find the problem is a lone error that appears in the logs.

>> Events must be registered on the main thread. <<

Which is thrown in at line 40, within the EnsureInitialized method of the EventPump.cs script.

Code: Select all

 public static void EnsureInitialized()
        {
            try
            {
                if (EventPump.Instance == null)
                {
                    lock (s_Lock)
                    {
                        if (EventPump.Instance == null)
                        {
                            UnityEngine.GameObject parent = new UnityEngine.GameObject("Kinect Desktop Event Pump");
                            EventPump.Instance = parent.AddComponent<Helper.EventPump>();
                            DontDestroyOnLoad(parent);
                        }
                    }
                }
            }
            catch
            {
                UnityEngine.Debug.LogError("Events must be registered on the main thread.");
                return;
            }
        }



Here is what I have tried:
Deleting and reimporting cinema face cap.
Launching cinema face cap in a new empty project
Closing and relaunching unity
Reinstalling Kinect SDK
Restarting Machine
Unplugging and re connecting the Kinect

Incidentally... I can see that the Kinect is connected because the camera image appears in the display window of cinema face cap and I get the following log messages:

Starting your device...
Device started.

The error I describe happen in between these two log messages.
I've attached a screenshot of the console.

Any suggestions?
Attachments
facecap error.png
facecap error.png (19.69 KiB) Viewed 338 times
edgrimaldi
 
Posts: 11
Joined: Fri Dec 02, 2016 10:15 am

Re: Events must be registered on the main thread. ERROR

Postby edgrimaldi » Wed Dec 07, 2016 1:39 pm

I learned that the line of code throwing the error was the DontDestroyOnLoad method. So I added a catch exception to the try / catch and found this as the debug output:

Events must be registered on the main thread. -- System.InvalidOperationException: The following game object is invoking the DontDestroyOnLoad method: Kinect Desktop Event Pump. Notice that DontDestroyOnLoad can only be used in play mode and, as such, cannot be part of an editor script.

I'm not sure how related this is to my problem, just wanted to give as much info as possible.

Aside of it not working, everything seems to be quite fine. << (dumbest thing I've ever typed into a support thread.)

Hope someone responds soon, we are excited to become productive with this asset.

Eddie G
edgrimaldi
 
Posts: 11
Joined: Fri Dec 02, 2016 10:15 am

Re: Events must be registered on the main thread. ERROR

Postby adrian » Wed Dec 07, 2016 5:36 pm

Hi Eddie,

Sorry that you are having issues. It is strange that it would work and then all of a sudden not. I will take a look into this, and get back to you soon.

can you just tell me what version of Unity you are using? Are you in Unity playmode while experiencing the issue?
adrian
 
Posts: 398
Joined: Thu Sep 05, 2013 8:47 am

Re: Events must be registered on the main thread. ERROR

Postby edgrimaldi » Wed Dec 07, 2016 6:18 pm

It is Unity 5.4.1 When you say Unity "playmode" I didn't think this was something you used while the game was running. Am I misunderstanding "Unity playmode"? The only other "playmode" I'm aware of is Animation.Play, which I don't think is relevant at the time of capture. No?

For the hell of it, I just tried using Cinema Facecap with the game running (after pressing play in an empty scene). The error goes away (and the DontDestroyOnLoad is created) but still.... nothing happens. No point cloud appears when I Generate it, even though the object is created in hierarchy. No errors either. Just no responsiveness from the editor extension. The Kinect view is filled and working but the green rect doesn't appear.
Last edited by edgrimaldi on Wed Dec 07, 2016 6:27 pm, edited 1 time in total.
edgrimaldi
 
Posts: 11
Joined: Fri Dec 02, 2016 10:15 am

Re: Events must be registered on the main thread. ERROR

Postby adrian » Wed Dec 07, 2016 6:27 pm

Thanks. I am just experimenting to try and recreate the issue. I am just making sure that you weren't trying to use it while in playmode.
adrian
 
Posts: 398
Joined: Thu Sep 05, 2013 8:47 am

Re: Events must be registered on the main thread. ERROR

Postby adrian » Wed Dec 07, 2016 6:46 pm

Is there a game object added to your scene called "Kinect Desktop event pump" when you try to turn the kinect on? This is the game object that feeds data to the face cap app.
Is the image viewer updating? I just want to make sure that the app is updating normally.

The missing green box, and no point cloud items being shown are both symptoms of the app not being able to detect a face. So either there is some bug stopping it, or it is having trouble actually detecting a face in your environment.

This may seem weird, but after turning on the kinect, step back and away from it so that it can see your entire body, then approach it afterwards. This may help the device find a face more easily and can help give some clues as to what is going wrong.
adrian
 
Posts: 398
Joined: Thu Sep 05, 2013 8:47 am

Re: Events must be registered on the main thread. ERROR

Postby edgrimaldi » Wed Dec 07, 2016 7:24 pm

I'm not at the machine at the moment, but yes, the "Kinect Desktop event pump" is created and when you say "image viewer updating" I assume you mean I can see what the Kinect sees in the small monitor in the editor. Yes. It's a live feed.

I saw the recommendation to step back and away so the Kinect could find me, and I've done that. I've made some really strange faces at it, so at one point, I thought it was just insulted. But yes. I've done that.

The point cloud however, is not there. There are no points. For the brief time things worked, when the Kinect lost tack my face, the points were still on screen, just not moving. Now, there are no visible points.

Does that observation help?
edgrimaldi
 
Posts: 11
Joined: Fri Dec 02, 2016 10:15 am

Re: Events must be registered on the main thread. ERROR

Postby adrian » Wed Dec 07, 2016 8:25 pm

I am working on a version that will output more logging, so that we can follow along with what is happening for you. I will email it to you tomorrow morning.
adrian
 
Posts: 398
Joined: Thu Sep 05, 2013 8:47 am

Re: Events must be registered on the main thread. ERROR

Postby Jamshid » Mon Mar 20, 2017 9:32 am

Today I also bought face cap. The same issue we have faced. Can you help me. Any suggestions.
Unity version: 5.5.1
Kinect 2
Jamshid
 
Posts: 1
Joined: Mon Mar 20, 2017 9:29 am

Re: Events must be registered on the main thread. ERROR

Postby adrian » Wed Mar 22, 2017 2:25 am

Hi Jamshid,

Please email me: adrian@cinema-suite.com so I can provide you with a version to help us solve the issue. We were never able to recreate it and never heard back from OP.

thanks!
adrian
 
Posts: 398
Joined: Thu Sep 05, 2013 8:47 am


Return to Help

Who is online

Users browsing this forum: No registered users and 1 guest

cron