View Issue Details

IDProjectCategoryView StatusLast Update
0032540CommunityOCCT:Data Exchangepublic2021-09-11 14:06
Reportermicheld2 Assigned Tosmoskvin  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
PlatformWindowsOSVC++ 2015 
Product Version7.4.0 
Target Version7.6.0Fixed in Version7.6.0 
Summary0032540: RWGltf_CafReader - optional "scene" parameter encoded as mandatory
DescriptionWhen 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
Steps To ReproduceOpening 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())
TagsNo tags attached.
Test case numberNot required

Attached Files

  • SPHERE ONLY.glb (142,348 bytes)

Relationships

child of 0030691 closedbugmaster Open CASCADE Data Exchange - implement import of mesh data from files in glTF format 

Activities

micheld2

2021-08-18 17:04

reporter  

SPHERE ONLY.glb (142,348 bytes)

kgv

2021-08-18 18:06

developer   ~0103282

Last edited: 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.

micheld2

2021-08-18 18:44

reporter   ~0103286

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.

kgv

2021-08-18 19:19

developer   ~0103288

Last edited: 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.

git

2021-09-09 22:21

administrator   ~0103959

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.

git

2021-09-09 23:40

administrator   ~0103966

Branch CR32540 has been updated forcibly by kgv.

SHA-1: d297772c5806efca078b4b7c8f85b9d72807bcc3

kgv

2021-09-09 23:46

developer   ~0103967

Patch is ready for review
- OCCT: branch CR32540.

osa

2021-09-10 19:29

developer   ~0103992

The patch was reviewed

smoskvin

2021-09-11 13:27

administrator   ~0104016

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

git

2021-09-11 14:06

administrator   ~0104045

Branch CR32540 has been deleted by mnt.

SHA-1: d297772c5806efca078b4b7c8f85b9d72807bcc3

Related Changesets

occt: master 8a17a8bb

2021-09-09 18:59:18

kgv


Committer: smoskvin Details Diff
0032540: RWGltf_CafReader - optional "scene" parameter encoded as mandatory

First scene is now loaded when default one is undefined.
Affected Issues
0032540
mod - src/RWGltf/RWGltf_CafReader.cxx Diff File
mod - src/RWGltf/RWGltf_CafReader.hxx Diff File
mod - src/RWGltf/RWGltf_GltfJsonParser.cxx Diff File
mod - src/RWGltf/RWGltf_GltfJsonParser.hxx Diff File
mod - src/RWGltf/RWGltf_GltfRootElement.hxx Diff File
mod - src/XSDRAWSTLVRML/XSDRAWSTLVRML.cxx Diff File

Issue History

Date Modified Username Field Change
2021-08-18 17:04 micheld2 New Issue
2021-08-18 17:04 micheld2 Assigned To => gka
2021-08-18 17:04 micheld2 File Added: SPHERE ONLY.glb
2021-08-18 18:06 kgv Note Added: 0103282
2021-08-18 18:07 kgv Note Edited: 0103282
2021-08-18 18:12 kgv Relationship added child of 0030691
2021-08-18 18:12 kgv Assigned To gka => kgv
2021-08-18 18:12 kgv Product Version 7.5.0 => 7.4.0
2021-08-18 18:12 kgv Target Version => 7.6.0
2021-08-18 18:44 micheld2 Note Added: 0103286
2021-08-18 19:19 kgv Note Added: 0103288
2021-08-18 19:22 kgv Note Edited: 0103288
2021-09-09 22:21 git Note Added: 0103959
2021-09-09 23:40 git Note Added: 0103966
2021-09-09 23:46 kgv Note Added: 0103967
2021-09-09 23:46 kgv Assigned To kgv => osa
2021-09-09 23:46 kgv Status new => resolved
2021-09-10 19:29 osa Note Added: 0103992
2021-09-10 19:29 osa Assigned To osa => bugmaster
2021-09-10 19:29 osa Status resolved => reviewed
2021-09-11 13:27 smoskvin Note Added: 0104016
2021-09-11 13:27 smoskvin Status reviewed => tested
2021-09-11 13:37 smoskvin Test case number => Not required
2021-09-11 13:43 smoskvin Changeset attached => occt master 8a17a8bb
2021-09-11 13:43 smoskvin Assigned To bugmaster => smoskvin
2021-09-11 13:43 smoskvin Status tested => verified
2021-09-11 13:43 smoskvin Resolution open => fixed
2021-09-11 14:06 git Note Added: 0104045