[Python-ogre-commit] SF.net SVN: python-ogre: [599] trunk/python-ogre
Brought to you by:
andy_miller,
roman_yakovenko
|
From: <and...@us...> - 2008-06-20 06:57:51
|
Revision: 599
http://python-ogre.svn.sourceforge.net/python-ogre/?rev=599&view=rev
Author: andy_miller
Date: 2008-06-19 23:57:55 -0700 (Thu, 19 Jun 2008)
Log Message:
-----------
Various cleanups for latest version (SVN 7604) of ogre
Fixing Ogre demos for the 1.2 release
Modified Paths:
--------------
trunk/python-ogre/PythonOgreConfig_nt.py
trunk/python-ogre/code_generators/common_utils/__init__.py
trunk/python-ogre/code_generators/common_utils/ogre_properties.py
trunk/python-ogre/code_generators/nxogre/generate_code.py
trunk/python-ogre/code_generators/nxogre/python_nxogre_aliases.h
trunk/python-ogre/code_generators/nxogre/python_nxogre_sizeof.h
trunk/python-ogre/code_generators/ogre/generate_code.py
trunk/python-ogre/code_generators/ogre/hand_made_wrappers.py
trunk/python-ogre/code_generators/ogre/python_ogre.h
trunk/python-ogre/code_generators/ogre/python_ogre_sizeof.h
trunk/python-ogre/demos/ogre/Demo_Basic.py
trunk/python-ogre/demos/ogre/Demo_Facial.py
trunk/python-ogre/demos/ogre/Demo_Fresnel.py
trunk/python-ogre/demos/ogre/Demo_Grass.py
trunk/python-ogre/demos/ogre/SampleLoadingBar.py
trunk/python-ogre/demos/ogre/quake3settings.cfg
trunk/python-ogre/environment.py
Removed Paths:
-------------
trunk/python-ogre/demos/ogre/1.py
trunk/python-ogre/demos/ogre/Demo_Blank.py
trunk/python-ogre/demos/ogre/a1.py
trunk/python-ogre/demos/ogre/c1.sed
Modified: trunk/python-ogre/PythonOgreConfig_nt.py
===================================================================
--- trunk/python-ogre/PythonOgreConfig_nt.py 2008-06-20 06:56:17 UTC (rev 598)
+++ trunk/python-ogre/PythonOgreConfig_nt.py 2008-06-20 06:57:55 UTC (rev 599)
@@ -97,7 +97,7 @@
PATH_LIB_Newton = os.path.join( PATH_Newton ,'dll') ##NOTE Posix platforms this lives in 'lib-mt'
PATH_LIB_OIS = os.path.join( PATH_OIS, 'lib') ## NOTE Posix platforms this lives in'lib' not 'dll'
PATH_LIB_CEGUI = os.path.join( PATH_CEGUI, 'lib' )
-PATH_LIB_ODE = os.path.join( PATH_ODE, 'lib/releasedll')## probable releaselib for posix
+PATH_LIB_ODE = os.path.join( PATH_ODE, 'lib/releaselib')## probable releaselib for posix
PATH_LIB_OPCODE = os.path.join( PATH_OPCODE )
PATH_LIB_OgreOde = os.path.join( PATH_OgreOde, 'lib/Release')
# # PATH_LIB_OgreBullet = os.path.join( PATH_OgreBullet, 'lib/Release')
Modified: trunk/python-ogre/code_generators/common_utils/__init__.py
===================================================================
--- trunk/python-ogre/code_generators/common_utils/__init__.py 2008-06-20 06:56:17 UTC (rev 598)
+++ trunk/python-ogre/code_generators/common_utils/__init__.py 2008-06-20 06:57:55 UTC (rev 599)
@@ -156,7 +156,7 @@
if duplicate:
for k in unique.keys():
if len ( unique[k] ) > 1 :
-# print "DUPLICATE FOUND: ", cls, len ( unique[k] )
+ print "DUPLICATE FOUND: ", cls, len ( unique[k] )
for p in unique[k]:
# print " Checking", p.name, p.fget, p.fset
prefered = p
Modified: trunk/python-ogre/code_generators/common_utils/ogre_properties.py
===================================================================
--- trunk/python-ogre/code_generators/common_utils/ogre_properties.py 2008-06-20 06:56:17 UTC (rev 598)
+++ trunk/python-ogre/code_generators/common_utils/ogre_properties.py 2008-06-20 06:57:55 UTC (rev 599)
@@ -64,8 +64,11 @@
def create_read_only_property( self, fget ):
found = self.find_out_ro_prefixes( fget.name )
+# print "Prop Check", fget.name, ' ',
if found in ( None, '' ):
+# print "NO"
return None
+# print "YES"
## Now we need to look for overlapping function declarations
pure_names = []
pure_names.append( fget.name[len( found ):].lower())
Modified: trunk/python-ogre/code_generators/nxogre/generate_code.py
===================================================================
--- trunk/python-ogre/code_generators/nxogre/generate_code.py 2008-06-20 06:56:17 UTC (rev 598)
+++ trunk/python-ogre/code_generators/nxogre/generate_code.py 2008-06-20 06:57:55 UTC (rev 599)
@@ -52,14 +52,14 @@
def ManualExclude ( mb ):
global_ns = mb.global_ns
main_ns = global_ns.namespace( MAIN_NAMESPACE )
- return
+
-
for c in main_ns.classes():
if c.decl_string.startswith('::NxOgre::Container<') and '*' not in c.decl_string:
print "EXCLUDING: ", c
c.exclude()
+
### Now some of the functions need to be excluded.. This is too much and could be cut back
### ie only some of the containers lists fail at compile time
funlist = ['get','has','next','remove']
@@ -70,10 +70,21 @@
print "EXCLUDING: ", c, f
except:
pass
+
+ funlist = ['begin','get','getFirst','next','copyTo','_begin','_next']
+ if c.decl_string.startswith('::NxOgre::Container<'):
+ for f in funlist:
+ try:
+ c.member_functions(f).exclude()
+ print "EXCLUDING: ", c, f
+ except:
+ pass
+
for v in c.variables(allow_empty=True):
if v.access_type != 'public' :
v.exclude()
print "excluded", v, v.access_type
+
for t in main_ns.typedefs():
if t.decl_string.startswith('::NxOgre::Container<') and '*' not in t.decl_string:
t.exclude()
@@ -85,28 +96,19 @@
for m in c.member_functions(allow_empty=True):
for e in excludes:
if e in m.decl_string:
+ print "EXCLUDING: ", m
m.exclude()
# problem with a constructor on Cloth
- main_ns.class_('::NxOgre::Cloth').constructor(arg_types=[None,'::NxClothDesc','::NxMeshData',None,None]).exclude()
+# main_ns.class_('::NxOgre::Cloth').constructor(arg_types=[None,'::NxClothDesc','::NxMeshData',None,None]).exclude()
# functions specified in the headers but not implemented
- main_ns.class_('::NxOgre::Blueprints::ActorBlueprint').member_function('unserialise',arg_types=[None]).exclude()
+# main_ns.class_('::NxOgre::Blueprints::ActorBlueprint').member_function('unserialise',arg_types=[None]).exclude()
# # #
# # # ### Member Functions
- excludes=[
- '::NxOgre::Container<std::string, NxOgre::FluidDrain*>::begin'
- ,'::NxOgre::Container<std::string, NxOgre::FluidDrain*>::get'
- ,'::NxOgre::Container<std::string, NxOgre::FluidDrain*>::getFirst'
- ,'::NxOgre::Container<std::string, NxOgre::FluidDrain*>::next'
- ,'::NxOgre::Container<std::string, NxOgre::FluidDrain*>::_begin'
- ,'::NxOgre::Container<std::string, NxOgre::FluidDrain*>::_next'
- ,'::NxOgre::Container<std::string, NxOgre::FluidEmitter*>::_begin'
- ,'::NxOgre::Container<std::string, NxOgre::FluidEmitter*>::_next'
- ,'::NxOgre::Container<std::string, NxOgre::FluidEmitter*>::getFirst'
- ,'::NxOgre::List<NxOgre::RemoteDebuggerConnection::Camera>::destroyAndEraseAll'
+ excludes=['::NxOgre::List<NxOgre::RemoteDebuggerConnection::Camera>::destroyAndEraseAll'
,'::NxOgre::List<NxOgre::RemoteDebuggerConnection::Camera>::dumpToConsole'
,'::NxOgre::UserAllocator::realloc'
,'::NxOgre::Cloth::duplicate'
@@ -157,11 +159,31 @@
,'::NxOgre::OgreNodeRenderable::addSceneNode'
# ,'::NxOgre::ResourceStreamPtr::ResourceStreamPtr'
,'::NxOgre::MaterialAlias::generateConversionList'
+# ,'::NxOgre::Container<std::string, NxOgre::FluidDrain*>::begin'
+# ,'::NxOgre::Container<std::string, NxOgre::FluidDrain*>::get'
+# ,'::NxOgre::Container<std::string, NxOgre::FluidDrain*>::getFirst'
+# ,'::NxOgre::Container<std::string, NxOgre::FluidDrain*>::next'
+# ,'::NxOgre::Container<std::string, NxOgre::FluidDrain*>::_begin'
+# ,'::NxOgre::Container<std::string, NxOgre::FluidDrain*>::_next'
+# ,'::NxOgre::Container<std::string, NxOgre::FluidEmitter*>::_begin'
+# ,'::NxOgre::Container<std::string, NxOgre::FluidEmitter*>::_next'
+# ,'::NxOgre::Container<std::string, NxOgre::FluidEmitter*>::getFirst'
+ ,'::NxOgre::Actor::getCompartment'
+ ,'::NxOgre::Shape::getSkeleton'
+# ,'::NxOgre::Container< std::string, NxOgre::Cloth* >::begin'
+# ,'::NxOgre::Container< std::string, NxOgre::Cloth* >::get'
+# ,'::NxOgre::Container< std::string, NxOgre::Cloth* >::getFirst'
+# ,'::NxOgre::Container< std::string, NxOgre::Cloth* >::next'
+# ,'::NxOgre::Container< std::string, NxOgre::Cloth* >::CopyTo'
+
]
for e in excludes:
print "excluding ", e
-# # # main_ns.member_functions(e).exclude()
+ try:
+ main_ns.member_functions(e).exclude()
+ except:
+ print "FAIL TO EXCLUDE"
## this is probably excessive :)
names = ['_begin','_end', '_atEnd', '_next']
@@ -185,15 +207,20 @@
,'Character' ## defined in header but not very much implementation
# ,'RenderableSource'
,'ResourceManager'
+ ,'::NxOgre::Container< std::string, NxConvexMesh* >' # issue with deleting protected classes
# ,'ResourceStreamPtr'
- ,'::NxOgre::Blueprints::ActorFactory'
- ,'State'
- ,'MeshResource'
- ,'::NxOgre::Serialiser::SerialiserBase'
+# ,'::NxOgre::Blueprints::ActorFactory'
+# ,'State'
+# ,'MeshResource'
+# ,'::NxOgre::Serialiser::SerialiserBase'
+# ,'BlueprintUserData'
]
for e in excludes:
print "Excluding", e
-# # main_ns.class_(e).exclude()
+ try:
+ main_ns.class_(e).exclude()
+ except:
+ print "FAILED"
# # #
# # #
## I have a challenge that Py++ doesn't recognise these classes by full name (perhaps because they are structs?)
@@ -210,7 +237,10 @@
print ("Checking:",c.name)
if c.name in excludeName:
print ("SPECIAL excluding ", c.name)
-# # c.exclude()
+ try:
+ c.exclude()
+ except:
+ print "FAILED"
# a temporary fix for container based classes -- still an issue with them though...
# AND this is an overkill -- not all classes need these removed...
# # if c.decl_string.startswith ('::NxOgre::Container<'):
@@ -230,11 +260,23 @@
for e in excludes:
main_ns.typedefs(e).exclude()
- ### Operators
+ ### Operators
+ for o in main_ns.operators():
+ if o.decl_string.startswith('::NxOgre::Container<'):
+ if o.decl_string.endswith('[]'):
+ print "Excluding Operator: ", o
+ o.exclude()
excludes=['::NxOgre::Container<std::string, NxOgre::FluidDrain*>::operator[]'
- ,'::NxOgre::Container<std::string, NxOgre::FluidEmitter*>::operator[]']
-# for e in excludes:
-# main_ns.operators(e).exclude()
+ ,'::NxOgre::Container<std::string, NxOgre::FluidEmitter*>::operator[]'
+ ,'::NxOgre::Container< std::string, NxOgre::Cloth* >::operator[]'
+ ,'::NxOgre::Container< std::string, NxOgre::Fluid* >::operator[]'
+ ]
+ for e in excludes:
+ print "Excluding operator:", e
+ try:
+ main_ns.operators(e).exclude()
+ except:
+ print "FAILED"
#
### Constructors
# # for c in main_ns.class_('::NxOgre::Pose').constructors(): ## these hide the working constructors
Modified: trunk/python-ogre/code_generators/nxogre/python_nxogre_aliases.h
===================================================================
--- trunk/python-ogre/code_generators/nxogre/python_nxogre_aliases.h 2008-06-20 06:56:17 UTC (rev 598)
+++ trunk/python-ogre/code_generators/nxogre/python_nxogre_aliases.h 2008-06-20 06:57:55 UTC (rev 599)
@@ -1,6 +1,12 @@
typedef std::vector<NxOgre::Joint::LimitPlane,std::allocator<NxOgre::Joint::LimitPlane> > VectorJointLimitPlane;
typedef std::vector<NxOgre::SimplePlane*,std::allocator<NxOgre::SimplePlane*> > VectorSimplePlane;
+typedef std::map<std::string, NxOgre::Container<std::string, NxOgre::CharacterSystem::Character*>::Containee, std::less<std::string>, std::allocator<std::pair<std::string const, NxOgre::Container<std::string, NxOgre::CharacterSystem::Character*>::Containee> > >\
+ MapContainerCharacterSystemCharacter;
+typedef std::map<std::string, NxOgre::Container<std::string, NxOgre::CharacterSystem::CharacterMovementModel*>::Containee, std::less<std::string>, std::allocator<std::pair<std::string const, NxOgre::Container<std::string, NxOgre::CharacterSystem::CharacterMovementModel*>::Containee> > >\
+ MapContainerCharacterSystemMovementModel;
+
+
typedef std::vector<float, std::allocator<float> > VectorFloat;
typedef std::vector<std::string, std::allocator<std::string> > VectorString;
typedef std::list<std::string> stdString;
Modified: trunk/python-ogre/code_generators/nxogre/python_nxogre_sizeof.h
===================================================================
--- trunk/python-ogre/code_generators/nxogre/python_nxogre_sizeof.h 2008-06-20 06:56:17 UTC (rev 598)
+++ trunk/python-ogre/code_generators/nxogre/python_nxogre_sizeof.h 2008-06-20 06:57:55 UTC (rev 599)
@@ -27,7 +27,7 @@
sizeof ( NxHeightField );
sizeof ( NxUserContactReport );
//sizeof ( NxOgre::FluidDrain );
-sizeof ( NxImplicitScreenMesh );
+// sizeof ( NxImplicitScreenMesh );
sizeof ( NxMemoryType );
sizeof ( NxJointState );
sizeof ( NxBounds3 );
Modified: trunk/python-ogre/code_generators/ogre/generate_code.py
===================================================================
--- trunk/python-ogre/code_generators/ogre/generate_code.py 2008-06-20 06:56:17 UTC (rev 598)
+++ trunk/python-ogre/code_generators/ogre/generate_code.py 2008-06-20 06:57:55 UTC (rev 599)
@@ -1033,13 +1033,20 @@
for cls in main_ns.classes():
if cls.name not in NoPropClasses:
+ print "ADDING PROPS", cls
cls.add_properties( recognizer=ogre_properties.ogre_property_recognizer_t() )
common_utils.remove_DuplicateProperties ( cls )
## because we want backwards pyogre compatibility lets add leading lowercase properties
common_utils.add_LeadingLowerProperties ( cls )
+
common_utils.add_constants( mb, { 'ogre_version' : '"%s"' % environment.ogre.version.replace("\n", "\\\n")
- , 'python_version' : '"%s"' % sys.version.replace("\n", "\\\n" ) } )
-
+ , 'python_version' : '"%s"' % sys.version.replace("\n", "\\\n" )
+ , 'pythonogre_version' : '"%s"' %\
+ '.'.join( [environment.PythonOgreMajorVersion,
+ environment.PythonOgreMinorVersion,
+ environment.PythonOgrePatchVersion] ) }
+ )
+
## need to create a welcome doc string for this...
common_utils.add_constants( mb, { '__doc__' : '"Python-Ogre Main Module for OGRE 3D"' } )
Modified: trunk/python-ogre/code_generators/ogre/hand_made_wrappers.py
===================================================================
--- trunk/python-ogre/code_generators/ogre/hand_made_wrappers.py 2008-06-20 06:56:17 UTC (rev 598)
+++ trunk/python-ogre/code_generators/ogre/hand_made_wrappers.py 2008-06-20 06:57:55 UTC (rev 599)
@@ -365,6 +365,22 @@
"\"" + environment.PythonOgrePatchVersion + "\""
) );
}
+## Duplicating to get lower case 'get'
+boost::python::tuple
+getOgreVersion () {
+ return ( boost::python::make_tuple( Ogre::StringConverter::toString(OGRE_VERSION_MAJOR),
+ Ogre::StringConverter::toString(OGRE_VERSION_MINOR),
+ Ogre::StringConverter::toString(OGRE_VERSION_PATCH),
+ OGRE_VERSION_NAME
+ ) );
+}
+boost::python::tuple
+getPythonOgreVersion () {
+ return ( boost::python::make_tuple( "\"" + environment.PythonOgreMajorVersion + "\"",
+ "\"" + environment.PythonOgreMinorVersion + "\"",
+ "\"" + environment.PythonOgrePatchVersion + "\""
+ ) );
+}
Ogre::VertexData *
Modified: trunk/python-ogre/code_generators/ogre/python_ogre.h
===================================================================
--- trunk/python-ogre/code_generators/ogre/python_ogre.h 2008-06-20 06:56:17 UTC (rev 598)
+++ trunk/python-ogre/code_generators/ogre/python_ogre.h 2008-06-20 06:57:55 UTC (rev 599)
@@ -32,44 +32,44 @@
// This code is VERY UNTESTED and PROBABLY BROKEN
// Uee the CVS version of Ogre !!!!
-#ifndef OGRE_VERSION_1.4 // these are needed for the 1.2.x SDK
- #include "OgreEventListeners.h"
- #include "OgreEventQueue.h"
- #include "OgreKeyEvent.h"
- #include "OgreMouseEvent.h"
+// #ifndef OGRE_VERSION_1.4 // these are needed for the 1.2.x SDK
+// #include "OgreEventListeners.h"
+// #include "OgreEventQueue.h"
+// #include "OgreKeyEvent.h"
+// #include "OgreMouseEvent.h"
-namespace Ogre {
-class CombinedListener : public FrameListener, public KeyListener,
- public MouseListener, public MouseMotionListener
-{
-public:
- CombinedListener() {}
- virtual ~CombinedListener() {}
-
- // KeyListener methods
- virtual void keyClicked(KeyEvent *e) {}
- virtual void keyPressed(KeyEvent *e) {}
- virtual void keyReleased(KeyEvent *e) {}
-
- // MouseListener methods
- virtual void mouseClicked(MouseEvent *e) {}
- virtual void mousePressed(MouseEvent *e) {}
- virtual void mouseReleased(MouseEvent *e) {}
- virtual void mouseEntered(MouseEvent *e) {}
- virtual void mouseExited(MouseEvent *) {}
-
- // MouseMotionListener methods
- virtual void mouseMoved(MouseEvent *e) {}
- virtual void mouseDragged(MouseEvent *e) {}
-
- // FrameEvent methods
- virtual bool frameStarted (const FrameEvent &evt) {return true;}
- virtual bool frameEnded (const FrameEvent &evt) {return true;}
-};
+// namespace Ogre {
+// class CombinedListener : public FrameListener, public KeyListener,
+// public MouseListener, public MouseMotionListener
+// {
+// public:
+// CombinedListener() {}
+// virtual ~CombinedListener() {}
+//
+// // KeyListener methods
+// virtual void keyClicked(KeyEvent *e) {}
+// virtual void keyPressed(KeyEvent *e) {}
+// virtual void keyReleased(KeyEvent *e) {}
+//
+// // MouseListener methods
+// virtual void mouseClicked(MouseEvent *e) {}
+// virtual void mousePressed(MouseEvent *e) {}
+// virtual void mouseReleased(MouseEvent *e) {}
+// virtual void mouseEntered(MouseEvent *e) {}
+// virtual void mouseExited(MouseEvent *) {}
+//
+// // MouseMotionListener methods
+// virtual void mouseMoved(MouseEvent *e) {}
+// virtual void mouseDragged(MouseEvent *e) {}
+//
+// // FrameEvent methods
+// virtual bool frameStarted (const FrameEvent &evt) {return true;}
+// virtual bool frameEnded (const FrameEvent &evt) {return true;}
+// };
+//
+// }
+// #endif
-}
-#endif
-
#endif//__python_ogre_h_5B402FBF_8DE8_49C9_AF71_1CF9634B5344__
Modified: trunk/python-ogre/code_generators/ogre/python_ogre_sizeof.h
===================================================================
--- trunk/python-ogre/code_generators/ogre/python_ogre_sizeof.h 2008-06-20 06:56:17 UTC (rev 598)
+++ trunk/python-ogre/code_generators/ogre/python_ogre_sizeof.h 2008-06-20 06:57:55 UTC (rev 599)
@@ -14,6 +14,13 @@
sizeof( stdext::_Hash<stdext::_Hmap_traits<std::string, Ogre::MovableObject*, stdext::hash_compare<std::string, std::less<std::string> >, std::allocator<std::pair<std::string const, Ogre::MovableObject*> >, false> > );
#endif
+#if OGRE_VERSION_MINOR == 4
+
+#else
+ sizeof ( Ogre::ResourceBackgroundQueue );
+#endif
+
+
sizeof( std::pair<Ogre::SharedPtr<Ogre::Resource>, bool> );
std::vector< int > v;
Deleted: trunk/python-ogre/demos/ogre/1.py
===================================================================
--- trunk/python-ogre/demos/ogre/1.py 2008-06-20 06:56:17 UTC (rev 598)
+++ trunk/python-ogre/demos/ogre/1.py 2008-06-20 06:57:55 UTC (rev 599)
@@ -1,4 +0,0 @@
-import time
-
-while True:
- print "hello", time.localtime()
\ No newline at end of file
Modified: trunk/python-ogre/demos/ogre/Demo_Basic.py
===================================================================
--- trunk/python-ogre/demos/ogre/Demo_Basic.py 2008-06-20 06:56:17 UTC (rev 598)
+++ trunk/python-ogre/demos/ogre/Demo_Basic.py 2008-06-20 06:57:55 UTC (rev 599)
@@ -19,7 +19,7 @@
import ogre.io.OIS as OIS
class OGREMain(ogre.Root):
- def __init__(self, plugins_path='src/plugins.cfg',resource_path='resources.cfg'):
+ def __init__(self, plugins_path='plugins.cfg',resource_path='resources.cfg'):
ogre.Root.__init__(self, plugins_path)
self.plugins_path = plugins_path
self.resource_path = resource_path
@@ -55,22 +55,23 @@
for ren in rend_list:
print ren.getName()
cap = ren.getCapabilities()
- print "MaxPointSize:", cap.getMaxPointSize()
- print "Stencil stuff:", cap.getStencilBufferBitDepth()
- opts = ren.getConfigOptions()
- print "Opts:", opts
- print "Opts keys:",opts.keys()
- for i in opts:
- print "Key:",i.key
- print i.value.currentValue
- print i.value.name
- print i.value.immutable
- for v in i.value.possibleValues:
- print "Posible Value", v
-
- print dir(opts)
- print "Opts", opts['Video Mode']
- print"Viewo Mode:", ren.getConfigOptions()['Video Mode']
+ if cap:
+ print "MaxPointSize:", cap.getMaxPointSize()
+ print "Stencil stuff:", cap.getStencilBufferBitDepth()
+ opts = ren.getConfigOptions()
+ print "Opts:", opts
+ print "Opts keys:",opts.keys()
+ for i in opts:
+ print "Key:",i.key
+ print i.value.currentValue
+ print i.value.name
+ print i.value.immutable
+ for v in i.value.possibleValues:
+ print "Posible Value", v
+
+ print dir(opts)
+ print "Opts", opts['Video Mode']
+ print"Viewo Mode:", ren.getConfigOptions()['Video Mode']
self.setRenderSystem(rend_list[-1])
def _build_scene(self):
Deleted: trunk/python-ogre/demos/ogre/Demo_Blank.py
===================================================================
--- trunk/python-ogre/demos/ogre/Demo_Blank.py 2008-06-20 06:56:17 UTC (rev 598)
+++ trunk/python-ogre/demos/ogre/Demo_Blank.py 2008-06-20 06:57:55 UTC (rev 599)
@@ -1,110 +0,0 @@
-# This code is in the Public Domain
-# -----------------------------------------------------------------------------
-# This source file is part of Python-Ogre
-# For the latest info, see http://python-ogre.org/
-#
-# It is likely based on original code from OGRE
-# For the latest info, see http://www.ogre3d.org/
-#
-# You may use this sample code for anything you like, it is not covered by the
-# LGPL.
-# -----------------------------------------------------------------------------
-import sys
-sys.path.insert(0,'..')
-import PythonOgreConfig
-
-import ogre.renderer.OGRE as ogre
-
-
-def doit():
- # create the root
- self.root = ogre.Root(getPluginPath())
-
- # setup the resources
- config = ogre.ConfigFile()
- config.load('resources.cfg' ) #, '', False )
- seci = config.getSectionIterator()
- while seci.hasMoreElements():
- secName = seci.peekNextKey()
- settings = seci.getNext()
- for entry in settings:
- typeName = entry.key
- archName =entry.value
- ogre.ResourceGroupManager.getSingleton().addResourceLocation(archName, typeName, secName)
-
-
- # load the resources
- ogre.ResourceGroupManager.getSingleton().initialiseAllResourceGroups()
- carryOn = self.root.showConfigDialog()
- if carryOn:
- self.renderWindow = self.root.initialise(True, "OGRE Render Window")
- else:
- sys.exit()
- self.sceneManager = self.root.createSceneManager(ogre.ST_GENERIC,"ExampleSMInstance")
- self.camera = self.sceneManager.createCamera('PlayerCam')
- self.camera.setPosition(ogre.Vector3(0, 0, 500))
- self.camera.lookAt(ogre.Vector3(0, 0, -300))
-
- self.viewport = self.renderWindow.addViewport(self.camera)
-
- sceneManager.ambientLight = ogre.ColourValue(0.5, 0.5, 0.5)
- sceneManager.setSkyBox(True, "Examples/SpaceSkyBox")
- light = sceneManager.createLight('MainLight')
- light.setPosition (20, 80, 50)
-
- # need a framelistener
- self.frameListener = BlankListener(self.renderWindow, self.camera, self.sceneManager)
- self.root.addFrameListener(self.frameListener)
-
- self.root.startRendering()
-
-
-class BlankListener(ogre.FrameListener, ogre.WindowEventListener):
- def __init__(self, renderWindow, camera, sceneManager):
- ogre.FrameListener.__init__(self)
- ogre.WindowEventListener.__init__(self)
- self.sceneManager = sceneManager
- self.camera = camera
- self.renderWindow = renderWindow
-
- windowHnd = self.renderWindow.getCustomAttributeInt("WINDOW")
- self.InputManager = OIS.createPythonInputSystem([("WINDOW",str(windowHnd))])
- self.Keyboard = self.InputManager.createInputObjectKeyboard( OIS.OISKeyboard, self.bufferedKeys )
- self.Mouse = self.InputManager.createInputObjectMouse( OIS.OISMouse, self.bufferedMouse )
-
- #Set initial mouse clipping size
- self.windowResized(self.renderWindow)
-
- #Register as a Window listener
- ogre.WindowEventUtilities.addWindowEventListener(self.renderWindow, self);
-
- def windowClosed(self, rw):
- if( rw == self.renderWindow ):
- if( self.InputManager ):
- self.InputManager.destroyInputObjectMouse( self.Mouse )
- self.InputManager.destroyInputObjectKeyboard( self.Keyboard )
- OIS.InputManager.destroyInputSystem(self.InputManager)
- self.InputManager=None
-
-
- def windowResized (self, rw):
- [width, height, depth, left, top] = rw.getMetrics() # Note the wrapped function as default needs unsigned int's
- ms = self.Mouse.getMouseState()
- ms.width = width
- ms.height = height
-
- def __del__ (self ):
- ogre.WindowEventUtilities.removeWindowEventListener(self.renderWindow, self)
- self.windowClosed(self.renderWindow)
-
- def frameStarted(self, frameEvent):
- if(self.renderWindow.isClosed()):
- return False
- ##Need to capture/update each device - this will also trigger any listeners
- self.Keyboard.capture()
- self.Mouse.capture()
-
- if self.Keyboard.isKeyDown(OIS.KC_ESCAPE) or self.Keyboard.isKeyDown(OIS.KC_Q):
- return False
- return sf.FrameListener.frameStarted(self, frameEvent)
-
Modified: trunk/python-ogre/demos/ogre/Demo_Facial.py
===================================================================
--- trunk/python-ogre/demos/ogre/Demo_Facial.py 2008-06-20 06:56:17 UTC (rev 598)
+++ trunk/python-ogre/demos/ogre/Demo_Facial.py 2008-06-20 06:57:55 UTC (rev 599)
@@ -63,7 +63,7 @@
self.animationStates.append( anim)
# Create Camera
- self.camnode = sceneManager.RootSceneNode.createChildSceneNode("CamNode1", ogre.Vector3(0, 25, 90))
+ self.camnode = sceneManager.getRootSceneNode().createChildSceneNode("CamNode1", ogre.Vector3(0, 25, 90))
node = self.camnode.createChildSceneNode("PitchNode1")
node.attachObject(self.camera)
Modified: trunk/python-ogre/demos/ogre/Demo_Fresnel.py
===================================================================
--- trunk/python-ogre/demos/ogre/Demo_Fresnel.py 2008-06-20 06:56:17 UTC (rev 598)
+++ trunk/python-ogre/demos/ogre/Demo_Fresnel.py 2008-06-20 06:57:55 UTC (rev 599)
@@ -240,12 +240,12 @@
self.planeEnt.setMaterialName("Examples/FresnelReflectionRefraction")
- sceneManager.rootSceneNode.createChildSceneNode().attachObject(self.planeEnt)
+ sceneManager.getRootSceneNode().createChildSceneNode().attachObject(self.planeEnt)
sceneManager.setSkyBox(True, "Examples/CloudyNoonSkyBox")
#My node to which all objects will be attached
- self.rootNode = sceneManager.rootSceneNode.createChildSceneNode()
+ self.rootNode = sceneManager.getRootSceneNode().createChildSceneNode()
# create above Water Entities
# # for entity_name in "head1 Pillar1 Pillar2 Pillar3 Pillar4 UpperSurround".split():
Modified: trunk/python-ogre/demos/ogre/Demo_Grass.py
===================================================================
--- trunk/python-ogre/demos/ogre/Demo_Grass.py 2008-06-20 06:56:17 UTC (rev 598)
+++ trunk/python-ogre/demos/ogre/Demo_Grass.py 2008-06-20 06:57:55 UTC (rev 599)
@@ -101,14 +101,13 @@
## a little randomness
self.xpos += reg.getCentre().x * 0.001
self.zpos += reg.getCentre().z * 0.001
- offset.x = math.sin(self.xpos) * 0.05
- offset.z = math.sin(self.zpos) * 0.05
+ offset.x = math.sin(self.xpos) * 5
+ offset.z = math.sin(self.zpos) * 5
for lod in reg.getLODIterator():
for mat in lod.getMaterialIterator():
for geom in mat.getGeometryIterator():
geom.setCustomParameter(OFFSET_PARAM, offset)
-
def frameStarted( self, evt) :
global mAnimState
if sf.FrameListener.frameStarted(self, evt) == False:
@@ -396,11 +395,18 @@
## Put an Ogre head in the middle
m = ogre.MeshManager.getSingleton().load("ogrehead.mesh",
ogre.ResourceGroupManager.DEFAULT_RESOURCE_GROUP_NAME)
-
- ### Note the python version of suggestTangentVectorBuildParams!!
- ret, src, dest = m.suggestTangentVectorBuildParams(ogre.VES_TANGENT)
- if ( not ret):
- m.buildTangentVectors(ogre.VES_TANGENT, src, dest)
+
+
+ if ogre.GetPythonOgreVersion()[1] == '1' and int(ogre.GetPythonOgreVersion()[1]) < 2: ## Python Ogre after 1.2 has API changes
+ ### Note the python version of suggestTangentVectorBuildParams!!
+ ret, src, dest = m.suggestTangentVectorBuildParams(ogre.VES_TANGENT)
+ if ( not ret):
+ m.buildTangentVectors(ogre.VES_TANGENT, src, dest)
+ else: ## note the change for more recent version of Python-Ogre...
+ ### Note the python version of suggestTangentVectorBuildParams!!
+ ret, src, dest = m.suggestTangentVectorBuildParams(ogre.VES_TANGENT,1,1)
+ if ( not ret):
+ m.buildTangentVectors(ogre.VES_TANGENT, src, dest)
e = self.sceneManager.createEntity("head", "ogrehead.mesh")
e.setMaterialName("Examples/OffsetMapping/Specular")
@@ -408,10 +414,9 @@
headNode.attachObject(e)
headNode.setScale(7,7,7)
headNode.setPosition(0,200,0)
- e.setNormaliseNormals(True)
+ headNode.yaw(ogre.Degree(15))
self.camera.move(ogre.Vector3(0,350,0))
- print "2"
-
+
def _createFrameListener(self):
self.frameListener = GrassListener(self.renderWindow, self.camera, self.sceneManager)
self.root.addFrameListener(self.frameListener)
Modified: trunk/python-ogre/demos/ogre/SampleLoadingBar.py
===================================================================
--- trunk/python-ogre/demos/ogre/SampleLoadingBar.py 2008-06-20 06:56:17 UTC (rev 598)
+++ trunk/python-ogre/demos/ogre/SampleLoadingBar.py 2008-06-20 06:57:55 UTC (rev 599)
@@ -86,9 +86,14 @@
self.mLoadingDescriptionElement.setCaption(ogre.UTFString("Parsing scripts.."))
self.mWindow.update()
- def scriptParseStarted(self, scriptName):
- self.mLoadingCommentElement.setCaption(ogre.UTFString(scriptName))
- self.mWindow.update()
+ if ogre.OgreVersionString[:2] == "12":
+ def scriptParseStarted(self, scriptName):
+ self.mLoadingCommentElement.setCaption(ogre.UTFString(scriptName))
+ self.mWindow.update()
+ else:
+ def scriptParseStarted(self, scriptName, skipThisScript):
+ self.mLoadingCommentElement.setCaption(ogre.UTFString(scriptName))
+ self.mWindow.update()
if ogre.OgreVersionString[:2] == "12":
def scriptParseEnded(self):
@@ -96,7 +101,7 @@
self.mLoadingBarElement.getWidth() + self.mProgressBarInc)
self.mWindow.update()
else:
- def scriptParseEnded(self, scriptName):
+ def scriptParseEnded(self, scriptName, skipped):
self.mLoadingBarElement.setWidth(
self.mLoadingBarElement.getWidth() + self.mProgressBarInc)
self.mWindow.update()
Deleted: trunk/python-ogre/demos/ogre/a1.py
===================================================================
--- trunk/python-ogre/demos/ogre/a1.py 2008-06-20 06:56:17 UTC (rev 598)
+++ trunk/python-ogre/demos/ogre/a1.py 2008-06-20 06:57:55 UTC (rev 599)
@@ -1,3 +0,0 @@
-import ogre.renderer.OGRE as ogre
-def test():
- print ogre.sm
Deleted: trunk/python-ogre/demos/ogre/c1.sed
===================================================================
--- trunk/python-ogre/demos/ogre/c1.sed 2008-06-20 06:56:17 UTC (rev 598)
+++ trunk/python-ogre/demos/ogre/c1.sed 2008-06-20 06:57:55 UTC (rev 599)
@@ -1,21 +0,0 @@
-s/mGUIRenderer/self.mGUIRenderer/
-s/mGUISystem/self.mGUISystem/
-s/mDescWindow/self.mDescWindow/
-s/mFixedBias/self.mFixedBias/
-s/mGradientBias/self.mGradientBias/
-s/mGradientClamp/self.mGradientClamp/
-s/mDepthShadowTweak/self.mDepthShadowTweak/
-s/mFixedBiasText/self.mFixedBiasText/
-s/mGradientBiasText/self.mGradientBiasText/
-s/mGradientClampText/self.mGradientClampText/
-s/mCurrentShadowTechnique/self.mCurrentShadowTechnique/
-s/mCurrentProjection/self.mCurrentProjection/
-s/mCurrentMaterial/self.mCurrentMaterial/
-s/mCustomRockwallVparams/self.mCustomRockwallVparams/
-s/mCustomRockwallFparams/self.mCustomRockwallFparams/
-s/mCustoself.mAtheneVparams/self.mCustoself.mAtheneVparams/
-s/mCustoself.mAtheneFparams/self.mCustoself.mAtheneFparams/
-s/mCurrentShadowCameraSetup/self.mCurrentShadowCameraSetup/
-s/mPlane/self.mPlane/
-s/mLiSPSMSetup/self.mLiSPSMSetup/
-s/mIsOpenGL/self.mIsOpenGL/
\ No newline at end of file
Modified: trunk/python-ogre/demos/ogre/quake3settings.cfg
===================================================================
--- trunk/python-ogre/demos/ogre/quake3settings.cfg 2008-06-20 06:56:17 UTC (rev 598)
+++ trunk/python-ogre/demos/ogre/quake3settings.cfg 2008-06-20 06:57:55 UTC (rev 599)
@@ -1,5 +1,3 @@
-#Pak0Location: ../media/packs/ogretestmap.zip
+Pak0Location: ../media/packs/ogretestmap.zip
#Map: maps/q3dm3.bsp
-#Map: ogretestmap.bsp
-Pak1Location: c:/temp/ww
-Map: maps/wamphi1.bsp
+Map: ogretestmap.bsp
Modified: trunk/python-ogre/environment.py
===================================================================
--- trunk/python-ogre/environment.py 2008-06-20 06:56:17 UTC (rev 598)
+++ trunk/python-ogre/environment.py 2008-06-20 06:57:55 UTC (rev 599)
@@ -955,7 +955,7 @@
class navi:
active = True
pythonModule = True
- version="1.5"
+ version="1.6"
parent="ogre/gui"
name ='navi'
CCFLAGS = '-D"WIN32" -D"NDEBUG", -D"WINDOWS"'
@@ -964,15 +964,15 @@
include_dirs = [ Config.PATH_Boost
,Config.PATH_INCLUDE_Ogre
,Config.PATH_INCLUDE_navi
- ,os.path.join(Config.PATH_navi,'..','Dependencies','win32','llmozlib','include')
+ ,os.path.join(Config.PATH_navi,'..','Dependencies','win32','astral','include')
]
lib_dirs = [Config.PATH_LIB_Boost,
Config.PATH_LIB_Ogre_OgreMain
,Config.PATH_LIB_navi
- ,os.path.join(Config.PATH_navi,'..','Dependencies','win32','llmozlib','lib')
+ ,os.path.join(Config.PATH_navi,'..','Dependencies','win32','astral','lib')
]
CheckIncludes=[]
- libs=[ Config.LIB_Boost, 'Navi', 'OgreMain','llmozlib', 'user32',
+ libs=[ Config.LIB_Boost, 'Navi', 'OgreMain','Astral', 'user32',
'kernel32.lib', 'gdi32.lib', 'winspool.lib', 'comdlg32.lib', 'advapi32.lib',
'shell32.lib','ole32.lib','oleaut32.lib','uuid.lib' ]
ModuleName="navi"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|