Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src/model
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2010-10-15 22:39:43 +0000
committerStijn Buys <ingar@osirion.org>2010-10-15 22:39:43 +0000
commit3be87402d2a63bf536bd712e0575b4f559af579a (patch)
tree0fb5cc262116ed081fa875cb3d223175ae56d467 /src/model
parent208c13a72d72ab2aea08e79d8862e41c63fd1037 (diff)
have the ASE reader respect the Material::Ignore flag
Diffstat (limited to 'src/model')
-rw-r--r--src/model/asefile.cc33
1 files changed, 18 insertions, 15 deletions
diff --git a/src/model/asefile.cc b/src/model/asefile.cc
index d94f103..f02c450 100644
--- a/src/model/asefile.cc
+++ b/src/model/asefile.cc
@@ -593,24 +593,27 @@ bool ASEFile::read_geom(std::istream &is)
for (SubMaterialList::iterator smit = submateriallist->begin(); smit != submateriallist->end(); smit++) {
size_t submaterial_index = (*smit).first;
Material *material = (*smit).second;
-
- // load GEOMOBJECT triangles with matching material into the fragment
- Fragment *fragment = new Fragment(Fragment::Triangles, material);
- for (FaceList::iterator it = ase_facelist.begin(); it != ase_facelist.end(); it++) {
+
+ if ((material->flags() & Material::Ignore) != Material::Ignore ) {
+
+ // load GEOMOBJECT triangles with matching material into the fragment
+ Fragment *fragment = new Fragment(Fragment::Triangles, material);
+ for (FaceList::iterator it = ase_facelist.begin(); it != ase_facelist.end(); it++) {
+
+ Triangle *triangle = (*it).second;
+ if (triangle->material_index() == submaterial_index) {
+ fragment->add_vertex((triangle->v0() * SCALE) , triangle->n0(), triangle->t0(), false);
+ fragment->add_vertex((triangle->v1() * SCALE) , triangle->n1(), triangle->t1(), false);
+ fragment->add_vertex((triangle->v2() * SCALE) , triangle->n2(), triangle->t2(), false);
+ }
+ }
- Triangle *triangle = (*it).second;
- if (triangle->material_index() == submaterial_index) {
- fragment->add_vertex((triangle->v0() * SCALE) , triangle->n0(), triangle->t0(), false);
- fragment->add_vertex((triangle->v1() * SCALE) , triangle->n1(), triangle->t1(), false);
- fragment->add_vertex((triangle->v2() * SCALE) , triangle->n2(), triangle->t2(), false);
+ if (fragment->structural_size() + fragment->detail_size() > 0) {
+ ase_fragmentgroup->add_fragment(fragment);
+ } else {
+ delete fragment;
}
}
-
- if (fragment->structural_size() + fragment->detail_size() > 0) {
- ase_fragmentgroup->add_fragment(fragment);
- } else {
- delete fragment;
- }
}
}