Esempio n. 1
0
        public static string GetStudioMdlPath()
        {
            if (ProjectUtils.IsProjectLoaded())
            {
                return(string.Format("{0}\\studiomdl.exe", ProjectUtils.GetStudioModelPath()));
            }

            return(null);
        }
Esempio n. 2
0
        public static bool OpenModelInHLMV(string path)
        {
            if (string.IsNullOrEmpty(path) || !ProjectUtils.IsProjectLoaded())
            {
                return(false);
            }

            if (!File.Exists(path))
            {
                return(false);
            }

            QCParser qcInfo = new QCParser(path);

            if (qcInfo.ParseQCFile())
            {
                string modelPath = string.Format("{0}\\models\\{1}", ProjectUtils.GetGameInfoPath(), qcInfo.GetQCParamValue("$modelname"));
                if (File.Exists(modelPath))
                {
                    string hlmv = string.Format("{0}\\hlmv.exe", ProjectUtils.GetStudioModelPath());
                    if (File.Exists(hlmv))
                    {
                        using (Process procLaunchHLMV = new Process())
                        {
                            procLaunchHLMV.StartInfo.Arguments              = string.Format("-game \"{0}\" \"{1}\"", ProjectUtils.GetGameInfoPath(), modelPath);
                            procLaunchHLMV.StartInfo.CreateNoWindow         = true;
                            procLaunchHLMV.StartInfo.FileName               = hlmv;
                            procLaunchHLMV.StartInfo.UseShellExecute        = false;
                            procLaunchHLMV.StartInfo.WindowStyle            = ProcessWindowStyle.Hidden;
                            procLaunchHLMV.StartInfo.RedirectStandardOutput = true;
                            procLaunchHLMV.Start();
                        }
                        return(true);
                    }
                }
            }

            return(false);
        }