private void resourceConvertBtn_Click(object sender, EventArgs e) { try { _resource = ResourceUtils.LoadResource(resourceInputPath.Text); ResourceFormat format = ResourceUtils.ExtensionToResourceFormat(resourceOutputPath.Text); FileVersion outputVersion = _form.GetGame() == Game.DivinityOriginalSin2 ? FileVersion.VerExtendedNodes : FileVersion.VerChunkedCompress; ResourceUtils.SaveResource(_resource, resourceOutputPath.Text, format, outputVersion); MessageBox.Show("Resource saved successfully."); } catch (Exception exc) { MessageBox.Show($"Internal error!{Environment.NewLine}{Environment.NewLine}{exc}", "Conversion Failed", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void UpdateCommonExporterSettings(ExporterOptions settings) { Game game = _form.GetGame(); settings.FlipUVs = flipUVs.Checked; settings.BuildDummySkeleton = buildDummySkeleton.Checked; settings.DeduplicateUVs = filterUVs.Checked; settings.ApplyBasisTransforms = applyBasisTransforms.Checked; settings.FlipMesh = flipMeshes.Checked; settings.FlipSkeleton = flipSkeletons.Checked; settings.LoadGameSettings(game); settings.ModelType = 0; if (meshRigid.Checked) { settings.ModelType |= DivinityModelFlag.Rigid; } if (meshCloth.Checked) { settings.ModelType |= DivinityModelFlag.Cloth; } if (meshProxy.Checked) { settings.ModelType |= DivinityModelFlag.MeshProxy | DivinityModelFlag.HasProxyGeometry; } settings.ConformGR2Path = conformToOriginal.Checked && conformantGR2Path.Text.Length > 0 ? conformantGR2Path.Text : null; settings.ConformSkeletonsCopy = conformCopySkeletons.Checked; }
private void UpdateCommonExporterSettings(ExporterOptions settings) { Game game = _form.GetGame(); if (game == Game.DivinityOriginalSin) { settings.Is64Bit = false; settings.AlternateSignature = false; settings.VersionTag = Header.Tag_DOS; settings.ModelInfoFormat = DivinityModelInfoFormat.None; } else { settings.Is64Bit = true; settings.AlternateSignature = true; settings.VersionTag = Header.Tag_DOSEE; if (game == Game.DivinityOriginalSinEE) { settings.ModelInfoFormat = DivinityModelInfoFormat.UserDefinedProperties; } else { settings.ModelInfoFormat = DivinityModelInfoFormat.LSMv1; } } settings.ExportNormals = exportNormals.Checked; settings.ExportTangents = exportTangents.Checked; settings.ExportUVs = exportUVs.Checked; settings.ExportColors = exportColors.Checked; settings.FlipUVs = flipUVs.Checked; settings.RecalculateNormals = recalculateNormals.Checked; settings.RecalculateTangents = recalculateTangents.Checked; settings.RecalculateIWT = recalculateJointIWT.Checked; settings.BuildDummySkeleton = buildDummySkeleton.Checked; settings.CompactIndices = use16bitIndex.Checked; settings.DeduplicateVertices = deduplicateVertices.Checked; settings.DeduplicateUVs = filterUVs.Checked; settings.ApplyBasisTransforms = applyBasisTransforms.Checked; settings.UseObsoleteVersionTag = forceLegacyVersion.Checked; settings.FlipMesh = flipMeshes.Checked; settings.FlipSkeleton = flipSkeletons.Checked; switch (gr2ExtraProps.SelectedIndex) { case 0: settings.ModelType = DivinityModelType.Normal; break; case 1: settings.ModelType = DivinityModelType.Rigid; break; case 2: settings.ModelType = DivinityModelType.Cloth; break; case 3: settings.ModelType = DivinityModelType.MeshProxy; break; default: throw new Exception("Unknown model type selected"); } settings.ConformGR2Path = conformToOriginal.Checked && conformantGR2Path.Text.Length > 0 ? conformantGR2Path.Text : null; }
private void resourceConvertBtn_Click(object sender, EventArgs e) { if (String.IsNullOrEmpty(resourceInputPath.Text) || String.IsNullOrEmpty(resourceOutputPath.Text)) { MessageBox.Show("Please specify both input and output file path first!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { try { _resource = ResourceUtils.LoadResource(resourceInputPath.Text); ResourceFormat format = ResourceUtils.ExtensionToResourceFormat(resourceOutputPath.Text); FileVersion outputVersion = _form.GetGame().IsDOS2() ? FileVersion.VerExtendedNodes : FileVersion.VerChunkedCompress; ResourceUtils.SaveResource(_resource, resourceOutputPath.Text, format, outputVersion); MessageBox.Show("Resource saved successfully."); } catch (Exception exc) { MessageBox.Show($"Internal error!{Environment.NewLine}{Environment.NewLine}{exc}", "Conversion Failed", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private void UpdateCommonExporterSettings(ExporterOptions settings) { Game game = _form.GetGame(); if (game == Game.DivinityOriginalSin) { settings.Is64Bit = false; settings.AlternateSignature = false; settings.VersionTag = Header.Tag_DOS; } else { settings.Is64Bit = true; settings.AlternateSignature = true; settings.VersionTag = Header.Tag_DOSEE; } settings.ExportNormals = exportNormals.Checked; settings.ExportTangents = exportTangents.Checked; settings.ExportUVs = exportUVs.Checked; settings.ExportColors = exportColors.Checked; settings.FlipUVs = flipUVs.Checked; settings.RecalculateNormals = recalculateNormals.Checked; settings.RecalculateTangents = recalculateTangents.Checked; settings.RecalculateIWT = recalculateJointIWT.Checked; settings.BuildDummySkeleton = buildDummySkeleton.Checked; settings.CompactIndices = use16bitIndex.Checked; settings.DeduplicateVertices = deduplicateVertices.Checked; settings.DeduplicateUVs = filterUVs.Checked; settings.ApplyBasisTransforms = applyBasisTransforms.Checked; settings.UseObsoleteVersionTag = forceLegacyVersion.Checked; if (rigid.Checked) { settings.ModelType = DivinityModelType.Rigid; } else { settings.ModelType = DivinityModelType.Normal; } settings.ConformGR2Path = conformToOriginal.Checked && conformantGR2Path.Text.Length > 0 ? conformantGR2Path.Text : null; }