Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not Working in -batchmode commandline arguments. #86

Open
vikz91 opened this issue Jul 9, 2018 · 1 comment
Open

Not Working in -batchmode commandline arguments. #86

vikz91 opened this issue Jul 9, 2018 · 1 comment

Comments

@vikz91
Copy link

vikz91 commented Jul 9, 2018

What happened?

NullReferenceException: Object reference not set to an instance of an object
at UnityEngine.Recorder.Input.GameViewSize.get_currentSize () [0x00008]

This is the error I get when I try to run the editor in batchmode.

What I am trying to do:
Export a Video Render based on a scene, from command line.

This works fine without the -batchmode command argument.

This is my Editor Script

public class RenderEngine
{
    [@MenuItem("Tools/ExportRender")]
    public static void DoRender()
    {
        EditorSceneManager.OpenScene("Assets/StaticScene.unity");

        if (!EditorApplication.isPlaying)
        {
            EditorApplication.isPlaying = true;
        }
    }
}

I have setup a Scene where I am using a camera with playableDirector and timeline which is a simple animation of the camera. I have also setup recorder clip to export it outside. So essentially when I play the scene, this exports a video. So, I am trying to play the scene by opening it in command line.

/Applications/Unity/Hub/Editor/2018.2.0b9/Unity.app/Contents/MacOS/Unity  -projectPath  <projectPath>   -executeMethod RenderEngine.DoRender -logFile ./piplineExportOutput.txt -batchmode

Released package version / tag?

OS: MacOS 10.13.5 (17F77)
Unity: 2018.2.0b9
RecorderVersion: 0.2.0032

@Bluefriend
Copy link

Bluefriend commented Jul 25, 2018

I'm using Recorder with batchmode.

There is a collection method option in Timeline recorder track.
Choose sampling (off screen) option instead of Game view option.

OS : Windows 10
Unity : 2018.2
RecorderVersion : Asset Store version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants