GetPath() public method

public GetPath ( ) : string
return string
Exemplo n.º 1
0
        public override string GetOutputPath()
        {
            string ret = m_outputDir.GetPath();

            if (ret.Length > 0)
            {
                ret += "/";
            }
            ret += m_output_file;
            return(ret);
        }
Exemplo n.º 2
0
        void DoExport()
        {
            Debug.Log("ExrOffscreenRecorder: exporting frame " + Time.frameCount);

            string dir = m_outputDir.GetPath();
            string ext = Time.frameCount.ToString("0000") + ".exr";

            if (m_callbacks == null)
            {
                m_callbacks = new int[m_scratch_buffers.Length * 6];
            }
            for (int i = 0; i < m_scratch_buffers.Length; ++i)
            {
                int    i6   = i * 6;
                string path = dir + "/" + m_outputFilename + "[" + i + "]_" + ext;
                var    rt   = m_scratch_buffers[i];

                m_callbacks[i6 + 0] = fcAPI.fcExrBeginFrame(m_ctx, path, rt.width, rt.height, m_callbacks[i6 + 0]);
                m_callbacks[i6 + 1] = fcAPI.fcExrAddLayerTexture(m_ctx, rt, 0, "R", m_callbacks[i6 + 1]);
                m_callbacks[i6 + 2] = fcAPI.fcExrAddLayerTexture(m_ctx, rt, 1, "G", m_callbacks[i6 + 2]);
                m_callbacks[i6 + 3] = fcAPI.fcExrAddLayerTexture(m_ctx, rt, 2, "B", m_callbacks[i6 + 3]);
                m_callbacks[i6 + 4] = fcAPI.fcExrAddLayerTexture(m_ctx, rt, 3, "A", m_callbacks[i6 + 4]);
                m_callbacks[i6 + 5] = fcAPI.fcExrEndFrame(m_ctx, m_callbacks[i6 + 5]);
            }
            for (int i = 0; i < m_callbacks.Length; ++i)
            {
                GL.IssuePluginEvent(fcAPI.fcGetRenderEventFunc(), m_callbacks[i]);
            }
        }
Exemplo n.º 3
0
        void DoExport()
        {
            Debug.Log("PngOffscreenRecorder: exporting frame " + Time.frameCount);

            string dir = m_outputDir.GetPath();
            string ext = Time.frameCount.ToString("0000") + ".png";

            if (m_callbacks == null)
            {
                m_callbacks = new int[m_scratch_buffers.Length];
            }
            for (int i = 0; i < m_callbacks.Length; ++i)
            {
                string path = dir + "/" + m_outputFilename + "[" + i + "]_" + ext;
                m_callbacks[i] = fcAPI.fcPngExportTexture(m_ctx, path, m_scratch_buffers[i], m_callbacks[i]);
                GL.IssuePluginEvent(fcAPI.fcGetRenderEventFunc(), m_callbacks[i]);
            }
        }
Exemplo n.º 4
0
        void DoExport()
        {
            Debug.Log("PngRecorder: exporting frame " + Time.frameCount);

            string dir = m_outputDir.GetPath();
            string ext = Time.frameCount.ToString("0000") + ".png";

            // callback for frame buffer
            {
                string path = dir + "/FrameBuffer_" + ext;
                if (m_callbacks_fb == null)
                {
                    m_callbacks_fb = new int[1];
                }
                m_callbacks_fb[0] = fcAPI.fcPngExportTexture(m_ctx, path, m_frame_buffer, m_callbacks_fb[0]);
                GL.IssuePluginEvent(fcAPI.fcGetRenderEventFunc(), m_callbacks_fb[0]);
            }

            // callbacks for gbuffer
            {
                string[] path = new string[] {
                    dir + "/Albedo_" + ext,
                    dir + "/Occlusion_" + ext,
                    dir + "/Specular_" + ext,
                    dir + "/Smoothness_" + ext,
                    dir + "/Normal_" + ext,
                    dir + "/Emission_" + ext,
                    dir + "/Depth_" + ext,
                };
                if (m_callbacks_gb == null)
                {
                    m_callbacks_gb = new int[m_gbuffer.Length];
                }
                for (int i = 0; i < m_callbacks_gb.Length; ++i)
                {
                    m_callbacks_gb[i] = fcAPI.fcPngExportTexture(m_ctx, path[i], m_gbuffer[i], m_callbacks_gb[i]);
                    GL.IssuePluginEvent(fcAPI.fcGetRenderEventFunc(), m_callbacks_gb[i]);
                }
            }
        }
Exemplo n.º 5
0
        IEnumerator Authorize()
        {
            bool authorized = false;

            // 保存された token が有効かチェック
            auth_state = AuthStateCode.VerifyCredentialsBegin;
            TweetMediaPlugin.tmLoadCredentials(m_ctx, m_credentialFile.GetPath());
            TweetMediaPlugin.tmVerifyCredentialsAsync(m_ctx);
            while (enabled)
            {
                var state = TweetMediaPlugin.tmGetVerifyCredentialsState(m_ctx);
                if (state.code == TweetMediaPlugin.tmEStatusCode.InProgress)
                {
                    yield return(0);
                }
                else
                {
                    if (state.code == TweetMediaPlugin.tmEStatusCode.Succeeded)
                    {
                        authorized = true;
                        auth_state = AuthStateCode.VerifyCredentialsSucceeded;
                    }
                    else
                    {
                        m_error_message = state.error_message;
                        auth_state      = AuthStateCode.VerifyCredentialsFailed;
                    }
                    break;
                }
            }

            // token が無効な場合認証処理開始
            while (enabled && !authorized)
            {
                // 認証 URL を取得
                auth_state = AuthStateCode.RequestAuthURLBegin;
                TweetMediaPlugin.tmRequestAuthURLAsync(m_ctx, m_consumerKey, m_consumerSecret);
                while (enabled)
                {
                    var state = TweetMediaPlugin.tmGetRequestAuthURLState(m_ctx);
                    if (state.code == TweetMediaPlugin.tmEStatusCode.InProgress)
                    {
                        yield return(0);
                    }
                    else
                    {
                        if (state.code == TweetMediaPlugin.tmEStatusCode.Succeeded)
                        {
                            m_auth_url = state.auth_url;
                            auth_state = AuthStateCode.RequestAuthURLSucceeded;
                        }
                        else
                        {
                            m_error_message = state.error_message;
                            auth_state      = AuthStateCode.RequestAuthURLFailed;
                            // ここで失敗したらほとんど続けようがない (consumer key / secret が無効かネットワーク障害)
                            yield break;
                        }
                        break;
                    }
                }

                // pin の入力を待って送信
                while (enabled && m_pin.Length == 0)
                {
                    yield return(0);
                }

                m_error_message = "";
                auth_state      = AuthStateCode.EnterPINBegin;
                TweetMediaPlugin.tmEnterPinAsync(m_ctx, m_pin);
                m_pin = "";
                while (enabled)
                {
                    var state = TweetMediaPlugin.tmGetEnterPinState(m_ctx);
                    if (state.code == TweetMediaPlugin.tmEStatusCode.InProgress)
                    {
                        yield return(0);
                    }
                    else
                    {
                        if (state.code == TweetMediaPlugin.tmEStatusCode.Succeeded)
                        {
                            authorized = true;
                            TweetMediaPlugin.tmSaveCredentials(m_ctx, m_credentialFile.GetPath());
                            auth_state = AuthStateCode.EnterPINSucceeded;
                        }
                        else
                        {
                            m_error_message = state.error_message;
                            auth_state      = AuthStateCode.EnterPINFailed;
                        }
                        break;
                    }
                }
            }
        }
Exemplo n.º 6
0
 private static string GetOutputPath(DataPath directory, string name)
 {
     return(directory.GetPath() + "/" + name);
 }
Exemplo n.º 7
0
 public override string GetOutputPath()
 {
     return(m_outputDir.GetPath() + "/" + m_output_file);
 }
Exemplo n.º 8
0
        void DoExport()
        {
            Debug.Log("ExrRecorder: exporting frame " + Time.frameCount);

            string dir = m_outputDir.GetPath();
            string ext = Time.frameCount.ToString("0000") + ".exr";

            if (m_captureFramebuffer)
            {
                // callback for frame buffer
                if (m_callbacks_fb == null)
                {
                    m_callbacks_fb = new int[5];
                }
                {
                    string path = dir + "/FrameBuffer_" + ext;
                    var    rt   = m_frame_buffer;
                    m_callbacks_fb[0] = fcAPI.fcExrBeginFrame(m_ctx, path, rt.width, rt.height, m_callbacks_fb[0]);
                    m_callbacks_fb[1] = fcAPI.fcExrAddLayerTexture(m_ctx, rt, 0, "R", m_callbacks_fb[1]);
                    m_callbacks_fb[2] = fcAPI.fcExrAddLayerTexture(m_ctx, rt, 1, "G", m_callbacks_fb[2]);
                    m_callbacks_fb[3] = fcAPI.fcExrAddLayerTexture(m_ctx, rt, 2, "B", m_callbacks_fb[3]);
                    m_callbacks_fb[4] = fcAPI.fcExrEndFrame(m_ctx, m_callbacks_fb[4]);
                }
                for (int i = 0; i < m_callbacks_fb.Length; ++i)
                {
                    GL.IssuePluginEvent(fcAPI.fcGetRenderEventFunc(), m_callbacks_fb[i]);
                }
            }

            if (m_captureGBuffer)
            {
                // callbacks for gbuffer
                if (m_callbacks_gb == null)
                {
                    m_callbacks_gb = new int[29];
                }
                {
                    string path = dir + "/Albedo_" + ext;
                    var    rt   = m_gbuffer[0];
                    m_callbacks_gb[0] = fcAPI.fcExrBeginFrame(m_ctx, path, rt.width, rt.height, m_callbacks_gb[0]);
                    m_callbacks_gb[1] = fcAPI.fcExrAddLayerTexture(m_ctx, rt, 0, "R", m_callbacks_gb[1]);
                    m_callbacks_gb[2] = fcAPI.fcExrAddLayerTexture(m_ctx, rt, 1, "G", m_callbacks_gb[2]);
                    m_callbacks_gb[3] = fcAPI.fcExrAddLayerTexture(m_ctx, rt, 2, "B", m_callbacks_gb[3]);
                    m_callbacks_gb[4] = fcAPI.fcExrEndFrame(m_ctx, m_callbacks_gb[4]);
                }
                {
                    string path = dir + "/Occlusion_" + ext;
                    var    rt   = m_gbuffer[0];
                    m_callbacks_gb[5] = fcAPI.fcExrBeginFrame(m_ctx, path, rt.width, rt.height, m_callbacks_gb[5]);
                    m_callbacks_gb[6] = fcAPI.fcExrAddLayerTexture(m_ctx, rt, 3, "R", m_callbacks_gb[6]);
                    m_callbacks_gb[7] = fcAPI.fcExrEndFrame(m_ctx, m_callbacks_gb[7]);
                }
                {
                    string path = dir + "/Specular_" + ext;
                    var    rt   = m_gbuffer[1];
                    m_callbacks_gb[8]  = fcAPI.fcExrBeginFrame(m_ctx, path, rt.width, rt.height, m_callbacks_gb[8]);
                    m_callbacks_gb[9]  = fcAPI.fcExrAddLayerTexture(m_ctx, rt, 0, "R", m_callbacks_gb[9]);
                    m_callbacks_gb[10] = fcAPI.fcExrAddLayerTexture(m_ctx, rt, 1, "G", m_callbacks_gb[10]);
                    m_callbacks_gb[11] = fcAPI.fcExrAddLayerTexture(m_ctx, rt, 2, "B", m_callbacks_gb[11]);
                    m_callbacks_gb[12] = fcAPI.fcExrEndFrame(m_ctx, m_callbacks_gb[12]);
                }
                {
                    string path = dir + "/Smoothness_" + ext;
                    var    rt   = m_gbuffer[1];
                    m_callbacks_gb[13] = fcAPI.fcExrBeginFrame(m_ctx, path, rt.width, rt.height, m_callbacks_gb[13]);
                    m_callbacks_gb[14] = fcAPI.fcExrAddLayerTexture(m_ctx, rt, 3, "R", m_callbacks_gb[14]);
                    m_callbacks_gb[15] = fcAPI.fcExrEndFrame(m_ctx, m_callbacks_gb[15]);
                }
                {
                    string path = dir + "/Normal_" + ext;
                    var    rt   = m_gbuffer[2];
                    m_callbacks_gb[16] = fcAPI.fcExrBeginFrame(m_ctx, path, rt.width, rt.height, m_callbacks_gb[16]);
                    m_callbacks_gb[17] = fcAPI.fcExrAddLayerTexture(m_ctx, rt, 0, "R", m_callbacks_gb[17]);
                    m_callbacks_gb[18] = fcAPI.fcExrAddLayerTexture(m_ctx, rt, 1, "G", m_callbacks_gb[18]);
                    m_callbacks_gb[19] = fcAPI.fcExrAddLayerTexture(m_ctx, rt, 2, "B", m_callbacks_gb[19]);
                    m_callbacks_gb[20] = fcAPI.fcExrEndFrame(m_ctx, m_callbacks_gb[20]);
                }
                {
                    string path = dir + "/Emission_" + ext;
                    var    rt   = m_gbuffer[3];
                    m_callbacks_gb[21] = fcAPI.fcExrBeginFrame(m_ctx, path, rt.width, rt.height, m_callbacks_gb[21]);
                    m_callbacks_gb[22] = fcAPI.fcExrAddLayerTexture(m_ctx, rt, 0, "R", m_callbacks_gb[22]);
                    m_callbacks_gb[23] = fcAPI.fcExrAddLayerTexture(m_ctx, rt, 1, "G", m_callbacks_gb[23]);
                    m_callbacks_gb[24] = fcAPI.fcExrAddLayerTexture(m_ctx, rt, 2, "B", m_callbacks_gb[24]);
                    m_callbacks_gb[25] = fcAPI.fcExrEndFrame(m_ctx, m_callbacks_gb[25]);
                }
                {
                    string path = dir + "/Depth_" + ext;
                    var    rt   = m_gbuffer[4];
                    m_callbacks_gb[26] = fcAPI.fcExrBeginFrame(m_ctx, path, rt.width, rt.height, m_callbacks_gb[26]);
                    m_callbacks_gb[27] = fcAPI.fcExrAddLayerTexture(m_ctx, rt, 0, "R", m_callbacks_gb[27]);
                    m_callbacks_gb[28] = fcAPI.fcExrEndFrame(m_ctx, m_callbacks_gb[28]);
                }
                for (int i = 0; i < m_callbacks_gb.Length; ++i)
                {
                    GL.IssuePluginEvent(fcAPI.fcGetRenderEventFunc(), m_callbacks_gb[i]);
                }
            }
        }