|
@@ -150,18 +150,6 @@ function SidebarScene( editor ) {
|
|
|
|
|
|
// background
|
|
// background
|
|
|
|
|
|
- function onBackgroundChanged() {
|
|
|
|
-
|
|
|
|
- signals.sceneBackgroundChanged.dispatch(
|
|
|
|
- backgroundType.getValue(),
|
|
|
|
- backgroundColor.getHexValue(),
|
|
|
|
- backgroundTexture.getValue(),
|
|
|
|
- backgroundEquirectangularTexture.getValue(),
|
|
|
|
- environmentType.getValue()
|
|
|
|
- );
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
var backgroundRow = new UIRow();
|
|
var backgroundRow = new UIRow();
|
|
|
|
|
|
var backgroundType = new UISelect().setOptions( {
|
|
var backgroundType = new UISelect().setOptions( {
|
|
@@ -196,7 +184,16 @@ function SidebarScene( editor ) {
|
|
|
|
|
|
container.add( backgroundRow );
|
|
container.add( backgroundRow );
|
|
|
|
|
|
- //
|
|
|
|
|
|
+ function onBackgroundChanged() {
|
|
|
|
+
|
|
|
|
+ signals.sceneBackgroundChanged.dispatch(
|
|
|
|
+ backgroundType.getValue(),
|
|
|
|
+ backgroundColor.getHexValue(),
|
|
|
|
+ backgroundTexture.getValue(),
|
|
|
|
+ backgroundEquirectangularTexture.getValue()
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
|
|
function refreshBackgroundUI() {
|
|
function refreshBackgroundUI() {
|
|
|
|
|
|
@@ -216,22 +213,45 @@ function SidebarScene( editor ) {
|
|
var environmentType = new UISelect().setOptions( {
|
|
var environmentType = new UISelect().setOptions( {
|
|
|
|
|
|
'None': '',
|
|
'None': '',
|
|
- 'Background': 'Background',
|
|
|
|
|
|
+ 'Equirectangular': 'Equirect',
|
|
'ModelViewer': 'ModelViewer'
|
|
'ModelViewer': 'ModelViewer'
|
|
|
|
|
|
} ).setWidth( '150px' );
|
|
} ).setWidth( '150px' );
|
|
environmentType.setValue( 'None' );
|
|
environmentType.setValue( 'None' );
|
|
environmentType.onChange( function () {
|
|
environmentType.onChange( function () {
|
|
|
|
|
|
- signals.sceneEnvironmentChanged.dispatch( environmentType.getValue() );
|
|
|
|
|
|
+ onEnvironmentChanged();
|
|
|
|
+ refreshEnvironmentUI();
|
|
|
|
|
|
} );
|
|
} );
|
|
|
|
|
|
environmentRow.add( new UIText( strings.getKey( 'sidebar/scene/environment' ) ).setWidth( '90px' ) );
|
|
environmentRow.add( new UIText( strings.getKey( 'sidebar/scene/environment' ) ).setWidth( '90px' ) );
|
|
environmentRow.add( environmentType );
|
|
environmentRow.add( environmentType );
|
|
|
|
|
|
|
|
+ var environmentEquirectangularTexture = new UITexture().setMarginLeft( '8px' ).onChange( onEnvironmentChanged );
|
|
|
|
+ environmentEquirectangularTexture.setDisplay( 'none' );
|
|
|
|
+ environmentRow.add( environmentEquirectangularTexture );
|
|
|
|
+
|
|
container.add( environmentRow );
|
|
container.add( environmentRow );
|
|
|
|
|
|
|
|
+ function onEnvironmentChanged() {
|
|
|
|
+
|
|
|
|
+ signals.sceneEnvironmentChanged.dispatch(
|
|
|
|
+ environmentType.getValue(),
|
|
|
|
+ environmentEquirectangularTexture.getValue()
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ function refreshEnvironmentUI() {
|
|
|
|
+
|
|
|
|
+ var type = environmentType.getValue();
|
|
|
|
+
|
|
|
|
+ environmentType.setWidth( type !== 'Equirectangular' ? '150px' : '110px' );
|
|
|
|
+ environmentEquirectangularTexture.setDisplay( type === 'Equirectangular' ? '' : 'none' );
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
// fog
|
|
// fog
|
|
|
|
|
|
function onFogChanged() {
|
|
function onFogChanged() {
|