Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CR167: GLTF Import - Metadata support #184

Merged
merged 1 commit into from
Dec 11, 2024

Conversation

AtheneNoctuaPt
Copy link
Contributor

Limited support of metadata import is added to RWGltf_GltfJsonParser. Following Json data types are currently supported: int32, double, string, array of int32, array of double, array of strings, Json object. Notable unsupported types are: binary data, array of Json objects. Metadata is processed for nodes and meshes.
Tests "gltf_export" are updated with import testing and renamed to "gltf".

Method RWGltf_GltfJsonParser::gltfParseSceneNode() is slightly refactored: parsing of transformations and transformation matrices is moved into separate functions.

@AtheneNoctuaPt AtheneNoctuaPt added 2. Enhancement New feature or request 1. Data Exchange Import/Export or iterating of the CAD data labels Dec 9, 2024
@AtheneNoctuaPt AtheneNoctuaPt requested a review from a team December 9, 2024 17:20
@AtheneNoctuaPt AtheneNoctuaPt self-assigned this Dec 9, 2024
Copy link
Member

@dpasukhi dpasukhi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dear dkulikov, here are few remarks,
Additionally, any changes please combine into single.
And please update the commit first line to have #184 directly at the end. You can check any other newest comments.

@@ -297,17 +297,19 @@ protected:
void bindNodeShape (TopoDS_Shape& theShape,
const TopLoc_Location& theLoc,
const TCollection_AsciiString& theNodeId,
const RWGltf_JsonValue* theUserName)
const RWGltf_JsonValue* theUserName,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest to use const Handle(TDataStd_NamedData)&.
Originally input parameter must be not updated. It is originally a part of the new internal class.
The same for 2 more new methods in current file


//! Parses the "extras" value provided in the constructor.
//! @return Container with parsed data. May be nullptr if failed to parse.
Handle(TDataStd_NamedData) Parse();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But the myResult allocated always. It is not related?
Can be it null? Or better to avoid allocate ahead?

# Compare metadata in files.
set aMetaDataLines [split ${aMetaData} "\n"]
set aRefMetaDataLines [split ${ref_metadata} "\n"]
set aMetaDataLinesCount [llength $aMetaDataLines]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please clear up the short tabs from here.
Imposters here :)

@dpasukhi dpasukhi added this to the Release 7.9 milestone Dec 10, 2024
Limited support of metadata import is added to RWGltf_GltfJsonParser.
Following Json data types are currently supported: int32, double, string,
array of int32, array of double, array of strings, Json object.
Notable unsupported types are: binary data, array of Json objects.
Metadata is processed for nodes and meshes.
Tests "gltf_export" are updated with import testing and renamed to "gltf".

Method RWGltf_GltfJsonParser::gltfParseSceneNode() is slightly
refactored: parsing of transformations and transformation matrices is
moved into separate functions.
@dpasukhi dpasukhi linked an issue Dec 10, 2024 that may be closed by this pull request
@dpasukhi dpasukhi merged commit bbbb8ea into Open-Cascade-SAS:IR Dec 11, 2024
13 checks passed
dpasukhi added a commit to dpasukhi/OCCT that referenced this pull request Dec 14, 2024
Regression after Open-Cascade-SAS#184 where some methods are not isolated.
dpasukhi added a commit to dpasukhi/OCCT that referenced this pull request Dec 14, 2024
Regression after Open-Cascade-SAS#184 where some methods are not isolated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. Data Exchange Import/Export or iterating of the CAD data 2. Enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

GLTF Import - Metadata support
2 participants