Skip to content

Commit

Permalink
Editor: Remove Fix Color Maps script. (mrdoob#27033)
Browse files Browse the repository at this point in the history
* Editor: Remove `Fix Color Maps` script.

* Editor: Clean up.
  • Loading branch information
Mugen87 authored and CITIZENDOT committed Oct 25, 2023
1 parent 422d096 commit c65f2d7
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 68 deletions.
65 changes: 0 additions & 65 deletions editor/js/Menubar.Edit.js
Expand Up @@ -149,71 +149,6 @@ function MenubarEdit( editor ) {
} );
options.add( option );

//

options.add( new UIHorizontalRule() );

// Set textures to sRGB. See #15903

option = new UIRow();
option.setClass( 'option' );
option.setTextContent( strings.getKey( 'menubar/edit/fixcolormaps' ) );
option.onClick( function () {

editor.scene.traverse( fixColorMap );

} );
options.add( option );

const colorMaps = [ 'map', 'envMap', 'emissiveMap' ];

function fixColorMap( obj ) {

const material = obj.material;

if ( material !== undefined ) {

if ( Array.isArray( material ) === true ) {

for ( let i = 0; i < material.length; i ++ ) {

fixMaterial( material[ i ] );

}

} else {

fixMaterial( material );

}

editor.signals.sceneGraphChanged.dispatch();

}

}

function fixMaterial( material ) {

let needsUpdate = material.needsUpdate;

for ( let i = 0; i < colorMaps.length; i ++ ) {

const map = material[ colorMaps[ i ] ];

if ( map ) {

map.colorSpace = THREE.SRGBColorSpace;
needsUpdate = true;

}

}

material.needsUpdate = needsUpdate;

}

return container;

}
Expand Down
3 changes: 0 additions & 3 deletions editor/js/Strings.js
Expand Up @@ -30,7 +30,6 @@ function Strings( config ) {
'menubar/edit/center': 'Center',
'menubar/edit/clone': 'Clone',
'menubar/edit/delete': 'Delete (Del)',
'menubar/edit/fixcolormaps': 'Fix Color Maps',

'menubar/add': 'Add',
'menubar/add/group': 'Group',
Expand Down Expand Up @@ -382,7 +381,6 @@ function Strings( config ) {
'menubar/edit/center': 'Center',
'menubar/edit/clone': 'Cloner',
'menubar/edit/delete': 'Supprimer (Supp)',
'menubar/edit/fixcolormaps': 'Correction des couleurs',

'menubar/add': 'Ajouter',
'menubar/add/group': 'Groupe',
Expand Down Expand Up @@ -732,7 +730,6 @@ function Strings( config ) {
'menubar/edit/center': '居中',
'menubar/edit/clone': '拷贝',
'menubar/edit/delete': '删除 (Del)',
'menubar/edit/fixcolormaps': '修复颜色贴图',

'menubar/add': '添加',
'menubar/add/group': '组',
Expand Down

0 comments on commit c65f2d7

Please sign in to comment.