You can subscribe to this list here.
2007 |
Jan
|
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
(64) |
Jul
(77) |
Aug
(21) |
Sep
(15) |
Oct
(3) |
Nov
(4) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(1) |
Feb
|
Mar
(12) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(3) |
Dec
|
From: <RoR...@us...> - 2008-11-27 03:54:19
|
Revision: 208 http://roreditor.svn.sourceforge.net/roreditor/?rev=208&view=rev Author: RoRThomas Date: 2008-11-27 03:54:14 +0000 (Thu, 27 Nov 2008) Log Message: ----------- small fixes, compilation errors :( Modified Paths: -------------- cppeditor/CMakeLists.txt cppeditor/include/GesModelStyleNode.h cppeditor/include/OgreMVCCtrlPaneController.h cppeditor/include/OgreMVCFactory.h cppeditor/include/OgreMVCModelEntity.h cppeditor/include/OgreMVCModelManager.h cppeditor/include/OgreMVCModelMovable.h cppeditor/include/OgreMVCModelNull.h cppeditor/include/OgreMVCViewTopFrame.h cppeditor/src/GesMain.cpp cppeditor/src/OgreMVCCtrlFpsCamController.cpp cppeditor/src/OgreMVCCtrlOrbitCamController.cpp cppeditor/src/OgreMVCViewUtils.cpp Modified: cppeditor/CMakeLists.txt =================================================================== --- cppeditor/CMakeLists.txt 2008-11-27 00:00:36 UTC (rev 207) +++ cppeditor/CMakeLists.txt 2008-11-27 03:54:14 UTC (rev 208) @@ -6,13 +6,16 @@ set(wxWidgets_USE_UNICODE ON) #set(wxWidgets_CONFIGURATION mswu) SET(wxWidgets_USE_LIBS base html net) -set(OGRE_DIR /home/thomas/data/ror-trunk/RoRdev/build/dependencies/ogrenew/) +set(OGRE_DIR ${RoR_Editor_SOURCE_DIR}/ogre3d) FIND_PACKAGE(wxWidgets) +FIND_PACKAGE(Boost COMPONENTS date_time filesystem iostreams) IF(wxWidgets_FOUND) - +IF(Boost_FOUND) INCLUDE(${wxWidgets_USE_FILE}) + INCLUDE(${Boost_INCLUDE_DIRS}) include_directories (include) + include_directories (${OGRE_DIR}/OgreMain/include) include_directories (${OGRE_DIR}/Dependencies/include) @@ -22,6 +25,9 @@ # already in correct path, no need to install at all! #install(TARGETS rorconfig.bin DESTINATION ${BIN_DIR}) +ELSE(Boost_FOUND) + MESSAGE("boost not found. Will not build anything.") +ENDIF(Boost_FOUND) ELSE(wxWidgets_FOUND) MESSAGE("wxWidgets not found. Will not build anything.") ENDIF(wxWidgets_FOUND) Modified: cppeditor/include/GesModelStyleNode.h =================================================================== --- cppeditor/include/GesModelStyleNode.h 2008-11-27 00:00:36 UTC (rev 207) +++ cppeditor/include/GesModelStyleNode.h 2008-11-27 03:54:14 UTC (rev 208) @@ -33,4 +33,4 @@ } -#endif \ No newline at end of file +#endif Modified: cppeditor/include/OgreMVCCtrlPaneController.h =================================================================== --- cppeditor/include/OgreMVCCtrlPaneController.h 2008-11-27 00:00:36 UTC (rev 207) +++ cppeditor/include/OgreMVCCtrlPaneController.h 2008-11-27 03:54:14 UTC (rev 208) @@ -3,25 +3,25 @@ This source file is part of wxOgreMVC Copyright (c) 2007 Torus Knot Software Ltd, all rights reserved - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + ----------------------------------------------------------------------------- */ #ifndef OMVC_CTRLPANECONTROLLER_H @@ -73,4 +73,4 @@ } -#endif \ No newline at end of file +#endif Modified: cppeditor/include/OgreMVCFactory.h =================================================================== --- cppeditor/include/OgreMVCFactory.h 2008-11-27 00:00:36 UTC (rev 207) +++ cppeditor/include/OgreMVCFactory.h 2008-11-27 03:54:14 UTC (rev 208) @@ -96,4 +96,4 @@ } -#endif \ No newline at end of file +#endif Modified: cppeditor/include/OgreMVCModelEntity.h =================================================================== --- cppeditor/include/OgreMVCModelEntity.h 2008-11-27 00:00:36 UTC (rev 207) +++ cppeditor/include/OgreMVCModelEntity.h 2008-11-27 03:54:14 UTC (rev 208) @@ -83,4 +83,4 @@ } -#endif \ No newline at end of file +#endif Modified: cppeditor/include/OgreMVCModelManager.h =================================================================== --- cppeditor/include/OgreMVCModelManager.h 2008-11-27 00:00:36 UTC (rev 207) +++ cppeditor/include/OgreMVCModelManager.h 2008-11-27 03:54:14 UTC (rev 208) @@ -88,4 +88,4 @@ } -#endif \ No newline at end of file +#endif Modified: cppeditor/include/OgreMVCModelMovable.h =================================================================== --- cppeditor/include/OgreMVCModelMovable.h 2008-11-27 00:00:36 UTC (rev 207) +++ cppeditor/include/OgreMVCModelMovable.h 2008-11-27 03:54:14 UTC (rev 208) @@ -51,4 +51,4 @@ } -#endif \ No newline at end of file +#endif Modified: cppeditor/include/OgreMVCModelNull.h =================================================================== --- cppeditor/include/OgreMVCModelNull.h 2008-11-27 00:00:36 UTC (rev 207) +++ cppeditor/include/OgreMVCModelNull.h 2008-11-27 03:54:14 UTC (rev 208) @@ -71,4 +71,4 @@ } -#endif \ No newline at end of file +#endif Modified: cppeditor/include/OgreMVCViewTopFrame.h =================================================================== --- cppeditor/include/OgreMVCViewTopFrame.h 2008-11-27 00:00:36 UTC (rev 207) +++ cppeditor/include/OgreMVCViewTopFrame.h 2008-11-27 03:54:14 UTC (rev 208) @@ -105,4 +105,4 @@ }; } -#endif \ No newline at end of file +#endif Modified: cppeditor/src/GesMain.cpp =================================================================== --- cppeditor/src/GesMain.cpp 2008-11-27 00:00:36 UTC (rev 207) +++ cppeditor/src/GesMain.cpp 2008-11-27 03:54:14 UTC (rev 208) @@ -7,13 +7,13 @@ ----------------------------------------------------------------------------- */ -#include "GesStableHeaders.h" -#include "GesPrerequisites.h" +//#include "GesStableHeaders.h" +//#include "GesPrerequisites.h" -#if GES_PLATFORM == GES_PLATFORM_WIN32 -#define WIN32_LEAN_AND_MEAN -#include "windows.h" -#endif +//#if GES_PLATFORM == GES_PLATFORM_WIN32 +//#define WIN32_LEAN_AND_MEAN +//#include "windows.h" +//#endif #ifdef __cplusplus extern "C" { @@ -32,4 +32,4 @@ #ifdef __cplusplus } -#endif \ No newline at end of file +#endif Modified: cppeditor/src/OgreMVCCtrlFpsCamController.cpp =================================================================== --- cppeditor/src/OgreMVCCtrlFpsCamController.cpp 2008-11-27 00:00:36 UTC (rev 207) +++ cppeditor/src/OgreMVCCtrlFpsCamController.cpp 2008-11-27 03:54:14 UTC (rev 208) @@ -3,25 +3,25 @@ This source file is part of wxOgreMVC Copyright (c) 2007 Torus Knot Software Ltd, all rights reserved - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + ----------------------------------------------------------------------------- */ #include "OgreMVCStableHeaders.h" @@ -40,10 +40,10 @@ { #define ID_TIMER wxID_HIGHEST + 1 - BEGIN_EVENT_TABLE(FpsCamController, wxEvtHandler) - EVT_TIMER(ID_TIMER, FpsCamController::OnTimer) - END_EVENT_TABLE() - + BEGIN_EVENT_TABLE(FpsCamController, wxEvtHandler) + EVT_TIMER(ID_TIMER, FpsCamController::OnTimer) + END_EVENT_TABLE() + //--------------------------------------------------------------------- FpsCamController::FpsCamController(ControllerInstance* callback) : PaneController(callback) @@ -197,4 +197,4 @@ } //--------------------------------------------------------------------- -} \ No newline at end of file +} Modified: cppeditor/src/OgreMVCCtrlOrbitCamController.cpp =================================================================== --- cppeditor/src/OgreMVCCtrlOrbitCamController.cpp 2008-11-27 00:00:36 UTC (rev 207) +++ cppeditor/src/OgreMVCCtrlOrbitCamController.cpp 2008-11-27 03:54:14 UTC (rev 208) @@ -3,25 +3,25 @@ This source file is part of wxOgreMVC Copyright (c) 2007 Torus Knot Software Ltd, all rights reserved - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + ----------------------------------------------------------------------------- */ #include "OgreMVCStableHeaders.h" @@ -140,4 +140,4 @@ } //--------------------------------------------------------------------- -} \ No newline at end of file +} Modified: cppeditor/src/OgreMVCViewUtils.cpp =================================================================== --- cppeditor/src/OgreMVCViewUtils.cpp 2008-11-27 00:00:36 UTC (rev 207) +++ cppeditor/src/OgreMVCViewUtils.cpp 2008-11-27 03:54:14 UTC (rev 208) @@ -83,4 +83,4 @@ return proot->createRenderWindow(str.str(), sz.x, sz.y, false, ¶ms); } -} \ No newline at end of file +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <RoR...@us...> - 2008-11-27 00:00:45
|
Revision: 207 http://roreditor.svn.sourceforge.net/roreditor/?rev=207&view=rev Author: RoRThomas Date: 2008-11-27 00:00:36 +0000 (Thu, 27 Nov 2008) Log Message: ----------- initial, broken version based on sinbads implementation Added Paths: ----------- cppeditor/CMakeLists.txt cppeditor/Readme.txt cppeditor/bin/ cppeditor/bin/icons/ cppeditor/bin/icons/arrow_in.png cppeditor/bin/icons/arrow_join.png cppeditor/bin/icons/arrow_out.png cppeditor/bin/icons/arrow_right.png cppeditor/bin/icons/arrow_rotate_anticlockwise.png cppeditor/bin/icons/arrow_turn_left.png cppeditor/bin/icons/arrow_turn_right.png cppeditor/bin/icons/brick.png cppeditor/bin/icons/bullet_black.png cppeditor/bin/icons/bullet_green.png cppeditor/bin/icons/camera.png cppeditor/bin/icons/camera_direct.png cppeditor/bin/icons/camera_targetted.png cppeditor/bin/icons/chart_organisation.png cppeditor/bin/icons/cut.png cppeditor/bin/icons/eye.png cppeditor/bin/icons/folder_page.png cppeditor/bin/icons/lightbulb.png cppeditor/bin/icons/page_copy.png cppeditor/bin/icons/page_lightning.png cppeditor/bin/icons/page_paste.png cppeditor/bin/icons/page_world.png cppeditor/bin/icons/pointer.gif cppeditor/bin/icons/shape_square_add.png cppeditor/bin/icons/shape_square_edit.png cppeditor/bin/icons/vector.png cppeditor/bin/textures/ cppeditor/bin/textures/grid.png cppeditor/bin/xformpanel.fbp cppeditor/copydlls.bat cppeditor/include/ cppeditor/include/GesModelStyleNode.h cppeditor/include/OgreMVCControllerInstance.h cppeditor/include/OgreMVCControllerManager.h cppeditor/include/OgreMVCCtrlFpsCamController.h cppeditor/include/OgreMVCCtrlOrbitCamController.h cppeditor/include/OgreMVCCtrlPaneController.h cppeditor/include/OgreMVCCtrlSelectionController.h cppeditor/include/OgreMVCDefaultControllerInstance.h cppeditor/include/OgreMVCEntityViewNode.h cppeditor/include/OgreMVCEvent.h cppeditor/include/OgreMVCFactory.h cppeditor/include/OgreMVCGeneral.h cppeditor/include/OgreMVCModelEntity.h cppeditor/include/OgreMVCModelManager.h cppeditor/include/OgreMVCModelMovable.h cppeditor/include/OgreMVCModelNode.h cppeditor/include/OgreMVCModelNull.h cppeditor/include/OgreMVCModelRoot.h cppeditor/include/OgreMVCModelSelection.h cppeditor/include/OgreMVCMovableViewNode.h cppeditor/include/OgreMVCMultiItemControllerInstance.h cppeditor/include/OgreMVCPrerequisites.h cppeditor/include/OgreMVCProperty.h cppeditor/include/OgreMVCStableHeaders.h cppeditor/include/OgreMVCViewApp.h cppeditor/include/OgreMVCViewLogWindow.h cppeditor/include/OgreMVCViewNode.h cppeditor/include/OgreMVCViewOgreWindow.h cppeditor/include/OgreMVCViewTopFrame.h cppeditor/include/OgreMVCViewUtils.h cppeditor/include/wxFourWaySplitter.h cppeditor/src/ cppeditor/src/GesMain.cpp cppeditor/src/OgreMVCControllerInstance.cpp cppeditor/src/OgreMVCControllerManager.cpp cppeditor/src/OgreMVCCtrlFpsCamController.cpp cppeditor/src/OgreMVCCtrlOrbitCamController.cpp cppeditor/src/OgreMVCCtrlPaneController.cpp cppeditor/src/OgreMVCCtrlSelectionController.cpp cppeditor/src/OgreMVCDefaultControllerInstance.cpp cppeditor/src/OgreMVCEntityViewNode.cpp cppeditor/src/OgreMVCEvent.cpp cppeditor/src/OgreMVCModelEntity.cpp cppeditor/src/OgreMVCModelManager.cpp cppeditor/src/OgreMVCModelMovable.cpp cppeditor/src/OgreMVCModelNode.cpp cppeditor/src/OgreMVCModelNull.cpp cppeditor/src/OgreMVCModelRoot.cpp cppeditor/src/OgreMVCModelSelection.cpp cppeditor/src/OgreMVCMovableViewNode.cpp cppeditor/src/OgreMVCMultiItemControllerInstance.cpp cppeditor/src/OgreMVCPrecompiledHeaders.cpp cppeditor/src/OgreMVCProperty.cpp cppeditor/src/OgreMVCViewApp.cpp cppeditor/src/OgreMVCViewLogWindow.cpp cppeditor/src/OgreMVCViewOgreWindow.cpp cppeditor/src/OgreMVCViewTopFrame.cpp cppeditor/src/OgreMVCViewUtils.cpp cppeditor/src/wxFourWaySplitter.cpp cppeditor/wxOgreMVC.sln cppeditor/wxOgreMVC.suo cppeditor/wxOgreMVC.vcproj cppeditor/wxOgreMVC.vcproj.user Added: cppeditor/CMakeLists.txt =================================================================== --- cppeditor/CMakeLists.txt (rev 0) +++ cppeditor/CMakeLists.txt 2008-11-27 00:00:36 UTC (rev 207) @@ -0,0 +1,27 @@ +cmake_minimum_required(VERSION 2.4) + +project(RoR_Editor) +aux_source_directory(src editor_src) + +set(wxWidgets_USE_UNICODE ON) +#set(wxWidgets_CONFIGURATION mswu) +SET(wxWidgets_USE_LIBS base html net) +set(OGRE_DIR /home/thomas/data/ror-trunk/RoRdev/build/dependencies/ogrenew/) + +FIND_PACKAGE(wxWidgets) +IF(wxWidgets_FOUND) + + INCLUDE(${wxWidgets_USE_FILE}) + include_directories (include) + include_directories (${OGRE_DIR}/OgreMain/include) + include_directories (${OGRE_DIR}/Dependencies/include) + + add_executable(roreditor.bin ${editor_src}) + TARGET_LINK_LIBRARIES(roreditor.bin ${wxWidgets_LIBRARIES} ) + target_link_libraries(roreditor.bin OgreMain ois) + # already in correct path, no need to install at all! + #install(TARGETS rorconfig.bin DESTINATION ${BIN_DIR}) + +ELSE(wxWidgets_FOUND) + MESSAGE("wxWidgets not found. Will not build anything.") +ENDIF(wxWidgets_FOUND) Added: cppeditor/Readme.txt =================================================================== --- cppeditor/Readme.txt (rev 0) +++ cppeditor/Readme.txt 2008-11-27 00:00:36 UTC (rev 207) @@ -0,0 +1,44 @@ +wxOgreMVC README File +--------------------- + +wxOgreMVC is a framework I wrote in 2007 to create an application written in wxWidgets with multiple Ogre render windows within it. I decided to open the core of this framework under the MIT license to help other people write their own tools using wxWidgets and Ogre. + +As suggested by the name, the framework adheres to the Model View Controller (MVC) pattern of GUI software design. View components display the user interface, controller components receive user input and route it appropriately, and Model components store the persistent data. Controllers are switchable depending on what tool is currently selected, nicely handling variant behaviour. + +There are several things this framework implements: + +1) A multi-window system with embedded Ogre rendering +2) A typical 3D modeller style 4-pane setup with 'cross' splitter control and the ability to maximise a single window +3) Camera controls - FPS and 'focussed' (orbit) mode +4) An event system communicating changes to the model to other subsystems +5) A single click and rubber-band selection system +6) A generic property system +7) A simple model implementation +8) Examples of doing selection display and different view modes (wire, hidden line, textured) + +When using this framework you will undoubtedly want to expand the model and probably the controller system to meet your applications needs. + +Building +-------- +Place the wxOgreMVC folder alongside the 'ogre' folder, or change the paths internally to cope with a different setup. Only VC++ 2005 is supported currently. The 'copydlls.bat' will copy the Ogre DLLs into the bin directory as needed, provided you've built ogre already and used the standard folder setup. + +Dependencies +------------ +1) wxWidgets +2) Boost +3) Ogre (Shoggoth or later) + +Known Issues +------------ +1) wxWidgets reports some leaks still present +2) Many of the controls on toolbars are not implemented +3) On window closure in debug app doesn't always stop immediately +4) Scene is currently hard-coded for proof of concept + + +Acknowledgements +---------------- +The icons in the application are from FamFamFam: http://www.famfamfam.com/lab/icons/silk/ , used under the Creative Commons Attribution 2.5 license. + + +All other work (c) 2007 Torus Knot Software Ltd Added: cppeditor/bin/icons/arrow_in.png =================================================================== (Binary files differ) Property changes on: cppeditor/bin/icons/arrow_in.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: cppeditor/bin/icons/arrow_join.png =================================================================== (Binary files differ) Property changes on: cppeditor/bin/icons/arrow_join.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: cppeditor/bin/icons/arrow_out.png =================================================================== (Binary files differ) Property changes on: cppeditor/bin/icons/arrow_out.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: cppeditor/bin/icons/arrow_right.png =================================================================== (Binary files differ) Property changes on: cppeditor/bin/icons/arrow_right.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: cppeditor/bin/icons/arrow_rotate_anticlockwise.png =================================================================== (Binary files differ) Property changes on: cppeditor/bin/icons/arrow_rotate_anticlockwise.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: cppeditor/bin/icons/arrow_turn_left.png =================================================================== (Binary files differ) Property changes on: cppeditor/bin/icons/arrow_turn_left.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: cppeditor/bin/icons/arrow_turn_right.png =================================================================== (Binary files differ) Property changes on: cppeditor/bin/icons/arrow_turn_right.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: cppeditor/bin/icons/brick.png =================================================================== (Binary files differ) Property changes on: cppeditor/bin/icons/brick.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: cppeditor/bin/icons/bullet_black.png =================================================================== (Binary files differ) Property changes on: cppeditor/bin/icons/bullet_black.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: cppeditor/bin/icons/bullet_green.png =================================================================== (Binary files differ) Property changes on: cppeditor/bin/icons/bullet_green.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: cppeditor/bin/icons/camera.png =================================================================== (Binary files differ) Property changes on: cppeditor/bin/icons/camera.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: cppeditor/bin/icons/camera_direct.png =================================================================== (Binary files differ) Property changes on: cppeditor/bin/icons/camera_direct.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: cppeditor/bin/icons/camera_targetted.png =================================================================== (Binary files differ) Property changes on: cppeditor/bin/icons/camera_targetted.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: cppeditor/bin/icons/chart_organisation.png =================================================================== (Binary files differ) Property changes on: cppeditor/bin/icons/chart_organisation.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: cppeditor/bin/icons/cut.png =================================================================== (Binary files differ) Property changes on: cppeditor/bin/icons/cut.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: cppeditor/bin/icons/eye.png =================================================================== (Binary files differ) Property changes on: cppeditor/bin/icons/eye.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: cppeditor/bin/icons/folder_page.png =================================================================== (Binary files differ) Property changes on: cppeditor/bin/icons/folder_page.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: cppeditor/bin/icons/lightbulb.png =================================================================== (Binary files differ) Property changes on: cppeditor/bin/icons/lightbulb.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: cppeditor/bin/icons/page_copy.png =================================================================== (Binary files differ) Property changes on: cppeditor/bin/icons/page_copy.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: cppeditor/bin/icons/page_lightning.png =================================================================== (Binary files differ) Property changes on: cppeditor/bin/icons/page_lightning.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: cppeditor/bin/icons/page_paste.png =================================================================== (Binary files differ) Property changes on: cppeditor/bin/icons/page_paste.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: cppeditor/bin/icons/page_world.png =================================================================== (Binary files differ) Property changes on: cppeditor/bin/icons/page_world.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: cppeditor/bin/icons/pointer.gif =================================================================== (Binary files differ) Property changes on: cppeditor/bin/icons/pointer.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: cppeditor/bin/icons/shape_square_add.png =================================================================== (Binary files differ) Property changes on: cppeditor/bin/icons/shape_square_add.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: cppeditor/bin/icons/shape_square_edit.png =================================================================== (Binary files differ) Property changes on: cppeditor/bin/icons/shape_square_edit.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: cppeditor/bin/icons/vector.png =================================================================== (Binary files differ) Property changes on: cppeditor/bin/icons/vector.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: cppeditor/bin/textures/grid.png =================================================================== (Binary files differ) Property changes on: cppeditor/bin/textures/grid.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: cppeditor/bin/xformpanel.fbp =================================================================== --- cppeditor/bin/xformpanel.fbp (rev 0) +++ cppeditor/bin/xformpanel.fbp 2008-11-27 00:00:36 UTC (rev 207) @@ -0,0 +1,773 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> +<wxFormBuilder_Project> + <FileVersion major="1" minor="5" /> + <object class="Project" expanded="1"> + <property name="bitmaps"></property> + <property name="code_generation">C++|XRC</property> + <property name="file"></property> + <property name="first_id">1000</property> + <property name="icons"></property> + <property name="internationalize">0</property> + <property name="name">MyProject1</property> + <property name="path">.</property> + <property name="precompiled_header">wx/wxprec.h</property> + <property name="relative_path">1</property> + <property name="use_enum">0</property> + <property name="use_microsoft_bom">0</property> + <object class="Panel" expanded="1"> + <property name="bg"></property> + <property name="enabled">1</property> + <property name="fg"></property> + <property name="font"></property> + <property name="hidden">0</property> + <property name="id">wxID_ANY</property> + <property name="maximum_size"></property> + <property name="minimum_size"></property> + <property name="name">xformPanel</property> + <property name="pos"></property> + <property name="size">191,256</property> + <property name="subclass"></property> + <property name="tooltip"></property> + <property name="window_extra_style"></property> + <property name="window_style">wxTAB_TRAVERSAL</property> + <event name="OnSize"></event> + <object class="wxBoxSizer" expanded="1"> + <property name="minimum_size"></property> + <property name="name">outerCol</property> + <property name="orient">wxVERTICAL</property> + <object class="sizeritem" expanded="1"> + <property name="border">5</property> + <property name="flag">wxEXPAND</property> + <property name="proportion">1</property> + <object class="wxBoxSizer" expanded="1"> + <property name="minimum_size"></property> + <property name="name">scale</property> + <property name="orient">wxHORIZONTAL</property> + <object class="sizeritem" expanded="1"> + <property name="border">5</property> + <property name="flag">wxALL</property> + <property name="proportion">0</property> + <object class="wxBitmapButton" expanded="1"> + <property name="bg"></property> + <property name="bitmap">icons\arrow_out.png; Load From File</property> + <property name="enabled">1</property> + <property name="fg"></property> + <property name="font"></property> + <property name="hidden">0</property> + <property name="id">ID_SCL</property> + <property name="maximum_size"></property> + <property name="minimum_size"></property> + <property name="name">tglScale</property> + <property name="permission">protected</property> + <property name="pos"></property> + <property name="size"></property> + <property name="style">wxBU_AUTODRAW</property> + <property name="subclass"></property> + <property name="tooltip"></property> + <property name="window_extra_style"></property> + <property name="window_style"></property> + <event name="OnButtonClick"></event> + </object> + </object> + <object class="sizeritem" expanded="1"> + <property name="border">5</property> + <property name="flag">wxEXPAND</property> + <property name="proportion">1</property> + <object class="wxBoxSizer" expanded="1"> + <property name="minimum_size"></property> + <property name="name">toolRowScl</property> + <property name="orient">wxVERTICAL</property> + <object class="sizeritem" expanded="1"> + <property name="border">5</property> + <property name="flag">wxEXPAND</property> + <property name="proportion">1</property> + <object class="wxBoxSizer" expanded="1"> + <property name="minimum_size"></property> + <property name="name">axisRowSclX</property> + <property name="orient">wxHORIZONTAL</property> + <object class="sizeritem" expanded="1"> + <property name="border">5</property> + <property name="flag">wxALL</property> + <property name="proportion">0</property> + <object class="wxButton" expanded="1"> + <property name="bg"></property> + <property name="enabled">1</property> + <property name="fg"></property> + <property name="font"></property> + <property name="hidden">0</property> + <property name="id">ID_SCL_X</property> + <property name="label">X</property> + <property name="maximum_size"></property> + <property name="minimum_size"></property> + <property name="name">btnSclX</property> + <property name="permission">protected</property> + <property name="pos"></property> + <property name="size">30,-1</property> + <property name="style"></property> + <property name="subclass"></property> + <property name="tooltip"></property> + <property name="window_extra_style"></property> + <property name="window_style"></property> + <event name="OnButtonClick"></event> + </object> + </object> + <object class="sizeritem" expanded="1"> + <property name="border">5</property> + <property name="flag">wxALL</property> + <property name="proportion">0</property> + <object class="wxTextCtrl" expanded="1"> + <property name="bg"></property> + <property name="enabled">1</property> + <property name="fg"></property> + <property name="font"></property> + <property name="hidden">0</property> + <property name="id">wxID_ANY</property> + <property name="maximum_size"></property> + <property name="maxlength">0</property> + <property name="minimum_size"></property> + <property name="name">txtSclX</property> + <property name="permission">protected</property> + <property name="pos"></property> + <property name="size"></property> + <property name="style">wxTE_PROCESS_ENTER|wxTE_PROCESS_TAB</property> + <property name="subclass"></property> + <property name="tooltip"></property> + <property name="value">1.0</property> + <property name="window_extra_style"></property> + <property name="window_style"></property> + <event name="OnText"></event> + <event name="OnTextEnter"></event> + <event name="OnTextMaxLen"></event> + <event name="OnTextURL"></event> + </object> + </object> + </object> + </object> + <object class="sizeritem" expanded="1"> + <property name="border">5</property> + <property name="flag">wxEXPAND</property> + <property name="proportion">1</property> + <object class="wxBoxSizer" expanded="1"> + <property name="minimum_size"></property> + <property name="name">axisRowSclY</property> + <property name="orient">wxHORIZONTAL</property> + <object class="sizeritem" expanded="1"> + <property name="border">5</property> + <property name="flag">wxALL</property> + <property name="proportion">0</property> + <object class="wxButton" expanded="1"> + <property name="bg"></property> + <property name="enabled">1</property> + <property name="fg"></property> + <property name="font"></property> + <property name="hidden">0</property> + <property name="id">ID_SCL_Y</property> + <property name="label">Y</property> + <property name="maximum_size"></property> + <property name="minimum_size"></property> + <property name="name">btnSclY</property> + <property name="permission">protected</property> + <property name="pos"></property> + <property name="size">30,-1</property> + <property name="style"></property> + <property name="subclass"></property> + <property name="tooltip"></property> + <property name="window_extra_style"></property> + <property name="window_style"></property> + <event name="OnButtonClick"></event> + </object> + </object> + <object class="sizeritem" expanded="1"> + <property name="border">5</property> + <property name="flag">wxALL</property> + <property name="proportion">0</property> + <object class="wxTextCtrl" expanded="1"> + <property name="bg"></property> + <property name="enabled">1</property> + <property name="fg"></property> + <property name="font"></property> + <property name="hidden">0</property> + <property name="id">wxID_ANY</property> + <property name="maximum_size"></property> + <property name="maxlength">0</property> + <property name="minimum_size"></property> + <property name="name">txtSclY</property> + <property name="permission">protected</property> + <property name="pos"></property> + <property name="size"></property> + <property name="style">wxTE_PROCESS_ENTER|wxTE_PROCESS_TAB</property> + <property name="subclass"></property> + <property name="tooltip"></property> + <property name="value">1.0</property> + <property name="window_extra_style"></property> + <property name="window_style"></property> + <event name="OnText"></event> + <event name="OnTextEnter"></event> + <event name="OnTextMaxLen"></event> + <event name="OnTextURL"></event> + </object> + </object> + </object> + </object> + <object class="sizeritem" expanded="1"> + <property name="border">5</property> + <property name="flag">wxEXPAND</property> + <property name="proportion">1</property> + <object class="wxBoxSizer" expanded="1"> + <property name="minimum_size"></property> + <property name="name">axisRowSclZ</property> + <property name="orient">wxHORIZONTAL</property> + <object class="sizeritem" expanded="1"> + <property name="border">5</property> + <property name="flag">wxALL</property> + <property name="proportion">0</property> + <object class="wxButton" expanded="1"> + <property name="bg"></property> + <property name="enabled">1</property> + <property name="fg"></property> + <property name="font"></property> + <property name="hidden">0</property> + <property name="id">ID_SCL_Z</property> + <property name="label">Z</property> + <property name="maximum_size"></property> + <property name="minimum_size"></property> + <property name="name">btnSclZ</property> + <property name="permission">protected</property> + <property name="pos"></property> + <property name="size">30,-1</property> + <property name="style"></property> + <property name="subclass"></property> + <property name="tooltip"></property> + <property name="window_extra_style"></property> + <property name="window_style"></property> + <event name="OnButtonClick"></event> + </object> + </object> + <object class="sizeritem" expanded="1"> + <property name="border">5</property> + <property name="flag">wxALL</property> + <property name="proportion">0</property> + <object class="wxTextCtrl" expanded="1"> + <property name="bg"></property> + <property name="enabled">1</property> + <property name="fg"></property> + <property name="font"></property> + <property name="hidden">0</property> + <property name="id">wxID_ANY</property> + <property name="maximum_size"></property> + <property name="maxlength">0</property> + <property name="minimum_size"></property> + <property name="name">txtSclZ</property> + <property name="permission">protected</property> + <property name="pos"></property> + <property name="size"></property> + <property name="style">wxTE_PROCESS_ENTER|wxTE_PROCESS_TAB</property> + <property name="subclass"></property> + <property name="tooltip"></property> + <property name="value">1.0</property> + <property name="window_extra_style"></property> + <property name="window_style"></property> + <event name="OnText"></event> + <event name="OnTextEnter"></event> + <event name="OnTextMaxLen"></event> + <event name="OnTextURL"></event> + </object> + </object> + </object> + </object> + </object> + </object> + </object> + </object> + <object class="sizeritem" expanded="1"> + <property name="border">5</property> + <property name="flag">wxEXPAND</property> + <property name="proportion">1</property> + <object class="wxBoxSizer" expanded="1"> + <property name="minimum_size"></property> + <property name="name">rotate</property> + <property name="orient">wxHORIZONTAL</property> + <object class="sizeritem" expanded="1"> + <property name="border">5</property> + <property name="flag">wxALL</property> + <property name="proportion">0</property> + <object class="wxBitmapButton" expanded="1"> + <property name="bg"></property> + <property name="bitmap">icons\arrow_rotate_anticlockwise.png; Load From File</property> + <property name="enabled">1</property> + <property name="fg"></property> + <property name="font"></property> + <property name="hidden">0</property> + <property name="id">ID_ROT</property> + <property name="maximum_size"></property> + <property name="minimum_size"></property> + <property name="name">m_bpButton71</property> + <property name="permission">protected</property> + <property name="pos"></property> + <property name="size"></property> + <property name="style">wxBU_AUTODRAW</property> + <property name="subclass"></property> + <property name="tooltip"></property> + <property name="window_extra_style"></property> + <property name="window_style"></property> + <event name="OnButtonClick"></event> + </object> + </object> + <object class="sizeritem" expanded="1"> + <property name="border">5</property> + <property name="flag">wxEXPAND</property> + <property name="proportion">1</property> + <object class="wxBoxSizer" expanded="1"> + <property name="minimum_size"></property> + <property name="name">toolRowRot</property> + <property name="orient">wxVERTICAL</property> + <object class="sizeritem" expanded="1"> + <property name="border">5</property> + <property name="flag">wxEXPAND</property> + <property name="proportion">1</property> + <object class="wxBoxSizer" expanded="1"> + <property name="minimum_size"></property> + <property name="name">axisRowRotX</property> + <property name="orient">wxHORIZONTAL</property> + <object class="sizeritem" expanded="1"> + <property name="border">5</property> + <property name="flag">wxALL</property> + <property name="proportion">0</property> + <object class="wxButton" expanded="1"> + <property name="bg"></property> + <property name="enabled">1</property> + <property name="fg"></property> + <property name="font"></property> + <property name="hidden">0</property> + <property name="id">ID_ROT_X</property> + <property name="label">X</property> + <property name="maximum_size"></property> + <property name="minimum_size"></property> + <property name="name">m_button53</property> + <property name="permission">protected</property> + <property name="pos"></property> + <property name="size">30,-1</property> + <property name="style"></property> + <property name="subclass"></property> + <property name="tooltip"></property> + <property name="window_extra_style"></property> + <property name="window_style"></property> + <event name="OnButtonClick"></event> + </object> + </object> + <object class="sizeritem" expanded="1"> + <property name="border">5</property> + <property name="flag">wxALL</property> + <property name="proportion">0</property> + <object class="wxTextCtrl" expanded="1"> + <property name="bg"></property> + <property name="enabled">1</property> + <property name="fg"></property> + <property name="font"></property> + <property name="hidden">0</property> + <property name="id">wxID_ANY</property> + <property name="maximum_size"></property> + <property name="maxlength">0</property> + <property name="minimum_size"></property> + <property name="name">m_textCtrl33</property> + <property name="permission">protected</property> + <property name="pos"></property> + <property name="size"></property> + <property name="style">wxTE_PROCESS_ENTER|wxTE_PROCESS_TAB</property> + <property name="subclass"></property> + <property name="tooltip"></property> + <property name="value">0.0</property> + <property name="window_extra_style"></property> + <property name="window_style"></property> + <event name="OnText"></event> + <event name="OnTextEnter"></event> + <event name="OnTextMaxLen"></event> + <event name="OnTextURL"></event> + </object> + </object> + </object> + </object> + <object class="sizeritem" expanded="1"> + <property name="border">5</property> + <property name="flag">wxEXPAND</property> + <property name="proportion">1</property> + <object class="wxBoxSizer" expanded="1"> + <property name="minimum_size"></property> + <property name="name">axisRowRotY</property> + <property name="orient">wxHORIZONTAL</property> + <object class="sizeritem" expanded="1"> + <property name="border">5</property> + <property name="flag">wxALL</property> + <property name="proportion">0</property> + <object class="wxButton" expanded="1"> + <property name="bg"></property> + <property name="enabled">1</property> + <property name="fg"></property> + <property name="font"></property> + <property name="hidden">0</property> + <property name="id">ID_ROT_Y</property> + <property name="label">Y</property> + <property name="maximum_size"></property> + <property name="minimum_size"></property> + <property name="name">m_button511</property> + <property name="permission">protected</property> + <property name="pos"></property> + <property name="size">30,-1</property> + <property name="style"></property> + <property name="subclass"></property> + <property name="tooltip"></property> + <property name="window_extra_style"></property> + <property name="window_style"></property> + <event name="OnButtonClick"></event> + </object> + </object> + <object class="sizeritem" expanded="1"> + <property name="border">5</property> + <property name="flag">wxALL</property> + <property name="proportion">0</property> + <object class="wxTextCtrl" expanded="1"> + <property name="bg"></property> + <property name="enabled">1</property> + <property name="fg"></property> + <property name="font"></property> + <property name="hidden">0</property> + <property name="id">wxID_ANY</property> + <property name="maximum_size"></property> + <property name="maxlength">0</property> + <property name="minimum_size"></property> + <property name="name">m_textCtrl311</property> + <property name="permission">protected</property> + <property name="pos"></property> + <property name="size"></property> + <property name="style">wxTE_PROCESS_ENTER|wxTE_PROCESS_TAB</property> + <property name="subclass"></property> + <property name="tooltip"></property> + <property name="value">0.0</property> + <property name="window_extra_style"></property> + <property name="window_style"></property> + <event name="OnText"></event> + <event name="OnTextEnter"></event> + <event name="OnTextMaxLen"></event> + <event name="OnTextURL"></event> + </object> + </object> + </object> + </object> + <object class="sizeritem" expanded="1"> + <property name="border">5</property> + <property name="flag">wxEXPAND</property> + <property name="proportion">1</property> + <object class="wxBoxSizer" expanded="1"> + <property name="minimum_size"></property> + <property name="name">axisRowRotZ</property> + <property name="orient">wxHORIZONTAL</property> + <object class="sizeritem" expanded="1"> + <property name="border">5</property> + <property name="flag">wxALL</property> + <property name="proportion">0</property> + <object class="wxButton" expanded="1"> + <property name="bg"></property> + <property name="enabled">1</property> + <property name="fg"></property> + <property name="font"></property> + <property name="hidden">0</property> + <property name="id">ID_ROT_Z</property> + <property name="label">Z</property> + <property name="maximum_size"></property> + <property name="minimum_size"></property> + <property name="name">m_button521</property> + <property name="permission">protected</property> + <property name="pos"></property> + <property name="size">30,-1</property> + <property name="style"></property> + <property name="subclass"></property> + <property name="tooltip"></property> + <property name="window_extra_style"></property> + <property name="window_style"></property> + <event name="OnButtonClick"></event> + </object> + </object> + <object class="sizeritem" expanded="1"> + <property name="border">5</property> + <property name="flag">wxALL</property> + <property name="proportion">0</property> + <object class="wxTextCtrl" expanded="1"> + <property name="bg"></property> + <property name="enabled">1</property> + <property name="fg"></property> + <property name="font"></property> + <property name="hidden">0</property> + <property name="id">wxID_ANY</property> + <property name="maximum_size"></property> + <property name="maxlength">0</property> + <property name="minimum_size"></property> + <property name="name">m_textCtrl321</property> + <property name="permission">protected</property> + <property name="pos"></property> + <property name="size"></property> + <property name="style">wxTE_PROCESS_ENTER|wxTE_PROCESS_TAB</property> + <property name="subclass"></property> + <property name="tooltip"></property> + <property name="value">0.0</property> + <property name="window_extra_style"></property> + <property name="window_style"></property> + <event name="OnText"></event> + <event name="OnTextEnter"></event> + <event name="OnTextMaxLen"></event> + <event name="OnTextURL"></event> + </object> + </object> + </object> + </object> + </object> + </object> + </object> + </object> + <object class="sizeritem" expanded="1"> + <property name="border">5</property> + <property name="flag">wxEXPAND</property> + <property name="proportion">1</property> + <object class="wxBoxSizer" expanded="1"> + <property name="minimum_size"></property> + <property name="name">scale2</property> + <property name="orient">wxHORIZONTAL</property> + <object class="sizeritem" expanded="1"> + <property name="border">5</property> + <property name="flag">wxALL</property> + <property name="proportion">0</property> + <object class="wxBitmapButton" expanded="1"> + <property name="bg"></property> + <property name="bitmap">icons\arrow_right.png; Load From File</property> + <property name="enabled">1</property> + <property name="fg"></property> + <property name="font"></property> + <property name="hidden">0</property> + <property name="id">ID_TRS</property> + <property name="maximum_size"></property> + <property name="minimum_size"></property> + <property name="name">m_bpButton72</property> + <property name="permission">protected</property> + <property name="pos"></property> + <property name="size"></property> + <property name="style">wxBU_AUTODRAW</property> + <property name="subclass"></property> + <property name="tooltip"></property> + <property name="window_extra_style"></property> + <property name="window_style"></property> + <event name="OnButtonClick"></event> + </object> + </object> + <object class="sizeritem" expanded="1"> + <property name="border">5</property> + <property name="flag">wxEXPAND</property> + <property name="proportion">1</property> + <object class="wxBoxSizer" expanded="1"> + <property name="minimum_size"></property> + <property name="name">bSizer112</property> + <property name="orient">wxVERTICAL</property> + <object class="sizeritem" expanded="1"> + <property name="border">5</property> + <property name="flag">wxEXPAND</property> + <property name="proportion">1</property> + ... [truncated message content] |
From: <RoR...@us...> - 2008-11-26 23:28:35
|
Revision: 206 http://roreditor.svn.sourceforge.net/roreditor/?rev=206&view=rev Author: RoRThomas Date: 2008-11-26 23:28:30 +0000 (Wed, 26 Nov 2008) Log Message: ----------- added new home directory for the cpp editor Added Paths: ----------- cppeditor/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <RoR...@us...> - 2008-10-18 22:27:01
|
Revision: 205 http://roreditor.svn.sourceforge.net/roreditor/?rev=205&view=rev Author: RoRThomas Date: 2008-10-18 22:26:57 +0000 (Sat, 18 Oct 2008) Log Message: ----------- lepe's save fix, thanks very much!! Modified Paths: -------------- trunk/lib_common/ror/terrainparser.py Modified: trunk/lib_common/ror/terrainparser.py =================================================================== --- trunk/lib_common/ror/terrainparser.py 2008-10-18 19:29:25 UTC (rev 204) +++ trunk/lib_common/ror/terrainparser.py 2008-10-18 22:26:57 UTC (rev 205) @@ -66,6 +66,8 @@ content = loadResourceFile(filename) self.beamobj = [] self.objects = [] + self.beamobjs = [] + self.procroads = [] log().info("processing terrain file: %s" % filename) self.processTerrnFile(content) #self.FixTerrainConfig(os.path.join(os.path.dirname(filename), self.TerrainConfig)) @@ -310,4 +312,4 @@ self.saveFile(filename, lines) return True - \ No newline at end of file + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <RoR...@us...> - 2008-10-18 19:29:33
|
Revision: 204 http://roreditor.svn.sourceforge.net/roreditor/?rev=204&view=rev Author: RoRThomas Date: 2008-10-18 19:29:25 +0000 (Sat, 18 Oct 2008) Log Message: ----------- added linux workarounds, one step further towards linux compatibility :) Modified Paths: -------------- trunk/lib_common/roreditor/MainFrame.py trunk/lib_common/wxogre/OgreManager.py trunk/lib_common/wxogre/wxOgreWindow.py Added Paths: ----------- trunk/linux/libwxogre_util.so trunk/tools/linux_workarounds/ trunk/tools/linux_workarounds/gethandle/ trunk/tools/linux_workarounds/gethandle/build.sh trunk/tools/linux_workarounds/gethandle/libwxogre_util.so trunk/tools/linux_workarounds/gethandle/wxogre_util.cpp trunk/tools/linux_workarounds/gethandle/wxogre_util.py Modified: trunk/lib_common/roreditor/MainFrame.py =================================================================== --- trunk/lib_common/roreditor/MainFrame.py 2008-03-22 20:42:36 UTC (rev 203) +++ trunk/lib_common/roreditor/MainFrame.py 2008-10-18 19:29:25 UTC (rev 204) @@ -19,7 +19,7 @@ from GUIObjectTree import * from MainFrame_Tools import * from MainFrame_Tools_ODefEditor import * - + import wx import wx.grid import wx.html @@ -56,496 +56,499 @@ OBJECTDIR = os.path.join(DATADIR, "objects") class MainFrame(wx.Frame): - - def __init__(self, parent, id=-1, title="", pos=wx.DefaultPosition, - size=wx.DefaultSize, style=wx.DEFAULT_FRAME_STYLE | - wx.SUNKEN_BORDER | - wx.CLIP_CHILDREN): + + def __init__(self, parent, id=-1, title="", pos=wx.DefaultPosition, + size=wx.DefaultSize, style=wx.DEFAULT_FRAME_STYLE | + wx.SUNKEN_BORDER | + wx.CLIP_CHILDREN): - wx.Frame.__init__(self, parent, id, title, pos, size, style) - - # tell FrameManager to manage this frame - self._mgr = wx.aui.AuiManager() - self._mgr.SetManagedWindow(self) - - self._perspectives = [] - self.n = 0 - self.x = 0 - - self.SetIcon(wx.Icon('ror.ico',wx.BITMAP_TYPE_ICO)) + wx.Frame.__init__(self, parent, id, title, pos, size, style) + + # tell FrameManager to manage this frame + self._mgr = wx.aui.AuiManager() + self._mgr.SetManagedWindow(self) + + self._perspectives = [] + self.n = 0 + self.x = 0 + + self.SetIcon(wx.Icon('ror.ico',wx.BITMAP_TYPE_ICO)) - # create menu - mb = wx.MenuBar() + #fix Ogre/linux/gethandle issues with this + self.Show(True) + + # create menu + mb = wx.MenuBar() - file_menu = wx.Menu() - #file_menu.Append(ID_OpenTerrain, "Open Terrain") - file_menu.Append(wx.ID_EXIT, "Exit") + file_menu = wx.Menu() + #file_menu.Append(ID_OpenTerrain, "Open Terrain") + file_menu.Append(wx.ID_EXIT, "Exit") - #view_menu = wx.Menu() - #view_menu.Append(ID_CreateOgre, "Create new 3D View") + #view_menu = wx.Menu() + #view_menu.Append(ID_CreateOgre, "Create new 3D View") - self.managerInit() - options_menu = wx.Menu() - options_menu.Append(ID_Settings, "GUI Settings Pane") + self.managerInit() + options_menu = wx.Menu() + options_menu.Append(ID_Settings, "GUI Settings Pane") - self._perspectives_menu = wx.Menu() - self._perspectives_menu.Append(ID_CreatePerspective, "Create Perspective") - #self._perspectives_menu.Append(ID_CopyPerspective, "Copy Perspective Data To Clipboard") - self._perspectives_menu.AppendSeparator() - self._perspectives_menu.Append(ID_FirstPerspective+0, "Default Startup") - self._perspectives_menu.Append(ID_FirstPerspective+1, "Terrain") - self._perspectives_menu.Append(ID_FirstPerspective+2, "ODef Editor") - self._perspectives_menu.Append(ID_FirstPerspective+3, "Truck Editor") + self._perspectives_menu = wx.Menu() + self._perspectives_menu.Append(ID_CreatePerspective, "Create Perspective") + #self._perspectives_menu.Append(ID_CopyPerspective, "Copy Perspective Data To Clipboard") + self._perspectives_menu.AppendSeparator() + self._perspectives_menu.Append(ID_FirstPerspective+0, "Default Startup") + self._perspectives_menu.Append(ID_FirstPerspective+1, "Terrain") + self._perspectives_menu.Append(ID_FirstPerspective+2, "ODef Editor") + self._perspectives_menu.Append(ID_FirstPerspective+3, "Truck Editor") - help_menu = wx.Menu() - help_menu.Append(ID_About, "About...") - help_menu.Append(ID_ViewHelp, "View Help") - - mb.Append(file_menu, "File") - #mb.Append(view_menu, "View") - mb.Append(self._perspectives_menu, "Perspectives") - mb.Append(options_menu, "Options") - mb.Append(help_menu, "Help") - - self.SetMenuBar(mb) + help_menu = wx.Menu() + help_menu.Append(ID_About, "About...") + help_menu.Append(ID_ViewHelp, "View Help") + + mb.Append(file_menu, "File") + #mb.Append(view_menu, "View") + mb.Append(self._perspectives_menu, "Perspectives") + mb.Append(options_menu, "Options") + mb.Append(help_menu, "Help") + + self.SetMenuBar(mb) - self.statusbar = self.CreateStatusBar(5, 0, wx.ID_ANY, "mainstatusbar") - self.statusbar.SetStatusWidths([-1, 200, 130, 250, 80]) + self.statusbar = self.CreateStatusBar(5, 0, wx.ID_ANY, "mainstatusbar") + self.statusbar.SetStatusWidths([-1, 200, 130, 250, 80]) - # min size for the frame itself isn't completely done. - # see the end up FrameManager::Update() for the test - # code. For now, just hard code a frame minimum size - self.SetMinSize(wx.Size(600, 400)) - self.SetTitle("Rigs of Rods Toolkit version 0.34") - - # create some toolbars - self.terraintoolbar = wx.ToolBar(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TB_FLAT | wx.TB_NODIVIDER) - self.terraintoolbar.SetToolBitmapSize(wx.Size(16,16)) - self.terraintoolbar.AddLabelTool(ID_OpenTerrain, "Open Terrain", wx.ArtProvider_GetBitmap(wx.ART_FILE_OPEN)) - self.terraintoolbar.AddLabelTool(ID_SaveTerrain, "Save Terrain", wx.ArtProvider_GetBitmap(wx.ART_FILE_SAVE)) - self.terraintoolbar.EnableTool(ID_SaveTerrain, False) - self.terraintoolbar.AddLabelTool(ID_SaveTerrainAs, "Save Terrain as", wx.ArtProvider_GetBitmap(wx.ART_FILE_SAVE_AS)) - self.terraintoolbar.EnableTool(ID_SaveTerrainAs, False) - self.terraintoolbar.AddSeparator() - #self.terraintoolbar.AddLabelTool(ID_AddObject, "Add Something", wx.ArtProvider_GetBitmap(wx.ART_NEW)) - #self.terraintoolbar.EnableTool(ID_AddObject, False) - #self.terraintoolbar.AddLabelTool(ID_DeleteSelection, "Delete Selection", wx.ArtProvider_GetBitmap(wx.ART_DELETE)) - #self.terraintoolbar.EnableTool(ID_DeleteSelection, False) - #self.terraintoolbar.AddSeparator() - #self.terraintoolbar.AddLabelTool(ID_CopySelection, "Copy Selection", wx.ArtProvider_GetBitmap(wx.ART_COPY)) - #self.terraintoolbar.EnableTool(ID_CopySelection, False) - #self.terraintoolbar.AddLabelTool(ID_PasteSelection, "Paste Selection", wx.ArtProvider_GetBitmap(wx.ART_PASTE)) - #self.terraintoolbar.EnableTool(ID_PasteSelection, False) - #self.terraintoolbar.AddSeparator() - #self.terraintoolbar.AddLabelTool(ID_UndoAction, "Undo last Action", wx.ArtProvider_GetBitmap(wx.ART_UNDO)) - #self.terraintoolbar.EnableTool(ID_UndoAction, False) - #self.terraintoolbar.AddLabelTool(ID_RedoAction, "Redo last Undo", wx.ArtProvider_GetBitmap(wx.ART_REDO)) - #self.terraintoolbar.EnableTool(ID_RedoAction, False) - #self.terraintoolbar.AddSeparator() - #self.terraintoolbar.AddLabelTool(ID_FindObject, "Find Object", wx.ArtProvider_GetBitmap(wx.ART_FIND)) - #self.terraintoolbar.EnableTool(ID_FindObject, False) - #self.terraintoolbar.AddSeparator() - self.terraintoolbar.AddLabelTool(ID_Quit, "Quit", wx.ArtProvider_GetBitmap(wx.ART_QUIT)) - self.terraintoolbar.Realize() - - self.rordir = getSettingsManager().getSetting("RigsOfRods", "BasePath") - - - # add a bunch of panes - self.objectPreviewWindow = ObjectPreviewOgreWindow(self, wx.ID_ANY, rordir=self.rordir) - - self._mgr.AddPane(self.objectPreviewWindow, wx.aui.AuiPaneInfo(). - Name("object_preview"). - Caption("Object Preview"). - CenterPane(). - MinSize(wx.Size(200,200)). - CloseButton(True). - MaximizeButton(False)) + # min size for the frame itself isn't completely done. + # see the end up FrameManager::Update() for the test + # code. For now, just hard code a frame minimum size + self.SetMinSize(wx.Size(600, 400)) + self.SetTitle("Rigs of Rods Toolkit version 0.34") + + # create some toolbars + self.terraintoolbar = wx.ToolBar(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TB_FLAT | wx.TB_NODIVIDER) + self.terraintoolbar.SetToolBitmapSize(wx.Size(16,16)) + self.terraintoolbar.AddLabelTool(ID_OpenTerrain, "Open Terrain", wx.ArtProvider_GetBitmap(wx.ART_FILE_OPEN)) + self.terraintoolbar.AddLabelTool(ID_SaveTerrain, "Save Terrain", wx.ArtProvider_GetBitmap(wx.ART_FILE_SAVE)) + self.terraintoolbar.EnableTool(ID_SaveTerrain, False) + self.terraintoolbar.AddLabelTool(ID_SaveTerrainAs, "Save Terrain as", wx.ArtProvider_GetBitmap(wx.ART_FILE_SAVE_AS)) + self.terraintoolbar.EnableTool(ID_SaveTerrainAs, False) + self.terraintoolbar.AddSeparator() + #self.terraintoolbar.AddLabelTool(ID_AddObject, "Add Something", wx.ArtProvider_GetBitmap(wx.ART_NEW)) + #self.terraintoolbar.EnableTool(ID_AddObject, False) + #self.terraintoolbar.AddLabelTool(ID_DeleteSelection, "Delete Selection", wx.ArtProvider_GetBitmap(wx.ART_DELETE)) + #self.terraintoolbar.EnableTool(ID_DeleteSelection, False) + #self.terraintoolbar.AddSeparator() + #self.terraintoolbar.AddLabelTool(ID_CopySelection, "Copy Selection", wx.ArtProvider_GetBitmap(wx.ART_COPY)) + #self.terraintoolbar.EnableTool(ID_CopySelection, False) + #self.terraintoolbar.AddLabelTool(ID_PasteSelection, "Paste Selection", wx.ArtProvider_GetBitmap(wx.ART_PASTE)) + #self.terraintoolbar.EnableTool(ID_PasteSelection, False) + #self.terraintoolbar.AddSeparator() + #self.terraintoolbar.AddLabelTool(ID_UndoAction, "Undo last Action", wx.ArtProvider_GetBitmap(wx.ART_UNDO)) + #self.terraintoolbar.EnableTool(ID_UndoAction, False) + #self.terraintoolbar.AddLabelTool(ID_RedoAction, "Redo last Undo", wx.ArtProvider_GetBitmap(wx.ART_REDO)) + #self.terraintoolbar.EnableTool(ID_RedoAction, False) + #self.terraintoolbar.AddSeparator() + #self.terraintoolbar.AddLabelTool(ID_FindObject, "Find Object", wx.ArtProvider_GetBitmap(wx.ART_FIND)) + #self.terraintoolbar.EnableTool(ID_FindObject, False) + #self.terraintoolbar.AddSeparator() + self.terraintoolbar.AddLabelTool(ID_Quit, "Quit", wx.ArtProvider_GetBitmap(wx.ART_QUIT)) + self.terraintoolbar.Realize() + + self.rordir = getSettingsManager().getSetting("RigsOfRods", "BasePath") + + + # add a bunch of panes + self.objectPreviewWindow = ObjectPreviewOgreWindow(self, wx.ID_ANY, rordir=self.rordir) + + self._mgr.AddPane(self.objectPreviewWindow, wx.aui.AuiPaneInfo(). + Name("object_preview"). + Caption("Object Preview"). + CenterPane(). + MinSize(wx.Size(200,200)). + CloseButton(True). + MaximizeButton(False)) - self._mgr.AddPane(HelpPanel(self, self), wx.aui.AuiPaneInfo(). - Name("help"). - Caption("Help"). - Dockable(False). - Float(). - Fixed(). - Hide(). - CloseButton(True). - MaximizeButton(True)) + self._mgr.AddPane(HelpPanel(self, self), wx.aui.AuiPaneInfo(). + Name("help"). + Caption("Help"). + Dockable(False). + Float(). + Fixed(). + Hide(). + CloseButton(True). + MaximizeButton(True)) - self._mgr.AddPane(SettingsPanel(self, self), wx.aui.AuiPaneInfo(). - Name("settings"). - Caption("Dock Manager Settings"). - Dockable(False). - Float(). - Fixed(). - Hide(). - CloseButton(True). - MaximizeButton(True)) + self._mgr.AddPane(SettingsPanel(self, self), wx.aui.AuiPaneInfo(). + Name("settings"). + Caption("Dock Manager Settings"). + Dockable(False). + Float(). + Fixed(). + Hide(). + CloseButton(True). + MaximizeButton(True)) - self._mgr.AddPane(RoRObjectTreeCtrl(self, self), wx.aui.AuiPaneInfo(). - Name("object_tree"). - Caption("Object Tree"). - MinSize(wx.Size(200,100)). - Left(). - CloseButton(True). - MaximizeButton(True)) - - - # odef editor panels - self.oddefEditorViewSettings = OdefViewPanel(self, self) - self._mgr.AddPane(self.oddefEditorViewSettings, wx.aui.AuiPaneInfo(). - Name("odef_editor_view_settings"). - Caption("ODef Editor View Settings"). - MinSize(wx.Size(200,100)). - Left(). - CloseButton(True). - MaximizeButton(False). - Hide()) - - - # create the center pane(s) - #Timer creation (for rendering) - self.ogreTimer = wx.Timer() - self.ogreTimer.SetOwner(self) - self.Bind(wx.EVT_TIMER, self.onUpdateRender, self.ogreTimer) - self.ogreTimer.Start(25) - - # create timer for gui update - self.guitimer = wx.Timer() - self.guitimer.SetOwner(self) #Sets the timer to notify self: binding the timer event is not enough - self.Bind(wx.EVT_TIMER, self.OnGUITimer, self.guitimer) - self.guitimer.Start(200) + self._mgr.AddPane(RoRObjectTreeCtrl(self, self), wx.aui.AuiPaneInfo(). + Name("object_tree"). + Caption("Object Tree"). + MinSize(wx.Size(200,100)). + Left(). + CloseButton(True). + MaximizeButton(True)) + + + # odef editor panels + self.oddefEditorViewSettings = OdefViewPanel(self, self) + self._mgr.AddPane(self.oddefEditorViewSettings, wx.aui.AuiPaneInfo(). + Name("odef_editor_view_settings"). + Caption("ODef Editor View Settings"). + MinSize(wx.Size(200,100)). + Left(). + CloseButton(True). + MaximizeButton(False). + Hide()) + + + # create the center pane(s) + #Timer creation (for rendering) + self.ogreTimer = wx.Timer() + self.ogreTimer.SetOwner(self) + self.Bind(wx.EVT_TIMER, self.onUpdateRender, self.ogreTimer) + self.ogreTimer.Start(25) + + # create timer for gui update + self.guitimer = wx.Timer() + self.guitimer.SetOwner(self) #Sets the timer to notify self: binding the timer event is not enough + self.Bind(wx.EVT_TIMER, self.OnGUITimer, self.guitimer) + self.guitimer.Start(200) - # the terrain editor ogre window - self.terrainOgreWin = RoRTerrainOgreWindow(self, wx.ID_ANY, rordir=self.rordir) - self._mgr.AddPane(self.terrainOgreWin, wx.aui.AuiPaneInfo().Name("ogre_terrain_content").CenterPane().Hide()) + # the terrain editor ogre window + self.terrainOgreWin = RoRTerrainOgreWindow(self, wx.ID_ANY, rordir=self.rordir) + self._mgr.AddPane(self.terrainOgreWin, wx.aui.AuiPaneInfo().Name("ogre_terrain_content").CenterPane().Hide()) - # the odef editor ogre window - self.odefEditorOgreWin = ODefEditorOgreWindow(self, wx.ID_ANY, rordir=self.rordir) - self._mgr.AddPane(self.odefEditorOgreWin, wx.aui.AuiPaneInfo().Name("ogre_odef_editor_content").CenterPane().Hide()) + # the odef editor ogre window + self.odefEditorOgreWin = ODefEditorOgreWindow(self, wx.ID_ANY, rordir=self.rordir) + self._mgr.AddPane(self.odefEditorOgreWin, wx.aui.AuiPaneInfo().Name("ogre_odef_editor_content").CenterPane().Hide()) - # the truck editor window - self.truckEditorOgreWin = RoRTruckOgreWindow(self, wx.ID_ANY) - self._mgr.AddPane(self.truckEditorOgreWin, wx.aui.AuiPaneInfo().Name("ogre_truck_editor_content").CenterPane().Hide()) + # the truck editor window + self.truckEditorOgreWin = RoRTruckOgreWindow(self, wx.ID_ANY) + self._mgr.AddPane(self.truckEditorOgreWin, wx.aui.AuiPaneInfo().Name("ogre_truck_editor_content").CenterPane().Hide()) - # the truck editor UV window - self.truckEditorUVOgreWin = RoRTruckUVOgreWindow(self, wx.ID_ANY) - self._mgr.AddPane(self.truckEditorUVOgreWin, wx.aui.AuiPaneInfo().Name("ogre_truck_editor_uv_content").Float().Hide()) - - - # add the toolbars to the manager - self._mgr.AddPane(self.terraintoolbar, wx.aui.AuiPaneInfo(). - Name("terrain_toolbar"). - Caption("General Toolbar"). - ToolbarPane().Top(). - LeftDockable(False). - RightDockable(False). - Hide() - ) + # the truck editor UV window + self.truckEditorUVOgreWin = RoRTruckUVOgreWindow(self, wx.ID_ANY) + self._mgr.AddPane(self.truckEditorUVOgreWin, wx.aui.AuiPaneInfo().Name("ogre_truck_editor_uv_content").Float().Hide()) + + + # add the toolbars to the manager + self._mgr.AddPane(self.terraintoolbar, wx.aui.AuiPaneInfo(). + Name("terrain_toolbar"). + Caption("General Toolbar"). + ToolbarPane().Top(). + LeftDockable(False). + RightDockable(False). + Hide() + ) - # make some default perspectives - self._perspectives.append(self._mgr.SavePerspective()) + # make some default perspectives + self._perspectives.append(self._mgr.SavePerspective()) - # hide all first - self.terraintoolbar.Hide() - all_panes = self._mgr.GetAllPanes() - for ii in xrange(len(all_panes)): - if not all_panes[ii].IsToolbar(): - all_panes[ii].Hide() + # hide all first + self.terraintoolbar.Hide() + all_panes = self._mgr.GetAllPanes() + for ii in xrange(len(all_panes)): + if not all_panes[ii].IsToolbar(): + all_panes[ii].Hide() - # terrain perspective - self._mgr.GetPane("ogre_truck_editor_uv_content").Show(False) - self._mgr.GetPane("terrain_toolbar").Show(True) - self._mgr.GetPane("ogre_truck_editor_content").Show(False) - self._mgr.GetPane("ogre_odef_editor_content").Show(False) - self._mgr.GetPane("odef_editor_view_settings").Show(False) - self._mgr.GetPane("ogre_terrain_content").Show(True) - self._mgr.GetPane("object_preview").Show(True).Left() - self._mgr.GetPane("object_tree").Show(True) - self.objectPreviewWindow - self._perspectives.append(self._mgr.SavePerspective()) + # terrain perspective + self._mgr.GetPane("ogre_truck_editor_uv_content").Show(False) + self._mgr.GetPane("terrain_toolbar").Show(True) + self._mgr.GetPane("ogre_truck_editor_content").Show(False) + self._mgr.GetPane("ogre_odef_editor_content").Show(False) + self._mgr.GetPane("odef_editor_view_settings").Show(False) + self._mgr.GetPane("ogre_terrain_content").Show(True) + self._mgr.GetPane("object_preview").Show(True).Left() + self._mgr.GetPane("object_tree").Show(True) + self.objectPreviewWindow + self._perspectives.append(self._mgr.SavePerspective()) - # odef editor perspective - self._mgr.GetPane("ogre_truck_editor_uv_content").Show(False) - self._mgr.GetPane("terrain_toolbar").Show(False) - self._mgr.GetPane("ogre_truck_editor_content").Show(False) - self._mgr.GetPane("object_preview").Show(False) - self._mgr.GetPane("ogre_terrain_content").Show(False) - self._mgr.GetPane("ogre_odef_editor_content").Show(True) - self._mgr.GetPane("odef_editor_view_settings").Show(True) - self._mgr.GetPane("object_tree").Show(True) - self._perspectives.append(self._mgr.SavePerspective()) + # odef editor perspective + self._mgr.GetPane("ogre_truck_editor_uv_content").Show(False) + self._mgr.GetPane("terrain_toolbar").Show(False) + self._mgr.GetPane("ogre_truck_editor_content").Show(False) + self._mgr.GetPane("object_preview").Show(False) + self._mgr.GetPane("ogre_terrain_content").Show(False) + self._mgr.GetPane("ogre_odef_editor_content").Show(True) + self._mgr.GetPane("odef_editor_view_settings").Show(True) + self._mgr.GetPane("object_tree").Show(True) + self._perspectives.append(self._mgr.SavePerspective()) - # truck editor perspective - self._mgr.GetPane("ogre_truck_editor_uv_content").Show(True) - self._mgr.GetPane("terrain_toolbar").Show(False) - self._mgr.GetPane("ogre_truck_editor_content").Show(True) - self._mgr.GetPane("object_preview").Show(False) - self._mgr.GetPane("ogre_terrain_content").Show(False) - self._mgr.GetPane("ogre_odef_editor_content").Show(False) - self._mgr.GetPane("odef_editor_view_settings").Show(False) - self._mgr.GetPane("object_tree").Show(False) - self._perspectives.append(self._mgr.SavePerspective()) - - # load startup perspective - self._mgr.LoadPerspective(self._perspectives[0]) - - # "commit" all changes made to FrameManager - self._mgr.Update() + # truck editor perspective + self._mgr.GetPane("ogre_truck_editor_uv_content").Show(True) + self._mgr.GetPane("terrain_toolbar").Show(False) + self._mgr.GetPane("ogre_truck_editor_content").Show(True) + self._mgr.GetPane("object_preview").Show(False) + self._mgr.GetPane("ogre_terrain_content").Show(False) + self._mgr.GetPane("ogre_odef_editor_content").Show(False) + self._mgr.GetPane("odef_editor_view_settings").Show(False) + self._mgr.GetPane("object_tree").Show(False) + self._perspectives.append(self._mgr.SavePerspective()) + + # load startup perspective + self._mgr.LoadPerspective(self._perspectives[0]) + + # "commit" all changes made to FrameManager + self._mgr.Update() - self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnEraseBackground) - self.Bind(wx.EVT_SIZE, self.OnSize) - self.Bind(wx.EVT_CLOSE, self.OnClose) + self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnEraseBackground) + self.Bind(wx.EVT_SIZE, self.OnSize) + self.Bind(wx.EVT_CLOSE, self.OnClose) - self.Bind(wx.EVT_MENU, self.OnOpenTerrain, id=ID_OpenTerrain) - self.Bind(wx.EVT_MENU, self.OnSaveTerrain, id=ID_SaveTerrain) - self.Bind(wx.EVT_MENU, self.OnSaveTerrainAs, id=ID_SaveTerrainAs) - self.Bind(wx.EVT_MENU, self.OnViewHelp, id=ID_ViewHelp) - - self.Bind(wx.EVT_MENU, self.OnCreateOgre, id=ID_CreateOgre) - - self.Bind(wx.EVT_MENU, self.OnCreatePerspective, id=ID_CreatePerspective) - self.Bind(wx.EVT_MENU, self.OnCopyPerspective, id=ID_CopyPerspective) + self.Bind(wx.EVT_MENU, self.OnOpenTerrain, id=ID_OpenTerrain) + self.Bind(wx.EVT_MENU, self.OnSaveTerrain, id=ID_SaveTerrain) + self.Bind(wx.EVT_MENU, self.OnSaveTerrainAs, id=ID_SaveTerrainAs) + self.Bind(wx.EVT_MENU, self.OnViewHelp, id=ID_ViewHelp) + + self.Bind(wx.EVT_MENU, self.OnCreateOgre, id=ID_CreateOgre) + + self.Bind(wx.EVT_MENU, self.OnCreatePerspective, id=ID_CreatePerspective) + self.Bind(wx.EVT_MENU, self.OnCopyPerspective, id=ID_CopyPerspective) - self.Bind(wx.EVT_MENU, self.OnSettings, id=ID_Settings) - - self.Bind(wx.EVT_MENU, self.OnExit, id=ID_Quit) - self.Bind(wx.EVT_MENU, self.OnExit, id=wx.ID_EXIT) - self.Bind(wx.EVT_MENU, self.OnAbout, id=ID_About) - - self.Bind(wx.EVT_MENU_RANGE, self.OnRestorePerspective, id=ID_FirstPerspective, - id2=ID_FirstPerspective+1000) - - def changeEditorMode(self, id): - self._mgr.LoadPerspective(self._perspectives[id]) - self._mgr.Update() - - def OnViewHelp(self, event=None): - # show the settings pane, and float it - floating_pane = self._mgr.GetPane("help").Float().Show() + self.Bind(wx.EVT_MENU, self.OnSettings, id=ID_Settings) + + self.Bind(wx.EVT_MENU, self.OnExit, id=ID_Quit) + self.Bind(wx.EVT_MENU, self.OnExit, id=wx.ID_EXIT) + self.Bind(wx.EVT_MENU, self.OnAbout, id=ID_About) + + self.Bind(wx.EVT_MENU_RANGE, self.OnRestorePerspective, id=ID_FirstPerspective, + id2=ID_FirstPerspective+1000) + + def changeEditorMode(self, id): + self._mgr.LoadPerspective(self._perspectives[id]) + self._mgr.Update() + + def OnViewHelp(self, event=None): + # show the settings pane, and float it + floating_pane = self._mgr.GetPane("help").Float().Show() - if floating_pane.floating_pos == wx.DefaultPosition: - floating_pane.FloatingPosition(self.GetStartPosition()) + if floating_pane.floating_pos == wx.DefaultPosition: + floating_pane.FloatingPosition(self.GetStartPosition()) - self._mgr.Update() + self._mgr.Update() - - def addObjectToTerrain(self, filename): - try: - self.changeEditorMode(1) - onlyfilename, extension = os.path.splitext(os.path.basename(filename)) - if extension.lower() in ['.truck', '.load']: - if not self.terrainOgreWin.addTruckToTerrain(truckFilename=filename): - dlg = wx.MessageDialog(self, "You must select a position on the ground first!", "error", wx.OK | wx.ICON_INFORMATION) - dlg.ShowModal() - dlg.Destroy() - elif extension.lower() in ['.odef']: - if not self.terrainOgreWin.addObjectToTerrain(odefFilename=filename): - dlg = wx.MessageDialog(self, "You must select a position on the ground first!", "error", wx.OK | wx.ICON_INFORMATION) - dlg.ShowModal() - dlg.Destroy() - except: - pass - - def previewObject(self, filename): - #try: - self.objectPreviewWindow.loadFile(filename) - #except: - # pass + + def addObjectToTerrain(self, filename): + try: + self.changeEditorMode(1) + onlyfilename, extension = os.path.splitext(os.path.basename(filename)) + if extension.lower() in ['.truck', '.load']: + if not self.terrainOgreWin.addTruckToTerrain(truckFilename=filename): + dlg = wx.MessageDialog(self, "You must select a position on the ground first!", "error", wx.OK | wx.ICON_INFORMATION) + dlg.ShowModal() + dlg.Destroy() + elif extension.lower() in ['.odef']: + if not self.terrainOgreWin.addObjectToTerrain(odefFilename=filename): + dlg = wx.MessageDialog(self, "You must select a position on the ground first!", "error", wx.OK | wx.ICON_INFORMATION) + dlg.ShowModal() + dlg.Destroy() + except: + pass + + def previewObject(self, filename): + #try: + self.objectPreviewWindow.loadFile(filename) + #except: + # pass - def editODefFile(self, filename): - #try: - self.odefEditorOgreWin.loadFile(filename) - self.changeEditorMode(2) - self.oddefEditorViewSettings.resetControls() - #except Exception, err: - # print err - # pass + def editODefFile(self, filename): + #try: + self.odefEditorOgreWin.loadFile(filename) + self.changeEditorMode(2) + self.oddefEditorViewSettings.resetControls() + #except Exception, err: + # print err + # pass - def editTruck(self, filename): - #try: - tree = self.truckEditorOgreWin.LoadTruck(filename) - self.changeEditorMode(3) - self.truckEditorUVOgreWin.setTree(tree) - #except Exception, err: - # print err - # pass + def editTruck(self, filename): + #try: + tree = self.truckEditorOgreWin.LoadTruck(filename) + self.changeEditorMode(3) + self.truckEditorUVOgreWin.setTree(tree) + #except Exception, err: + # print err + # pass - def updateObjPosRot(self, event=None): - self.statusbar.SetStatusText(self.terrainOgreWin.currentStatusMsg, 1) - if self.terrainOgreWin.terrain is None: - return - if self.terrainOgreWin.selectedEntry is None: - self.statusbar.SetStatusText("Nothing selected", 2) - return - entry = self.terrainOgreWin.selectedEntry - #comment = self.terrainOgreWin.getCommentsForObject(n.getName()).lstrip('/') - #if comment.strip() != "": - # txt = "%s / %s" % (n.getName(), comment) - #else: - try: - txt = "%s %s" % (entry.data.name, " ".join(entry.data.additionaloptions)) - self.statusbar.SetStatusText(txt, 2) - - posx, posy, posz, rotx, roty, rotz = self.terrainOgreWin.getSelectionPositionRotation() - txt = "%d, %0.2f, %0.2f, %0.2f / %0.2f, %0.2f, %0.2f" % (entry.data.line, posx, posy, posz, rotx, roty, rotz) - except: - txt = "" - self.statusbar.SetStatusText(txt, 3) + def updateObjPosRot(self, event=None): + self.statusbar.SetStatusText(self.terrainOgreWin.currentStatusMsg, 1) + if self.terrainOgreWin.terrain is None: + return + if self.terrainOgreWin.selectedEntry is None: + self.statusbar.SetStatusText("Nothing selected", 2) + return + entry = self.terrainOgreWin.selectedEntry + #comment = self.terrainOgreWin.getCommentsForObject(n.getName()).lstrip('/') + #if comment.strip() != "": + # txt = "%s / %s" % (n.getName(), comment) + #else: + try: + txt = "%s %s" % (entry.data.name, " ".join(entry.data.additionaloptions)) + self.statusbar.SetStatusText(txt, 2) + + posx, posy, posz, rotx, roty, rotz = self.terrainOgreWin.getSelectionPositionRotation() + txt = "%d, %0.2f, %0.2f, %0.2f / %0.2f, %0.2f, %0.2f" % (entry.data.line, posx, posy, posz, rotx, roty, rotz) + except: + txt = "" + self.statusbar.SetStatusText(txt, 3) - def OnGUITimer(self, event): - #fill labels with some information, all windows have the same FPS! - txt='' - try: - txt = "%0.2f FPS" % (self.terrainOgreWin.renderWindow.getStatistics().lastFPS) - except: - pass - self.statusbar.SetStatusText(txt, 4) - self.updateObjPosRot() - - def onUpdateRender(self, event=None): - getOgreManager().RenderAll() - pass + def OnGUITimer(self, event): + #fill labels with some information, all windows have the same FPS! + txt='' + try: + txt = "%0.2f FPS" % (self.terrainOgreWin.renderWindow.getStatistics().lastFPS) + except: + pass + self.statusbar.SetStatusText(txt, 4) + self.updateObjPosRot() + + def onUpdateRender(self, event=None): + getOgreManager().RenderAll() + pass - def openTerrain(self, filename): - self.changeEditorMode(1) - self.terrainOgreWin.LoadTerrain(filename) - #self.terraintoolbar.EnableTool(ID_AddObject, True) - #self.terraintoolbar.EnableTool(ID_DeleteSelection, True) - #self.terraintoolbar.EnableTool(ID_CopySelection, True) - #self.terraintoolbar.EnableTool(ID_PasteSelection, True) - #self.terraintoolbar.EnableTool(ID_UndoAction, True) - #self.terraintoolbar.EnableTool(ID_RedoAction, True) - #self.terraintoolbar.EnableTool(ID_FindObject, True) - self.terraintoolbar.EnableTool(ID_SaveTerrain, True) - self.terraintoolbar.EnableTool(ID_SaveTerrainAs, True) + def openTerrain(self, filename): + self.changeEditorMode(1) + self.terrainOgreWin.LoadTerrain(filename) + #self.terraintoolbar.EnableTool(ID_AddObject, True) + #self.terraintoolbar.EnableTool(ID_DeleteSelection, True) + #self.terraintoolbar.EnableTool(ID_CopySelection, True) + #self.terraintoolbar.EnableTool(ID_PasteSelection, True) + #self.terraintoolbar.EnableTool(ID_UndoAction, True) + #self.terraintoolbar.EnableTool(ID_RedoAction, True) + #self.terraintoolbar.EnableTool(ID_FindObject, True) + self.terraintoolbar.EnableTool(ID_SaveTerrain, True) + self.terraintoolbar.EnableTool(ID_SaveTerrainAs, True) - def OnOpenTerrain(self, event=None): - default = "" - if self.rordir: - default = os.path.join(self.rordir, TERRAINDIR) - dialog = wx.FileDialog(self, "Open Terrain", default, "", "Terrain Files (*.terrn)|*.terrn", wx.FD_OPEN | wx.FD_FILE_MUST_EXIST) - res = dialog.ShowModal() - if res == wx.ID_OK: - self.openTerrain(dialog.GetPath()) + def OnOpenTerrain(self, event=None): + default = "" + if self.rordir: + default = os.path.join(self.rordir, TERRAINDIR) + dialog = wx.FileDialog(self, "Open Terrain", default, "", "Terrain Files (*.terrn)|*.terrn", wx.FD_OPEN | wx.FD_FILE_MUST_EXIST) + res = dialog.ShowModal() + if res == wx.ID_OK: + self.openTerrain(dialog.GetPath()) - def OnSaveTerrain(self, event=None): - if not self.terrainOgreWin.SaveTerrain(): - dlg = wx.MessageDialog(self, "error while saving, see console!\n","error", wx.OK | wx.ICON_INFORMATION) - dlg.ShowModal() - dlg.Destroy() + def OnSaveTerrain(self, event=None): + if not self.terrainOgreWin.SaveTerrain(): + dlg = wx.MessageDialog(self, "error while saving, see console!\n","error", wx.OK | wx.ICON_INFORMATION) + dlg.ShowModal() + dlg.Destroy() - def OnSaveTerrainAs(self, event=None): - default = "" - if self.rordir: - default = os.path.join(self.rordir, TERRAINDIR) - dialog = wx.FileDialog(self, "Save Terrain as", default, "", "Terrain Files (*.terrn)|*.terrn", wx.FD_SAVE | wx.FD_OVERWRITE_PROMPT) - res = dialog.ShowModal() - if res == wx.ID_OK: - if not self.terrainOgreWin.SaveTerrain(dialog.GetPath()): - dlg = wx.MessageDialog(self, "error while saving as another file, see console!\n","error", wx.OK | wx.ICON_INFORMATION) - dlg.ShowModal() - dlg.Destroy() + def OnSaveTerrainAs(self, event=None): + default = "" + if self.rordir: + default = os.path.join(self.rordir, TERRAINDIR) + dialog = wx.FileDialog(self, "Save Terrain as", default, "", "Terrain Files (*.terrn)|*.terrn", wx.FD_SAVE | wx.FD_OVERWRITE_PROMPT) + res = dialog.ShowModal() + if res == wx.ID_OK: + if not self.terrainOgreWin.SaveTerrain(dialog.GetPath()): + dlg = wx.MessageDialog(self, "error while saving as another file, see console!\n","error", wx.OK | wx.ICON_INFORMATION) + dlg.ShowModal() + dlg.Destroy() - def OnClose(self, event): - self.OnExit(event) - - def OnExit(self, event): - try: - all_panes = self._mgr.GetAllPanes() - for ii in xrange(len(all_panes)): - if not all_panes[ii].IsToolbar(): - all_panes[ii].Hide() - self._mgr.UnInit() - del self._mgr - self.Destroy() - self.Close() - except: - pass + def OnClose(self, event): + self.OnExit(event) + + def OnExit(self, event): + try: + all_panes = self._mgr.GetAllPanes() + for ii in xrange(len(all_panes)): + if not all_panes[ii].IsToolbar(): + all_panes[ii].Hide() + self._mgr.UnInit() + del self._mgr + self.Destroy() + self.Close() + except: + pass - def OnAbout(self, event): - ShowOnAbout() + def OnAbout(self, event): + ShowOnAbout() - def GetDockArt(self): - return self._mgr.GetArtProvider() + def GetDockArt(self): + return self._mgr.GetArtProvider() - def DoUpdate(self): - self._mgr.Update() + def DoUpdate(self): + self._mgr.Update() - def OnEraseBackground(self, event): - event.Skip() + def OnEraseBackground(self, event): + event.Skip() - def OnSize(self, event): - event.Skip() + def OnSize(self, event): + event.Skip() - def OnSettings(self, event): - # show the settings pane, and float it - floating_pane = self._mgr.GetPane("settings").Float().Show() + def OnSettings(self, event): + # show the settings pane, and float it + floating_pane = self._mgr.GetPane("settings").Float().Show() - if floating_pane.floating_pos == wx.DefaultPosition: - floating_pane.FloatingPosition(self.GetStartPosition()) + if floating_pane.floating_pos == wx.DefaultPosition: + floating_pane.FloatingPosition(self.GetStartPosition()) - self._mgr.Update() + self._mgr.Update() - def managerInit(self): - flags = self._mgr.GetFlags() - # based on default settings! - flags |= wx.aui.AUI_MGR_ALLOW_ACTIVE_PANE - flags &= ~wx.aui.AUI_MGR_TRANSPARENT_DRAG - self._mgr.SetFlags(flags) + def managerInit(self): + flags = self._mgr.GetFlags() + # based on default settings! + flags |= wx.aui.AUI_MGR_ALLOW_ACTIVE_PANE + flags &= ~wx.aui.AUI_MGR_TRANSPARENT_DRAG + self._mgr.SetFlags(flags) - def OnCreatePerspective(self, event): - dlg = wx.TextEntryDialog(self, "Enter a name for the new perspective:", "AUI Test") - - dlg.SetValue(("Perspective %d")%(len(self._perspectives)+1)) - if dlg.ShowModal() != wx.ID_OK: - return - - if len(self._perspectives) == 0: - self._perspectives_menu.AppendSeparator() - - self._perspectives_menu.Append(ID_FirstPerspective + len(self._perspectives), dlg.GetValue()) - self._perspectives.append(self._mgr.SavePerspective()) + def OnCreatePerspective(self, event): + dlg = wx.TextEntryDialog(self, "Enter a name for the new perspective:", "AUI Test") + + dlg.SetValue(("Perspective %d")%(len(self._perspectives)+1)) + if dlg.ShowModal() != wx.ID_OK: + return + + if len(self._perspectives) == 0: + self._perspectives_menu.AppendSeparator() + + self._perspectives_menu.Append(ID_FirstPerspective + len(self._perspectives), dlg.GetValue()) + self._perspectives.append(self._mgr.SavePerspective()) - def OnCopyPerspective(self, event): - s = self._mgr.SavePerspective() - - if wx.TheClipboard.Open(): - - wx.TheClipboard.SetData(wx.TextDataObject(s)) - wx.TheClipboard.Close() - - def OnRestorePerspective(self, event): - self._mgr.LoadPerspective(self._perspectives[event.GetId() - ID_FirstPerspective]) + def OnCopyPerspective(self, event): + s = self._mgr.SavePerspective() + + if wx.TheClipboard.Open(): + + wx.TheClipboard.SetData(wx.TextDataObject(s)) + wx.TheClipboard.Close() + + def OnRestorePerspective(self, event): + self._mgr.LoadPerspective(self._perspectives[event.GetId() - ID_FirstPerspective]) - def GetStartPosition(self): - self.x = self.x + 20 - x = self.x - pt = self.ClientToScreen(wx.Point(0, 0)) - - return wx.Point(pt.x + x, pt.y + x) + def GetStartPosition(self): + self.x = self.x + 20 + x = self.x + pt = self.ClientToScreen(wx.Point(0, 0)) + + return wx.Point(pt.x + x, pt.y + x) - def OnCreateOgre(self, event): - self._mgr.AddPane(self.CreateOgreCtrl(), wx.aui.AuiPaneInfo(). - Caption("Ogre Window"). - Float().FloatingPosition(self.GetStartPosition()). - CloseButton(True).MaximizeButton(False)) - self._mgr.Update() - - def CreateOgreCtrl(self): - return RoRTerrainOgreWindow(self, wx.ID_ANY, maininstance=self.terrainOgreWin) + def OnCreateOgre(self, event): + self._mgr.AddPane(self.CreateOgreCtrl(), wx.aui.AuiPaneInfo(). + Caption("Ogre Window"). + Float().FloatingPosition(self.GetStartPosition()). + CloseButton(True).MaximizeButton(False)) + self._mgr.Update() + + def CreateOgreCtrl(self): + return RoRTerrainOgreWindow(self, wx.ID_ANY, maininstance=self.terrainOgreWin) def startApp(): - MainApp = wx.PySimpleApp(0) - wx.InitAllImageHandlers() #you may or may not need this - myFrame = MainFrame(None, -1, "") + MainApp = wx.PySimpleApp(0) + wx.InitAllImageHandlers() #you may or may not need this + myFrame = MainFrame(None, -1, "") - MainApp.SetTopWindow(myFrame) - - myFrame.SetSize((800, 600)) - myFrame.SetFocus() - myFrame.Show() + MainApp.SetTopWindow(myFrame) + + myFrame.SetSize((800, 600)) + myFrame.SetFocus() + myFrame.Show() - MainApp.MainLoop() \ No newline at end of file + MainApp.MainLoop() \ No newline at end of file Modified: trunk/lib_common/wxogre/OgreManager.py =================================================================== --- trunk/lib_common/wxogre/OgreManager.py 2008-03-22 20:42:36 UTC (rev 203) +++ trunk/lib_common/wxogre/OgreManager.py 2008-10-18 19:29:25 UTC (rev 204) @@ -11,127 +11,128 @@ # singleton implementation of OgreManager _ogremanager = None def getOgreManager(): - global _ogremanager - if _ogremanager is None: - _ogremanager = OgreManager() - return _ogremanager + global _ogremanager + if _ogremanager is None: + _ogremanager = OgreManager() + return _ogremanager class MyLog(ogre.LogListener): - def __init__(self): - # Creates a C++ log that will try and write to console and file - ogre.LogListener.__init__(self) + def __init__(self): + # Creates a C++ log that will try and write to console and file + ogre.LogListener.__init__(self) - def messageLogged(self, message, level, debug, logName): - print ">>>", message - return True + def messageLogged(self, message, level, debug, logName): + print ">>>", message + return True class OgreManager: - renderWindows = {} + renderWindows = {} - def restart(self): - self.ogreRoot.shutdown() - self.init() + def restart(self): + self.ogreRoot.shutdown() + self.init() - def __init__(self): - self.init() + def __init__(self): + self.init() - def init(self): - #Root creation - pluginsfile = 'plugins.cfg' - if sys.platform in ['linux', 'linux2']: - pluginsfile = 'plugins_linux.cfg' - elif sys.platform in ['win32']: - pluginsfile = 'plugins_windows.cfg' - - self.ogreRoot = ogre.Root(self.getConfigPath(pluginsfile), self.getConfigPath('ogre.cfg'), "Ogre.log") - #logMgr = ogre.LogManager() - #currentLog = ogre.LogManager.getSingletonPtr().createLog("ogre.log" ,True, False, False) - #myLog = MyLog() - #currentLog.addListener ( myLog ) - #ogre.LogManager.getSingletonPtr().setDefaultLog(currentLog) + def init(self): + #Root creation + pluginsfile = 'plugins.cfg' + if sys.platform in ['linux', 'linux2']: + pluginsfile = 'plugins_linux.cfg' + elif sys.platform in ['win32']: + pluginsfile = 'plugins_windows.cfg' + + self.ogreRoot = ogre.Root(self.getConfigPath(pluginsfile), self.getConfigPath('ogre.cfg'), "Ogre.log") + #logMgr = ogre.LogManager() + #currentLog = ogre.LogManager.getSingletonPtr().createLog("ogre.log" ,True, False, False) + #myLog = MyLog() + #currentLog.addListener ( myLog ) + #ogre.LogManager.getSingletonPtr().setDefaultLog(currentLog) - if not self.tryDetectRenderer(): - self.ogreRoot.showConfigDialog() - self.ogreRoot.initialise(False) + if not self.tryDetectRenderer(): + self.ogreRoot.showConfigDialog() + self.ogreRoot.initialise(False) - def tryDetectRenderer(self): - for rs in self.ogreRoot.getAvailableRenderers(): - try : - rs.setConfigOption("Full Screen","No") - rs.setConfigOption("Video Mode","800 x 600 @ 32-bit colour") - self.ogreRoot.setRenderSystem(rs) - log().info("successfully autodeteced renderer : %s" % rs.getName()) - return True - except: - log().info("not able to auto-detect renderer! showing ogre config dialog instead") - return False + def tryDetectRenderer(self): + for rs in self.ogreRoot.getAvailableRenderers(): + try : + rs.setConfigOption("Full Screen","No") + rs.setConfigOption("Video Mode","800 x 600 @ 32-bit colour") + self.ogreRoot.setRenderSystem(rs) + log().info("successfully autodeteced renderer : %s" % rs.getName()) + return True + except: + log().info("not able to auto-detect renderer! showing ogre config dialog instead") + return False - def getRoot(self): - return self.ogreRoot + def getRoot(self): + return self.ogreRoot - def getConfigPath(self, filename): - """Return the absolute path to a valid config file.""" - import sys - import os - import os.path + def getConfigPath(self, filename): + """Return the absolute path to a valid config file.""" + import sys + import os + import os.path - paths = [os.path.join(os.getcwd(), filename), - os.path.join(os.path.dirname(os.path.abspath(__file__)), filename)] + paths = [os.path.join(os.getcwd(), filename), + os.path.join(os.path.dirname(os.path.abspath(__file__)), filename)] - for path in paths: - if os.path.exists(path): - print path - return path + for path in paths: + if os.path.exists(path): + print path + return path - sys.stderr.write("\n" - "** Warning: Unable to locate a suitable " + filename + " file.\n" - "** Warning: Please check your ogre installation and copy a\n" - "** Warning: working plugins.cfg file to the current directory.\n\n") - #raise ogre.Exception(0, "can't locate the '%s' file" % filename, "") + sys.stderr.write("\n" + "** Warning: Unable to locate a suitable " + filename + " file.\n" + "** Warning: Please check your ogre installation and copy a\n" + "** Warning: working plugins.cfg file to the current directory.\n\n") + #raise ogre.Exception(0, "can't locate the '%s' file" % filename, "") - def createRenderWindow(self, wxOgrewin, name, width, height, fullscreen, handle): - renderParameters = ogre.NameValuePairList() - #TODO: For some reason passing renderParameters causes the renderer not to start, passing Null is a work around - - # use len to make the names unique! - if getPlatform() == 'windows': - renderParameters['externalWindowHandle'] = str(handle) - elif getPlatform() == 'linux': - renderParameters['externalWindowHandle'] = 0 - renderWindow = self.ogreRoot.createRenderWindow(name + str(len(self.renderWindows)), width, height, fullscreen, renderParameters) - #renderWindow.active = True - self.renderWindows[wxOgrewin] = renderWindow - return renderWindow + def createRenderWindow(self, wxOgrewin, name, width, height, fullscreen, handle): + renderParameters = ogre.NameValuePairList() + #TODO: For some reason passing renderParameters causes the renderer not to start, passing Null is a work around + + # use len to make the names unique! + #if getPlatform() == 'windows': + renderParameters['externalWindowHandle'] = str(handle) + #elif getPlatform() == 'linux': + # renderParameters['externalWindowHandle'] = str(handle) + # #renderParameters['externalWindowHandle'] = 0 + renderWindow = self.ogreRoot.createRenderWindow(name + str(len(self.renderWindows)), width, height, fullscreen, renderParameters) + #renderWindow.active = True + self.renderWindows[wxOgrewin] = renderWindow + return renderWindow - def removeRenderWindow(self, wxOgrewin): - print "removing render target" - self.ogreRoot.detachRenderTarget(self.renderWindows[wxOgrewin]) - del self.renderWindows[wxOgrewin] + def removeRenderWindow(self, wxOgrewin): + print "removing render target" + self.ogreRoot.detachRenderTarget(self.renderWindows[wxOgrewin]) + del self.renderWindows[wxOgrewin] - def RenderAll(self): - for ogrewin in self.renderWindows.keys(): - try: - ogrewin.OnFrameStarted() - except: - continue + def RenderAll(self): + for ogrewin in self.renderWindows.keys(): + try: + ogrewin.OnFrameStarted() + except: + continue - try: - self.ogreRoot.renderOneFrame() - except ogre.OgreException, e: - print '## EXCEPTION ##' - print str(e) - pass + try: + self.ogreRoot.renderOneFrame() + except ogre.OgreException, e: + print '## EXCEPTION ##' + print str(e) + pass - for ogrewin in self.renderWindows.keys(): - try: - ogrewin.OnFrameEnded() - except: - continue + for ogrewin in self.renderWindows.keys(): + try: + ogrewin.OnFrameEnded() + except: + continue - def createSceneManager(self, type): - return self.ogreRoot.createSceneManager(type, "SceneManager" + str(randomID())) + def createSceneManager(self, type): + return self.ogreRoot.createSceneManager(type, "SceneManager" + str(randomID())) - def destroySceneManager(self, sm): - return self.ogreRoot.destroySceneManager(sm) - \ No newline at end of file + def destroySceneManager(self, sm): + return self.ogreRoot.destroySceneManager(sm) + \ No newline at end of file Modified: trunk/lib_common/wxogre/wxOgreWindow.py =================================================================== --- trunk/lib_common/wxogre/wxOgreWindow.py 2008-03-22 20:42:36 UTC (rev 203) +++ trunk/lib_common/wxogre/wxOgreWindow.py 2008-10-18 19:29:25 UTC (rev 204) @@ -3,6 +3,17 @@ import ogre.renderer.OGRE as ogre from wxogre.OgreManager import * +# Standard python imports +import ctypes as __ctypes +import os.path as __path + +# Library Imports +import wx as __wx + +if getPlatform() == 'linux': + # import gethandle workaround: + from wxogre_util import get_window_handle_str + class wxOgreWindow(wx.PyWindow): def __init__(self, parent, ID, size = wx.Size(200,200), **kwargs): """ @@ -14,7 +25,7 @@ wx.PyWindow.__init__(self, parent, ID, size = size, **kwargs) self.parent = parent - + #Event bindings self.Bind(wx.EVT_CLOSE, self._OnCloseWindow) self.Bind(wx.EVT_ERASE_BACKGROUND, self._OnEraseBackground) @@ -24,7 +35,14 @@ self.ogreRoot = getOgreManager().getRoot() # create a new RenderWindow - self.renderWindow = getOgreManager().createRenderWindow(self, "wxPythonWxOgreRenderWindow", size[0], size[1], False, self.GetHandle()) + handle = "" + if getPlatform() == 'linux': + handle = get_window_handle_str(self) + else: + handle = str(self.GetHandle()) + #print "> window handle: " + handle + + self.renderWindow = getOgreManager().createRenderWindow(self, "wxPythonWxOgreRenderWindow", size[0], size[1], False, handle) self.renderWindow.active = True try: Added: trunk/linux/libwxogre_util.so =================================================================== (Binary files differ) Property changes on: trunk/linux/libwxogre_util.so ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Added: trunk/tools/linux_workarounds/gethandle/build.sh =================================================================== --- trunk/tools/linux_workarounds/gethandle/build.sh (rev 0) +++ trunk/tools/linux_workarounds/gethandle/build.sh 2008-10-18 19:29:25 UTC (rev 204) @@ -0,0 +1,2 @@ +#!/bin/sh +g++ -shared `/usr/lib/wx/config/gtk2-unicode-release-2.8 --cflags` `pkg-config gtk+-2.0 --cflags` `/usr/lib/wx/config/gtk2-unicode-release-2.8 --libs` `pkg-config gtk+-2.0 --libs` -lGL wxogre_util.cpp -o libwxogre_util.so Property changes on: trunk/tools/linux_workarounds/gethandle/build.sh ___________________________________________________________________ Added: svn:executable + * Added: trunk/tools/linux_workarounds/gethandle/libwxogre_util.so =================================================================== (Binary files differ) Property changes on: trunk/tools/linux_workarounds/gethandle/libwxogre_util.so ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Added: trunk/tools/linux_workarounds/gethandle/wxogre_util.cpp =================================================================== --- trunk/tools/linux_workarounds/gethandle/wxogre_util.cpp (rev 0) +++ trunk/tools/linux_workarounds/gethandle/wxogre_util.cpp 2008-10-18 19:29:25 UTC (rev 204) @@ -0,0 +1,99 @@ +// Copyright (C) 2007 Maryland Robotics Club +// Copyright (C) 2007 Joseph Lisee <jl...@um...> +// All rights reserved. +// +// Author: Joseph Lisee <jl...@um...> +// File: utility/wxogre_util/src/wxogre_util.h + +// std includes +#include <sstream> +#include <string> +#include <cstring> +#include <iostream> +using namespace std; + +// wxWidgets includes +#include <wx/window.h> + +// Platform specific includes +#ifdef __WXGTK__ +// Needed for random GTK/GDK macros and functions +#include <gdk/gdkx.h> +#include <gtk/gtk.h> + +// Needed for crazy GTK_PIZZA stuff +#include <wx/gtk/win_gtk.h> +#include <GL/glx.h> +#endif + + +extern "C" +{ + /** Returns a window handle string from a wxWindow in Ogre form + @param window + Must be a pointer to a wxWindow or its subclass. + @return + The window handle in its display:xid form. + */ + extern char* get_window_handle_str(void* window); +} + +char* get_window_handle_str(void* _window) +{ + // Assume its a wxObject (can be dangerous) + wxObject* window_obj = (wxObject*)_window; + + // Preform a dynamic cast to a wxWindow + wxWindow* window = wxDynamicCast(window_obj, wxWindow); + + if (window) + { + std::string handle; +#ifdef __WXGTK__ + // Should help reduce flickering + //SetBackgroundStyle(wxBG_STYLE_CUSTOM); + std::stringstream handleStream; + + // wxWidgets uses serverl internal GtkWidgets, the GetHandle method returns + // a different one then this, but wxWidgets GLCanvas uses this one to + // interact with GLX with, so we will do the same. + GtkWidget* private_handle = window->m_wxwindow; + + // Prevents flicker + gtk_widget_set_double_buffered( private_handle, FALSE ); + + // Grabs the window for use in the below macros + GdkWindow *gdkWin = GTK_PIZZA(private_handle)->bin_window; + Display* display = GDK_WINDOW_XDISPLAY(gdkWin); + Window wid = GDK_WINDOW_XWINDOW(gdkWin); + + // Display + handleStream << (unsigned long)display << ':'; + + // screen (returns "display.screen") + std::string screenStr = DisplayString(display); + std::string::size_type dotPos = screenStr.find("."); + screenStr = screenStr.substr(dotPos+1, screenStr.size()); + handleStream << screenStr << ':'; + + // XID + handleStream << wid << ':'; + + // retrieve XVisualInfo + int attrlist[] = { GLX_RGBA, GLX_DOUBLEBUFFER, GLX_DEPTH_SIZE, 16, GLX_STENCIL_SIZE, 8, None }; + XVisualInfo* vi = glXChooseVisual(display, DefaultScreen(display), attrlist); + handleStream << (unsigned long)vi; + + handle = handleStream.str(); +#else + #error External/Parent Window handle not supported on this platform +#endif + + // Allocate string for the return + char* ret = new char[handle.length() + 1]; + strcpy(ret, handle.c_str()); + return ret; + } + + return 0; +} Added: trunk/tools/linux_workarounds/gethandle/wxogre_util.py =================================================================== --- trunk/tools/linux_workarounds/gethandle/wxogre_util.py (rev 0) +++ trunk/tools/linux_workarounds/gethandle/wxogre_util.py 2008-10-18 19:29:25 UTC (rev 204) @@ -0,0 +1,35 @@ +#this is copied from http://www.ogre3d.org/phpBB2addons/viewtopic.php?t=4739&start=0&postdays=0&postorder=asc&highlight=&sid=ce193664e1d3d7c4af509e6f4e2718c6 +# Copyright (C) 2007 Maryland Robotics Club +# Copyright (C) 2007 Joseph Lisee <jl...@um...> +# All rights reserved. +# +# Author: Joseph Lisee <jl...@um...> + +# Standard python imports +import ctypes as __ctypes +import os.path as __path + +# Library Imports +import wx as __wx + +# Load library +__lib_path = __path.join('/usr/local/lib', 'libwxogre_util.so') +__lib = __ctypes.cdll.LoadLibrary(__path.abspath(__lib_path)) +# Look up function +__get_window_handle_str = __lib.get_window_handle_str +# Set types to match prototype: char* get_window_handle_str(void*) +__get_window_handle_str.restype = __ctypes.c_char_p +__get_window_handle_str.argtypes = [__ctypes.c_void_p] + +def get_window_handle_str(window): + """ + Returns the Ogre friendly window format. It will not allow itself to be + called with an invalid type, but calling the underlying C wrapped C++ + function with anything but a wxWindow or a subclass of it, will result in + a hard crash. + """ + if not isinstance(window, __wx.Window): + raise TypeError, 'Must be called with a wx.Window or a subclass' + + # This automatically performs the int -> void* cast + return __get_window_handle_str(int(window.this)) \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ror...@us...> - 2008-03-22 20:42:39
|
Revision: 203 http://roreditor.svn.sourceforge.net/roreditor/?rev=203&view=rev Author: rorthomas Date: 2008-03-22 13:42:36 -0700 (Sat, 22 Mar 2008) Log Message: ----------- updated setup Modified Paths: -------------- trunk/devtools/setup/setup.nsi Modified: trunk/devtools/setup/setup.nsi =================================================================== --- trunk/devtools/setup/setup.nsi 2008-03-22 20:14:52 UTC (rev 202) +++ trunk/devtools/setup/setup.nsi 2008-03-22 20:42:36 UTC (rev 203) @@ -43,7 +43,7 @@ ; License page !insertmacro MUI_PAGE_LICENSE "readme-installer.txt" ; Components page -!insertmacro MUI_PAGE_COMPONENTS +;!insertmacro MUI_PAGE_COMPONENTS ; Directory page !insertmacro MUI_PAGE_DIRECTORY ; Instfiles page @@ -78,13 +78,13 @@ ; Reserve files !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS -InstType /NOCUSTOM -InstType "full" -InstType "minimal" +;InstType /NOCUSTOM +;InstType "full" +;InstType "minimal" ; MUI end ------ Name "${PRODUCT_NAME} ${PRODUCT_VERSION}" -OutFile "RoRToolkitSetup.exe" +OutFile "RoRToolkit-0.34-rc3-Setup.exe" InstallDir "$PROGRAMFILES\Rigs of Rods 0.34 Toolkit" ;InstallDir "c:\rortoolkit" ShowInstDetails show @@ -236,12 +236,12 @@ SectionEnd -!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN -!insertmacro MUI_DESCRIPTION_TEXT ${SEC01} "python 2.5" -!insertmacro MUI_DESCRIPTION_TEXT ${SEC02} "required Tools (directX)" -!insertmacro MUI_DESCRIPTION_TEXT ${SEC03} "optional Tools (PyWin32 for bugreporting, PyParsing and GraphViz for Dependency Graphs)" -!insertmacro MUI_DESCRIPTION_TEXT ${SEC04} "the RoR Toolkit. It includes the Truckeditor, Terraineditor and various other tools" -!insertmacro MUI_FUNCTION_DESCRIPTION_END +;!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN +;!insertmacro MUI_DESCRIPTION_TEXT ${SEC01} "python 2.5" +;!insertmacro MUI_DESCRIPTION_TEXT ${SEC02} "required Tools (directX)" +;!insertmacro MUI_DESCRIPTION_TEXT ${SEC03} "optional Tools (PyWin32 for bugreporting, PyParsing and GraphViz for Dependency Graphs)" +;!insertmacro MUI_DESCRIPTION_TEXT ${SEC04} "the RoR Toolkit. It includes the Truckeditor, Terraineditor and various other tools" +;!insertmacro MUI_FUNCTION_DESCRIPTION_END ;Function "LaunchPostInstallation" ; ReadEnvStr $0 SYSTEMDRIVE @@ -253,10 +253,10 @@ #ReadEnvStr $0 SYSTEMDRIVE SetOutPath $INSTDIR WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}" - CreateDirectory "$SMPROGRAMS\RoRToolkit" - CreateShortCut "$SMPROGRAMS\Rigs of Rods Toolkit\Website.lnk" "$INSTDIR\${PRODUCT_NAME}.url" - CreateShortCut "$SMPROGRAMS\Rigs of Rods Toolkit\Uninstall.lnk" "$INSTDIR\uninst.exe" - CreateShortCut '$SMPROGRAMS\Rigs of Rods Toolkit\Start Toolkit.lnk' '$INSTDIR\rortoolkit.py' '' '$INSTDIR\ror.ico' + CreateDirectory "$SMPROGRAMS\Rigs of Rods 0.34 Toolkit" + CreateShortCut "$SMPROGRAMS\Rigs of Rods 0.34 Toolkit\Website.lnk" "$INSTDIR\${PRODUCT_NAME}.url" + CreateShortCut "$SMPROGRAMS\Rigs of Rods 0.34 Toolkit\Uninstall.lnk" "$INSTDIR\uninst.exe" + CreateShortCut '$SMPROGRAMS\Rigs of Rods 0.34 Toolkit\Start Toolkit.lnk' '$INSTDIR\start.bat' '' '$INSTDIR\ror.ico' SectionEnd Section -Post @@ -285,7 +285,7 @@ Delete "$INSTDIR\uninst.exe" RMDir "/r" "$INSTDIR" - RMDir "/r" "$SMPROGRAMS\RoRToolkit" + RMDir "/r" "$SMPROGRAMS\Rigs of Rods 0.34 Toolkit" Delete "$STARTMENU.lnk" RMDir "$INSTDIR" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ror...@us...> - 2008-03-22 20:14:54
|
Revision: 202 http://roreditor.svn.sourceforge.net/roreditor/?rev=202&view=rev Author: rorthomas Date: 2008-03-22 13:14:52 -0700 (Sat, 22 Mar 2008) Log Message: ----------- added startup script for noobs :| Added Paths: ----------- trunk/start.bat Added: trunk/start.bat =================================================================== --- trunk/start.bat (rev 0) +++ trunk/start.bat 2008-03-22 20:14:52 UTC (rev 202) @@ -0,0 +1,3 @@ +@echo off +...@ro... +@pause \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ror...@us...> - 2008-03-22 19:56:07
|
Revision: 201 http://roreditor.svn.sourceforge.net/roreditor/?rev=201&view=rev Author: rorthomas Date: 2008-03-22 12:56:01 -0700 (Sat, 22 Mar 2008) Log Message: ----------- removed old file fixed physics bug updated setup Modified Paths: -------------- trunk/devtools/setup/setup.nsi trunk/lib_common/roreditor/RoROdefEditorOgreWindow.py trunk/lib_common/roreditor/RoRTruckOgreWindow.py trunk/lib_common/roreditor/RoRTruckUVOgreWindow.py Removed Paths: ------------- trunk/rortoolkit_old.py Modified: trunk/devtools/setup/setup.nsi =================================================================== --- trunk/devtools/setup/setup.nsi 2008-03-17 09:45:13 UTC (rev 200) +++ trunk/devtools/setup/setup.nsi 2008-03-22 19:56:01 UTC (rev 201) @@ -1,8 +1,8 @@ ; Script generated by the HM NIS Edit Script Wizard. ; HM NIS Edit Wizard helper defines -!define PRODUCT_NAME "RoRToolkit" -!define PRODUCT_VERSION "0.1.187" +!define PRODUCT_NAME "Rigs of Rods Toolkit" +!define PRODUCT_VERSION "0.34-rc3" !define PRODUCT_PUBLISHER "Thomas Fischer" !define PRODUCT_WEB_SITE "http://wiki.rigsofrods.com/index.php?title=RoRToolkit" !define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" @@ -54,10 +54,10 @@ #!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\Example.file" !define MUI_FINISHPAGE_NOAUTOCLOSE -!define MUI_FINISHPAGE_RUN +;!define MUI_FINISHPAGE_RUN ;!define MUI_FINISHPAGE_RUN_NOTCHECKED -!define MUI_FINISHPAGE_RUN_TEXT "Update and start (Can take some time)" -!define MUI_FINISHPAGE_RUN_FUNCTION "LaunchPostInstallation" +;!define MUI_FINISHPAGE_RUN_TEXT "Update and start (Can take some time)" +;!define MUI_FINISHPAGE_RUN_FUNCTION "LaunchPostInstallation" !insertmacro MUI_PAGE_FINISH ; Uninstaller pages @@ -85,8 +85,8 @@ Name "${PRODUCT_NAME} ${PRODUCT_VERSION}" OutFile "RoRToolkitSetup.exe" -;InstallDir "$PROGRAMFILES\RoRToolkit" -InstallDir "c:\rortoolkit" +InstallDir "$PROGRAMFILES\Rigs of Rods 0.34 Toolkit" +;InstallDir "c:\rortoolkit" ShowInstDetails show ShowUnInstDetails show @@ -232,7 +232,7 @@ SectionIn 1 2 RO SetOutPath "$INSTDIR" SetOverwrite try - File /r /x *.pyc /x *.pyo /x doc /x devtools /x 3rdparty /x downloaded /x graphs /x linux /x lib_linux /x tools /x .svn ..\..\* + File /r /x *.pyc /x *.pyo /x doc /x devtools /x 3rdparty /x downloaded /x graphs /x linux /x lib_linux /x tools /x .svn /x lib_linux /x linux /x rortoolkit /x *.log ..\..\* SectionEnd @@ -243,20 +243,20 @@ !insertmacro MUI_DESCRIPTION_TEXT ${SEC04} "the RoR Toolkit. It includes the Truckeditor, Terraineditor and various other tools" !insertmacro MUI_FUNCTION_DESCRIPTION_END -Function "LaunchPostInstallation" - ReadEnvStr $0 SYSTEMDRIVE - ExecWait "$0\python25\python.exe $INSTDIR\tools\update.py" - ExecWait "$0\python25\python.exe $INSTDIR\rortoolkit.py" -FunctionEnd +;Function "LaunchPostInstallation" +; ReadEnvStr $0 SYSTEMDRIVE +; ExecWait "$0\python25\python.exe $INSTDIR\tools\update.py" +; ExecWait "$0\python25\python.exe $INSTDIR\rortoolkit.py" +;FunctionEnd Section -AdditionalIcons #ReadEnvStr $0 SYSTEMDRIVE SetOutPath $INSTDIR WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}" CreateDirectory "$SMPROGRAMS\RoRToolkit" - CreateShortCut "$SMPROGRAMS\RoRToolkit\Website.lnk" "$INSTDIR\${PRODUCT_NAME}.url" - CreateShortCut "$SMPROGRAMS\RoRToolkit\Uninstall.lnk" "$INSTDIR\uninst.exe" - CreateShortCut '$SMPROGRAMS\RoRToolkit\RoR Toolkit.lnk' '$INSTDIR\rortoolkit.py' '' '$INSTDIR\ror.ico' + CreateShortCut "$SMPROGRAMS\Rigs of Rods Toolkit\Website.lnk" "$INSTDIR\${PRODUCT_NAME}.url" + CreateShortCut "$SMPROGRAMS\Rigs of Rods Toolkit\Uninstall.lnk" "$INSTDIR\uninst.exe" + CreateShortCut '$SMPROGRAMS\Rigs of Rods Toolkit\Start Toolkit.lnk' '$INSTDIR\rortoolkit.py' '' '$INSTDIR\ror.ico' SectionEnd Section -Post Modified: trunk/lib_common/roreditor/RoROdefEditorOgreWindow.py =================================================================== --- trunk/lib_common/roreditor/RoROdefEditorOgreWindow.py 2008-03-17 09:45:13 UTC (rev 200) +++ trunk/lib_common/roreditor/RoROdefEditorOgreWindow.py 2008-03-22 19:56:01 UTC (rev 201) @@ -348,5 +348,3 @@ ogre.PM_POINTS ] self.sceneDetailIndex = (self.sceneDetailIndex + 1) % len(detailsLevel) self.camera.polygonMode=detailsLevel[self.sceneDetailIndex] - elif event.m_keyCode == 81: # Q, wx.WXK_LEFT: - self.enablephysics = not self.enablephysics \ No newline at end of file Modified: trunk/lib_common/roreditor/RoRTruckOgreWindow.py =================================================================== --- trunk/lib_common/roreditor/RoRTruckOgreWindow.py 2008-03-17 09:45:13 UTC (rev 200) +++ trunk/lib_common/roreditor/RoRTruckOgreWindow.py 2008-03-22 19:56:01 UTC (rev 201) @@ -66,9 +66,7 @@ def OnFrameStarted(self): - if self.enablephysics: - self.World.update(TIMER) - self.updateBeams() + pass def OnFrameEnded(self): pass @@ -699,8 +697,6 @@ ogre.PM_POINTS ] self.sceneDetailIndex = (self.sceneDetailIndex + 1) % len(detailsLevel) self.camera.polygonMode=detailsLevel[self.sceneDetailIndex] - elif event.m_keyCode == 81: # Q, wx.WXK_LEFT: - self.enablephysics = not self.enablephysics else: if event.m_keyCode == 65: # A, wx.WXK_LEFT: self.camera.moveRelative(ogre.Vector3(-d,0,0)) Modified: trunk/lib_common/roreditor/RoRTruckUVOgreWindow.py =================================================================== --- trunk/lib_common/roreditor/RoRTruckUVOgreWindow.py 2008-03-17 09:45:13 UTC (rev 200) +++ trunk/lib_common/roreditor/RoRTruckUVOgreWindow.py 2008-03-22 19:56:01 UTC (rev 201) @@ -11,7 +11,7 @@ from wxogre.wxOgreWindow import * import ogre.renderer.OGRE as Ogre -import ogre.physics.OgreNewt as OgreNewt +#import ogre.physics.OgreNewt as OgreNewt import ogre.io.OIS as OIS IMGSCALE = 20 Deleted: trunk/rortoolkit_old.py =================================================================== --- trunk/rortoolkit_old.py 2008-03-17 09:45:13 UTC (rev 200) +++ trunk/rortoolkit_old.py 2008-03-22 19:56:01 UTC (rev 201) @@ -1,30 +0,0 @@ -#!/bin/env python -#Thomas Fischer 31/05/2007, th...@th... -import sys, os, os.path - -def main(): - """ - main method - """ - if sys.platform in ['linux', 'linux2']: - sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "lib_common")) - sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "lib_linux")) - elif sys.platform in ['win32']: - sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "lib_common")) - sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "lib_windows")) - - # Import Psyco if available - try: - import psyco - #psyco.full() - #psyco.log() - #psyco.profile() - except ImportError: - pass - - import ror.starter - ror.starter.startApp() - - -if __name__=="__main__": - main() \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ror...@us...> - 2008-03-17 09:45:17
|
Revision: 200 http://roreditor.svn.sourceforge.net/roreditor/?rev=200&view=rev Author: rorthomas Date: 2008-03-17 02:45:13 -0700 (Mon, 17 Mar 2008) Log Message: ----------- * fixed stupid svn bug :| Modified Paths: -------------- trunk/lib_common/ror/rorcommon.py trunk/lib_common/ror/starter.py trunk/lib_common/ror/svn.py trunk/lib_common/ror/svngui.py trunk/tools/update.py Modified: trunk/lib_common/ror/rorcommon.py =================================================================== --- trunk/lib_common/ror/rorcommon.py 2008-03-16 13:26:41 UTC (rev 199) +++ trunk/lib_common/ror/rorcommon.py 2008-03-17 09:45:13 UTC (rev 200) @@ -5,13 +5,6 @@ import ogre.renderer.OGRE as ogre def ShowOnAbout(event = None): - rev = "" - try: - import ror.svn - rev = str(ror.svn.getRevision()) - except: - pass - dlg = wx.MessageDialog(None, "RoR Toolkit version 0.34 %s\nAuthors: Thomas, Aperion", "About This", wx.OK | wx.ICON_INFORMATION) dlg.ShowModal() Modified: trunk/lib_common/ror/starter.py =================================================================== --- trunk/lib_common/ror/starter.py 2008-03-16 13:26:41 UTC (rev 199) +++ trunk/lib_common/ror/starter.py 2008-03-17 09:45:13 UTC (rev 200) @@ -153,14 +153,14 @@ gui.Show() del gui - def OnUpdate(self, event=None): - import svngui - gui = svngui.svnUpdate() - del gui + #def OnUpdate(self, event=None): + #import svngui + #gui = svngui.svnUpdate() + #del gui - def checkForUpdate(self): - import svn - return svn.checkForUpdate() + #def checkForUpdate(self): + # import svn + # return svn.checkForUpdate() def OnStartRoR(self, event=None): @@ -245,8 +245,8 @@ def __set_properties(self): #try: - import ror.svn - self.SetTitle("RoR Toolkit r%d" % ror.svn.getRevision()) + #import ror.svn + self.SetTitle("RoR Toolkit 0.34") #except: # self.SetTitle("RoR Toolkit") Modified: trunk/lib_common/ror/svn.py =================================================================== --- trunk/lib_common/ror/svn.py 2008-03-16 13:26:41 UTC (rev 199) +++ trunk/lib_common/ror/svn.py 2008-03-17 09:45:13 UTC (rev 200) @@ -1,4 +1,6 @@ #Thomas Fischer 28/06/2007, th...@th... +# this functions are deprecated +""" import sys, os, os.path try: import pysvn @@ -30,12 +32,13 @@ log().info(str(event_dict['action']) + ", " + event_dict['path']) def getRevision(client=None, path=None): - if client is None: - client = pysvn.Client() - if path is None: - path = getRootPath() - info = client.info(path) - return info['revision'].number + #if client is None: + # client = pysvn.Client() + #if path is None: + # path = getRootPath() + #info = client.info(path) + #return info['revision'].number + return -1 def checkForUpdate(): client = pysvn.Client() @@ -163,5 +166,5 @@ svnupdate() restoreBackup() else: - svncheckout() - + svncheckout() +""" \ No newline at end of file Modified: trunk/lib_common/ror/svngui.py =================================================================== --- trunk/lib_common/ror/svngui.py 2008-03-16 13:26:41 UTC (rev 199) +++ trunk/lib_common/ror/svngui.py 2008-03-17 09:45:13 UTC (rev 200) @@ -7,6 +7,9 @@ from ror.logger import log from ror.settingsManager import getSettingsManager +# these functions are deprecated + +""" import svn import wx, os, os.path @@ -50,4 +53,5 @@ msg = str(event_dict['action']) + ", " + os.path.basename(event_dict['path']) #self.pr.Update(self.changes % 100, msg) self.pr.Pulse(msg) - \ No newline at end of file + +""" \ No newline at end of file Modified: trunk/tools/update.py =================================================================== --- trunk/tools/update.py 2008-03-16 13:26:41 UTC (rev 199) +++ trunk/tools/update.py 2008-03-17 09:45:13 UTC (rev 200) @@ -1,5 +1,7 @@ import sys, os, os.path +# deprecated +""" def main(): if sys.platform in ['linux', 'linux2']: sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "lib_common")) @@ -22,6 +24,8 @@ #non-gui version: import ror.svn ror.svn.run() - +""" + if __name__=="__main__": - main() \ No newline at end of file + print "this tool is deprecated, please do not use it anymore" + #main() \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ror...@us...> - 2008-03-16 13:26:55
|
Revision: 199 http://roreditor.svn.sourceforge.net/roreditor/?rev=199&view=rev Author: rorthomas Date: 2008-03-16 06:26:41 -0700 (Sun, 16 Mar 2008) Log Message: ----------- little starter improvement, fixed spincontrol bug (not fatal now) Modified Paths: -------------- trunk/editor.ini trunk/lib_common/ror/rorcommon.py trunk/lib_common/ror/starter.py Modified: trunk/editor.ini =================================================================== --- trunk/editor.ini 2008-03-14 12:31:32 UTC (rev 198) +++ trunk/editor.ini 2008-03-16 13:26:41 UTC (rev 199) @@ -1,3 +1,3 @@ [RigsOfRods] -basepath = E:\projects\ror\main +basepath = Null Modified: trunk/lib_common/ror/rorcommon.py =================================================================== --- trunk/lib_common/ror/rorcommon.py 2008-03-14 12:31:32 UTC (rev 198) +++ trunk/lib_common/ror/rorcommon.py 2008-03-16 13:26:41 UTC (rev 199) @@ -93,7 +93,10 @@ ogre.ResourceGroupManager.getSingleton().addResourceLocation("media/materials", "FileSystem", "General", False) ogre.ResourceGroupManager.getSingleton().addResourceLocation("media/models", "FileSystem", "General", False) - ogre.ResourceGroupManager.getSingleton().initialiseAllResourceGroups() + try: + ogre.ResourceGroupManager.getSingleton().initialiseAllResourceGroups() + except Exception, e: + print str(e) def loadResourceFile(filename): content = [] Modified: trunk/lib_common/ror/starter.py =================================================================== --- trunk/lib_common/ror/starter.py 2008-03-14 12:31:32 UTC (rev 198) +++ trunk/lib_common/ror/starter.py 2008-03-16 13:26:41 UTC (rev 199) @@ -44,8 +44,8 @@ self.btnSelectRoRDir = wx.Button(self.panel, wx.ID_ANY, "Select RoR Directory") self.Bind(wx.EVT_BUTTON, self.OnSelectRoRDir, self.btnSelectRoRDir) - self.btnStartRoR = wx.Button(self.panel, wx.ID_ANY, "Start RoR") - self.Bind(wx.EVT_BUTTON, self.OnStartRoR, self.btnStartRoR) + #self.btnStartRoR = wx.Button(self.panel, wx.ID_ANY, "Start RoR") + #self.Bind(wx.EVT_BUTTON, self.OnStartRoR, self.btnStartRoR) if sys.platform == 'win32': self.cbbRenderEngine = wx.ComboBox(self.panel, wx.ID_ANY, RENDERSYSTEMS[0], style=wx.CB_READONLY, choices=RENDERSYSTEMS) @@ -93,13 +93,13 @@ def displayRoRDir(self): if self.rordir == "": - self.btnStartRoR.Enable(False) + #self.btnStartRoR.Enable(False) #self.btnStartTruckEditor.Enable(False) self.btnStartTerrainEditor.Enable(False) #self.btnBugReport.Enable(False) self.lblRoRDir.SetLabel("Please select Rigs of Rods Directory!") else: - self.btnStartRoR.Enable(True) + #self.btnStartRoR.Enable(True) #self.btnStartTruckEditor.Enable(True) self.btnStartTerrainEditor.Enable(True) #self.btnBugReport.Enable(True) @@ -259,7 +259,7 @@ sizer_a.Add(self.lblRoRDir, 0, wx.EXPAND, 0) sizer_a.Add(self.btnSelectRoRDir, 0, wx.EXPAND, 0) #sizer_c.Add(self.btnStartTruckEditor, 1, wx.EXPAND, 0) - sizer_a.Add(self.btnStartRoR, 0, wx.EXPAND, 0) + #sizer_a.Add(self.btnStartRoR, 0, wx.EXPAND, 0) sizer_a.Add(self.btnStartTerrainEditor, 1, wx.EXPAND, 0) if sys.platform == 'win32': This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ror...@us...> - 2008-03-14 12:31:37
|
Revision: 198 http://roreditor.svn.sourceforge.net/roreditor/?rev=198&view=rev Author: rorthomas Date: 2008-03-14 05:31:32 -0700 (Fri, 14 Mar 2008) Log Message: ----------- bugfixes Modified Paths: -------------- trunk/lib_common/ror/rorcommon.py trunk/lib_common/roreditor/MainFrame.py trunk/lib_common/roreditor/RoRTerrainOgreWindow.py Modified: trunk/lib_common/ror/rorcommon.py =================================================================== --- trunk/lib_common/ror/rorcommon.py 2008-03-13 22:25:30 UTC (rev 197) +++ trunk/lib_common/ror/rorcommon.py 2008-03-14 12:31:32 UTC (rev 198) @@ -12,7 +12,7 @@ except: pass - dlg = wx.MessageDialog(None, "RoR Toolkit revision %s\nAuthors: Aperion, Thomas" % rev, + dlg = wx.MessageDialog(None, "RoR Toolkit version 0.34 %s\nAuthors: Thomas, Aperion", "About This", wx.OK | wx.ICON_INFORMATION) dlg.ShowModal() dlg.Destroy() Modified: trunk/lib_common/roreditor/MainFrame.py =================================================================== --- trunk/lib_common/roreditor/MainFrame.py 2008-03-13 22:25:30 UTC (rev 197) +++ trunk/lib_common/roreditor/MainFrame.py 2008-03-14 12:31:32 UTC (rev 198) @@ -116,7 +116,7 @@ # see the end up FrameManager::Update() for the test # code. For now, just hard code a frame minimum size self.SetMinSize(wx.Size(600, 400)) - self.SetTitle("Rigs of Rods Terrain Editor 0.34") + self.SetTitle("Rigs of Rods Toolkit version 0.34") # create some toolbars self.terraintoolbar = wx.ToolBar(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TB_FLAT | wx.TB_NODIVIDER) @@ -127,24 +127,24 @@ self.terraintoolbar.AddLabelTool(ID_SaveTerrainAs, "Save Terrain as", wx.ArtProvider_GetBitmap(wx.ART_FILE_SAVE_AS)) self.terraintoolbar.EnableTool(ID_SaveTerrainAs, False) self.terraintoolbar.AddSeparator() - self.terraintoolbar.AddLabelTool(ID_AddObject, "Add Something", wx.ArtProvider_GetBitmap(wx.ART_NEW)) - self.terraintoolbar.EnableTool(ID_AddObject, False) - self.terraintoolbar.AddLabelTool(ID_DeleteSelection, "Delete Selection", wx.ArtProvider_GetBitmap(wx.ART_DELETE)) - self.terraintoolbar.EnableTool(ID_DeleteSelection, False) - self.terraintoolbar.AddSeparator() - self.terraintoolbar.AddLabelTool(ID_CopySelection, "Copy Selection", wx.ArtProvider_GetBitmap(wx.ART_COPY)) - self.terraintoolbar.EnableTool(ID_CopySelection, False) - self.terraintoolbar.AddLabelTool(ID_PasteSelection, "Paste Selection", wx.ArtProvider_GetBitmap(wx.ART_PASTE)) - self.terraintoolbar.EnableTool(ID_PasteSelection, False) - self.terraintoolbar.AddSeparator() - self.terraintoolbar.AddLabelTool(ID_UndoAction, "Undo last Action", wx.ArtProvider_GetBitmap(wx.ART_UNDO)) - self.terraintoolbar.EnableTool(ID_UndoAction, False) - self.terraintoolbar.AddLabelTool(ID_RedoAction, "Redo last Undo", wx.ArtProvider_GetBitmap(wx.ART_REDO)) - self.terraintoolbar.EnableTool(ID_RedoAction, False) - self.terraintoolbar.AddSeparator() - self.terraintoolbar.AddLabelTool(ID_FindObject, "Find Object", wx.ArtProvider_GetBitmap(wx.ART_FIND)) - self.terraintoolbar.EnableTool(ID_FindObject, False) - self.terraintoolbar.AddSeparator() + #self.terraintoolbar.AddLabelTool(ID_AddObject, "Add Something", wx.ArtProvider_GetBitmap(wx.ART_NEW)) + #self.terraintoolbar.EnableTool(ID_AddObject, False) + #self.terraintoolbar.AddLabelTool(ID_DeleteSelection, "Delete Selection", wx.ArtProvider_GetBitmap(wx.ART_DELETE)) + #self.terraintoolbar.EnableTool(ID_DeleteSelection, False) + #self.terraintoolbar.AddSeparator() + #self.terraintoolbar.AddLabelTool(ID_CopySelection, "Copy Selection", wx.ArtProvider_GetBitmap(wx.ART_COPY)) + #self.terraintoolbar.EnableTool(ID_CopySelection, False) + #self.terraintoolbar.AddLabelTool(ID_PasteSelection, "Paste Selection", wx.ArtProvider_GetBitmap(wx.ART_PASTE)) + #self.terraintoolbar.EnableTool(ID_PasteSelection, False) + #self.terraintoolbar.AddSeparator() + #self.terraintoolbar.AddLabelTool(ID_UndoAction, "Undo last Action", wx.ArtProvider_GetBitmap(wx.ART_UNDO)) + #self.terraintoolbar.EnableTool(ID_UndoAction, False) + #self.terraintoolbar.AddLabelTool(ID_RedoAction, "Redo last Undo", wx.ArtProvider_GetBitmap(wx.ART_REDO)) + #self.terraintoolbar.EnableTool(ID_RedoAction, False) + #self.terraintoolbar.AddSeparator() + #self.terraintoolbar.AddLabelTool(ID_FindObject, "Find Object", wx.ArtProvider_GetBitmap(wx.ART_FIND)) + #self.terraintoolbar.EnableTool(ID_FindObject, False) + #self.terraintoolbar.AddSeparator() self.terraintoolbar.AddLabelTool(ID_Quit, "Quit", wx.ArtProvider_GetBitmap(wx.ART_QUIT)) self.terraintoolbar.Realize() @@ -410,13 +410,13 @@ def openTerrain(self, filename): self.changeEditorMode(1) self.terrainOgreWin.LoadTerrain(filename) - self.terraintoolbar.EnableTool(ID_AddObject, True) - self.terraintoolbar.EnableTool(ID_DeleteSelection, True) - self.terraintoolbar.EnableTool(ID_CopySelection, True) - self.terraintoolbar.EnableTool(ID_PasteSelection, True) - self.terraintoolbar.EnableTool(ID_UndoAction, True) - self.terraintoolbar.EnableTool(ID_RedoAction, True) - self.terraintoolbar.EnableTool(ID_FindObject, True) + #self.terraintoolbar.EnableTool(ID_AddObject, True) + #self.terraintoolbar.EnableTool(ID_DeleteSelection, True) + #self.terraintoolbar.EnableTool(ID_CopySelection, True) + #self.terraintoolbar.EnableTool(ID_PasteSelection, True) + #self.terraintoolbar.EnableTool(ID_UndoAction, True) + #self.terraintoolbar.EnableTool(ID_RedoAction, True) + #self.terraintoolbar.EnableTool(ID_FindObject, True) self.terraintoolbar.EnableTool(ID_SaveTerrain, True) self.terraintoolbar.EnableTool(ID_SaveTerrainAs, True) Modified: trunk/lib_common/roreditor/RoRTerrainOgreWindow.py =================================================================== --- trunk/lib_common/roreditor/RoRTerrainOgreWindow.py 2008-03-13 22:25:30 UTC (rev 197) +++ trunk/lib_common/roreditor/RoRTerrainOgreWindow.py 2008-03-14 12:31:32 UTC (rev 198) @@ -237,12 +237,11 @@ self.line[i].setDynamic(True) self.linenode.append(self.sceneManager.getRootSceneNode().createChildSceneNode()) self.linenode[i].attachObject(self.line[i]) - +""" self.virtualMoveNode = self.sceneManager.getRootSceneNode().createChildSceneNode() # this is for debugging of the grid system: #self.virtualMoveNode.attachObject(self.sceneManager.createEntity("afsdfsdfsfsdfsdfasdf", "arrow.mesh") ) -""" #create objects self.populateScene() @@ -291,15 +290,18 @@ return pos.x, pos.y, pos.z, rotx, roty, rotz def reattachArrows(self, entity): - self.TranslateNode.setPosition(entity.getParentNode().getPosition()) - #self.TranslateNode.setOrientation(entity.getParentNode().getOrientation()) + try: + self.TranslateNode.setPosition(entity.getParentNode().getPosition()) + #self.TranslateNode.setOrientation(entity.getParentNode().getOrientation()) + + self.RotateNode.setOrientation(entity.getParentNode().getOrientation()) + self.RotateNode.setPosition(entity.getParentNode().getPosition()) + + self.virtualMoveNode.setOrientation(entity.getParentNode().getOrientation()) + self.virtualMoveNode.setPosition(entity.getParentNode().getPosition()) + except: + pass - self.RotateNode.setOrientation(entity.getParentNode().getOrientation()) - self.RotateNode.setPosition(entity.getParentNode().getPosition()) - - self.virtualMoveNode.setOrientation(entity.getParentNode().getOrientation()) - self.virtualMoveNode.setPosition(entity.getParentNode().getPosition()) - def createArrows(self): if not self.TranslateNode is None: return This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ror...@us...> - 2008-03-13 22:25:31
|
Revision: 197 http://roreditor.svn.sourceforge.net/roreditor/?rev=197&view=rev Author: rorthomas Date: 2008-03-13 15:25:30 -0700 (Thu, 13 Mar 2008) Log Message: ----------- removed deprecated code Removed Paths: ------------- branches/dev/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ror...@us...> - 2008-03-13 22:17:13
|
Revision: 196 http://roreditor.svn.sourceforge.net/roreditor/?rev=196&view=rev Author: rorthomas Date: 2008-03-13 15:17:09 -0700 (Thu, 13 Mar 2008) Log Message: ----------- * lots of bugfixes * now able to delete things (use 'delete' keyboard key) * removed pseudo red/green line thing Modified Paths: -------------- trunk/lib_common/ror/terrainparser.py trunk/lib_common/roreditor/MainFrame.py trunk/lib_common/roreditor/RoRTerrainOgreWindow.py Modified: trunk/lib_common/ror/terrainparser.py =================================================================== --- trunk/lib_common/ror/terrainparser.py 2008-03-13 00:47:22 UTC (rev 195) +++ trunk/lib_common/ror/terrainparser.py 2008-03-13 22:17:09 UTC (rev 196) @@ -18,8 +18,10 @@ additionaloptions = [] comments = [] mayRotate = True + type="" error = None + deleted=False def setPosition(self, x, y, z): self.x = x @@ -32,7 +34,7 @@ self.rotz = z def __str__(self): - return self.filename + return "Terrain entry: "+self.filename class RoRTerrain: @@ -41,9 +43,9 @@ TerrainConfig = "" filename = "" - trucks = [] - loads = [] + beamobjs = [] objects = [] + procroads = [] UsingCaelum = False WaterHeight = None @@ -62,8 +64,7 @@ def __init__(self, filename): self.filename = filename content = loadResourceFile(filename) - self.trucks = [] - self.loads = [] + self.beamobj = [] self.objects = [] log().info("processing terrain file: %s" % filename) self.processTerrnFile(content) @@ -84,19 +85,52 @@ def processTerrnFile(self, content): linecounter = 0 comm = [] + treemode=False + procroad=False + procroadlines=[] for i in range(0, len(content)): # convert tabs to spaces! content[i] = content[i].replace("\t", " ") + if treemode: + comm.append(content[i]) + if content[i].strip()[:8] == "tree_end": + treemode=False + continue + if procroad: + procroadlines.append(content[i].strip().split(',')) + if content[i].strip()[:20] == "end_procedural_roads": + procroad=False + self.procroads.append(copy.copy(procroadlines)) + # process now + continue + if content[i].strip() == "": comm.append(content[i]) continue if content[i].strip()[0:4] == "////": # ignore editor self made comments (usefull for those error msgs) continue - if content[i].strip()[0:2] == "//": + if content[i].strip()[:2] == "//": comm.append(content[i]) continue + if content[i].strip()[:5] == "grass": + comm.append(content[i]) + continue + if content[i].strip()[:7] == "mpspawn": + comm.append(content[i]) + continue + if content[i].strip()[:7] == "mpspawn": + comm.append(content[i]) + continue + if content[i].strip()[:10] == "tree_begin": + comm.append(content[i]) + treemode=True + continue + if content[i].strip()[:22] == "begin_procedural_roads": + procroad=True + continue + if content[i].strip()[0:1] == ";": # bugfix wrong characters! comm.append(content[i].replace(";","//")) @@ -149,35 +183,23 @@ log().error("unable to parse line: %s. ignoring it!" % content[i]) continue - print objname - if objname[0].lower() == "truck" and len(objname) > 1: + #print objname + if objname[0].lower() in ["truck", "load", "machine", "boat"] and len(objname) > 1: #print "truck" truck = Object() - truck.name = "truck" + truck.name = objname[1] truck.filename = objname[-1].strip() truck.comments = comm comm = [] truck.setPosition(x, y, z) truck.setRotation(rx, ry, -rz) - truck.additionaloptions = objname[1:] + #if len(objname)>1: + #truck.additionaloptions = objname[2:] truck.line = i + truck.type = objname[0].lower() #truck.mayRotate=False - self.trucks.append(truck) + self.beamobjs.append(truck) continue - if objname[0] == "load" and len(objname) > 1: - #print "load" - load = Object() - load.name = "load" - load.filename = objname[-1].strip() - load.comments = comm - load.line=i - comm = [] - load.setPosition(x, y, z) - load.setRotation(rx, ry, -rz) - load.additionaloptions = objname[1:] - #load.mayRotate=False - self.loads.append(load) - continue #print "object" # now it can just be an static object @@ -192,6 +214,8 @@ obj.setRotation(rx, ry, rz) obj.additionaloptions = objname[1:] self.objects.append(obj) + + print "number of proceddual roads: %d" % len(self.procroads) def getObjectLines(self, object): lines = [] @@ -199,14 +223,16 @@ # add comments if len(object.comments) > 0: for comment in object.comments: - lines.append(comment) + lines.append(comment+"\n") # construct objects name - objname = object.name + #print object.name, object.type + objname = object.type+" "+object.name if len(object.additionaloptions) > 0: - tmp = (" " + " ".join(object.additionaloptions)).strip() - objname += " " + tmp + objname += " " + " ".join(object.additionaloptions) + #print objname + # add line itself linearray = [self.formatFloat(object.x), self.formatFloat(object.y), @@ -216,6 +242,8 @@ self.formatFloat(object.rotz), objname] line = ", ".join(linearray) + if object.deleted: + line = "//"+line if not object.error is None: lines.append("//// the next object had errors, so the terraineditor commented it out:\n") @@ -230,7 +258,9 @@ def save(self, filename = None): if filename is None: - filename = self.filename + rordir = getSettingsManager().getSetting("RigsOfRods", "BasePath") + filename = os.path.join(rordir, "data", "terrains", self.filename) + print "saving terrain as %s" % filename lines = [] lines.append(self.TerrainName+"\n") lines.append(self.TerrainConfig+"\n") @@ -265,15 +295,10 @@ #save trucks - for truck in self.trucks: + for truck in self.beamobjs: trucklines = self.getObjectLines(truck) for l in trucklines: lines.append(l) - # save loads - for load in self.loads: - loadlines = self.getObjectLines(load) - for l in loadlines: - lines.append(l) # save objects for object in self.objects: Modified: trunk/lib_common/roreditor/MainFrame.py =================================================================== --- trunk/lib_common/roreditor/MainFrame.py 2008-03-13 00:47:22 UTC (rev 195) +++ trunk/lib_common/roreditor/MainFrame.py 2008-03-13 22:17:09 UTC (rev 196) @@ -116,11 +116,7 @@ # see the end up FrameManager::Update() for the test # code. For now, just hard code a frame minimum size self.SetMinSize(wx.Size(600, 400)) - try: - import ror.svn - self.SetTitle("Rigs of Rods Terrain Editor revision %d" % ror.svn.getRevision()) - except: - self.SetTitle("Rigs of Rods Terrain Editor") + self.SetTitle("Rigs of Rods Terrain Editor 0.34") # create some toolbars self.terraintoolbar = wx.ToolBar(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TB_FLAT | wx.TB_NODIVIDER) @@ -387,11 +383,14 @@ #if comment.strip() != "": # txt = "%s / %s" % (n.getName(), comment) #else: - txt = "%s %s" % (entry.data.name, " ".join(entry.data.additionaloptions)) - self.statusbar.SetStatusText(txt, 2) - - posx, posy, posz, rotx, roty, rotz = self.terrainOgreWin.getSelectionPositionRotation() - txt = "%d, %0.2f, %0.2f, %0.2f / %0.2f, %0.2f, %0.2f" % (entry.data.line, posx, posy, posz, rotx, roty, rotz) + try: + txt = "%s %s" % (entry.data.name, " ".join(entry.data.additionaloptions)) + self.statusbar.SetStatusText(txt, 2) + + posx, posy, posz, rotx, roty, rotz = self.terrainOgreWin.getSelectionPositionRotation() + txt = "%d, %0.2f, %0.2f, %0.2f / %0.2f, %0.2f, %0.2f" % (entry.data.line, posx, posy, posz, rotx, roty, rotz) + except: + txt = "" self.statusbar.SetStatusText(txt, 3) def OnGUITimer(self, event): Modified: trunk/lib_common/roreditor/RoRTerrainOgreWindow.py =================================================================== --- trunk/lib_common/roreditor/RoRTerrainOgreWindow.py 2008-03-13 00:47:22 UTC (rev 195) +++ trunk/lib_common/roreditor/RoRTerrainOgreWindow.py 2008-03-13 22:17:09 UTC (rev 196) @@ -204,7 +204,7 @@ self.Bind(wx.EVT_KEY_UP, self.onKeyUp) self.Bind(wx.EVT_MOUSE_EVENTS, self.onMouseEvent) - + """ self.spline = ogre.SimpleSpline() # some spline material mat = ogre.MaterialManager.getSingleton().create("matline","debugger") @@ -242,7 +242,7 @@ # this is for debugging of the grid system: #self.virtualMoveNode.attachObject(self.sceneManager.createEntity("afsdfsdfsfsdfsdfasdf", "arrow.mesh") ) - +""" #create objects self.populateScene() @@ -458,8 +458,8 @@ self.createWaterPlane() self.createArrows() - for t in self.terrain.trucks: - print str(t) + #for t in self.terrain.trucks: + # print str(t) try: if not self.terrain.CharacterStartPosition is None: @@ -470,20 +470,13 @@ log().error("Error while setting initial camera:") log().error(str(err)) - for truck in self.terrain.trucks: + for beam in self.terrain.beamobjs: try: self.addTruckToTerrain(data=truck) except Exception, err: - log().error("Error while adding a truck to the terrain:") + log().error("Error while adding a Beam Construction to the terrain:") log().error(str(err)) - for load in self.terrain.loads: - try: - self.addTruckToTerrain(data=load) - except Exception, err: - log().error("Error while adding a load to the terrain:") - log().error(str(err)) - for object in self.terrain.objects: try: self.addObjectToTerrain(data=object) @@ -544,7 +537,26 @@ self.entries[uuid] = entry return True - + + def deleteObjectFromFile(self, entry): + if entry.line == 0: + return + + for truck in self.terrain.beamobjs: + if truck.line == entry.line: + truck.deleted=True + print "truck in line %d deleted" % entry.line + return True + + for object in self.terrain.objects: + if object.line == entry.line: + object.deleted=True + print "object in line %d deleted" % entry.line + return True + + print "object in line %d not found!" % entry.line + return False + def addTruckToTerrain(self, data=None, truckFilename=None, coords=None): if coords is None: coords = self.selectedCoords @@ -560,16 +572,19 @@ data.comments = ['// added by terrain editor\n'] data.setPosition(coords.x, coords.y, coords.z) data.setRotation(0, 0, 0) + data.type="truck" data.additionaloptions =[data.filename] if truckFilename.split(".")[-1].lower() == "truck": - self.terrain.trucks.append(data) + data.type="truck" elif truckFilename.split(".")[-1].lower() == "load": - self.terrain.loads.append(data) + data.type="load" + self.terrain.beamobj.append(data) else: + #print data truckFilename = data.filename - if os.path.basename(truckFilename) == truckFilename: - truckFilename = self.rordir + "\\data\\trucks\\"+truckFilename + #if os.path.basename(truckFilename) == truckFilename: + # truckFilename = truckFilename entry = Entry() entry.uuid = uuid @@ -863,7 +878,9 @@ width, height, a, b, c = self.renderWindow.getMetrics() self.controlArrows(event) + """ if event.LeftDown(): + pos = self.getPointedPosition(event) self.spline.addPoint(pos) @@ -911,8 +928,8 @@ self.line[3].position(point) self.line[3].position(point+ogre.Vector3(0,2,0)) self.line[3].end() + """ - if event.RightDown() or event.LeftDown(): self.SetFocus() @@ -964,14 +981,13 @@ if self.terrain is None: return + # print keycode for debugging purposes #print event.m_keyCode d = 0.5 if event.ShiftDown(): d *= SHIFT_SPEED_FACTOR - if event.m_keyCode == 65: # A, wx.WXK_LEFT: - self.keyPress.x = -d - + """ elif event.m_keyCode == 66: # B lines = [] factor = 1 @@ -991,6 +1007,17 @@ f = open("roads.out", 'w') f.writelines(lines) f.close() + """ + + if event.m_keyCode == 65: # A, wx.WXK_LEFT: + self.keyPress.x = -d + elif event.m_keyCode == 127: + # delete key + self.deleteObjectFromFile(self.selectedEntry.data) + self.selectedEntry.entity.getParentSceneNode().setVisible(False) + self.deselectSelection() + self.selectTerrain(event) + elif event.m_keyCode == 68: # D, wx.WXK_RIGHT: self.keyPress.x = d elif event.m_keyCode == 87: # W ,wx.WXK_UP: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ror...@us...> - 2008-03-13 00:47:24
|
Revision: 195 http://roreditor.svn.sourceforge.net/roreditor/?rev=195&view=rev Author: rorthomas Date: 2008-03-12 17:47:22 -0700 (Wed, 12 Mar 2008) Log Message: ----------- fixed parts of the terrain editor Modified Paths: -------------- trunk/lib_common/ror/terrainparser.py trunk/lib_common/roreditor/GUIObjectTree.py trunk/lib_common/roreditor/RoRObjectPreviewOgreWindow.py trunk/lib_common/roreditor/RoRTerrainOgreWindow.py Modified: trunk/lib_common/ror/terrainparser.py =================================================================== --- trunk/lib_common/ror/terrainparser.py 2008-03-13 00:12:58 UTC (rev 194) +++ trunk/lib_common/ror/terrainparser.py 2008-03-13 00:47:22 UTC (rev 195) @@ -30,6 +30,9 @@ self.rotx = x self.roty = y self.rotz = z + + def __str__(self): + return self.filename class RoRTerrain: @@ -146,8 +149,9 @@ log().error("unable to parse line: %s. ignoring it!" % content[i]) continue - #print objname - if objname[0][0:5].lower() == "truck" and len(objname) > 1: + print objname + if objname[0].lower() == "truck" and len(objname) > 1: + #print "truck" truck = Object() truck.name = "truck" truck.filename = objname[-1].strip() @@ -160,7 +164,8 @@ #truck.mayRotate=False self.trucks.append(truck) continue - if objname[0][0:4] == "load" and len(objname) > 1: + if objname[0] == "load" and len(objname) > 1: + #print "load" load = Object() load.name = "load" load.filename = objname[-1].strip() @@ -174,6 +179,7 @@ self.loads.append(load) continue + #print "object" # now it can just be an static object objectname = objname[0].strip() obj = Object() Modified: trunk/lib_common/roreditor/GUIObjectTree.py =================================================================== --- trunk/lib_common/roreditor/GUIObjectTree.py 2008-03-13 00:12:58 UTC (rev 194) +++ trunk/lib_common/roreditor/GUIObjectTree.py 2008-03-13 00:47:22 UTC (rev 195) @@ -73,10 +73,13 @@ files=[] for pattern in filepattern: + #print pattern newfiles = self.getInstalledFiles(pattern) for newfile in newfiles: files.append(newfile) + #print files + files_editable=[] files_uneditable=[] for file in files: @@ -84,9 +87,19 @@ if file.archive: type = file.archive.getType() if type == 'FileSystem': - files_editable.append(file) + ok = True + for filecheck in files_editable: + if filecheck.filename == file.filename: + ok=False + if ok: + files_editable.append(file) else: - files_uneditable.append(file) + ok = True + for filecheck in files_uneditable: + if filecheck.filename == file.filename: + ok=False + if ok: + files_uneditable.append(file) section = None if len(files_editable) > 0 or len(files_uneditable) > 0: Modified: trunk/lib_common/roreditor/RoRObjectPreviewOgreWindow.py =================================================================== --- trunk/lib_common/roreditor/RoRObjectPreviewOgreWindow.py 2008-03-13 00:12:58 UTC (rev 194) +++ trunk/lib_common/roreditor/RoRObjectPreviewOgreWindow.py 2008-03-13 00:47:22 UTC (rev 195) @@ -116,9 +116,23 @@ terrain = RoRTerrain(filename) cfgfile = os.path.join(os.path.dirname(filename), terrain.TerrainConfig) self.objnode = self.sceneManager.getRootSceneNode().createChildSceneNode(uuid+"objnode") - self.objnode.setPosition(1500, 0, 1500) + (x, z) = self.getTerrainSize(cfgfile) + self.terrainsize = (x, z) + print "terrain size: ", x, z + self.objnode.setPosition(x/2, 0, z/2) self.sceneManager.setWorldGeometry(cfgfile) + def getTerrainSize(self, filename): + lines = loadResourceFile(filename) + x=1500 + z=1500 + for line in lines: + if line.lower().strip()[:11] == 'pageworldx=': + x = int(line.lower().strip()[11:]) + if line.lower().strip()[:11] == 'pageworldz=': + z = int(line.lower().strip()[11:]) + return (x, z) + def loadodef(self, filename, uuid): try: meshname, sx, sy, sz, ismovable, boxes = loadOdef(filename) @@ -187,14 +201,14 @@ #self.MainLight.setPosition (ogre.Vector3(20, 80, 130)) # add some fog - self.sceneManager.setFog(ogre.FOG_EXP, ogre.ColourValue.White, 0.00002) + self.sceneManager.setFog(ogre.FOG_EXP, ogre.ColourValue.White, 0.0000002) # create a floor Mesh plane = ogre.Plane() plane.normal = ogre.Vector3(0, 1, 0) plane.d = 200 uuid = str(randomID()) - ogre.MeshManager.getSingleton().createPlane(uuid + 'FloorPlane', "General", plane, 200000.0, 200000.0, + ogre.MeshManager.getSingleton().createPlane(uuid + 'FloorPlane', "General", plane, 20000000.0, 20000000.0, 20, 20, True, 1, 50.0, 50.0,ogre.Vector3(0, 0, 1), ogre.HardwareBuffer.HBU_STATIC_WRITE_ONLY, ogre.HardwareBuffer.HBU_STATIC_WRITE_ONLY, @@ -246,8 +260,8 @@ pos = self.objnode.getPosition() + rotateheight + (self.objentity.getBoundingBox().getMinimum() + self.objentity.getBoundingBox().getMaximum() ) / 2 lookheight = ogre.Vector3(0, height / 2, 0) elif self.mode == "terrain": - self.radius = 3000 - rotateheight = ogre.Vector3(0, 1600, 0) + self.radius = self.terrainsize[0] + rotateheight = ogre.Vector3(0, self.terrainsize[0]/2, 0) pos = self.objnode.getPosition() + rotateheight lookheight = -rotateheight Modified: trunk/lib_common/roreditor/RoRTerrainOgreWindow.py =================================================================== --- trunk/lib_common/roreditor/RoRTerrainOgreWindow.py 2008-03-13 00:12:58 UTC (rev 194) +++ trunk/lib_common/roreditor/RoRTerrainOgreWindow.py 2008-03-13 00:47:22 UTC (rev 195) @@ -457,6 +457,10 @@ self.createWaterPlane() self.createArrows() + + for t in self.terrain.trucks: + print str(t) + try: if not self.terrain.CharacterStartPosition is None: self.camera.setPosition(self.terrain.CharacterStartPosition) @@ -960,7 +964,7 @@ if self.terrain is None: return - print event.m_keyCode + #print event.m_keyCode d = 0.5 if event.ShiftDown(): d *= SHIFT_SPEED_FACTOR This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ror...@us...> - 2008-03-13 00:13:00
|
Revision: 194 http://roreditor.svn.sourceforge.net/roreditor/?rev=194&view=rev Author: rorthomas Date: 2008-03-12 17:12:58 -0700 (Wed, 12 Mar 2008) Log Message: ----------- some parts working again. added section'ed Object Tree Modified Paths: -------------- trunk/lib_common/ror/SimpleTruckRepresentation.py trunk/lib_common/ror/rorcommon.py trunk/lib_common/ror/truckparser.py trunk/lib_common/roreditor/GUIObjectTree.py trunk/lib_common/roreditor/RoRObjectPreviewOgreWindow.py Modified: trunk/lib_common/ror/SimpleTruckRepresentation.py =================================================================== --- trunk/lib_common/ror/SimpleTruckRepresentation.py 2008-03-12 23:28:56 UTC (rev 193) +++ trunk/lib_common/ror/SimpleTruckRepresentation.py 2008-03-13 00:12:58 UTC (rev 194) @@ -8,10 +8,10 @@ from ror.rorcommon import * def createTruckMesh(sceneManager, fn, uuid): - if not os.path.isfile(fn): - #print "truck file not found: " + fn - log().error("truck file not found: %s" % fn) - return + #if not os.path.isfile(fn): + # #print "truck file not found: " + fn + # log().error("truck file not found: %s" % fn) + # return p = rorparser() p.parse(fn) if not 'nodes' in p.tree.keys() or not 'beams' in p.tree.keys(): Modified: trunk/lib_common/ror/rorcommon.py =================================================================== --- trunk/lib_common/ror/rorcommon.py 2008-03-12 23:28:56 UTC (rev 193) +++ trunk/lib_common/ror/rorcommon.py 2008-03-13 00:12:58 UTC (rev 194) @@ -1,4 +1,4 @@ -import sys, os, os.path, glob +import sys, os, os.path, glob, copy import wx from random import Random from logger import log Modified: trunk/lib_common/ror/truckparser.py =================================================================== --- trunk/lib_common/ror/truckparser.py 2008-03-12 23:28:56 UTC (rev 193) +++ trunk/lib_common/ror/truckparser.py 2008-03-13 00:12:58 UTC (rev 194) @@ -3,932 +3,926 @@ import sys, os, os.path, tempfile, pickle from ror.logger import log from ror.settingsManager import getSettingsManager +from ror.rorcommon import * - # default values: required:True - # please note: unkown args are marked with 'WHAT IS THIS' + # default values: required:True + # please note: unkown args are marked with 'WHAT IS THIS' class rorparser: - # This specifies all valid commands - commands = { - # set_beam_defaults changes the beams (but also the hydros and ropes) default characteristics that will be used for the beams declared after the line. You can use this line many times to make different groups of beams that have different characteristics (e.g. stronger chassis, softer cab, etc.). This method is better than the globeams command that is now deprecated. The parameters comes on the same line, after set_beam_defaults. You can use the first parameters (most usefull) and safely ignore the last parameters. - 'set_beam_defaults':[ - # Spring constant (use -1 for the default, which is 9000000) - {'name':'spring constant','type':'float'}, - # Damping constant (use -1 for the default, which is 12000) - {'name':'damping constant','type':'float'}, - # Deformation threshold constant (use -1 for the default, which is 400000) - {'name':'deformation threshold','type':'float'}, - # Breaking thresold constant (use -1 for the default, which is 1000000) - {'name':'breaking thresold','type':'float'}, - # Beam diameter (use -1 for the default, which is 0.05) - {'name':'beam diameter','type':'float', 'required':False}, - # Beam material (default: tracks/beam) - {'name':'beam material','type':'string', 'required':False}, - ], + # This specifies all valid commands + commands = { + # set_beam_defaults changes the beams (but also the hydros and ropes) default characteristics that will be used for the beams declared after the line. You can use this line many times to make different groups of beams that have different characteristics (e.g. stronger chassis, softer cab, etc.). This method is better than the globeams command that is now deprecated. The parameters comes on the same line, after set_beam_defaults. You can use the first parameters (most usefull) and safely ignore the last parameters. + 'set_beam_defaults':[ + # Spring constant (use -1 for the default, which is 9000000) + {'name':'spring constant','type':'float'}, + # Damping constant (use -1 for the default, which is 12000) + {'name':'damping constant','type':'float'}, + # Deformation threshold constant (use -1 for the default, which is 400000) + {'name':'deformation threshold','type':'float'}, + # Breaking thresold constant (use -1 for the default, which is 1000000) + {'name':'breaking thresold','type':'float'}, + # Beam diameter (use -1 for the default, which is 0.05) + {'name':'beam diameter','type':'float', 'required':False}, + # Beam material (default: tracks/beam) + {'name':'beam material','type':'string', 'required':False}, + ], - # Enables collision between wheels and the textured surfaces of a truck. - 'rollon':[], + # Enables collision between wheels and the textured surfaces of a truck. + 'rollon':[], - # Forwards the commandkeys pressed while riding a truck to loads in close proximity. It is used to remote control the commands of a load. The load must have the "importcommands" tag. - 'forwardcommands':[], + # Forwards the commandkeys pressed while riding a truck to loads in close proximity. It is used to remote control the commands of a load. The load must have the "importcommands" tag. + 'forwardcommands':[], - # Enables a load to receive commandkeys from a manned vehicle in close proximity. The controlling vehicle must have the "forwardcommands" tag. The load only receives the keys that are pressed by the player, it must contain a commands section. Commands section for loads is defined in the same manner as in manned trucks. - 'importcommands':[], + # Enables a load to receive commandkeys from a manned vehicle in close proximity. The controlling vehicle must have the "forwardcommands" tag. The load only receives the keys that are pressed by the player, it must contain a commands section. Commands section for loads is defined in the same manner as in manned trucks. + 'importcommands':[], - # the triangles backsides of the submesh will be black instead of see-through. - 'backmesh':[], + # the triangles backsides of the submesh will be black instead of see-through. + 'backmesh':[], - # rescue-truck? - 'rescuer':[], + # rescue-truck? + 'rescuer':[], - # end of file - 'end':[], + # end of file + 'end':[], - } - - ### This specifies all valid sections und subsections - sections = { - # This section is the only that is not introduced by a keyword. It is the name of the truck, and it must absolutely be the first line of the file. e.g. - 'title':[ - {'name':'title','type':'string'}, - ], + } + + ### This specifies all valid sections und subsections + sections = { + # This section is the only that is not introduced by a keyword. It is the name of the truck, and it must absolutely be the first line of the file. e.g. + 'title':[ + {'name':'title','type':'string'}, + ], - # This section is very special and should not be used for most designs. It was created to make the bridge. It allows you to alter the default mechanical and visual beam properties. The parameters are: default stress at which beams deforms (in Newtons), default stress at which beams break, default beams diameter (in meter), default beams material. This section is deprecated and should not be used for truck designs. Use the more powerfull set_beam_defaults instead. - 'globals':[ - {'name':'dry mass', 'type':'float'}, - {'name':'cargo mass', 'type':'float'}, - {'name':'material', 'type':'string'}, - ], + # This section is very special and should not be used for most designs. It was created to make the bridge. It allows you to alter the default mechanical and visual beam properties. The parameters are: default stress at which beams deforms (in Newtons), default stress at which beams break, default beams diameter (in meter), default beams material. This section is deprecated and should not be used for truck designs. Use the more powerfull set_beam_defaults instead. + 'globals':[ + {'name':'dry mass', 'type':'float'}, + {'name':'cargo mass', 'type':'float'}, + {'name':'material', 'type':'string'}, + ], - # This section is very special and should not be used for most designs. It was created to make the bridge. It allows you to alter the default mechanical and visual beam properties. The parameters are: default stress at which beams deforms (in Newtons), default stress at which beams break, default beams diameter (in meter), default beams material. This section is deprecated and should not be used for truck designs. Use the more powerfull set_beam_defaults instead. - 'globeams':[ - #default stress at which beams deforms (in Newtons) - {'name':'deform', 'type':'float'}, - #default stress at which beams break - {'name':'break', 'type':'float'}, - #default beams diameter (in meter) - {'name':'diameter', 'type':'float'}, - #default beams material - {'name':'material', 'type':'string'}, - ], + # This section is very special and should not be used for most designs. It was created to make the bridge. It allows you to alter the default mechanical and visual beam properties. The parameters are: default stress at which beams deforms (in Newtons), default stress at which beams break, default beams diameter (in meter), default beams material. This section is deprecated and should not be used for truck designs. Use the more powerfull set_beam_defaults instead. + 'globeams':[ + #default stress at which beams deforms (in Newtons) + {'name':'deform', 'type':'float'}, + #default stress at which beams break + {'name':'break', 'type':'float'}, + #default beams diameter (in meter) + {'name':'diameter', 'type':'float'}, + #default beams material + {'name':'material', 'type':'string'}, + ], - # The engine section contains the engine parameters. - 'engine':[ - {'name':'min rpm', 'type':'float'}, - {'name':'max rpm', 'type':'float'}, - #torque (flat torque model, usually correct for large intercooled turbo diesels). This defines the engine power! - {'name':'torque', 'type':'float'}, - #differential ratio (a global gear conversion ratio) - {'name':'differential ratio', 'type':'float'}, - {'name':'rear gear', 'type':'float'}, - {'name':'first gear', 'type':'float'}, - {'name':'second gear', 'type':'float'}, - {'name':'third gear', 'type':'float','required':False}, - {'name':'fourth gear', 'type':'float','required':False}, - {'name':'fifth gear', 'type':'float','required':False}, - {'name':'sixth gear', 'type':'float','required':False}, - {'name':'seventh gear', 'type':'float','required':False}, - {'name':'eighth gear', 'type':'float','required':False}, - {'name':'nineth gear', 'type':'float','required':False}, - {'name':'tenth rpm', 'type':'float','required':False}, - {'name':'eleventh rpm', 'type':'float','required':False}, - {'name':'twelveth rpm', 'type':'float','required':False}, - {'name':'thirteenth rpm', 'type':'float','required':False}, - {'name':'fourteenth rpm', 'type':'float','required':False}, - {'name':'fifteenth rpm', 'type':'float','required':False}, - {'name':'sixteenth rpm', 'type':'float','required':False}, - #The last gear must be followed by a -1 value. - {'name':'ending argument', 'type':'float','required':False}, - ], + # The engine section contains the engine parameters. + 'engine':[ + {'name':'min rpm', 'type':'float'}, + {'name':'max rpm', 'type':'float'}, + #torque (flat torque model, usually correct for large intercooled turbo diesels). This defines the engine power! + {'name':'torque', 'type':'float'}, + #differential ratio (a global gear conversion ratio) + {'name':'differential ratio', 'type':'float'}, + {'name':'rear gear', 'type':'float'}, + {'name':'first gear', 'type':'float'}, + {'name':'second gear', 'type':'float'}, + {'name':'third gear', 'type':'float','required':False}, + {'name':'fourth gear', 'type':'float','required':False}, + {'name':'fifth gear', 'type':'float','required':False}, + {'name':'sixth gear', 'type':'float','required':False}, + {'name':'seventh gear', 'type':'float','required':False}, + {'name':'eighth gear', 'type':'float','required':False}, + {'name':'nineth gear', 'type':'float','required':False}, + {'name':'tenth rpm', 'type':'float','required':False}, + {'name':'eleventh rpm', 'type':'float','required':False}, + {'name':'twelveth rpm', 'type':'float','required':False}, + {'name':'thirteenth rpm', 'type':'float','required':False}, + {'name':'fourteenth rpm', 'type':'float','required':False}, + {'name':'fifteenth rpm', 'type':'float','required':False}, + {'name':'sixteenth rpm', 'type':'float','required':False}, + #The last gear must be followed by a -1 value. + {'name':'ending argument', 'type':'float','required':False}, + ], - # Engoption sets optional parameters to the engine, mainly for car engines. Parameters are: - 'engoption':[ - # Engine inertia: the default game value is 10.0, which is correct for a large diesel engine, but for smaller engines you might want smaller values, like 1.0 or 0.5 for small athmospheric engines. - {'name':'Engine inertia', 'type':'float'}, + # Engoption sets optional parameters to the engine, mainly for car engines. Parameters are: + 'engoption':[ + # Engine inertia: the default game value is 10.0, which is correct for a large diesel engine, but for smaller engines you might want smaller values, like 1.0 or 0.5 for small athmospheric engines. + {'name':'Engine inertia', 'type':'float'}, - # Engine type: valid types are t for truck engine and c for car engine. This changes engine sound and other engine characteristics. - {'name':'Engine type', 'type':'string', - 'validvalues':[ - 'c', # truck engine - 't', # car engine - ]}, - ], + # Engine type: valid types are t for truck engine and c for car engine. This changes engine sound and other engine characteristics. + {'name':'Engine type', 'type':'string', + 'validvalues':[ + 'c', # truck engine + 't', # car engine + ]}, + ], - # This allows you to change the default braking force value (the default is 30000), generally to a lower value for smaller trucks and cars. - 'brakes':[ - # braking force - {'name':'braking force', 'type':'float'}, - ], + # This allows you to change the default braking force value (the default is 30000), generally to a lower value for smaller trucks and cars. + 'brakes':[ + # braking force + {'name':'braking force', 'type':'float'}, + ], - # This section is important. It helps to position the truck in space, by defining a local direction reference. For example this is used to measure the pitch and the roll of the truck. The three parameters are node numbers (defined in the next section). The first if the reference and may be anywhere, the second must be behind the first (if you look at the front of the truck, it is hidden behind the first), and the third must be at the left of the first (if you look to the right of the truck, it is hidden by the first) - 'cameras':[ - # The first if the reference and may be anywhere - {'name':'center node', 'type':'node'}, - # The second must be behind the first - {'name':'back node', 'type':'node'}, - # The third must be at the left of the first - {'name':'left node', 'type':'node'}, - ], + # This section is important. It helps to position the truck in space, by defining a local direction reference. For example this is used to measure the pitch and the roll of the truck. The three parameters are node numbers (defined in the next section). The first if the reference and may be anywhere, the second must be behind the first (if you look at the front of the truck, it is hidden behind the first), and the third must be at the left of the first (if you look to the right of the truck, it is hidden by the first) + 'cameras':[ + # The first if the reference and may be anywhere + {'name':'center node', 'type':'node'}, + # The second must be behind the first + {'name':'back node', 'type':'node'}, + # The third must be at the left of the first + {'name':'left node', 'type':'node'}, + ], - # With this section begins the structural description. Each line defines a node. The first parameter is the node number, and must absolutely be consecutive. The three following parameters are the x,y,z coordinates, in meter. You can attach an optional option to a node by adding a single character. Recognized options are: - 'nodes':[ - {'name':'id', 'type':'int'}, - {'name':'x', 'type':'float'}, - {'name':'y', 'type':'float'}, - {'name':'z', 'type':'float'}, - {'name':'options', 'type':'string', - 'required':False, - 'default':'n', - 'validvalues':[ - 'n', # normal node, nothing special - 'l', # this node bears a part of the cargo load - 'f', # this node has extra friction with the ground (usefull for feets) - 'x', # this node is the exhaust point (requires a "y" node) - 'y', # exhaust reference point, this point is at the opposite of the direction of the exhaust - 'c', # this node will not detect contact with ground (can be used for optimization, on inner chassis parts) - 'h', # this node is a hook point (e.g. the extremity of a crane) - 'e', # this node is a terrain editing point (used in the terrain editor truck) - 'b', # this node is assigned an extra buoyancy force (experimental) - ]}, - ], + # With this section begins the structural description. Each line defines a node. The first parameter is the node number, and must absolutely be consecutive. The three following parameters are the x,y,z coordinates, in meter. You can attach an optional option to a node by adding a single character. Recognized options are: + 'nodes':[ + {'name':'id', 'type':'int'}, + {'name':'x', 'type':'float'}, + {'name':'y', 'type':'float'}, + {'name':'z', 'type':'float'}, + {'name':'options', 'type':'string', + 'required':False, + 'default':'n', + 'validvalues':[ + 'n', # normal node, nothing special + 'l', # this node bears a part of the cargo load + 'f', # this node has extra friction with the ground (usefull for feets) + 'x', # this node is the exhaust point (requires a "y" node) + 'y', # exhaust reference point, this point is at the opposite of the direction of the exhaust + 'c', # this node will not detect contact with ground (can be used for optimization, on inner chassis parts) + 'h', # this node is a hook point (e.g. the extremity of a crane) + 'e', # this node is a terrain editing point (used in the terrain editor truck) + 'b', # this node is assigned an extra buoyancy force (experimental) + ]}, + ], - # Fixes are nodes that are fixed in place. That means that once put in place in the terrain, they will never move, whatever happens. This is usefull to make fixed scenery elements from beams, like bridges. Just add the node number that you want to fix. - 'fixes':[ - # node number that you want to fix. - {'name':'node', 'type':'node'}, - ], + # Fixes are nodes that are fixed in place. That means that once put in place in the terrain, they will never move, whatever happens. This is usefull to make fixed scenery elements from beams, like bridges. Just add the node number that you want to fix. + 'fixes':[ + # node number that you want to fix. + {'name':'node', 'type':'node'}, + ], - # This section defines all the beams connecting nodes. Each line describes a beam. The two first parameters are the node number of the two connected nodes. Order has no importance. There is an optional 3rd parameter, composed of a single character. - 'beams':[ - {'name':'first node', 'type':'node'}, - {'name':'second node', 'type':'node'}, - {'name':'options', 'type':'string', - 'required':False, - 'default':'n', - 'validvalues':[ - 'n', # visible, default - 'v', # visible, default - 'i', # this beam is invisible. Very usefull to hide "cheating" structural beam, or to improve performances once the truck is textured. - 'r', # this beam is a rope (opposes no force to compression) - ]} - ], + # This section defines all the beams connecting nodes. Each line describes a beam. The two first parameters are the node number of the two connected nodes. Order has no importance. There is an optional 3rd parameter, composed of a single character. + 'beams':[ + {'name':'first node', 'type':'node'}, + {'name':'second node', 'type':'node'}, + {'name':'options', 'type':'string', + 'required':False, + 'default':'n', + 'validvalues':[ + 'n', # visible, default + 'v', # visible, default + 'i', # this beam is invisible. Very usefull to hide "cheating" structural beam, or to improve performances once the truck is textured. + 'r', # this beam is a rope (opposes no force to compression) + ]} + ], - # Shocks can be seen as tunable beams, useful for suspensions. - 'shocks':[ - # the two nodes connected by the shock - {'name':'first node', 'type':'node'}, - {'name':'second node', 'type':'node'}, - # spring rate: the stiffness - {'name':'spring rate', 'type':'float'}, - # to adjust the amount of rebound: the best value is given by 2*sqrt(suspended mass*spring) - {'name':'dampening', 'type':'float'}, - # shortbound, longbound: defines the amount of deformation the shock can support (beyond, it becomes rigid as a standard beam) when shortened and lengthened - {'name':'shortbound', 'type':'float'}, - {'name':'longbound', 'type':'float'}, - # allows to compress or depress the suspension (leave it to 1.0 for most cases). - {'name':'precomp', 'type':'float'}, - # You can make the shocks stability-active with optional parameters: - {'name':'options', 'type':'string', - 'required':False, - 'default':None, - 'validvalues':[ - 'n', # normal - 'l', # to make a left-hand active shock - 'r', # to make a right-hand active shock - 'i', # to make the shock invisible (AVAILABLE FROM VERSION 0.29). - ]} - ], + # Shocks can be seen as tunable beams, useful for suspensions. + 'shocks':[ + # the two nodes connected by the shock + {'name':'first node', 'type':'node'}, + {'name':'second node', 'type':'node'}, + # spring rate: the stiffness + {'name':'spring rate', 'type':'float'}, + # to adjust the amount of rebound: the best value is given by 2*sqrt(suspended mass*spring) + {'name':'dampening', 'type':'float'}, + # shortbound, longbound: defines the amount of deformation the shock can support (beyond, it becomes rigid as a standard beam) when shortened and lengthened + {'name':'shortbound', 'type':'float'}, + {'name':'longbound', 'type':'float'}, + # allows to compress or depress the suspension (leave it to 1.0 for most cases). + {'name':'precomp', 'type':'float'}, + # You can make the shocks stability-active with optional parameters: + {'name':'options', 'type':'string', + 'required':False, + 'default':None, + 'validvalues':[ + 'n', # normal + 'l', # to make a left-hand active shock + 'r', # to make a right-hand active shock + 'i', # to make the shock invisible (AVAILABLE FROM VERSION 0.29). + ]} + ], - # The hydros section concerns only the direction actuactors! They are beams that changes of length depending on the direction command. - 'hydros':[ - # two node numbers - {'name':'first node', 'type':'node'}, - {'name':'second node', 'type':'node'}, - # lenghtening factor (negative or positive depending on wether you want to lenghten or shorten when turning left or the contrary) - {'name':'lenghtening factor', 'type':'float'}, - # optional flags - {'name':'options', 'type':'string', - 'required':False, - 'default':None, - 'validvalues':[ - 's', # WHAT IS THIS? - 'n', # normal - 'i', # make the hydro invisible. - ]} - ], + # The hydros section concerns only the direction actuactors! They are beams that changes of length depending on the direction command. + 'hydros':[ + # two node numbers + {'name':'first node', 'type':'node'}, + {'name':'second node', 'type':'node'}, + # lenghtening factor (negative or positive depending on wether you want to lenghten or shorten when turning left or the contrary) + {'name':'lenghtening factor', 'type':'float'}, + # optional flags + {'name':'options', 'type':'string', + 'required':False, + 'default':None, + 'validvalues':[ + 's', # WHAT IS THIS? + 'n', # normal + 'i', # make the hydro invisible. + ]} + ], - # The commands section describes the "real" hydros, those you command with the function keys. They are like beams, but their length varies depending with the function keys you press. - 'commands':[ - # two node numbers - {'name':'first node', 'type':'node'}, - {'name':'second node', 'type':'node'}, - # speed rate (how fast the hydro will change length) - {'name':'speed rate', 'type':'float'}, - # the shortest length (1.0 is the startup length) - {'name':'shortest length', 'type':'float'}, - # the longest length (1.0 is the startup length) - {'name':'longest length', 'type':'float'}, - # the number of the shortening function key (between 1 and 12) - {'name':'shortening key', 'type':'int'}, - # the number of the lengthtening function key (between 1 and 12) - {'name':'lengthtening key', 'type':'int'}, - # optional flags - {'name':'options', 'type':'string', - 'required':False, - 'default':None, - 'validvalues':[ - 'i', # make the hydro invisible. - 'r', # WHAT IS THIS - 'n', # WHAT IS THIS - 'v', # WHAT IS THIS - ]} - ], + # The commands section describes the "real" hydros, those you command with the function keys. They are like beams, but their length varies depending with the function keys you press. + 'commands':[ + # two node numbers + {'name':'first node', 'type':'node'}, + {'name':'second node', 'type':'node'}, + # speed rate (how fast the hydro will change length) + {'name':'speed rate', 'type':'float'}, + # the shortest length (1.0 is the startup length) + {'name':'shortest length', 'type':'float'}, + # the longest length (1.0 is the startup length) + {'name':'longest length', 'type':'float'}, + # the number of the shortening function key (between 1 and 12) + {'name':'shortening key', 'type':'int'}, + # the number of the lengthtening function key (between 1 and 12) + {'name':'lengthtening key', 'type':'int'}, + # optional flags + {'name':'options', 'type':'string', + 'required':False, + 'default':None, + 'validvalues':[ + 'i', # make the hydro invisible. + 'r', # WHAT IS THIS + 'n', # WHAT IS THIS + 'v', # WHAT IS THIS + ]} + ], - # Rotators are alternate commands(hydros) that allows you to do turntables, like in the base of a rotating crane. They use 10 reference nodes: and Then, in a similar way to commands, comes the , and the numbers of the left and right function keys. - 'rotators':[ - # 2 nodes to define the axis of rotation - {'name':'axis1 node', 'type':'node'}, - {'name':'axis2 node', 'type':'node'}, - # 4 nodes (must be a square, centered with the axis), to define the baseplate - {'name':'base1 node', 'type':'node'}, - {'name':'base2 node', 'type':'node'}, - {'name':'base3 node', 'type':'node'}, - {'name':'base4 node', 'type':'node'}, - # 4 nodes (again, a square, centered with the axis) to define the rotating plate. - {'name':'rotbase1 node', 'type':'node'}, - {'name':'rotbase2 node', 'type':'node'}, - {'name':'rotbase3 node', 'type':'node'}, - {'name':'rotbase4 node', 'type':'node'}, - # speed rate (how fast the hydro will change length) - {'name':'speed rate', 'type':'float'}, - # the number of the left key (between 1 and 12) - {'name':'left key', 'type':'int'}, - # the number of the right key (between 1 and 12) - {'name':'right key', 'type':'int'}, - ], + # Rotators are alternate commands(hydros) that allows you to do turntables, like in the base of a rotating crane. They use 10 reference nodes: and Then, in a similar way to commands, comes the , and the numbers of the left and right function keys. + 'rotators':[ + # 2 nodes to define the axis of rotation + {'name':'axis1 node', 'type':'node'}, + {'name':'axis2 node', 'type':'node'}, + # 4 nodes (must be a square, centered with the axis), to define the baseplate + {'name':'base1 node', 'type':'node'}, + {'name':'base2 node', 'type':'node'}, + {'name':'base3 node', 'type':'node'}, + {'name':'base4 node', 'type':'node'}, + # 4 nodes (again, a square, centered with the axis) to define the rotating plate. + {'name':'rotbase1 node', 'type':'node'}, + {'name':'rotbase2 node', 'type':'node'}, + {'name':'rotbase3 node', 'type':'node'}, + {'name':'rotbase4 node', 'type':'node'}, + # speed rate (how fast the hydro will change length) + {'name':'speed rate', 'type':'float'}, + # the number of the left key (between 1 and 12) + {'name':'left key', 'type':'int'}, + # the number of the right key (between 1 and 12) + {'name':'right key', 'type':'int'}, + ], - # The contacters section lists the nodes that may contact with cab triangle. This concerns only contacts with other trucks or loads. You can easily omit this section at first. - 'contacters':[ - #node that may contact with cab triangle - {'name':'node', 'type':'node'}, - ], + # The contacters section lists the nodes that may contact with cab triangle. This concerns only contacts with other trucks or loads. You can easily omit this section at first. + 'contacters':[ + #node that may contact with cab triangle + {'name':'node', 'type':'node'}, + ], - # The help section gives the name material used for the help panel on the dashboard. This material must be defined elsewhere in the MaterialFile. This is optional. - 'help':[ - {'name':'dashboard material', 'type':'string'}, - ], + # The help section gives the name material used for the help panel on the dashboard. This material must be defined elsewhere in the MaterialFile. This is optional. + 'help':[ + {'name':'dashboard material', 'type':'string'}, + ], - # Ropes are special beams that have no compression strength (they can shorten easily) but have standard extension strength, like a cable or a chain. They have also another particularity: the second node can "grab" the nearest reachable ropable node with the 'O' key. Standard use is to use a chassis node as the first node, and a "free" node as the second node (free as in not attached by any other beam). The best example of this are the chains of the multibennes truck. - 'ropes':[ - {'name':'first node', 'type':'node'}, - {'name':'second node', 'type':'node'}, - ], + # Ropes are special beams that have no compression strength (they can shorten easily) but have standard extension strength, like a cable or a chain. They have also another particularity: the second node can "grab" the nearest reachable ropable node with the 'O' key. Standard use is to use a chassis node as the first node, and a "free" node as the second node (free as in not attached by any other beam). The best example of this are the chains of the multibennes truck. + 'ropes':[ + {'name':'first node', 'type':'node'}, + {'name':'second node', 'type':'node'}, + ], - # Ties are also special beams that have no compression strength (they can shorten easily) but have standard extension strength, like a cable or a chain. As the Ropes, they grab the nearest reachable ropable node with the 'O' key. But there is a twist: unlike the ropes, they disappear when not attached (because they have no extremity node at rest) and they automatically shorten until the extension forces reaches a thresold. They are very usefull to solidly strap a load to a chassis. The parameters are the number of the root node (the starting point of the beam), the maximum reach length, the rate of auto-shortening, the shortest length possible, and the last parameter... well... is probably not very usefull and should be kept as 1.0... You can make a tie invisible with the "i" option. - 'ties':[ - {'name':'root node', 'type':'node'}, - {'name':'max len', 'type':'float'}, - {'name':'rate', 'type':'float'}, - {'name':'short', 'type':'float'}, - {'name':'long', 'type':'float'}, - {'name':'options', 'type':'string', - 'required':False, - 'default':None, - 'validvalues':[ - 'i', # make the hydro invisible. - ]}, - ], + # Ties are also special beams that have no compression strength (they can shorten easily) but have standard extension strength, like a cable or a chain. As the Ropes, they grab the nearest reachable ropable node with the 'O' key. But there is a twist: unlike the ropes, they disappear when not attached (because they have no extremity node at rest) and they automatically shorten until the extension forces reaches a thresold. They are very usefull to solidly strap a load to a chassis. The parameters are the number of the root node (the starting point of the beam), the maximum reach length, the rate of auto-shortening, the shortest length possible, and the last parameter... well... is probably not very usefull and should be kept as 1.0... You can make a tie invisible with the "i" option. + 'ties':[ + {'name':'root node', 'type':'node'}, + {'name':'max len', 'type':'float'}, + {'name':'rate', 'type':'float'}, + {'name':'short', 'type':'float'}, + {'name':'long', 'type':'float'}, + {'name':'options', 'type':'string', + 'required':False, + 'default':None, + 'validvalues':[ + 'i', # make the hydro invisible. + ]}, + ], - # This section lists the nodes that can be catched by ropes or ties. Good use is to define some ropable nodes at the front and back of the truck to allow towing the truck. - 'ropables':[ - {'name':'node', 'type':'node'}, - ], + # This section lists the nodes that can be catched by ropes or ties. Good use is to define some ropable nodes at the front and back of the truck to allow towing the truck. + 'ropables':[ + {'name':'node', 'type':'node'}, + ], - # This section is important, it defines the wheels! The order in which the wheel are declared is important: each consecutive pair of wheel is grouped into an axle. - 'wheels':[ - # radius (in meter) - {'name':'radius', 'type':'float'}, - # width (in meter) - {'name':'width', 'type':'float'}, - # number of rays - {'name':'raycount', 'type':'int'}, - # the numbers of two existing nodes that defines the wheel axis (the second node must have a larger Z coordinate than the first) - {'name':'node1', 'type':'node'}, - {'name':'node2', 'type':'node'}, - # the number of a special rigidity node (see explanation about Axle Rigidity) or 9999 if it is not used - {'name':'rigidity node', 'type':'node'}, - # is the wheel braked (1) or not (0) (for directional braking, as found in planes, use 2 for left wheel and 3 for right wheel) - {'name':'braked', 'type':'int'}, - # is the wheel propulsed (1) or not (0) - {'name':'propulsed', 'type':'int'}, - # the number of a reference arm node for this wheel. This is where reaction torque is applied to the chassis. Should be on the rotation axis of the suspension arm. - {'name':'arm node', 'type':'node'}, - # mass of the wheel (in kg) - {'name':'mass', 'type':'float'}, - # spring factor of the wheel : the stiffiness of the wheel - {'name':'spring', 'type':'float'}, - # damp factor : the reboundiness of the wheel - {'name':'damp', 'type':'float'}, - # face material and band material (and no quote between them) if you don't know, use "tracks/wheelface" for the face and "tracks/wheelband1" for single wheel or "tracks/wheelband2" for dual mounted wheels. - {'name':'material', 'type':'string'}, - ], + # This section is important, it defines the wheels! The order in which the wheel are declared is important: each consecutive pair of wheel is grouped into an axle. + 'wheels':[ + # radius (in meter) + {'name':'radius', 'type':'float'}, + # width (in meter) + {'name':'width', 'type':'float'}, + # number of rays + {'name':'raycount', 'type':'int'}, + # the numbers of two existing nodes that defines the wheel axis (the second node must have a larger Z coordinate than the first) + {'name':'node1', 'type':'node'}, + {'name':'node2', 'type':'node'}, + # the number of a special rigidity node (see explanation about Axle Rigidity) or 9999 if it is not used + {'name':'rigidity node', 'type':'node'}, + # is the wheel braked (1) or not (0) (for directional braking, as found in planes, use 2 for left wheel and 3 for right wheel) + {'name':'braked', 'type':'int'}, + # is the wheel propulsed (1) or not (0) + {'name':'propulsed', 'type':'int'}, + # the number of a reference arm node for this wheel. This is where reaction torque is applied to the chassis. Should be on the rotation axis of the suspension arm. + {'name':'arm node', 'type':'node'}, + # mass of the wheel (in kg) + {'name':'mass', 'type':'float'}, + # spring factor of the wheel : the stiffiness of the wheel + {'name':'spring', 'type':'float'}, + # damp factor : the reboundiness of the wheel + {'name':'damp', 'type':'float'}, + # face material and band material (and no quote between them) if you don't know, use "tracks/wheelface" for the face and "tracks/wheelband1" for single wheel or "tracks/wheelband2" for dual mounted wheels. + {'name':'material', 'type':'string'}, + ], - # This define the position of the in-truck cam. It is a special node suspended to eight chassis nodes. The parameters are the 3 coordinates of the point and the 8 nodes numbers to which it is binded. - 'cinecam':[ - {'name':'x', 'type':'float'}, - {'name':'y', 'type':'float'}, - {'name':'z', 'type':'float'}, - {'name':'node1', 'type':'node'}, - {'name':'node2', 'type':'node'}, - {'name':'node3', 'type':'node'}, - {'name':'node4', 'type':'node'}, - {'name':'node5', 'type':'node'}, - {'name':'node6', 'type':'node'}, - {'name':'node7', 'type':'node'}, - {'name':'node8', 'type':'node'}, - ], + # This define the position of the in-truck cam. It is a special node suspended to eight chassis nodes. The parameters are the 3 coordinates of the point and the 8 nodes numbers to which it is binded. + 'cinecam':[ + {'name':'x', 'type':'float'}, + {'name':'y', 'type':'float'}, + {'name':'z', 'type':'float'}, + {'name':'node1', 'type':'node'}, + {'name':'node2', 'type':'node'}, + {'name':'node3', 'type':'node'}, + {'name':'node4', 'type':'node'}, + {'name':'node5', 'type':'node'}, + {'name':'node6', 'type':'node'}, + {'name':'node7', 'type':'node'}, + {'name':'node8', 'type':'node'}, + ], - # This defines where the light flares will be. It is positionned relative to 3 nodes of the chassis. One node is the reference node, and the two others define a base (x,y). So the flare is in the plane defined by the 3 nodes, and is placed relative to the reference node by adding a fraction of the vectors ref->x and ref->y. The three first parameters are the 3 nodes numbers (rex,x,y) and the two next gives what amount of ref->x and ref->y to add to displace the flare point (these two should be logically between 0 and 1, or else that means you use the wrong base triangle and if the body flexes too much the flare will not stick to the body correctly). - 'flares':[ - {'name':'ref node', 'type':'node'}, - {'name':'x node', 'type':'node'}, - {'name':'y node', 'type':'node'}, - {'name':'offsetx', 'type':'float'}, - {'name':'offsety', 'type':'float'}, - ], + # This defines where the light flares will be. It is positionned relative to 3 nodes of the chassis. One node is the reference node, and the two others define a base (x,y). So the flare is in the plane defined by the 3 nodes, and is placed relative to the reference node by adding a fraction of the vectors ref->x and ref->y. The three first parameters are the 3 nodes numbers (rex,x,y) and the two next gives what amount of ref->x and ref->y to add to displace the flare point (these two should be logically between 0 and 1, or else that means you use the wrong base triangle and if the body flexes too much the flare will not stick to the body correctly). + 'flares':[ + {'name':'ref node', 'type':'node'}, + {'name':'x node', 'type':'node'}, + {'name':'y node', 'type':'node'}, + {'name':'offsetx', 'type':'float'}, + {'name':'offsety', 'type':'float'}, + ], - #This allows you to "stick" any 3D mesh to a triangle of points of a truck. You can use it to stick air intakes, horns, seats, dashboard, bumbers, whatever to the truck (note that there will be no collision detection of these objects). They work the same way as the flares. It is positionned relative to 3 nodes of the chassis. One node is the reference node, and the two others define a base (x,y). So the prop is positionned relative to the plane defined by the 3 nodes, and is placed relative to the reference node by adding a fraction of the vectors ref->x and ref->y. Additionnally, you can displace the prop along the normal to the plane. The three first parameters are the 3 nodes numbers (rex,x,y) and the three next gives what amount of ref->x, ref->y and normal to add to displace the prop (the first two should be logically between 0 and 1, or else that means you use the wrong base triangle and if the body flexes too much the flare will not stick to the body correctly, the third is normalized, in meter). The next 3 parameters are rotation angles to apply to the mesh (in each 3 axis), and the last is the name of an Ogre3D mesh object. Note that meshes with the name beginning with "dashboard", "leftmirror", "rightmirror", "seat", "beacon", "pale" and "spinprop" are reserved as they employ some magic to work. The first "seat" mesh is made translucent, so it should be the driver's seat. - 'props':[ - {'name':'ref node', 'type':'node'}, - {'name':'x node', 'type':'node'}, - {'name':'y node', 'type':'node'}, - {'name':'offsetx', 'type':'float'}, - {'name':'offsety', 'type':'float'}, - {'name':'offsetz', 'type':'float'}, - {'name':'rotx', 'type':'float'}, - {'name':'roty', 'type':'float'}, - {'name':'rotz', 'type':'float'}, - {'name':'mesh', 'type':'string'}, - ], + #This allows you to "stick" any 3D mesh to a triangle of points of a truck. You can use it to stick air intakes, horns, seats, dashboard, bumbers, whatever to the truck (note that there will be no collision detection of these objects). They work the same way as the flares. It is positionned relative to 3 nodes of the chassis. One node is the reference node, and the two others define a base (x,y). So the prop is positionned relative to the plane defined by the 3 nodes, and is placed relative to the reference node by adding a fraction of the vectors ref->x and ref->y. Additionnally, you can displace the prop along the normal to the plane. The three first parameters are the 3 nodes numbers (rex,x,y) and the three next gives what amount of ref->x, ref->y and normal to add to displace the prop (the first two should be logically between 0 and 1, or else that means you use the wrong base triangle and if the body flexes too much the flare will not stick to the body correctly, the third is normalized, in meter). The next 3 parameters are rotation angles to apply to the mesh (in each 3 axis), and the last is the name of an Ogre3D mesh object. Note that meshes with the name beginning with "dashboard", "leftmirror", "rightmirror", "seat", "beacon", "pale" and "spinprop" are reserved as they employ some magic to work. The first "seat" mesh is made translucent, so it should be the driver's seat. + 'props':[ + {'name':'ref node', 'type':'node'}, + {'name':'x node', 'type':'node'}, + {'name':'y node', 'type':'node'}, + {'name':'offsetx', 'type':'float'}, + {'name':'offsety', 'type':'float'}, + {'name':'offsetz', 'type':'float'}, + {'name':'rotx', 'type':'float'}, + {'name':'roty', 'type':'float'}, + {'name':'rotz', 'type':'float'}, + {'name':'mesh', 'type':'string'}, + ], - #This last part defines the most visible part of the truck: the body. It will dress the chassis with solid triangles. You must define each body panel (a continuous almost-flat section) in a different submesh section, in order to have sharp body angles, and to simplify texturing. A submesh has two subsection: the texcoords, that places nodes of the submesh on the texture image (coordinates between 0.0 and 1.0) , and then the cab subsection, that draws the triangles, with triplets of node numbers. The nodes used in the cab subsection must be present in the texcoord subsection. The order in which the three points forming the triangles is given is important, as its winding defines in which direction it will be visible. The winding must be counterclockwise to be visible (IIRC). There is an optional flag to the cab subsection: if you add "c" to the triangle, this triangle will be a contact triangle, that can contact with contacters nodes. mcreed has contributed a cool Texturing Tutorial that describes how to fill the submesh and cab parts of the truck file. When the tag "backmesh" is added, the triangles backsides of the submesh will be black instead of see-through. - 'submesh':[ - {'name':'groupno', 'type':'int'}, - ], - 'texcoords':[ - {'name':'node', 'type':'node'}, - {'name':'u', 'type':'float'}, - {'name':'v', 'type':'float'}, - ], - 'cab':[ - {'name':'node1', 'type':'node'}, - {'name':'node2', 'type':'node'}, - {'name':'node3', 'type':'node'}, - {'name':'options', 'type':'string', - 'required':False, - 'default':None, - 'validvalues':[ - 'c', # triangle will be a contact triangle - 'n', # normal - 'b', # buoy - 'D', # WHAT IS THIS? - ]}, - ], + #This last part defines the most visible part of the truck: the body. It will dress the chassis with solid triangles. You must define each body panel (a continuous almost-flat section) in a different submesh section, in order to have sharp body angles, and to simplify texturing. A submesh has two subsection: the texcoords, that places nodes of the submesh on the texture image (coordinates between 0.0 and 1.0) , and then the cab subsection, that draws the triangles, with triplets of node numbers. The nodes used in the cab subsection must be present in the texcoord subsection. The order in which the three points forming the triangles is given is important, as its winding defines in which direction it will be visible. The winding must be counterclockwise to be visible (IIRC). There is an optional flag to the cab subsection: if you add "c" to the triangle, this triangle will be a contact triangle, that can contact with contacters nodes. mcreed has contributed a cool Texturing Tutorial that describes how to fill the submesh and cab parts of the truck file. When the tag "backmesh" is added, the triangles backsides of the submesh will be black instead of see-through. + 'submesh':[ + {'name':'groupno', 'type':'int'}, + ], + 'texcoords':[ + {'name':'node', 'type':'node'}, + {'name':'u', 'type':'float'}, + {'name':'v', 'type':'float'}, + ], + 'cab':[ + {'name':'node1', 'type':'node'}, + {'name':'node2', 'type':'node'}, + {'name':'node3', 'type':'node'}, + {'name':'options', 'type':'string', + 'required':False, + 'default':None, + 'validvalues':[ + 'c', # triangle will be a contact triangle + 'n', # normal + 'b', # buoy + 'D', # WHAT IS THIS? + ]}, + ], - # This section declares parts of the chassis as wings, and that they should bear aerodynamic forces. Each line of this section designs a wing segment, that is a homogeneous part of a wing. You can (and you should!) make a plane's wing from several contiguous wing segments. Rudder and elevators are also made with one or more wing segments. Each wing segment is bounded by 8 nodes, that defines the "bounding box" of the wing, specifically its span, chord and thickness. You must ensure that these nodes are properly interconnected by beams to ensure the structural integrity of the wing. Notice that it is VERY IMPORTANT to declare contiguous wing segments (i.e. that shares nodes) IN SEQUENTIAL ORDER FROM RIGHT TO LEFT, and you should avoid cutting a wing in two at the fuselage, but make the whole wing continuous across the fuselage because it helps to compute whole-wing effects like induced drag and other things like wing lights. A very important aerodynamic parameter is the wing airfoil. The airfoil is the tear-like shape of the wing, and its exact geometry is very important for the characteristics and performances of real-world wings. RoR uses precomputed performances curves from standard airfoils, interpolated from wing tunnel tests. These curves are stored in .afl files. Standard aifoils provided in RoR are: - 'wings':[ - # Front left down node number - {'name':'front left down node', 'type':'node'}, - # Front right down node number - {'name':'front right down node', 'type':'node'}, - # Front left up node number - {'name':'front left up node', 'type':'node'}, - # Front right up node number - {'name':'front right up node', 'type':'node'}, - # Back left down node number - {'name':'back left down node', 'type':'node'}, - # Back right down node number - {'name':'back right down node', 'type':'node'}, - # Back left up node number - {'name':'back left up node', 'type':'node'}, - # Back right up node number - {'name':'back right up node', 'type':'node'}, - # Texture X coordinate of the front left of the wing (in the texture defined in "globals") - {'name':'texture x front left', 'type':'float'}, - # Texture Y coordinate of the front left of the wing (in the texture defined in "globals") - {'name':'texture y front left', 'type':'float'}, - # Texture X coordinate of the front right of the wing (in the texture defined in "globals") - {'name':'texture x front right', 'type':'float'}, - # Texture Y coordinate of the front right of the wing (in the texture defined in "globals") - {'name':'texture y front right', 'type':'float'}, - # Texture X coordinate of the back left of the wing (in the texture defined in "globals") - {'name':'texture x back left', 'type':'float'}, - # Texture Y coordinate of the back left of the wing (in the texture defined in "globals") - {'name':'texture y back left', 'type':'float'}, - # Texture X coordinate of the back right of the wing (in the texture defined in "globals") - {'name':'texture x back right', 'type':'float'}, - # Texture Y coordinate of the back right of the wing (in the texture defined in "globals") - {'name':'texture y back right', 'type':'float'}, - # Type of control surface: 'n'=none, 'a'=right aileron, 'b'=left aileron, 'f'=flap, 'e'=elevator, 'r'=rudder - {'name':'controltype', 'type':'string', - 'default':'n', - 'validvalues':[ - 'n', # none - 'a', # right aileron - 'b', # left aileron - 'f', # flap - 'e', # elevator - 'r', # rudder - ]}, - # Relative chord point at which st... [truncated message content] |
From: <ror...@us...> - 2008-03-12 23:28:58
|
Revision: 193 http://roreditor.svn.sourceforge.net/roreditor/?rev=193&view=rev Author: rorthomas Date: 2008-03-12 16:28:56 -0700 (Wed, 12 Mar 2008) Log Message: ----------- added forgotten files Modified Paths: -------------- trunk/lib_common/ror/odefparser.py trunk/lib_common/ror/rorcommon.py trunk/lib_common/ror/terrainparser.py Added Paths: ----------- trunk/lib_windows/ogre/addons/ trunk/lib_windows/ogre/addons/__init__.py trunk/lib_windows/ogre/addons/cadunetree/ trunk/lib_windows/ogre/addons/cadunetree/__init__.py trunk/lib_windows/ogre/addons/cadunetree/_cadunetree_.pyd trunk/lib_windows/ogre/addons/caelum/ trunk/lib_windows/ogre/addons/caelum/__init__.py trunk/lib_windows/ogre/addons/caelum/_caelum_.pyd trunk/lib_windows/ogre/addons/et/ trunk/lib_windows/ogre/addons/et/__init__.py trunk/lib_windows/ogre/addons/et/_et_.pyd trunk/lib_windows/ogre/addons/noise/ trunk/lib_windows/ogre/addons/noise/__init__.py trunk/lib_windows/ogre/addons/noise/_noise_.pyd trunk/lib_windows/ogre/addons/ofusion/ trunk/lib_windows/ogre/addons/ofusion/__init__.py trunk/lib_windows/ogre/addons/ofusion/_ofusion_.pyd trunk/lib_windows/ogre/addons/ogredshow/ trunk/lib_windows/ogre/addons/ogredshow/__init__.py trunk/lib_windows/ogre/addons/ogreforests/ trunk/lib_windows/ogre/addons/ogreforests/__init__.py trunk/lib_windows/ogre/addons/ogreforests/_ogreforests_.pyd trunk/lib_windows/ogre/addons/ogrevideoffmpeg/ trunk/lib_windows/ogre/addons/ogrevideoffmpeg/__init__.py trunk/lib_windows/ogre/addons/ogrevideoffmpeg/_ogrevideoffmpeg_.pyd trunk/lib_windows/ogre/addons/ogrevideoffmpeg/avcodec-51.dll trunk/lib_windows/ogre/addons/ogrevideoffmpeg/avcodec.dll trunk/lib_windows/ogre/addons/ogrevideoffmpeg/avdevice-52.dll trunk/lib_windows/ogre/addons/ogrevideoffmpeg/avdevice.dll trunk/lib_windows/ogre/addons/ogrevideoffmpeg/avformat-52.dll trunk/lib_windows/ogre/addons/ogrevideoffmpeg/avformat.dll trunk/lib_windows/ogre/addons/ogrevideoffmpeg/avutil-49.dll trunk/lib_windows/ogre/addons/ogrevideoffmpeg/avutil.dll trunk/lib_windows/ogre/addons/opensteer/ trunk/lib_windows/ogre/addons/opensteer/__init__.py trunk/lib_windows/ogre/addons/particleuniverse/ trunk/lib_windows/ogre/addons/particleuniverse/__init__.py trunk/lib_windows/ogre/addons/particleuniverse/_particleuniverse_.pyd trunk/lib_windows/ogre/addons/plib/ trunk/lib_windows/ogre/addons/plib/__init__.py trunk/lib_windows/ogre/addons/plib/_plib_.pyd trunk/lib_windows/ogre/addons/plib/boost_python-vc80-mt-1_35.dll trunk/lib_windows/ogre/addons/theora/ trunk/lib_windows/ogre/addons/theora/OAL_MOD.dll trunk/lib_windows/ogre/addons/theora/__init__.py trunk/lib_windows/ogre/addons/theora/_theora_.pyd trunk/lib_windows/ogre/addons/watermesh/ trunk/lib_windows/ogre/addons/watermesh/__init__.py trunk/lib_windows/ogre/addons/watermesh/_watermesh_.pyd trunk/lib_windows/ogre/gui/CEGUI/CEGUITinyXMLParser.dll trunk/lib_windows/ogre/gui/QuickGUI/ trunk/lib_windows/ogre/gui/QuickGUI/QuickGUI.dll trunk/lib_windows/ogre/gui/QuickGUI/__init__.py trunk/lib_windows/ogre/gui/QuickGUI/_quickgui_.pyd trunk/lib_windows/ogre/gui/betagui/ trunk/lib_windows/ogre/gui/betagui/__init__.py trunk/lib_windows/ogre/gui/betagui/_betagui_.pyd trunk/lib_windows/ogre/gui/navi/ trunk/lib_windows/ogre/gui/navi/__init__.py trunk/lib_windows/ogre/gui/navi/_navi_.pyd trunk/lib_windows/ogre/gui/navi/js3250.dll trunk/lib_windows/ogre/gui/navi/nspr4.dll trunk/lib_windows/ogre/gui/navi/plc4.dll trunk/lib_windows/ogre/gui/navi/plds4.dll trunk/lib_windows/ogre/gui/navi/xpcom.dll trunk/lib_windows/ogre/gui/navi/xul.dll trunk/lib_windows/ogre/io/OIS/__init__.pyc trunk/lib_windows/ogre/io/OIS/__init__.pyo trunk/lib_windows/ogre/io/__init__.pyc trunk/lib_windows/ogre/io/__init__.pyo trunk/lib_windows/ogre/physics/NxOgre/ trunk/lib_windows/ogre/physics/NxOgre/__init__.py trunk/lib_windows/ogre/physics/NxOgre_09/ trunk/lib_windows/ogre/physics/NxOgre_09/NxCharacter.dll trunk/lib_windows/ogre/physics/NxOgre_09/NxCooking.dll trunk/lib_windows/ogre/physics/NxOgre_09/NxExtensions.dll trunk/lib_windows/ogre/physics/NxOgre_09/__init__.py trunk/lib_windows/ogre/physics/NxOgre_09/_nxogre_09_.pyd trunk/lib_windows/ogre/physics/ODE/boost_python-vc80-mt-1_35.dll trunk/lib_windows/ogre/physics/OgreBulletC/ trunk/lib_windows/ogre/physics/OgreBulletC/__init__.py trunk/lib_windows/ogre/physics/OgreBulletC/_ogrebulletc_.pyd trunk/lib_windows/ogre/physics/OgreBulletD/ trunk/lib_windows/ogre/physics/OgreBulletD/__init__.py trunk/lib_windows/ogre/physics/OgreBulletD/_ogrebulletd_.pyd trunk/lib_windows/ogre/physics/OgreNewt/__init__.pyc trunk/lib_windows/ogre/physics/OgreNewt/__init__.pyo trunk/lib_windows/ogre/physics/Opcode/ trunk/lib_windows/ogre/physics/Opcode/__init__.py trunk/lib_windows/ogre/physics/Opcode/_opcode_.pyd trunk/lib_windows/ogre/physics/PhysX/ trunk/lib_windows/ogre/physics/PhysX/NxCharacter.dll trunk/lib_windows/ogre/physics/PhysX/NxCooking.dll trunk/lib_windows/ogre/physics/PhysX/NxExtensions.dll trunk/lib_windows/ogre/physics/PhysX/PhysXLoader.dll trunk/lib_windows/ogre/physics/PhysX/__init__.py trunk/lib_windows/ogre/physics/PhysX/_physx_.pyd trunk/lib_windows/ogre/physics/__init__.pyc trunk/lib_windows/ogre/physics/__init__.pyo trunk/lib_windows/ogre/physics/bullet/ trunk/lib_windows/ogre/physics/bullet/__init__.py trunk/lib_windows/ogre/physics/bullet/_bullet_.pyd trunk/lib_windows/ogre/renderer/OGRE/__init__.pyc trunk/lib_windows/ogre/renderer/OGRE/__init__.pyo trunk/lib_windows/ogre/renderer/OGRE/_ogre_exceptions_.pyc trunk/lib_windows/ogre/renderer/OGRE/_ogre_exceptions_.pyo trunk/lib_windows/ogre/renderer/OGRE/boost_python-vc80-mt-1_35.dll trunk/lib_windows/ogre/renderer/OGREdshow/ trunk/lib_windows/ogre/renderer/OGREdshow/__init__.py trunk/lib_windows/ogre/renderer/__init__.pyc trunk/lib_windows/ogre/renderer/__init__.pyo trunk/lib_windows/ogre/sound/OgreAL/vorbisenc.dll trunk/lib_windows/psyco/__init__.pyc trunk/lib_windows/psyco/__init__.pyo trunk/lib_windows/psyco/core.pyc trunk/lib_windows/psyco/core.pyo trunk/lib_windows/psyco/kdictproxy.pyc trunk/lib_windows/psyco/kdictproxy.pyo trunk/lib_windows/psyco/profiler.pyc trunk/lib_windows/psyco/profiler.pyo trunk/lib_windows/psyco/support.pyc trunk/lib_windows/psyco/support.pyo trunk/lib_windows/pydot.pyc trunk/lib_windows/pysvn/__init__.pyc trunk/lib_windows/pysvn/__init__.pyo trunk/lib_windows/wx/__init__.pyc trunk/lib_windows/wx/__init__.pyo trunk/lib_windows/wx/__version__.pyc trunk/lib_windows/wx/__version__.pyo trunk/lib_windows/wx/_controls.pyc trunk/lib_windows/wx/_controls.pyo trunk/lib_windows/wx/_core.pyc trunk/lib_windows/wx/_core.pyo trunk/lib_windows/wx/_gdi.pyc trunk/lib_windows/wx/_gdi.pyo trunk/lib_windows/wx/_misc.pyc trunk/lib_windows/wx/_misc.pyo trunk/lib_windows/wx/_windows.pyc trunk/lib_windows/wx/_windows.pyo trunk/lib_windows/wx/aui.pyc trunk/lib_windows/wx/aui.pyo trunk/lib_windows/wx/grid.pyc trunk/lib_windows/wx/grid.pyo trunk/lib_windows/wx/html.pyc trunk/lib_windows/wx/html.pyo trunk/windows/ParticleUniverse.dll trunk/windows/Plugin_PagingLandScapeSceneManager2.dll trunk/windows/Plugin_TheoraVideoSystem.dll Modified: trunk/lib_common/ror/odefparser.py =================================================================== --- trunk/lib_common/ror/odefparser.py 2008-03-12 23:21:05 UTC (rev 192) +++ trunk/lib_common/ror/odefparser.py 2008-03-12 23:28:56 UTC (rev 193) @@ -2,6 +2,7 @@ import ogre.renderer.OGRE as ogre from ror.logger import log from ror.settingsManager import getSettingsManager +from ror.rorcommon import * def loadOdef_old(odefFilename): f=open(odefFilename, 'r') @@ -36,25 +37,9 @@ s += " rotation: " + str(self.rotation) return s -def loadOdefContent(filename): - content = [] - ds=ogre.ResourceGroupManager.getSingleton().openResource(filename, "General"); - ec=0 - while True: - line = copy.copy(ds.getLine()) - #print line, ec - if line.strip() == "": - ec+=1 - if ec > 50: - break - content.append(line) - #ds.close() - return content - - def loadOdef(odefFilename): try: - content = loadOdefContent(os.path.basename(odefFilename)) + content = loadResourceFile(os.path.basename(odefFilename)) ismovable = False meshname = content[0].strip() scalearr = [1,1,1] Modified: trunk/lib_common/ror/rorcommon.py =================================================================== --- trunk/lib_common/ror/rorcommon.py 2008-03-12 23:21:05 UTC (rev 192) +++ trunk/lib_common/ror/rorcommon.py 2008-03-12 23:28:56 UTC (rev 193) @@ -95,6 +95,21 @@ ogre.ResourceGroupManager.getSingleton().initialiseAllResourceGroups() +def loadResourceFile(filename): + content = [] + ds=ogre.ResourceGroupManager.getSingleton().openResource(filename, "General"); + ec=0 + while True: + line = copy.copy(ds.getLine()) + #print line, ec + if line.strip() == "": + ec+=1 + if ec > 50: + break + content.append(line) + #ds.close() + return content + def getPlatform(): if sys.platform in ['linux', 'linux2']: return 'linux' Modified: trunk/lib_common/ror/terrainparser.py =================================================================== --- trunk/lib_common/ror/terrainparser.py 2008-03-12 23:21:05 UTC (rev 192) +++ trunk/lib_common/ror/terrainparser.py 2008-03-12 23:28:56 UTC (rev 193) @@ -3,6 +3,7 @@ import ogre.renderer.OGRE as ogre from logger import log from settingsManager import getSettingsManager +from ror.rorcommon import * class Object: x = None @@ -54,24 +55,10 @@ f.writelines(lines) f.close() - def loadFile(self,filename): - content = [] - ds=ogre.ResourceGroupManager.getSingleton().openResource(filename, "General"); - ec=0 - while True: - line = copy.copy(ds.getLine()) - #print line, ec - if line.strip() == "": - ec+=1 - if ec > 50: - break - content.append(line) - #ds.close() - return content - + def __init__(self, filename): self.filename = filename - content = self.loadFile(filename) + content = loadResourceFile(filename) self.trucks = [] self.loads = [] self.objects = [] Added: trunk/lib_windows/ogre/addons/__init__.py =================================================================== --- trunk/lib_windows/ogre/addons/__init__.py (rev 0) +++ trunk/lib_windows/ogre/addons/__init__.py 2008-03-12 23:28:56 UTC (rev 193) @@ -0,0 +1 @@ +#keep me \ No newline at end of file Added: trunk/lib_windows/ogre/addons/cadunetree/__init__.py =================================================================== --- trunk/lib_windows/ogre/addons/cadunetree/__init__.py (rev 0) +++ trunk/lib_windows/ogre/addons/cadunetree/__init__.py 2008-03-12 23:28:56 UTC (rev 193) @@ -0,0 +1 @@ +from _cadunetree_ import * Added: trunk/lib_windows/ogre/addons/cadunetree/_cadunetree_.pyd =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/addons/cadunetree/_cadunetree_.pyd ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/addons/caelum/__init__.py =================================================================== --- trunk/lib_windows/ogre/addons/caelum/__init__.py (rev 0) +++ trunk/lib_windows/ogre/addons/caelum/__init__.py 2008-03-12 23:28:56 UTC (rev 193) @@ -0,0 +1 @@ +from _caelum_ import * Added: trunk/lib_windows/ogre/addons/caelum/_caelum_.pyd =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/addons/caelum/_caelum_.pyd ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/addons/et/__init__.py =================================================================== --- trunk/lib_windows/ogre/addons/et/__init__.py (rev 0) +++ trunk/lib_windows/ogre/addons/et/__init__.py 2008-03-12 23:28:56 UTC (rev 193) @@ -0,0 +1 @@ +from _et_ import * Added: trunk/lib_windows/ogre/addons/et/_et_.pyd =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/addons/et/_et_.pyd ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/addons/noise/__init__.py =================================================================== --- trunk/lib_windows/ogre/addons/noise/__init__.py (rev 0) +++ trunk/lib_windows/ogre/addons/noise/__init__.py 2008-03-12 23:28:56 UTC (rev 193) @@ -0,0 +1 @@ +from _noise_ import * Added: trunk/lib_windows/ogre/addons/noise/_noise_.pyd =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/addons/noise/_noise_.pyd ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/addons/ofusion/__init__.py =================================================================== --- trunk/lib_windows/ogre/addons/ofusion/__init__.py (rev 0) +++ trunk/lib_windows/ogre/addons/ofusion/__init__.py 2008-03-12 23:28:56 UTC (rev 193) @@ -0,0 +1 @@ +from _ofusion_ import * Added: trunk/lib_windows/ogre/addons/ofusion/_ofusion_.pyd =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/addons/ofusion/_ofusion_.pyd ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/addons/ogredshow/__init__.py =================================================================== --- trunk/lib_windows/ogre/addons/ogredshow/__init__.py (rev 0) +++ trunk/lib_windows/ogre/addons/ogredshow/__init__.py 2008-03-12 23:28:56 UTC (rev 193) @@ -0,0 +1 @@ +from _ogredshow_ import * Added: trunk/lib_windows/ogre/addons/ogreforests/__init__.py =================================================================== --- trunk/lib_windows/ogre/addons/ogreforests/__init__.py (rev 0) +++ trunk/lib_windows/ogre/addons/ogreforests/__init__.py 2008-03-12 23:28:56 UTC (rev 193) @@ -0,0 +1 @@ +from _ogreforests_ import * Added: trunk/lib_windows/ogre/addons/ogreforests/_ogreforests_.pyd =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/addons/ogreforests/_ogreforests_.pyd ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/addons/ogrevideoffmpeg/__init__.py =================================================================== --- trunk/lib_windows/ogre/addons/ogrevideoffmpeg/__init__.py (rev 0) +++ trunk/lib_windows/ogre/addons/ogrevideoffmpeg/__init__.py 2008-03-12 23:28:56 UTC (rev 193) @@ -0,0 +1 @@ +from _ogrevideoffmpeg_ import * \ No newline at end of file Added: trunk/lib_windows/ogre/addons/ogrevideoffmpeg/_ogrevideoffmpeg_.pyd =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/addons/ogrevideoffmpeg/_ogrevideoffmpeg_.pyd ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/addons/ogrevideoffmpeg/avcodec-51.dll =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/addons/ogrevideoffmpeg/avcodec-51.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/addons/ogrevideoffmpeg/avcodec.dll =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/addons/ogrevideoffmpeg/avcodec.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/addons/ogrevideoffmpeg/avdevice-52.dll =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/addons/ogrevideoffmpeg/avdevice-52.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/addons/ogrevideoffmpeg/avdevice.dll =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/addons/ogrevideoffmpeg/avdevice.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/addons/ogrevideoffmpeg/avformat-52.dll =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/addons/ogrevideoffmpeg/avformat-52.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/addons/ogrevideoffmpeg/avformat.dll =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/addons/ogrevideoffmpeg/avformat.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/addons/ogrevideoffmpeg/avutil-49.dll =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/addons/ogrevideoffmpeg/avutil-49.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/addons/ogrevideoffmpeg/avutil.dll =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/addons/ogrevideoffmpeg/avutil.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/addons/opensteer/__init__.py =================================================================== --- trunk/lib_windows/ogre/addons/opensteer/__init__.py (rev 0) +++ trunk/lib_windows/ogre/addons/opensteer/__init__.py 2008-03-12 23:28:56 UTC (rev 193) @@ -0,0 +1 @@ +from _opensteer_ import * Added: trunk/lib_windows/ogre/addons/particleuniverse/__init__.py =================================================================== --- trunk/lib_windows/ogre/addons/particleuniverse/__init__.py (rev 0) +++ trunk/lib_windows/ogre/addons/particleuniverse/__init__.py 2008-03-12 23:28:56 UTC (rev 193) @@ -0,0 +1 @@ +from _particleuniverse_ import * Added: trunk/lib_windows/ogre/addons/particleuniverse/_particleuniverse_.pyd =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/addons/particleuniverse/_particleuniverse_.pyd ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/addons/plib/__init__.py =================================================================== --- trunk/lib_windows/ogre/addons/plib/__init__.py (rev 0) +++ trunk/lib_windows/ogre/addons/plib/__init__.py 2008-03-12 23:28:56 UTC (rev 193) @@ -0,0 +1,2 @@ +import sys, os +from _plib_ import * Added: trunk/lib_windows/ogre/addons/plib/_plib_.pyd =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/addons/plib/_plib_.pyd ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/addons/plib/boost_python-vc80-mt-1_35.dll =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/addons/plib/boost_python-vc80-mt-1_35.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/addons/theora/OAL_MOD.dll =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/addons/theora/OAL_MOD.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/addons/theora/__init__.py =================================================================== --- trunk/lib_windows/ogre/addons/theora/__init__.py (rev 0) +++ trunk/lib_windows/ogre/addons/theora/__init__.py 2008-03-12 23:28:56 UTC (rev 193) @@ -0,0 +1 @@ +from _theora_ import * \ No newline at end of file Added: trunk/lib_windows/ogre/addons/theora/_theora_.pyd =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/addons/theora/_theora_.pyd ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/addons/watermesh/__init__.py =================================================================== --- trunk/lib_windows/ogre/addons/watermesh/__init__.py (rev 0) +++ trunk/lib_windows/ogre/addons/watermesh/__init__.py 2008-03-12 23:28:56 UTC (rev 193) @@ -0,0 +1 @@ +from _watermesh_ import * Added: trunk/lib_windows/ogre/addons/watermesh/_watermesh_.pyd =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/addons/watermesh/_watermesh_.pyd ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/gui/CEGUI/CEGUITinyXMLParser.dll =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/gui/CEGUI/CEGUITinyXMLParser.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/gui/QuickGUI/QuickGUI.dll =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/gui/QuickGUI/QuickGUI.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/gui/QuickGUI/__init__.py =================================================================== --- trunk/lib_windows/ogre/gui/QuickGUI/__init__.py (rev 0) +++ trunk/lib_windows/ogre/gui/QuickGUI/__init__.py 2008-03-12 23:28:56 UTC (rev 193) @@ -0,0 +1,5 @@ +import sys, os +import warnings +warnings.simplefilter('ignore', RuntimeWarning) +from _quickgui_ import * +warnings.resetwarnings( ) Added: trunk/lib_windows/ogre/gui/QuickGUI/_quickgui_.pyd =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/gui/QuickGUI/_quickgui_.pyd ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/gui/betagui/__init__.py =================================================================== --- trunk/lib_windows/ogre/gui/betagui/__init__.py (rev 0) +++ trunk/lib_windows/ogre/gui/betagui/__init__.py 2008-03-12 23:28:56 UTC (rev 193) @@ -0,0 +1,4 @@ +import warnings +warnings.simplefilter('ignore', RuntimeWarning) +from _betagui_ import * +warnings.resetwarnings( ) Added: trunk/lib_windows/ogre/gui/betagui/_betagui_.pyd =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/gui/betagui/_betagui_.pyd ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/gui/navi/__init__.py =================================================================== --- trunk/lib_windows/ogre/gui/navi/__init__.py (rev 0) +++ trunk/lib_windows/ogre/gui/navi/__init__.py 2008-03-12 23:28:56 UTC (rev 193) @@ -0,0 +1,2 @@ +import sys, os +from _navi_ import * Added: trunk/lib_windows/ogre/gui/navi/_navi_.pyd =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/gui/navi/_navi_.pyd ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/gui/navi/js3250.dll =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/gui/navi/js3250.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/gui/navi/nspr4.dll =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/gui/navi/nspr4.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/gui/navi/plc4.dll =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/gui/navi/plc4.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/gui/navi/plds4.dll =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/gui/navi/plds4.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/gui/navi/xpcom.dll =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/gui/navi/xpcom.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/gui/navi/xul.dll =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/gui/navi/xul.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/io/OIS/__init__.pyc =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/io/OIS/__init__.pyc ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/io/OIS/__init__.pyo =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/io/OIS/__init__.pyo ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/io/__init__.pyc =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/io/__init__.pyc ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/io/__init__.pyo =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/io/__init__.pyo ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/physics/NxOgre/__init__.py =================================================================== --- trunk/lib_windows/ogre/physics/NxOgre/__init__.py (rev 0) +++ trunk/lib_windows/ogre/physics/NxOgre/__init__.py 2008-03-12 23:28:56 UTC (rev 193) @@ -0,0 +1,7 @@ +import warnings +warnings.simplefilter('ignore', RuntimeWarning) + +from _nxogre_ import * + +warnings.resetwarnings( ) + Added: trunk/lib_windows/ogre/physics/NxOgre_09/NxCharacter.dll =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/physics/NxOgre_09/NxCharacter.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/physics/NxOgre_09/NxCooking.dll =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/physics/NxOgre_09/NxCooking.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/physics/NxOgre_09/NxExtensions.dll =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/physics/NxOgre_09/NxExtensions.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/physics/NxOgre_09/__init__.py =================================================================== --- trunk/lib_windows/ogre/physics/NxOgre_09/__init__.py (rev 0) +++ trunk/lib_windows/ogre/physics/NxOgre_09/__init__.py 2008-03-12 23:28:56 UTC (rev 193) @@ -0,0 +1,7 @@ +import warnings +warnings.simplefilter('ignore', RuntimeWarning) + +from _nxogre_09_ import * + +warnings.resetwarnings( ) + Added: trunk/lib_windows/ogre/physics/NxOgre_09/_nxogre_09_.pyd =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/physics/NxOgre_09/_nxogre_09_.pyd ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/physics/ODE/boost_python-vc80-mt-1_35.dll =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/physics/ODE/boost_python-vc80-mt-1_35.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/physics/OgreBulletC/__init__.py =================================================================== --- trunk/lib_windows/ogre/physics/OgreBulletC/__init__.py (rev 0) +++ trunk/lib_windows/ogre/physics/OgreBulletC/__init__.py 2008-03-12 23:28:56 UTC (rev 193) @@ -0,0 +1 @@ +from _ogrebulletc_ import * Added: trunk/lib_windows/ogre/physics/OgreBulletC/_ogrebulletc_.pyd =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/physics/OgreBulletC/_ogrebulletc_.pyd ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/physics/OgreBulletD/__init__.py =================================================================== --- trunk/lib_windows/ogre/physics/OgreBulletD/__init__.py (rev 0) +++ trunk/lib_windows/ogre/physics/OgreBulletD/__init__.py 2008-03-12 23:28:56 UTC (rev 193) @@ -0,0 +1 @@ +from _ogrebulletd_ import * Added: trunk/lib_windows/ogre/physics/OgreBulletD/_ogrebulletd_.pyd =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/physics/OgreBulletD/_ogrebulletd_.pyd ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/physics/OgreNewt/__init__.pyc =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/physics/OgreNewt/__init__.pyc ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/physics/OgreNewt/__init__.pyo =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/physics/OgreNewt/__init__.pyo ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/physics/Opcode/__init__.py =================================================================== --- trunk/lib_windows/ogre/physics/Opcode/__init__.py (rev 0) +++ trunk/lib_windows/ogre/physics/Opcode/__init__.py 2008-03-12 23:28:56 UTC (rev 193) @@ -0,0 +1 @@ +from _opcode_ import * \ No newline at end of file Added: trunk/lib_windows/ogre/physics/Opcode/_opcode_.pyd =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/physics/Opcode/_opcode_.pyd ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/physics/PhysX/NxCharacter.dll =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/physics/PhysX/NxCharacter.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/physics/PhysX/NxCooking.dll =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/physics/PhysX/NxCooking.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/physics/PhysX/NxExtensions.dll =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/physics/PhysX/NxExtensions.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/physics/PhysX/PhysXLoader.dll =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/physics/PhysX/PhysXLoader.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/physics/PhysX/__init__.py =================================================================== --- trunk/lib_windows/ogre/physics/PhysX/__init__.py (rev 0) +++ trunk/lib_windows/ogre/physics/PhysX/__init__.py 2008-03-12 23:28:56 UTC (rev 193) @@ -0,0 +1,21 @@ +import warnings +warnings.simplefilter('ignore', RuntimeWarning) + +from _physx_ import * +import ogre.renderer.OGRE as ogre + +def NxQuat( arg0=None, arg1=None ): + if isinstance (arg0, ogre.Quaternion) : + ret = _physx_.NxQuat() + ret.w = arg0.w + ret.x = arg0.x + ret.y = arg0.y + ret.z = arg0.z + return ret + elif arg1: + return _physx_.NxQuat(arg0,arg1) + elif arg0: + return _physx_.NxQuat(arg0) + return _physx_.NxQuat() +warnings.resetwarnings( ) + \ No newline at end of file Added: trunk/lib_windows/ogre/physics/PhysX/_physx_.pyd =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/physics/PhysX/_physx_.pyd ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/physics/__init__.pyc =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/physics/__init__.pyc ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/physics/__init__.pyo =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/physics/__init__.pyo ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/physics/bullet/__init__.py =================================================================== --- trunk/lib_windows/ogre/physics/bullet/__init__.py (rev 0) +++ trunk/lib_windows/ogre/physics/bullet/__init__.py 2008-03-12 23:28:56 UTC (rev 193) @@ -0,0 +1 @@ +from _bullet_ import * Added: trunk/lib_windows/ogre/physics/bullet/_bullet_.pyd =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/physics/bullet/_bullet_.pyd ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/renderer/OGRE/__init__.pyc =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/renderer/OGRE/__init__.pyc ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/renderer/OGRE/__init__.pyo =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/renderer/OGRE/__init__.pyo ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/renderer/OGRE/_ogre_exceptions_.pyc =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/renderer/OGRE/_ogre_exceptions_.pyc ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/renderer/OGRE/_ogre_exceptions_.pyo =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/renderer/OGRE/_ogre_exceptions_.pyo ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/renderer/OGRE/boost_python-vc80-mt-1_35.dll =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/renderer/OGRE/boost_python-vc80-mt-1_35.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/renderer/OGREdshow/__init__.py =================================================================== --- trunk/lib_windows/ogre/renderer/OGREdshow/__init__.py (rev 0) +++ trunk/lib_windows/ogre/renderer/OGREdshow/__init__.py 2008-03-12 23:28:56 UTC (rev 193) @@ -0,0 +1,8 @@ +import sys, os + +# Note that we put the Python-Ogre path first to ensure we don't get strange problems with windows +# picking up the wrong dlls -- Thanks to Pelle for tracking down this issue.. +if sys.platform == 'win32': + os.environ['PATH'] = __path__[0] +';' + os.environ['PATH'] + +from _ogredshow_ import * Added: trunk/lib_windows/ogre/renderer/__init__.pyc =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/renderer/__init__.pyc ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/renderer/__init__.pyo =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/renderer/__init__.pyo ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/ogre/sound/OgreAL/vorbisenc.dll =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/ogre/sound/OgreAL/vorbisenc.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/psyco/__init__.pyc =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/psyco/__init__.pyc ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/psyco/__init__.pyo =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/psyco/__init__.pyo ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/psyco/core.pyc =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/psyco/core.pyc ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/psyco/core.pyo =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/psyco/core.pyo ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/psyco/kdictproxy.pyc =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/psyco/kdictproxy.pyc ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/psyco/kdictproxy.pyo =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/psyco/kdictproxy.pyo ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/psyco/profiler.pyc =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/psyco/profiler.pyc ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/psyco/profiler.pyo =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/psyco/profiler.pyo ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/psyco/support.pyc =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/psyco/support.pyc ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/psyco/support.pyo =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/psyco/support.pyo ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/pydot.pyc =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/pydot.pyc ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/pysvn/__init__.pyc =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/pysvn/__init__.pyc ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/pysvn/__init__.pyo =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/pysvn/__init__.pyo ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/wx/__init__.pyc =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/wx/__init__.pyc ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/wx/__init__.pyo =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/wx/__init__.pyo ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/wx/__version__.pyc =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/wx/__version__.pyc ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/wx/__version__.pyo =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/wx/__version__.pyo ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/wx/_controls.pyc =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/wx/_controls.pyc ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/wx/_controls.pyo =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/wx/_controls.pyo ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/wx/_core.pyc =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/wx/_core.pyc ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/wx/_core.pyo =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/wx/_core.pyo ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/wx/_gdi.pyc =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/wx/_gdi.pyc ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/wx/_gdi.pyo =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/wx/_gdi.pyo ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/wx/_misc.pyc =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/wx/_misc.pyc ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/wx/_misc.pyo =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/wx/_misc.pyo ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/wx/_windows.pyc =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/wx/_windows.pyc ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/wx/_windows.pyo =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/wx/_windows.pyo ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/wx/aui.pyc =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/wx/aui.pyc ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/wx/aui.pyo =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/wx/aui.pyo ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/wx/grid.pyc =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/wx/grid.pyc ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/wx/grid.pyo =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/wx/grid.pyo ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/wx/html.pyc =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/wx/html.pyc ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib_windows/wx/html.pyo =================================================================== (Binary files differ) Property changes on: trunk/lib_windows/wx/html.pyo ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/windows/ParticleUniverse.dll =================================================================== (Binary files differ) Property changes on: trunk/windows/ParticleUniverse.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/windows/Plugin_PagingLandScapeSceneManager2.dll =================================================================== (Binary files differ) Property changes on: trunk/windows/Plugin_PagingLandScapeSceneManager2.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/windows/Plugin_TheoraVideoSystem.dll =================================================================== (Binary files differ) Property changes on: trunk/windows/Plugin_TheoraVideoSystem.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ror...@us...> - 2008-03-12 23:21:09
|
Revision: 192 http://roreditor.svn.sourceforge.net/roreditor/?rev=192&view=rev Author: rorthomas Date: 2008-03-12 16:21:05 -0700 (Wed, 12 Mar 2008) Log Message: ----------- - updated pyogre to 1.1 - fixed resource loading (parts only) !! WIP !! Modified Paths: -------------- trunk/editor.ini trunk/lib_common/ror/odefparser.py trunk/lib_common/ror/rorcommon.py trunk/lib_common/ror/terrainparser.py trunk/lib_common/roreditor/GUIObjectTree.py trunk/lib_common/roreditor/MainFrame.py trunk/lib_common/roreditor/RoRObjectPreviewOgreWindow.py trunk/lib_common/roreditor/RoROdefEditorOgreWindow.py trunk/lib_common/roreditor/RoRTerrainOgreWindow.py trunk/lib_common/roreditor/RoRTruckOgreWindow.py trunk/lib_common/roreditor/RoRTruckUVOgreWindow.py trunk/lib_windows/ogre/__init__.py trunk/lib_windows/ogre/gui/CEGUI/CEGUIBase.dll trunk/lib_windows/ogre/gui/CEGUI/CEGUIExpatParser.dll trunk/lib_windows/ogre/gui/CEGUI/CEGUIFalagardWRBase.dll trunk/lib_windows/ogre/gui/CEGUI/OgreGUIRenderer.dll trunk/lib_windows/ogre/gui/CEGUI/__init__.py trunk/lib_windows/ogre/gui/CEGUI/_cegui_.pyd trunk/lib_windows/ogre/io/OIS/__init__.py trunk/lib_windows/ogre/io/OIS/_ois_.pyd trunk/lib_windows/ogre/physics/ODE/_ode_.pyd trunk/lib_windows/ogre/physics/OgreNewt/__init__.py trunk/lib_windows/ogre/physics/OgreNewt/_ogrenewt_.pyd trunk/lib_windows/ogre/physics/OgreOde/OgreOde_Core.dll trunk/lib_windows/ogre/physics/OgreOde/OgreOde_Loader.dll trunk/lib_windows/ogre/physics/OgreOde/OgreOde_Prefab.dll trunk/lib_windows/ogre/physics/OgreOde/_ogreode_.pyd trunk/lib_windows/ogre/physics/OgreRefApp/ReferenceAppLayer.dll trunk/lib_windows/ogre/physics/OgreRefApp/_ogrerefapp_.pyd trunk/lib_windows/ogre/renderer/OGRE/OgreMain.dll trunk/lib_windows/ogre/renderer/OGRE/__init__.py trunk/lib_windows/ogre/renderer/OGRE/_ogre_.pyd trunk/lib_windows/ogre/renderer/OGRE/_ogre_exceptions_.py trunk/lib_windows/ogre/renderer/OGRE/cg.dll trunk/lib_windows/ogre/renderer/OGRE/sf_OIS.py trunk/lib_windows/ogre/sound/OgreAL/_ogreal_.pyd trunk/lib_windows/ogre/sound/OgreAL/ogg.dll trunk/lib_windows/ogre/sound/OgreAL/vorbis.dll trunk/lib_windows/ogre/sound/OgreAL/vorbisfile.dll trunk/rortoolkit.py trunk/windows/Plugin_BSPSceneManager.dll trunk/windows/Plugin_CgProgramManager.dll trunk/windows/Plugin_OctreeSceneManager.dll trunk/windows/Plugin_ParticleFX.dll trunk/windows/RenderSystem_Direct3D9.dll trunk/windows/RenderSystem_GL.dll Removed Paths: ------------- trunk/Plugin_BSPSceneManager.dll trunk/Plugin_CgProgramManager.dll trunk/Plugin_OctreeSceneManager.dll trunk/Plugin_ParticleFX.dll trunk/RenderSystem_Direct3D9.dll trunk/RenderSystem_GL.dll trunk/media/packs/OgreCore.zip Deleted: trunk/Plugin_BSPSceneManager.dll =================================================================== (Binary files differ) Deleted: trunk/Plugin_CgProgramManager.dll =================================================================== (Binary files differ) Deleted: trunk/Plugin_OctreeSceneManager.dll =================================================================== (Binary files differ) Deleted: trunk/Plugin_ParticleFX.dll =================================================================== (Binary files differ) Deleted: trunk/RenderSystem_Direct3D9.dll =================================================================== (Binary files differ) Deleted: trunk/RenderSystem_GL.dll =================================================================== (Binary files differ) Modified: trunk/editor.ini =================================================================== --- trunk/editor.ini 2008-01-15 12:44:59 UTC (rev 191) +++ trunk/editor.ini 2008-03-12 23:21:05 UTC (rev 192) @@ -1,3 +1,3 @@ [RigsOfRods] -basepath = invalid +basepath = E:\projects\ror\main Modified: trunk/lib_common/ror/odefparser.py =================================================================== --- trunk/lib_common/ror/odefparser.py 2008-01-15 12:44:59 UTC (rev 191) +++ trunk/lib_common/ror/odefparser.py 2008-03-12 23:21:05 UTC (rev 192) @@ -1,4 +1,5 @@ -# old format: +import copy, os, os.path +import ogre.renderer.OGRE as ogre from ror.logger import log from ror.settingsManager import getSettingsManager @@ -34,12 +35,26 @@ s += " coordinates: " + str(self.coords) s += " rotation: " + str(self.rotation) return s - + +def loadOdefContent(filename): + content = [] + ds=ogre.ResourceGroupManager.getSingleton().openResource(filename, "General"); + ec=0 + while True: + line = copy.copy(ds.getLine()) + #print line, ec + if line.strip() == "": + ec+=1 + if ec > 50: + break + content.append(line) + #ds.close() + return content + + def loadOdef(odefFilename): try: - f=open(odefFilename, 'r') - content = f.readlines() - f.close() + content = loadOdefContent(os.path.basename(odefFilename)) ismovable = False meshname = content[0].strip() scalearr = [1,1,1] Modified: trunk/lib_common/ror/rorcommon.py =================================================================== --- trunk/lib_common/ror/rorcommon.py 2008-01-15 12:44:59 UTC (rev 191) +++ trunk/lib_common/ror/rorcommon.py 2008-03-12 23:21:05 UTC (rev 192) @@ -1,7 +1,8 @@ -import sys, os, os.path +import sys, os, os.path, glob import wx from random import Random from logger import log +import ogre.renderer.OGRE as ogre def ShowOnAbout(event = None): rev = "" @@ -48,6 +49,52 @@ return rnd_id +def readResourceConfig(rordir): + f = open(os.path.join(rordir, 'resources.cfg'), 'r') + lines = f.readlines() + f.close() + normalResources = [] + zipResources = [] + isZip=False + for line in lines: + if line.strip() == '[Packs]' or line.strip() == '[InternalPacks]': + isZip=True + elif line[0] == '[': + isZip=False + #print line, isZip + + if line[:11] == 'FileSystem=': + dir=line[11:].strip() + dirname = dir.replace('/', '\\') + path = os.path.join(rordir, dirname) + if isZip: + zipResources.append(path) + else: + normalResources.append(path) + return (normalResources, zipResources) + + +def initResources(rordir): + (normalResources, zipResources) = readResourceConfig(rordir) + # only init things in the main window, not in shared ones! + # setup resources + for r in normalResources: + print 'adding normal resource: ' + r + ogre.ResourceGroupManager.getSingleton().addResourceLocation(r, "FileSystem", "General", False) + + for r in zipResources: + files = glob.glob(os.path.join(r, "*.zip")) + for file in files: + print 'adding zip resource: ' + file + ogre.ResourceGroupManager.getSingleton().addResourceLocation(file, "Zip", "General", False) + + #ogre.ResourceGroupManager.getSingleton().addResourceLocation("media/packs/OgreCore.zip", "Zip", "Bootstrap", False) + ogre.ResourceGroupManager.getSingleton().addResourceLocation("media", "FileSystem", "General", False) + ogre.ResourceGroupManager.getSingleton().addResourceLocation("media/materials", "FileSystem", "General", False) + ogre.ResourceGroupManager.getSingleton().addResourceLocation("media/models", "FileSystem", "General", False) + + ogre.ResourceGroupManager.getSingleton().initialiseAllResourceGroups() + def getPlatform(): if sys.platform in ['linux', 'linux2']: return 'linux' Modified: trunk/lib_common/ror/terrainparser.py =================================================================== --- trunk/lib_common/ror/terrainparser.py 2008-01-15 12:44:59 UTC (rev 191) +++ trunk/lib_common/ror/terrainparser.py 2008-03-12 23:21:05 UTC (rev 192) @@ -1,5 +1,6 @@ -import wx, os, os.path +import wx, os, os.path, copy +import ogre.renderer.OGRE as ogre from logger import log from settingsManager import getSettingsManager @@ -12,6 +13,7 @@ rotz = None name = "" filename = "" + line = 0 additionaloptions = [] comments = [] mayRotate = True @@ -53,9 +55,18 @@ f.close() def loadFile(self,filename): - f=open(filename, 'r') - content = f.readlines() - f.close() + content = [] + ds=ogre.ResourceGroupManager.getSingleton().openResource(filename, "General"); + ec=0 + while True: + line = copy.copy(ds.getLine()) + #print line, ec + if line.strip() == "": + ec+=1 + if ec > 50: + break + content.append(line) + #ds.close() return content def __init__(self, filename): @@ -158,6 +169,7 @@ truck.setPosition(x, y, z) truck.setRotation(rx, ry, -rz) truck.additionaloptions = objname[1:] + truck.line = i #truck.mayRotate=False self.trucks.append(truck) continue @@ -166,6 +178,7 @@ load.name = "load" load.filename = objname[-1].strip() load.comments = comm + load.line=i comm = [] load.setPosition(x, y, z) load.setRotation(rx, ry, -rz) @@ -180,6 +193,7 @@ obj.name = objectname obj.filename = objectname obj.comments = comm + obj.line=i comm = [] obj.setPosition(x, y, z) obj.setRotation(rx, ry, rz) Modified: trunk/lib_common/roreditor/GUIObjectTree.py =================================================================== --- trunk/lib_common/roreditor/GUIObjectTree.py 2008-01-15 12:44:59 UTC (rev 191) +++ trunk/lib_common/roreditor/GUIObjectTree.py 2008-03-12 23:21:05 UTC (rev 192) @@ -5,186 +5,134 @@ import wx.html import wx.aui import ror.settingsManager +from ror.rorcommon import * import cStringIO -RORPATH = ror.settingsManager.getSettingsManager().getSetting("RigsOfRods", "BasePath") -DATADIR = os.path.join(RORPATH, "data") -TRUCKDIR = os.path.join(DATADIR, "trucks") -TERRAINDIR = os.path.join(DATADIR, "terrains") -OBJECTDIR = os.path.join(DATADIR, "objects") - class RoRObjectTreeCtrl(wx.Panel): - def __init__(self, parent, frame): - wx.Panel.__init__(self, parent, wx.ID_ANY, wx.DefaultPosition, - wx.DefaultSize) + def __init__(self, parent, frame): + wx.Panel.__init__(self, parent, wx.ID_ANY, wx.DefaultPosition, + wx.DefaultSize) - self.parent = parent - self._frame = frame - + self.parent = parent + self._frame = frame + + self.rordir = ror.settingsManager.getSettingsManager().getSetting("RigsOfRods", "BasePath") + initResources(self.rordir) - vert = wx.BoxSizer(wx.VERTICAL) + vert = wx.BoxSizer(wx.VERTICAL) - tree = wx.TreeCtrl(self, -1, wx.Point(0, 0), wx.DefaultSize, wx.NO_BORDER | wx.TR_HIDE_ROOT) - - root = tree.AddRoot("Objects") - items = [] + tree = wx.TreeCtrl(self, -1, wx.Point(0, 0), wx.DefaultSize, wx.NO_BORDER | wx.TR_HIDE_ROOT) + + root = tree.AddRoot("Objects") + items = [] - imglist = wx.ImageList(16, 16, True, 2) - imglist.Add(wx.ArtProvider_GetBitmap(wx.ART_FOLDER, wx.ART_OTHER, wx.Size(16,16))) - imglist.Add(wx.ArtProvider_GetBitmap(wx.ART_NORMAL_FILE, wx.ART_OTHER, wx.Size(16,16))) - tree.AssignImageList(imglist) + imglist = wx.ImageList(16, 16, True, 2) + imglist.Add(wx.ArtProvider_GetBitmap(wx.ART_FOLDER, wx.ART_OTHER, wx.Size(16,16))) + imglist.Add(wx.ArtProvider_GetBitmap(wx.ART_NORMAL_FILE, wx.ART_OTHER, wx.Size(16,16))) + tree.AssignImageList(imglist) - terrains = self.getInstalledTerrains() - items.append(tree.AppendItem(root, "Terrains", 0)) - for terrain in terrains: - terrainname, extension = os.path.splitext(os.path.basename(terrain)) - data = wx.TreeItemData() - data.SetData(terrain) - tree.AppendItem(items[-1], terrainname, 1, data=data) - - trucks = self.getInstalledTrucks() - items.append(tree.AppendItem(root, "Trucks", 0)) - for truck in trucks: - truckname, extension = os.path.splitext(os.path.basename(truck)) - data = wx.TreeItemData() - data.SetData(truck) - tree.AppendItem(items[-1], truckname, 1, data=data) + terrains = tree.AppendItem(root, "Terrains", 0) + terrains_editable = tree.AppendItem(terrains, "editable", 0) + terrains_noneditable = tree.AppendItem(terrains, "Non-Editable", 0) + + terrainfiles = self.getInstalledTerrains("*.terrn") + for terrain in terrainfiles: + terrainname, extension = os.path.splitext(os.path.basename(terrain)) + data = wx.TreeItemData() + data.SetData(terrain) + tree.AppendItem(items[-1], terrainname, 1, data=data) + - loads = self.getInstalledLoads() - items.append(tree.AppendItem(root, "Loads", 0)) - for load in loads: - loadname, extension = os.path.splitext(os.path.basename(load)) - data = wx.TreeItemData() - data.SetData(load) - tree.AppendItem(items[-1], loadname, 1, data=data) - - objects = self.getInstalledObjects() - items.append(tree.AppendItem(root, "Objects", 0)) - for object in objects: - objectname, extension = os.path.splitext(os.path.basename(object)) - data = wx.TreeItemData() - data.SetData(object) - tree.AppendItem(items[-1], objectname, 1, data=data) + # root is hidden, no expand! + #tree.Expand(root) + vert.Add(tree, 1, wx.EXPAND, 5) + self.SetSizer(vert) + self.GetSizer().SetSizeHints(self) + + self.tree = tree + + # this dows not work :( + #self.Bind(wx.EVT_LEFT_DCLICK, self.OnLeftDClick, self.tree) + self.Bind(wx.EVT_TREE_SEL_CHANGED, self.onTreeSelectionChange, self.tree) + self.Bind(wx.EVT_TREE_ITEM_RIGHT_CLICK, self.OnRightClick, self.tree) + + #self.Bind(wx.EVT_TREE_BEGIN_DRAG, self.BeginDrag, self.tree) + def OnLeftDClick(self, event): + #this is just a shortcut! + self.selectedfn = self.tree.GetItemData(event.GetItem()).GetData() + if self.selectedfn[-4:].lower() == "odef": + self.editOdef() + if self.selectedfn[-5:].lower() == "terrn": + self.editTerrain() + if self.selectedfn[-5:].lower() == 'truck' or self.selectedfn[-4:].lower() == 'load': + self.editTruck() + + def OnRightClick(self, event): + self.selectedfn = self.tree.GetItemData(event.GetItem()).GetData() + if self.selectedfn is None: + event.Skip() + return + + menu = wx.Menu() + + #create various menu entries + if self.selectedfn[-4:].lower() == "odef": + item_edit_odef = menu.Append(wx.ID_ANY, "Edit in ODef Editor") + self.Bind(wx.EVT_MENU, self.editOdef, item_edit_odef) + if self.selectedfn[-5:].lower() == "terrn": + item_edit_terrain = menu.Append(wx.ID_ANY, "Edit in Terrain Editor") + self.Bind(wx.EVT_MENU, self.editTerrain, item_edit_terrain) + if self.selectedfn[-5:].lower() == 'truck' or self.selectedfn[-4:].lower() == 'load': + item_edit_truck = menu.Append(wx.ID_ANY, "Edit in Truck Editor") + self.Bind(wx.EVT_MENU, self.editTruck, item_edit_truck) + menu.AppendSeparator() + item_add = menu.Append(wx.ID_ANY, "add to Terrain") + self.Bind(wx.EVT_MENU, self.addObjectToTerrain, item_add) + + self.PopupMenu(menu) + menu.Destroy() + + def editTruck(self, event=None): + if self.selectedfn is None: + return + self.parent.editTruck(self.selectedfn) + + def editOdef(self, event=None): + if self.selectedfn is None: + return + self.parent.editODefFile(self.selectedfn) - # root is hidden, no expand! - #tree.Expand(root) - vert.Add(tree, 1, wx.EXPAND, 5) - self.SetSizer(vert) - self.GetSizer().SetSizeHints(self) - - self.tree = tree - - # this dows not work :( - #self.Bind(wx.EVT_LEFT_DCLICK, self.OnLeftDClick, self.tree) - self.Bind(wx.EVT_TREE_SEL_CHANGED, self.onTreeSelectionChange, self.tree) - self.Bind(wx.EVT_TREE_ITEM_RIGHT_CLICK, self.OnRightClick, self.tree) - - #self.Bind(wx.EVT_TREE_BEGIN_DRAG, self.BeginDrag, self.tree) - def OnLeftDClick(self, event): - #this is just a shortcut! - self.selectedfn = self.tree.GetItemData(event.GetItem()).GetData() - if self.selectedfn[-4:].lower() == "odef": - self.editOdef() - if self.selectedfn[-5:].lower() == "terrn": - self.editTerrain() - if self.selectedfn[-5:].lower() == 'truck' or self.selectedfn[-4:].lower() == 'load': - self.editTruck() - - def OnRightClick(self, event): - self.selectedfn = self.tree.GetItemData(event.GetItem()).GetData() - if self.selectedfn is None: - event.Skip() - return - - menu = wx.Menu() - - #create various menu entries - if self.selectedfn[-4:].lower() == "odef": - item_edit_odef = menu.Append(wx.ID_ANY, "Edit in ODef Editor") - self.Bind(wx.EVT_MENU, self.editOdef, item_edit_odef) - if self.selectedfn[-5:].lower() == "terrn": - item_edit_terrain = menu.Append(wx.ID_ANY, "Edit in Terrain Editor") - self.Bind(wx.EVT_MENU, self.editTerrain, item_edit_terrain) - if self.selectedfn[-5:].lower() == 'truck' or self.selectedfn[-4:].lower() == 'load': - item_edit_truck = menu.Append(wx.ID_ANY, "Edit in Truck Editor") - self.Bind(wx.EVT_MENU, self.editTruck, item_edit_truck) - menu.AppendSeparator() - item_add = menu.Append(wx.ID_ANY, "add to Terrain") - self.Bind(wx.EVT_MENU, self.addObjectToTerrain, item_add) - - self.PopupMenu(menu) - menu.Destroy() - - def editTruck(self, event=None): - if self.selectedfn is None: - return - self.parent.editTruck(self.selectedfn) - - def editOdef(self, event=None): - if self.selectedfn is None: - return - self.parent.editODefFile(self.selectedfn) - - def editTerrain(self, event=None): - if self.selectedfn is None: - return - self.parent.openTerrain(self.selectedfn) - - def addObjectToTerrain(self, event=None): - if self.selectedfn is None: - return - self.parent.addObjectToTerrain(self.selectedfn) - #def BeginDrag(self, event): - # ''' - # EVT_TREE_BEGIN_DRAG handler. - # ''' - # self.dragItem = event.GetItem() - # fn = self.tree.GetItemData(event.GetItem()).GetData() - # if fn is None: - # return - # #event.Allow() - # wx.TreeEvent.Allow(event) - - def onTreeSelectionChange(self, event=None): - fn = self.tree.GetItemData(self.tree.GetSelection()).GetData() - if fn is None: - return - self.parent.previewObject(fn) - - def getInstalledTerrains(self): - files = [] - for filename in os.listdir(TERRAINDIR): - onlyfilename, extension = os.path.splitext(filename) - if extension.lower() == ".terrn": - files.append(os.path.join(TERRAINDIR, filename)) - files.sort() - return files - - def getInstalledTrucks(self): - files = [] - for filename in os.listdir(TRUCKDIR): - onlyfilename, extension = os.path.splitext(filename) - if extension.lower() == ".truck": - files.append(os.path.join(TRUCKDIR, filename)) - files.sort() - return files - - def getInstalledLoads(self): - files = [] - for filename in os.listdir(TRUCKDIR): - onlyfilename, extension = os.path.splitext(filename) - if extension.lower() == ".load": - files.append(os.path.join(TRUCKDIR, filename)) - files.sort() - return files - - def getInstalledObjects(self): - files = [] - for filename in os.listdir(OBJECTDIR): - onlyfilename, extension = os.path.splitext(filename) - if extension.lower() == ".odef": - files.append(os.path.join(OBJECTDIR, filename)) - files.sort() - return files \ No newline at end of file + def editTerrain(self, event=None): + if self.selectedfn is None: + return + self.parent.openTerrain(self.selectedfn) + + def addObjectToTerrain(self, event=None): + if self.selectedfn is None: + return + self.parent.addObjectToTerrain(self.selectedfn) + #def BeginDrag(self, event): + # ''' + # EVT_TREE_BEGIN_DRAG handler. + # ''' + # self.dragItem = event.GetItem() + # fn = self.tree.GetItemData(event.GetItem()).GetData() + # if fn is None: + # return + # #event.Allow() + # wx.TreeEvent.Allow(event) + + def onTreeSelectionChange(self, event=None): + fn = self.tree.GetItemData(self.tree.GetSelection()).GetData() + if fn is None: + return + self.parent.previewObject(fn) + + def getInstalledFiles(self, extension): + files = [] + filesr = ogre.ResourceGroupManager.getSingleton().findResourceFileInfo("General", extension) + for file in filesr: + files.append(file) + return files Modified: trunk/lib_common/roreditor/MainFrame.py =================================================================== --- trunk/lib_common/roreditor/MainFrame.py 2008-01-15 12:44:59 UTC (rev 191) +++ trunk/lib_common/roreditor/MainFrame.py 2008-03-12 23:21:05 UTC (rev 192) @@ -19,7 +19,7 @@ from GUIObjectTree import * from MainFrame_Tools import * from MainFrame_Tools_ODefEditor import * - + import wx import wx.grid import wx.html @@ -56,493 +56,497 @@ OBJECTDIR = os.path.join(DATADIR, "objects") class MainFrame(wx.Frame): - - def __init__(self, parent, id=-1, title="", pos=wx.DefaultPosition, - size=wx.DefaultSize, style=wx.DEFAULT_FRAME_STYLE | - wx.SUNKEN_BORDER | - wx.CLIP_CHILDREN): + + def __init__(self, parent, id=-1, title="", pos=wx.DefaultPosition, + size=wx.DefaultSize, style=wx.DEFAULT_FRAME_STYLE | + wx.SUNKEN_BORDER | + wx.CLIP_CHILDREN): - wx.Frame.__init__(self, parent, id, title, pos, size, style) - - # tell FrameManager to manage this frame - self._mgr = wx.aui.AuiManager() - self._mgr.SetManagedWindow(self) - - self._perspectives = [] - self.n = 0 - self.x = 0 - - self.SetIcon(wx.Icon('ror.ico',wx.BITMAP_TYPE_ICO)) + wx.Frame.__init__(self, parent, id, title, pos, size, style) + + # tell FrameManager to manage this frame + self._mgr = wx.aui.AuiManager() + self._mgr.SetManagedWindow(self) + + self._perspectives = [] + self.n = 0 + self.x = 0 + + self.SetIcon(wx.Icon('ror.ico',wx.BITMAP_TYPE_ICO)) - # create menu - mb = wx.MenuBar() + # create menu + mb = wx.MenuBar() - file_menu = wx.Menu() - #file_menu.Append(ID_OpenTerrain, "Open Terrain") - file_menu.Append(wx.ID_EXIT, "Exit") + file_menu = wx.Menu() + #file_menu.Append(ID_OpenTerrain, "Open Terrain") + file_menu.Append(wx.ID_EXIT, "Exit") - #view_menu = wx.Menu() - #view_menu.Append(ID_CreateOgre, "Create new 3D View") + #view_menu = wx.Menu() + #view_menu.Append(ID_CreateOgre, "Create new 3D View") - self.managerInit() - options_menu = wx.Menu() - options_menu.Append(ID_Settings, "GUI Settings Pane") + self.managerInit() + options_menu = wx.Menu() + options_menu.Append(ID_Settings, "GUI Settings Pane") - self._perspectives_menu = wx.Menu() - self._perspectives_menu.Append(ID_CreatePerspective, "Create Perspective") - #self._perspectives_menu.Append(ID_CopyPerspective, "Copy Perspective Data To Clipboard") - self._perspectives_menu.AppendSeparator() - self._perspectives_menu.Append(ID_FirstPerspective+0, "Default Startup") - self._perspectives_menu.Append(ID_FirstPerspective+1, "Terrain") - self._perspectives_menu.Append(ID_FirstPerspective+2, "ODef Editor") - self._perspectives_menu.Append(ID_FirstPerspective+3, "Truck Editor") + self._perspectives_menu = wx.Menu() + self._perspectives_menu.Append(ID_CreatePerspective, "Create Perspective") + #self._perspectives_menu.Append(ID_CopyPerspective, "Copy Perspective Data To Clipboard") + self._perspectives_menu.AppendSeparator() + self._perspectives_menu.Append(ID_FirstPerspective+0, "Default Startup") + self._perspectives_menu.Append(ID_FirstPerspective+1, "Terrain") + self._perspectives_menu.Append(ID_FirstPerspective+2, "ODef Editor") + self._perspectives_menu.Append(ID_FirstPerspective+3, "Truck Editor") - help_menu = wx.Menu() - help_menu.Append(ID_About, "About...") - help_menu.Append(ID_ViewHelp, "View Help") - - mb.Append(file_menu, "File") - #mb.Append(view_menu, "View") - mb.Append(self._perspectives_menu, "Perspectives") - mb.Append(options_menu, "Options") - mb.Append(help_menu, "Help") - - self.SetMenuBar(mb) + help_menu = wx.Menu() + help_menu.Append(ID_About, "About...") + help_menu.Append(ID_ViewHelp, "View Help") + + mb.Append(file_menu, "File") + #mb.Append(view_menu, "View") + mb.Append(self._perspectives_menu, "Perspectives") + mb.Append(options_menu, "Options") + mb.Append(help_menu, "Help") + + self.SetMenuBar(mb) - self.statusbar = self.CreateStatusBar(5, 0, wx.ID_ANY, "mainstatusbar") - self.statusbar.SetStatusWidths([-1, 200, 130, 250, 80]) + self.statusbar = self.CreateStatusBar(5, 0, wx.ID_ANY, "mainstatusbar") + self.statusbar.SetStatusWidths([-1, 200, 130, 250, 80]) - # min size for the frame itself isn't completely done. - # see the end up FrameManager::Update() for the test - # code. For now, just hard code a frame minimum size - self.SetMinSize(wx.Size(600, 400)) - try: - import ror.svn - self.SetTitle("Rigs of Rods Terrain Editor revision %d" % ror.svn.getRevision()) - except: - self.SetTitle("Rigs of Rods Terrain Editor") - - # create some toolbars - self.terraintoolbar = wx.ToolBar(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TB_FLAT | wx.TB_NODIVIDER) - self.terraintoolbar.SetToolBitmapSize(wx.Size(16,16)) - self.terraintoolbar.AddLabelTool(ID_OpenTerrain, "Open Terrain", wx.ArtProvider_GetBitmap(wx.ART_FILE_OPEN)) - self.terraintoolbar.AddLabelTool(ID_SaveTerrain, "Save Terrain", wx.ArtProvider_GetBitmap(wx.ART_FILE_SAVE)) - self.terraintoolbar.EnableTool(ID_SaveTerrain, False) - self.terraintoolbar.AddLabelTool(ID_SaveTerrainAs, "Save Terrain as", wx.ArtProvider_GetBitmap(wx.ART_FILE_SAVE_AS)) - self.terraintoolbar.EnableTool(ID_SaveTerrainAs, False) - self.terraintoolbar.AddSeparator() - self.terraintoolbar.AddLabelTool(ID_AddObject, "Add Something", wx.ArtProvider_GetBitmap(wx.ART_NEW)) - self.terraintoolbar.EnableTool(ID_AddObject, False) - self.terraintoolbar.AddLabelTool(ID_DeleteSelection, "Delete Selection", wx.ArtProvider_GetBitmap(wx.ART_DELETE)) - self.terraintoolbar.EnableTool(ID_DeleteSelection, False) - self.terraintoolbar.AddSeparator() - self.terraintoolbar.AddLabelTool(ID_CopySelection, "Copy Selection", wx.ArtProvider_GetBitmap(wx.ART_COPY)) - self.terraintoolbar.EnableTool(ID_CopySelection, False) - self.terraintoolbar.AddLabelTool(ID_PasteSelection, "Paste Selection", wx.ArtProvider_GetBitmap(wx.ART_PASTE)) - self.terraintoolbar.EnableTool(ID_PasteSelection, False) - self.terraintoolbar.AddSeparator() - self.terraintoolbar.AddLabelTool(ID_UndoAction, "Undo last Action", wx.ArtProvider_GetBitmap(wx.ART_UNDO)) - self.terraintoolbar.EnableTool(ID_UndoAction, False) - self.terraintoolbar.AddLabelTool(ID_RedoAction, "Redo last Undo", wx.ArtProvider_GetBitmap(wx.ART_REDO)) - self.terraintoolbar.EnableTool(ID_RedoAction, False) - self.terraintoolbar.AddSeparator() - self.terraintoolbar.AddLabelTool(ID_FindObject, "Find Object", wx.ArtProvider_GetBitmap(wx.ART_FIND)) - self.terraintoolbar.EnableTool(ID_FindObject, False) - self.terraintoolbar.AddSeparator() - self.terraintoolbar.AddLabelTool(ID_Quit, "Quit", wx.ArtProvider_GetBitmap(wx.ART_QUIT)) - self.terraintoolbar.Realize() - - self.rordir = getSettingsManager().getSetting("RigsOfRods", "BasePath") - - - # add a bunch of panes - self.objectPreviewWindow = ObjectPreviewOgreWindow(self, wx.ID_ANY, rordir=self.rordir) - - self._mgr.AddPane(self.objectPreviewWindow, wx.aui.AuiPaneInfo(). - Name("object_preview"). - Caption("Object Preview"). - CenterPane(). - MinSize(wx.Size(200,200)). - CloseButton(True). - MaximizeButton(False)) + # min size for the frame itself isn't completely done. + # see the end up FrameManager::Update() for the test + # code. For now, just hard code a frame minimum size + self.SetMinSize(wx.Size(600, 400)) + try: + import ror.svn + self.SetTitle("Rigs of Rods Terrain Editor revision %d" % ror.svn.getRevision()) + except: + self.SetTitle("Rigs of Rods Terrain Editor") + + # create some toolbars + self.terraintoolbar = wx.ToolBar(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TB_FLAT | wx.TB_NODIVIDER) + self.terraintoolbar.SetToolBitmapSize(wx.Size(16,16)) + self.terraintoolbar.AddLabelTool(ID_OpenTerrain, "Open Terrain", wx.ArtProvider_GetBitmap(wx.ART_FILE_OPEN)) + self.terraintoolbar.AddLabelTool(ID_SaveTerrain, "Save Terrain", wx.ArtProvider_GetBitmap(wx.ART_FILE_SAVE)) + self.terraintoolbar.EnableTool(ID_SaveTerrain, False) + self.terraintoolbar.AddLabelTool(ID_SaveTerrainAs, "Save Terrain as", wx.ArtProvider_GetBitmap(wx.ART_FILE_SAVE_AS)) + self.terraintoolbar.EnableTool(ID_SaveTerrainAs, False) + self.terraintoolbar.AddSeparator() + self.terraintoolbar.AddLabelTool(ID_AddObject, "Add Something", wx.ArtProvider_GetBitmap(wx.ART_NEW)) + self.terraintoolbar.EnableTool(ID_AddObject, False) + self.terraintoolbar.AddLabelTool(ID_DeleteSelection, "Delete Selection", wx.ArtProvider_GetBitmap(wx.ART_DELETE)) + self.terraintoolbar.EnableTool(ID_DeleteSelection, False) + self.terraintoolbar.AddSeparator() + self.terraintoolbar.AddLabelTool(ID_CopySelection, "Copy Selection", wx.ArtProvider_GetBitmap(wx.ART_COPY)) + self.terraintoolbar.EnableTool(ID_CopySelection, False) + self.terraintoolbar.AddLabelTool(ID_PasteSelection, "Paste Selection", wx.ArtProvider_GetBitmap(wx.ART_PASTE)) + self.terraintoolbar.EnableTool(ID_PasteSelection, False) + self.terraintoolbar.AddSeparator() + self.terraintoolbar.AddLabelTool(ID_UndoAction, "Undo last Action", wx.ArtProvider_GetBitmap(wx.ART_UNDO)) + self.terraintoolbar.EnableTool(ID_UndoAction, False) + self.terraintoolbar.AddLabelTool(ID_RedoAction, "Redo last Undo", wx.ArtProvider_GetBitmap(wx.ART_REDO)) + self.terraintoolbar.EnableTool(ID_RedoAction, False) + self.terraintoolbar.AddSeparator() + self.terraintoolbar.AddLabelTool(ID_FindObject, "Find Object", wx.ArtProvider_GetBitmap(wx.ART_FIND)) + self.terraintoolbar.EnableTool(ID_FindObject, False) + self.terraintoolbar.AddSeparator() + self.terraintoolbar.AddLabelTool(ID_Quit, "Quit", wx.ArtProvider_GetBitmap(wx.ART_QUIT)) + self.terraintoolbar.Realize() + + self.rordir = getSettingsManager().getSetting("RigsOfRods", "BasePath") + + + # add a bunch of panes + self.objectPreviewWindow = ObjectPreviewOgreWindow(self, wx.ID_ANY, rordir=self.rordir) + + self._mgr.AddPane(self.objectPreviewWindow, wx.aui.AuiPaneInfo(). + Name("object_preview"). + Caption("Object Preview"). + CenterPane(). + MinSize(wx.Size(200,200)). + CloseButton(True). + MaximizeButton(False)) - self._mgr.AddPane(HelpPanel(self, self), wx.aui.AuiPaneInfo(). - Name("help"). - Caption("Help"). - Dockable(False). - Float(). - Fixed(). - Hide(). - CloseButton(True). - MaximizeButton(True)) + self._mgr.AddPane(HelpPanel(self, self), wx.aui.AuiPaneInfo(). + Name("help"). + Caption("Help"). + Dockable(False). + Float(). + Fixed(). + Hide(). + CloseButton(True). + MaximizeButton(True)) - self._mgr.AddPane(SettingsPanel(self, self), wx.aui.AuiPaneInfo(). - Name("settings"). - Caption("Dock Manager Settings"). - Dockable(False). - Float(). - Fixed(). - Hide(). - CloseButton(True). - MaximizeButton(True)) + self._mgr.AddPane(SettingsPanel(self, self), wx.aui.AuiPaneInfo(). + Name("settings"). + Caption("Dock Manager Settings"). + Dockable(False). + Float(). + Fixed(). + Hide(). + CloseButton(True). + MaximizeButton(True)) - self._mgr.AddPane(RoRObjectTreeCtrl(self, self), wx.aui.AuiPaneInfo(). - Name("object_tree"). - Caption("Object Tree"). - MinSize(wx.Size(200,100)). - Left(). - CloseButton(True). - MaximizeButton(True)) - - - # odef editor panels - self.oddefEditorViewSettings = OdefViewPanel(self, self) - self._mgr.AddPane(self.oddefEditorViewSettings, wx.aui.AuiPaneInfo(). - Name("odef_editor_view_settings"). - Caption("ODef Editor View Settings"). - MinSize(wx.Size(200,100)). - Left(). - CloseButton(True). - MaximizeButton(False). - Hide()) - - - # create the center pane(s) - #Timer creation (for rendering) - self.ogreTimer = wx.Timer() - self.ogreTimer.SetOwner(self) - self.Bind(wx.EVT_TIMER, self.onUpdateRender, self.ogreTimer) - self.ogreTimer.Start(25) - - # create timer for gui update - self.guitimer = wx.Timer() - self.guitimer.SetOwner(self) #Sets the timer to notify self: binding the timer event is not enough - self.Bind(wx.EVT_TIMER, self.OnGUITimer, self.guitimer) - self.guitimer.Start(200) + self._mgr.AddPane(RoRObjectTreeCtrl(self, self), wx.aui.AuiPaneInfo(). + Name("object_tree"). + Caption("Object Tree"). + MinSize(wx.Size(200,100)). + Left(). + CloseButton(True). + MaximizeButton(True)) + + + # odef editor panels + self.oddefEditorViewSettings = OdefViewPanel(self, self) + self._mgr.AddPane(self.oddefEditorViewSettings, wx.aui.AuiPaneInfo(). + Name("odef_editor_view_settings"). + Caption("ODef Editor View Settings"). + MinSize(wx.Size(200,100)). + Left(). + CloseButton(True). + MaximizeButton(False). + Hide()) + + + # create the center pane(s) + #Timer creation (for rendering) + self.ogreTimer = wx.Timer() + self.ogreTimer.SetOwner(self) + self.Bind(wx.EVT_TIMER, self.onUpdateRender, self.ogreTimer) + self.ogreTimer.Start(25) + + # create timer for gui update + self.guitimer = wx.Timer() + self.guitimer.SetOwner(self) #Sets the timer to notify self: binding the timer event is not enough + self.Bind(wx.EVT_TIMER, self.OnGUITimer, self.guitimer) + self.guitimer.Start(200) - # the terrain editor ogre window - self.terrainOgreWin = RoRTerrainOgreWindow(self, wx.ID_ANY, rordir=self.rordir) - self._mgr.AddPane(self.terrainOgreWin, wx.aui.AuiPaneInfo().Name("ogre_terrain_content").CenterPane().Hide()) + # the terrain editor ogre window + self.terrainOgreWin = RoRTerrainOgreWindow(self, wx.ID_ANY, rordir=self.rordir) + self._mgr.AddPane(self.terrainOgreWin, wx.aui.AuiPaneInfo().Name("ogre_terrain_content").CenterPane().Hide()) # the odef editor ogre window - self.odefEditorOgreWin = ODefEditorOgreWindow(self, wx.ID_ANY, rordir=self.rordir) - self._mgr.AddPane(self.odefEditorOgreWin, wx.aui.AuiPaneInfo().Name("ogre_odef_editor_content").CenterPane().Hide()) + self.odefEditorOgreWin = ODefEditorOgreWindow(self, wx.ID_ANY, rordir=self.rordir) + self._mgr.AddPane(self.odefEditorOgreWin, wx.aui.AuiPaneInfo().Name("ogre_odef_editor_content").CenterPane().Hide()) - # the truck editor window - self.truckEditorOgreWin = RoRTruckOgreWindow(self, wx.ID_ANY) - self._mgr.AddPane(self.truckEditorOgreWin, wx.aui.AuiPaneInfo().Name("ogre_truck_editor_content").CenterPane().Hide()) + # the truck editor window + self.truckEditorOgreWin = RoRTruckOgreWindow(self, wx.ID_ANY) + self._mgr.AddPane(self.truckEditorOgreWin, wx.aui.AuiPaneInfo().Name("ogre_truck_editor_content").CenterPane().Hide()) - # the truck editor UV window - self.truckEditorUVOgreWin = RoRTruckUVOgreWindow(self, wx.ID_ANY) - self._mgr.AddPane(self.truckEditorUVOgreWin, wx.aui.AuiPaneInfo().Name("ogre_truck_editor_uv_content").Float().Hide()) - - + # the truck editor UV window + self.truckEditorUVOgreWin = RoRTruckUVOgreWindow(self, wx.ID_ANY) + self._mgr.AddPane(self.truckEditorUVOgreWin, wx.aui.AuiPaneInfo().Name("ogre_truck_editor_uv_content").Float().Hide()) + + # add the toolbars to the manager - self._mgr.AddPane(self.terraintoolbar, wx.aui.AuiPaneInfo(). - Name("terrain_toolbar"). - Caption("General Toolbar"). - ToolbarPane().Top(). - LeftDockable(False). - RightDockable(False). - Hide() - ) + self._mgr.AddPane(self.terraintoolbar, wx.aui.AuiPaneInfo(). + Name("terrain_toolbar"). + Caption("General Toolbar"). + ToolbarPane().Top(). + LeftDockable(False). + RightDockable(False). + Hide() + ) - # make some default perspectives - self._perspectives.append(self._mgr.SavePerspective()) + # make some default perspectives + self._perspectives.append(self._mgr.SavePerspective()) - # hide all first - self.terraintoolbar.Hide() - all_panes = self._mgr.GetAllPanes() - for ii in xrange(len(all_panes)): - if not all_panes[ii].IsToolbar(): - all_panes[ii].Hide() + # hide all first + self.terraintoolbar.Hide() + all_panes = self._mgr.GetAllPanes() + for ii in xrange(len(all_panes)): + if not all_panes[ii].IsToolbar(): + all_panes[ii].Hide() - # terrain perspective - self._mgr.GetPane("ogre_truck_editor_uv_content").Show(False) - self._mgr.GetPane("terrain_toolbar").Show(True) - self._mgr.GetPane("ogre_truck_editor_content").Show(False) - self._mgr.GetPane("ogre_odef_editor_content").Show(False) - self._mgr.GetPane("odef_editor_view_settings").Show(False) - self._mgr.GetPane("ogre_terrain_content").Show(True) - self._mgr.GetPane("object_preview").Show(True).Left() - self._mgr.GetPane("object_tree").Show(True) - self.objectPreviewWindow - self._perspectives.append(self._mgr.SavePerspective()) + # terrain perspective + self._mgr.GetPane("ogre_truck_editor_uv_content").Show(False) + self._mgr.GetPane("terrain_toolbar").Show(True) + self._mgr.GetPane("ogre_truck_editor_content").Show(False) + self._mgr.GetPane("ogre_odef_editor_content").Show(False) + self._mgr.GetPane("odef_editor_view_settings").Show(False) + self._mgr.GetPane("ogre_terrain_content").Show(True) + self._mgr.GetPane("object_preview").Show(True).Left() + self._mgr.GetPane("object_tree").Show(True) + self.objectPreviewWindow + self._perspectives.append(self._mgr.SavePerspective()) - # odef editor perspective - self._mgr.GetPane("ogre_truck_editor_uv_content").Show(False) - self._mgr.GetPane("terrain_toolbar").Show(False) - self._mgr.GetPane("ogre_truck_editor_content").Show(False) - self._mgr.GetPane("object_preview").Show(False) - self._mgr.GetPane("ogre_terrain_content").Show(False) - self._mgr.GetPane("ogre_odef_editor_content").Show(True) - self._mgr.GetPane("odef_editor_view_settings").Show(True) - self._mgr.GetPane("object_tree").Show(True) - self._perspectives.append(self._mgr.SavePerspective()) + # odef editor perspective + self._mgr.GetPane("ogre_truck_editor_uv_content").Show(False) + self._mgr.GetPane("terrain_toolbar").Show(False) + self._mgr.GetPane("ogre_truck_editor_content").Show(False) + self._mgr.GetPane("object_preview").Show(False) + self._mgr.GetPane("ogre_terrain_content").Show(False) + self._mgr.GetPane("ogre_odef_editor_content").Show(True) + self._mgr.GetPane("odef_editor_view_settings").Show(True) + self._mgr.GetPane("object_tree").Show(True) + self._perspectives.append(self._mgr.SavePerspective()) - # truck editor perspective - self._mgr.GetPane("ogre_truck_editor_uv_content").Show(True) - self._mgr.GetPane("terrain_toolbar").Show(False) - self._mgr.GetPane("ogre_truck_editor_content").Show(True) - self._mgr.GetPane("object_preview").Show(False) - self._mgr.GetPane("ogre_terrain_content").Show(False) - self._mgr.GetPane("ogre_odef_editor_content").Show(False) - self._mgr.GetPane("odef_editor_view_settings").Show(False) - self._mgr.GetPane("object_tree").Show(False) - self._perspectives.append(self._mgr.SavePerspective()) - - # load startup perspective - self._mgr.LoadPerspective(self._perspectives[0]) - - # "commit" all changes made to FrameManager - self._mgr.Update() + # truck editor perspective + self._mgr.GetPane("ogre_truck_editor_uv_content").Show(True) + self._mgr.GetPane("terrain_toolbar").Show(False) + self._mgr.GetPane("ogre_truck_editor_content").Show(True) + self._mgr.GetPane("object_preview").Show(False) + self._mgr.GetPane("ogre_terrain_content").Show(False) + self._mgr.GetPane("ogre_odef_editor_content").Show(False) + self._mgr.GetPane("odef_editor_view_settings").Show(False) + self._mgr.GetPane("object_tree").Show(False) + self._perspectives.append(self._mgr.SavePerspective()) + + # load startup perspective + self._mgr.LoadPerspective(self._perspectives[0]) + + # "commit" all changes made to FrameManager + self._mgr.Update() - self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnEraseBackground) - self.Bind(wx.EVT_SIZE, self.OnSize) - self.Bind(wx.EVT_CLOSE, self.OnClose) + self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnEraseBackground) + self.Bind(wx.EVT_SIZE, self.OnSize) + self.Bind(wx.EVT_CLOSE, self.OnClose) - self.Bind(wx.EVT_MENU, self.OnOpenTerrain, id=ID_OpenTerrain) - self.Bind(wx.EVT_MENU, self.OnSaveTerrain, id=ID_SaveTerrain) - self.Bind(wx.EVT_MENU, self.OnSaveTerrainAs, id=ID_SaveTerrainAs) - self.Bind(wx.EVT_MENU, self.OnViewHelp, id=ID_ViewHelp) - - self.Bind(wx.EVT_MENU, self.OnCreateOgre, id=ID_CreateOgre) - - self.Bind(wx.EVT_MENU, self.OnCreatePerspective, id=ID_CreatePerspective) - self.Bind(wx.EVT_MENU, self.OnCopyPerspective, id=ID_CopyPerspective) + self.Bind(wx.EVT_MENU, self.OnOpenTerrain, id=ID_OpenTerrain) + self.Bind(wx.EVT_MENU, self.OnSaveTerrain, id=ID_SaveTerrain) + self.Bind(wx.EVT_MENU, self.OnSaveTerrainAs, id=ID_SaveTerrainAs) + self.Bind(wx.EVT_MENU, self.OnViewHelp, id=ID_ViewHelp) + + self.Bind(wx.EVT_MENU, self.OnCreateOgre, id=ID_CreateOgre) + + self.Bind(wx.EVT_MENU, self.OnCreatePerspective, id=ID_CreatePerspective) + self.Bind(wx.EVT_MENU, self.OnCopyPerspective, id=ID_CopyPerspective) - self.Bind(wx.EVT_MENU, self.OnSettings, id=ID_Settings) - - self.Bind(wx.EVT_MENU, self.OnExit, id=ID_Quit) - self.Bind(wx.EVT_MENU, self.OnExit, id=wx.ID_EXIT) - self.Bind(wx.EVT_MENU, self.OnAbout, id=ID_About) - - self.Bind(wx.EVT_MENU_RANGE, self.OnRestorePerspective, id=ID_FirstPerspective, - id2=ID_FirstPerspective+1000) - - def changeEditorMode(self, id): - self._mgr.LoadPerspective(self._perspectives[id]) - self._mgr.Update() + self.Bind(wx.EVT_MENU, self.OnSettings, id=ID_Settings) - def OnViewHelp(self, event=None): - # show the settings pane, and float it - floating_pane = self._mgr.GetPane("help").Float().Show() + self.Bind(wx.EVT_MENU, self.OnExit, id=ID_Quit) + self.Bind(wx.EVT_MENU, self.OnExit, id=wx.ID_EXIT) + self.Bind(wx.EVT_MENU, self.OnAbout, id=ID_About) + + self.Bind(wx.EVT_MENU_RANGE, self.OnRestorePerspective, id=ID_FirstPerspective, + id2=ID_FirstPerspective+1000) + + def changeEditorMode(self, id): + self._mgr.LoadPerspective(self._perspectives[id]) + self._mgr.Update() + + def OnViewHelp(self, event=None): + # show the settings pane, and float it + floating_pane = self._mgr.GetPane("help").Float().Show() - if floating_pane.floating_pos == wx.DefaultPosition: - floating_pane.FloatingPosition(self.GetStartPosition()) + if floating_pane.floating_pos == wx.DefaultPosition: + floating_pane.FloatingPosition(self.GetStartPosition()) - self._mgr.Update() + self._mgr.Update() - - def addObjectToTerrain(self, filename): - try: - self.changeEditorMode(1) - onlyfilename, extension = os.path.splitext(os.path.basename(filename)) - if extension.lower() in ['.truck', '.load']: - if not self.terrainOgreWin.addTruckToTerrain(truckFilename=filename): - dlg = wx.MessageDialog(self, "You must select a position on the ground first!", "error", wx.OK | wx.ICON_INFORMATION) - dlg.ShowModal() - dlg.Destroy() - elif extension.lower() in ['.odef']: - if not self.terrainOgreWin.addObjectToTerrain(odefFilename=filename): - dlg = wx.MessageDialog(self, "You must select a position on the ground first!", "error", wx.OK | wx.ICON_INFORMATION) - dlg.ShowModal() - dlg.Destroy() - except: - pass - - def previewObject(self, filename): - #try: - self.objectPreviewWindow.loadFile(filename) - #except: - # pass + + def addObjectToTerrain(self, filename): + try: + self.changeEditorMode(1) + onlyfilename, extension = os.path.splitext(os.path.basename(filename)) + if extension.lower() in ['.truck', '.load']: + if not self.terrainOgreWin.addTruckToTerrain(truckFilename=filename): + dlg = wx.MessageDialog(self, "You must select a position on the ground first!", "error", wx.OK | wx.ICON_INFORMATION) + dlg.ShowModal() + dlg.Destroy() + elif extension.lower() in ['.odef']: + if not self.terrainOgreWin.addObjectToTerrain(odefFilename=filename): + dlg = wx.MessageDialog(self, "You must select a position on the ground first!", "error", wx.OK | wx.ICON_INFORMATION) + dlg.ShowModal() + dlg.Destroy() + except: + pass + + def previewObject(self, filename): + #try: + self.objectPreviewWindow.loadFile(filename) + #except: + # pass - def editODefFile(self, filename): - #try: - self.odefEditorOgreWin.loadFile(filename) - self.changeEditorMode(2) - self.oddefEditorViewSettings.resetControls() - #except Exception, err: - # print err - # pass + def editODefFile(self, filename): + #try: + self.odefEditorOgreWin.loadFile(filename) + self.changeEditorMode(2) + self.oddefEditorViewSettings.resetControls() + #except Exception, err: + # print err + # pass - def editTruck(self, filename): - #try: - tree = self.truckEditorOgreWin.LoadTruck(filename) - self.changeEditorMode(3) - self.truckEditorUVOgreWin.setTree(tree) - #except Exception, err: - # print err - # pass + def editTruck(self, filename): + #try: + tree = self.truckEditorOgreWin.LoadTruck(filename) + self.changeEditorMode(3) + self.truckEditorUVOgreWin.setTree(tree) + #except Exception, err: + # print err + # pass - def updateObjPosRot(self, event=None): - self.statusbar.SetStatusText(self.terrainOgreWin.currentStatusMsg, 1) - if self.terrainOgreWin.terrain is None: - return - if self.terrainOgreWin.selectedEntry is None: - self.statusbar.SetStatusText("Nothing selected", 2) - return - entry = self.terrainOgreWin.selectedEntry - #comment = self.terrainOgreWin.getCommentsForObject(n.getName()).lstrip('/') - #if comment.strip() != "": - # txt = "%s / %s" % (n.getName(), comment) - #else: - txt = "%s %s" % (entry.data.name, " ".join(entry.data.additionaloptions)) - self.statusbar.SetStatusText(txt, 2) - - posx, posy, posz, rotx, roty, rotz = self.terrainOgreWin.getSelectionPositionRotation() - txt = "%0.2f, %0.2f, %0.2f / %0.2f, %0.2f, %0.2f" % (posx, posy, posz, rotx, roty, rotz) - self.statusbar.SetStatusText(txt, 3) + def updateObjPosRot(self, event=None): + self.statusbar.SetStatusText(self.terrainOgreWin.currentStatusMsg, 1) + if self.terrainOgreWin.terrain is None: + return + if self.terrainOgreWin.selectedEntry is None: + self.statusbar.SetStatusText("Nothing selected", 2) + return + entry = self.terrainOgreWin.selectedEntry + #comment = self.terrainOgreWin.getCommentsForObject(n.getName()).lstrip('/') + #if comment.strip() != "": + # txt = "%s / %s" % (n.getName(), comment) + #else: + txt = "%s %s" % (entry.data.name, " ".join(entry.data.additionaloptions)) + self.statusbar.SetStatusText(txt, 2) + + posx, posy, posz, rotx, roty, rotz = self.terrainOgreWin.getSelectionPositionRotation() + txt = "%d, %0.2f, %0.2f, %0.2f / %0.2f, %0.2f, %0.2f" % (entry.data.line, posx, posy, posz, rotx, roty, rotz) + self.statusbar.SetStatusText(txt, 3) - def OnGUITimer(self, event): - #fill labels with some information, all windows have the same FPS! - txt = "%0.2f FPS" % (self.terrainOgreWin.renderWindow.getStatistics().lastFPS) - self.statusbar.SetStatusText(txt, 4) - self.updateObjPosRot() - - def onUpdateRender(self, event=None): - getOgreManager().RenderAll() - pass + def OnGUITimer(self, event): + #fill labels with some information, all windows have the same FPS! + txt='' + try: + txt = "%0.2f FPS" % (self.terrainOgreWin.renderWindow.getStatistics().lastFPS) + except: + pass + self.statusbar.SetStatusText(txt, 4) + self.updateObjPosRot() + + def onUpdateRender(self, event=None): + getOgreManager().RenderAll() + pass - def openTerrain(self, filename): - self.changeEditorMode(1) - self.terrainOgreWin.LoadTerrain(filename) - self.terraintoolbar.EnableTool(ID_AddObject, True) - self.terraintoolbar.EnableTool(ID_DeleteSelection, True) - self.terraintoolbar.EnableTool(ID_CopySelection, True) - self.terraintoolbar.EnableTool(ID_PasteSelection, True) - self.terraintoolbar.EnableTool(ID_UndoAction, True) - self.terraintoolbar.EnableTool(ID_RedoAction, True) - self.terraintoolbar.EnableTool(ID_FindObject, True) - self.terraintoolbar.EnableTool(ID_SaveTerrain, True) - self.terraintoolbar.EnableTool(ID_SaveTerrainAs, True) + def openTerrain(self, filename): + self.changeEditorMode(1) + self.terrainOgreWin.LoadTerrain(filename) + self.terraintoolbar.EnableTool(ID_AddObject, True) + self.terraintoolbar.EnableTool(ID_DeleteSelection, True) + self.terraintoolbar.EnableTool(ID_CopySelection, True) + self.terraintoolbar.EnableTool(ID_PasteSelection, True) + self.terraintoolbar.EnableTool(ID_UndoAction, True) + self.terraintoolbar.EnableTool(ID_RedoAction, True) + self.terraintoolbar.EnableTool(ID_FindObject, True) + self.terraintoolbar.EnableTool(ID_SaveTerrain, True) + self.terraintoolbar.EnableTool(ID_SaveTerrainAs, True) - def OnOpenTerrain(self, event=None): - default = "" - if self.rordir: - default = os.path.join(self.rordir, TERRAINDIR) - dialog = wx.FileDialog(self, "Open Terrain", default, "", "Terrain Files (*.terrn)|*.terrn", wx.FD_OPEN | wx.FD_FILE_MUST_EXIST) - res = dialog.ShowModal() - if res == wx.ID_OK: - self.openTerrain(dialog.GetPath()) + def OnOpenTerrain(self, event=None): + default = "" + if self.rordir: + default = os.path.join(self.rordir, TERRAINDIR) + dialog = wx.FileDialog(self, "Open Terrain", default, "", "Terrain Files (*.terrn)|*.terrn", wx.FD_OPEN | wx.FD_FILE_MUST_EXIST) + res = dialog.ShowModal() + if res == wx.ID_OK: + self.openTerrain(dialog.GetPath()) - def OnSaveTerrain(self, event=None): - if not self.terrainOgreWin.SaveTerrain(): - dlg = wx.MessageDialog(self, "error while saving, see console!\n","error", wx.OK | wx.ICON_INFORMATION) - dlg.ShowModal() - dlg.Destroy() + def OnSaveTerrain(self, event=None): + if not self.terrainOgreWin.SaveTerrain(): + dlg = wx.MessageDialog(self, "error while saving, see console!\n","error", wx.OK | wx.ICON_INFORMATION) + dlg.ShowModal() + dlg.Destroy() - def OnSaveTerrainAs(self, event=None): - default = "" - if self.rordir: - default = os.path.join(self.rordir, TERRAINDIR) - dialog = wx.FileDialog(self, "Save Terrain as", default, "", "Terrain Files (*.terrn)|*.terrn", wx.FD_SAVE | wx.FD_OVERWRITE_PROMPT) - res = dialog.ShowModal() - if res == wx.ID_OK: - if not self.terrainOgreWin.SaveTerrain(dialog.GetPath()): - dlg = wx.MessageDialog(self, "error while saving as another file, see console!\n","error", wx.OK | wx.ICON_INFORMATION) - dlg.ShowModal() - dlg.Destroy() + def OnSaveTerrainAs(self, event=None): + default = "" + if self.rordir: + default = os.path.join(self.rordir, TERRAINDIR) + dialog = wx.FileDialog(self, "Save Terrain as", default, "", "Terrain Files (*.terrn)|*.terrn", wx.FD_SAVE | wx.FD_OVERWRITE_PROMPT) + res = dialog.ShowModal() + if res == wx.ID_OK: + if not self.terrainOgreWin.SaveTerrain(dialog.GetPath()): + dlg = wx.MessageDialog(self, "error while saving as another file, see console!\n","error", wx.OK | wx.ICON_INFORMATION) + dlg.ShowModal() + dlg.Destroy() - def OnClose(self, event): - self.OnExit(event) - - def OnExit(self, event): - try: - all_panes = self._mgr.GetAllPanes() - for ii in xrange(len(all_panes)): - if not all_panes[ii].IsToolbar(): - all_panes[ii].Hide() - self._mgr.UnInit() - del self._mgr - self.Destroy() - self.Close() - except: - pass + def OnClose(self, event): + self.OnExit(event) + + def OnExit(self, event): + try: + all_panes = self._mgr.GetAllPanes() + for ii in xrange(len(all_panes)): + if not all_panes[ii].IsToolbar(): + all_panes[ii].Hide() + self._mgr.UnInit() + del self._mgr + self.Destroy() + self.Close() + except: + pass - def OnAbout(self, event): - ShowOnAbout() + def OnAbout(self, event): + ShowOnAbout() - def GetDockArt(self): - return self._mgr.GetArtProvider() + def GetDockArt(self): + return self._mgr.GetArtProvider() - def DoUpdate(self): - self._mgr.Update() + def DoUpdate(self): + self._mgr.Update() - def OnEraseBackground(self, event): - event.Skip() + def OnEraseBackground(self, event): + event.Skip() - def OnSize(self, event): - event.Skip() + def OnSize(self, event): + event.Skip() - def OnSettings(self, event): - # show the settings pane, and float it - floating_pane = self._mgr.GetPane("settings").Float().Show() + def OnSettings(self, event): + # show the settings pane, and float it + floating_pane = self._mgr.GetPane("settings").Float().Show() - if floating_pane.floating_pos == wx.DefaultPosition: - floating_pane.FloatingPosition(self.GetStartPosition()) + if floating_pane.floating_pos == wx.DefaultPosition: + floating_pane.FloatingPosition(self.GetStartPosition()) - self._mgr.Update() + self._mgr.Update() - def managerInit(self): - flags = self._mgr.GetFlags() - # based on default settings! - flags |= wx.aui.AUI_MGR_ALLOW_ACTIVE_PANE - flags &= ~wx.aui.AUI_MGR_TRANSPARENT_DRAG - self._mgr.SetFlags(flags) + def managerInit(self): + flags = self._mgr.GetFlags() + # based on default settings! + flags |= wx.aui.AUI_MGR_ALLOW_ACTIVE_PANE + flags &= ~wx.aui.AUI_MGR_TRANSPARENT_DRAG + self._mgr.SetFlags(flags) - def OnCreatePerspective(self, event): - dlg = wx.TextEntryDialog(self, "Enter a name for the new perspective:", "AUI Test") - - dlg.SetValue(("Perspective %d")%(len(self._perspectives)+1)) - if dlg.ShowModal() != wx.ID_OK: - return - - if len(self._perspectives) == 0: - self._perspectives_menu.AppendSeparator() - - self._perspectives_menu.Append(ID_FirstPerspective + len(self._perspectives), dlg.GetValue()) - self._perspectives.append(self._mgr.SavePerspective()) + def OnCreatePerspective(self, event): + dlg = wx.TextEntryDialog(self, "Enter a name for the new perspective:", "AUI Test") + + dlg.SetValue(("Perspective %d")%(len(self._perspectives)+1)) + if dlg.ShowModal() != wx.ID_OK: + return + + if len(self._perspectives) == 0: + self._perspectives_menu.AppendSeparator() + + self._perspectives_menu.Append(ID_FirstPerspective + len(self._perspectives), dlg.GetValue()) + self._perspectives.append(self._mgr.SavePerspective()) - def OnCopyPerspective(self, event): - s = self._mgr.SavePerspective() - - if wx.TheClipboard.Open(): - - wx.TheClipboard.SetData(wx.TextDataObject(s)) - wx.TheClipboard.Close() - - def OnRestorePerspective(self, event): - self._mgr.LoadPerspective(self._perspectives[event.GetId() - ID_FirstPerspective]) + def OnCopyPerspective(self, event): + s = self._mgr.SavePerspective() + + if wx.TheClipboard.Open(): + + wx.TheClipboard.SetData(wx.TextDataObject(s)) + wx.TheClipboard.Close() + + def OnRestorePerspective(self, event): + self._mgr.LoadPerspective(self._perspectives[event.GetId() - ID_FirstPerspective]) - def GetStartPosition(self): - self.x = self.x + 20 - x = self.x - pt = self.ClientToScreen(wx.Point(0, 0)) - - return wx.Point(pt.x + x, pt.y + x) + def GetStartPosition(self): + self.x = self.x + 20 + x = self.x + pt = self.ClientToScreen(wx.Point(0, 0)) + + return wx.Point(pt.x + x, pt.y + x) - def OnCreateOgre(self, event): - self._mgr.AddPane(self.CreateOgreCtrl(), wx.aui.AuiPaneInfo(). - Caption("Ogre Window"). - Float().FloatingPosition(self.GetStartPosition()). - CloseButton(True).MaximizeButton(False)) - self._mgr.Update() - - def CreateOgreCtrl(self): - return RoRTerrainOgreWindow(self, wx.ID_ANY, maininstance=self.terrainOgreWin) + def OnCreateOgre(self, event): + self._mgr.AddPane(self.CreateOgreCtrl(), wx.aui.AuiPaneInfo(). + Caption("Ogre Window"). + Float().FloatingPosition(self.GetS... [truncated message content] |
From: <ror...@us...> - 2008-01-15 12:45:15
|
Revision: 191 http://roreditor.svn.sourceforge.net/roreditor/?rev=191&view=rev Author: rorthomas Date: 2008-01-15 04:44:59 -0800 (Tue, 15 Jan 2008) Log Message: ----------- -fixed some bugs -removed newton physics completely. cleaned up code. added error msgs Modified Paths: -------------- trunk/lib_common/roreditor/RoRObjectPreviewOgreWindow.py trunk/lib_common/roreditor/RoRTruckOgreWindow.py Modified: trunk/lib_common/roreditor/RoRObjectPreviewOgreWindow.py =================================================================== --- trunk/lib_common/roreditor/RoRObjectPreviewOgreWindow.py 2007-11-27 15:31:10 UTC (rev 190) +++ trunk/lib_common/roreditor/RoRObjectPreviewOgreWindow.py 2008-01-15 12:44:59 UTC (rev 191) @@ -148,8 +148,10 @@ log().exception(str(e)) try: - self.logotextnode.detachAllObjects() - self.logowheelnode.detachAllObjects() + if self.logotextnode: + self.logotextnode.detachAllObjects() + if self.logowheelnode: + self.logowheelnode.detachAllObjects() self.sceneManager.destroySceneNode(self.logotextnode.getName()) self.sceneManager.destroySceneNode(self.logowheelnode.getName()) self.sceneManager.destroyEntity(self.logotextentity) @@ -158,7 +160,8 @@ log().exception(str(e)) try: #BUG: next line fails and goes to except - self.objnode.detachAllObjects() + if self.objnode: + self.objnode.detachAllObjects() self.sceneManager.destroySceneNode(self.objnode.getName()) except Exception, e: log().exception(str(e)) Modified: trunk/lib_common/roreditor/RoRTruckOgreWindow.py =================================================================== --- trunk/lib_common/roreditor/RoRTruckOgreWindow.py 2007-11-27 15:31:10 UTC (rev 190) +++ trunk/lib_common/roreditor/RoRTruckOgreWindow.py 2008-01-15 12:44:59 UTC (rev 191) @@ -15,7 +15,6 @@ from wxogre.wxOgreWindow import * import ogre.renderer.OGRE as Ogre -import ogre.physics.OgreNewt as OgreNewt import ogre.io.OIS as OIS TIMER = 25 @@ -25,11 +24,9 @@ def __init__(self, parent, ID, size = wx.Size(200,200), **kwargs): self.parent = parent self.rordir = getSettingsManager().getSetting("RigsOfRods", "BasePath") - self.World = OgreNewt.World() self.sceneManager = None - self.uvFrame = None + #self.uvFrame = None self.clearlist = {'entity':[]} - self.bodies = [] self.initScene() wxOgreWindow.__init__(self, parent, ID, size = size, **kwargs) @@ -45,18 +42,14 @@ for n in self.nodes: n[0].detachAllObjects() self.sceneManager.destroySceneNode(n[0].getName()) - except: - pass + except Exception, e: + print "error clearing up nodes: "+str(e)+" / "+str(e.__doc__) try: for e in self.clearlist['entity']: print e self.sceneManager.destroyEntity(e) - except: - pass - try: - self.uvFrame.Close() - except: - pass + except "error clearing up entities: "+Exception, e: + print str(e)+" / "+str(e.__doc__) self.nodes = {} self.beams = {} self.shocks = {} @@ -69,16 +62,13 @@ def __del__ (self): - ## delete the world when we're done. - del self.bodies - del self.World + pass def OnFrameStarted(self): if self.enablephysics: self.World.update(TIMER) self.updateBeams() - pass def OnFrameEnded(self): pass @@ -128,8 +118,10 @@ def createNode(self, node): try: + print "creating node " id = int(node[0]) pos = ogre.Vector3(float(node[1]),float(node[2]),float(node[3])) + print "creating node " + str(pos.x) + ", " + str(pos.y) + ", " + str(pos.z) if len(node) == 5: option = node[4] else: @@ -139,8 +131,6 @@ size = 0.1 mass = 0.5 * size - inertia = OgreNewt.CalcBoxSolid( mass, size ) - box1node = self.sceneManager.getRootSceneNode().createChildSceneNode() box1 = self.sceneManager.createEntity("NodeEntity"+str(self.EntityCount), "ellipsoid.mesh" ) self.clearlist['entity'].append("NodeEntity"+str(self.EntityCount)) @@ -149,16 +139,6 @@ box1node.setScale(size) box1.setNormaliseNormals(True) - col = OgreNewt.Ellipsoid( self.World, size ) - bod = OgreNewt.Body(self.World, col) - self.bodies.append (bod) - - del col - - bod.attachToNode( box1node ) - bod.setMassMatrix( mass, inertia ) - bod.setStandardForceCallback() - if option == 'l': matname = "TruckEditor/NodeLoad" elif option == 'f': @@ -175,12 +155,12 @@ matname = "TruckEditor/NodeNormal" box1.setMaterialName(matname) box1.setCastShadows(False) + box1node.setPosition(pos) - bod.setPositionOrientation(pos, Ogre.Quaternion.IDENTITY ) + print str(id) self.nodes[id] = [box1node, option, node] - return bod - except: - pass + except Exception, e: + print "error creating nodes: "+str(e)+" / "+str(e.__doc__) def showSubmeshs(self, value): for k in self.submeshs.keys(): @@ -260,8 +240,11 @@ def createBeam(self, id0, id1, id2, options): try: + print "creating beam " + str(id0) + " - " + str(id1) pos1 = self.nodes[id1][0].getPosition() pos2 = self.nodes[id2][0].getPosition() + print "pos1: " + str(pos1.x) + ", " + str(pos1.y) + ", " + str(pos1.z) + print "pos2: " + str(pos2.x) + ", " + str(pos2.y) + ", " + str(pos2.z) idstr = str(id0) + str(id1) + str(id2) line = self.sceneManager.createManualObject("manual"+idstr) @@ -280,10 +263,9 @@ linenode = self.sceneManager.getRootSceneNode().createChildSceneNode() linenode.attachObject(line) self.beams[id0] = [linenode, id1, id2, options, line] - print id0 - except: - pass - + except Exception, e: + print "error creating beam: "+str(e)+" / "+str(e.__doc__) + def updateBeams(self): for bk in self.beams.keys(): beam = self.beams[bk] @@ -298,7 +280,7 @@ line.position(pos2) line.end() except Exception, e: - print str(e) + print "error updating beams: "+str(e)+" / "+str(e.__doc__) continue @@ -321,9 +303,9 @@ linenode = self.sceneManager.getRootSceneNode().createChildSceneNode() linenode.attachObject(line) self.shocks[id0] = [linenode, id1, id2, options, line] - except: - pass - + except Exception, e: + print "error creating shock: "+str(e)+" / "+str(e.__doc__) + def createSubMeshGroup(self, tree, smg, smgid): #print smg try: @@ -374,16 +356,13 @@ smnode.attachObject(sm) self.submeshs[smgid] = [smnode, smgid, smg, sm] - except: - pass - + except Exception, e: + print "error creating submesh-group: "+str(e)+" / "+str(e.__doc__) + def makeSimpleBox( self, size, pos, orient ): ## base mass on the size of the object. mass = size.x * size.y * size.z * 2.5 - ## calculate the inertia based on box formula and mass - inertia = OgreNewt.CalcBoxSolid( mass, size ) - box1 = self.sceneManager.createEntity("Entity"+str(self.EntityCount), "cap_mid.mesh" ) self.clearlist['entity'].append("Entity"+str(self.EntityCount)) @@ -393,22 +372,10 @@ box1node.setScale( size ) box1.setNormaliseNormals(True) - col = OgreNewt.Box( self.World, size ) - bod = OgreNewt.Body( self.World, col ) - del col - - bod.attachToNode( box1node ) - bod.setMassMatrix( mass, inertia ) - bod.setStandardForceCallback() - box1.setMaterialName( "mysimple/terrainselect" ) box1.setCastShadows(False) - bod.setPositionOrientation( pos, orient ) - return bod - - def populateScene(self): self.sceneManager.AmbientLight = ogre.ColourValue(0.7, 0.7, 0.7 ) @@ -426,44 +393,7 @@ self.createGroundPlane() - stat_col = OgreNewt.TreeCollisionSceneParser( self.World ) - stat_col.parseScene( self.planenode, True ) - bod = OgreNewt.Body( self.World, stat_col ) - self.bodies.append(bod) - del stat_col - def createTestRope(self): - ## make a simple rope. - size = Ogre.Vector3(5,0.5,0.5) - pos = Ogre.Vector3(0,20,0) - orient = Ogre.Quaternion.IDENTITY - - ## loop through, making bodies and connecting them. - parent = None - child = None - - for x in range (5): - ## make the next box. - child = self.makeSimpleBox(size, pos, orient) - self.bodies.append(child) - - ## make the joint right between the bodies... - if (parent): - joint = OgreNewt.BallAndSocket( self.World, child, parent, pos-Ogre.Vector3(size.x/2,0,0) ) - - else: - ## no parent, this is the first joint, so just pass NULL as the parent, to stick it to the "world" - joint = OgreNewt.BallAndSocket( self.World, child, None, pos-Ogre.Vector3(size.x/2,0,0) ) - - ## offset pos a little more. - pos += Ogre.Vector3(size.x,0,0) - - ## save the last body for the next loop! - parent = child - - ## NOW - we also have to kepe copies of the joints, otherwise they get deleted !!! - self.bodies.append (joint) - def createGroundPlane(self): plane = ogre.Plane() plane.normal = ogre.Vector3(0, 1, 0) @@ -480,16 +410,7 @@ self.planenode = self.sceneManager.getRootSceneNode().createChildSceneNode() self.planenode.attachObject(entity) - #col = OgreNewt.TreeCollision(self.World, self.planenode, True) - groundthickness = 50 - boxsize = ogre.Vector3(planesize, groundthickness, planesize) - col = OgreNewt.Box(self.World, boxsize ) - bod = OgreNewt.Body( self.World, col ) - self.bodies.append(bod) - bod.setPositionOrientation( Ogre.Vector3(0.0, -groundthickness - plane.d, 0.0), Ogre.Quaternion.IDENTITY ) - del col - def LoadTruck(self, fn): if not os.path.isfile(fn): print "truck file not found: "+fn @@ -503,7 +424,6 @@ self.initScene() self.CreateTruck(p.tree) - self.createTestRope() return p.tree @@ -541,13 +461,9 @@ else: option = None #print beam - try: - self.createBeam(beamcounter, int(beam[0]),int(beam[1]), option) - beamcounter += 1 - except: - pass + self.createBeam(beamcounter, int(beam[0]),int(beam[1]), option) + beamcounter += 1 - if 'shocks' in tree.keys(): shockcounter = 0 for shockobj in tree['shocks']: @@ -559,10 +475,7 @@ else: option = None #print beam - try: - self.createShock(shockcounter, int(shock[0]),int(shock[1]), option) - except: - pass + self.createShock(shockcounter, int(shock[0]),int(shock[1]), option) shockcounter += 1 smgcounter = 0 @@ -571,13 +484,13 @@ self.createSubMeshGroup(tree, smg,smgcounter) smgcounter += 1 - from UVFrame import * - self.uvFrame = UVFrame(self, wx.ID_ANY, "") - self.uvFrame.setTree(tree) - self.uvFrame.Show() - except: - pass - + #from UVFrame import * + #self.uvFrame = UVFrame(self, wx.ID_ANY, "") + #self.uvFrame.setTree(tree) + #self.uvFrame.Show() + except Exception, e: + print "error creating truck: "+str(e)+" / "+str(e.__doc__) + def onMouseEvent(self,event): width, height, a, b, c = self.renderWindow.getMetrics() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ror...@us...> - 2007-11-27 15:31:12
|
Revision: 190 http://roreditor.svn.sourceforge.net/roreditor/?rev=190&view=rev Author: rorthomas Date: 2007-11-27 07:31:10 -0800 (Tue, 27 Nov 2007) Log Message: ----------- updated setup, removed menu Modified Paths: -------------- trunk/devtools/setup/setup.nsi Added Paths: ----------- trunk/editor.ini trunk/rortoolkit.py trunk/rortoolkit_old.py Removed Paths: ------------- trunk/roreditors.py trunk/rortoolkit.py Modified: trunk/devtools/setup/setup.nsi =================================================================== --- trunk/devtools/setup/setup.nsi 2007-11-27 13:16:15 UTC (rev 189) +++ trunk/devtools/setup/setup.nsi 2007-11-27 15:31:10 UTC (rev 190) @@ -232,7 +232,7 @@ SectionIn 1 2 RO SetOutPath "$INSTDIR" SetOverwrite try - File /r /x *.pyc /x *.pyo /x doc /x devtools /x 3rdparty /x downloaded /x graphs ..\..\* + File /r /x *.pyc /x *.pyo /x doc /x devtools /x 3rdparty /x downloaded /x graphs /x linux /x lib_linux /x tools /x .svn ..\..\* SectionEnd Added: trunk/editor.ini =================================================================== --- trunk/editor.ini (rev 0) +++ trunk/editor.ini 2007-11-27 15:31:10 UTC (rev 190) @@ -0,0 +1,3 @@ +[RigsOfRods] +basepath = invalid + Deleted: trunk/roreditors.py =================================================================== --- trunk/roreditors.py 2007-11-27 13:16:15 UTC (rev 189) +++ trunk/roreditors.py 2007-11-27 15:31:10 UTC (rev 190) @@ -1,36 +0,0 @@ -#!/bin/env python -#Thomas Fischer 31/05/2007, th...@th... -import sys, os, os.path - -def main(): - """ - main method - """ - rorexecutable = '' - if sys.platform in ['linux', 'linux2']: - sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "lib_common")) - sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "lib_linux")) - rorexecutable = "RoR.bin" - elif sys.platform in ['win32']: - sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "lib_common")) - sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "lib_windows")) - rorexecutable = "RoR.exe" - - import ror.rorcommon - if not ror.rorcommon.checkRoRDirectory(): - import ror.starter - ror.starter.startApp() - - # Import Psyco if available - try: - import psyco - psyco.full() - except ImportError: - pass - - import roreditor.MainFrame - roreditor.MainFrame.startApp() - - -if __name__=="__main__": - main() \ No newline at end of file Deleted: trunk/rortoolkit.py =================================================================== --- trunk/rortoolkit.py 2007-11-27 13:16:15 UTC (rev 189) +++ trunk/rortoolkit.py 2007-11-27 15:31:10 UTC (rev 190) @@ -1,30 +0,0 @@ -#!/bin/env python -#Thomas Fischer 31/05/2007, th...@th... -import sys, os, os.path - -def main(): - """ - main method - """ - if sys.platform in ['linux', 'linux2']: - sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "lib_common")) - sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "lib_linux")) - elif sys.platform in ['win32']: - sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "lib_common")) - sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "lib_windows")) - - # Import Psyco if available - try: - import psyco - #psyco.full() - #psyco.log() - #psyco.profile() - except ImportError: - pass - - import ror.starter - ror.starter.startApp() - - -if __name__=="__main__": - main() \ No newline at end of file Copied: trunk/rortoolkit.py (from rev 187, trunk/roreditors.py) =================================================================== --- trunk/rortoolkit.py (rev 0) +++ trunk/rortoolkit.py 2007-11-27 15:31:10 UTC (rev 190) @@ -0,0 +1,36 @@ +#!/bin/env python +#Thomas Fischer 31/05/2007, th...@th... +import sys, os, os.path + +def main(): + """ + main method + """ + rorexecutable = '' + if sys.platform in ['linux', 'linux2']: + sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "lib_common")) + sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "lib_linux")) + rorexecutable = "RoR.bin" + elif sys.platform in ['win32']: + sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "lib_common")) + sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "lib_windows")) + rorexecutable = "RoR.exe" + + import ror.rorcommon + if not ror.rorcommon.checkRoRDirectory(): + import ror.starter + ror.starter.startApp() + + # Import Psyco if available + try: + import psyco + psyco.full() + except ImportError: + pass + + import roreditor.MainFrame + roreditor.MainFrame.startApp() + + +if __name__=="__main__": + main() \ No newline at end of file Copied: trunk/rortoolkit_old.py (from rev 187, trunk/rortoolkit.py) =================================================================== --- trunk/rortoolkit_old.py (rev 0) +++ trunk/rortoolkit_old.py 2007-11-27 15:31:10 UTC (rev 190) @@ -0,0 +1,30 @@ +#!/bin/env python +#Thomas Fischer 31/05/2007, th...@th... +import sys, os, os.path + +def main(): + """ + main method + """ + if sys.platform in ['linux', 'linux2']: + sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "lib_common")) + sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "lib_linux")) + elif sys.platform in ['win32']: + sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "lib_common")) + sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "lib_windows")) + + # Import Psyco if available + try: + import psyco + #psyco.full() + #psyco.log() + #psyco.profile() + except ImportError: + pass + + import ror.starter + ror.starter.startApp() + + +if __name__=="__main__": + main() \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ror...@us...> - 2007-11-27 13:16:18
|
Revision: 189 http://roreditor.svn.sourceforge.net/roreditor/?rev=189&view=rev Author: rorthomas Date: 2007-11-27 05:16:15 -0800 (Tue, 27 Nov 2007) Log Message: ----------- bugfixed updated setup Modified Paths: -------------- trunk/devtools/setup/setup.nsi trunk/lib_common/ror/starter.py Modified: trunk/devtools/setup/setup.nsi =================================================================== --- trunk/devtools/setup/setup.nsi 2007-11-27 12:55:32 UTC (rev 188) +++ trunk/devtools/setup/setup.nsi 2007-11-27 13:16:15 UTC (rev 189) @@ -153,80 +153,80 @@ Abort FunctionEnd -Function InstallDirectX - InitPluginsDir - File /oname=$PLUGINSDIR\dxwebsetup.exe "..\..\tools\3rdparty\dxwebsetup.exe" - Banner::show /NOUNLOAD "Installing lastest DirectX ..." - ExecWait '"$PLUGINSDIR\dxwebsetup.exe /Q"' - Delete $PLUGINSDIR\dxwebsetup.exe - Banner::destroy -FunctionEnd +#Function InstallDirectX +# InitPluginsDir +# File /oname=$PLUGINSDIR\dxwebsetup.exe "..\..\tools\3rdparty\dxwebsetup.exe" +# Banner::show /NOUNLOAD "Installing lastest DirectX ..." +# ExecWait '"$PLUGINSDIR\dxwebsetup.exe /Q"' +# Delete $PLUGINSDIR\dxwebsetup.exe +# Banner::destroy +#FunctionEnd -Function InstallPyWin32 - InitPluginsDir - File /oname=$PLUGINSDIR\pywin32-setup.exe "..\..\tools\3rdparty\pywin32-setup.exe" - Banner::show /NOUNLOAD "Installing Python for Windows ..." - ExecWait '"$PLUGINSDIR\pywin32-setup.exe"' - Delete $PLUGINSDIR\pywin32-setup.exe - Banner::destroy -FunctionEnd +#Function InstallPyWin32 +# InitPluginsDir +# File /oname=$PLUGINSDIR\pywin32-setup.exe "..\..\tools\3rdparty\pywin32-setup.exe" +# Banner::show /NOUNLOAD "Installing Python for Windows ..." +# ExecWait '"$PLUGINSDIR\pywin32-setup.exe"' +# Delete $PLUGINSDIR\pywin32-setup.exe +# Banner::destroy +#FunctionEnd -Function InstallPyParsing - InitPluginsDir - File /oname=$PLUGINSDIR\pyparsing-1.4.6.win32.exe "..\..\tools\3rdparty\pyparsing-1.4.6.win32.exe" - Banner::show /NOUNLOAD "Installing PyParsing Python Module ..." - ExecWait '"$PLUGINSDIR\pyparsing-1.4.6.win32.exe"' - Delete $PLUGINSDIR\pyparsing-1.4.6.win32.exe - Banner::destroy -FunctionEnd +#Function InstallPyParsing +# InitPluginsDir +# File /oname=$PLUGINSDIR\pyparsing-1.4.6.win32.exe "..\..\tools\3rdparty\pyparsing-1.4.6.win32.exe" +# Banner::show /NOUNLOAD "Installing PyParsing Python Module ..." +# ExecWait '"$PLUGINSDIR\pyparsing-1.4.6.win32.exe"' +# Delete $PLUGINSDIR\pyparsing-1.4.6.win32.exe +# Banner::destroy +#FunctionEnd -Function InstallGraphViz - InitPluginsDir - File /oname=$PLUGINSDIR\graphviz-2.12.exe "..\..\tools\3rdparty\graphviz-2.12.exe" - Banner::show /NOUNLOAD "Installing Graphviz for Windows ..." - ExecWait '"$PLUGINSDIR\graphviz-2.12.exe"' - Delete $PLUGINSDIR\graphviz-2.12.exe - Banner::destroy -FunctionEnd +#Function InstallGraphViz +# InitPluginsDir +# File /oname=$PLUGINSDIR\graphviz-2.12.exe "..\..\tools\3rdparty\graphviz-2.12.exe" +# Banner::show /NOUNLOAD "Installing Graphviz for Windows ..." +# ExecWait '"$PLUGINSDIR\graphviz-2.12.exe"' +# Delete $PLUGINSDIR\graphviz-2.12.exe +# Banner::destroy +#FunctionEnd -Function ChangeRoRRepoReg - Banner::show /NOUNLOAD "Updating RoR Repository Protocol Extensions ..." - WriteRegStr HKCR "RoRRepo" "" "URL:RoRRepo Protocol" - WriteRegStr HKCR "RoRRepo" "URL Protocol" "" - WriteRegStr HKCR "RoRRepo\shell" "" "" - WriteRegStr HKCR "RoRRepo\shell\open" "" "" - ReadEnvStr $0 SYSTEMDRIVE - WriteRegStr HKCR 'RoRRepo\shell\open\command' '' '"$0\python25\python.exe" "$INSTDIR\tools\modtool.py" "installrepo" "%1"' - Banner::destroy -FunctionEnd +#Function ChangeRoRRepoReg +# Banner::show /NOUNLOAD "Updating RoR Repository Protocol Extensions ..." +# WriteRegStr HKCR "RoRRepo" "" "URL:RoRRepo Protocol" +# WriteRegStr HKCR "RoRRepo" "URL Protocol" "" +# WriteRegStr HKCR "RoRRepo\shell" "" "" +# WriteRegStr HKCR "RoRRepo\shell\open" "" "" +# ReadEnvStr $0 SYSTEMDRIVE +# WriteRegStr HKCR 'RoRRepo\shell\open\command' '' '"$0\python25\python.exe" "$INSTDIR\tools\modtool.py" "installrepo" "%1"' +# Banner::destroy +#FunctionEnd -Function .onInit - InitPluginsDir - File /oname=$PLUGINSDIR\splash.bmp "splash.bmp" - advsplash::show 1000 1300 600 -1 $PLUGINSDIR\splash - Pop $0 - Delete $PLUGINSDIR\splash.bmp - !insertmacro MUI_LANGDLL_DISPLAY -FunctionEnd +#Function .onInit +# InitPluginsDir +# File /oname=$PLUGINSDIR\splash.bmp "splash.bmp" +# advsplash::show 1000 1300 600 -1 $PLUGINSDIR\splash +# Pop $0 +# Delete $PLUGINSDIR\splash.bmp +# !insertmacro MUI_LANGDLL_DISPLAY +#FunctionEnd Section "-Install Python" SEC01 SectionIn 1 2 RO Call CheckForPython SectionEnd -Section "Required Tools" SEC02 - SectionIn 1 2 RO - Call InstallDirectX -SectionEnd +#Section "Required Tools" SEC02 +# SectionIn 1 2 RO +# Call InstallDirectX +#SectionEnd -Section /o "Optional Tools" SEC03 - AddSize 20000 - SectionIn 1 - Call InstallPyWin32 - Call InstallPyParsing - Call InstallGraphViz -SectionEnd +#Section /o "Optional Tools" SEC03 +# AddSize 20000 +# SectionIn 1 +# Call InstallPyWin32 +# Call InstallPyParsing +# Call InstallGraphViz +#SectionEnd Section "!RoR Toolkit" SEC04 SectionIn 1 2 RO @@ -256,13 +256,11 @@ CreateDirectory "$SMPROGRAMS\RoRToolkit" CreateShortCut "$SMPROGRAMS\RoRToolkit\Website.lnk" "$INSTDIR\${PRODUCT_NAME}.url" CreateShortCut "$SMPROGRAMS\RoRToolkit\Uninstall.lnk" "$INSTDIR\uninst.exe" - CreateShortCut '$SMPROGRAMS\RoRToolkit\RoR Terrain Editor.lnk' '$INSTDIR\terraineditor.py' '' '$INSTDIR\ror.ico' - CreateShortCut '$SMPROGRAMS\RoRToolkit\RoR Truck Editor.lnk' '$INSTDIR\truckeditor.py' '' '$INSTDIR\ror.ico' CreateShortCut '$SMPROGRAMS\RoRToolkit\RoR Toolkit.lnk' '$INSTDIR\rortoolkit.py' '' '$INSTDIR\ror.ico' SectionEnd Section -Post - Call ChangeRoRRepoReg + #Call ChangeRoRRepoReg WriteUninstaller "$INSTDIR\uninst.exe" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe" Modified: trunk/lib_common/ror/starter.py =================================================================== --- trunk/lib_common/ror/starter.py 2007-11-27 12:55:32 UTC (rev 188) +++ trunk/lib_common/ror/starter.py 2007-11-27 13:16:15 UTC (rev 189) @@ -96,7 +96,7 @@ self.btnStartRoR.Enable(False) #self.btnStartTruckEditor.Enable(False) self.btnStartTerrainEditor.Enable(False) - self.btnBugReport.Enable(False) + #self.btnBugReport.Enable(False) self.lblRoRDir.SetLabel("Please select Rigs of Rods Directory!") else: self.btnStartRoR.Enable(True) @@ -194,7 +194,7 @@ dlg = wx.MessageDialog(self, "Update Available!\nPlease update prior submitting a BugReport!", "Info", wx.OK | wx.ICON_INFORMATION) dlg.ShowModal() dlg.Destroy() - self.btnBugReport.Enable(False) + #self.btnBugReport.Enable(False) return log().info("starting bugreporter") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ror...@us...> - 2007-11-27 12:55:35
|
Revision: 188 http://roreditor.svn.sourceforge.net/roreditor/?rev=188&view=rev Author: rorthomas Date: 2007-11-27 04:55:32 -0800 (Tue, 27 Nov 2007) Log Message: ----------- updated setup simplified starter Modified Paths: -------------- trunk/devtools/setup/setup.nsi trunk/lib_common/ror/starter.py Modified: trunk/devtools/setup/setup.nsi =================================================================== --- trunk/devtools/setup/setup.nsi 2007-11-27 12:46:06 UTC (rev 187) +++ trunk/devtools/setup/setup.nsi 2007-11-27 12:55:32 UTC (rev 188) @@ -2,7 +2,7 @@ ; HM NIS Edit Wizard helper defines !define PRODUCT_NAME "RoRToolkit" -!define PRODUCT_VERSION "0.1.142" +!define PRODUCT_VERSION "0.1.187" !define PRODUCT_PUBLISHER "Thomas Fischer" !define PRODUCT_WEB_SITE "http://wiki.rigsofrods.com/index.php?title=RoRToolkit" !define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" Modified: trunk/lib_common/ror/starter.py =================================================================== --- trunk/lib_common/ror/starter.py 2007-11-27 12:46:06 UTC (rev 187) +++ trunk/lib_common/ror/starter.py 2007-11-27 12:55:32 UTC (rev 188) @@ -54,24 +54,25 @@ self.btnStartTerrainEditor = wx.Button(self.panel, wx.ID_ANY, "Start Editor") self.Bind(wx.EVT_BUTTON, self.OnTerrainEditor, self.btnStartTerrainEditor) - self.btnBugReport = wx.Button(self.panel, wx.ID_ANY, "Report a Bug") - self.Bind(wx.EVT_BUTTON, self.OnBugReport, self.btnBugReport) - if sys.platform != 'win32': - self.btnBugReport.Enable(False) + #self.btnBugReport = wx.Button(self.panel, wx.ID_ANY, "Report a Bug") + #self.Bind(wx.EVT_BUTTON, self.OnBugReport, self.btnBugReport) + #if sys.platform != 'win32': + #self.btnBugReport.Enable(False) - self.btnUpdate = wx.Button(self.panel, wx.ID_ANY, "Update") - self.Bind(wx.EVT_BUTTON, self.OnUpdate, self.btnUpdate) + #self.btnUpdate = wx.Button(self.panel, wx.ID_ANY, "Update") + #self.Bind(wx.EVT_BUTTON, self.OnUpdate, self.btnUpdate) + #self.btnUpdate.Enable(False) - self.btnDepGraph = wx.Button(self.panel, wx.ID_ANY, "Dependency Graph") - self.Bind(wx.EVT_BUTTON, self.OnDepGraph, self.btnDepGraph) - if sys.platform != 'win32': - self.btnDepGraph.Enable(False) + #self.btnDepGraph = wx.Button(self.panel, wx.ID_ANY, "Dependency Graph") + #self.Bind(wx.EVT_BUTTON, self.OnDepGraph, self.btnDepGraph) + #if sys.platform != 'win32': + # self.btnDepGraph.Enable(False) - self.btnModUninstaller = wx.Button(self.panel, wx.ID_ANY, "Mod Uninstaller") - self.Bind(wx.EVT_BUTTON, self.OnModUninstaller, self.btnModUninstaller) + #self.btnModUninstaller = wx.Button(self.panel, wx.ID_ANY, "Mod Uninstaller") + #self.Bind(wx.EVT_BUTTON, self.OnModUninstaller, self.btnModUninstaller) - self.btnRepClient = wx.Button(self.panel, wx.ID_ANY, "Repository Client") - self.Bind(wx.EVT_BUTTON, self.OnRepClient, self.btnRepClient) + #self.btnRepClient = wx.Button(self.panel, wx.ID_ANY, "Repository Client") + #self.Bind(wx.EVT_BUTTON, self.OnRepClient, self.btnRepClient) self.btnExit = wx.Button(self.panel, wx.ID_ANY, "Exit") self.Bind(wx.EVT_BUTTON, self.OnExit, self.btnExit) @@ -101,7 +102,7 @@ self.btnStartRoR.Enable(True) #self.btnStartTruckEditor.Enable(True) self.btnStartTerrainEditor.Enable(True) - self.btnBugReport.Enable(True) + #self.btnBugReport.Enable(True) self.lblRoRDir.SetLabel("Selected Rigs of Rods Directory: " + self.rordir) def OnSelectRenderer(self, id=None, func=None): @@ -254,34 +255,28 @@ sizer_panel = wx.BoxSizer(wx.VERTICAL) sizer_panel.Add(self.image, 0, wx.EXPAND, 0) - sizer_a = wx.BoxSizer(wx.HORIZONTAL) - sizer_a.Add(self.lblRoRDir, 1, wx.EXPAND, 0) + sizer_a = wx.BoxSizer(wx.VERTICAL) + sizer_a.Add(self.lblRoRDir, 0, wx.EXPAND, 0) sizer_a.Add(self.btnSelectRoRDir, 0, wx.EXPAND, 0) - sizer_panel.Add(sizer_a, 0, wx.EXPAND, 0) - - sizer_b = wx.BoxSizer(wx.HORIZONTAL) - sizer_b.Add(self.btnStartRoR, 0, wx.EXPAND, 0) - - sizer_c = wx.BoxSizer(wx.VERTICAL) #sizer_c.Add(self.btnStartTruckEditor, 1, wx.EXPAND, 0) - sizer_c.Add(self.btnStartTerrainEditor, 1, wx.EXPAND, 0) - sizer_b.Add(sizer_c, 1, wx.EXPAND, 0) + sizer_a.Add(self.btnStartRoR, 0, wx.EXPAND, 0) + sizer_a.Add(self.btnStartTerrainEditor, 1, wx.EXPAND, 0) if sys.platform == 'win32': - sizer_b.Add(self.cbbRenderEngine, 0, wx.EXPAND, 0) - sizer_panel.Add(sizer_b, 1, wx.EXPAND, 0) + sizer_a.Add(self.cbbRenderEngine, 0, wx.EXPAND, 0) + sizer_panel.Add(sizer_a, 1, wx.EXPAND, 0) - sizer_d = wx.BoxSizer(wx.HORIZONTAL) - sizer_d.Add(self.btnBugReport, 1, wx.EXPAND, 0) - sizer_d.Add(self.btnUpdate, 1, wx.EXPAND, 0) - sizer_panel.Add(sizer_d, 0, wx.EXPAND, 0) + #sizer_d = wx.BoxSizer(wx.HORIZONTAL) + #sizer_d.Add(self.btnBugReport, 1, wx.EXPAND, 0) + #sizer_d.Add(self.btnUpdate, 1, wx.EXPAND, 0) + #sizer_panel.Add(sizer_d, 0, wx.EXPAND, 0) - sizer_e = wx.BoxSizer(wx.HORIZONTAL) - sizer_e.Add(self.btnDepGraph, 1, wx.EXPAND, 0) - sizer_e.Add(self.btnRepClient, 1, wx.EXPAND, 0) - sizer_e.Add(self.btnModUninstaller, 1, wx.EXPAND, 0) - sizer_panel.Add(sizer_e, 0, wx.EXPAND, 0) + #sizer_e = wx.BoxSizer(wx.HORIZONTAL) + #sizer_e.Add(self.btnDepGraph, 1, wx.EXPAND, 0) + #sizer_e.Add(self.btnRepClient, 1, wx.EXPAND, 0) + #sizer_e.Add(self.btnModUninstaller, 1, wx.EXPAND, 0) + #sizer_panel.Add(sizer_e, 0, wx.EXPAND, 0) sizer_panel.Add(self.btnExit, 0, wx.EXPAND, 0) self.panel.SetSizer(sizer_panel) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ror...@us...> - 2007-11-27 12:46:09
|
Revision: 187 http://roreditor.svn.sourceforge.net/roreditor/?rev=187&view=rev Author: rorthomas Date: 2007-11-27 04:46:06 -0800 (Tue, 27 Nov 2007) Log Message: ----------- updated Modified Paths: -------------- trunk/lib_common/ror/depchecker.py Modified: trunk/lib_common/ror/depchecker.py =================================================================== --- trunk/lib_common/ror/depchecker.py 2007-10-04 23:13:51 UTC (rev 186) +++ trunk/lib_common/ror/depchecker.py 2007-11-27 12:46:06 UTC (rev 187) @@ -17,398 +17,398 @@ GRAPHPATH = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", ".." ,"graphs")) class RoRDepChecker: - def __init__(self, path, mode, dependfilename, verbose=True): - self.verbose = verbose - self.filedeps = {} - self.dstree = None # target field for single dtree's - self.notfound = None - self.dir = path - self.invalid = False - self.dependfilename = dependfilename - - self.getfiles() - if mode == "getfiles": - return + def __init__(self, path, mode, dependfilename, verbose=True): + self.verbose = verbose + self.filedeps = {} + self.dstree = None # target field for single dtree's + self.notfound = None + self.dir = path + self.invalid = False + self.dependfilename = dependfilename + + self.getfiles() + if mode == "getfiles": + return - self.createDeps() + self.createDeps() - if mode == "record": - self.generateCrossDep(False) - self.saveTree(RORDEPSFILE) - return - else: - self.generateCrossDep(True) + if mode == "record": + self.generateCrossDep(False) + self.saveTree(RORDEPSFILE) + return + else: + self.generateCrossDep(True) - if dependfilename != "": - self.generateSingleDep() - - if mode == "all" and verbose: - self.tryGraph() + if dependfilename != "": + self.generateSingleDep() + + if mode == "all" and verbose: + self.tryGraph() - def saveTree(self, filename): - import pickle - file = open(filename, 'w') - pickle.dump(self.filedeps, file) - file.close() + def saveTree(self, filename): + import pickle + file = open(filename, 'w') + pickle.dump(self.filedeps, file) + file.close() - def loadTree(self, filename): - import pickle - file = open(filename, 'r') - result = pickle.load(file) - file.close() - return result - - def savemd5(self): - lines = [] - for fn in self.files.keys(): - lines.append(os.path.basename(fn)+" "+self.files[fn]['md5']+"\n") - f=open(MD5FILE, 'w') - f.writelines(lines) - f.close() - - def getSingleDepRecursive(self, filename, depth = 0): - file = self.filedeps[filename] - req = [{'depth':depth, 'filename':filename}] - for r in file[REQUIRES][FILE]: - try: - for rr in self.getSingleDepRecursive(r, depth + 1): - duplicate = False - for rsub in req: - if rr['filename'] == rsub['filename']: - duplicate = True - - # enable for graph functions (allows multiple arrows then) - if not duplicate: - req.append(rr) - except: - pass - return req - - def generateSingleDep(self): - if not self.dependfilename in self.filedeps.keys(): - self.invalid = True - if self.verbose: - log().error("file not found in the dependency tree: %s !" % self.dependfilename) - return - tree = self.getSingleDepRecursive(self.dependfilename) - #print tree - if self.verbose: - for t in tree: - t['fullpath'] = self.getFullPath(t['filename']) - t['md5sum'] = self.md5Sum(t['fullpath']) - infostr = "%-30s %-30s" % ("+"*t['depth']+t['filename'], t['md5sum']) - log().info(infostr) - #self.removeOriginalFilesFromSingleDep - #for t in tree: - # f = t['filename'] - # print str(self.filedeps[f][REQUIRES]) - # print str(self.filedeps[f][REQUIREDBY]) - # print "---------------------------------" - - self.dstree = tree - - if self.verbose and len(tree) > 1: - self.tryGraph(tree) - + def loadTree(self, filename): + import pickle + file = open(filename, 'r') + result = pickle.load(file) + file.close() + return result + + def savemd5(self): + lines = [] + for fn in self.files.keys(): + lines.append(os.path.basename(fn)+" "+self.files[fn]['md5']+"\n") + f=open(MD5FILE, 'w') + f.writelines(lines) + f.close() + + def getSingleDepRecursive(self, filename, depth = 0): + file = self.filedeps[filename] + req = [{'depth':depth, 'filename':filename}] + for r in file[REQUIRES][FILE]: + try: + for rr in self.getSingleDepRecursive(r, depth + 1): + duplicate = False + for rsub in req: + if rr['filename'] == rsub['filename']: + duplicate = True + + # enable for graph functions (allows multiple arrows then) + if not duplicate: + req.append(rr) + except: + pass + return req + + def generateSingleDep(self): + if not self.dependfilename in self.filedeps.keys(): + self.invalid = True + if self.verbose: + log().error("file not found in the dependency tree: %s !" % self.dependfilename) + return + tree = self.getSingleDepRecursive(self.dependfilename) + #print tree + if self.verbose: + for t in tree: + t['fullpath'] = self.getFullPath(t['filename']) + t['md5sum'] = self.md5Sum(t['fullpath']) + infostr = "%-30s %-30s" % ("+"*t['depth']+t['filename'], t['md5sum']) + log().info(infostr) + #self.removeOriginalFilesFromSingleDep + #for t in tree: + # f = t['filename'] + # print str(self.filedeps[f][REQUIRES]) + # print str(self.filedeps[f][REQUIREDBY]) + # print "---------------------------------" + + self.dstree = tree + + if self.verbose and len(tree) > 1: + self.tryGraph(tree) + - def readMD5File(self): - md5s = {} - f=open(MD5FILE, 'r') - content = f.readlines() - f.close() - for line in content: - l = line.split(" ") - md5s[l[0]] = l[1] - self.orgMD5s = md5s - return md5s - - def readFile(self, filename): - f=open(filename, 'rb') - content = f.read() - f.close() - return content - - def md5Sum(self, filename): - try: - content = self.readFile(filename) - #print len(content) - except: - return - return md5.new(content).hexdigest() + def readMD5File(self): + md5s = {} + f=open(MD5FILE, 'r') + content = f.readlines() + f.close() + for line in content: + l = line.split(" ") + md5s[l[0]] = l[1] + self.orgMD5s = md5s + return md5s + + def readFile(self, filename): + f=open(filename, 'rb') + content = f.read() + f.close() + return content + + def md5Sum(self, filename): + try: + content = self.readFile(filename) + #print len(content) + except: + return + return md5.new(content).hexdigest() - def tryGraph(self, tree = None): - try: - import pydot - log().info("pydot found, drawing graphs! beware this can take some time with big graphs!") - self.drawGraph(tree) - except ImportError: - log().error("pydot not found, not drawing graphs") - pass - - def drawGraph(self, tree = None): - import pydot - if not os.path.isdir(GRAPHPATH): - os.mkdir(GRAPHPATH) - edges = [] - if tree is None: - for filenameA in self.filedeps.keys(): - fileA = self.filedeps[filenameA] - if REQUIRES in fileA.keys() and FILE in fileA[REQUIRES].keys(): - for rel in fileA[REQUIRES][FILE]: - e = (filenameA, rel) - edges.append(e) - fn = os.path.join(GRAPHPATH, 'alldependencies.png') - else: - od = -1 - parents = [] - for t in tree: - d = t['depth'] - f = t['filename'] - if d > od: - if len(parents) > 0: - #print "1", (parents[-1], f) - edges.append((parents[-1], f)) - parents.append(f) - elif d == od: - #print "2", (parents[-2], f) - edges.append((parents[-2], f)) - elif d < od: - for i in range(0, od - d + 1): - del parents[-1] - #print "3", od - d, (parents[-1], f) - edges.append((parents[-1], f)) - parents.append(f) - od = d - fn = os.path.join(GRAPHPATH, self.dependfilename + '_dependencies.png') - pass - - #edges = [(1,2), (1,3), (1,4), (3,4)] - graph = pydot.graph_from_edges(edges) - graph.set_type('digraph') - graph.simplify = True - #graph.set("resolution", "320") - #graph.set("overlap", "scale") - #graph.set("shape", "box") - - for n in graph.get_node_list(): - n.set('fontsize', 8) - n.set('style', 'filled') - onlyfilename, ext = os.path.splitext(n.get_name()) - fp = self.getFullPath(n.get_name()) - if fp is None: - n.set('fillcolor', 'red') - else: - if ext == ".truck": - n.set('fillcolor', 'gold') - n.set('group', 'truck') - elif ext == ".load": - n.set('fillcolor', 'lightyellow') - n.set('group', 'load') - elif ext == ".material": - n.set('fillcolor', 'lightseagreen') - n.set('group', 'material') - elif ext == ".terrn": - n.set('fillcolor', 'forestgreen') - n.set('group', 'terrain') - elif ext == ".mesh": - n.set('fillcolor', 'lightsalmon') - n.set('group', 'mesh') - elif ext == ".odef": - n.set('fillcolor', 'lightsalmon') - n.set('group', 'object') - elif ext == ".png" or ext == ".jpg" or ext == ".bmp": - n.set('fillcolor', 'lightblue') - n.set('group', 'texture') - - - - #graph.set("ranksep", "2") - #graph.set("splines", True) - program = "dot" # dot or twopi - # this takes very long: - #if len(self.filedeps) > 100: - # program = "twopi" - # graph.set("overlap", "scale") - - graph.write(fn, prog = program, format='png') - log().info("graph successfull written to " + fn) - - def removeRoRDeps(self, notfound): - rortree = self.loadTree(RORDEPSFILE) - newfound = {MATERIAL:[], FILE:[]} - for category in notfound.keys(): - for searchitem in notfound[category]: - found = False - for filenameA in rortree.keys(): - if found: - break - fileA = rortree[filenameA] - if PROVIDES in fileA.keys() and category in fileA[PROVIDES].keys(): - for provide in fileA[PROVIDES][category]: - if provide == searchitem: - if self.verbose: - log().info("found missing item in original ror: %s, %s" % (category, provide)) - found = True - break - if not found: - newfound[category].append(searchitem) - return newfound - - def generateCrossDep(self, removeRoRDeps=False): - crossdep = 0 - notfound = {MATERIAL:[], FILE:[]} - newtree = copy.deepcopy(self.filedeps) - for filenameA in self.filedeps.keys(): - fileA = self.filedeps[filenameA] - for relation in [REQUIRES, OPTIONAL]: - for type in TYPES: - if not relation in fileA.keys() or len(fileA[relation]) == 0: - continue - for reqfile in fileA[relation][type]: - found = False - for filenameB in self.filedeps.keys(): - fileB = self.filedeps[filenameB] - if filenameA == filenameB: - continue - #print filenameA, relation, type, reqfile, fileB[PROVIDES][type] - if len(fileB[PROVIDES]) == 0: - continue - if reqfile in fileB[PROVIDES][type]: - crossdep += 1 - newtree[filenameB][REQUIREDBY][FILE].append(filenameA) - if not filenameB in fileA[REQUIRES][FILE]: - # found new - newtree[filenameA][REQUIRES][FILE].append(filenameB) - found = True - break - if not found and relation != OPTIONAL: - if not reqfile in notfound[type]: - notfound[type].append(reqfile) - self.filedeps = newtree - #print newtree - self.everythingfound = False - if len(notfound[MATERIAL]) == 0 and len(notfound[FILE]) == 0: - self.everythingfound = True - if self.verbose: - log().info("### nothing missing, great!") - else: - if removeRoRDeps: - notfound = self.removeRoRDeps(notfound) - self.notfound = notfound - if len(notfound[MATERIAL]) == 0 and len(notfound[FILE]) == 0: - self.everythingfound = True - if self.verbose: - log().info("### no files missing, all prior missing files found in RoR") - if self.verbose: - if len(notfound[FILE]) > 0: - log().info("### we are missing the following files:") - log().info(" "+str(notfound[FILE])) - if len(notfound[MATERIAL]) > 0: - log().info("### we are missing the following materials:") - log().info(" "+str(notfound[MATERIAL])) - if self.verbose: - log().info("### found %d files, of which %d have dependencies." % (len(self.files), len(self.filedeps))) - nodeps = 0 - for filename in self.filedeps.keys(): - file = self.filedeps[filename] - line = " %-30s " % filename - linesub = "" - sublines = [] - if REQUIRES in file.keys() and FILE in file[REQUIRES].keys(): - linesub = "requires: %s" % (str(file[REQUIRES][FILE])) - if linesub != "": - sublines.append("%-50s" % linesub) - - linesub = "" - if REQUIREDBY in file.keys() and FILE in file[REQUIRES].keys(): - linesub = "required by: %s" % (str(file[REQUIREDBY][FILE])) - if linesub != "": - sublines.append("%-50s" % linesub) - if len(sublines) > 0: - line += ", ".join(sublines) - else: - line += "NO DEPENDENCIES" - nodeps += 1 - log().info(line) - log().info("### %d files depends on each other" % (crossdep)) - log().info("### %d files with no dependencies" % (nodeps)) - log().info("### advanced file dependency check finished") - #if len(file[PROVIDES]) == 0 - - def getDependencies(self, extension, filename): - try: - #print "trying to use module: %s" % "ror_" + extension.lstrip(".") - mod = __import__("ror_" + extension.lstrip(".")) - except ImportError, e: - #print "module not found!" - #print e - return None - pass - return mod.getDependencies(filename) + def tryGraph(self, tree = None): + try: + import pydot + log().info("pydot found, drawing graphs! beware this can take some time with big graphs!") + self.drawGraph(tree) + except ImportError: + log().error("pydot not found, not drawing graphs") + pass + + def drawGraph(self, tree = None): + import pydot + if not os.path.isdir(GRAPHPATH): + os.mkdir(GRAPHPATH) + edges = [] + if tree is None: + for filenameA in self.filedeps.keys(): + fileA = self.filedeps[filenameA] + if REQUIRES in fileA.keys() and FILE in fileA[REQUIRES].keys(): + for rel in fileA[REQUIRES][FILE]: + e = (filenameA, rel) + edges.append(e) + fn = os.path.join(GRAPHPATH, 'alldependencies.png') + else: + od = -1 + parents = [] + for t in tree: + d = t['depth'] + f = t['filename'] + if d > od: + if len(parents) > 0: + #print "1", (parents[-1], f) + edges.append((parents[-1], f)) + parents.append(f) + elif d == od: + #print "2", (parents[-2], f) + edges.append((parents[-2], f)) + elif d < od: + for i in range(0, od - d + 1): + del parents[-1] + #print "3", od - d, (parents[-1], f) + edges.append((parents[-1], f)) + parents.append(f) + od = d + fn = os.path.join(GRAPHPATH, self.dependfilename + '_dependencies.png') + pass + + #edges = [(1,2), (1,3), (1,4), (3,4)] + graph = pydot.graph_from_edges(edges) + graph.set_type('digraph') + graph.simplify = True + #graph.set("resolution", "320") + #graph.set("overlap", "scale") + #graph.set("shape", "box") + + for n in graph.get_node_list(): + n.set('fontsize', 8) + n.set('style', 'filled') + onlyfilename, ext = os.path.splitext(n.get_name()) + fp = self.getFullPath(n.get_name()) + if fp is None: + n.set('fillcolor', 'red') + else: + if ext == ".truck": + n.set('fillcolor', 'gold') + n.set('group', 'truck') + elif ext == ".load": + n.set('fillcolor', 'lightyellow') + n.set('group', 'load') + elif ext == ".material": + n.set('fillcolor', 'lightseagreen') + n.set('group', 'material') + elif ext == ".terrn": + n.set('fillcolor', 'forestgreen') + n.set('group', 'terrain') + elif ext == ".mesh": + n.set('fillcolor', 'lightsalmon') + n.set('group', 'mesh') + elif ext == ".odef": + n.set('fillcolor', 'lightsalmon') + n.set('group', 'object') + elif ext == ".png" or ext == ".jpg" or ext == ".bmp": + n.set('fillcolor', 'lightblue') + n.set('group', 'texture') + + + + #graph.set("ranksep", "2") + #graph.set("splines", True) + program = "dot" # dot or twopi + # this takes very long: + #if len(self.filedeps) > 100: + # program = "twopi" + # graph.set("overlap", "scale") + + graph.write(fn, prog = program, format='png') + log().info("graph successfull written to " + fn) + + def removeRoRDeps(self, notfound): + rortree = self.loadTree(RORDEPSFILE) + newfound = {MATERIAL:[], FILE:[]} + for category in notfound.keys(): + for searchitem in notfound[category]: + found = False + for filenameA in rortree.keys(): + if found: + break + fileA = rortree[filenameA] + if PROVIDES in fileA.keys() and category in fileA[PROVIDES].keys(): + for provide in fileA[PROVIDES][category]: + if provide == searchitem: + if self.verbose: + log().info("found missing item in original ror: %s, %s" % (category, provide)) + found = True + break + if not found: + newfound[category].append(searchitem) + return newfound + + def generateCrossDep(self, removeRoRDeps=False): + crossdep = 0 + notfound = {MATERIAL:[], FILE:[]} + newtree = copy.deepcopy(self.filedeps) + for filenameA in self.filedeps.keys(): + fileA = self.filedeps[filenameA] + for relation in [REQUIRES, OPTIONAL]: + for type in TYPES: + if not relation in fileA.keys() or len(fileA[relation]) == 0: + continue + for reqfile in fileA[relation][type]: + found = False + for filenameB in self.filedeps.keys(): + fileB = self.filedeps[filenameB] + if filenameA == filenameB: + continue + #print filenameA, relation, type, reqfile, fileB[PROVIDES][type] + if len(fileB[PROVIDES]) == 0: + continue + if reqfile in fileB[PROVIDES][type]: + crossdep += 1 + newtree[filenameB][REQUIREDBY][FILE].append(filenameA) + if not filenameB in fileA[REQUIRES][FILE]: + # found new + newtree[filenameA][REQUIRES][FILE].append(filenameB) + found = True + break + if not found and relation != OPTIONAL: + if not reqfile in notfound[type]: + notfound[type].append(reqfile) + self.filedeps = newtree + #print newtree + self.everythingfound = False + if len(notfound[MATERIAL]) == 0 and len(notfound[FILE]) == 0: + self.everythingfound = True + if self.verbose: + log().info("### nothing missing, great!") + else: + if removeRoRDeps: + notfound = self.removeRoRDeps(notfound) + self.notfound = notfound + if len(notfound[MATERIAL]) == 0 and len(notfound[FILE]) == 0: + self.everythingfound = True + if self.verbose: + log().info("### no files missing, all prior missing files found in RoR") + if self.verbose: + if len(notfound[FILE]) > 0: + log().info("### we are missing the following files:") + log().info(" "+str(notfound[FILE])) + if len(notfound[MATERIAL]) > 0: + log().info("### we are missing the following materials:") + log().info(" "+str(notfound[MATERIAL])) + if self.verbose: + log().info("### found %d files, of which %d have dependencies." % (len(self.files), len(self.filedeps))) + nodeps = 0 + for filename in self.filedeps.keys(): + file = self.filedeps[filename] + line = " %-30s " % filename + linesub = "" + sublines = [] + if REQUIRES in file.keys() and FILE in file[REQUIRES].keys(): + linesub = "requires: %s" % (str(file[REQUIRES][FILE])) + if linesub != "": + sublines.append("%-50s" % linesub) + + linesub = "" + if REQUIREDBY in file.keys() and FILE in file[REQUIRES].keys(): + linesub = "required by: %s" % (str(file[REQUIREDBY][FILE])) + if linesub != "": + sublines.append("%-50s" % linesub) + if len(sublines) > 0: + line += ", ".join(sublines) + else: + line += "NO DEPENDENCIES" + nodeps += 1 + log().info(line) + log().info("### %d files depends on each other" % (crossdep)) + log().info("### %d files with no dependencies" % (nodeps)) + log().info("### advanced file dependency check finished") + #if len(file[PROVIDES]) == 0 + + def getDependencies(self, extension, filename): + try: + #print "trying to use module: %s" % "ror_" + extension.lstrip(".") + mod = __import__("ror_" + extension.lstrip(".")) + except ImportError, e: + #print "module not found!" + #print e + return None + pass + return mod.getDependencies(filename) - - def getFullPath(self, filename): - for f in self.files: - if os.path.basename(f) == filename: - return f - return None - - def getfiles(self, md5 = False): - fl = {} - for root, dirs, files in os.walk(self.dir): - for f in files: - fn = os.path.join(root, f) - fl[fn] = {} - if md5: - fl[fn]['md5'] = self.md5Sum(fn) - if self.verbose: - for fk in fl.keys(): - infostr = "%10s %s" % ("", os.path.basename(fk)) - log().info(infostr) - log().info("found %d files!" % (len(fl.keys()))) - self.files = fl + + def getFullPath(self, filename): + for f in self.files: + if os.path.basename(f) == filename: + return f + return None + + def getfiles(self, md5 = False): + fl = {} + for root, dirs, files in os.walk(os.path.abspath(self.dir)): + for f in files: + fn = os.path.join(root, f) + fl[fn] = {} + if md5: + fl[fn]['md5'] = self.md5Sum(fn) + if self.verbose: + for fk in fl.keys(): + infostr = "%10s %s" % ("", os.path.basename(fk)) + log().info(infostr) + log().info("found %d files!" % (len(fl.keys()))) + self.files = fl - def newRelation(self, dep): - # ensures that each field exists - tmp = {} - for rel in RELATIONS: - tmp[rel] = {} - for type in TYPES: - tmp[rel][type] = [] - for rel in dep.keys(): - for type in dep[rel].keys(): - if type == FILE: - for f in dep[rel][type]: - #print f - tmp[rel][type].append(os.path.basename(f)) - else: - tmp[rel][type] = dep[rel][type] - return tmp - - def createDeps(self): - tree = self.filedeps - unused = [] - if self.verbose: - log().info("### dependency checker log following") - for filename in self.files.keys(): - onlyfilename, extension = os.path.splitext(filename) - basefilename = os.path.basename(filename) - dependencies = self.getDependencies(extension, filename) - if dependencies is None: - unused.append(filename) - #print "DEP "+ basefilename +" / "+str(dependencies) - if not dependencies is None: - for relation in dependencies.keys(): - deps = dependencies[relation] - tree[basefilename] = {} - tree[basefilename][relation] = {} - for type in deps.keys(): - tree[basefilename] = self.newRelation(dependencies) - if self.verbose: - log().info("### file dependency check finished") - if len(unused) > 0: - log().info("### unused files: %s" % str(unused)) - else: - log().info("### all files used") + def newRelation(self, dep): + # ensures that each field exists + tmp = {} + for rel in RELATIONS: + tmp[rel] = {} + for type in TYPES: + tmp[rel][type] = [] + for rel in dep.keys(): + for type in dep[rel].keys(): + if type == FILE: + for f in dep[rel][type]: + #print f + tmp[rel][type].append(os.path.basename(f)) + else: + tmp[rel][type] = dep[rel][type] + return tmp + + def createDeps(self): + tree = self.filedeps + unused = [] + if self.verbose: + log().info("### dependency checker log following") + for filename in self.files.keys(): + onlyfilename, extension = os.path.splitext(filename) + basefilename = os.path.basename(filename) + dependencies = self.getDependencies(extension, filename) + if dependencies is None: + unused.append(filename) + #print "DEP "+ basefilename +" / "+str(dependencies) + if not dependencies is None: + for relation in dependencies.keys(): + deps = dependencies[relation] + tree[basefilename] = {} + tree[basefilename][relation] = {} + for type in deps.keys(): + tree[basefilename] = self.newRelation(dependencies) + if self.verbose: + log().info("### file dependency check finished") + if len(unused) > 0: + log().info("### unused files: %s" % str(unused)) + else: + log().info("### all files used") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ap...@us...> - 2007-10-04 23:13:52
|
Revision: 186 http://roreditor.svn.sourceforge.net/roreditor/?rev=186&view=rev Author: aperion Date: 2007-10-04 16:13:51 -0700 (Thu, 04 Oct 2007) Log Message: ----------- Modified Paths: -------------- branches/dev/lib_common/wxogre/OgreManager.py branches/dev/lib_common/wxogre/wxOgreWindow.py Modified: branches/dev/lib_common/wxogre/OgreManager.py =================================================================== --- branches/dev/lib_common/wxogre/OgreManager.py 2007-10-04 19:28:10 UTC (rev 185) +++ branches/dev/lib_common/wxogre/OgreManager.py 2007-10-04 23:13:51 UTC (rev 186) @@ -136,6 +136,7 @@ ogrewin.OnFrameEnded() except: continue + def createSceneManager(self, type): return self.ogreRoot.createSceneManager(type, "SceneManager" + str(randomID())) Modified: branches/dev/lib_common/wxogre/wxOgreWindow.py =================================================================== --- branches/dev/lib_common/wxogre/wxOgreWindow.py 2007-10-04 19:28:10 UTC (rev 185) +++ branches/dev/lib_common/wxogre/wxOgreWindow.py 2007-10-04 23:13:51 UTC (rev 186) @@ -43,18 +43,7 @@ self.SceneInitialisation() self.SetFocus() - - def UpdateRender(self): - try: - self.OnFrameStarted() - ogre.WindowEventUtilities().messagePump() - self.ogreRoot.renderOneFrame() - self.OnFrameEnded() - except Exception, e: - print "## EXCEPION ##" - print str(e) - return - + def GetHandle(self): # use len to make the names unique! if getPlatform() == 'windows': This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ap...@us...> - 2007-10-04 19:28:13
|
Revision: 185 http://roreditor.svn.sourceforge.net/roreditor/?rev=185&view=rev Author: aperion Date: 2007-10-04 12:28:10 -0700 (Thu, 04 Oct 2007) Log Message: ----------- utility for retreiving linux window information Added Paths: ----------- branches/dev/lib_common/wxogre/libwxogre_util.so branches/dev/lib_common/wxogre/wxogre_util.cpp branches/dev/lib_common/wxogre/wxogre_util.py Added: branches/dev/lib_common/wxogre/libwxogre_util.so =================================================================== (Binary files differ) Property changes on: branches/dev/lib_common/wxogre/libwxogre_util.so ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + application/octet-stream Added: branches/dev/lib_common/wxogre/wxogre_util.cpp =================================================================== --- branches/dev/lib_common/wxogre/wxogre_util.cpp (rev 0) +++ branches/dev/lib_common/wxogre/wxogre_util.cpp 2007-10-04 19:28:10 UTC (rev 185) @@ -0,0 +1,110 @@ +// Copyright (C) 2007 Maryland Robotics Club +// Copyright (C) 2007 Joseph Lisee <jl...@um...> +// All rights reserved. +// +// Author: Joseph Lisee <jl...@um...> +// File: utility/wxogre_util/src/wxogre_util.h + +// std includes +#include <sstream> +#include <string> +#include <cstring> +#include <iostream> +using namespace std; + +// wxWidgets includes +#include <wx/window.h> + +// Platform specific includes +#ifdef __WXGTK__ +// Needed for random GTK/GDK macros and functions +#include <gdk/gdkx.h> +#include <gtk/gtk.h> + +// Needed for crazy GTK_PIZZA stuff +#include <wx/gtk/win_gtk.h> +#include <GL/glx.h> +#endif + + +extern "C" +{ + /** Returns a window handle string from a wxWindow in Ogre form + @param window + Must be a pointer to a wxWindow or its subclass. + @return + The window handle in its display:xid form. + */ + extern char* get_window_handle_str(void* window); +} + +char* get_window_handle_str(void* _window) +{ + int counter = 0; + // Assume its a wxObject (can be dangerous) + wxObject* window_obj = (wxObject*)_window; + + // Preform a dynamic cast to a wxWindow + wxWindow* window = wxDynamicCast(window_obj, wxWindow); + + std::cout << counter++ <<std::endl; + if (window) + { + std::cout << counter++ <<std::endl; + std::string handle; +#ifdef __WXGTK__ + // Should help reduce flickering + //SetBackgroundStyle(wxBG_STYLE_CUSTOM); + std::stringstream handleStream; + + // wxWidgets uses serverl internal GtkWidgets, the GetHandle method returns + // a different one then this, but wxWidgets GLCanvas uses this one to + // interact with GLX with, so we will do the same. + GtkWidget* private_handle = window->m_wxwindow; + + std::cout << counter++ <<std::endl; + // Prevents flicker + gtk_widget_set_double_buffered( private_handle, FALSE ); + std::cout << counter++ <<std::endl; + + // Grabs the window for use in the below macros + GdkWindow *gdkWin = GTK_PIZZA(private_handle)->bin_window; + std::cout << counter++ << (0 == gdkWin) << std::endl; + Display* display = GDK_WINDOW_XDISPLAY(gdkWin); //chrashes here + std::cout << counter++ <<std::endl; + Window wid = GDK_WINDOW_XWINDOW(gdkWin); + + std::cout << counter++ <<std::endl; + // Display + handleStream << (unsigned long)display << ':'; + + // screen (returns "display.screen") + std::string screenStr = DisplayString(display); + std::string::size_type dotPos = screenStr.find("."); + screenStr = screenStr.substr(dotPos+1, screenStr.size()); + handleStream << screenStr << ':'; + + std::cout << counter++ <<std::endl; + // XID + handleStream << wid << ':'; + + // retrieve XVisualInfo + int attrlist[] = { GLX_RGBA, GLX_DOUBLEBUFFER, GLX_DEPTH_SIZE, 16, GLX_STENCIL_SIZE, 8, None }; + XVisualInfo* vi = glXChooseVisual(display, DefaultScreen(display), attrlist); + handleStream << (unsigned long)vi; + + std::cout << counter++ <<std::endl; + handle = handleStream.str(); +#else +#error External/Parent Window handle not supported on this platform +#endif + + // Allocate string for the return + char* ret = new char[handle.length() + 1]; + strcpy(ret, handle.c_str()); + std::cout << counter++ <<std::endl; + return ret; +} + std::cout << "problem, returning 0" <<std::endl; + return 0; +} Added: branches/dev/lib_common/wxogre/wxogre_util.py =================================================================== --- branches/dev/lib_common/wxogre/wxogre_util.py (rev 0) +++ branches/dev/lib_common/wxogre/wxogre_util.py 2007-10-04 19:28:10 UTC (rev 185) @@ -0,0 +1,35 @@ + +# Copyright (C) 2007 Maryland Robotics Club +# Copyright (C) 2007 Joseph Lisee <jl...@um...> +# All rights reserved. +# +# Author: Joseph Lisee <jl...@um...> + +# Standard python imports +import ctypes as __ctypes +import os.path as __path + +# Library Imports +import wx as __wx + +# Load library +__lib_path = __path.join(__path.dirname(__path.abspath(__file__)),'libwxogre_util.so') +__lib = __ctypes.cdll.LoadLibrary(__path.abspath(__lib_path)) +# Look up function +__get_window_handle_str = __lib.get_window_handle_str +# Set types to match prototype: char* get_window_handle_str(void*) +__get_window_handle_str.restype = __ctypes.c_char_p +__get_window_handle_str.argtypes = [__ctypes.c_void_p] + +def get_window_handle_str(window): + """ + Returns the Ogre friendly window format. It will not allow itself to be + called with an invalid type, but calling the underlying C wrapped C++ + function with anything but a wxWindow or a subclass of it, will result in + a hard crash. + """ + if not isinstance(window, __wx.Window): + raise TypeError, 'Must be called with a wx.Window or a subclass' + + # This automatically performs the int -> void* cast + return __get_window_handle_str(int(window.this)) \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ap...@us...> - 2007-10-04 19:26:27
|
Revision: 184 http://roreditor.svn.sourceforge.net/roreditor/?rev=184&view=rev Author: aperion Date: 2007-10-04 12:26:20 -0700 (Thu, 04 Oct 2007) Log Message: ----------- Branch for development/testing version Modified Paths: -------------- branches/dev/lib_common/roreditor/MainFrame.py branches/dev/lib_common/roreditor/RoRObjectPreviewOgreWindow.py branches/dev/lib_common/roreditor/RoROdefEditorOgreWindow.py branches/dev/lib_common/roreditor/RoRTerrainOgreWindow.py branches/dev/lib_common/roreditor/RoRTruckOgreWindow.py branches/dev/lib_common/roreditor/RoRTruckUVOgreWindow.py branches/dev/lib_common/wxogre/OgreManager.py branches/dev/lib_common/wxogre/wxOgreWindow.py Added Paths: ----------- branches/dev/ Copied: branches/dev (from rev 183, trunk) Modified: branches/dev/lib_common/roreditor/MainFrame.py =================================================================== --- trunk/lib_common/roreditor/MainFrame.py 2007-09-20 17:59:02 UTC (rev 183) +++ branches/dev/lib_common/roreditor/MainFrame.py 2007-10-04 19:26:20 UTC (rev 184) @@ -1,7 +1,7 @@ import sys, os, os.path -from wxogre.OgreManager import * -from ror.RoROgreWindow import * +#from wxogre.OgreManager import * +#from ror.RoROgreWindow import * from ror.logger import log from ror.settingsManager import getSettingsManager @@ -63,7 +63,7 @@ wx.CLIP_CHILDREN): wx.Frame.__init__(self, parent, id, title, pos, size, style) - + wx.Frame.Show(self) # tell FrameManager to manage this frame self._mgr = wx.aui.AuiManager() self._mgr.SetManagedWindow(self) @@ -224,19 +224,19 @@ self.terrainOgreWin = RoRTerrainOgreWindow(self, wx.ID_ANY, rordir=self.rordir) self._mgr.AddPane(self.terrainOgreWin, wx.aui.AuiPaneInfo().Name("ogre_terrain_content").CenterPane().Hide()) + # the odef editor ogre window self.odefEditorOgreWin = ODefEditorOgreWindow(self, wx.ID_ANY, rordir=self.rordir) self._mgr.AddPane(self.odefEditorOgreWin, wx.aui.AuiPaneInfo().Name("ogre_odef_editor_content").CenterPane().Hide()) - + # the truck editor window self.truckEditorOgreWin = RoRTruckOgreWindow(self, wx.ID_ANY) self._mgr.AddPane(self.truckEditorOgreWin, wx.aui.AuiPaneInfo().Name("ogre_truck_editor_content").CenterPane().Hide()) - + # the truck editor UV window self.truckEditorUVOgreWin = RoRTruckUVOgreWindow(self, wx.ID_ANY) self._mgr.AddPane(self.truckEditorUVOgreWin, wx.aui.AuiPaneInfo().Name("ogre_truck_editor_uv_content").Float().Hide()) - # add the toolbars to the manager self._mgr.AddPane(self.terraintoolbar, wx.aui.AuiPaneInfo(). Name("terrain_toolbar"). @@ -543,6 +543,6 @@ myFrame.SetSize((800, 600)) myFrame.SetFocus() - myFrame.Show() + #myFrame.Show() MainApp.MainLoop() \ No newline at end of file Modified: branches/dev/lib_common/roreditor/RoRObjectPreviewOgreWindow.py =================================================================== --- trunk/lib_common/roreditor/RoRObjectPreviewOgreWindow.py 2007-09-20 17:59:02 UTC (rev 183) +++ branches/dev/lib_common/roreditor/RoRObjectPreviewOgreWindow.py 2007-10-04 19:26:20 UTC (rev 184) @@ -46,12 +46,15 @@ self.dragging = False self.mode = None self.logovisible = True + #NOTE: OgreWindow created here wxOgreWindow.__init__(self, parent, ID, size = size, **kwargs) droptarget = TreeDropTarget(self) self.SetDropTarget(droptarget) def SceneInitialisation(self): + #TODO: the below pattern occurs ~3-4 times in the ror editor, it should be moved into a + # seperate function. addresources = [os.path.join(self.rordir,'data', 'terrains'), os.path.join(self.rordir,'data', 'trucks'), os.path.join(self.rordir,'data', 'objects')] Modified: branches/dev/lib_common/roreditor/RoROdefEditorOgreWindow.py =================================================================== --- trunk/lib_common/roreditor/RoROdefEditorOgreWindow.py 2007-09-20 17:59:02 UTC (rev 183) +++ branches/dev/lib_common/roreditor/RoROdefEditorOgreWindow.py 2007-10-04 19:26:20 UTC (rev 184) @@ -50,12 +50,15 @@ self.boxes = [] self.objmat = None self.randcolors = [0,0.2,0.4] + #NOTE: OgreWindow created here wxOgreWindow.__init__(self, parent, ID, size = size, **kwargs) droptarget = TreeDropTarget(self) self.SetDropTarget(droptarget) def SceneInitialisation(self): + #TODO: the below pattern occurs ~3-4 times in the ror editor, it should be moved into a + # seperate function. addresources = [os.path.join(self.rordir,'data', 'terrains'), os.path.join(self.rordir,'data', 'trucks'), os.path.join(self.rordir,'data', 'objects')] Modified: branches/dev/lib_common/roreditor/RoRTerrainOgreWindow.py =================================================================== --- trunk/lib_common/roreditor/RoRTerrainOgreWindow.py 2007-09-20 17:59:02 UTC (rev 183) +++ branches/dev/lib_common/roreditor/RoRTerrainOgreWindow.py 2007-10-04 19:26:20 UTC (rev 184) @@ -98,6 +98,7 @@ self.size = size self.kwargs = kwargs self.ID = ID + #NOTE: OgreWindow created here wxOgreWindow.__init__(self, self.parent, self.ID, size = self.size, **self.kwargs) myDrop = MyDropTarget(self) self.SetDropTarget(myDrop) @@ -151,8 +152,8 @@ self.moveVector += self.keyPress self.camera.moveRelative(self.moveVector) self.moveVector *= SLOW_DOWN_FACTOR # each iteration slow the movement down by some fator - if self.moveVector < self.moveVector.normalize()*LOW_SPEED_THRESHOLD: - self.moveVector *= 0 + #if self.moveVector < self.moveVector.normalize()*LOW_SPEED_THRESHOLD: + # self.moveVector *= 0 def OnFrameEnded(self): pass @@ -176,6 +177,8 @@ def SceneInitialisation(self): hasparent = (not self.sceneManager is None) if not hasparent: + #TODO: the below pattern occurs ~3-4 times in the ror editor, it should be moved into a + # seperate function. addresources = [os.path.join(self.rordir,'data', 'terrains'), os.path.join(self.rordir,'data', 'trucks'), os.path.join(self.rordir,'data', 'objects')] Modified: branches/dev/lib_common/roreditor/RoRTruckOgreWindow.py =================================================================== --- trunk/lib_common/roreditor/RoRTruckOgreWindow.py 2007-09-20 17:59:02 UTC (rev 183) +++ branches/dev/lib_common/roreditor/RoRTruckOgreWindow.py 2007-10-04 19:26:20 UTC (rev 184) @@ -31,6 +31,7 @@ self.clearlist = {'entity':[]} self.bodies = [] self.initScene() + #NOTE: OgreWindow created here wxOgreWindow.__init__(self, parent, ID, size = size, **kwargs) def initScene(self, resetCam = True): @@ -84,6 +85,8 @@ pass def SceneInitialisation(self): + #TODO: the below pattern occurs ~3-4 times in the ror editor, it should be moved into a + # seperate function. addresources = [os.path.join(self.rordir,'data', 'trucks'), os.path.join(self.rordir,'data', 'objects')] # only init things in the main window, not in shared ones! Modified: branches/dev/lib_common/roreditor/RoRTruckUVOgreWindow.py =================================================================== --- trunk/lib_common/roreditor/RoRTruckUVOgreWindow.py 2007-09-20 17:59:02 UTC (rev 183) +++ branches/dev/lib_common/roreditor/RoRTruckUVOgreWindow.py 2007-10-04 19:26:20 UTC (rev 184) @@ -24,6 +24,7 @@ self.trucktree = None self.clearlist = {'entity':[]} self.initScene() + #NOTE: OgreWindow created here wxOgreWindow.__init__(self, parent, ID, size = size, **kwargs) def initScene(self): @@ -70,6 +71,8 @@ pass def SceneInitialisation(self): + #TODO: the below pattern occurs ~3-4 times in the ror editor, it should be moved into a + # seperate function. addresources = [os.path.join(self.rordir,'data', 'trucks'), os.path.join(self.rordir,'data', 'objects')] # only init things in the main window, not in shared ones! Modified: branches/dev/lib_common/wxogre/OgreManager.py =================================================================== --- trunk/lib_common/wxogre/OgreManager.py 2007-09-20 17:59:02 UTC (rev 183) +++ branches/dev/lib_common/wxogre/OgreManager.py 2007-10-04 19:26:20 UTC (rev 184) @@ -38,6 +38,7 @@ def init(self): #Root creation + #TODO: Unify platforms pluginsfile = 'plugins.cfg' if sys.platform in ['linux', 'linux2']: pluginsfile = 'plugins_linux.cfg' @@ -95,10 +96,13 @@ #TODO: For some reason passing renderParameters causes the renderer not to start, passing Null is a work around # use len to make the names unique! - if getPlatform() == 'windows': - renderParameters['externalWindowHandle'] = str(handle) - elif getPlatform() == 'linux': - renderParameters['externalWindowHandle'] = 0 + #if getPlatform() == 'windows': + # renderParameters['externalWindowHandle'] = str(handle) + #elif getPlatform() == 'linux': + # import wxogre_util as wxHandle + # renderParameters['externalWindowHandle'] = wxHandle.get_window_handle_str(self) + renderParameters['externalWindowHandle'] = str(handle) + renderWindow = self.ogreRoot.createRenderWindow(name + str(len(self.renderWindows)), width, height, fullscreen, renderParameters) #renderWindow.active = True self.renderWindows[wxOgrewin] = renderWindow @@ -113,14 +117,18 @@ for ogrewin in self.renderWindows.keys(): try: ogrewin.OnFrameStarted() - except: - continue + except ogre.OgreException, e: + print '## EXCEPTION ##' + print str(e) + pass try: + ogre.WindowEventUtilities().messagePump() self.ogreRoot.renderOneFrame() except ogre.OgreException, e: print '## EXCEPTION ##' print str(e) + #TODO: if we get here there is an error, throw the error so we can handle it gracefully. pass for ogrewin in self.renderWindows.keys(): @@ -128,7 +136,6 @@ ogrewin.OnFrameEnded() except: continue - def createSceneManager(self, type): return self.ogreRoot.createSceneManager(type, "SceneManager" + str(randomID())) Modified: branches/dev/lib_common/wxogre/wxOgreWindow.py =================================================================== --- trunk/lib_common/wxogre/wxOgreWindow.py 2007-09-20 17:59:02 UTC (rev 183) +++ branches/dev/lib_common/wxogre/wxOgreWindow.py 2007-10-04 19:26:20 UTC (rev 184) @@ -4,99 +4,131 @@ from wxogre.OgreManager import * class wxOgreWindow(wx.PyWindow): - def __init__(self, parent, ID, size = wx.Size(200,200), **kwargs): - """ - @param parent: The parent wx Window - @param size: the minimal window size - @param kwargs: any other wx arguments - @return: none - """ - wx.PyWindow.__init__(self, parent, ID, size = size, **kwargs) - self.parent = parent + def __init__(self, parent, ID, size = wx.Size(200,200), **kwargs): + """ + @param parent: The parent wx Window + @param size: the minimal window size + @param kwargs: any other wx arguments + @return: none + """ + wx.PyWindow.__init__(self, parent, ID, size = size, **kwargs) + self.parent = parent - #Event bindings - self.Bind(wx.EVT_CLOSE, self._OnCloseWindow) - self.Bind(wx.EVT_ERASE_BACKGROUND, self._OnEraseBackground) - self.Bind(wx.EVT_SIZE, self._OnSize) + #Event bindings + self.Bind(wx.EVT_CLOSE, self._OnCloseWindow) + self.Bind(wx.EVT_ERASE_BACKGROUND, self._OnEraseBackground) + self.Bind(wx.EVT_SIZE, self._OnSize) - #Ogre Initialisation - self.ogreRoot = getOgreManager().getRoot() + #Ogre Initialisation + self.ogreRoot = getOgreManager().getRoot() + self.size = size + self.createRenderWindow() + self.ogreRoot.getRenderSystem()._initRenderTargets() + + def createRenderWindow(self, size = None): + if(not size): + size = self.size + # create a new RenderWindow + #FIXME: In order to work in linux this cannot be called on init + + self.renderWindow = getOgreManager().createRenderWindow(self, "wxPythonWxOgreRenderWindow", size[0], size[1], False, self.GetHandle()) + self.renderWindow.active = True + + try: + if not self.sceneManager is None: + pass + except: + self.sceneManager = None + + self.SceneInitialisation() + self.SetFocus() - # create a new RenderWindow - self.renderWindow = getOgreManager().createRenderWindow(self, "wxPythonWxOgreRenderWindow", size[0], size[1], False, self.GetHandle()) - self.renderWindow.active = True - - try: - if not self.sceneManager is None: - pass - except: - self.sceneManager = None - - self.SceneInitialisation() - self.SetFocus() - - def __del__(self): - self.close() - - def close(self): - getOgreManager().removeRenderWindow(self) - if not self.sceneManager is None: - getOgreManager().destroySceneManager(self.sceneManager) + def UpdateRender(self): + try: + self.OnFrameStarted() + ogre.WindowEventUtilities().messagePump() + self.ogreRoot.renderOneFrame() + self.OnFrameEnded() + except Exception, e: + print "## EXCEPION ##" + print str(e) + return + + def GetHandle(self): + # use len to make the names unique! + if getPlatform() == 'windows': + return wx.PyWindow.GetHandle() + elif getPlatform() == 'linux': + import wxogre_util as wxHandle + return wxHandle.get_window_handle_str(self) + + def __del__(self): + self.close() + + def close(self): + getOgreManager().removeRenderWindow(self) + if not self.sceneManager is None: + getOgreManager().destroySceneManager(self.sceneManager) - def _OnSize(self, event): - """ - Is called when the ogre Window is getting resized - @param event: the sizing event - @return: none - """ - try: - if getattr(self, 'ogreRoot', None): - self.renderWindow.windowMovedOrResized() - event.Skip() - except: - pass + def _OnSize(self, event): + """ + Is called when the ogre Window is getting resized + @param event: the sizing event + @return: none + """ + try: + if getattr(self, 'ogreRoot', None): + #resize the window + width, height = GetSizeTuple() + self.renderWindow.resize(width, height) + #Tell Ogre the window has been resized. + self.renderWindow.windowMovedOrResized() + + event.Skip() + except: + pass - def _OnEraseBackground(self, event): - """ - overwrite standart background drawing routing with empty one - @param event: the draw event - @return: none - """ - # Do nothing, to avoid flashing on MSW. - pass + def _OnEraseBackground(self, event): + """ + overwrite standart background drawing routing with empty one + @param event: the draw event + @return: none + """ + # Do nothing, to avoid flashing on MSW. + pass - def _OnCloseWindow(self, event): - """ - called when the ogre window gets closed - @param event: the closing event - @return: none - """ - self.Destroy() + def _OnCloseWindow(self, event): + """ + called when the ogre window gets closed + @param event: the closing event + @return: none + """ + self.Destroy() - def AcceptsFocus(self): - """ - this window may accept keyboard focus - """ - return True - - def SceneInitialisation(self): - """ - default, base function, that has to be overwritten in the inherited class. It gets called after create the window, and should select a scenemanger. - @return: none - """ - pass + def AcceptsFocus(self): + """ + this window may accept keyboard focus + """ + return True + + def SceneInitialisation(self): + """ + default, base function, that has to be overwritten in the inherited class. It gets called after create the window, and should select a scenemanger. + @return: none + """ + pass - def OnFrameStarted(self): - """ - default, base function, that has to be overwritten in the inherited class. gets called before rendering a frame. - @return: none - """ - return - - def OnFrameEnded(self): - """ - default, base function, that has to be overwritten in the inherited class. gets called after rendering a frame. - @return: none - """ - return + def OnFrameStarted(self): + """ + default, base function, that has to be overwritten in the inherited class. gets called before rendering a frame. + @return: none + """ + return + + def OnFrameEnded(self): + """ + default, base function, that has to be overwritten in the inherited class. gets called after rendering a frame. + @return: none + """ + return This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |