Skip to content

Commit c00a853

Browse files
pijaroalek-kam-robotec-ai
authored andcommitted
Exclude meshes in lidar using regex _nolidar
Signed-off-by: Piotr Jaroszek <[email protected]>
1 parent cd9867d commit c00a853

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Code/Source/Model/ModelLibrary.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* See the License for the specific language governing permissions and
1313
* limitations under the License.
1414
*/
15+
#include <AzCore/std/string/regex.h>
1516
#include <Model/ModelLibrary.h>
1617
#include <Utilities/RGLUtils.h>
1718
#include <rgl/api/core.h>
@@ -68,10 +69,19 @@ namespace RGL
6869
const auto modelLodAsset = lodAssets.begin()->Get();
6970
const auto meshes = modelLodAsset->GetMeshes();
7071

72+
const AZStd::regex excludeMeshRegex(".*_nolidar.*");
73+
7174
MeshMaterialSlotPairList modelMeshes;
7275
modelMeshes.reserve(meshes.size());
7376
for (auto& mesh : meshes)
7477
{
78+
AZStd::smatch matches;
79+
if (AZStd::regex_match(mesh.GetName().GetCStr(), matches, excludeMeshRegex))
80+
{
81+
AZ_Info("RGL", "Ignoring mesh %s.", mesh.GetName().GetCStr());
82+
continue;
83+
}
84+
7585
const AZStd::span<const rgl_vec3f> vertices = mesh.GetSemanticBufferTyped<rgl_vec3f>(AZ::Name("POSITION"));
7686
const AZStd::span<const rgl_vec3i> indices = mesh.GetIndexBufferTyped<rgl_vec3i>();
7787

0 commit comments

Comments
 (0)