MantisBT - Community
View Issue Details
0032540Community[OCCT] OCCT:Data Exchangepublic2021-08-18 17:042021-09-11 14:06
micheld2 
smoskvin 
normalminor 
verifiedfixed 
WindowsVC++ 201564 bit
[OCCT] 7.4.0 
[OCCT] 7.6.0* 
Not required
0032540: RWGltf_CafReader - optional "scene" parameter encoded as mandatory
When reading the included file, with RWGltf_CafReader or OCCT CAD Assistant , error "Member 'scene' is not found" is returned.

The gltf file format has the scene parameter as not required: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#reference-scene [^]

File can be opened in this online gltf validator: https://github.khronos.org/glTF-Validator/ [^] without error

Parameter is flagged as mandatory in RWGltf_GltfJsonParser.cxx at line 240
Opening the file with OCCT CAD Assistant or using sample code:

opencascade::handle<TDocStd_Application> aTDFApplication = XCAFApp_Application::GetApplication();
opencascade::handle<TDocStd_Document> aTDFDocument;
aTDFApplication->NewDocument("IMPORTGLTF", aTDFDocument);

RWGltf_CafReader aGLTFReader;
aGLTFReader.SetFileLengthUnit(1.);
aGLTFReader.SetSystemLengthUnit(1e-3);
aGLTFReader.SetDocument(aTDFDocument);
aGLTFReader.Perform(aFilename, Standard_ProgressDialog::ProgressIndicator()->Start())
No tags attached.
child of 0030691closed bugmaster Open CASCADE Data Exchange - implement import of mesh data from files in glTF format 
? SPHERE ONLY.glb (142,348) 2021-08-18 17:04
https://tracker.dev.opencascade.org/
Issue History
2021-08-18 17:04micheld2New Issue
2021-08-18 17:04micheld2Assigned To => gka
2021-08-18 17:04micheld2File Added: SPHERE ONLY.glb
2021-08-18 18:06kgvNote Added: 0103282
2021-08-18 18:07kgvNote Edited: 0103282bug_revision_view_page.php?bugnote_id=103282#r25624
2021-08-18 18:12kgvRelationship addedchild of 0030691
2021-08-18 18:12kgvAssigned Togka => kgv
2021-08-18 18:12kgvProduct Version7.5.0 => 7.4.0
2021-08-18 18:12kgvTarget Version => 7.6.0*
2021-08-18 18:44micheld2Note Added: 0103286
2021-08-18 19:19kgvNote Added: 0103288
2021-08-18 19:22kgvNote Edited: 0103288bug_revision_view_page.php?bugnote_id=103288#r25629
2021-09-09 22:21gitNote Added: 0103959
2021-09-09 23:40gitNote Added: 0103966
2021-09-09 23:46kgvNote Added: 0103967
2021-09-09 23:46kgvAssigned Tokgv => osa
2021-09-09 23:46kgvStatusnew => resolved
2021-09-10 19:29osaNote Added: 0103992
2021-09-10 19:29osaAssigned Toosa => bugmaster
2021-09-10 19:29osaStatusresolved => reviewed
2021-09-11 13:27smoskvinNote Added: 0104016
2021-09-11 13:27smoskvinStatusreviewed => tested
2021-09-11 13:37smoskvinTest case number => Not required
2021-09-11 13:43smoskvinChangeset attached => occt master 8a17a8bb
2021-09-11 13:43smoskvinAssigned Tobugmaster => smoskvin
2021-09-11 13:43smoskvinStatustested => verified
2021-09-11 13:43smoskvinResolutionopen => fixed
2021-09-11 14:06gitNote Added: 0104045

Notes
(0103282)
kgv   
2021-08-18 18:06   
(edited on: 2021-08-18 18:07)
> When scene is undefined, runtime is not required to render anything at load time.
Based on this item in specs, one would expect an empty document being loaded, which looks kind of useless to me.
It is strange that other viewers display a sphere for attached file instead of an empty model.

I guess we may modify OCCT to follow a common behavior, probably with a strict option or a warning message.
It is currently not possible asking RWGltf_CafReader to import non-default scene into XCAF document.

(0103286)
micheld2   
2021-08-18 18:44   
The glb file still contains a scenes array. The first item scenes[0] could be loaded by default, if present, when there is no default scene specified. This is probably what the other viewer does.
(0103288)
kgv   
2021-08-18 19:19   
(edited on: 2021-08-18 19:22)
Sure, I see what other viewers do.
I'm just saying that current behavior of RWGltf_CafReader doesn't contradict to glTF specification (returning error or importing an empty scene will give no particular difference) - in fact reader is trying to follow specs more strictly here.

(0103959)
git   
2021-09-09 22:21   
Branch CR32540 has been created by kgv.

SHA-1: 85143ccdc35fb89e73fdbeded166b8ab1ef8a4bc


Detailed log of new commits:

Author: kgv
Date: Thu Sep 9 21:59:18 2021 +0300

    0032540: RWGltf_CafReader - optional "scene" parameter encoded as mandatory
    
    First scene is now loaded when default one is undefined.
(0103966)
git   
2021-09-09 23:40   
Branch CR32540 has been updated forcibly by kgv.

SHA-1: d297772c5806efca078b4b7c8f85b9d72807bcc3
(0103967)
kgv   
2021-09-09 23:46   
Patch is ready for review
- OCCT: branch CR32540.
(0103992)
osa   
2021-09-10 19:29   
The patch was reviewed
(0104016)
smoskvin   
2021-09-11 13:27   
Combination -
OCCT branch : IR-2021-09-10
master SHA - 9ae883970dd77a39d856b49e6883ed5d0e60d20f
49e51745631c52b6c452c65adae4d6dfa21a1b1e
Products branch : IR-2021-09-10 SHA - 2d2bc879e2da9d770a1938ab3410f5885c8555e7
was compiled on Linux, MacOS and Windows platforms and tested in optimize mode.

Number of compiler warnings:
No new/fixed warnings

Regressions/Differences/Improvements:
No regressions/differences

CPU differences:
Debian80-64:
OCCT
Total CPU difference: 17358.54000000042 / 17496.500000000422 [-0.79%]
Products
Total CPU difference: 11397.800000000112 / 11567.680000000111 [-1.47%]
Windows-64-VC14:
OCCT
Total CPU difference: 19328.109375 / 19307.609375 [+0.11%]
Products
Total CPU difference: 12733.328125 / 12920.953125 [-1.45%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention
(0104045)
git   
2021-09-11 14:06   
Branch CR32540 has been deleted by mnt.

SHA-1: d297772c5806efca078b4b7c8f85b9d72807bcc3