Re: [pygccxml-development] Ogre Binding
Brought to you by:
mbaas,
roman_yakovenko
From: Lakin W. <lak...@gm...> - 2006-06-02 13:31:50
|
On 6/2/06, Roman Yakovenko <rom...@gm...> wrote: > On 6/2/06, Lakin Wecker <lak...@gm...> wrote: > > Good news: http://lakin.weckers.net/ogre/Screenshot.png this is > > rendered from python using the pyplusplus ogre bindings that I'm > > working on. > > Those are really good news. You did it! > > > ... only the CameraTrackingDemo.py is working) Thanks > First step is the most important one! > > I did not see SharedPtr treatment, without it a lot of functionality > will not be > available. Of course, and it is high up on my TODO list. > Few comments on script: > 1. For some reason you prefer to use "multiple select" functions, why? > For example: > > ogre_ns.classes ('ColourValue').always_expose_using_scope = True This is due to my laziness, I knew that this syntax worked at some point, so I continued to use it. I will be attempting to clean up the script over the next few days. > 2. There is nothing wrong with "always_expose_using_scope". The generated code > is longer, but compiler is able to give better errors locations. > I suggest you to set "always_expose_using_scope" to True for all classes. Will do. > 3. StringVector > from pyplusplus import code_creators > > code = """ > class_< std::vector<Ogre::String> > , boost::shared_ptr<std::vector<Ogre::String> > >("StringVector") > .def(vector_indexing_suite<std::vector<OgreString> >()) > ; > """ > > mb = module_builder_t(...) > mb.build_code_creator(...) > mb.code_creator.body.adopt_creator( code_creators.custom_text_t( code ), 0 ) > > This will add code that register StringVector. I will send you the > updated script Thanks > 4. generate_code.py and sconscript could re-use ogre_settings. > 4.1 please move gccxml location to ogre_settings > 4.2 please move "build" dir to ogre_settings > 4.3 import ogre_settings from sconscript. Thus you will be able to > re-use all > variables and settings. > And of course I will don't have to change anything when I download > your script Yes, this is the first thing on my TODO list. I had forgotten about some of the variables that I still had hard coded. :( > 5. System wide configurations better to do at the end. > > ogre_ns.member_functions (lambda decl: decl.name.startswith( '_' > )).exclude () > ogre_ns.member_functions (lambda decl: decl.name == '', > allow_empty=True).exclude () > > Because, when you configure classes, you include them. That is why few lines > later you need to exclude some of the functions again. Yes of course. I should have figured this out. > > 1. I still have the call_policy for const Matrix4 & problem, (see the > > matrix4 scons log), even though there is code in generate_code.py that > > should specify call_policies for all references and pointer return > > types. > > > > 2. There are some issues for compiling the > Sorry, can not reproduce. The generated file compiles fine for me. > May I guess? You are generating XML files from one Ogre header files, > but compile python bindings with another. Or may be you use different > compilation settings. > > Please put all environment variables into ogre_settings. For this one, are you referring to #1, #2, or both? I will go ahead and put all environment settings into ogre_settings. As for your first guess: I'm fairly certain that I am using the exact same headers for both steps. However, I will double check. > > 4. If you look through the generate_code.py, you'll notice a number > > of TODO statements. Some of these are simply that, things that I > > still need to take care of, however, others are methods, or classes > > that I've excluded because they cause problems, and I'm not sure how > > to fix them. As I go back through and add them one at a time and see > > if I can figure them out. If not, I'll post here with more questions. > > I will take a look on other issuer this evening. I suggest you to ask the > questions, if you can not find solution in 30 minutes :-) Of course. My general criteria for this is: Try it. If I have ideas try them. When I run out of ideas, use google, repeat. When I've finished trying everything that google has told me, I'll post here. Lakin |