mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
0031618: Data Exchange, RWGltf_CafWriter - exporting some models produces glTF files not passing validation
Added a check for non-empty mesh and new warning that notifies about skipping an empty node
This commit is contained in:
parent
d533dafb56
commit
b011420f28
@ -1226,7 +1226,14 @@ void RWGltf_CafWriter::writeMeshes (const RWGltf_GltfSceneNodeMap& theSceneNodeM
|
|||||||
{
|
{
|
||||||
const XCAFPrs_DocumentNode& aDocNode = aSceneNodeIter.Value();
|
const XCAFPrs_DocumentNode& aDocNode = aSceneNodeIter.Value();
|
||||||
const TCollection_AsciiString aNodeName = readNameAttribute (aDocNode.RefLabel);
|
const TCollection_AsciiString aNodeName = readNameAttribute (aDocNode.RefLabel);
|
||||||
|
{
|
||||||
|
RWMesh_FaceIterator aFaceIter(aDocNode.RefLabel, TopLoc_Location(), false);
|
||||||
|
if (!aFaceIter.More())
|
||||||
|
{
|
||||||
|
Message::SendWarning (TCollection_AsciiString("RWGltf_CafWriter skipped node '") + aNodeName + "' without triangulation data");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
myWriter->StartObject();
|
myWriter->StartObject();
|
||||||
myWriter->Key ("name");
|
myWriter->Key ("name");
|
||||||
myWriter->String (aNodeName.ToCString());
|
myWriter->String (aNodeName.ToCString());
|
||||||
@ -1304,6 +1311,13 @@ void RWGltf_CafWriter::writeNodes (const Handle(TDocStd_Document)& theDocument,
|
|||||||
aDocExplorer.More(); aDocExplorer.Next())
|
aDocExplorer.More(); aDocExplorer.Next())
|
||||||
{
|
{
|
||||||
const XCAFPrs_DocumentNode& aDocNode = aDocExplorer.Current();
|
const XCAFPrs_DocumentNode& aDocNode = aDocExplorer.Current();
|
||||||
|
{
|
||||||
|
RWMesh_FaceIterator aFaceIter(aDocNode.RefLabel, TopLoc_Location(), false);
|
||||||
|
if (!aFaceIter.More())
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (theLabelFilter != NULL
|
if (theLabelFilter != NULL
|
||||||
&& !theLabelFilter->Contains (aDocNode.Id))
|
&& !theLabelFilter->Contains (aDocNode.Id))
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user