MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0031703Open CASCADE[OCCT] OCCT:Data Exchangepublic2020-08-10 16:172020-11-25 15:45
Reporterkgv 
Assigned Toosa 
PrioritynormalSeverityfeature 
StatusresolvedResolutionopen 
PlatformOSOS Version
Product Version 
Target Version[OCCT] 7.6.0*Fixed in Version 
Summary0031703: Data Exchange, RWGltf_CafWriter - add option putting textures inside GLB file as alternative to external references
DescriptionCurrently, binary glTF (glb) export preserves texture images as external file references. It is desired providing an option which would put textures inside glb file.
Steps To Reproducepload XDE OCAF VISUALIZATION
ReadGltf D Lantern.glb
vinit View
XDisplay -dispMode 1 D
vfit
WriteGltf D LanternWithTextures.glb -texturesInside
TagsNo tags attached.
Test case number
Attached Files? file icon Lantern.glb (9,872,848 bytes) 2020-11-17 17:45

- Relationships
duplicate of 0030953verifiedbugmaster Data Exchange - implement export of mesh data into glTF 2.0 format 

-  Notes
(0096837)
git (administrator)
2020-11-17 17:39

Branch CR31703 has been created by mkrylova.

SHA-1: c8a2bc3048c317b25a5dae4f5b572d648f9ee13a


Detailed log of new commits:

Author: mkrylova
Date: Fri Nov 6 11:33:58 2020 +0300

    0031703: Data Exchange, RWGltf_CafWriter - add option putting textures inside GLB file as alternative to external references
    
    - Added opportunity ti put textures inside GLB file
    - Added new flag to WriteGltf
(0096841)
kgv (developer)
2020-11-17 18:06
edited on: 2020-11-24 10:32

+      theWriter->Key ("mimeType");
+      theWriter->String ("image/png");

Why all images are expected to be in PNG format?
Image_Texture::ProbeImageFileFormat() could be useful here.

@@ -301,8 +338,10 @@ bool RWGltf_CafWriter::Perform (const Handle(TDocStd_Document)& theDocument,
                                 
const TDF_LabelSequence& theRootLabels,
                                 const TColStd_MapOfAsciiString* theLabelFilter,
                                 const TColStd_IndexedDataMapOfStringString& theFileInfo,
-                                const Message_ProgressRange& theProgress)
+                                const Message_ProgressRange& theProgress,
+                                Standard_Boolean theIsTexturesInside)

The new flag should not be passed through Perform() parameter - it should be set via dedicated method.

+  Standard_Boolean                              myToPutTexturesInside;

New class field is undefined within constructor.

(0097023)
kgv (developer)
2020-11-24 10:29

+      std::ofstream aFileOut;
+      aBinFile.write ((const char*)aBuffer->Data(), aBuffer->Size());
+      aFileOut.close();
What is the purpose for unused aFileOut?

+        OSD_OpenStream (aFileIn, aCurrImageTexture->FilePath().ToCString(), std::ios::in | std::ios::binary);

+        aBuffer = new NCollection_Buffer(NCollection_BaseAllocator::CommonBaseAllocator(), aLen);
+      aBinFile.write ((const char*)aBuffer->Data(), aBuffer->Size());

This is counter-efficient always reading entire image file into temporary buffer. The usual way is reading file by chunks of reasonable size into temporary buffer / writing into output file.
(0097037)
git (administrator)
2020-11-24 16:54

Branch CR31703 has been updated forcibly by mkrylova.

SHA-1: 5fef75bc1fbf8cd1cef1b6e0c10932fd63eb9b7f
(0097040)
git (administrator)
2020-11-24 17:04

Branch CR31703_1 has been created by mkrylova.

SHA-1: 57f252e34f124726827923f7e061e2c4ef5b8675


Detailed log of new commits:

Author: mkrylova
Date: Fri Nov 6 11:33:58 2020 +0300

    0031703: Data Exchange, RWGltf_CafWriter - add option putting textures inside GLB file as alternative to external references
    
    - Added opportunity ti put textures inside GLB file
    - Added new flag to WriteGltf

- Issue History
Date Modified Username Field Change
2020-08-10 16:17 kgv New Issue
2020-08-10 16:17 kgv Assigned To => kgv
2020-08-10 16:21 kgv Assigned To kgv => mkrylova
2020-08-10 16:21 kgv Status new => assigned
2020-08-10 16:22 kgv Relationship added duplicate of 0030953
2020-09-18 12:04 kgv Target Version 7.5.0 => 7.6.0*
2020-11-17 17:39 git Note Added: 0096837
2020-11-17 17:45 mkrylova File Added: Lantern.glb
2020-11-17 17:46 mkrylova Assigned To mkrylova => gka
2020-11-17 17:46 mkrylova Status assigned => resolved
2020-11-17 17:46 mkrylova Steps to Reproduce Updated View Revisions
2020-11-17 17:47 mkrylova Assigned To gka => mkrylova
2020-11-17 17:47 mkrylova Status resolved => assigned
2020-11-17 17:48 mkrylova Assigned To mkrylova => osa
2020-11-17 17:48 mkrylova Status assigned => resolved
2020-11-17 18:06 kgv Note Added: 0096841
2020-11-24 10:29 kgv Note Added: 0097023
2020-11-24 10:30 kgv Assigned To osa => mkrylova
2020-11-24 10:30 kgv Status resolved => assigned
2020-11-24 10:32 kgv Note Edited: 0096841 View Revisions
2020-11-24 10:32 kgv Note Edited: 0096841 View Revisions
2020-11-24 16:54 git Note Added: 0097037
2020-11-24 17:04 git Note Added: 0097040
2020-11-25 15:45 mkrylova Assigned To mkrylova => osa
2020-11-25 15:45 mkrylova Status assigned => resolved


Copyright © 2000 - 2020 MantisBT Team
Powered by Mantis Bugtracker