1
0
mirror of synced 2024-12-01 10:37:25 +01:00

Add actor file renamer for SZS files in odyssey

This commit is contained in:
KillzXGaming 2019-04-05 21:10:57 -04:00
parent f8a754058a
commit 62cbad92dd
15 changed files with 56 additions and 32 deletions

Binary file not shown.

View File

@ -59,8 +59,10 @@ namespace FirstPlugin
ContextMenuStrip = new STContextMenuStrip();
ContextMenuStrip.Items.Add(new STToolStipMenuItem("Save",null, Save, Keys.Control | Keys.S));
// ContextMenuStrip.Items.Add(new STToolStipMenuItem("Unpack to Folder", null, UnpackToFolder, Keys.Control | Keys.E));
// ContextMenuStrip.Items.Add(new STToolStipMenuItem("Pack From Folder", null, PackFromFolder, Keys.Control | Keys.R));
ContextMenuStrip.Items.Add(new STToolStipMenuItem("Rename Actor Files (Odyssey)", null, RenameActors, Keys.Control | Keys.S));
// ContextMenuStrip.Items.Add(new STToolStipMenuItem("Unpack to Folder", null, UnpackToFolder, Keys.Control | Keys.E));
// ContextMenuStrip.Items.Add(new STToolStipMenuItem("Pack From Folder", null, PackFromFolder, Keys.Control | Keys.R));
ContextMenuStrip.Items.Add(new STToolStripSeparator());
ContextMenuStrip.Items.Add(new STToolStipMenuItem("Batch Texture Editor", null, PreviewTextures, Keys.Control | Keys.P));
ContextMenuStrip.Items.Add(new STToolStripSeparator());
@ -70,6 +72,34 @@ namespace FirstPlugin
sarcData.Files.Clear();
}
private void RenameActors(object sender, EventArgs args)
{
string ActorName = Path.GetFileNameWithoutExtension(Text);
RenameDialog dialog = new RenameDialog();
dialog.SetString(ActorName);
if (dialog.ShowDialog() == DialogResult.OK)
{
string NewActorName = dialog.textBox1.Text;
Text = NewActorName + ".szs";
foreach (TreeNode node in Nodes)
{
string NodeName = Path.GetFileNameWithoutExtension(node.Text);
string ext = Utils.GetExtension(node.Text);
if (NodeName == ActorName)
{
node.Text = $"{NewActorName}.{ext}";
}
else if (node.Text.Contains("Attribute.byml"))
{
node.Text = $"{NewActorName}Attribute.byml";
}
}
}
}
private void UnpackToFolder(object sender, EventArgs args)
{

View File

@ -571,8 +571,6 @@ namespace FirstPlugin
Matrix4.CreateScale(Runtime.previewScale) *
Matrix4.CreateTranslation(Selected ? editorScene.currentAction.newPos(position) : position));
defaultShaderProgram.EnableVertexAttributes();
SetRenderSettings(defaultShaderProgram);
Matrix4 camMat = control.ModelMatrix * control.CameraMatrix * control.ProjectionMatrix;
@ -584,7 +582,6 @@ namespace FirstPlugin
GL.Uniform3(defaultShaderProgram["ambLightColor"], new Vector3(1));
defaultShaderProgram.EnableVertexAttributes();
SetRenderSettings(defaultShaderProgram);
foreach (KCLModel mdl in models)
{

View File

@ -238,12 +238,6 @@ namespace FirstPlugin.Turbo.CourseMuuntStructs
}
public List<BFRES> BfresObjects = new List<BFRES>();
public List<KCL> KclObjects = new List<KCL>();

View File

@ -29,44 +29,47 @@ namespace FirstPlugin.Forms
{
string CourseFolder = System.IO.Path.GetDirectoryName(FilePath);
scene = new CourseMuuntScene(by);
if (File.Exists($"{CourseFolder}/course_kcl.szs"))
scene.AddRenderableKcl($"{CourseFolder}/course_kcl.szs");
if (File.Exists($"{CourseFolder}/course.kcl"))
scene.AddRenderableKcl($"{CourseFolder}/course.kcl");
if (File.Exists($"{CourseFolder}/course_model.szs"))
{
// scene.AddRenderableBfres($"{CourseFolder}/course_model.szs");
// scene.AddRenderableKcl($"{CourseFolder}/course.kcl");
foreach (var kcl in scene.KclObjects)
{
viewport.AddDrawable(kcl.Renderer);
kcl.Renderer.UpdateVertexData();
}
foreach (var bfres in scene.BfresObjects)
{
viewport.AddDrawable(bfres.BFRESRender);
bfres.BFRESRender.UpdateVertexData();
bfres.BFRESRender.UpdateTextureMaps();
}
viewport.LoadObjects();
}
foreach (var kcl in scene.KclObjects)
{
viewport.AddDrawable(kcl.Renderer);
kcl.Renderer.UpdateVertexData();
}
foreach (var bfres in scene.BfresObjects)
{
viewport.AddDrawable(bfres.BFRESRender);
bfres.BFRESRender.UpdateVertexData();
bfres.BFRESRender.UpdateTextureMaps();
}
viewport.AddDrawable(new GL_EditorFramework.EditorDrawables.SingleObject(new OpenTK.Vector3(0)));
viewport.LoadObjects();
objectCB.Items.Add("Scene");
objectCB.SelectedIndex = 0;
if (scene.LapPaths.Count > 0)
{
if (scene.LapPaths.Count > 0) {
objectCB.Items.Add("Lap Paths");
foreach (var group in scene.LapPaths)
{
foreach (var path in group.PathPoints)
{
Console.WriteLine(path.Translate);
Console.WriteLine(path.Rotate);
Console.WriteLine(path.Scale);
viewport.AddDrawable(path.RenderablePoint);
}
}

Binary file not shown.

Binary file not shown.