Przeglądaj źródła

Editor: Set default emissive and specular color.

Mr.doob 10 lat temu
rodzic
commit
046f7809d4
2 zmienionych plików z 5 dodań i 3 usunięć
  1. 4 2
      editor/js/Sidebar.Material.js
  2. 1 1
      editor/js/libs/ui.js

+ 4 - 2
editor/js/Sidebar.Material.js

@@ -114,7 +114,7 @@ Sidebar.Material = function ( editor ) {
 	// emissive
 
 	var materialEmissiveRow = new UI.Panel();
-	var materialEmissive = new UI.Color().onChange( update );
+	var materialEmissive = new UI.Color().setHexValue( 0x000000 ).onChange( update );
 
 	materialEmissiveRow.add( new UI.Text( 'Emissive' ).setWidth( '90px' ) );
 	materialEmissiveRow.add( materialEmissive );
@@ -124,7 +124,7 @@ Sidebar.Material = function ( editor ) {
 	// specular
 
 	var materialSpecularRow = new UI.Panel();
-	var materialSpecular = new UI.Color().onChange( update );
+	var materialSpecular = new UI.Color().setHexValue( 0x111111 ).onChange( update );
 
 	materialSpecularRow.add( new UI.Text( 'Specular' ).setWidth( '90px' ) );
 	materialSpecularRow.add( materialSpecular );
@@ -376,8 +376,10 @@ Sidebar.Material = function ( editor ) {
 	function update() {
 
 		var object = editor.selected;
+
 		var geometry = object.geometry;
 		var material = object.material;
+		
 		var textureWarning = false;
 		var objectHasUvs = false;
 

+ 1 - 1
editor/js/libs/ui.js

@@ -735,7 +735,7 @@ UI.Color.prototype.setValue = function ( value ) {
 
 UI.Color.prototype.setHexValue = function ( hex ) {
 
-	this.dom.value = "#" + ( '000000' + hex.toString( 16 ) ).slice( -6 );
+	this.dom.value = '#' + ( '000000' + hex.toString( 16 ) ).slice( -6 );
 
 	return this;