Skip to content

Commit

Permalink
Remove the nonEditable extra property and change menu label to Export…
Browse files Browse the repository at this point in the history
… model
  • Loading branch information
aymanhab committed Jan 11, 2024
1 parent a3e7f9e commit 585009e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion editor/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@
modelLightIntensity.name('Model Light').onChange(function(value){
editor.updateModelLightIntensity(value);
});
gui.add(knobs, 'exportGLtf').name('Export scene');
gui.add(knobs, 'exportGLtf').name('Export model');
if (getParameterByName('expert') === "1"){
gui.add(knobs, 'expertModeSelect').name('Expert Mode');
gui.add(knobs, 'showStats').name('FPS');
Expand Down
8 changes: 6 additions & 2 deletions examples/jsm/exporters/GLTFExporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,8 @@ var GLTFExporter = ( function () {
*/
serializeUserData: function ( object, objectDef ) {

if ( Object.keys( object.userData ).length === 0 ) return;
if ( Object.keys( object.userData ).length === 0 ||
object.userData === 'NonEditable') return;

var options = this.options;
var extensionsUsed = this.extensionsUsed;
Expand Down Expand Up @@ -1243,11 +1244,14 @@ var GLTFExporter = ( function () {
materialDef.occlusionTexture = occlusionMapDef;

}
// If opacity is 1 treat as non transparent to reduce overhead -Ayman 01/24
if (material.opacity > 0.99)
material.transparent = false;

// alphaMode
if ( material.transparent ) {

materialDef.alphaMode = 'OPAQUE';
materialDef.alphaMode = 'BLEND';

} else {

Expand Down

0 comments on commit 585009e

Please sign in to comment.