2
0
Эх сурвалжийг харах

Merge pull request #20227 from Mugen87/dev53

Editor: Make emissiveIntensity configurable.
Mr.doob 4 жил өмнө
parent
commit
59e27eb8b2

+ 10 - 0
editor/js/Sidebar.Material.js

@@ -197,9 +197,11 @@ function SidebarMaterial( editor ) {
 
 	var materialEmissiveRow = new UIRow();
 	var materialEmissive = new UIColor().setHexValue( 0x000000 ).onChange( update );
+	var materialEmissiveIntensity = new UINumber( 1 ).setWidth( '30px' ).onChange( update );
 
 	materialEmissiveRow.add( new UIText( strings.getKey( 'sidebar/material/emissive' ) ).setWidth( '90px' ) );
 	materialEmissiveRow.add( materialEmissive );
+	materialEmissiveRow.add( materialEmissiveIntensity );
 
 	container.add( materialEmissiveRow );
 
@@ -693,6 +695,12 @@ function SidebarMaterial( editor ) {
 
 			}
 
+			if ( material.emissiveIntensity !== undefined && material.emissiveIntensity !== materialEmissiveIntensity.getValue() ) {
+
+				editor.execute( new SetMaterialValueCommand( editor, currentObject, 'emissiveIntensity', materialEmissiveIntensity.getValue(), currentMaterialSlot ) );
+
+			}
+
 			if ( material.specular !== undefined && material.specular.getHex() !== materialSpecular.getHexValue() ) {
 
 				editor.execute( new SetMaterialColorCommand( editor, currentObject, 'specular', materialSpecular.getHexValue(), currentMaterialSlot ) );
@@ -1344,6 +1352,8 @@ function SidebarMaterial( editor ) {
 
 			materialEmissive.setHexValue( material.emissive.getHexString() );
 
+			materialEmissiveIntensity.setValue( material.emissiveIntensity );
+
 		}
 
 		if ( material.specular !== undefined ) {