Commits

Richard Plangger  committed 725778e

removed material loading from the main plugin entry and moved it into properties
updated the readme for the new installation process

  • Participants
  • Parent commits 07bb099

Comments (0)

Files changed (4)

 * License: [GNU LGPL](http://www.gnu.org/licenses/lgpl.html)
 * [Source code repository](https://bitbucket.org/MindCalamity/blender2ogre)
 * [Issue tracker](https://bitbucket.org/MindCalamity/blender2ogre/issues)
-* [Ogre forum thread](http://ogre3d.org/forums/viewtopic.php?f=8&t=61485)
+* [Ogre forum thread](http://ogre3d.org/forums/viewtopic.php?f=8&t=61485)
    
 ## Authors ##
 
 * [Jonne Nauha](https://bitbucket.org/jonnenauha) aka Pforce
 * vax456
 * Sybren Stüvel
-
-Additionally the following companies have supportted/sponsored the development efforts.
-
-* [Adminotech Ltd.](http://www.meshmoon.com/)
-
+
+Additionally the following companies have supportted/sponsored the development efforts.
+
+* [Adminotech Ltd.](http://www.meshmoon.com/)
+
 ## Repository notes ##
 
-This is a fork of the [original version](https://code.google.com/p/blender2ogre/) which is no longer actively maintained. This fork is to continue mainaining support for new Blender releases and to develop the code base further with bug fixes and new functionality. 
+This is a fork of the [original version](https://code.google.com/p/blender2ogre/) which is no longer actively maintained. This fork is to continue mainaining support for new Blender releases and to develop the code base further with bug fixes and new functionality.
 
 ----------
 
-## Download ##
+## Download (Linux, Windows, OS X) ##
 
-* Supports Blender 2.66 and various older versions 
-* For Linux, Windows and OSX
-* [Download official releases](https://code.google.com/p/blender2ogre/downloads)
-* [Get latest sources](https://bitbucket.org/MindCalamity/blender2ogre)
+* [Download official releases](https://bitbucket.org/MindCalamity/blender2ogre/downloads)
+* [Get latest sources](https://bitbucket.org/MindCalamity/blender2ogre/sources)
+* Blender 2.71
+* Blender 2.66
+* Might also work with older versions of Blender
 
 ## Updating to new versions ##
 
 ----------
 
 ## Installing ##
-    
-### Using Windows .msi installer ###
 
-**Note:** The Windows MSI installer is not available for all releases!
+Please refer to the download section and download the desired plugin version. This zip file
+should be extracted into the blender scripts/addons folder.
+You can find instructions on how to find this folder [here](http://wiki.blender.org/index.php/Doc:2.6/Manual/Extensions/Python/Add-Ons#Installation_of_an_Add-On).
+After installing the addon enable it in Blender from `User Preferences > Add-Ons > Import-Export`. Search for `ogre` and check the box on the right. Remember to save as default if you want the addon to be enabled after you exit your Blender.
+Integrated help docs will be shown in the upper right hand toolbar, replacing blender's normal `Help` menu, read them for assistance.
 
-The addon script `io_export_ogreDotScene.py` has automatically been copied to the correct place by the installer. 
-        
-If the installer fails to detect a valid Blender installation for the automatic copying, it will show a dialog for the user and instructions how/where to copy it manually. The uninstall step also tries to automatically clean the script file from Blender.
-        
-Mandatory dependencies are installed to the blender2ogre install directory. The script should automatically try to find them from there and set them correctly to the addon config.
-
-### Using an .zip archive release (or raw io_export_ogreDotScene.py file) ###
-
-If you are using a .zip arhive release. Extract it to disk, you will find `io_export_ogreDotScene.py` inside of it.
-
-Use Blenders interface, under user-preferences, click addons, click `install-addon`, and select `io_export_ogreDotScene.py`. 
-
-Or you can simply copy `io_export_ogreDotScene.py` to your blender installation under `blender/2.6x/scripts/addons/`
+## Pre 0.6.1 ##
 
 ### 3rd party tutorials ###
 
-* Meshmoon: Video and text instructions how to install and use blender2ogre addon. See [http://doc.meshmoon.com/index.html?page=from-blender-to-meshmoon-part-1](http://doc.meshmoon.com/index.html?page=from-blender-to-meshmoon-part-1)
-
-## Enabling the blender2ogre addon ##
-
-* After installing the addon enable it in Blender from `User Preferences > Add-Ons > Import-Export`. Search for `ogre` and check the box on the right. Remember to save as default if you want the addon to be enabled after you exit your Blender.
-* Integrated help docs will be shown in the upper right hand toolbar, replacing blender's normal `Help` menu, read them for assistance.
+* Meshmoon: Video and text instructions how to install and use blender2ogre addon. See [http://doc.meshmoon.com/index.html?page=from-blender-to-meshmoon-part-1](http://doc.meshmoon.com/index.html?page=from-blender-to-meshmoon-part-1)
 
 ----------
 
 
 #### Linux ####
 
-* Install the package `ogre-1.8-tools` or `ogre-tools` if your distro provides it. For example on Ubuntu `apt-get install ogre-1.8-tools`
-* Or get [Ogre sources](https://bitbucket.org/sinbad/ogre), run CMake, `make && make install`. This should build `/usr/local/bin/OgreXMLConverter`
+* Install the package `ogre-1.8-tools` or `ogre-tools` if your distro provides it. For example on Ubuntu `apt-get install ogre-1.8-tools`
+* Or get [Ogre sources](https://bitbucket.org/sinbad/ogre), run CMake, `make && make install`. This should build `/usr/local/bin/OgreXMLConverter`
 
 #### Mac OSX ####
 
 
 See `Setting tool paths` section on how to configure the optional tools if default paths fail to find them.
         
-#### Image Magick ####
+#### Image Magick ####
 
 * Install [Image Magick](http://www.imagemagick.org) to the default location.
 
 
 * **Windows** Get the [latest Ogre Meshy](http://sourceforge.net/projects/ogremeshy/) and install to the default location. See the "Setting tool paths" section. Prefer using the 64-bit OgreMeshy for 64-bit Windows.                
 * **Linux / Mac OSX** Get Ogre Meshy for Windows, install wine, extract OgreMeshy to `/home/yourname/OgreMeshy`
-
-#### NVIDIA Texture Tools 2.0 with CUDA acceleration ####
+
+#### NVIDIA Texture Tools 2.0 with CUDA acceleration ####
 
 * [http://code.google.com/p/nvidia-texture-tools/](http://code.google.com/p/nvidia-texture-tools/)
 * **Note:** NVIDIA DDS, if you can not install "NVIDIA Texture Tools 2.0" above, you can still use [Legacy Utils](http://developer.nvidia.com/object/dds_utilities_legacy.html)
 
-#### realXtend Tundra ####
+#### realXtend Tundra ####
 
 Tundra is a 3D virtual world platform that uses Ogre3D for rendering. This plugin can export the Tundra scene format `.txml` directly along with the Ogre binary assets. Those scenes can be easily loaded and viewer by Tundra. Tundra also supports drag and drop imports for the Ogre scene file `.scene`.          
 
 
 You can change the required and optional tool paths in Blender when you see the need for it. This usually needs to be done if you failed to install the tools to the default paths, or they cannot be found from the default paths.
 
-* In Blender go to `Properties > Scene > Ogre Configuration File`
-* Edit the required tool paths 
+* In Blender go to `Properties > Scene > Ogre Configuration File`
+* Edit the required tool paths 
 * Click `update config file` to store the new config. You may need to restart Blender for the changes to take effect.

File io_ogre/__init__.py

     # export drop down add ogre export function
     bpy.types.INFO_MT_file_export.append(ui.export.menu_func)
 
-    if os.path.isdir( config.get('USER_MATERIALS') ):
-        scripts,progs = update_parent_material_path( config.get('USER_MATERIALS') )
-        for prog in progs:
-            logging.info('Ogre shader program', prog.name)
-    else:
-        logging.warn('Invalid my-shaders path %s' % config.get('USER_MATERIALS'))
-
 def unregister():
     logging.info('Unloading io_ogre %s', bl_info["version"])
     # remove the drop down

File io_ogre/ogre/material.py

 from datetime import datetime
+import os
 from ..util import *
+from .. import config
 
 # Make default material for missing materials:
 # * Red flags for users so they can quickly see what they forgot to assign a material to.
 }
 '''
 
+def load_user_materials():
+    # I think this is soley used for realxtend... the config of USER_MATERIAL
+    # points to a subdirectory of tundra by default. In this case all parsing
+    # can be moved to the tundra subfolder
+    if os.path.isdir( config.get('USER_MATERIALS') ):
+        scripts,progs = update_parent_material_path( config.get('USER_MATERIALS') )
+        for prog in progs:
+            logging.info('Ogre shader program', prog.name)
+    else:
+        logging.warn('Invalid my-shaders path %s' % config.get('USER_MATERIALS'))
+
 
 def material_name( mat, clean = False ):
     if type(mat) is str:

File io_ogre/properties.py

 import bpy
 from bpy.props import BoolProperty, StringProperty, FloatProperty, IntProperty, EnumProperty
-from .ogre.material import IMAGE_FORMATS
+from .ogre.material import IMAGE_FORMATS, load_user_materials
 
+load_user_materials()
 # Rendering
 
 bpy.types.Object.use_draw_distance = BoolProperty(