Exemplo n.º 1
0
        private static ToolResult MergeObjFiles(List <string> fileList, string objOutput)
        {
            bool          success = false;
            StringBuilder sb      = new StringBuilder();

            if (fileList != null)
            {
                List <ObjData> objDatas = ObjParser.ParseObjs(fileList);
                ObjData        objData  = ObjModifier.MergeObjFiles(objDatas);
                if (objData != null)
                {
                    success = ObjExporter.WriteObj(objData, objData.Mtl, objOutput, makeMtl: true, useExistingMtl: true);
                    sb.AppendLine($"Merged {objDatas.Count} obj files into one");
                    sb.Append(MessageBoxConstants.GetMessageExecutionCreation(success, objOutput));
                }
                else
                {
                    sb.Append(MessageBoxConstants.MessageErrorMergeObj + MessageBoxConstants.MessageErrorExecution);
                }
            }
            else
            {
                sb.Append(MessageBoxConstants.MessageErrorMergeObj + MessageBoxConstants.MessageNoFilesMerge);
            }
            return(new ToolResult(sb.ToString(), success));
        }