BVW tutorial updates

Changing cNode to cNodePath in calls to add_collider() in bvwdemo_12.py and in picker.py fixed the problem in bvwdemo_12.py and bvwdemo_13.py.

The program bvwdemo_14.py will start up, but when the Panda collides with the bamboo and tries to eat the program halts with: File "bvwdemo_14.py, line 168, in eat; pandaEat.start(); Attribute Error: ‘NoneType’ object has no attribute ‘start’. Any suggestions on this one?

The program bvwdemo_15.py starts, but immediately exits with: File bvwdemo_15.py, line 2, in ?; from direct.gui.DirectGHI import *; ImportError: No module named DirectGUI. I appreciate any suggestions on this one as well. Thanks.

Get rid of the first .start() - must be a typo

   pandaEat = Parallel(SoundInterval(self.eatSound),self.panda.actorInterval("eat")).start()
    pandaEat.start()

   pandaEat = Parallel(SoundInterval(self.eatSound),self.panda.actorInterval("eat"))
    pandaEat.start()

Try lower case “ui” in GUI.

from direct.gui.DirectGui import * # 2D GUI elements

Python seems to be case-sensitive. Even when looking for egg/bam files - it cares whether it is “Environment” or “environment” - while Windows doesn’t care.

Still, it’s been two days of Python and I can say I kinda understand it. What I don’t get is where all these globals (render, base, taskMgr) come from… ok I get they come from the imports, but it seems you can use them without any predeclaration (nice and also problematic at the same time).

I’m assuming that some of the globals are inherited, since class World extends DirectObject – class World(DirectObject):

Thanks for the tips on bvwdemo_14.py and bvwdemo_15. That works!

Are you able to get bvwlauncher.py to run? Mine is raising a SAXNotSupportedException. The traceback starts on line 317 in bvwlauncher.py, then goes to line 122 in init, then to line 148 in setFeature.

Just tried it… I changed the the line

        xmlParser.setFeature(xml.sax.handler.feature_validation,True)

to

        xmlParser.setFeature(xml.sax.handler.feature_validation,False)

I’ve seen similar errors in Perl. Or you can trap the exception (ala C++!)

    except xml.sax.SAXNotSupportedException:
        #print "Warning: Validation not supported, we may be forced to parse some invalid config file to undefined results"
        pass

I think that was the original intent, but the exception named changed in different XML parser versions?

Then you have the usual suspects: cNode ->cNodePath and GUI -> Gui errors. All of this makes me like Python more than (barf) Perl… Strange to use a Tk window to pop up over a OpenGL/Direct3D window…

OK, Got the launcher running. Thanks a lot. If you find other good panda demos / tutorials (other than the manual), please let me know.

Check the online panda manual.
I added a Panda Bootstrap Section with the tutorial list.
Please try to make it better, if possible.

Also can you put a patch for the bvw demo somewhere, should save people like me some pain.

I’d recommend keeping that link to the bvw scripting tutorial out of the main manual until it gets updated to work with 1.1.0 (or at least noting its incompatible with the current version). The current bvw tutorials for panda are technically out of date (we made them at the beginning of the year, when 1.0.5 was being used)

I think the tutorial is very good.
It would be better, if we spent our time adding the minor fixes and patching it rather than removing the links from the manual.

I will do it when i am working on them.[/img]

I heartily agree. If someone gets an up to date source made, I can replace the current version with it. In the meantime, I threw the non-current disclaimer up.

It might also be a good idea to consider throwing these as a first section in introductory tutorials.