mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
0031813: Data Exchange, RWGltf_GltfJsonParser - debug assertion in progress scope on reading glTF1.0 files
RWGltf_GltfJsonParser::gltfParseSceneNode() - removed redundant progress indication on sub-meshes list level.
This commit is contained in:
parent
7e6da17b9f
commit
28828566e9
@ -1243,9 +1243,8 @@ bool RWGltf_GltfJsonParser::gltfParseSceneNode (TopoDS_Shape& theNodeShape,
|
|||||||
&& aMeshes_1->IsArray())
|
&& aMeshes_1->IsArray())
|
||||||
{
|
{
|
||||||
// glTF 1.0
|
// glTF 1.0
|
||||||
Message_ProgressScope aPS (theProgress, "Reading scene meshes", aMeshes_1->Size());
|
|
||||||
for (rapidjson::Value::ConstValueIterator aMeshIter = aMeshes_1->Begin();
|
for (rapidjson::Value::ConstValueIterator aMeshIter = aMeshes_1->Begin();
|
||||||
aMeshIter != aMeshes_1->End() && aPS.More(); ++aMeshIter)
|
aMeshIter != aMeshes_1->End(); ++aMeshIter)
|
||||||
{
|
{
|
||||||
const RWGltf_JsonValue* aMesh = myGltfRoots[RWGltf_GltfRootElement_Meshes].FindChild (*aMeshIter);
|
const RWGltf_JsonValue* aMesh = myGltfRoots[RWGltf_GltfRootElement_Meshes].FindChild (*aMeshIter);
|
||||||
if (aMesh == NULL)
|
if (aMesh == NULL)
|
||||||
@ -1257,7 +1256,7 @@ bool RWGltf_GltfJsonParser::gltfParseSceneNode (TopoDS_Shape& theNodeShape,
|
|||||||
}
|
}
|
||||||
|
|
||||||
TopoDS_Shape aMeshShape;
|
TopoDS_Shape aMeshShape;
|
||||||
if (!gltfParseMesh (aMeshShape, getKeyString (*aMeshIter), *aMesh, aPS.Next()))
|
if (!gltfParseMesh (aMeshShape, getKeyString (*aMeshIter), *aMesh))
|
||||||
{
|
{
|
||||||
theNodeShape = aNodeShape;
|
theNodeShape = aNodeShape;
|
||||||
bindNodeShape (theNodeShape, aNodeLoc, theSceneNodeId, aName);
|
bindNodeShape (theNodeShape, aNodeLoc, theSceneNodeId, aName);
|
||||||
@ -1283,7 +1282,7 @@ bool RWGltf_GltfJsonParser::gltfParseSceneNode (TopoDS_Shape& theNodeShape,
|
|||||||
}
|
}
|
||||||
|
|
||||||
TopoDS_Shape aMeshShape;
|
TopoDS_Shape aMeshShape;
|
||||||
if (!gltfParseMesh (aMeshShape, getKeyString (*aMesh_2), *aMesh, theProgress))
|
if (!gltfParseMesh (aMeshShape, getKeyString (*aMesh_2), *aMesh))
|
||||||
{
|
{
|
||||||
theNodeShape = aNodeShape;
|
theNodeShape = aNodeShape;
|
||||||
bindNodeShape (theNodeShape, aNodeLoc, theSceneNodeId, aName);
|
bindNodeShape (theNodeShape, aNodeLoc, theSceneNodeId, aName);
|
||||||
@ -1314,8 +1313,7 @@ bool RWGltf_GltfJsonParser::gltfParseSceneNode (TopoDS_Shape& theNodeShape,
|
|||||||
// =======================================================================
|
// =======================================================================
|
||||||
bool RWGltf_GltfJsonParser::gltfParseMesh (TopoDS_Shape& theMeshShape,
|
bool RWGltf_GltfJsonParser::gltfParseMesh (TopoDS_Shape& theMeshShape,
|
||||||
const TCollection_AsciiString& theMeshId,
|
const TCollection_AsciiString& theMeshId,
|
||||||
const RWGltf_JsonValue& theMesh,
|
const RWGltf_JsonValue& theMesh)
|
||||||
const Message_ProgressRange& theProgress)
|
|
||||||
{
|
{
|
||||||
const RWGltf_JsonValue* aName = findObjectMember (theMesh, "name");
|
const RWGltf_JsonValue* aName = findObjectMember (theMesh, "name");
|
||||||
const RWGltf_JsonValue* aPrims = findObjectMember (theMesh, "primitives");
|
const RWGltf_JsonValue* aPrims = findObjectMember (theMesh, "primitives");
|
||||||
@ -1344,7 +1342,7 @@ bool RWGltf_GltfJsonParser::gltfParseMesh (TopoDS_Shape& theMeshShape,
|
|||||||
}
|
}
|
||||||
|
|
||||||
Handle(RWGltf_GltfLatePrimitiveArray) aMeshData = new RWGltf_GltfLatePrimitiveArray (theMeshId, aUserName);
|
Handle(RWGltf_GltfLatePrimitiveArray) aMeshData = new RWGltf_GltfLatePrimitiveArray (theMeshId, aUserName);
|
||||||
if (!gltfParsePrimArray (aMeshData, theMeshId, *aPrimArrIter, theProgress))
|
if (!gltfParsePrimArray (aMeshData, theMeshId, *aPrimArrIter))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -1397,8 +1395,7 @@ bool RWGltf_GltfJsonParser::gltfParseMesh (TopoDS_Shape& theMeshShape,
|
|||||||
// =======================================================================
|
// =======================================================================
|
||||||
bool RWGltf_GltfJsonParser::gltfParsePrimArray (const Handle(RWGltf_GltfLatePrimitiveArray)& theMeshData,
|
bool RWGltf_GltfJsonParser::gltfParsePrimArray (const Handle(RWGltf_GltfLatePrimitiveArray)& theMeshData,
|
||||||
const TCollection_AsciiString& theMeshId,
|
const TCollection_AsciiString& theMeshId,
|
||||||
const RWGltf_JsonValue& thePrimArray,
|
const RWGltf_JsonValue& thePrimArray)
|
||||||
const Message_ProgressRange& /*theProgress*/)
|
|
||||||
{
|
{
|
||||||
const RWGltf_JsonValue* anAttribs = findObjectMember (thePrimArray, "attributes");
|
const RWGltf_JsonValue* anAttribs = findObjectMember (thePrimArray, "attributes");
|
||||||
const RWGltf_JsonValue* anIndices = findObjectMember (thePrimArray, "indices");
|
const RWGltf_JsonValue* anIndices = findObjectMember (thePrimArray, "indices");
|
||||||
|
@ -183,14 +183,12 @@ protected:
|
|||||||
//! Parse mesh element.
|
//! Parse mesh element.
|
||||||
Standard_EXPORT bool gltfParseMesh (TopoDS_Shape& theMeshShape,
|
Standard_EXPORT bool gltfParseMesh (TopoDS_Shape& theMeshShape,
|
||||||
const TCollection_AsciiString& theMeshId,
|
const TCollection_AsciiString& theMeshId,
|
||||||
const RWGltf_JsonValue& theMesh,
|
const RWGltf_JsonValue& theMesh);
|
||||||
const Message_ProgressRange& theProgress);
|
|
||||||
|
|
||||||
//! Parse primitive array.
|
//! Parse primitive array.
|
||||||
Standard_EXPORT bool gltfParsePrimArray (const Handle(RWGltf_GltfLatePrimitiveArray)& theMeshData,
|
Standard_EXPORT bool gltfParsePrimArray (const Handle(RWGltf_GltfLatePrimitiveArray)& theMeshData,
|
||||||
const TCollection_AsciiString& theMeshName,
|
const TCollection_AsciiString& theMeshName,
|
||||||
const RWGltf_JsonValue& thePrimArray,
|
const RWGltf_JsonValue& thePrimArray);
|
||||||
const Message_ProgressRange& theProgress);
|
|
||||||
|
|
||||||
//! Parse accessor.
|
//! Parse accessor.
|
||||||
Standard_EXPORT bool gltfParseAccessor (const Handle(RWGltf_GltfLatePrimitiveArray)& theMeshData,
|
Standard_EXPORT bool gltfParseAccessor (const Handle(RWGltf_GltfLatePrimitiveArray)& theMeshData,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user