main.tscript 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464
  1. //-----------------------------------------------------------------------------
  2. // Copyright (c) 2012 GarageGames, LLC
  3. //
  4. // Permission is hereby granted, free of charge, to any person obtaining a copy
  5. // of this software and associated documentation files (the "Software"), to
  6. // deal in the Software without restriction, including without limitation the
  7. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  8. // sell copies of the Software, and to permit persons to whom the Software is
  9. // furnished to do so, subject to the following conditions:
  10. //
  11. // The above copyright notice and this permission notice shall be included in
  12. // all copies or substantial portions of the Software.
  13. //
  14. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  19. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  20. // IN THE SOFTWARE.
  21. //-----------------------------------------------------------------------------
  22. //------------------------------------------------------------------------------
  23. // Shape Editor
  24. //------------------------------------------------------------------------------
  25. function initializeShapeEditor()
  26. {
  27. echo(" % - Initializing Shape Editor");
  28. exec("./gui/Profiles.ed." @ $TorqueScriptFileExtension);
  29. // Order of GUI loading is important
  30. exec("./gui/shapeEdPreviewWindow.ed.gui");
  31. exec("./gui/ShapeEditorToolbar.ed.gui");
  32. exec("./gui/shapeEdSelectWindow.ed.gui");
  33. exec("./gui/shapeEdPropWindow.ed.gui");
  34. exec("./gui/shapeEdAdvancedWindow.ed.gui");
  35. exec("./gui/shapeEdAnimWindow.ed.gui");
  36. exec("./gui/shapeEdAddSequenceGui.gui");
  37. exec("./gui/shapeEdAddSequenceGui.tscript");
  38. exec("./scripts/shapeEditor.ed." @ $TorqueScriptFileExtension);
  39. exec("./scripts/shapeEditorHints.ed." @ $TorqueScriptFileExtension);
  40. exec("./scripts/shapeEditorActions.ed." @ $TorqueScriptFileExtension);
  41. // Add windows to editor gui
  42. ShapeEdPreviewGui.setVisible(false);
  43. ShapeEdAnimWindow.setVisible(false);
  44. ShapeEdSelectWindow.setVisible(false);
  45. ShapeEdPropWindow.setVisible(false);
  46. MainSceneTabPanel.add(ShapeEdPreviewGui);
  47. MainSceneTabPanel.add(ShapeEdAnimWindow);
  48. MainSceneTabPanel.add(ShapeEdAdvancedWindow);
  49. MainSceneTabPanel.add(ShapeEdSelectWindow);
  50. MainSceneTabPanel.add(ShapeEdPropWindow);
  51. new ScriptObject(ShapeEditorPlugin)
  52. {
  53. superClass = "EditorPlugin";
  54. editorGui = ShapeEdShapeView;
  55. };
  56. %map = new ActionMap();
  57. %map.bindCmd( keyboard, "escape", "ToolsToolbarArray->WorldEditorInspectorPalette.performClick();", "" );
  58. %map.bindCmd( keyboard, "1", "ShapeEditorNoneModeBtn.performClick();", "" );
  59. %map.bindCmd( keyboard, "2", "ShapeEditorMoveModeBtn.performClick();", "" );
  60. %map.bindCmd( keyboard, "3", "ShapeEditorRotateModeBtn.performClick();", "" );
  61. //%map.bindCmd( keyboard, "4", "ShapeEditorScaleModeBtn.performClick();", "" ); // not needed for the shape editor
  62. %map.bindCmd( keyboard, "n", "ShapeEditorToolbar->showNodes.performClick();", "" );
  63. %map.bindCmd( keyboard, "t", "ShapeEditorToolbar->ghostMode.performClick();", "" );
  64. %map.bindCmd( keyboard, "r", "ShapeEditorToolbar->wireframeMode.performClick();", "" );
  65. %map.bindCmd( keyboard, "f", "ShapeEditorToolbar->fitToShapeBtn.performClick();", "" );
  66. %map.bindCmd( keyboard, "g", "ShapeEditorToolbar->showGridBtn.performClick();", "" );
  67. %map.bindCmd( keyboard, "h", "ShapeEdSelectWindow->tabBook.selectPage( 2 );", "" ); // Load help tab
  68. %map.bindCmd( keyboard, "l", "ShapeEdSelectWindow->tabBook.selectPage( 1 );", "" ); // load Library Tab
  69. %map.bindCmd( keyboard, "j", "ShapeEdSelectWindow->tabBook.selectPage( 0 );", "" ); // load scene object Tab
  70. %map.bindCmd( keyboard, "SPACE", "ShapeEdAnimWindow.togglePause();", "" );
  71. %map.bindCmd( keyboard, "i", "ShapeEdSequences.onEditSeqInOut(\"in\", ShapeEdSeqSlider.getValue());", "" );
  72. %map.bindCmd( keyboard, "o", "ShapeEdSequences.onEditSeqInOut(\"out\", ShapeEdSeqSlider.getValue());", "" );
  73. %map.bindCmd( keyboard, "shift -", "ShapeEdSeqSlider.setValue(ShapeEdAnimWindow-->seqIn.getText());", "" );
  74. %map.bindCmd( keyboard, "shift =", "ShapeEdSeqSlider.setValue(ShapeEdAnimWindow-->seqOut.getText());", "" );
  75. %map.bindCmd( keyboard, "=", "ShapeEdAnimWindow-->stepFwdBtn.performClick();", "" );
  76. %map.bindCmd( keyboard, "-", "ShapeEdAnimWindow-->stepBkwdBtn.performClick();", "" );
  77. ShapeEditorPlugin.map = %map;
  78. ShapeEditorPlugin.initSettings();
  79. }
  80. function destroyShapeEditor()
  81. {
  82. }
  83. function SetToggleButtonValue(%ctrl, %value)
  84. {
  85. if ( %ctrl.getValue() != %value )
  86. %ctrl.performClick();
  87. }
  88. // Replace the command field in an Editor PopupMenu item (returns the original value)
  89. function ShapeEditorPlugin::replaceMenuCmd(%this, %menuTitle, %id, %newCmd)
  90. {
  91. %menu = EditorGui.findMenu( %menuTitle );
  92. %cmd = getField( %menu.item[%id], 2 );
  93. %menu.setItemCommand( %id, %newCmd );
  94. return %cmd;
  95. }
  96. function ShapeEditorPlugin::onWorldEditorStartup(%this)
  97. {
  98. // Add ourselves to the window menu.
  99. %accel = EditorGui.addToEditorsMenu("Shape Editor", "", ShapeEditorPlugin);
  100. // Add ourselves to the ToolsToolbar
  101. %tooltip = "Shape Editor (" @ %accel @ ")";
  102. EditorGui.addToToolsToolbar( "ShapeEditorPlugin", "ShapeEditorPalette", "ToolsModule:shape_editor_n_image", %tooltip );
  103. // Add ourselves to the Editor Settings window
  104. exec( "./gui/ShapeEditorSettingsTab.gui" );
  105. //ESettingsWindow.addTabPage( EShapeEditorSettingsPage );
  106. GuiWindowCtrl::attach(ShapeEdPropWindow, ShapeEdSelectWindow);
  107. // Initialise gui
  108. ShapeEdSeqNodeTabBook.selectPage(0);
  109. ShapeEdAdvancedWindow-->tabBook.selectPage(0);
  110. ShapeEdSelectWindow-->tabBook.selectPage(0);
  111. SetToggleButtonValue( ShapeEditorToolbar-->orbitNodeBtn, 0 );
  112. SetToggleButtonValue( ShapeEditorToolbar-->ghostMode, 0 );
  113. // Initialise hints menu
  114. ShapeEdHintMenu.clear();
  115. %count = ShapeHintGroup.getCount();
  116. for (%i = 0; %i < %count; %i++)
  117. {
  118. %hint = ShapeHintGroup.getObject(%i);
  119. ShapeEdHintMenu.add(%hint.objectType, %hint);
  120. }
  121. }
  122. function ShapeEditorPlugin::openShapeAsset(%this, %assetDef)
  123. {
  124. %this.selectedAssetDef = %assetDef;
  125. %this.open(%this.selectedAssetDef);
  126. }
  127. function ShapeEditorPlugin::openShapeAssetId(%this, %assetId)
  128. {
  129. %this.selectedAssetDef = AssetDatabase.acquireAsset(%assetId);
  130. EditorGui.setEditor( ShapeEditorPlugin );
  131. ShapeEditorPlugin.openShapeAsset(%this.selectedAssetDef);
  132. }
  133. function ShapeEditorPlugin::open(%this, %shapeAsset)
  134. {
  135. if ( !%this.isActivated )
  136. {
  137. // Activate the Shape Editor
  138. EditorGui.setEditor( %this, true );
  139. // Get editor settings (note the sun angle is not configured in the settings
  140. // dialog, so apply the settings here instead of in readSettings)
  141. %this.readSettings();
  142. ShapeEdShapeView.sunAngleX = EditorSettings.value("ShapeEditor/SunAngleX");
  143. ShapeEdShapeView.sunAngleZ = EditorSettings.value("ShapeEditor/SunAngleZ");
  144. EWorldEditor.forceLoadDAE = EditorSettings.value("forceLoadDAE");
  145. $wasInWireFrameMode = $gfx::wireframe;
  146. ShapeEditorToolbar-->wireframeMode.setStateOn($gfx::wireframe);
  147. if ( GlobalGizmoProfile.getFieldValue(alignment) $= "Object" )
  148. ShapeEdNodes-->objectTransform.setStateOn(1);
  149. else
  150. ShapeEdNodes-->worldTransform.setStateOn(1);
  151. // Initialise and show the shape editor
  152. ShapeEdShapeTreeView.open(getScene(0));
  153. ShapeEdShapeTreeView.buildVisibleTree(true);
  154. ShapeEdPreviewGui.setVisible(true);
  155. ShapeEdSelectWindow.setVisible(true);
  156. ShapeEdPropWindow.setVisible(true);
  157. ShapeEdAnimWindow.setVisible(true);
  158. ShapeEdAdvancedWindow.setVisible(ShapeEditorToolbar-->showAdvanced.getValue());
  159. MainSceneTabPanel.bringToFront(ShapeEdPreviewGui);
  160. ToolsPaletteArray.getObject(0).performClick();
  161. %this.map.push();
  162. // Switch to the ShapeEditor UndoManager
  163. %this.oldUndoMgr = Editor.getUndoManager();
  164. Editor.setUndoManager( ShapeEdUndoManager );
  165. ShapeEdShapeView.setDisplayType( EditorGui.currentDisplayType );
  166. %this.initStatusBar();
  167. // Customise menu bar
  168. %this.oldCamFitCmd = %this.replaceMenuCmd( "Camera", 8, "ShapeEdShapeView.fitToShape();" );
  169. %this.oldCamFitOrbitCmd = %this.replaceMenuCmd( "Camera", 9, "ShapeEdShapeView.fitToShape();" );
  170. Parent::onActivated(%this);
  171. }
  172. // Select the new shape
  173. if (isObject(ShapeEditor.shape) && (ShapeEditor.shape.baseShapeAsset $= %shapeAsset))
  174. {
  175. // Shape is already selected => re-highlight the selected material if necessary
  176. ShapeEdMaterials.updateSelectedMaterial(ShapeEdMaterials-->highlightMaterial.getValue());
  177. }
  178. else if (%shapeAsset !$= "")
  179. {
  180. ShapeEditor.selectShape(%shapeAsset, ShapeEditor.isDirty());
  181. // 'fitToShape' only works after the GUI has been rendered, so force a repaint first
  182. Canvas.repaint();
  183. ShapeEdShapeView.fitToShape();
  184. }
  185. }
  186. function EditorGui::SetShapePalletBar()
  187. {
  188. //Clears the button pallete stack
  189. EWToolsPaletteWindow.setStackCtrl(ToolsPaletteArray); //legacy ctrl adhereance
  190. EWToolsPaletteWindow.clearButtons();
  191. EWToolsPaletteWindow.setActionMap(WorldEditorInspectorPlugin.map);
  192. //Adds a button to the pallete stack
  193. //Name Icon Click Command Tooltip text Keybind
  194. EWToolsPaletteWindow.addButton("Select", "ToolsModule:arrow_n_image", "GlobalGizmoProfile.mode = \"None\";", "", "Select Arrow", "1");
  195. EWToolsPaletteWindow.addButton("MoveSelection", "ToolsModule:move_point_n_image", "GlobalGizmoProfile.mode = \"Move\";", "", "Move", "2");
  196. EWToolsPaletteWindow.addButton("RotateSelection", "ToolsModule:rotate_point_n_image", "GlobalGizmoProfile.mode = \"Rotate\";", "", "Rotate", "3");
  197. EWToolsPaletteWindow.addButton("RotateSun", "ToolsModule:sun_btn_n_image", "ShapeEdShapeView.editSun = !ShapeEdShapeView.editSun;", "", "Rotate sun", "4");
  198. EWToolsPaletteWindow.refresh();
  199. }
  200. function ShapeEditorPlugin::onActivated(%this)
  201. {
  202. %this.open("");
  203. %this.storedHDRAdaptRateVal = $PostFX::HDRPostFX::enableAutoExposure;
  204. $PostFX::HDRPostFX::enableAutoExposure = false;
  205. // Try to start with the shape selected in the world editor
  206. %count = EWorldEditor.getSelectionSize();
  207. for (%i = 0; %i < %count; %i++)
  208. {
  209. %obj = EWorldEditor.getSelectedObject(%i);
  210. %shapeFile = ShapeEditor.getObjectShapeFile(%obj);
  211. if (%shapeFile !$= "" && isFile(%shapeFile))
  212. {
  213. if (!isObject(ShapeEditor.shape) || (ShapeEditor.shape.baseShape !$= %shapeFile))
  214. {
  215. // Call the 'onSelect' method directly if the object is not in the
  216. // MissionGroup tree (such as a Player or Projectile object).
  217. ShapeEdShapeTreeView.clearSelection();
  218. if (!ShapeEdShapeTreeView.selectItem(%obj))
  219. ShapeEdShapeTreeView.onSelect(%obj);
  220. // 'fitToShape' only works after the GUI has been rendered, so force a repaint first
  221. Canvas.repaint();
  222. ShapeEdShapeView.fitToShape();
  223. }
  224. break;
  225. }
  226. else if(%shapeFile !$= "")
  227. {
  228. %this.openShapeAssetId(%shapeFile);
  229. }
  230. }
  231. EditorGuiToolbarStack.remove( EWorldEditorToolbar );
  232. EditorGuiToolbarStack.add( ShapeEditorToolbar );
  233. EditorGui.SetShapePalletBar();
  234. }
  235. function ShapeEditorPlugin::initStatusBar(%this)
  236. {
  237. EditorGuiStatusBar.setInfo("Shape editor ( Shift Click ) to speed up camera.");
  238. EditorGuiStatusBar.setSelection( ShapeEditor.shape.baseShape );
  239. }
  240. function ShapeEditorPlugin::onDeactivated(%this)
  241. {
  242. %this.writeSettings();
  243. // Notify game objects if shape has been modified
  244. if ( ShapeEditor.isDirty() )
  245. ShapeEditor.shape.notifyShapeChanged();
  246. $gfx::wireframe = $wasInWireFrameMode;
  247. ShapeEdMaterials.updateSelectedMaterial(false);
  248. EditorGuiToolbarStack.add( EWorldEditorToolbar );
  249. EditorGuiToolbarStack.remove( ShapeEditorToolbar );
  250. ShapeEdPreviewGui.setVisible(false);
  251. ShapeEdSelectWindow.setVisible(false);
  252. ShapeEdPropWindow.setVisible(false);
  253. ShapeEdAnimWindow.setVisible(false);
  254. ShapeEdAdvancedWindow.setVisible(false);
  255. if( MaterialEditorGui.isAwake() )
  256. {
  257. ShapeEdMaterials.editSelectedMaterialEnd( true );
  258. }
  259. %this.map.pop();
  260. // Restore the original undo manager
  261. Editor.setUndoManager( %this.oldUndoMgr );
  262. // Restore menu bar
  263. %this.replaceMenuCmd( "Camera", 8, %this.oldCamFitCmd );
  264. %this.replaceMenuCmd( "Camera", 9, %this.oldCamFitOrbitCmd );
  265. $PostFX::HDRPostFX::enableAutoExposure = %this.storedHDRAdaptRateVal;
  266. Parent::onDeactivated(%this);
  267. }
  268. function ShapeEditorPlugin::onExitMission( %this )
  269. {
  270. // unselect the current shape
  271. ShapeEdShapeView.setModel( "" );
  272. if (isObject(ShapeEditor.shape))
  273. ShapeEditor.shape.delete();
  274. ShapeEditor.shape = 0;
  275. ShapeEdUndoManager.clearAll();
  276. ShapeEditor.setDirty( false );
  277. ShapeEdSequenceList.clear();
  278. ShapeEdNodeTreeView.removeItem( 0 );
  279. ShapeEdPropWindow.update_onNodeSelectionChanged( -1 );
  280. ShapeEdDetailTree.removeItem( 0 );
  281. ShapeEdMaterialList.clear();
  282. ShapeEdMountWindow-->mountList.clear();
  283. ShapeEdThreadWindow-->seqList.clear();
  284. ShapeEdThreadList.clear();
  285. }
  286. function ShapeEditorPlugin::openShape( %this, %path, %discardChangesToCurrent )
  287. {
  288. EditorGui.setEditor( ShapeEditorPlugin );
  289. if( ShapeEditor.isDirty() && !%discardChangesToCurrent )
  290. {
  291. toolsMessageBoxYesNo( "Save Changes?",
  292. "Save changes to current shape?",
  293. "ShapeEditor.saveChanges(); ShapeEditorPlugin.openShape(\"" @ %path @ "\");",
  294. "ShapeEditorPlugin.openShape(\"" @ %path @ "\");" );
  295. return;
  296. }
  297. ShapeEditor.selectShape( %path );
  298. ShapeEdShapeView.fitToShape();
  299. }
  300. function shapeEditorWireframeMode()
  301. {
  302. $gfx::wireframe = !$gfx::wireframe;
  303. ShapeEditorToolbar-->wireframeMode.setStateOn($gfx::wireframe);
  304. }
  305. //-----------------------------------------------------------------------------
  306. // Settings
  307. //-----------------------------------------------------------------------------
  308. function ShapeEditorPlugin::initSettings( %this )
  309. {
  310. EditorSettings.beginGroup( "ShapeEditor", true );
  311. // Display options
  312. EditorSettings.setDefaultValue( "BackgroundColor", "128 128 128 100" );
  313. EditorSettings.setDefaultValue( "HighlightMaterial", 1 );
  314. EditorSettings.setDefaultValue( "ShowNodes", 1 );
  315. EditorSettings.setDefaultValue( "ShowBounds", 0 );
  316. EditorSettings.setDefaultValue( "ShowObjBox", 1 );
  317. EditorSettings.setDefaultValue( "RenderMounts", 1 );
  318. EditorSettings.setDefaultValue( "RenderCollision", 0 );
  319. // Grid
  320. EditorSettings.setDefaultValue( "ShowGrid", 1 );
  321. EditorSettings.setDefaultValue( "GridSize", 0.1 );
  322. EditorSettings.setDefaultValue( "GridDimension", "40 40" );
  323. // Sun
  324. EditorSettings.setDefaultValue( "SunDiffuseColor", "255 255 255 255" );
  325. EditorSettings.setDefaultValue( "SunAmbientColor", "180 180 180 255" );
  326. EditorSettings.setDefaultValue( "SunAngleX", "45" );
  327. EditorSettings.setDefaultValue( "SunAngleZ", "135" );
  328. // Sub-windows
  329. EditorSettings.setDefaultValue( "AdvancedWndVisible", "1" );
  330. EditorSettings.endGroup();
  331. }
  332. function ShapeEditorPlugin::readSettings( %this )
  333. {
  334. EditorSettings.beginGroup( "ShapeEditor", true );
  335. // Display options
  336. ShapeEdPreviewGui-->previewBackground.color = ColorIntToFloat( EditorSettings.value("BackgroundColor") );
  337. SetToggleButtonValue( ShapeEdMaterials-->highlightMaterial, EditorSettings.value( "HighlightMaterial" ) );
  338. SetToggleButtonValue( ShapeEditorToolbar-->showNodes, EditorSettings.value( "ShowNodes" ) );
  339. SetToggleButtonValue( ShapeEditorToolbar-->showBounds, EditorSettings.value( "ShowBounds" ) );
  340. SetToggleButtonValue( ShapeEditorToolbar-->showObjBox, EditorSettings.value( "ShowObjBox" ) );
  341. SetToggleButtonValue( ShapeEditorToolbar-->renderColMeshes, EditorSettings.value( "RenderCollision" ) );
  342. SetToggleButtonValue( ShapeEdMountWindow-->renderMounts, EditorSettings.value( "RenderMounts" ) );
  343. // Grid
  344. SetToggleButtonValue( ShapeEditorToolbar-->showGridBtn, EditorSettings.value( "ShowGrid" ) );
  345. ShapeEdShapeView.gridSize = EditorSettings.value( "GridSize" );
  346. ShapeEdShapeView.gridDimension = EditorSettings.value( "GridDimension" );
  347. // Sun
  348. ShapeEdShapeView.sunDiffuse = EditorSettings.value("SunDiffuseColor");
  349. ShapeEdShapeView.sunAmbient = EditorSettings.value("SunAmbientColor");
  350. // Sub-windows
  351. SetToggleButtonValue( ShapeEditorToolbar-->showAdvanced, EditorSettings.value( "AdvancedWndVisible" ) );
  352. EditorSettings.endGroup();
  353. }
  354. function ShapeEditorPlugin::writeSettings( %this )
  355. {
  356. EditorSettings.beginGroup( "ShapeEditor", true );
  357. // Display options
  358. EditorSettings.setValue( "BackgroundColor", ColorFloatToInt( ShapeEdPreviewGui-->previewBackground.color ) );
  359. EditorSettings.setValue( "HighlightMaterial", ShapeEdMaterials-->highlightMaterial.getValue() );
  360. EditorSettings.setValue( "ShowNodes", ShapeEditorToolbar-->showNodes.getValue() );
  361. EditorSettings.setValue( "ShowBounds", ShapeEditorToolbar-->showBounds.getValue() );
  362. EditorSettings.setValue( "ShowObjBox", ShapeEditorToolbar-->showObjBox.getValue() );
  363. EditorSettings.setValue( "RenderCollision", ShapeEditorToolbar-->renderColMeshes.getValue() );
  364. EditorSettings.setValue( "RenderMounts", ShapeEdMountWindow-->renderMounts.getValue() );
  365. // Grid
  366. EditorSettings.setValue( "ShowGrid", ShapeEditorToolbar-->showGridBtn.getValue() );
  367. EditorSettings.setValue( "GridSize", ShapeEdShapeView.gridSize );
  368. EditorSettings.setValue( "GridDimension", ShapeEdShapeView.gridDimension );
  369. // Sun
  370. EditorSettings.setValue( "SunDiffuseColor", ShapeEdShapeView.sunDiffuse );
  371. EditorSettings.setValue( "SunAmbientColor", ShapeEdShapeView.sunAmbient );
  372. EditorSettings.setValue( "SunAngleX", ShapeEdShapeView.sunAngleX );
  373. EditorSettings.setValue( "SunAngleZ", ShapeEdShapeView.sunAngleZ );
  374. // Sub-windows
  375. EditorSettings.setValue( "AdvancedWndVisible", ShapeEditorToolbar-->showAdvanced.getValue() );
  376. EditorSettings.endGroup();
  377. }