summaryrefslogtreecommitdiff
path: root/world/src/mesh.rs
diff options
context:
space:
mode:
Diffstat (limited to 'world/src/mesh.rs')
-rw-r--r--world/src/mesh.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/world/src/mesh.rs b/world/src/mesh.rs
index 6fff9c4..ebecfa5 100644
--- a/world/src/mesh.rs
+++ b/world/src/mesh.rs
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-use crate::{Args, TextureCache, load_texture};
+use crate::{Args, TextureCache, load_texture, vrm::VrmInfo};
use anyhow::Result;
use gltf::{Mesh, Node, buffer::Data};
use log::{debug, info, warn};
@@ -37,6 +37,7 @@ pub fn import_mesh(
args: &Args,
texture_cache: &TextureCache,
joint_index_map: &BTreeMap<(usize, u16), u32>,
+ vrm: &VrmInfo,
) -> Result<()> {
for p in mesh.primitives() {
let name = mesh.name().or(node.name()).map(|e| e.to_owned());
@@ -348,6 +349,12 @@ pub fn import_mesh(
None
};
+ let hint_hide_first_person = if vrm.hide_first_person.contains(&node.index()) {
+ Some(())
+ } else {
+ None
+ };
+
let armature = node.skin().map(|_| 0);
let mesh = store.set(&MeshPart {
@@ -383,6 +390,7 @@ pub fn import_mesh(
tex_transmission,
tex_thickness,
tex_occlusion,
+ hint_hide_first_person,
// not supported by gltf
hint_mirror: None, // TODO
hint_static: None, // TODO Set when instancing