| 89 | |
| 90 | |
| 91 | void GltfWriter::prepared(PointTableRef table) |
| 92 | { |
| 93 | const bool hasNormals = table.layout()->hasDim(Dimension::Id::NormalX) && |
| 94 | table.layout()->hasDim(Dimension::Id::NormalY) && |
| 95 | table.layout()->hasDim(Dimension::Id::NormalZ); |
| 96 | |
| 97 | if (!hasNormals && m_writeNormals) |
| 98 | { |
| 99 | log()->get(LogLevel::Warning) << getName() << ": Option 'normals' is set to " |
| 100 | "true, but one or more of the normal dimensions are missing. Not writing vertex " |
| 101 | "normals." << std::endl; |
| 102 | m_writeNormals = false; |
| 103 | } |
| 104 | |
| 105 | // Only color vertices if color dimensions are present and the option is |
| 106 | // enabled |
| 107 | const bool hasColors = table.layout()->hasDim(Dimension::Id::Red) && |
| 108 | table.layout()->hasDim(Dimension::Id::Green) && |
| 109 | table.layout()->hasDim(Dimension::Id::Blue); |
| 110 | |
| 111 | if (!hasColors && m_colorVertices) |
| 112 | { |
| 113 | log()->get(LogLevel::Warning) << getName() << ": Option 'colors' is set to " |
| 114 | "true, but one or more color dimensions are missing. Not writing vertex " |
| 115 | "colors." << std::endl; |
| 116 | m_colorVertices = false; |
| 117 | } |
| 118 | } |
| 119 | |
| 120 | |
| 121 | void GltfWriter::ready(PointTableRef table) |