From 9589ea300d360b8ad111d47583da86fed633aaeb Mon Sep 17 00:00:00 2001 From: HarrievG Date: Sun, 23 Oct 2022 13:02:43 +0200 Subject: [PATCH] [+] Inline support for gltf maps; add "inline" 0 property to an idStaticEntity or func_static to not inlude it in the map bsp. Defaults to 1 --- neo/idlib/MapFile_gltf.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/neo/idlib/MapFile_gltf.cpp b/neo/idlib/MapFile_gltf.cpp index cb4787a7..598a8758 100644 --- a/neo/idlib/MapFile_gltf.cpp +++ b/neo/idlib/MapFile_gltf.cpp @@ -370,10 +370,11 @@ int idMapEntity::GetEntities( gltfData* data, EntityListRef entities, int sceneI } else { - idStr classname = node->extras.strPairs.GetString( "classname" ); + idStr classnameStr = node->extras.strPairs.GetString( "classname" ); + bool skipInline = !node->extras.strPairs.GetBool("inline",true); // skip everything that is not an entity - if( !classname.IsEmpty() ) + if( !classnameStr.IsEmpty()) { idMapEntity* newEntity = new( TAG_IDLIB_GLTF ) idMapEntity(); entities.Append( newEntity ); @@ -418,7 +419,10 @@ int idMapEntity::GetEntities( gltfData* data, EntityListRef entities, int sceneI #endif // add meshes from all subnodes - ProcessSceneNode_r( newEntity, node, mat4_identity, worldToEntityTransform, data ); + if (!skipInline) + { + ProcessSceneNode_r(newEntity, node, mat4_identity, worldToEntityTransform, data); + } entityCount++; }