Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
xunilrj committed Dec 2, 2021
1 parent c60d161 commit 8a62c23
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 15 deletions.
4 changes: 2 additions & 2 deletions sources/rust/telltaled3dmesh/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions sources/rust/telltaled3dmesh/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "telltaled3dmesh"
version = "0.1.0"
name = "telltaleconv"
version = "0.2.0"
edition = "2018"

[dependencies]
Expand Down
8 changes: 2 additions & 6 deletions sources/rust/telltaled3dmesh/src/d3dmesh/outputs/obj.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,8 @@ fn obj_f(f: &mut File, a: u16, b: u16, c: u16) {
}

pub fn save_to_obj(mesh: &D3DFile, path: PathBuf) {
let mut f = File::with_options()
.write(true)
.create(true)
.truncate(true)
.open(path)
.unwrap();
let _ = std::fs::remove_file(&path);
let mut f = std::fs::File::create(&path).unwrap();

obj_o(&mut f, "obj");

Expand Down
1 change: 0 additions & 1 deletion sources/rust/telltaled3dmesh/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(with_options)]

mod anm;
mod d3dmesh;
Expand Down
2 changes: 1 addition & 1 deletion sources/rust/telltaled3dmesh/src/skl/gltf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ pub fn save<P: AsRef<Path>>(path: P, skl: super::SklFile) {
skins: skins
};

std::fs::write("./viewer/models/result.gltf", gltf.dump());
std::fs::write(path, gltf.dump());
}
3 changes: 2 additions & 1 deletion sources/rust/telltaled3dmesh/src/skl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ pub fn convert<P: AsRef<str>>(path: P) {
for _ in 0..qty {
let bone_name = input.parse_length_string("Bone Name");
let crc = crc64::crc64(0, bone_name.as_bytes());
println!("{} = {:X} {:?}", bone_name, crc, crc.to_le_bytes());
// println!("{} = {:X} {:?}", bone_name, crc, crc.to_le_bytes());

let _ = input.parse_le_f32("?");
}
Expand All @@ -90,6 +90,7 @@ pub fn convert<P: AsRef<str>>(path: P) {
}
}

bar.set_job_title("Saving...");
let out = PathBuf::from_str(path.as_ref()).unwrap();
let out = out.with_extension("gltf");
gltf::save(&out, skl);
Expand Down
4 changes: 2 additions & 2 deletions sources/rust/telltaled3dmesh/viewer/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">

<head>
<title>three.js webgl - animation - skinning</title>
<title>Telltale Conv</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<link type="text/css" rel="stylesheet" href="main.css">
Expand All @@ -25,7 +25,7 @@
<body>
<div id="container"></div>
<div id="info">
Telltale Exporter by Daniel Frederico Lins Leite
Telltale Conv by Daniel Frederico Lins Leite
</div>

<script type="module">
Expand Down

0 comments on commit 8a62c23

Please sign in to comment.