wxOgre - linux port quest -

skorpio

05-05-2008 07:54:28

Hello,

The lack of tools for OGRE has been discussed to death. Most user view it as as an impossible task. The main reason is that people do not have time and/or have substitutes. Anyway, I have been working on something that could help most of us, python-ogre users, a simple way to achieve tools for ogre.

The idea is to build up more tools for python-ogre as time goes on. I use some base code from the /demos/ogre folder to implement my approach:

wxOgre a python-ogre-wxpython approach


The wxOgre.py is close cousin to Demo_OgreWx.py is has been cleanup, pycrust has been removed. The layout is horizontal.
The basic structure is two have 2 panels on each side of the Ogre rendering window. The panels are implemented as wxPanel.
The Panels are kept in different source files, thus avoiding really messy code. Eventually panels can be loaded and unloaded. But the main reason for them is to create tools for python-ogre.


I enclosed two panels as demo. I'm also trying to learn as I go.
By the way, control panel2 was supposed to load ovelays into the OGRE rendering window but it is not finished yet, It just loads files. Work in progress, (WIP)

I can see more developers writing panels for all kind of support:Such as
overlays editors
mesh loaders
texture images viewers
skeleton editors
particle editors
material editors
importers
plugins
scene managers
animation panel to generate keyframes
etc.

ogreWinWx.py is a closed cousin of ogreWindowWx.py. Yes, it has been cleanup, It can render a windows of given size, show the OGRE config screen or not, I reduced the timer to 10msec. 33 seem really slow.

Installation
Create a folder in your demos folder named wxOgre
Copy all the files to the wxOgre folder

Run wxOgre.py
By default, it will create a 800x600 OpenGL, no dialog box. It will still have the fish as demo, but the button are now part of the panel. It has a menu to exit and show the statistics.

Plan
the long term plan, is to add more support to python-ogre. I would like to use some kind of XML back structure to edit meshes, skeleton, particles, materials. etc. The short term is to implement viewing capabilities of meshes, skeleton and other stuff. The main goal is to add more and more support as time goes on.


Please let me know your thoughts about this approach.

Thanks,

Skorpio

bharling

06-05-2008 11:47:41

The idea is sound certainly, heres my thoughts -

1) Check out the showcase forum, Sinbad has just open-sourced his own wxWidgets Ogre editor, and called it wxOgre MVC!

2) I'd be happy to write some modules for this, I've got quite a lot of experience with wxPython and python-ogre.

3) However, if you want several different authors to write modules, you have to have some sort of central interface sorted out first, answer questions like 'how does my module communicate with the render window for updating materials or textures?', 'What format do i save data from my module in?'

4) Actual mesh or skeleton editing in ogre is going to be *really* hard to code. So that the project has a chance of getting done, I'd recommend ditching the idea of editing meshes in ogre - thats what blender is for really.

I you can get a robust central framework in place, then I'll be more than happy to help ( I think I'd like to make a material editor). One thing I'd like to see is hotkeys / clever view navigation, I hate editors where you have to click a button on the GUI to rotate or move the camera, really tiresome!

skorpio

06-05-2008 15:39:17

Hello,

Thanks I will check it out. I will try to write some specifications.

Skorpio

skorpio

06-05-2008 15:41:12

Hello,

I was able to write the code for displaying the overlay.
Here is the code for control2_wx.py


import wx
import ogre.renderer.OGRE as ogre


class ogreClassOverlayPanel(wx.Panel):

def __init__(self, parent, id, ogrewin):
wx.Panel.__init__(self, parent, id, size=(640, 480))
self.parent = parent
self.ogreWin = ogrewin

self.overlayList=[]
self.overlayshow = False
self.overlay = None

self._wxLoadOverlayList()
self._wxCreateButton()


def _wxCreateButton(self):
self.testPressButton = wx.Button(self, -1, "Hide Overlay",(180, 100), (120, -1))
self.Bind(wx.EVT_BUTTON, self.__OnPressButtonCallback, self.testPressButton)


def _wxLoadOverlayList(self):
LISTBOX_OVERLAY = wx.NewId()

overlayManager = ogre.OverlayManager.getSingleton()
overlayIterator = overlayManager.getOverlayIterator();
while (overlayIterator.hasMoreElements()):
ovrlay = overlayIterator.getNext();
self.overlayList.append(ovrlay.getName())

self.overlays = wx.ListBox(self, LISTBOX_OVERLAY, (5, 0), (170, 300), self.overlayList, wx.LB_SINGLE)
self.Bind(wx.EVT_LISTBOX, self.__OnListBox, id=LISTBOX_OVERLAY)

def __OnListBox(self,event):
index = event.GetSelection()
overlayElement = self.overlayList[index]

if self.overlayshow== True:
self.overlay.hide()
self.overlayshow = False

self.overlay = ogre.OverlayManager.getSingleton().getByName(overlayElement)

if self.overlay is None:
raise ogre.Exception(111, "Could not find overlay " + overlayElement, "wxOgre.py")
if self.overlay.show:
self.overlay.show()
self.overlayshow = True
else:
self.overlay.hide()
self.overlayshow = False


def __OnPressButtonCallback(self,event):
if self.overlayshow== True:
self.overlay.hide()
self.overlayshow = False


bharling

07-05-2008 10:16:36

Cool, glad to see you got it working.

Been thinking about this some more, I think an interface based on the wx.AUI approach would be cool for this type of project. Check out the wxAUI demo in the wxPython demos application, I think dockable, configurable windows would be great to work with ogre editing.

bharling

07-05-2008 12:53:58

Here's what I'm on about:

http://pasteall.org/743/python

this is basically just the wx.AUI example hacked to include an ogre window. I think some arrangement like this would be cool.

skorpio

08-05-2008 08:11:50

Hello,

Yes, that looks very interesting. I will studying it
to see what I can use.

thanks,

skorpio

13-05-2008 08:35:29

Hello,

Here is the latest version rev2.
I added camera support for top view and 1st quadrant view. It needs some work.
Also, the panel layout can be changed but not loaded/unloaded yet.

Controlpanel3 loads entities at 0,0,0 for now. Eventually it will load entities at a given coordinate or the user will be able to move them within the OGRE to the desired position. I'm not sure which one is easier.

You will need axes.mesh in the model folder and axes.png in the materials\texture folder

All the files in the zip

wxOgre rev2.zip

dedesite

13-05-2008 12:42:04

Hi skorpio,

Thanks for sharing your work ;).

I also want to create tool for Ogre with wxPython and python-ogre, so I've got interest in your work.

On my side, I'm porting the wxOgreMVC that Sinbad released last week. For now, I've got nothing to show but I'll post as soon as I have some screens ;).

Greetings,
Andreas

skorpio

14-05-2008 08:35:28

Hello,

Here is rev3
I corrected some errors on the menu.
I added a new bottom panel. I intend to show texture files here... or something else.
I added the ability to specify the the origin XYZ for loaded meshes.

I added a thumbnail creator to the controlpanel1

I'm thinking about adding a toolbar for common function like camera, etc.


wxOgre rev3.zip




PS. set the XYZ before clicking load entity button


chpod

14-05-2008 09:52:34

I am impressed with your latest version (rev3), thanks for sharing Skorpio!

Several thoughts:

GUI Design:
I worked on a similar application some time ago and started using boa http://boa-constructor.sourceforge.net. Boa is sometimes buggy, but it is still very useful for GUI design. How did you design you GUI until now? By hand? Using BOA? Using glade?

Antialiasing fix proposal:
In ogreWinWx.py, line 92, add this to enable anti-aliasing:
renderParameters['FSAA'] = "16" There must be a cleaner way to check what the graphic adapter is really capable of, but this hopefully does the trick.

Ideas:
I would eventually be happy to work on this project. I would be interested in:
- adding "Full screen" capability (F11/Escape)
- adding some kind of timeline for key frame based animation

Keep this up!
chpod

skorpio

15-05-2008 04:26:05

Hello,

Thanks for the encouragement. I really like programming using python.
I'm learning as I go, so sometimes it takes me a while to crack a problem. I'm trying to get few things here and there. When I saw the original code for the Demo_WX.py, I thought it would be a nice starting point. I incorporated the idea of panels to make it more modular. The GUI was derived from the original + panels. I tried glade and wxAUI from bharling. They are nice but I kept it simple.

The Roadmap
The goal of wxOGRE is to become a useful tool for python-ogre through incremental changes. The tools are implemented using panels for modularity. Anybody is welcomed to participate. Use sample panels to create your own tools.


Things in the pipeline
1) I will be working on a Generate application. This feature will allow to create python-ogre aplication that will run without WX support. The user will use wxOGRE to add entities, animations, create world, etc. and then click the Generate button to create an OGRE stand alone version.
wxOGRE will store all information into a XML file similar to dotscene, then wxOGRE will read the XML and create python-ogre code. The XML can be viewed, loaded and modified to generate new apps.

2) Add a wxpython wrapper to MeshMagick. it is pretty useful but I ofter forget the commands. It would be nice to have a panel for this one.

3) Add a wxpython wrapper to XMLOGRE converter too.

4) Add a keyframe generation. I would like to do it graphically.


Thanks,

skorpio

15-05-2008 08:22:03

Hello,

Here is version 4.
I added the ability to rotate and scale and entity on Loading.
To reduce the scale (<1). Use checkbox

Also I added an Adjust button. Click on any of the loaded entities and use the same control for pos,rot and scaling, then click button.
The entity will change accordingly.

Fix the bug for antialiasing
Fix the bug screen capture button to generate JPEGs instead of PNG


Bugs
Top camera not resetting to original position


Rev4.zip

here is two athenes 1 regular size the other half the size

skorpio

19-05-2008 01:13:42

Hello

A few python-ogre users have express the desire to write tools for wxOgre. So, I thought it would take a little time off to describe how to write panel tools for wxOgre. Before I could do that, I had to clean up the code some more and implement a rude Panel manager for loading different panels. Integrating it to the existing code prove much tougher than I thought. However the process was reduced to 6 steps. First you will need to create a ClassPanel and then integrate to the wxOgre.py.

Here is an example of how to write a PanelClass.


## Control4_wx.py

import wx
import ogre.renderer.OGRE as ogre

class ogreControl2ClassPanel(wx.Panel):

def __init__(self, parent, id, ogrewin):
wx.Panel.__init__(self, parent, id, size=(640, 480))
self.parent = parent
self.id = id
self.ogreWin = ogrewin


Here we create an empty class panel but we are passing an ogrewin pointer. This is necessary so that we can access all the OGRE goodies!

Next, we need to integrate the panels within wxOgre.py. I added some comments to indicate the place that need modifying to test your ClassPanel. There is a lot of improvement that can be done here, incrementally of course.


## wxOgre.py

from Control4_wx import ogreControl2ClassPanel
##STEP 1 Import new ClassPanel


class wxFrame(wx.Frame):
def __init__(self, *args, **kwds):

.
.
.
self.wxPanels.append(wx.Panel(self,-1))
##STEP 2 Add a generic panel here. Append to the self.wxPanels

ogreControl2ClassPanel (self.wxPanels[4],-1,self.ogreWin)
## STEP 3 Create a ClassPanel

self.wxPanels[4].SetMinSize(self.BottomPanelSize)
## STEP 4 Assign a minimum size to the new ClassPanel

self.wxPanelName.append ( "Screen Capture")
## STEP 5 Give a name to new ClassPanel. Append to self.wxPanelName

self.wxPanels[4].SetBackgroundColour("#DDDDDD")
## STEP 6 Give it a background color. Shades of gray!


The current sizes for STEP 4 are:
self.LeftPanelSize = wx.Size(320,500)
self.RightPanelSize = wx.Size(320,500)
self.CenterPanelSize = wx.Size(640,480)
self.BottomPanelSize = wx.Size(640,200)



These instructions should help on developing new ClassPanel. Please refer to the existing examples. If everything goes ok, the Panel manager should be able to display the new ClassPanel.

Here is a good easy source of wxPython code that I use a lot.
http://www.zetcode.com/


Now to the goodies!!


The REV5 has a lot of new features:

Toolbar
Gives easy access to some handy functions. Full Screen, Panel View, Camera angles, Screenshot capture and Panel Manager.
The camera angles give new ways to look at the scene. The camera can be pitched an yawed with the RMB.

A perspective view is available.


Menu bar
The menu bar has a tool entry. These are meant for tools that can make any part of development faster of fun. Tetris anyone?

The code is still under development. It took me a really long time to get the Panel Manager working. If anybody feels like giving a shot please to do so. It is going to take a while before I come this way.


Entity ClassPanel
Here a new button has been added to move a node that is attached to an entity. The result is that it looks like the entity moves within OGRE world!

The user must select the mesh and click the Move Button. Then the user must move the mouse to the OGRE window. Use arrow keys to move mesh in XZ plane and PAGEUP &PAGEDOWN in the XY plane. Use LMB to change the yaw angle of the node. Camera angles are still accessible. In order to return control to the camera the user must de-click the Move Button.

Roadmap
The next big task is to work on the Code generator for stand alone python. This will require changes the way wxOgre loads and saves entities. I will use an XML format to populate a scene. I may loose the ability to do animations but it will come back shortly.


Panel tools
keyframe generator:
Now that wxOgre supports in-scene positioning it would be easy to drop some markers (axes.mesh) in the scene and generate key frame from those markers. Then we would attach those keyframes to a node and to and entity to make them move. The simplest version of these shouldn't be too hard to implement. More advanced versions could have a pre-determined path to easily create new ones.

Universal Mesh.
I have given a lot of thought about this one. I figure that instead to creating a new mesh. It would be better to create a universal mesh, that is ,a mesh with a fix number of vertex, faces. Then wxOgre would "Mold" it to different shapes. These universal meshes would be created for humanoids, n-legged animals, etc. Also there could universal meshes for low-poly, medium, and high.

Universal Skeleton
This is similar to the meshes. The advantage is that all the animation would work for any given class of universal mesh.


Sound support
I have used pygame mixer functions, and it works reasonably well. An OGG converter would be handy.

Camera support
A more advanced camera panel would be nice. It would nice to change the position and distances. Dolly, panning and other cool stuff.


Please share your ideas for new tools.
Thanks,


wxOgre rev5




Full Image
http://img2.freeimagehosting.net/uploads/adf07eceee.jpg

Spom

24-05-2008 19:35:22

Hello Skorpio,

I stumpled upon your project and like the idea of an wxPython based ogre editor. I started a very similar project before I found yours. An wyPythpn/python-ogre content editor for our space game.

Here is a screenshot for an impression:
http://www.opengate.ontheserver.de/?Content=2&Zoom=258

Im choosing wxAUI for the frame management and just finished some ressource trees and a basic material editor.

Im just started learning Python and develop under Gentoo Linux. All our code ist open source and accessible via sourceforge:

svn co https://opengate.svn.sourceforge.net/sv ... s/ogEditor ogEditor

Maybee we can collaborate or share ideas.

Greeting,
Spom

skorpio

25-05-2008 03:58:40

Hello Spom,

wxAUI is nice and your implementation is nice looking too.
There is another person porting the wxOgreMVC. In essence there are 3 different GUIs based on the wxOgre. I don't mind that. If we all use the same internal structure, we all benefit from each others work.


It would be great to cooperate, and create modules that can work in either application.

Have you tried wxOGRE on Gentoo yet?
I did try your version but I'm missing some files

Best Regards,

Skorpio

Spom

25-05-2008 16:00:01

you probably miss the game related bindings. I separated them from the editor and make them an optional module.
I commited the changes to the svn. Now it should start with an ogrehead.mesh as default.

I also tested on windows. That seams to works but my propertygrid looks totally weird. :?

I have tried wxOGRE on windows and it works nice after I removed 'import Image' in wxOgre.py and Control4_wx.py. It looks really promising.

On Gentoo, wxOGRE crashs after startup, probably ogreWinWx.py do not deliver a proper windowhandle on linux/gtk.

In ogEditor I get this windowhandle by libwxogre_util.so which is explained and indroduced in this thread:
http://www.ogre3d.org/phpBB2addons/view ... wxogreutil

I can try to alter the existing ogreWinWx.py to fit the requirements for windows and linux.

Greetings,
Spom

skorpio

27-05-2008 07:19:07

Hello,

I have been working on trying to make wxOgre a useful tool. The first part is the creation of a code generator. This part consists in reading a XML file and creating python-ogre code. The second part will generate an XML from the wxOgre GUI which the generator will use. The second part will come next.

The implementation of the generator is based on a combination of XML files and python-ogre classes. The classes are written in python and are integrated within the wxOgre Framework.

classOgreCore.py
Here we have the most basic function to create a python-ogre application.

classInputMgr.py
Here we process keyboard and mouse event. The keyboard handles KeyPressed and KeyReleased.

classNodeMovement.py
Here we process basic node movement like yaw and translation. Other movements can be added later. This type of classes will allow flexibility in the feature. It allows common code to be used by many. For example here the same functions can handle movement of the camera and the fish.

ogreGenerator.py
Here we process a XML file. Right now is hardcoded to look for testwxogre.xml ang generate a test1.py. It creates a python-ogre application.


XML
Here is the source on how to build an application. Python2.5 comes with all the xml libraries necessary to run.

test1.py
This is the output of the generator. It has main() and one class. The class has a _build scene, key_down, key_up, frame_started and frame_end. The structure was simplified to facilitate its creation.
So main() create sceneApp() which calls the classOgreCore() to initialize plugins, resources, etc. It also hooks up the classInputManager() to handle keyboard and mouse.

Next, main() renders one frame. Here our frame_started and frame_ended get called from the classOgreCore().

Finally, once the ESC key is pressed the application shuts down.

XML revisited
The XML has several sections. Please look at the sample testwxogre.xml
<environment> handles ambient light, skybox, skydome, fog and light.

<cameras> handles camera definition such as position and stuff.

<viewports> handles viewports creation and attachment a camera

<nodes> handles node position, orientation and scaling. You'll need a node if you have entities, planes, etc,

<entities> handles creation of entities and attachment to nodes. If the material is empty it uses the default material otherwise define your own.

<planes> handles creation of planes. Note: if the name and planeid are empty then this entry is ignored (not processed). Planes are attached to nodes through entities. So you must define an entity for the plane as well.

<events> handles the creation of classes such as "nodeMovement". As new classes are developed more events cang

<bindings> handles the mapping of keys to events to functions within the classes. Here keyup and down events are mapped.

<processes> handles background operations to be done either at frame start and/or frame end. They may be from classes or just background tasks.



<?xml version="1.0" encoding="ISO-8859-1"?>

<scene rev="1">
<environment rev="1">
<ambientlight r="0.7" g="0.7" b="0.7" />
<_skybox material="Examples/SpaceSkyBox" state="True"/>
<skydome material="Examples/CloudySky" curvature="4" tile="8" state="True"/>
<fog type="FOG_EXP" r="255" g="255" b="240" expdensity="0.0002" linearstart="" linearend="" />
<light name="light" lightid="Main" x="20" y="80" z="130"/>
</environment>

<cameras rev="1">
<camera name="camera" cameraid="Front" attach="nodeCameraFront">
<position x="300" y="150" z="300" />
<lookat x="0" y="1" z="0" />
<clipdistance near="5"/>
</camera>
</cameras>

<viewports rev="1">
<viewport name="viewport" viewportid="" attach="cameraFront">
<bkgcolor r="0.0" g="0.0" b="0.0" />
</viewport>
</viewports>

<nodes rev="1">
<node name="nodeAxes" nodeid="">
<position x="0" y="0" z="0" />
<orientation pitch="" yaw="" roll="" />
<scale x="5" y="5" z="5" />
</node>

<node name="nodeFish" nodeid="">
<position x="100" y="20" z="0" />
<orientation pitch="0" yaw="0" roll="0" />
<scale x="10" y="10" z="10" />
</node>

<node name="nodeFloor" nodeid="">
<position x="0" y="0" z="0" />
<orientation pitch="" yaw="" roll="" />
<scale x="" y="" z="" />
</node>

<node name="nodeCeiling" nodeid="">
<position x="0" y="0" z="0" />
<orientation pitch="0" yaw="0" roll="0" />
<scale x="1" y="1" z="1" />
</node>

<node name="nodeCamera" nodeid="Front">
<position x="300" y="150" z="300" />
<orientation pitch="" yaw="" roll="" />
<scale x="" y="" z="" />
</node>
</nodes>


<entities rev="1">
<entity name="Axis" file="axes.mesh" attach="nodeAxes" material="" />
<entity name="Fish" file="fish.mesh" attach="nodeFish" material="" />
<entity name="Floor" file="planeFloor" attach="nodeFloor" material="Examples/RustySteel" />
<_entity name="Ceiling" file="planeCeiling" attach="nodeCeiling" material="Examples/RustySteel" />
</entities>

<planes rev="1">
<plane name="plane" planeid="Floor" groupname="General" >
<size width="200000" height="200000"/>
<orientation x="0" y="1" z="0" distance="200"/>
<upvector x="0" y="0" z="1"/>
<normal createperpendicular="True"/>
<texture numcoordset="1"/>
<segments x="20" y="20"/>
<tile u="50.0" v="50.0"/>
<bufferusage vertex="ogre.HardwareBuffer.HBU_STATIC_WRITE_ONLY" index="ogre.HardwareBuffer.HBU_STATIC_WRITE_ONLY"/>
<shadowbuffer vertex="True" index="True"/>
</plane>

<plane name="" planeid="" groupname="General" >
<size width="2000" height="2000"/>
<orientation x="0" y="-1" z="0" distance="300"/>
<upvector x="0" y="0" z="1"/>
<normal createperpendicular="True"/>
<texture numcoordset="1"/>
<segments x="2" y="2"/>
<tile u="1.0" v="1.0"/>
<bufferusage vertex="ogre.HardwareBuffer.HBU_STATIC_WRITE_ONLY" index="ogre.HardwareBuffer.HBU_STATIC_WRITE_ONLY"/>
<shadowbuffer vertex="True" index="True"/>
</plane>
</planes>

<events>
<event name="eventCameraFront" eventid="" attach="nodeCameraFront" class="nodeMovement"/>
<event name="eventFish" eventid="" attach="nodeFish" class="nodeMovement"/>
</events>

<bindings rev="1">
<keyboard>
<key id="KC_LEFT" event="eventCameraFront" key_down="start_spinning(-1)" key_up="stop_spinning()"/>
<key id="KC_RIGHT" event="eventCameraFront" key_down="start_spinning( 1)" key_up="stop_spinning()"/>
<key id="KC_UP" event="eventCameraFront" key_down="start_moving( 1)" key_up="stop_moving()"/>
<key id="KC_DOWN" event="eventCameraFront" key_down="start_moving(-1)" key_up="stop_moving()"/>

<key id="KC_1" event="eventFish" key_down="start_spinning(-1)" key_up="stop_spinning()"/>
<key id="KC_2" event="eventFish" key_down="start_spinning( 1)" key_up="stop_spinning()"/>
<key id="KC_3" event="eventFish" key_down="start_moving( 1)" key_up="stop_moving()"/>
<key id="KC_4" event="eventFish" key_down="start_moving(-1)" key_up="stop_moving()"/>
</keyboard>

<mouse>
</mouse>
</bindings>

<processes>
<process event="eventCameraFront" frame_started="update()" frame_ended=""/>
<process event="eventFish" frame_started="update()" frame_ended=""/>
</processes>

</scene>



NOTES:
1) Some XML parameters are empty strings which the generator will ignore. Please check the code.

2) Putting underscore will "trick" the generator and not find that key. (See skyBox in the <environments> section

3) All major sections have a revision, eventually if the sections change a particular generator should check and call the appropriate code. Once the first version of the XML is release it would wise to check the revision.

4) Plane can be ignored if the name and id are both empty strings. This allows the code to remain within the XML file.

5) Most entries use the name and the id to generate a complete identification name. This is necessary when having multiples instances of robots, ninjas, etc.

6) Mouse is not activated yet, this is because I do like my mouse pointer to move outside the ogre render window. It will be activated at some point.

7) This code is preliminary and will probably change a bit if the structure breaks at some point. The next step is to get animation, overlys, particles, etc, in no particular order.

8) The LEFT, RIGHT, UP and DOWN are used to move the camera
1,2,3,4 are used to move the fish.


Please feel free to try out some of your own XML. I will be converting some of the demo found in the ogre folder to make sure the generator can handle most of them.

If you have any questions and comments feel free to post them here.

Thanks,

bharling

27-05-2008 09:02:18

Hi,

thats very interesting, I'll try and integrate what I've got for the material editor into your xml format.

dedesite

27-05-2008 12:32:17

Your work is very interesting skorpio, I have no time to look at it but I think we have the same goal : provide a powerful and simple ogre/game editor.
I'm working on wxOgreMVC in order to have good basis for my editor, once I 'll finish the portage, I'll look at your work and we could maybe colaborate ;).


Greetings,
Andreas

skorpio

28-05-2008 08:56:16

Hello,

I fixed a few issues with the ogregenerator.py. I added the capability to specify the XML and python file:

Now, you can specify the names in the command line.
c:\>ogregenerator.py demo_spinner.xml demo_spinner.py


I created XML files for:
demo_basic
demo_spinner
demo_skydome
testwxogre still available!

I also created a few more classes to handle:
overlay: show/hide
skydome: curvature/ tile Use G,H,Y,U, and F turns on/off the debugstatistics.


I will keep porting more of the Ogre Demos to test/debug ogregenerator.py. I figure I will need to add more support for XML so this may go for a while. So keep checking for new updates.

Thanks,

skorpio

31-05-2008 09:08:28

Hello,

I was able to convert the Demo_CameraTracking to the wxOgre Framework. I have included the XML along with the others.

Use:

c:>ogreGenerator.py demo_cameratracking.xml demo_cameratracking.py


XML list
demo_basic
demo_spinner
demo_skydome
demo_cameratracking

The good news is that I added support for autotracking to the ogreGenerator.py and it didn't break any of the existing XML files!!
This was necessary because Demo_CameraTracking uses it.

Also, I do not know how much this is due to the wxOgre Framework, but the under ogre, Demo_CameraTracking is 650 FPS and demo_cameratracking is about 1040 FPS.



ethankennerly

02-06-2008 18:21:27

I began with a similar intention as this thread, but a lot less technical prowess. Justin Lewis and I modified Demo_WX.py to create a simple editor. Immediately, a few problems arose:

1) the frame rate suffered.
2) the WX wrapper and Python-Ogre application were coupled.

Therefore, I went for a simpler, incomplete solution, to run the WX window separately, and invoke the Python-Ogre application remotely. This retained high frame rate, and kept WX decoupled from the Python-Ogre application. An example is shown here.

http://www.ogre3d.org/phpBB2addons/viewtopic.php?t=5822

I prefer the WX framework PythonCard for tool creation, because it has so many examples, and makes it easier for a designer (and not a fast programmer) like myself to rapidly create applications. In the example you can see that the code and presentation is succinct and separate.

Your work here is over my head; it's quite impressive, and I know I need Ogre tools. As I read through the discussion, I didn't see mention of this, so: I'd suggest decoupling the WX from Ogre. For example, in the WX app, allow it to "Open" an Ogre app, meaning that it runs the app in its usual Ogre window. That way:

1) There is no need to modify the Ogre app or write a wrapper for it.
2) The release application (Ogre) requires no additional modification.
3) The WX application, in theory, works with ANY well-formed Python-Ogre application.

Again, your technical discussion is over my head, and perhaps you've already solved this problem. I couldn't tell from reading. I wasn't able to successfully download from the file-hosting links, so I'm not sure what the full code is.

I hope your tools are easy to use and flexible for many Python-Ogre applications. If so, maybe I can help, since I need (and so I'm building) lightweight WX+Python-Ogre tools too.

-- Ethan
http://runesinger.com

skorpio

03-06-2008 08:43:37

Hello Ethan,

It is funny how things work out. You have solved the next piece of the puzzle.

So far I have been trying to crate a useful tool for ogre. I outlined 3-steps:
1) A GUI - right now is wxOgre based but uses the Ogre environment.
2) XML backbone - a way to create python-ogre ( It needs as XML writer, reader)
3) Modularity.

As I kept writing the wxOgre it became obvious that the wxOgre couldn't be used for writing real python-ogre apps because the frame rate was too slow, but it would great for GUI for generating new apps.

I think this picture will answer your questions.



As you can see, wxOgre Framework it is simple. I would like to combine the wxPanels and classes so they are common. I'm not sure how feasible this is.

I will study your approach because decoupling the wx from Ogre would make the GUI a lot simpler to maintain and you have already done this!

I guess my approach it is a little different from yours but the end-result it is the same: Native python-ogre code.

Where our approaches are the same is in decoupling the wx from Ogre to make better GUIs.

Roadmap
Basically to implement all the parts in the diagram shown above. The ogreGenerator.py handles a lot of the basic samples. I will study Ethan's code to merge with the existing code. Then I will write the XMLgenerator.py and the basic platform will be done.
Overtime the generators will become more complex and handle more but the basic architecture will remain the same.


XML list
demo_basic
demo_spinner
demo_skydome
demo_cameratracking
demo_wxOgre; 1 toggles animation 2 togles autotracking camera (no wx supports)
demo_skyplane
testwxogre

changes
I made changes ogrGgenerator.py to handle skyplane. I fixed a few bugs. I add new classes to support the new demos.


I'm not sure why the links are not working for you. I have not been able to find a good free-file hosting site yet. If you know one. I will post there. The idea is to make the code accessible to everyone.

Thanks,

ethankennerly

03-06-2008 22:54:58

Hmm. After looking at the code, I'm still confused on the use case that requires XML. Yesterday I spent hours decyphering and refactoring the dotscene.py which parses an XML dotscene files. I don't like parsing it one bit, not as a human in a text editor or as a programmer. That's my personal take. For dotscene, the value of XML is being an interchangeable standard between modelers and 3D graphics applications ("any" modeler to "any" 3D engine, where *any* means writing an XML generator/parser). Because you are writing GUI for Python-Ogre (only), is it reasonable to bypass the XML stage and call Python-Ogre commands directly? If you want to log the called code from which to program an app, that can be done at the same time the command is called.

That code linked in my last post is an example of calling Python-Ogre directly from the GUI. Here is a screenshot to go with it. Most of the functionality in the screenshot is included in the few dozen lines of code in that post, or in PythonCard's libraries and "batteries included". You can see that there is a trivial GUI, namespace browser, and Python shell.


http://www.ogre3d.org/phpBB2addons/viewtopic.php?t=5822

Moreover the screenshot depicts what I mean by decoupled WX and Ogre. Literally the WX app runs the Python-Ogre app separately.

I got the code this time. Don't know why I had aproblem with previous attempts. MyFreeFileHosting suggested the link might expire. I've had success with <censored> I haven't tried either of these: but would Google Code or SourceForge be an option?

By the way, part of my tools solution is now shifting from in-Ogre to Blender-Ogre conversion. Blender already has all the modeling and level editing features I need. dotscene is sufficient (once I refactor the dotscene.py parser). http://www.ogre3d.org/phpBB2addons/viewtopic.php?t=4209

Some of the XML code I saw seems to duplicate dotscene. For example, camera and nodeCamera are similar to the dotscene that Blender exporter generates. Here's an example from Blender's exporter:

<node name="Camera">
<position x="7.481132" y="5.343665" z="6.507640"/>
<quaternion w="0.893293" x="-0.212056" y="0.386910" z="0.085793"/>
<scale x="1.000000" y="1.000000" z="1.000000"/>
<camera fov="37.849289" name="Camera" projectionType="perspective">
<clipping farPlaneDist="100.000000" nearPlaneDist="0.100000"/>
</camera>
</node>


Have you considered Blender-dotscene as a partial solution to our problem? That is model and setup scene elements in Blender which can be loaded (and reloaded) in Python-Ogre during run-time. Here's a screenshot of a test case in Blender, which exports dotscene. The camera dotscene XML above corresponds to this screenshot.



I notice the code you uploaded is a true framework, and accords with the style of other Ogre code in all the demos. I had started following this framework paradigm, but as a game designer who has to make radical changes in the span of a week, I'm finding it more flexible (at least for my programming style) to apply a toolkit paradigm. Ogre has frameworks all over the place (SampleFramework, SampleApp, FrameListener, etc.), and when I want to refactor the problem with a creative solution, then the framework ... doesn't work. Have you considered a toolkit paradigm? Your class files are already light, but some could be a little lighter by eschewing middleman code (like the set functions in FishAnimation) and converting the Ogre App framework methods into functions, which could then be recomposed for an original app. I began doing that yesterday to generate a minimal Ogre app, and the results suit my needs (for refactoring, unit-testing, and agile prototyping). I don't know if they suit yours, but I could see what you have becoming a quite flexible (wx)Ogre toolkit.

-- Ethan
http://runesinger.com

skorpio

04-06-2008 08:17:43

Hello Ethan,

I also use Blender for character generation and animation. But that is the extend of it. I have never tried to compose a scene inside Blender. There are too many things that are not compatible with blender such as the axis orientation, and scaling.

I just create meshes in blender, export them out as XML and then use meshmagick to fix the scale and rotation. So what goes into ogre is clean and it is decoupled from yet another application.

I use the concept of XML files as a barrier between applications, that way the code is simpler to manage and one is less likely to mix them up.

As far the dotscene is concerned. I looked it up. The information inside the dotscene file lacks a lot of the things ogre has. It is very generic and focused on materials and shades. That was my very brief assessment. The XML on the wxOgre is tailor for ogre. However since both are XML it is possible to write a coverter between the two. So that is why, I was not worry about doing a custom XML for the wxOgre.

I considered Blender-dotscene solution but since everything will need to exported to ogre I did not see much point in trying to do this. I can accomplish the same result by having the wxOgre GUI be the environment to load meshes, particles, compose scenes, do animation, etc. Then store all of this information in a XML file. The XML can be open/edited/ and saved by the wxOgre GUI. Perhaps I wasn't clear about this but the problem is that wxOgre GUI is not doing any of this yet. It has a fix scene, it does some loading of meshes, but basically, it is not doing what it is supposed to do:

Create scenes using ogre resources:


So before I can create scenes from wxOgre GUI I need to decouple the wx from the OGRe. You already have done this. So I will look at your work. I think I will be able to use it. Next I will write a XMLgenerator that will take the information within wxOgre GUI and save it as a XML file.
This XML file along with the necessary classes will be used to generate an application that doesn't require wx.

The wxOgre Framework it is a lot simpler than the other frameworks because it hides little and implements the very basic behavior. The structure is simple thus very flexible. it provides the basic hooks for keyboard, mouse, and resource loading. I can't imagine you need to refactor this every time. This remains very constant across most applications what changes are the scenes and how they are built. By having the XML in the middle, the idea goes, it would be easier to derive other scenes from existing ones.

I use the concept of classes to increase modularity and avoid writing the same code over and over. In the demo_wxogre. The fish and the lookat animation use the same class (fishAnimation) but you could use it for moving the ogrehead if you want it. I guess classes would become more generic at doing reusable tasks.

The classes are an integral part of the the final application. In fact they are used by it. The application will fail to run if you do not have them. This is assuming that you are using them.


skorpio

05-06-2008 04:47:17

Hello Ethan

Have you posted the latest version of your OgreEditor?
The link you provided has the older, embedded version

Thanks,

skorpio

07-06-2008 16:36:00

Hello,

I started to decouple the wx code from the python-ogre. Then I noticed something very peculiar which I hadn't noticed before. When the python-ogre windows is active, the frames are rendered. but if the window loses focus then python-ogre stops rendering.

I checked this effect with the /demos/ogre demos and they do the same thing, I just had to switch apps with the CTRL-TAB

This effect is very undesirable when separating the wx from the ogre.
I'll need to re-think my approach. In my original approach of wxOgre. The OGRE was part of the wx and worked pretty good. But the scene loader was fix. Maybe I can decouple the scene-loader and keep the same GUI

Pennies for thought

Thanks

ethankennerly

07-06-2008 20:21:18

It took me several hours to extract it into what I hope is a usable version without the rest of the prototypes I'm construction. Here it is:

http://runesinger.com/source/ogre_toolkit.zip

DEPENDENCIES

Python-Ogre 1.1
(which depends on DirectX, MS VisualStudio Redistributable)
PythonCard (2007?)
(which depends on wxPython, which depends on ...?)
Python 2.5
Blender Ogre scene exporter
Blender mesh exporter

You should be able to use the editor without Blender scene exporter.
The ogre_toolkit_readme.txt says:

Ogre Toolkit
Ethan Kennerly
06/07/2008 Sat

Agile Python-Ogre tools to aid in development of Runesinger (http://runesinger.com).

This is a proof of concept with one simple test case that goes through a pipeline:
Blender camera, light, and model.
XML scene and Ogre mesh.
Ogre application that imports XML scene.
PythonCard editor that imports Ogre application.
Each of the functions is built as a lightweight toolkit, so that you don't need to use all the steps in the pipeline. You can, for example, replace Blender or XML scene with another toolset.

As a proof of concept, I haven't tested general cases or configurations on other computers.

I'm new to Ogre, Blender, and am more comfortable designing than programming, so if you have comments for improvement or know of other work along these lines, I'd like to discuss or collaborate.

-- Ethan

skorpio

09-06-2008 16:20:18

Hello Ethan


I was able to download the source code. I wasn't able to render a scene though. I placed all the files in the python-ogre\demos\ folder.

Perhaps, I need those files you mentioned after all.

Thanks for posting your code, I'll looking at it more closely this week.
I'll be happy to cooperate, it has always been the idea to build from the ground up through cooperation.

Thanks,

ethankennerly

09-06-2008 19:40:42

Come to think of it... I use an atypical directory structure for the default execution (if __main__). Sorry you ran into my misconfiguration.

I've now configuration tested it by copying the directory to the default demos directory, with its own '.cfg' files. In the course of doing so, I added a new feature to the editor: It can open the demo file: ../ogre/Demo_grass.py! I suspect it can open other demos (that work), too, I haven't tested the others. Here's Demo_grass.py in Ogre Toolkit:



dotscene.py can be run without PythonCard or wxPython (of course it needs Python-Ogre). It is just a test case for dotscene.

ogre_editor.py definitely requires PythonCard, which definitely requires wxPython. The paths between source and models and scene are relative, so directory structure in zip must be copied as is to Ogre 'demos'. Therefore, I changed the 'readme.txt', so please read the new: Dependencies, Installation, and Usage in the updated package:
http://runesinger.com/source/ogre_toolkit.zip

It's really a hack; I welcome your criticism and comments.

skorpio

10-06-2008 08:21:17

Hello Ethan,

It works now, thanks for posting the current code.
I was able to play a little bit with it. It is a pretty clever solution.
I'm studying the code right now. I really like the idea that it can import *.py files.

Very nice work!

skorpio

12-06-2008 07:48:00

Hello,

I was trying to speed up the rendering of the Ogre window within the wx environment.

I was partially successful. I started by removing the creation of the Timer to update the rendering. But this messed up the animation speed. So I had to bring it back. to update the animation...

Also I replaced wxMainApp.MainLoop() with the following code:


#wxMainApp.MainLoop()

## Replacing the MainLoop()
keepGoing = True
evtloop = wx.EventLoop()
old = wx.EventLoop.GetActive()
wx.EventLoop.SetActive(evtloop)

while keepGoing:

wxMainFrame.ogreWin.UpdateRender()

# This inner loop will process any GUI events
# until there are no more waiting.
while evtloop.Pending():
evtloop.Dispatch()

wx.EventLoop.GetActive()

#keepGoing = False
wx.EventLoop.SetActive(old)



Basically this code overwrites the Mainloop() with your own. Here I call the ogreWin.UpdateRender() .

The update is very high. ~500fps.

The only problem right now, is that the app will not exit, you must do a CTRL-C to close the application.

If anybody knows how to intercept the EVT_CLOSE, to exit gracefully that would be nice and appreciated. If the keepGoing flag is then then set to zero then the outer loop will terminate.

I searched for an answer, but I came empty handed.

Here is the latest code, it is version 5A. Since I have not done much. I'm still in the process of trying to figure out what is the best way to decouple wx from python-ogre.

Thanks,

skorpio

16-06-2008 08:25:58

Hello,

I have made some progress decoupling the wx from python-ogre.
Right now, wxOgre.py has mainly wx code. It just creates the ogrewindow and that is.

The ogreWinWx.py contains mostly Ogre stuff. The code still too messy for release.

I started the ogreXmlReader.py, this is the code that reads XML and builds a scene within wxogre environment and thanks to:

Python being the greatest language ever...

you can do this...


codeString = "self.%s.setPosition(ogre.Vector3(%s))" % (nodename,pos)
codeObject = compile(codeString,'<codeString>','exec')
exec codeObject


It turns a text-string into compilable code. So I didn't have to write a lot of code to turn ogreGenerator.py into ogreXmlReader.py

ogreXmlReader.py can process several sections of the XML:
environment
import
entities
nodes
planes
The events still need more development but this is tied to the adding/modifying ogreWinWx.py

The Classes that were written for the wxOgre Framework work with the "new" wxOgre.py which means common code is back.

Thanks,

skorpio

20-06-2008 07:04:17

Hello,

Ok, here is a temp version, I cleaned it up some more. Version 6. has some new features and lost some. The lost is only momentary.
The control-panels were removed because they are not quite compatible with the classes. Some of the toolbar buttons do not work as shown in red. By default, wxOgre loads the axis mesh reference at 0,0,0 and nothing else.


New Features

a) The camera movement was made more friendly. It uses only one button:
the middle-mouse button and wheel
Depending on the camera chosen the mouse-wheel will zoom-in and out.
If you click middle-mouse and drag, then the camera moves UP and DOWN.
if you double-click middle-mouse and drag, then the camera yaws.

This change was necessary to free up the keys that are normally used for moving object within ogre (up,down, left, right arrows)

b) The GUI now loads XML files. As stated before, events, cameras are not supported yet. Entities, nodes, environments, planes work. From the menu, go to file and select Open XML file.




c) wxOgre.py contains mainly wx code. ogreWinWx.py contains python initialization.


To Do
Fix controls based code to work with classes to increase modularity.
Add the ability to write XML based on what the user has designed.

Some design changes were necessary because of the requirements from the XML. I decided to remove multiple control-panels as found in earlier versions in favor of one big panel to maximize the controls that can be put there. Also I would like to have more toolbars to speed up the scene creation process.


Thanks,

View after loading demo_cameratracking.xml

skorpio

21-06-2008 11:42:33

Hello,

The control panel is back!!
Actually, it wasn't that hard to port over, I spent a lot of time trying to figure how to make the camera and entity movement more friendly when switching between the two.

Load a mesh and...

Pressing MoveXZ button will setup everything to move in that plane.
if the middle-mouse is clicked once then it moves along X axis
if the middle-mouse is double-clicked once then it moves along Y axis

Pressing MoveY button will setup everything to move in that plane.
if the middle-mouse is clicked once then it moves along Y axis

Thanks,

skorpio

22-06-2008 01:18:44

Hello,

I have been working getting the Full Screen to work. For some reason it doesn't behave as before. The control-panel is hidden but the screen doesn't go full screen in only extends to where the panel was. For full screen, you need to maximize the window. This is going to be pending bug for a while.

Moving on, the code that I released yesterday had a few bugs. It also loaded the demo_cameratracking.xml right of the bat. So I fixed that 'bug'

Also I added a scaling button. it works with the scroll wheel.
I will be adding yaw,pitch and roll control next.

As far as the camera movement goes, let me know what you think. How can it be improved? that sort of stuff.

I will try to tackle the generation of xml files after the user has build its scene. This may be challenging because it requires reading the actual position of nodes and entity, orientation, etc.

Help
Does anybody knows how to handle status bar? My search revealed very little. I would like to use the status bar for displaying current camera position and orientation and other useful information.


Thanks,

skorpio

23-06-2008 02:38:09

Hello,

This version has some bugs fixes. I removed the hardcoded resource loading and opted for using the resources.cfg. The reason is that one the XML demo files uses the dragon.mesh and The old code was not loading it. So now that works.

Rev9 also includes pitching and rolling of camera. If the user keeps the middle mouse button down and the press the mouse-right button then the amera yaws. The left-mouse button rolls. I'm not sure this is the best way but for now it will suffice. I will document all the movements associated with the middle mouse button.

I also added a status bar to show camera position and orientation. This is kind of nice to know where you are at.

I created a new structure which I do not know that if it going to work yet. It is use to track XML entities and nodes that were added to the scene. This is preliminary work, so next I need to know if I can this method to extract all the information to later use it to generate and XML files.

Now, the real challenge starts!!

bharling

23-06-2008 09:58:13

Hey this is starting to look rather cool.

I've started work on a material editor panel last night, I think its going to rock ( hopefully ).

Here's an overview:

- Based on wx.CustomTreeControl
- Widgets for Material, Technique, Pass, TextureUnit, Vertex / Fragment progs
- Colour chooser widgets
- Auto-creation of parameter definitions for vert / frag programs
- Bind all widgets for instant material updates
- Parsing ogre material scripts, and saving via ogre.MaterialSerialiser.
- Settings for integrated shadows.
- Settings for template materials.
- Texture previews in the tree control
- Modular format.
- Multiple passes / techniques / texunits per material.
- Multiple materials per workspace
- Drag and drop functionality
- Material Previews, via a rendertarget ( could be tricky that.... )

Suffice to say, not much of this is done yet, but the basic widgets have been coded up. The custom tree control is great because you can have basically whatever you want for tree widgets.

Once I have something working I'll try and plug into wxOgre.

good work skorp :)

skorpio

25-06-2008 16:18:58

Hello,

Yes, it is becoming more useful tool every time. I started looking at how to retrieve the entity information from the scenemanager.
It seems I can get the position, and other things but I did not see a way to get a list of all the entities attached to the scene.

Does anybody know if there is an iterator for entity list?

or

I believe there is an iterator for nodes, so Is there a way to get the entity that is attached a node?


thanks,

dermont

25-06-2008 19:55:11

Does this link, using getAttachedObjectIterator, not do what you want: http://www.ogre3d.org/wiki/index.php/DumpingNodeTree
e.g.

def DumpNodes(n):
node_it = n.getChildIterator()
object_it = n.castAsSceneNode().getAttachedObjectIterator()
print 'Scene Node %s' %( n.getName() )
while object_it.hasMoreElements():
m = object_it.getNext()
print " Attached Object %s %s" %( m.getName(), m.getMovableType())

while node_it.hasMoreElements():
DumpNodes(node_it.getNext())

...

DumpNodes(sceneManager.getRootSceneNode())

skorpio

26-06-2008 08:31:04

Hello,

Yes, the code you provided works very good. Thanks.

So far Thanks to:

dermont
kojack
falagard
ethankennerly
bharling
dedesite
chpod
spom
et al.

For their valuable input and to many others that have posted code/snips anonymously which this project is based on.

Thanks,

skorpio

28-06-2008 10:44:54

Hello,

Here is a newer version. It is partially working, it is getting some of the data that I wanted. I started trying to parse through the entities in a scene. I can't get the material or the mesh-file-name yet, but it is a good start.

To test it, load an XML file, like cameratracking then click the pannel view button from the toolbar. It will create XML testing_rev1.xml.

As I mentioned before it is work in progress but I want it to posted in the hope somebody may know how to get this info.

thanks,

dermont

28-06-2008 15:43:47

For mesh/material name:

m.getMesh().getName()
for i in range(m.getNumSubEntities()):
matName = m.getSubEntity(i).getMaterialName()

Why are you are using such a small timer interval of 1ms? You should take a look at Sinbad's editor for inspiration:
http://ogreaddons.svn.sourceforge.net/v ... wxOgreMVC/

I've been playing around with trying to implement it with pyQt:
http://img174.imageshack.us/img174/5112/qtpyogrepy3.jpg

I also have an unfinished ET Terrain editor in wxPython/Linux which uses AuiManager which you're more than welcome to:
http://img383.imageshack.us/img383/5053 ... ainmo3.jpg

skorpio

30-06-2008 04:47:26

Hello,

Here it is the newest version of wxOgreFramework. The basics are finally in place so this is a great step forward. There is more to do to integrate other parts into the framework.

So here is a summary of the current architecture
http://myfreefilehosting.com/f/5ba5326abb_0.1MB


wxOgre.py its main task is to build scenes easier by having a GUI front end to the python-ogre.
It creates an ogre window to render scenes in real time.
It uses wxPanels to facilitate access to python-ogre resources.
It creates the self.ogreWin pointer to have access to all ogre structures created by ogreWinWx.py

ogreWinWx.py implements the glue-code between wxOgre and python-ogre. It creates the default cameras, viewports, keys and mouse bindings. Here minimum ogre resources are loaded such as axes.mesh.
The resources here can be access by self.ogreWin or self.ogreWin.Scene.

wxPanel*.py are wxpython frames that access python-ogre resources. This add modularity by creating panels for different purposes.
In the future it will provide access to the other ogre resources such as animations, skeleton manipulation, materials, etc.


wxClass*.py are classes written in python to provide common code across many projects. This code is shared by the wxOgre and the final application. Two of the most important classes are classOgreCore.py and classInpuMgr.py, they are the base for the stand alone python application.
In the future, it will provide supports for animations, keyframes, skydomes, etc.


scene*.xml are XML files that contain information about the scene, cameras, entities, nodes, etc. It provides a way to contain information about a scene without any code. They contains event and key binding information too.


ogreXMLReader.py is a program that reads a XML file and converts it into actual python-code. The code is rendered by wxOgre.py

ogreXMLWriter.py is a program that create a XML file with the information inputed by wxOgre.py and wxPanel*.py

ogreGenerator.py is a program that reads a XML and creates native python-ogre code. Along with classOgreCore.py and classInputMgr.py a stand alone python application can be created.

classOgreCore.py is a class written in python that implements the simplest way to create a python application.

classInputMgr.py is a class written to provide keyboard and mouse interface to the python application. Mouse implementation not fully supported yet.


Update

Here is the update, I added a regression.bat file to test all the current XML are valid some of the previous releases had problems working.
Also the wxOgre can store scenes in XML format.
There is a problem with handling planes since they are created from meshes. I do not know how to retrieve all the plane data as described in the XML files. However, nodes and entities seems to work fine.

I loaded several meshes, moved them and then I save them. To save your XML file, go to menu->File. Afterwards I was able to load it back.

There are a few things to address, but the main architecture seems feasible. The next step is to implement some of the things that need a little more work.

To do list
handle submeshes, materials
planes
event-handling
key-mapping
More wxPanels to implement skyplane, skybox, lights, fogs, materials.
wxOgre panel manager re-implementation:

Thanks,

skorpio

05-07-2008 08:57:13

Hello,

Here is rev12. From my previous to do list, I reimplemented the panel manager. Well, there is no manager anymore. It is a lot simpler now, it is done with toolbar buttons.

I added some comments to wxOgre.py ( a few steps) on how to add panels.

The basics for creating a panels are:
1) create a panel
2) add code to wxOgre.py
3) create a new icon for new panel
4) add toolbar code for the new panel (see example)

The whole wxPanel handling is now working so it is easier to create new ones.

I created a wxPanelLight which handles very basic light creation. Also, there is code for changing the ambient color

As usual, there were a few more bugs fixed and 3 new toolbar buttons.

To do List
handle submeshes, materials
planes
event-handling
key-mapping
More wxPanels to implement skyplane, skybox, fogs, materials.
Write lights to XML

Thanks,

skorpio

14-07-2008 03:55:37

Hello,

Here is the latest code. In rev 13, I tried to implement a tree view control to keep track (hopefully) of everything that gets added to the scene.

The code right now should show whenever a mesh or a light is created. the issue that I have is how to bind tree events. So that when the user clicks on something then changes.

I had to pass another pointer to the panels. This the pointer to the wxOgre windows.

I added a set diffuse color to the light panel. I will be adding more stuff to the light panel shortly.

Also I will add the stuff from the XML to the tree, again shortly.

I think this will be a better solution in regards to GUI. Please let me know about your thoughts or if you know how to handle tree events. This would be greatly appreciated.


Thanks,

skorpio

16-07-2008 05:26:13

Hello,

Here is the latest version. The current version updates the tree when an XML file is loaded.

There is some tiny bug that when the user clicks on the "Scene" it tries to locate its parent but it doesn't have one, it is the root.

Thanks,

bharling

16-07-2008 10:44:51

Yo,

its cool that your keeping this going, well done.

Am still working on the material editor panel when I get any spare time, at the moment I'm just trying to work out how to a material preview. Will post something when I actually have anything that works.

skorpio

17-07-2008 06:59:50

Yeah,

Things are coming along, I add/fix a little bit every day and then I post. Sometimes, it takes me a little longer to get a new update. Adding a tree control seems to be the right way to go but it requires a few changes through the code. I would like to finish the read/write XML but I got distracted with the tree view. There is one more change that is necessary, the panels also have to process the XML data. In the camera_tracking.XML, the ogre head is loaded. But there is no way to move it. I will work on that first.

Thanks,

skorpio

20-07-2008 09:29:39

Hello,

Here I added the code so when a user loads a XML file, the entities will show up on the entity panel. So now it is possible to move those entities as well.

I loaded camera tracking and I was able to scale the ogre head, move it, and also I moved the plane, it was weird. I need to correct the tree information is passed. But this should be minimal.

Help

I would like to get a list of all the material available to then assigned to a given entity. Like athena, the original material is missing, so I would like to assign one.
Does anybody has code to display the material/textures?

Thanks,

skorpio

21-07-2008 07:15:56

Hello,

Today, I have added the ability to store the generated XML under its own name. I added an entry to the File menu: Save As. Generate XML still works.

I also I added some code to ogreXMLWriter.py. I added some fixed code that allows the resulting XML to be converted without any problems.
These fixed functions implement planes, cameras, viewports and enviroment data. I will be working to retrieve some of data from OGRE and I will probably start creating new Panels to handle them.
As stated before. Planes are not easy to handle because they are dynamic
meshes.

This is the first version that reads and saves XML files, it is partially doing it with the help of those fixed functions but at least it can create applications.

thanks,

skorpio

26-07-2008 06:45:21

Hello,

I made several changes to the code. There was a minor change in the XML structure, in the environment section. I removed the light from it and I created a Lights section. This was done to support the wxPanelLight where a user can create multiple light source. The tree control switches between the two available panels.

An user can see what the new structure look like by looking at the demo_cameratracking.xml environment and light section.

The wxPanelLight supports changing the position with a new button. The Statusbar shows the diffuse color. This panel had a lot of bugs that were fix in this version.

I created a wxOgreConstants.py like a header file. I'm thinking that I may move shake the tree around to add new sections.

The wxOgre now supports calls the ogreGenerator.py to create a stand alone version. The ambient color is also now stored in the XML file.

Overall this is much tighter version. I will be working on trying to implement the ogreXML writer. There are sections that has fix data.


Thanks,

skorpio

29-07-2008 07:24:25

Hello,

I have been trying to replace the fix camera in the XMLwriter with code that actually handles cameras. It is 80% done. I had to create a new panel for cameras, a new tree entry, code in XMLWriter.

The issue that I have is that this cameras added to the scene not currently attached. So they will only appear when a XML file is generated. The reason is that wxOgre has its own cameras so adding more cameras may mess up things. I don't know.

Also, the camera needs to be specified in the viewport. However, I don't think I can add this camera to this viewport without messing up wxOgre. So I just need to store the user's selection and then use it when the XML file is being generated.


help1
The other issue that I got with the camera panel is that the "lookAt" wokrs but ogre doesn't seem to have a getLookAt. So I'm trying getDerivedOrientation instead. I don't think it is working. This needs to be fix. I'm not sure how to get this information.

help2
Is there a way to create object within ogre or python-ogre that are kept by ogre. For the viewport I need to store what the user selected and then get it to generate XML.

I'll be adding support of near/far clip distance to the camera Panel and viewport selection.


Thanks.


PS. The viewport is hardcoded to cameraFront. So if you don't have a camera named like that, the stand alone will not work. You'll need to edit the *.py manually.
All the XML have the cameraFront. However if you start from scratch and create a camera, it will be create with the name camera0. oops!
there is no way to fix this yet.

chpod

29-07-2008 11:29:24

Hi skorpio,

I am very pleased to see that you keep this project up. It really looks very promising. I really like the dynamic update of panels.

I just have one nasty comment, regarding your code indentation. You mix tabs and white spaces, which makes it quite unreadable/uneditable with simple text editors. There is really a bunch of examples, but let's take one.

Here all self.ogreWin lines should be equally tabbed:

def __toolbar3(self,event):
self.ogreWin.Scene.Camera.parentSceneNode.detachObject(self.ogreWin.Scene.Camera)
self.ogreWin.Scene.Camera.setPosition(ogre.Vector3(0, 100, 400))
self.ogreWin.Scene.Camera.lookAt(ogre.Vector3(0, 0, 1))
self.ogreWin.sceneManager.getSceneNode("CamFront").attachObject(self.ogreWin.Scene.Camera)
self.ogreWin.Scene.CamNodeFront.resetOrientation()
self.ogreWin.Scene.CamNodeFront.setPosition (ogre.Vector3(0, 100, 400))
self.ogreWin.Scene.CamNode = self.ogreWin.Scene.CamNodeFront
self.ogreWin.wheel = ogre.Vector3(0,0,50)


Could you convert all tabs to spaces?

chpod

chpod

29-07-2008 13:04:47

The current full screen mode is actually a full window mode.

Here are some changes I made to have a real full screen mode:

In wxOgre.py update __do_layout:
def __do_layout(self,showall,hideall,index):
"index=n to show panel n, index=-1 to go full screen"

sizer_1 = wx.BoxSizer(wx.HORIZONTAL)
##sizer_1 = wx.BoxSizer(wx.VERTICAL)

count = len(self.wxPanels)

for i in range (2, count):
self.wxPanels[i].Hide()

sizer_1.Add(self.wxPanels[0],2,wx.EXPAND,0)
if index != -1:
sizer_1.Add(self.wxPanels[1],0,wx.EXPAND,0)
sizer_1.Add(self.wxPanels[index],2, wx.EXPAND,0)
self.wxPanels[index].Show()

self.SetAutoLayout(True)
self.SetSizer(sizer_1)
sizer_1.Fit(self)
sizer_1.SetSizeHints(self)
self.Layout()

if (index == -1):
self.ShowFullScreen(True)
self.FullScreen = True
else:
self.ShowFullScreen(False)
self.FullScreen = False


Also in wxOgre.py, update the toolbar callback:
def __toolbar1(self,event):
if self.FullScreen == True:
# Come back to windowed mode
self.__do_layout(False,False,self.panelindex)
else:
# Go full screen
self.__do_layout(True,True,-1)



And, in order to be able to come back to windowed mode:

1. In ogreWinWx.py, allow key capture by enabling wx.EVT_KEY_DOWN:
def _MouseAndKeysBindings(self):
"Some Additional mouse and keys bindings"
d=10.0 #displacement for key strokes
self.ControlKeyDict={wx.WXK_LEFT:ogre.Vector3(-d,0.0,0.0),
wx.WXK_RIGHT:ogre.Vector3(d,0.0,0.0),
wx.WXK_UP:ogre.Vector3(0.0,0.0,-d),
wx.WXK_DOWN:ogre.Vector3(0.0,0.0,d),
wx.WXK_PAGEUP:ogre.Vector3(0.0,d,0.0),
wx.WXK_PAGEDOWN:ogre.Vector3(0.0,-d,0.0)
}
self.Bind(wx.EVT_KEY_DOWN,self._DefaultKeyDownManager)
self.Bind(wx.EVT_MOUSE_EVENTS,self._DefaultMouseEventManager)
self.Bind(wx.EVT_MOUSEWHEEL, self._MouseWheel)


2. In ogreWinWx.py, update _DefaultKeyDownManager
def _DefaultKeyDownManager(self,event):
print "Key Code: ",event.m_keyCode
if (event.m_keyCode == wx.WXK_ESCAPE):
print "Cancel Full Screen"
self.parent.do_layout(False,False,self.parent.panelindex)
event.Skip()




3. In wxOgre.py, add a method so that __do_layout can be reached from outside:
def do_layout(self,showall,hideall,index):
self.__do_layout(showall,hideall,index)


By the way, I am really unsure of what showall and hideall are doing in __do_layout. Are they really still used?

skorpio

30-07-2008 06:10:36

Hello

I use python IDE from http://wingware.com/ and the indentation problems don't appear. I guess they are managed there. This IDE has an indentation manager that can change to Tab or Spaces or Mix. I did change to spaces and I verified that it works with word.exe. The next version I release will have only spaces. (I hope).

skorpio

30-07-2008 07:43:12

Hello,

Here is the latest version. I incorporated some of the suggestion posted here.

The files contain white spaces. The full screen really DOES full screen thanks to CHPOD!. You'll need to press ESC to exit full screen mode.
Also there was some code cleanup done (__do_layout)

The camera panel now has near/far and viewport assignment. You must click a camera and then assign it to the viewport.

There are few issues left with handling camera such as lookAt.
Also the viewport needs processing. I'll be working on that next. That is, it needs to be read from the XML and displayed on the camera panel.

Any suggestions and comments are appreciated.
Thanks,

PS. I really like the Full Screen

chpod

30-07-2008 10:06:57

The files contain white spaces.I just checked, it far easier to edit now! Thx :)

Also there was some code cleanup done (__do_layoutGreat!

Today I tried to add "short help" to the toolbar. From the wx point of view, it works. But: as to tool tips display over the ogreWin widget, they are deleted at every new frame, which in my cases occurs 60 times per second... Personally I would find those tool tips useful, and they give a more profesionnal look May be it would be worth changing the layout so that we have (20 pix height) panel just under the toobar. And under that panel we could keep the ogreWin. But I do not feel like messing up skorpio's layout, at least not today ;)

Anyway, if skorpio is interested, here is how to add the tooltips:
self.toolbar.AddLabelTool(id=TOOLBAR1, label='', bitmap=wx.Bitmap('toolbar/fullscreen.png'),shortHelp='Full_screen')


Regarding syntax, I usually try to pass the parameters to functions with name=value. It drastically helps when you want to update your code.

Cheers,
chpod

skorpio

31-07-2008 07:57:28

Hello,

Thanks for the input about the tooltips for the toolbar. I think we should have them. Another solution is to create another tool bar that doesn't have any buttons but serves as a buffer zone between the ogre rendering windows and the toolbar. This will probably avoid the flickering.

Today I spent most of my time fixing the last things related to the camera. The "lookAt" problem was solved by letting the wxPanelCamera keep a list everytime a camera is created or added externally (from XML).
So this data is kept locally and then it is used to write to the XML. I think this approach will work for planes where data can't be recovered easily from the ogre scene manager.

In summary I think the camera is done 100% and I'm moving on to viewports.

The viewport is partially implemented in the XMLread. I'm getting my feet wet with Dictionaries and List. I will need to create another panel to handle viewports.

At some point I will review the wxPanelEntity to make it behave like the other panels. That is, if you click an entity it will update its position, rotation, etc.

Help
It would be nice when a tree children is clicked the proper panel shows up and the correct list entry is highlighted. The first part is done, the second could be achieve by sending and event to the list??? I don't know


Thanks,

skorpio

01-08-2008 08:54:55

Hello,

Most of the viewport panel is working. I just into a few problems that need fixing.
1) a camera can't be assigned from the wxPanelViewport
2) Apparently, having multiple viewport requiere a Z-order..
3) Cameras can't be assign to different viewports.

I'll need to investigate this Z-order stuff and fix some of these issues.
The XMLread, XMLwrite and ogreGenerator were debugged successfully.
A stand-alone may crash if multiple viwports are added but you can comment them out and just leave only one viewport.

Thanks.

skorpio

03-08-2008 03:19:57

Hello,

Today I fixed some of the problems with Cameras/Viewports. Both are working fine. We can create multiple viewports and assign cameras to it.

Oops, I just remember about the Z-order. The stand alone will fail if you have multiple viewports. I will fix shortly. I hope. Just comment out the extra viewport for now.

Also I started to review other items not handled yet. The camera tracking is one of them. The XML node handles this. I think It needs to be in the camera section. I will move it. But also, cameras will need to be able to access this from the wxPanelCamera. So more changes to the panel.

So there are two little issues before moving on to planes.
Also I just added some code to the wxPanelEntity to do position and scale the pitch, roll and yaw are not implemented. but it is a start.

Thanks,

skorpio

03-08-2008 21:32:48

Hello,

I had a chance to look at the viewport Zorder. It turns out that you can create some cool stuff with it. Like overlapping windows (viewports)
Here is something to share. I will need to add more description to the XML viewport. Also I will need to add more boxes to the panel to handle dimmension of the viewport as well as Z-order.


Thanks,

demo_cameratracking3.zip
http://www.mediafire.com/?dxezhwwg89a

skorpio

07-08-2008 08:36:02

Hello

Here is an update for the viewport. The data from the XML makes it all the way to the wxPanelViewport. I was trying to do something different for handling the viewport dimension. You can move the mouse in the dimension box and it gives a value from 0 to 1.0 as described in the viewport class definition.

I wanted to draw a rectangle when a viewport list is clicked and then resize it by resizing the rectangle. However, I do not have much experience with drawing and stuff. So if somebody could help, it would be appreciated

As a back up I will implement the good old spin control but the rectangle seem more native to handle this kind of data.

The dimension is a four field structure. So I used the ogre.quaternion.
I know this is not good but it was easy. To clarify the dimension is not a quaternion but it has four fields that I'm using. Please see the code.
This may need a fix in the future.

Thanks,

http://www.mediafire.com/?sgwnngrqrvc

skorpio

10-08-2008 09:15:46

Hello,

I finished making changes to the viewport panel.
I decided to use wx.StaticBox instead of trying to figure out
how to get rectangles drawn on the screen.
Clicking in the area draws a rectangle. Make sure
you press both mouse buttons and the Assign button to store the
changes. Press the left-mouse button first to set the Left, Top coordinate
and then the press the right-mouse button to establish the width and height.

Z order is also implemented. I think I will try to fix the camera tracking
issue I described a few post ago.

Thanks,

chpod

10-08-2008 11:07:51

Hi Skorpio,

Today I tried played with cameras and viewports... unluckily. I could not figure out how to add the viewport inside the ogre rendering panel. Could you help, please?

By the way, I find it not so user friendly to be able to choose camera0 from the tree and having camera1 selected in the list. Don't you think this list should be removed? The same applies to viewports.

Camera0 in the tree, camera1 in the list:


Can't wait for next version ;)
chpod

skorpio

10-08-2008 16:30:07

Hello Chpod,

I'll be happy to help, but I think I need to go back and clarify a few things.

Camera and viewports are not rendered like entities and lights. The reason is that at the time ( beginning of this project ) I could not think of a way to handle user's cameras vs wxOgre's cameras. Since then, I implemented a treeview control and it may be possible to select user's cameras from it.
The wxpanelCamera would need another button to render it or add it to the ogre scene manager.

As far as viewports go, the same is true, by default, wxOgre creates its own viewport, I think I can add a z-order and dimensions to it so that it would be easier to render user's viewports. The problems may arise when you create a viewport that has the same parameters as wxOgre's.

It is possible to use all 4 panels and create an XML that can be later use (along with ogregenerator.py) to generate a stand alone version where you can see the cameras and viewports.

Viewports required a camara to be attached, this is the reason why there is camera list on the viewport panel. You must assign a camera to each viewport.

I was thinking that wxOgre may use a default XML file that it load, instead of being hard coded, that way wxOgre cameras, viewports and entities would be rendered the same way. But once user's cameras and enities are added to the scene manager, you have the problem of having to distinguish between wxOgre's and user's resources.

Another thing is that my original idea was to let ogre render everything but then I realize while you can do this, some things you can't ask ogre to read back. This is the case with planes. That is you can add to the scene manager but you get every parameter you put in. So the original idea was modified to be able to manipulate things (cameras and viewports) while not been rendered, they would still create an XML file that you can use as a stand alone version.

I'm not sure how hard or easy it is going to be have cameras and viewports rendered. I will look into that.

As far as the tree goes, yes, it is confusing. I posted a while ago the need to improve this part. Now If we can fix this, then rendering users' cameras may be possible.

Also, if we stick to the definition of treeview control where it shows what it rendered, then cameras and viewport shouldn't be there. However, right now, it shows what goes in there from the XML file. Well that is not quite true either. The plane is rendered but it doesn't have a tree entry.

I'm hoping to sort out all these inconsistencies shortly, or eventually.

I hope I answered your question. If not, I will try again.

Thanks,

skorpio

10-08-2008 18:39:18

Hello,

The information on my last post was incorrect when talking about cameras:

They are added to the scene some of the parameters such as "lookat" can't be retrieve from ogre. There is no getLookAt function.

In any case I patched, my current version and now I can view the cameras that the user creates or loaded from XML. It is pretty cool. I will post later but in the mean time here is the code for the wxPanelCamera


import wx
import ogre.renderer.OGRE as ogre
import os
#import wxOgreConstants

class wxPanelCamera(wx.Panel):

def __init__(self, parent, id, ogrewin, wxwin ):
wx.Panel.__init__(self, parent, id, size=(640, 480))
self.id = id
self.parent = parent
self.ogreWin = ogrewin
self.wxwin = wxwin

self.cameraViewAttach={}
self.viewportList=[]
self.cameraList=[]
self._wxCreateButtons()
self._wxSpinControl()
self.listId = 0
self.selectFirstTime = 0
self.listindex = -1
self.ViewPortAttachCam = "NONE"
self.ViewPortName = "NONE"
self._wxStaticLabels()
self.lookAt={}

def _wxStaticLabels(self):
str1 = self.ViewPortAttachCam + " attached to viewport: " + self.ViewPortName + " "
self.label1 = wx.StaticText(self, -1, str1 , wx.Point(150, 230))

def _wxSpinControl(self):
label = wx.StaticText(self, -1, 'X pos', (5, 260))
label.SetBackgroundColour((255,0,0))
label = wx.StaticText(self, -1, 'Y pos', (5, 280))
label.SetBackgroundColour((0,255,0))
label = wx.StaticText(self, -1, 'Z pos', (5, 300))
label.SetBackgroundColour((0,0,255))

self.posX = wx.SpinCtrl(self, -1, '', (50, 260), (70, -1))
self.posX.SetRange(-10000, 10000)
self.posX.SetValue(100)
self.posY = wx.SpinCtrl(self, -1, '', (50, 280), (70, -1))
self.posY.SetRange(-10000, 10000)
self.posY.SetValue(100)
self.posZ = wx.SpinCtrl(self, -1, '', (50, 300), (70, -1))
self.posZ.SetRange(-10000, 10000)
self.posZ.SetValue(100)

label = wx.StaticText(self, -1, 'X lookAt', (5, 330))
label.SetBackgroundColour((255,0,0))
label = wx.StaticText(self, -1, 'Y lookAt', (5, 350))
label.SetBackgroundColour((0,255,0))
label = wx.StaticText(self, -1, 'Z lookAt', (5, 370))
label.SetBackgroundColour((0,0,255))

self.poslookX = wx.SpinCtrl(self, -1, '', (50, 330), (70, -1))
self.poslookX.SetRange(-10000, 10000)
self.poslookX.SetValue(0)
self.poslookY = wx.SpinCtrl(self, -1, '', (50, 350), (70, -1))
self.poslookY.SetRange(-10000, 10000)
self.poslookY.SetValue(1)
self.poslookZ = wx.SpinCtrl(self, -1, '', (50, 370), (70, -1))
self.poslookZ.SetRange(-10000, 10000)
self.poslookZ.SetValue(0)

label = wx.StaticText(self, -1, 'Clip Distance', (5, 410))
label = wx.StaticText(self, -1, 'Near', (5, 430))
self.posNear = wx.SpinCtrl(self, -1, '', (50, 430), (70, -1))
self.posNear.SetRange(1, 1000)
self.posNear.SetValue(5)

label = wx.StaticText(self, -1, 'Far', (5, 450))
self.posFar = wx.SpinCtrl(self, -1, '', (50, 450), (70, -1))
self.posFar.SetRange(1, 500000)
self.posFar.SetValue(100000)


def _wxCreateButtons(self):
self.LoadButton = wx.Button(self, -1, "Create Camera",(150, 260), (120, -1))
self.Bind(wx.EVT_BUTTON, self.__OnCreateCameraButton, self.LoadButton)

self.AdjustPosition = wx.Button(self, -1, "Adjust Position",(150, 290), (120, -1))
self.Bind(wx.EVT_BUTTON, self.__OnAdjustPositionButton, self.AdjustPosition)

self.AdjustLookAt = wx.Button(self, -1, "Adjust LookAt",(150, 330), (120, -1))
self.Bind(wx.EVT_BUTTON, self.__OnAdjustLookAtButton, self.AdjustLookAt)

#self.AddCamera = wx.Button(self, -1, "Add Camera to Scene",(150, 360), (120, -1))
#self.Bind(wx.EVT_BUTTON, self.__AddCamera, self.AddCamera)

self.AssignNear = wx.Button(self, -1, "Adjust Near Distance",(150, 420), (120, -1))
self.Bind(wx.EVT_BUTTON, self.__OnAssignNearButton, self.AssignNear)

self.AssignFar = wx.Button(self, -1, "Adjust Far Distance",(150, 450), (120, -1))
self.Bind(wx.EVT_BUTTON, self.__OnAssignFarButton, self.AssignFar)

def _wxLoadCameraList(self):
LISTBOX_SELECTEDENTITY = wx.NewId()
self.wxListBoxCamera = wx.ListBox(self, LISTBOX_SELECTEDENTITY, (5, 0), (140, 250), self.cameraList, wx.LB_SINGLE)
self.Bind(wx.EVT_LISTBOX, self.__OnListBox, id=LISTBOX_SELECTEDENTITY)

def __OnListBox(self,event):
#print "list"
index = event.GetSelection()
self.listindex = index
name = self.cameraList[index]

self.camera = self.ogreWin.sm.getCamera(name)
position = self.camera.getPosition()
self.posX.SetValue(position[0])
self.posY.SetValue(position[1])
self.posZ.SetValue(position[2])

vec3 = self.lookAt[name]
self.poslookX.SetValue(vec3[0])
self.poslookY.SetValue(vec3[1])
self.poslookZ.SetValue(vec3[2])
#self.wxwin.statusbar.SetStatusText(info,3)

near = self.camera.getNearClipDistance()
self.posNear.SetValue(near)

far = self.camera.getFarClipDistance()
self.posFar.SetValue(far)

self.ViewPortName = self.cameraViewAttach[name]
self.ViewPortAttachCam = name
self._wxStaticLabels()
self.showCamera()


def _OnExternalLoadCamera(self, name, vec3):
found = False
for it in self.cameraList:
if name == it:
found = True
if found == False:
self.cameraList.append(name)
self.cameraViewAttach[name] = "NONE"
self.lookAt[name] = vec3
if self.selectFirstTime == 0:
self.selectFirstTime = 1
self._wxLoadCameraList()
else:
self.wxListBoxCamera.Set(self.cameraList)
return found

def _OnExternalCameraLoadViewPort(self, namelist, attachDict):
count = len (namelist)
for i in range (0,count):
name = namelist[i]
self.viewportList.append(name)

#if self.viewselectFirstTime == 0:
# self.viewselectFirstTime = 1;
# self._wxLoadViewportList()
#else:
# self.wxListBoxViewport.Set(self.viewportList)

count = len (self.cameraList)
for i in range (0,count):
name = self.cameraList[i]

found = False
for k,v in attachDict.iteritems():
if v == name:
self.cameraViewAttach[name] = k
found = True

if found == False:
self.cameraViewAttach[name] = "NONE"

print " key: " + name + " value: " + self.cameraViewAttach[name]


def __OnCreateCameraButton(self,event):
#print "CreateCamera"
name = 'camera' + str(self.listId)

self.camera = self.ogreWin.sm.createCamera(name)
position = ogre.Vector3(self.posX.GetValue(),self.posY.GetValue(),self.posZ.GetValue())
self.camera.setPosition(position)

node = self.ogreWin.sceneManager.getRootSceneNode().createChildSceneNode('node'+name)
node.resetOrientation()
node.position = ogre.Vector3(self.posX.GetValue(),self.posY.GetValue(),self.posZ.GetValue())

self.listId = self.listId + 1
self.cameraList.append(name)
self.cameraViewAttach[name] = "NONE"

if self.selectFirstTime == 0:
self.selectFirstTime = 1
self._wxLoadCameraList()
else:
self.wxListBoxCamera.Set(self.cameraList)

vec3 = ogre.Vector3(self.poslookX.GetValue(),self.poslookY.GetValue(),self.poslookZ.GetValue())
self.lookAt[name] = vec3
#print self.lookAt

self.camera.setNearClipDistance(self.posNear.GetValue())
self.camera.setFarClipDistance(self.posFar.GetValue())

self.wxwin.updateCameraList(name)
self.showCamera()
self.listindex = -1

def __OnAdjustPositionButton(self,event):
index = self.listindex
if index!= -1:
print "Adjust Position"
name = self.cameraList[index]

self.camera = self.ogreWin.sm.getCamera(name)
print "Camera: " + name

position = ogre.Vector3(self.posX.GetValue(),self.posY.GetValue(),self.posZ.GetValue())
self.camera.setPosition(position)
self.showCamera()


def __OnAdjustLookAtButton(self,event):
index = self.listindex
if index!= -1:
print "Adjust LookAt"
name = self.cameraList[index]

self.camera = self.ogreWin.sm.getCamera(name)
print "Camera: " + name

position = ogre.Vector3(self.poslookX.GetValue(),self.poslookY.GetValue(),self.poslookZ.GetValue())
self.lookAt[name] = position
self.camera.lookAt(position)
self.showCamera()


def __OnAssignNearButton(self,event):
index = self.listindex
if index!= -1:
print "Assign Near"
name = self.cameraList[index]
self.camera = self.ogreWin.sm.getCamera(name)
print "Camera: " + name
self.camera.setNearClipDistance(self.posNear.GetValue())
self.showCamera()


def __OnAssignFarButton(self,event):
index = self.listindex
if index!= -1:
print "Assign Far"
name = self.cameraList[index]
self.camera = self.ogreWin.sm.getCamera(name)
print "Camera: " + name
self.camera.setFarClipDistance(self.posFar.GetValue())
self.showCamera()

def showCamera(self):
index = self.listindex
if index != -1:
#print "show camera"
name = self.cameraList[index]
self.camera = self.ogreWin.sm.getCamera(name)

self.ogreWin.Scene.Camera.parentSceneNode.detachObject(self.ogreWin.Scene.Camera)

position = self.camera.getPosition()
self.ogreWin.Scene.Camera.setPosition(position)
vec3 = self.lookAt[name]
self.ogreWin.Scene.Camera.lookAt(vec3)
self.ogreWin.sceneManager.getSceneNode("CamUser").attachObject(self.ogreWin.Scene.Camera)
self.ogreWin.Scene.CamNodeUser.resetOrientation()
self.ogreWin.Scene.CamNodeUser.setPosition(position)
self.ogreWin.Scene.CamNode = self.ogreWin.Scene.CamNodeUser





this is the patch for ogreWinWx.py add this code between "CamBack"
and "CamQI"


# create the camera nodes & attach camera
cameraNode = self.sceneManager.getRootSceneNode().createChildSceneNode("CamUser")
self.Scene.CamNodeUser = cameraNode


it should look at this:



# create the camera nodes & attach camera
cameraNode = self.sceneManager.getRootSceneNode().createChildSceneNode("CamBack")
self.Scene.CamNodeBack = cameraNode

# create the camera nodes & attach camera
cameraNode = self.sceneManager.getRootSceneNode().createChildSceneNode("CamUser")
self.Scene.CamNodeUser = cameraNode

cameraNode = self.sceneManager.getRootSceneNode().createChildSceneNode("CamQI")
cameraNode.setPosition (ogre.Vector3(200, 200, 200))
cameraNode.attachObject(camera)
self.Scene.CamNodeQI = cameraNode
self.Scene.CamNode = self.Scene.CamNodeQI



Sorry about the camera, I forgot what I wrote and I was writing from memory.

Thanks,

PS. I need help from a TreeView Control expert.
I need to know how to get an index for the children attached to parent.

skorpio

12-08-2008 08:26:06

Hello,

Here is the latest version. This includes the patch for cameras and viewports.

I added a new button to the wxPanelViewport. Now you can render a viewport. However there are a few warnings:

1) there are not a lot of checks, yet. so if the zorder is taken, it will not work.
2) if no camera is assigned, it will not work.
3) if your try to render a full screen, it will work but you will loose your previous viewport fullscreen
4) There is no delete, once it is rendered, it can't be undone.
I looked at the documentation and I did not see any way to delete or hide a viewport.


Thanks,

skorpio

16-08-2008 19:31:07

Hello

Here is the latest update. I finally fix the camera tracking. For that,
the camera needs to be aware of the nodes.
So in order for the camera to track, it needs
to be enable ( check box) and
to be assigned to a node (select from a node listbox)

I also did a regression test on all the XML files. They tested good.
I still need to put more safeguard in the viewport but it works.

So viewports and cameras are finally done. Except for a few bugs that I'm not aware yet.

I think, I will work on the plane and/or environment panel next.

Thanks,

skorpio

19-08-2008 07:13:56

Hello,

Here is another installment. As it turns out, the current version was not handling any import. Rev 27 now can handle it.
Looking at the environment section of the XML, it handles different things that require more panels. I may combine skyplane and skydome in one panel, fog in another. I guess, I'm leaving planes last. Planes required a lot of parameters.

help
I need some help with some code that can return the material list. I believe they are loaded as part of the configuration.
For example all *.material files start with:
material ?????, where ????? is the name of the material

Skyplanes require a material definition. It would be nice to be able to change it.

Thanks,

skorpio

22-08-2008 08:39:40

Hello

Here is latest version, I fixed a few bugs.
I implemented the skyplane panel. You can change some of the parameters there. You can't change the material because I haven't found a way to show what materials are available.

The implementation of the skyplane is little different than the others. It uses classes to simulate structures. So all the data in skyplane is put into a structure and then I create a list of them. It is handy way to pack data.
Eventually I would like to migrate some of the existing code. It should clean up the number of list and dictionary that are passed around.

As summary this far, most of the XML sections are getting implemented, shortly I will implement skydome, skybox and fog. This should conclude most of the basic sections. After that comes the bindings, events and processes. That should be fun.

I was thinking that perhaps the tree should only list the main sections.
what do you think?

Thanks,

For this demo I used the demo_skyplane.xml

skorpio

23-08-2008 10:49:08

Hello,

Here are the 3-Skys:
plane
box
dome.

I added a new box.xml demo and I fixed a few bugs that I found a long the way. The all take a distance parameters, so the xml changed
All these changes are in rev29. Fog and plane are coming soon.

Thanks,

EvanPMeth

23-08-2008 19:28:37

I was just curios, do you plan on having a material selector/editor in the future? or anything involving materials?

skorpio

24-08-2008 03:37:55

Evan,

Yes, I would like to add material, particles, animation, etc. I'm just trying to wrap up all the basics. I have tried to find some basic code that does materials and texture but nothing yet.

Also out of curiosity, has anybody created their own panels?


Thanks,

skorpio

24-08-2008 11:37:04

Hello,

Here is the latest version. It includes Fog. The scale of exp density and linear start and linear end use a 10,000 scale. That is
0 = 0
10,000 = 1.0
2 = 0.0002

Spin control only take integers some these variables needs scaling.

I started loading some of the XML that are included with ZIP. Most of them failed with all the changes going around. I fixed all, I think.

Also I removed two of the buttons on the tool bar. There were not necessary since treeview came along.


Thanks,

skorpio

29-08-2008 09:27:12

Hello,

I have been trying to integrating plane which are meshes created manually
then assigned to an entity and later to a node. At least that is the what I have seen in most demos.

So when I tried to run the following code


self.plane = ogre.Plane()
self.plane.normal = ogre.Vector3(normalX,normalY,normalZ)
self.plane.d = distance
self.mm = ogre.MeshManager.getSingleton()

self.mm.createPlane(planename, planegrpname, self.plane, planewitdth, planeheight,
segX, segY, normalper, numcoorset, tileU, tileV,
ogre.Vector3(planeUpX,planeUpY,planeUpZ),
ogre.HardwareBuffer.HBU_STATIC_WRITE_ONLY,
ogre.HardwareBuffer.HBU_STATIC_WRITE_ONLY,
bufShadowVertexState, bufShadowIndexState)




I get an error that the resource already exist so, I tried to unload it.
However it doesn't work. It crashes


self.mm = ogre.MeshManager.getSingleton()
self.mm.unload(planename)




Traceback (most recent call last):
File "C:\PythonOgre\demos\wxOgre\wxPanelPlane.py", line 197, in __OnAdjustPlane
bufShadowVertexState, bufShadowIndexState)
ogre.renderer.OGRE._ogre_exceptions_.OgreItemIdentityException: OGRE EXCEPTION(4:): Resource with the name planeFloor already exists. in ResourceManager::add at ..\src\OgreResourceManager.cpp (line 113)


Any suggestions?

Thanks,

chpod

31-08-2008 10:58:06

The toolbar subdir is missing in rev30. It was quite obvious, but it took me quite a while to figure it out.

Could you add this so that it get easier to troubleshoot: around line 118, just before self.CreateToolBar():
import os.path
if (not os.path.exists("./toolbar")):
print "Fatal, toolbar directory could not be found: ",".toolbar"
quit()


chpod

chpod

31-08-2008 11:19:38

Regarding the plane creation/remove issue:

I inserted this code at the end of __init__ in wxOgre.py (code inserted from line 172):
print "Tests"
normalX = 0
normalY = 0
normalZ = 1
distance = 1
planename = "planeFloor"
planegrpname = "GroupName"
planewidth = 10
planeheight = 10
segX = 1
segY = 1
normalper = 1
numcoorset = 1
tileU = 1
tileV = 1
planeUpX = 1
planeUpY = -1
planeUpZ = 0
bufShadowVertexState = 1
bufShadowIndexState = 1


self.plane = ogre.Plane()
self.plane.normal = ogre.Vector3(normalX,normalY,normalZ)
self.plane.d = distance
self.mm = ogre.MeshManager.getSingleton()

self.mm.createPlane(planename, planegrpname, self.plane, planewidth, planeheight,
segX, segY, normalper, numcoorset, tileU, tileV,
ogre.Vector3(planeUpX,planeUpY,planeUpZ),
ogre.HardwareBuffer.HBU_STATIC_WRITE_ONLY,
ogre.HardwareBuffer.HBU_STATIC_WRITE_ONLY,
bufShadowVertexState, bufShadowIndexState)

self.mm = ogre.MeshManager.getSingleton()
self.mm.unload(planename)
print "Tests OK"


Everything seems to work. Nothing is displayed, but there is no crash (with RC2).

Could you provide the full wxPanelPlane.py so that we can investigate more, please?

One more detail, in you case there might be a confusion between ResourceManager.remove and ResourceManager.unload.

chpod

PS: Thx for the explanations regarding node etc, dates back to August 10th already. I have been quite busy in the passed weeks and could not work on it... yet.

skorpio

31-08-2008 17:39:06

Hello,

Ok, here is the latest version. I finally finished the Plane panel. The issue with deleting a plane it is not resolved yet. However it seems you need to have this plane entity attached to the node to be visible. Perhaps the node can be destroyed to make the plane disappear. I don't know.
Also you can go to the entity panels and move this plane around! There are a few things that are hard coded like materials but I don't think will impact negatively anything. The need for a material panel is underscored.

I added a demo_room.xml that shows how planes can be used to create a simple room.


There was a little change done to the XML plane:
was:

<bufferusage vertex="ogre.HardwareBuffer.HBU_STATIC_WRITE_ONLY" index="ogre.HardwareBuffer.HBU_STATIC_WRITE_ONLY"/>

Now

<bufferusage vertex="HBU_STATIC_WRITE_ONLY" index="HBU_STATIC_WRITE_ONLY"/>



I'm also providing a default.XML
It basically creates 1 camera and 1 viewport. Any user can load this XML, autogenerate code and it will run. The screen will be black but it will run.
It is the simplest application anybody can do.


I also added buttons for creating
Skybox
Skydome
Skyplane and
Fog

For the skies you can use the state to make them visible or invisible. So you can load all 3 them. Just make sure that you click the adjust button after clicking the checkbox.

I'll be working on the last 3 XML sections. Events, Binding, and Process.
These sections give the wxOgre its dynamic aspect and it ties to the generic Python-ogre classes (library)


Thanks,




skorpio

06-09-2008 08:32:14

Hello,

Here is an update, for Rev32. It has some code for reading and displaying the Event section in the XML file. However. I haven't been successful at binding/unbinding key events.

Basically, the only event key_down is being used by the ESC key to get out of full screen mode.

For some reason you need to import the class just before creating an instance of it.
If you uncomment the following lines and load cameratracking.xml.
you can get the Statistics overlay to display but no way to activate the keys.



wxPanelEvent.py

#codeString = "from class%s import %s" % (evtclass, evtclass)
#print codeString
#codeObject = compile(codeString,'<codeString>','exec')
#exec codeObject


#codeString = "%s = %s(self,%s)" % (evtname, evtclass, params)
#print codeString
#codeObject = compile(codeString,'<codeString>','exec')
#exec codeObject



The main goal now is to tied the events in the XML file to wxOgre. So that the user can dynamically press keys.



Thanks,


Note: wxOgre uses widgets keys handler while the stand alone uses OIS

skorpio

10-09-2008 08:25:40

Hello,

Is there a conversion function that takes OIS key codes to wx keycodes?

As mentioned before wxOgre uses wx key handlers while the wxFramework uses OIS key handlers. I have not found a way to patch dynamically key events, I think I'm getting closer.
Trying to create an OIS input handler yield to a coop error which I interpreted as there is somebody doing a callback to the input handlers.

In any case, I was able to patch ogrWinWx.py



def _MouseAndKeysBindings(self):
"Some Additional mouse and keys bindings"
#d=10.0 #displacement for key strokes
#self.ControlKeyDict={wx.WXK_LEFT:ogre.Vector3(-d,0.0,0.0),
# wx.WXK_RIGHT:ogre.Vector3(d,0.0,0.0),
# wx.WXK_UP:ogre.Vector3(0.0,0.0,-d),
# wx.WXK_DOWN:ogre.Vector3(0.0,0.0,d),
# wx.WXK_PAGEUP:ogre.Vector3(0.0,d,0.0),
# wx.WXK_PAGEDOWN:ogre.Vector3(0.0,-d,0.0)
# }

from classOverlayDisplay import OverlayDisplay
self.eventShowOverlay = OverlayDisplay(self,'Core/DebugOverlay')


self.Bind(wx.EVT_KEY_DOWN,self._DefaultKeyDownManager)
self.Bind(wx.EVT_MOUSE_EVENTS,self._DefaultMouseEventManager)
self.Bind(wx.EVT_MOUSEWHEEL, self._MouseWheel)


def _DefaultKeyDownManager(self,event):
if event.m_keyCode == wx.WXK_ESCAPE:
self.parent.do_layout(self.parent.panelindex)

self.key_down(event)
event.Skip()


def key_down(self,event):
print "Keycode: " + str(event.m_keyCode)

"" OIS.KC_F == 070
if event.m_keyCode==70:
self.eventShowOverlay.start_Show()
pass



Everything is statically loaded which is not desired. But at least I think I may be possible to be dynamically load them (eventually)

So what I'm trying to do is to patch the key_down() when the XML is loaded. I'm not sure how to go about doing this. Any help would be appreciated.


Thanks,

skorpio

15-09-2008 06:53:47

Hello,

Here is the latest version of the code. I figured out how to bind events to the wxOgre. The events are forwarded from ogreWinWx.py to wxOgre.py which in turn forwards events wxPanelEvent. Here the code is compiled on-the-fly per event.

In order to get everything to work, there were changes to most class ( common libraries). The arguments used by the event panel were simplified.

warnings
1) There is problem with the rate things are updated by winOgre. The stand alone apps have the correct timing but the wxOgre uses a timer every 16 msec.
In summary, the xml loaded by wxOgre are running slow. A while ago, I posted in regards to getting the wxOgre to run faster by doing different things to render one ogre frame.
This needs to be addressed.

2) Binding events is mostly a manual task. This should be improved shortly. The reason was the extensive debugging required to get all to work. But it works, so it will be automatized shortly.

How to
Load demo_spinner.xml
Click event tree-entry
Click eventNinja list to select event
Click create class button
Select Keys to bind and press Bind keyboard button
Select process to bind and press Bind process button
Press left and right key to turn the ninja around.

If you can't stand the slowness, you could edit the classNodeMovement.py
and change:


def update(self):
if self.spinning_y != 0:
self.node.yaw(.2 * self.spinning_y)

if self.moving_x != 0:
self.translateVector.x = 2 * self.moving_x
self.translateVector.y = 0
self.translateVector.z = 0
self.node.translate(self.translateVector)




I tested all the demo XML and did a regression test. There were no crashes. So that is a good sign.

Another major milestone was reached: All the data from XML is now visible within the wxOgre environment.

Thanks,


skorpio

16-09-2008 07:09:24

Hello,

I forgot to mentioned that camera tracking is not quite working yet.
It doesn't crash but it doesn't. The issue is that camera in the XML is not the same camera used in the wxOgre. wxOgre uses some internal nodes to create different the 6-cameras used. When the user clicks one of the cameras angles, the selected camera is mapped to an internal camera which it is tied to the mouse movement.
Another mapping will be needed to make some of the classes work.

thanks,

skorpio

17-09-2008 04:04:37

Hello,

I have been working on trying to fix the problem with difference in behavior when the code runs as a stand alone vs within wxOgre. I thought the problem could be solved by calling the updateRender() faster that 16msec or faster that wx allows it by having a different thread.

So, I created a thread that call the UpdateRender(). The thread works but it fails to update the screen. You can see from the image that when it tried to display the statistics something was sort of showing. Also the arrow seems distorted.



ogreWinWx.py

class frameThread(Thread):
def __init__ (self,run_flag,app):
Thread.__init__(self)
self.running = run_flag
self.ogreWin = app

def run(self):
print "\n\n>> TestThread: run()\n\n"
while self.running:
if not self.running:
break
#print time.ctime()
#self.ogreWin.DummyPrint()
self.ogreWin.UpdateRender()
time.sleep(0.016)
print "thread_exit"

def Kill(self):
self.running = 0



Also


def _OnCloseWindow(self, event):
self.thr.Kill()
self.Destroy()

def StartRendering(self,interval=16):
# "Activates the timer. A rendering will be triggered at each interval (default :33ms)"
#self.timer.Start(interval)
self.thr = frameThread(1,self)
self.thr.start()




Here is the code is you like to play with it. Use previous REV33 version. This version is just for development.

Thanks,



skorpio

19-09-2008 07:19:25

Hello,

Here it is: a Full speed Ninja!

This code allows wxOgre to run much faster than using wxTimer.
I had explored this option a while ago by overwriting the wxEventLoop.
The problem then was that it just couldn't exit gracefully.
I figured out out to exit properly, in fact, it is the only way to exit.

the user must use menu Exit option to exit

I think this is an acceptable trade of. Full speed vs exit restriction.

There is some cleanup left as well as figuring out why the fish moves oddly.
As stated before, I think is really important to simulate within XML withing the wxOgre framework.


Thanks,

skorpio

21-09-2008 01:55:07

Hello,

It is very exciting to have achieve this milestone of the project.
This is the first time that code is read from XML and written to XML without skipping any data.

I was able to get the event and camera tracking working. After loading the Events manually, the user should be able to go to the selected camera and do camera tracking.

How to
Load demo_cameratracking.xml
Click event tree-entry
Click eventCamAnimation list to select event
Click bind class button
Select process to bind and press Bind process button
Click camerMain from the cameraPanel.

There are a few issues that needs to be resolved but overall structure is done.
At this point I would like to invite people to participate on discussion on how to make this project better.
I thinking cleaning up, documenting and prioritizing fixes and adding new features.

Thanks,


skorpio

24-09-2008 04:41:53

Hello,

A long time ago, my Ogre-saga started by looking at this great demo. This time around I wanted to pay homage to the author of this demo by trying to load it into the wxOgre Framework.

I was able to load all the resources/entities and it worked pretty good.
It has sound, camera tracking.

I will be releasing a more complete wxOgre version soon. By making sure we can create StoneHenge from wxOgre environment. Until then, here is a screen capture.

Thanks,




PS1. I created two new classes. one for audio, and the other does camera animation for the original Stonehenge demo.

PS2. You will need to download pygame to play sounds.
http://www.pygame.org/download.shtml

PS3. You will need to download the Magic of Stonehenge demo from here:
http://www.ogre3d.org/index.php?option= ... Itemid=150

bharling

24-09-2008 19:54:43

Wow!

now that is really neat - well done!

skorpio

07-10-2008 07:46:00

Hello,

Here is the latest version. There has been a lot of changes since the last version. They include:

-Mouse bugs corrected.

- Camera pitching and yawing like regular ogre camera movement.

- Multiple XML can be loaded, repeated objects are ignored.
This allows the user to combine different scenes into one.

-Tree level only shows top level. This avoids confusion.

- One button to bind all the events.

- Events' arguments can be modified.

- Entity panel handles material. It displays materials and they can be changed.

- Entity panel allows multiple meshes to be loaded.

- New entity translate/orientation available. See Help.

- Double-clicking a mesh loads it immediately.

- Mouse support for stand alone applications. See demo_skybox.py and others.

- Zoom in/out using mouse-wheel in stand alone applications.

- I added Help in the form of HTML. This is due to the free image site stopped working. Also I thought it was necessary to consolidate the help.
It would be nice if people submit patches,fixes,new sections so they can be incorporated in the next version. More documentation will follow.


The magic of Stonehenge

Also I cleaned up, the magic of stonehenge Media folder. It is included here. Some of the files were duplicated and made ogre crashed.
You will need to copy all the textures to the empty texture folder.
The music.wav needs to be in the same directory as the rest of the files.

You can run stone1.py and stone2.py. These are partial solution not all the stuff on the original stonehenge is here. wxOgre needs to implement Particles. I will implement basic particle panel on next version (I hope).
stone1 does the camera tracking similar to the original.
stone2 allows the user to explore the world.

The fastest way to create your own magic is to follow these steps:
-load default_audio.xml
-load default_mouse_only.xml. These load events to handle events.
-Load entities barrier, forlight, S1..S15, cast1, pilon and gorizont. Remember to select them all then press load button.

By the way, the stone*.xml can be loaded too.


TO DO
There are some issues to clean up such as planes, viewport. These are low priorities.

I think I will use 3 buttons to move cameras (orientation too) instead of what it is now. I think it may be easier that way.

I will add particles support XML, read/write and panel. These will allows simple particles to be loaded.

Thanks,

skorpio

12-10-2008 01:05:39

Hello,

Here is the latest version of the wxOgre. I tried to improve the mouse movement again. It is similar than the latest. See latest help.

I also added code for reading/writing ParticleSystem. There is no panel yet, but the user can edit the XML files.

The magic of stone is finished. It is under stone3.py and stone3.xml. It is a pretty good simulation of the original. I went over the main.cpp and created the XML. I will not be releasing the Media from the magic of stonehenge. It was covered on rev36.



Complete magic of stonehenge



Athena with castsun1 material



Thanks,

skorpio

14-10-2008 04:45:00

Hello,

There is a 'tiny' bug (Rev37) when handling particlesystem. Please add the following line: self.particleList=[] as shown below.


class wxFrame(wx.Frame):

def __init__(self, *args, **kwds):

.
.
.
self.particleList=[]


That should fix it.

Thanks,

skorpio

18-10-2008 09:56:53

Hello,

Here is the latest version. I fixed a few bugs.
I got rid of the help as the main panel and I created a new one.
This one is more useful. It allows the user to specify whether the
stand-alone application would be full-screen and/or the dimension
of the screen.

Make sure to click the 'update all' button.

I had to change the XML to incorporate this change.


<stand rev="1">
<screen fullscreen="True" width="800" height="600"/>
</stand>



Except for stone4.xml and stone4.py none of the other XML have this change. You'll need to add these changes manually to existing XML. Old XML shouldn't crash because of the default values specified here.


class classOgreCore(object):
def __init__(self, plugins_path='plugins.cfg', resource_path='resources.cfg',fullscreen=False,width=800,height=600):


stand-alone app

def main():
app = sceneApp(fullscreen=False,width=800,height=600)
while not app.renderWindow.isClosed():
ogre.WindowEventUtilities().messagePump()
if app.renderWindow.isActive():
app.render_one()
time.sleep(0.0001)
else:
time.sleep(.1)
app.shutdown()




As far the magic of stone henge, when I moved my code to python-ogre 1.6 the particle system template changed.
So I included a new patch that you can use.

Thanks,

new panel

skorpio

25-10-2008 12:26:03

Hello,

Here is the latest update. I finally couldn't ignore fixing the wxPanelEntity.
I got rid of the wxSpin control in favor of text boxes. This allows the user to set decimal points for orientation, position and scale. The main change was on the orientation. I had to keep track of it instead of asking ogre. (quaternion thing). Unfortunately, this change rippled through a lot of modules, so it took me a while to get it all working again. Also I fixed the wxPanelFog. Now, that was easier.

I recently moved to 1.6RC1. There are lot of goodies in there. I just have not had time to play with all of them but Hydrax was great.

I created a class and a XML for it. It can be found on the zip file.
Before you can run it. Download the Media files from here. Also copy all the media files to the python-ogre\demos\hydrax\media folder

http://www.ogre3d.org/phpBB2addons/viewtopic.php?t=8391

If need a RAR program, use http://www.7zip.com/


Hydrax can be loaded on the wxOgre framework, but if you 'Bind' the events it will crash. From the logs, I think it can't find a camera so it crashes. But, I loaded the XML to move the island and place the palm tree. The stand alone works. There is a small issue with the texture for the island. It doesn't seem to work when all the media files are used. If you ran the original Demo_Hydrax, it works ok. Weird!

I'll be looking at some of the other examples and see what I can port over.

Thanks,

Using M toggles between different skyboxes.




Free Image Hosting by ImageBam.com

skorpio

29-10-2008 07:14:49

Hello,

I found this bug while trying to add more palms the the demo_hydrax.

Currently wxPanelEntity uses a counter to give each entity and plane a unique ID. But when a user loads a Palm0 (through a XML load)and you want to add a Palm for the first time, OGRE generates an exception because the name is already taken.

[Patch]
In then wxPanelEntity add self.entityID +=1 just as shown



def _OnExternalLoadEntity(self, entityname,nodelist):
found = False
for it in self.entitySelectedList:
if entityname == it:
found = True

if found == False:
self.entitySelectedList.append(entityname)
self.entityNodeList.append(nodelist)

self.nodename = "node" + entityname
self.node = self.ogreWin.sm.getSceneNode(self.nodename)

self.selEntitiesList.Set(self.entitySelectedList)
self.entities.DeselectAll()
self.entityID +=1
return found

and


def _OnExternalLoadPlaneEntity(self, name, node):

found = False
self.entitySelectedList.append(name)

position = ogre.Vector3(0,0,0)
orientation = ogre.Vector3(0,0,0)
scale = ogre.Vector3(1,1,1)
nodelist = position, orientation, scale
self.entityNodeList.append(nodelist)

self.selEntitiesList.Set(self.entitySelectedList)
self.entities.DeselectAll()
self.entityID +=1
return found


This should help things a bit.

Thanks,

skorpio

31-10-2008 06:18:43

Hello,

I started to port particle universe. However, there are a lot of issues with this addons.

ISSUE 1
If bring python and type import ogre.addons.particleuniverse as PU.
It crashes. It is looking for three DLL. which I copied to the folder but I get
another error:


c:\PythonOgre\demos\wxOgre>python
Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import ogre.addons.particleuniverse as PU
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python25\lib\site-packages\ogre\addons\particleuniverse\__init__.py",
line 1, in <module>
from _particleuniverse_ import *
RuntimeError: extension class wrapper for base class class Ogre::MovableObject h
as not been created yet
>>>


ISSUE 2
You can't call the wxPanelParticleUniverse without first loading the particleUniverse.DLL
So, in the wxOgre.py you'll see this:


self.wxPanelStand = wxPanelStand( self.wxPanels[13],-1, self.ogreWin, self )

from wxPanelParticleUniverse import wxPanelParticleUniverse
self.wxPanelParticleUniverse = wxPanelParticleUniverse( self.wxPanels[14],-1, self.ogreWin, self )



These two issues may be related.

ISSUE 3
The scene manager does not return the proper pointer :

self.particleSystem = self.sm.getParticleSystem(self.particlename)

This is necessary when creating stand alone apps.

ISSUE 4
when you attach a node the the particleuniverse, the position works but not the orientation.

MY ISSUE1
I added some routine to read particleUniverse from and XML, but it also crashes. it may be related to 1 & 2

MY ISSUE2
particleUniverse have a dual behavior. They can be treated as particle system and or events. particleUniverse supports start() and stop(). This behavior belongs with events.

As particle Systems

import ogre.addons.particleuniverse as PU

self.particlefountain5 = PU.ParticleSystemManager.getSingleton().createParticleSystem('fountain5','electricBeamSystem',self.sm)
self.nodefountain5 = self.rn.createChildSceneNode('nodefountain5')
self.nodefountain5.setPosition(ogre.Vector3(0, 0, 0))
self.nodefountain5.pitch(ogre.Degree(d=0.0))
self.nodefountain5.yaw(ogre.Degree(d=0.0))
self.nodefountain5.roll(ogre.Degree(d=0.0))
self.nodefountain5.setScale(1.0, 1.0, 1.0)
self.nodefountain5.attachObject(self.particlefountain5)
self.particlefountain5.start()


or as events

self.eventFountain5 = ParticleUniverse(self)

.
.
.

self.eventFountain5.start()
.
.
self.eventFountain5.stop()





Anyway, I think, the porting over will be put on the back burner until some of these issues are resolved. In the mean time, the wxPanelParticleUniverse acts like a viewer.
Once loaded, the user can click the list to view the status, and
double click to start and stop the particle system

I'm hoping these issues will be resolved at some point, but for now, please enjoy the viewer.


Thanks,





andy

31-10-2008 07:44:23

Let me see if I can help here.. And when in doubt check out the demo code...

A couple of your issues and sample issues are indeed related to the dll locations and the fact that you have to load the base ogre library first - from the demo you can see the following....
## this here becase the ParticelUnivser.dll needs to be access by both the python module and the ogre plugins
## need a better fix ling term
if sys.platform == 'win32':
newpath = os.path.join ( os.path.abspath(os.path.dirname(__file__)), '../../plugins')
os.environ['PATH'] = newpath +';' + os.environ['PATH']

import PythonOgreConfig
import ogre.renderer.OGRE as ogre
import ogre.addons.particleuniverse as PU


ISSUE3: Use code like this:
name= self.particleSystem2.name
self.ps = self.sceneManager.getMovableObject(name, PU.ParticleSystemFactory.PU_FACTORY_TYPE_NAME)


Not sure about the position and orientation of nodes that are attached -- do you have sample code that shows the problem.

regards

Andy

skorpio

02-11-2008 04:27:53

Hello,

Thanks for the help.

I just tried many different ways of integrating the code as mentioned but it has not worked. Here is the code if anybody feels like tackling



self.particlefountain5 = PU.ParticleSystemManager.getSingleton().createPar
ticleSystem('fountain5','electricBeamSystem',self.sm)
Traceback (most recent call last):
File "C:\PythonOgre\demos\xKorpio\wxOgre.py", line 457, in __OnFileOpen
self._PopulateFromXML(file)
File "C:\PythonOgre\demos\xKorpio\wxOgre.py", line 506, in _PopulateFromXML
self.particleUniverseList = ogreXmlRd._ProcessXmlParticleUniverse()
File "C:\PythonOgre\demos\xKorpio\ogreXMLReader.py", line 389, in _ProcessXmlP
articleUniverse
self._execXml(codeString)
File "C:\PythonOgre\demos\xKorpio\ogreXMLReader.py", line 796, in _execXml
exec codeObject
File "<codeString>", line 1, in <module>
NameError: name 'PU' is not defined


Sections of the XML looks like this


<nodes rev="1">

<node name="nodefountain5" nodeid="">
<position x="0" y="0" z="0" />
<orientation pitch="0.0" yaw="0.0" roll="0.0" />
<scale x="1.0" y="1.0" z="1.0" />
</node>

</nodes>


<particleuniverse>
<particle name="fountain5" file="electricBeamSystem" attach="nodefountain5"/>
</particleuniverse>




ogreXMLreader.py



def _ProcessXmlParticleUniverse(self):
particleList=[]
firsttime = True
for node in self.doc.getElementsByTagName("particleuniverse"):
node_section = node.getElementsByTagName("particle")
for node2 in node_section:
name = node2.getAttribute("name")
file = node2.getAttribute("file")
attach = node2.getAttribute("attach")
partname = "particle%s" % name

#exist = True
#try:
# self.enthandle = self.sm.hasParticleSystem(name)
#except ogre.OgreItemIdentityException:
exist = False

if exist == False: ## or self.enthandle == False:

if firsttime == True:

if sys.platform == 'win32':
newpath = os.path.join ( os.path.abspath(os.path.dirname(__file__)), '../../plugins')
os.environ['PATH'] = newpath +';' + os.environ['PATH']
import ogre.addons.particleuniverse as PU


#codeString = "import ogre.addons.particleuniverse as PU"
#self._execXml(codeString)
print "\n"
firsttime = False

codeString = "self.%s = PU.ParticleSystemManager.getSingleton().createParticleSystem('%s','%s',self.sm)" % (partname,name,file)
self._execXml(codeString)
#self._ProcessXmlNodes(attach,partname,True)
codeString = "self.%s.start()" % (partname)
self._execXml(codeString)

prt = XmlParticlesStruct()
prt.name = name
prt.file = file
prt.attach = attach
particleList.append(prt)

else:
print "\n***Particle %sFound, skipping ***\n" % (name)
return particleList



wxOgre.py



def _PopulateFromXML(self, filename):

.

.
.

self.particleList = ogreXmlRd._ProcessXmlParticles()
self.particleUniverseList = ogreXmlRd._ProcessXmlParticleUniverse()
.
.
.


Again, Thanks for the all the help,

Skorpio

andy

02-11-2008 05:47:31

What is you _execXml function?

Andy

skorpio

02-11-2008 07:43:36

hello,

_execXml is supposed to execute codestring. It has worked so far.


def _execXml(self, codeString):
print " " + codeString
codeObject = compile(codeString,'<codeString>','exec')
exec codeObject


Thanks,

skorpio

03-11-2008 07:41:02

Hello,

Good news today, I was able to fix the shutting down problem with wxOgre.py. This was due to the fact I replaced the MainLoop with my own event loop to force faster rendering of ogre scenes.


Here is the patch:

wxOgre.py


class wxFrame(wx.Frame):

def __init__(self, *args, **kwds):
kwds["style"] = wx.DEFAULT_FRAME_STYLE
self.wx = wx.Frame.__init__(self, *args, **kwds)

.
.
.
self.Bind(wx.EVT_CLOSE,self.OnExit)

Add Bind within the __init__

wxOgre.py

def OnExit(self,event):
self.ogreWin._OnCloseWindow(event)

Add this new module within the wxFrame class

wxOgre.py

if __name__=="__main__":
wxMainApp = wx.PySimpleApp(0)
wxMainFrame = wxFrame(None, -1, "",pos=(0,0))
wxMainApp.SetTopWindow(wxMainFrame)
wxMainFrame.ogreWin.StartRendering()
wxMainFrame.Show()

#wxMainApp.MainLoop()

#Create a new event loop (to overide default wxEventLoop)
evtloop = wx.EventLoop()
old = wx.EventLoop.GetActive()
wx.EventLoop.SetActive(evtloop)

run = True
while run== True:
try:
wxMainFrame.ogreWin.UpdateRender()
except wx.PyDeadObjectError:
run = False
print "*** wxOgre.py Shutdown ***"

while evtloop.Pending():
wxMainApp.Pending()
evtloop.Dispatch()

Update main section at end of file

Thanks,

skorpio

06-11-2008 07:45:08

Hello,

Here is the latest version. It includes the latest patches.
Also, I found a bug related to particles. The nodes for attached to particles
were not being passed along. That is fixed now.

Thanks,

skorpio

08-11-2008 17:53:08

Hello,

Here is the latest version, it implements particle universe.
As stated before there are a few issues with particle universe and I'm able to describe a few more.

I found a way to load PU into the wxOgre by loading the nodes from the XML not not attaching them. Then particle universe structure is loaded into the panel which actually creates the particle system and attaches it to the node.I can't explain why it wouldn't load from the ogreXMLreader but it works form the wxPanel.

Discovering that I can load things from the wxPanel too, means that ogreXML reader can be used to just load structures no ogre-stuff. Then each appropriate panel would render ogre resources. I'm thinking that is something I may explore later on.

Also I need to add another Panel for the regular particle or add another list in the current particle panel and renamed it.

OK,
Some of the issues that I found with PU, most of the templates behave differently.
For example, the electricbeam can't be orientated, and the position only works if the particle system is stopped which makes it hard to position it

Fire template can be moved when started, the roll, yaw and pitch are not consistent, they orientate but not on the axis you think.

I think for both, the particle, you can't scale. Changing the scale doesn't seem to to anything. I just the code there because I borrow the code from the wxPanelEntity, and it was harder to take out.

In any case, the basic functionality of the PU is there. A simple particleuniverse.xml is provided.

Thanks,

skorpio

11-11-2008 08:14:41

Hello

Here is the latest version, I copied most of the stuff from ParticleUniverse to create just Particle. It was not easy as I thought. A lot of little bugs.
I think most of the bugs were fixed. I finally figured out how to iterate through the particle system to get to the template name. See code.

I may port some of the particle demos found in the \demos\ folder and added them here. Also I need to see how to list all the material list available to the entity page.

Thanks,

Here I moved this particle off center

bharling

11-11-2008 08:54:47

I'm still working on a material editor for this project - although its so difficult to find spare time these days to work on it.

However its starting to come together - it works just like Blender's nodes system where you connect widgets together to create materials. Also, its all contained in a single wxWindow, so will be very easy to integrate into you existing work ( I'll probably put it all into one python file as well to make it even simpler ).

will post a screenshot if i get 5 minutes later today

chpod

11-11-2008 09:49:53

Great work Skorpio! Really love the particule system.

I'm still working on a material editor for this projectWill your material editor include a cg editor?

Cheers,
chpod

bharling

11-11-2008 16:19:39

Yes thats the plan, I've got it all sketched out in my head, and an almost working widget system, just have to find some time to complete it.

So yes, it will contain noodles that correspond to all Cg operations & semantics ( mul, swizzle, tex2D, constants, POSITION etc etc. ) plus noodles that correspond to ogre material objects ( texture_unit, pass, technique, material, material template etc. etc. ). When compiled, each widget just evaluates its children and spits out code corresponding to what it does. eg: You could have a POSITION input node with its only output going to a swizzle node, which just has the x and y outputs conencted to some parent. The result of this node would be "pos.xy" which would be forwarded to the parent and included in its own output. Of course, you're able to connect nodes to multiple inputs, so POSITION could be re-used elsewhere in another node.

I've got the visual side of this almost nailed, and am quite pleased with the widget creation system ( I've abstracted it a lot, so you can add new widget types in as little as 3 lines of code ). Theres some problems to iron out with display and I've yet to write the actual output engine, but I've a good idea how to do this.

As I said, the aim is to keep this totally self contained in a single wxWindow ( Obviously you'll need to pass some reference to a mesh or material in, but hopefully thats all ), so it should be a breeze to integrate. Finally of course, there'll be some functionality to save the results as a material script. I think parsing material scripts to create a node view might be a bit of a headache, so I might opt for an xml-based way to store projects 'in progress' so you can edit noodles later on.

-----
EDIT
-----

http://imagebin.org/30957

Have a play around with it so far, debug nodes are the only ones that connect properly at the moment!:

http://pasteall.org/3107/python

Much thanks has to go to eber and their post here, on which a lot of this code is based:

http://www.ogre3d.org/phpBB2/viewtopic.php?t=45305

pepere

12-11-2008 21:32:00

Hi Skorpio,
I'm new to ogre. I'm quite interested to integrate an ogre view inside one of my GUI. I've tried to install you last revision but get this error:
(launching wxogre.py)

ogre.renderer.OGRE._ogre_exceptions_.OgreInternalErrorException: OGRE EXCEPTION(7:): ../wxOgre/Media/packs/models.zip - error whilst opening archive: Unable to read zip file.

In fact there is no ./Media in your zip. Do I miss something?

To continue I've commented out the lines in ressources.cfg.
Launching wxOgre the whole script run but end whitout showing anything...
Here is the end of the log:

Texture: pu_lightning_20x64.png: Loading 1 faces(PF_A8R8G8B8,20x64x1) with 6 generated mipmaps from Image. Internal format is PF_A8R8G8B8,32x64x1.
Parsing script pu_lod.pu
ParticleUniverse: Particle System Template 'lodSystem' registered
Texture: basic_droplet.png: Loading 1 faces(PF_R8G8B8,64x64x1) with 6 generated mipmaps from Image. Internal format is PF_X8R8G8B8,64x64x1.
ParticleUniverse: Particle System Template 'advancedLodSystem' registered
Texture: RustyBarrel.png: Loading 1 faces(PF_R8G8B8,256x256x1) with 8 generated mipmaps from Image. Internal format is PF_X8R8G8B8,256x256x1.
Texture: pu_barrel.png: Loading 1 faces(PF_A8R8G8B8,235x295x1) with 9 generated mipmaps from Image. Internal format is PF_A8R8G8B8,256x512x1.
Parsing script pu_rain.pu
ParticleUniverse: Particle System Template 'rainSystem_1' registered
Texture: pu_circle.png: Loading 1 faces(PF_A8R8G8B8,64x64x1) with 6 generated mipmaps from Image. Internal format is PF_A8R8G8B8,64x64x1.
ParticleUniverse: Particle System Template 'rainSystem_2' registered
Parsing script pu_tornado.pu
ParticleUniverse: Particle System Template 'tornadoSystem' registered
Texture: pu_sand_336x330.png: Loading 1 faces(PF_A8R8G8B8,336x330x1) with 9 generated mipmaps from Image. Internal format is PF_A8R8G8B8,512x512x1.
Texture: pu_stone.jpeg: Loading 1 faces(PF_R8G8B8,480x360x1) with 9 generated mipmaps from Image. Internal format is PF_X8R8G8B8,512x512x1.
Finished parsing scripts for resource group General
Parsing scripts for resource group Hydrax
Finished parsing scripts for resource group Hydrax
Parsing scripts for resource group Internal
Finished parsing scripts for resource group Internal
Mesh: Loading axes.mesh.
WARNING: axes.mesh is an older format ([MeshSerializer_v1.30]); you should upgrade it as soon as possible using the OgreMeshUpgrade tool.
Texture: axes.png: Loading 1 faces(PF_R8G8B8,256x256x1) with 8 generated mipmaps from Image. Internal format is PF_X8R8G8B8,256x256x1.

Sure i'm missing something but what ? :)

Cheers,
Laurent

skorpio

13-11-2008 02:52:56

Hello Laurent,

The stonehenge Media files are missing. I stopped releasing them because the zip files were too big. I'm only releasing the wxOgreFramework files.
Here are the files you need. Also you may need to upgrage to python-ogre 1.6 RC1


Media stonehenge. Unzip in the same folder where you unzip wxOgreFramework_rev43.zip
http://www.mediafire.com/file/imzntnycm2zz/Media.zip


Music OGG. Unzip in the same folder where you unzip wxOgreFramework_rev43.zip
http://www.mediafire.com/file/zigtzba4i ... ic_ogg.zip

I started to write a tutorial. Here is what I got. Some of the info and screen capture may be a little out of date. But it will give you an idea how everything works.

Create a tutorial folder in the same folder where you unzip wxOgreFramework_rev43.zip. Load html file
http://www.mediafire.com/file/qf25mzzj1ft/tutorial.zip


After you add the files you need and run the program, you should see a black screen with 3-axis reference on the left.


The easiest thing to do, it is to load some of the XML demo files.
To create your own scenes, open default_mouseonly.xml and then add you entities. Save as XML and then run scene as stand-alone application

I would be happy to help you, please let me know how far you get.



Thanks,

skorpio

13-11-2008 02:58:39

Hello chpod,

Thanks, I really like moving the particles around. They look so cool.
Eventually, it would be nice to have all kinds of editors added to wxOgreFramework. As a minimum, I would like to list the material available that way, any user can attach them to their entities. I use 'RustyBarrel" for everything! because it is the only material I can remember.

Best Regards,


Great work Skorpio! Really love the particule system.

I'm still working on a material editor for this projectWill your material editor include a cg editor?

Cheers,
chpod

skorpio

13-11-2008 03:02:50

Hello bharling,

I would be a great addition to the project. Thanks a lot

Best regards,



Yes thats the plan, I've got it all sketched out in my head, and an almost working widget system, just have to find some time to complete it.

So yes, it will contain noodles that correspond to all Cg operations & semantics ( mul, swizzle, tex2D, constants, POSITION etc etc. ) plus noodles that correspond to ogre material objects ( texture_unit, pass, technique, material, material template etc. etc. ). When compiled, each widget just evaluates its children and spits out code corresponding to what it does. eg: You could have a POSITION input node with its only output going to a swizzle node, which just has the x and y outputs conencted to some parent. The result of this node would be "pos.xy" which would be forwarded to the parent and included in its own output. Of course, you're able to connect nodes to multiple inputs, so POSITION could be re-used elsewhere in another node.

I've got the visual side of this almost nailed, and am quite pleased with the widget creation system ( I've abstracted it a lot, so you can add new widget types in as little as 3 lines of code ). Theres some problems to iron out with display and I've yet to write the actual output engine, but I've a good idea how to do this.

As I said, the aim is to keep this totally self contained in a single wxWindow ( Obviously you'll need to pass some reference to a mesh or material in, but hopefully thats all ), so it should be a breeze to integrate. Finally of course, there'll be some functionality to save the results as a material script. I think parsing material scripts to create a node view might be a bit of a headache, so I might opt for an xml-based way to store projects 'in progress' so you can edit noodles later on.

-----
EDIT
-----

http://imagebin.org/30957

Have a play around with it so far, debug nodes are the only ones that connect properly at the moment!:

http://pasteall.org/3107/python

Much thanks has to go to eber and their post here, on which a lot of this code is based:

http://www.ogre3d.org/phpBB2/viewtopic.php?t=45305

bharling

13-11-2008 08:50:22

Cool, well you're more than welcome to include it when I can get it actually working! -

In the meantime, heres a small update:

http://pasteall.org/3119/python

More test node types, working maths function nodes, sorted out the noodles orientations ( so they connect properly now! ), and added the ability to shrink / expand nodes.

heres a screeny:

http://imagebin.org/31067

pepere

13-11-2008 23:30:37

Hi Skorpio,
The material problem is resolved. :)

I still get an issue with wxOgre.py:
With winpdb
Line 194:
self.statusbar = self.CreateStatusBar(4, wx.ST_SIZEGRIP)

Here is the stack traceback:
ogrewinwx.py line 162 _OnSize
ogrewinwx.py line 201 UpdateRenderer
Then the program exit at line 201:

self.ogreRoot.renderOneFrame()#Asks Ogre to render a frame :

The program crash silently (it exit to command prompt directly without any errors.)

I'm using python 2.5, wxpython 2.8.9.1, and python-ogre 1.6RC1 under vista.

Do you use the same versions?

skorpio

14-11-2008 06:56:54

Hello,

I'm using python 2.5.2, python-ogre 1.6 RC1 and wxwidgets 2.8.9, vista SP1 and wxpython 2.8.9.1 (ANSI) version. I tried the Unicode but some of the control did not work.

Also you will need pygame for playing some of the sounds.


Cheers,

skorpio

14-11-2008 07:10:17

Hello bharling,

Cool, I haven't spend to much time looking at what all the scripts do. I was thinking about doing something with overlays. The seemed simpler than some of the other scripts.
My idea was to hold data in a XML file, Then edit it using wxpython, then compile a new version and display it on python-ogre.

Right now, I'm thinking that wxOgreFramework should handle the basic objects such as entities, skymap, particle, etc. That is my main focus, once the basic stuff is done, I'll doing some of the most advanced stuff.

Best regards,


Cool, well you're more than welcome to include it when I can get it actually working! -

In the meantime, heres a small update:

http://pasteall.org/3119/python

More test node types, working maths function nodes, sorted out the noodles orientations ( so they connect properly now! ), and added the ability to shrink / expand nodes.

heres a screeny:

http://imagebin.org/31067

bharling

14-11-2008 09:49:28

Yes - storing the data is a pretty important question!

Today I'm going to try simply pickling the state of an entire nodes diagram and reloading it, I don't think it'll work, but if it does then that's a lot of time saved.

Now the framework is built, its becoming very quick and easy to build in new features.

To make your own widgets for this, just subclass AbstractNode, for example:

class testFloatMultiplyNode( AbstractNode ):
def createWidget(self):
self.SetLabel(" * ")
self.AddOutput("Output", TYPE_FLOAT)
self.AddInput("argument A", TYPE_FLOAT)
self.AddInput("argument B", TYPE_FLOAT)
self.setContractedSize(wx.Size(50, 20))

def resolve(self, event=None):
# first check everything is connected
ready = True
for inp in self.inputs:
if not inp.HasConnections():
ready = False
if ready:
return self.inputs[0].getConnectedNode().resolve() * self.inputs[1].getConnectedNode().resolve()


then simply create an instance of that widget, and call add it to the view with 'view.addNode( node )', how you add it is up to you ( can be from a menu event, or anything you want ).

Every time you create a connection, the view automatically calls 'resolve' on all top-level nodes. I'm hoping to expand that to catch all events ( text entry etc )

skorpio

16-11-2008 10:07:36

Hello,

I finally managed to implement the list for available material. The changes are local to wxPanelEntity.

Here is the link for the python file.
http://www.mediafire.com/file/wzkzkfcmm ... lEntity.py
Just replace the old wxpanelEntity with this new file

Howto
If the material text box is enabled, then you can double-click on the available material list to copy the material. Then press Adjust Material button to make the change.

Here, I found a really nice material for athena.

Thanks,

skorpio

17-11-2008 07:15:48

Hello,

I just downloaded the latest python-ogre version 1.6.0.
There were a few changes but I fixed a few things.

The new hydrax was changed, there are fewer skyboxes.
I patched my version so that classHydrax would run properly.

So, you will need to update demos\hydrax\media\pack\Skyboxex.zip
and
demos\hydrax\media\materials\scripts\Skybox.material

Thanks,

skorpio

19-11-2008 08:03:55

Hello,

I thought I would share with you, what I do in between postings.

I usually start by looking at some demo such as hydrax, stonehenge, etc, In this case I wanted to port over the BSP demo.

So the first step is to get working the 'new BSP' under wxOgreFramework.
that is, get it working with all the classes. At this point I don't care about wx or XML. I just want some python code that runs.

Porting this demo over, I discovered that I need to have a more generic
scenemanager. So far, I have been using ogre.ST_GENERIC but BSP requires BspSceneManager
This will require changes to XML, wxOgre.py and other files. This change will ripple through a lot of modules. The biggest problem will be with ogreWinWx.py. It uses the generic scenemanager on start up. So you will have to know what manager to use before you run wxOgre.py. I really don't like it that but I'm not sure I have a choice.


Later, I will create an XML manually that can hold the information that is needed to create a BSP app. Then, I will edit ogregenerator to generate
the desired code. These steps are coming next (soon).

Thanks,


http://www.mediafire.com/file/uyyzzetaw ... asicBSP.py

skorpio

20-11-2008 16:57:13

Hello,

I started to port over the hikari demo. It was going pretty good but I run into some problems with two things:
The mouse.Abs.X and Y gives me 0 to 50 range even though the screen is 800x600. I'm not sure how this happening.

Also the control.bind are not working. I think it is related to the mouse position.

There are changes to to input manager and some of the mouse event need to be exposed to the general application.

The beuty of porting is that I discovered how to display the mouse inside the ogre windows!

thanks,

chpod

20-11-2008 17:57:44

I just gave a try to bharling's material editor prototype. It looks very promising.

Up to now I was unable to play with vertex shaders. I have to stick with pixel shaders. Hopefully this tool will help me to jump into vertex shaders! I can't wait for a release with working code generation!

This together with skorpio's work would really make a killer application!

Cheers,
chpod

skorpio

21-11-2008 09:05:24

Hello,

I have a new version, I got two new demos BSP and hikari.
BSP works ok. however fixing an axis should be done before executing lookat. Otherwise it changes the camera's orientation.

Hikari on the other hands needs more work. In order to run Hirari stand-alone, you'll need to copy the hikari media folder to where wxOgre.py is running and renamed to 'hikarimedia'.

The mouse moved keeps giving me 50 by 50 range. I think I know what the problem is. Ogre when is asked to create a window of the dimensions indicated: 800x600 it creates one even though my computer screen resolution is much higher. wxOgreFramework always create this pseudo-resolution of 50x50. I'm not sure how to fix it.
You can verify this by putting a debug code in the Demo_hikari.py in the mousemoved, similar to the one I have. Change screen sizes and you will see what I'm talking about.


Ogregenerator.py was updated to include code to handle mouse events and scene manager. (because of the BSP and hikari)

I run a regression test on all the demos, and all are working fine.
The next step is to get the XML reader and writer to process all the new changes.

Thanks,

dermont

21-11-2008 10:55:52


The mouse moved keeps giving me 50 by 50 range.


50x50 is OIS's default mouse state width and height. You doesn't appear to be updating that anywhere in your code. Your InputManager needs to subclass an ogre.WindowEventListener and set the mouse height/width via it's windowResized method.

http://www.ogre3d.org/phpBB2addons/view ... 66&start=0

skorpio

23-11-2008 01:33:56

Hello,

Thanks to Dermont, I was able to fix the demo_hikari.py. Here is the patch for rev45. Now that this demo is working fine.

You can use the rigth-mouse to drag the flash. Cool!
This will be great for creating toolbars for game and stuff.

Thanks,

skorpio

01-12-2008 07:57:09

Hello,

Here is version rev46. I added a caelum example. It works but for some reason the texture of the Ninja is not showing.

I tried to create some server/client apps. This is work in progress.
The server creates individual threads for each of the clients opened. The client1 tells the server to initialize, the server then tells the client to load a ninja. Really simple stuff.
However, these messages are only processed if the window is focused. So to see happen you need to focus on the server and client, so on and so for. I don't know how to force windows to update these windows.
The idea here was to experiment with some simple network stuff and ogre.

Thanks,




wxOgre can be made to load the demo_caelum.xml, if the event arguments is updated to self.ogreWin.renderWindow
and also by changing the ogreWinWx.py

def _ChooseSceneManager(self):
"choose SceneManager"
#self.sceneManager = self.ogreRoot.createSceneManager(ogre.ST_GENERIC,"ExampleSMInstance")
#self.sceneManager = self.ogreRoot.createSceneManager('BspSceneManager')
self.sceneManager = self.ogreRoot.createSceneManager("TerrainSceneManager")


skorpio

10-12-2008 08:21:55

Hello,

I just updated the documentation for the wxOgre framework to include some of the latest update.

I added a few new sections to describe how to install and configure all the required python packages.

I'm hoping I can update this document regularly.

Thanks,

skorpio

15-12-2008 08:15:26

Hello,

Here is the latest version. I created a new panel for creating Animation Tracks.

how to
1) load and entity from the entity panel. In this example I used the Ninja.
2) switch to the AnimTrack panel.
3) Select the node you want.
NOTE: at this moment, I only tested 1 node,
4) Click the Translate XZ-Y button.
NOTE: This button behaves the same way as moving the entity:
LMB moves node in XZ plane
MMB moves node in Y direction

You should see something similar to this screen.




5) Move Ninja around to the desired position. In this example, I moved the ninja in circle pattern.

6) Press Lock Position to store this position.

7) Repeat until you have create your animation track you want. That is, move ninja and lock its position.

NOTE: you can double click the Middle Mouse button to return the ninja to 0,0,0 position.

You should have something like this.



8) Toggle the Translate XZ-Y button. Other buttons will be enabled.

9) click the Create Anim button

10) click the Run Anim button.

You Should see the ninja following the Animation track, you just created.

11) You can press the Create Class button to create a class***Animation.py file. where *** is the Animation name.

12) The update button should be used to change the Animation name and the Length. These values are captured when the Create Anim button is pressed.

known issues
1) Once a animation track is created around a node then, you can't move the node as before. You must destroy the Animation track. You can do this by toggling the Translate XZ-Y button. I don't know another way around it.

2) This version could be buggy. I fixed a lot of bugs but a few may be there.

3) At this point orientation is not supported, that is probably next of my TODO list.

I provided a demo_testclass.py that is 'wired' to look for classtestAnimation.py. If you don't change the name of the animation i should work with the demo. Otherwise, you'll have to edit the demo.

The reason I provided a class for animation is that it is very generic. I can use it not just for the ninja, it can be used for other entities and or camera.

Comments are appreciated.

Thanks,

skorpio

17-12-2008 08:02:50

Hello,

Here is the latest version. I fixed a few bugs. The main fixes are related to getting wxPanelTracking more integrated with wxOgre.

You can create Animation tracks for all the following resources.
-- Entity
-- Particle
-- ParticleUniverse
-- Camera
-- Plane

Also when a new animation class is created, it is added to the wxPanelImport, which then, it can be imported.

Thanks,

Here is a few screen shots showing all the different node tracks available:


Here, I created an animation track for the ninja. He is moving on a square.


Here, I used the same animation for the fireSystem (ParitcleUniverse).
1) I switched to the nodefireSystem
2) I pressed the Create Anim button
3) I pressed on the Run Anim button
4) When done, I pressed on the Stop anim button


Here, I used the smoke particle


Here, I switched to the camera panel to activate this camera instead of the ones in the tool bar.



Here, I'm switching back to the animation track panel to run this animation of the camera.




Here, I messed up on the Captured position, I clicked the lock button 3 times on the same position. I changed one the Captured position to 100 in the y-position, then I pressed the Update button.



Lastly, I animated the plane, you can tell the planes moves, the plane is around the ninja's waist.

pepere

19-12-2008 13:21:54

H skorpio,
Taking a look at your screenshots I've seen that you've done a one windows application.
I suggest you to take a look at wx.aui. Basicaly you create wx.panels with widgets by functions, and thes panels are embedded inside your app and can be made floatable.
This is awesone and can make your app looks very very profesional.(and you can use it also o dual screen config!)
I can send you /help you, if you want to see some examples.
You can also take a look at wx demo app, it has a wx.aui demo that will show all the capabilities of the library!

Cheers,
Laurent

skorpio

20-12-2008 15:55:11

Hello Laurent,

Sure, please send me some examples so I can see how to build some applications. A while ago, I tried to do something with floating panels but the main wx ogre window was not getting updated as I switched between the different panels.

Best Regards,

Skorpio

mickey

31-12-2008 14:12:36

Hi

Apparently, I think I maybe a little lost. I want to see the application in action, so I downloaded one of the package - "wxOgreFramework_rev48.zip". But i'm not too sure how to run it.

I tried to run the demo_basic.py but i just get a python error (ImportError: No moduole named ogre.renderer.OGRE)

Someone can point me to a wiki or tutorials in running the app?

I just like to run the application above and would like to use the anim track editor so I was wondering if there's any pre built binaries that i can just run off the bat.

Many thanks.

ps,

I have python 3.0 installed by the way.

mickey

01-01-2009 04:35:12

Hi

I manage to run the application, if anyone wants to know these were my steps:

Install python 2.5. Installed python ogre. Installed wxWdigets (wxMSW-2.8.9-Setup.exe). Installed wxPython (wxPython2.8-win32-ansi-2.8.9.1-py25.exe).

Downloaded the latest wxOgre framework.
Downloaded the skyboxex required pack.

Edited wxOgre.py and removed the line "import Image" -> this causes error and it doesn't seem to be needed.
Edited plugins.cfg and resources.cfg and made sure the paths are correct.

Ran "python wxOgre.py"

Complicated though, requires lots of packages and steps. Anyway I hope you finish off the orientation on the track editor soon!

Happy new year everyone!

skorpio

01-01-2009 18:44:36

Hello Mickey,

Sorry about having to find out how to install it / run it.
Some of the documentation is here. It covers installation.

Please let me know if you need further assistance

Best regards,

Skorpio

skorpio

05-01-2009 07:19:23

Hello,

Here is the latest version. I added orientation to the animation track.
So the ninja also looks at, when it moves.

I used pitch, yaw and roll because it is more intuitive than quaternions.
However, key-animation uses quaternion.
So I had to do this:

node.resetOrientation()
set pitch()
set yaw()
set roll()
quat = node.getOrientation()
key.setOrientation(quat)

Please check code for further information.

I Also updated the documentation to include the latest panels.

Thanks,

skorpio

07-01-2009 05:28:42

Hello,

I started looking to port over some of the OgreODE demos.
I looked at gran tourism and scenes for some of the basic. They are bit too complicated for me since
I have not done any physics simulation. I extracted what I could, expecting the Ninja to fall to the ground. (because of gravity)
It didn't happen. If the user presses the E key. It shows the setShowDebugGeometries(). It shows the
ninja at (0, 0, 0) while the Ninja position was initialized at (100, 100, 0)).

Does anybody has any simple ogreODE that would like to share? It would be appreciated.
I'm trying to get two ninjas to walk and bump each other, or a ninja jumping, etc.

Here is the code that I got so far, feel free to modify.
Thanks,

demo_ode.py

# -----------------------------------------------------------------------------
# This code is auto generated by wxOgre
# This code is free and can be used for any purpose.
# Disclaimer: This code is provided 'as is' without warranty of any kind,
# either express or implied.
# -----------------------------------------------------------------------------

import sys
import time
import ogre.renderer.OGRE as ogre
import ogre.io.OIS as OIS
import ogre.physics.OgreOde as OgreOde

from classOgreCore import classOgreCore
from classInputManager import InputManager
from classOverlayDisplay import OverlayDisplay

class sceneApp(classOgreCore):
def _build_scene(self):
self.sm = self.root.createSceneManager(ogre.ST_GENERIC)
self.rn = self.sm.getRootSceneNode()

self.sm.setAmbientLight(ogre.ColourValue(1.000,1.000,1.000))
self.sm.setSkyBox(True, 'Sky/ClubTropicana', 5000.00)



self.cameraMain = self.sm.createCamera('cameraMain')
self.cameraMain.setPosition(0,100,500)
self.cameraMain.setNearClipDistance(15)
self.cameraMain.lookAt(ogre.Vector3(0,0,0))

self.nodecameraMain = self.rn.createChildSceneNode('nodecameraMain')
self.nodecameraMain.setPosition(ogre.Vector3(0, 100, 500))
self.nodecameraMain.attachObject(self.cameraMain)


self.viewportMain = self.renderWindow.addViewport(self.cameraMain,1,0,0,1,1)
self.viewportMain.setBackgroundColour(ogre.ColourValue(0.0,0.0,0.0))



plane = ogre.Plane()
plane.normal = ogre.Vector3(0.0,1.0,0.0)
plane.d = 0.0
mm = ogre.MeshManager.getSingleton()
mm.createPlane('planeFloor', 'General', plane, 20000.0, 20000.0,
20, 20, True, 1, 10.0, 10.0,
ogre.Vector3(0.0,0.0,1.0),
ogre.HardwareBuffer.HBU_STATIC_WRITE_ONLY,
ogre.HardwareBuffer.HBU_STATIC_WRITE_ONLY,
True, True)


self.entityFloor = self.sm.createEntity('Floor','planeFloor')
self.subentityFloor = self.entityFloor.getSubEntity(0)
self.subentityFloor.setMaterialName('Examples/RustySteel')
self.nodePlane = self.rn.createChildSceneNode('nodePlane')
self.nodePlane.setPosition(ogre.Vector3(0.0, 0.0, 0.0))
self.nodePlane.pitch(ogre.Degree(d=0.0))
self.nodePlane.yaw(ogre.Degree(d=0.0))
self.nodePlane.roll(ogre.Degree(d=0.0))
self.nodePlane.setScale(1.0, 1.0, 1.0)
self.nodePlane.attachObject(self.entityFloor)


self.entityNinja = self.sm.createEntity('Ninja','ninja.mesh')
self.nodeNinja = self.rn.createChildSceneNode('nodeNinja')
self.nodeNinja.setPosition(ogre.Vector3(100, 100, 0))
self.nodeNinja.attachObject(self.entityNinja)
self.cameraMain.setAutoTracking(False,self.nodeNinja)


## Create the ODE world
self._world = OgreOde.World(self.sm)

self._world.setGravity( (0,-9.80665,0) )
self._world.setCFM(0.0000010 )
self._world.setERP(0.8)
self._world.setAutoSleep(True)
self._world.setAutoSleepAverageSamplesCount(10)
self._world.setContactCorrectionVelocity(1.0)
self._space = self._world.getDefaultSpace()

#stepModeType = OgreOde.StepHandler.BasicStep
#stepModeType = OgreOde.StepHandler.FastStep
stepModeType = OgreOde.StepHandler.QuickStep
STEP_RATE=0.01
frame_rate = 1.0 / 60.0
max_frame_time = 1.0 / 4.0
time_scale = 1.7


self._stepper = OgreOde.ForwardFixedInterpolatedStepHandler (self._world, stepModeType,
STEP_RATE, frame_rate, max_frame_time, time_scale)


## Create a default plane to act as the ground
self._plane = OgreOde.InfinitePlaneGeometry(ogre.Plane(ogre.Vector3(0,1,0),0),self._world, self._space)
s = self.sm.createStaticGeometry("StaticFloor")
s.setRegionDimensions((600.0, 600.0, 600.0))

## Set the region origin so the center is at 0 world
s.setOrigin(ogre.Vector3().ZERO)


ei = OgreOde.EntityInformer(self.entityNinja)
self._track = ei.createStaticTriangleMesh(self._world, self._space)


InputManager.setCamera(self.input_manager,'cameraMain')
self.eventShowOverlay = OverlayDisplay(self,'Core/DebugOverlay',True)


def key_down(self,key):

if key==OIS.KC_F:
self.eventShowOverlay.start_Show()

if key==OIS.KC_E:
self._world.setShowDebugGeometries(not self._world.getShowDebugGeometries())


pass

def key_up(self, key):
pass

def frame_started(self):
pass

def frame_ended(self):
pass

def mousePressed(self, evt, btn):
pass

def mouseReleased(self, evt, btn):
pass

def mouseMoved(self, evt):
pass

def onClose(self):
pass

def main():
app = sceneApp()
while not app.renderWindow.isClosed():
ogre.WindowEventUtilities().messagePump()
if app.renderWindow.isActive():
app.render_one()
time.sleep(0.0001)
else:
time.sleep(.1)
app.shutdown()


if __name__ == "__main__":
main()


skorpio

20-01-2009 05:28:28

Hello,

I have been playing around with integrating the CEQUI. Here is what I got so far.
I have been having problems with subscribing the cegui events. I think I'm missing something.

classInputCEGUI.py

# -----------------------------------------------------------------------------
# This code is part of the wxOgre framework
# This code is free and can be used for any purpose.
# Disclaimer: This code is provided 'as is' without warranty of any kind,
# either express or implied.
# -----------------------------------------------------------------------------

import ogre.renderer.OGRE as ogre
import ogre.io.OIS as OIS
import ogre.gui.CEGUI as cegui

class InputCEGUI(object): ##classOgreCore):

##def _createGUI(self):
def __init__(self,renderWindow,SceneManager):

self.sm = SceneManager
self.renderWindow = renderWindow

# Initiaslise CEGUI Renderer
self.guiRenderer = cegui.OgreCEGUIRenderer(self.renderWindow,ogre.RENDER_QUEUE_OVERLAY, False, 3000, self.sm)

# create cegui system and log name facial.log
self.system = cegui.System(self.guiRenderer)
cegui.Logger.getSingleton().loggingLevel = cegui.Insane

# Load Cegui Scheme
cegui.SchemeManager.getSingleton().loadScheme("TaharezLookSkin.scheme")
self.system.setDefaultMouseCursor("TaharezLook", "MouseArrow")
self.system.setDefaultFont("BlueHighway-12")

# Load Layout
sheet = cegui.WindowManager.getSingleton().loadWindowLayout("facial.layout", False)
self.system.setGUISheet (sheet)
sheet.enabled=True
self._subscribeEvents()

def _subscribeEvents(self):
wmgr = cegui.WindowManager.getSingleton()


def cegui_reldim (self, x ) :
return cegui.UDim((x),0)

def createUVector2(self, x, y):
return cegui.UVector2(cegui.UDim(x,0), cegui.UDim(y,0))

def convertOISMouseButtonToCegui(self, buttonID):
if buttonID ==0:
return cegui.LeftButton
elif buttonID ==1:
return cegui.RightButton
elif buttonID ==2:
return cegui.MiddleButton
elif buttonID ==3:
return cegui.X1Button
else:
return cegui.LeftButton



def keyPressed(self, key):
cegui.System.getSingleton().injectKeyDown(key) ##( evt.key )
cegui.System.getSingleton().injectChar(key) ##( evt.text )

def keyReleased(self, key):
cegui.System.getSingleton().injectKeyUp(key) ###( evt.key )

def mouseMoved(self, evt):
cegui.System.getSingleton().injectMouseMove( evt.get_state().X.rel, evt.get_state().Y.rel )

def mousePressed(self, evt, button):
cegui.System.getSingleton().injectMouseButtonUp(self.convertOISMouseButtonToCegui(button))
return True

def mouseReleased(self, evt, button):
cegui.System.getSingleton().injectMouseButtonDown(self.convertOISMouseButtonToCegui(button))
return True




demo_cegui.py

# -----------------------------------------------------------------------------
# This code is auto generated by wxOgre
# This code is free and can be used for any purpose.
# Disclaimer: This code is provided 'as is' without warranty of any kind,
# either express or implied.
# -----------------------------------------------------------------------------

import sys
import time
import ogre.renderer.OGRE as ogre
import ogre.io.OIS as OIS
from classOgreCore import classOgreCore
from classInputCEGUI import InputCEGUI

class sceneApp(classOgreCore):
def _build_scene(self):
self.sm = self.root.createSceneManager(ogre.ST_GENERIC)
self.rn = self.sm.getRootSceneNode()

self.sm.setAmbientLight(ogre.ColourValue(1.000,1.000,1.000))

self.cameraMain = self.sm.createCamera('cameraMain')
self.cameraMain.setPosition(0,100,500)
self.cameraMain.setNearClipDistance(15)
self.cameraMain.lookAt(ogre.Vector3(0,0,0))

self.nodecameraMain = self.rn.createChildSceneNode('nodecameraMain')
self.nodecameraMain.setPosition(ogre.Vector3(0, 100, 500))
self.nodecameraMain.attachObject(self.cameraMain)


self.viewportMain = self.renderWindow.addViewport(self.cameraMain,1,0,0,1,1)
self.viewportMain.setBackgroundColour(ogre.ColourValue(0.0,0.0,0.0))


self.entityNinja = self.sm.createEntity('Ninja','ninja.mesh')
self.nodeNinja = self.rn.createChildSceneNode('nodeNinja')
self.nodeNinja.setPosition(ogre.Vector3(100, 0, 0))
self.nodeNinja.attachObject(self.entityNinja)
self.cameraMain.setAutoTracking(False,self.nodeNinja)

self.eventcegui = InputCEGUI(self.renderWindow,self.sm)

def key_down(self,key):
self.eventcegui.keyPressed(key)
pass

def key_up(self, key):
self.eventcegui.keyReleased(key)
pass

def frame_started(self):
pass

def frame_ended(self):
pass

def mousePressed(self, evt, btn):
self.eventcegui.mousePressed(evt,btn)
pass

def mouseReleased(self, evt, btn):
self.eventcegui.mouseReleased(evt,btn)
pass

def mouseMoved(self, evt):
self.eventcegui.mouseMoved(evt)
pass

def onClose(self):
pass

def main():
app = sceneApp()
while not app.renderWindow.isClosed():
ogre.WindowEventUtilities().messagePump()
if app.renderWindow.isActive():
app.render_one()
time.sleep(0.0001)
else:
time.sleep(.1)
app.shutdown()


if __name__ == "__main__":
main()



resources.cfg

FileSystem=../cegui/datafiles/configs
FileSystem=../cegui/datafiles/imagesets
FileSystem=../cegui/datafiles/looknfeel
FileSystem=../cegui/datafiles/fonts
FileSystem=../cegui/datafiles/layouts
FileSystem=../cegui/datafiles/schemes
FileSystem=../cegui/v061



http://www.mediafire.com/file/ganz5mtnh ... _cegui.jpg


Best Regards,

Skorpio

dermont

23-01-2009 04:37:28

Take a look at the CEGUI demos there are numerous examples of event handling via subscribeEvent, including the demo you are working on Demo_CEGUI_Facial.

Also since you appear to be loading everything from xml , you may want to read the following post regarding assigning events from a .layout file via a ScriptModule.

http://groups.google.com/group/python-o ... 428446da00

skorpio

25-01-2009 09:16:37

Hello,

This released includes some interesting preliminary work.
I started by trying to integrage ODE, unsuccessfully.
Then, I partially integrated CEQUI. (See previous postings)

Here I got the basic for creating a server/client pair:
It is based on python twisted implementation.
http://www.artima.com/weblogs/viewpost. ... ead=156396

Then I read something on twisted and ogre-python integration.
viewtopic.php?f=3&t=7595

I followed the instructions but the coiterate did not work
as I thought. So I modified the code a little.

After that, most of the code integrated ok, All the previous
demos and classes worked. The ogre app seems to lock when
it runs for the first time. Give it a few seconds and it will start rendering
frames correctly. I think the frames are queued up somewhere.

The basic idea of this demo is to report the position of the ninja.
back to the server.The server acks the message and Ninja moves.

In a network game, it is necessary to broadcast the position
to the rest of the players or a command to update client's position.

On the client side, a fifo is created. The request to goes to
the server and the client pushed the request into the fifo.
Once the server responds, the client pops the fifo and it moves the ninja,
thus synchronization is maintained.

The Fifo code came from here:
http://code.activestate.com/recipes/68436/

Other implementation may be possible, this is just one of many.

The code is Work In Progress (WIP). I'm hoping this posting generates
some interest to start setting the basis for some kind of user-friendly
game engine. The CEGUI and the ODE needs more work,
camera needs more work. I really like the way the camera works on lineageII.
Trying to replicate it, is a lot harder.

I used some of the classes used by the some of the other demos such
as animation and music.

How to

Install twisted if you don't have it. http://twistedmatrix.com/trac/
Run demo_twisted_server.py first.
Run demo_twisted_client.py

Use mouse wheel to adjust camera.
Remember, that python-ogre seems to lock sometimes, just wait...
Use the UP,DOWN, LEFT, RIGHT keys.
You have to press the keys every time you want the ninja to move.

Thanks,

skorpio

02-02-2009 08:00:35

Hello,

I just found a bug when loading XML files:
The wxPanel tracking list was not getting updated.
Please update your code with this patch, just replace def _PopulateFromXML()

wxOgre.py


def _PopulateFromXML(self, filename):
ogreXmlRd = XmlFileReader(filename, 'r',self.ogreWin.sm)

standList = ogreXmlRd._ProcessStand()
self.buildTreeFromXmlStand(standList)

importlist = ogreXmlRd._ProcessImport()
self.buildTreeFromXmlImport(importlist)

skyplaneList, skydomeList, skyboxList, fogList = ogreXmlRd._ProcessXmlEnvironment()
self._ShowAmbientColor()

self.buildTreeFromXmlSkyplane(skyplaneList)
self.buildTreeFromXmlSkydome(skydomeList)
self.buildTreeFromXmlSkybox(skyboxList)
self.buildTreeFromXmlFog(fogList)

ogreXmlRd._ProcessXmlLights()
self.buildTreeFromXmlLight(self.ogreWin.sm)

planeList = ogreXmlRd._ProcessPlanes()
self.buildTreeFromXmlPlane(planeList)

entitystructList = ogreXmlRd._ProcessXmlEntities()
self.buildTreeFromXmlEntity( entitystructList )

camnamelist,camlookatlist,camautotrackstatelist,camautotracknodelist = ogreXmlRd._ProcessXmlCameras()
self.buildTreeFromXmlCamera(camnamelist,camlookatlist,camautotrackstatelist,camautotracknodelist)

viewlist, viewattachDict, viewbkgcolorDict, viewportzorderDict, viewportdimensionDict = ogreXmlRd._ProcessViewPorts()
self.buildTreeFromXmlViewport(viewlist,viewattachDict,viewbkgcolorDict,viewportzorderDict,viewportdimensionDict)

#update camera/vieport attachment.
self.wxPanelCamera._OnExternalCameraLoadViewPort(viewlist,viewattachDict)
self.wxPanelViewport._OnExternalLoadCamera(camnamelist)

count = len(entitystructList)
entitylist=[]
for i in range(0,count):
entitylist.append (entitystructList[i].attach)
#print entitystructList[i].attach
self.wxPanelCamera._OnExternalLoadNode(entitylist)

self.wxPanelTracking._OnExternalLoadNode(entitylist)

count = len(camnamelist)
camnodelist=[]
for i in range(0,count):
name = 'node' + camnamelist[i]
camnodelist.append (name)

self.wxPanelTracking._OnExternalLoadNode(camnodelist)

self.particleList = ogreXmlRd._ProcessXmlParticles()
self.buildTreeFromXmlParticle(self.particleList)

self.particleUniverseList = ogreXmlRd._ProcessXmlParticleUniverse()
self.buildTreeFromXmlParticleUniverse(self.particleUniverseList)

eventlist = ogreXmlRd._ProcessEvents()
bindkeylist = ogreXmlRd._ProcessBindings()
proclist = ogreXmlRd._ProcessProcess()
self.buildTreeFromXmlEvent(eventlist,bindkeylist,proclist)
self._settittle(filename)


Thanks,

Danaugrs

02-02-2009 12:29:36

Great idea!
I have used wxpython in the past - it is so much better than tk. :)

Maybe you guys have heard that Nokia has made QT opensource (LGPL if I remember correctly)?
Probably wxWidgets will loose a lot of popularity, though I particularly like it.
I never tried QT, besides some demos, it is really interesting.
There has been some trouble because there was a pyQT, but with the older licence:
probably someone will have to take over and develop a new pyQT with the new license,
or the old pyQT guy will update it... This still going to take some time,
but QT might get to be a real standard for mobile phones embedded systems in general.

wxOgre - I have seen it in some of the python demos a while ago I guess - the fish swimming around right?
A very nice scene editor could be made with it I guess :D

Keep up the good work,
Danaugrs

skorpio

10-02-2009 05:40:43

Hello Danaugrs,

It has been a challenge. Porting wxOgre to QT shouldn't be too difficult since for the most
part, the GUI is separated from the ogre handling functions. Right now, I'm focusing on
getting some generic tools that can be used to create cool projects. I'm working on trying
to develop a game engine. It is pretty basic at this point but this week I made a lot of
progress.

I updated the demo_twisted_client.py. If the file is called with no argument, it defaults
to running without the server, but if you add 'server' as an argument you get the client
to run. Of course, you need the server side to run first.

I modified input manager and ogre_core, mostly to add support new features like
mouse mode. I finally got around to implement to camera behavior that I want it for
my game.
if cammode =1 then the camera behaves as usual.
if cammode=2 then the camera behaves as detailed below
if cammode=3 then it is similar to 2

cammode=2
-LMB, the user moves camera, in XZ plane and locks this position as its pivot-point.
-Mouse Wheel zooms the camera in and out.
-RMB rotates camera around pivot point.Pitch is allowed from -80deg to 80deg. (Adjustable).
It also moves the camera along the z-axis from -5000 to 5000. (Adjustable).

cammode=3
-LMB moves the camera and the character in the direction the camera is pointing. The camera tracks the player and keeps its distance.
-Mouse Wheel zooms the camera in and out. As the camera gets close to the character, it fades out.
-RMB rotates camera around pivot point.Pitch is allowed from -80deg to 80deg. (Adjustable).
It also moves the camera along the z-axis from 150 to 200. (Adjustable).
These settings give a good view, and camera movement.

Also, the CEGUI is out and Hikari is in. It works much better (interface-wise) than CEGUI.
I tried creating my own menus, they would run under their environment but not with python-ogre.
So, I decided to switch.

Also I figured out how to attach a particle-node to the ninja node, I would rather try to attach it to the bone on
the hand, but all the code-snippets that I tried, none of them work.

Here are some to things I tried. Check this link too.
http://www.ogre3d.org/forums/viewtopic.php?f=2&t=34737



skel = self.entityNinja.getSkeleton()
anim = skel.getAnimation("Walk")
self.boneWaist = skel.getBone("Joint4")
#node = self.boneWaist.getParent()

#pos = self.entityNinja._getParentNodeFullTransform() * self.boneWaist._getDerivedPosition();
#print " *** skeleton -bone pos"
#print pos
##Ogre::Quaternion neckBoneWorldOrientation = ent->getParentSceneNode()->getWorldOrientation() * neckBone->getWorldOrientation();

## Billboard
#bbs = self.sm.createBillboardSet("b1");
#bbs.setDefaultDimensions(0.25, 0.25);
#bbs.setMaterialName("Examples/Flare");
#bbs.createBillboard(0,0,0, ogre.ColourValue(0.0,1.0,0.0));
#tp = self.entityNinja.attachObjectToBone("Joint4", bbs);

##// Trail
#trail = self.sm.createRibbonTrail("rib");
#trail.setMaterialName("Examples/LightRibbonTrail");
#trail.setTrailLength(50);
#trail.setMaxChainElements(40);
#trail.setInitialColour(0, 0.2, 1.0, 0.3);
#trail.setColourChange(0, 0.5, 0.5, 0.5, 0.5);
#trail.setInitialWidth(0, 0.1);
#trail.addNode(tp);
#self.sm.getRootSceneNode().attachObject(trail);
#self.nodeNinja.attachObject(trail);



Twisted
This part when through a few changes, mainly to handle the characters position.
Right now, it just informs the server that it is moving. It will send orientation and position so
that the server knows where it is. Also, It would like to improve the little things such as.

1) As the ninja rotates, it should do it smoothly no abruptly.
2) the camera should avoid collisions with objects.
3) there should be an idle-walk-idle transition. I'm thinking about toggling the LMB.
you get tire clicking the mouse to get the ninja to move.

To Do
I'll be working on some SWF to do buttons, etc such as login, create character, health bar, weapons inventory.
I would like to fix locking that happens when twisted-client runs under the server.
Also, the node tracking for the hand would be nice, So that the particle moves with the hand.
Collision detection,
camera collision, etc,


Thanks,
Skorpio


Ninja with camera pivoting around it. Also jet-particle attached to ninja node. It moves when the ninja does.


Fading of ninja. Some of the stuff it is not visible. such as the particle. But it is a nice thing to have

skorpio

13-02-2009 17:06:27

Hello,

I thought about toggling between walk-idle whenever I click the mouse.
I think I want to try something that I have seen before.
The user moves the mouse to where he wants to go,
then it presses the LMB and a particle-ball shoots and lands at
the required position.
Then the node moves to that position.

It is very effective. However, I'm not sure how to implement it.
I believe it has something to do with ogre-ray.

Any suggestions?

-Skorpio

skorpio

24-02-2009 07:11:48

Hello,

I just found out about this project. It is called the "Player Demo".
It is from the creator of Hikari.

It has a lot of the same components that I intend to develop:
-chat window
-the character moves when the user clicks the left-mouse-button.(notice the 4 white circles on the ground)
-the character moves from idle to walk.
-network interface. I would use twisted instead of

http://www.ogre3d.org/forums/viewtopic.php?f=11&t=46020


I tried to use the chat.swf and login.swf but when I load them
there are no buttons. I tried flash 8 and I can't open these files.
I don't know how to pythonize this. Help is appreciated.

I'm working on some re-structuring and cleaning up of the twisted apps.
I moved to python-ogre 1.6.1 successfully.

Best regards,
Skorpio

skorpio

14-03-2009 10:42:46

Hello,

Here is the latest version of wxOgre Framework. Time has been scarce but this project has not been abandoned (yet).
I see that there is a new Addon project called Ogitor. It seems to similar structure and goals to this project. So, I wonder if
there a purpose to trying to improve wxOgre any further.

My original thought, and the reason for sharing the code here, was too encourage participation so that the project
can move forward faster.

Anyway, the code has been recompiled under 1.6.1 and patch. There were some changes related to,
including QuickGUI. If you are keeping score, I started with CEQUI, then Hikari, which I'm abandoning because I could never
get anything to work. So Hikari is out and QuickGUI is in. It has worked so far and it runs very well.

As usual, I created a class that is called from the demo. Any user can create its own class and called it from their demo.
In the example, I just used some progress bar, buttons and text bar.

The demo_twisted_client.py has a lot of improvement. The ninja is able to 'walk' to a selected point. The destination
is created by clicking on the plane with the left-mouse button. It also rotates to the direction it needs to move.
The camera follows the ninja and can move around it. The mouse wheel also zooms in and out.
Right now, I'm using the Axis to indicate the destination, a nicer marker can be created, if only days were 25hrs long

It would be nice to make the ninja rotate slowly instead of making abrupt changes.
Also when focus is given to the text box, the user clicks and the ninja moves. I think this is related to QuickGUI.
I played a little bit with the terrain.cfg. It would be great to use this instead of a flat plane. However, the
terrain manager seem to use small maps and everything needs to be reduce to the size of ants. I really don't like that.
It would be nice to give the character a name and have it display above his head.
I'm looking into adding some kind of physics engine.


Best Regards,

Skorpio



demo_twisted_client.py


Buttons move the bar. Text box accepts characters



Rev52
http://www.mediafire.com/file/0todozka1 ... _rev52.zip

Documentation REV3
http://www.mediafire.com/file/dwozmyzf1 ... l_rev3.zip

PATCHES
Skyboxes (3.3Meg)
http://www.mediafire.com/file/dqotmdxydoc/SkyBoxes.zip

Here is the dragon character

skorpio

15-03-2009 01:04:50

Hello,

Thanks to KungfuMasta, another bugs was squashed. Here is the patch.

In demo_twisted_client.py, the code from MouseReleased needs to be moved to MousePressed


def mousePressed(self, evt, btn):
state = self.eventQgui.mousePressed(evt,btn)
print state
if state == True:
return
ms = self.input_manager.mouse.getMouseState()
.....


The inject function returns True if it is used by the QuickGui and false otherwise.
So, here we don't move the character when the user clicks on the text box.

classQgui.py needs to change to return the state from the inject.

def mousePressed(self, evt, id):
#print id
b = gui.MouseButtonID.values[id]
state = self.mGUIManager.injectMouseButtonDown(b)
return state


In a nutshell, classInputManager calls the app, the app calls the classQgui, and we intercept the event.

- Skorpio

skorpio

23-03-2009 06:57:35

Hello,

I started to play around with moving a light, so I attached it to a node.
However the light doesn't seem to move with the node. I'm not sure
what is happening here. Any ideas?

self.light0 = self.sm.createLight( 'light0')
self.light0.setPosition ( ogre.Vector3(0.0, 0.0, 0.0) )
self.light0.setDiffuseColour ( ogre.ColourValue(1.0,0.0,0.0) )
#self.light0.setSpecularColour ( ogre.ColourValue(1.0,0.0,0.0) )
##self.light0.setDiffuseColour ( ogre.ColourValue(0.753,0.753,0.753) )
#self.light0.setType(ogre.Light.LT_POINT)
#self.light0.setCastShadows=True



self.node_light0 = self.rn.createChildSceneNode('node_light0')
self.node_light0.setPosition(ogre.Vector3(0,100, 0))
self.node_light0.pitch(ogre.Degree(d=0.0))
self.node_light0.yaw(ogre.Degree(d=0.0))
self.node_light0.roll(ogre.Degree(d=0.0))
self.node_light0.setScale(1.0, 1.0, 1.0)
self.node_light0.attachObject(self.light0)

Then I used wxOgre to create an animation for it

Thanks,

-skorpio

SomeFusion

23-03-2009 09:34:37

I can remember having a similar problem with my editor. I think the problem could be that you first set the lightposition to 0,0,0.
Then you set the light node to 0,100,0. After that you attach the light to the node. I think the light is still at position 0,0,0.
The light moves with the node, but propably not where you expect.

Try to set the light position also to 0,100,0 and it should work. Or don't set the lightposition at all and attach the light to the node before you set the node position.

skorpio

25-03-2009 07:45:41

Hello,

Thanks for the tip about the light. I'm evaluating right now.
Also. It seems that light shines ok on top of meshes but not the plane.
Any ideas?

Skorpio

majadi

21-05-2009 08:33:59

hello, is this project still available? is there an SVN? all the links are expired. thank you

skorpio

23-05-2009 23:50:16

Hello Majadi,

Yes, the project still available. I have not had time to work on it lately.
The project started as way to take advantage of all the OGRE resources, to create
scenes easily. Now, I'm trying to use wxOgre to generate a game framework.

May I ask, what is it you are looking for?

Best regards,

Skorpio

skorpio

07-06-2009 08:02:30

Hello,

Here is the latest version. It has a few updates, mostly minor changes and bugs that were found along the way.
Thanks to Dermont for helping with the video mode code!


Double click the available video mode to update Height and Width. Don't forget to click "update All"



Double click the available skyplane. It updates the material box, then press the "Create Skyplane":



Double click the available skybox. It updates the material box, then press the "Create Skybox":



There seem to be no real way to name material that are associated to Skydomes. But new Skydome could have 'Skydome' in the name
so they can be identified and parsed by the code as shown.

Best Regards,

Skorpio

Framework_rev53

skorpio

09-06-2009 09:06:29

Hello,

I would like to discuss the next addition to wxOgre: Motion Capture.
Currently, there is no easy way to add new animation to any of the skeleton based meshes.
Personally, I use Blender to import XML files, then move the bones to create a new animation,
export animation back to *.mesh. All of this is very tedious process.

The following image explains an easy way to create new animations.



Import Path
1) Find a *.skeleton file and use OgreXMLCoverter to generate an *.skeleton.xml
2) Convert *.skeleton.xml into wxOgre XML format
3) Import new XML. Use wxOgre to move the bones and store its position and orientation
4) Create/test a new animation
5) Store new animation into wxOgre XML format.
or
1) Import existing motion capture files by creating Python apps to translate this formats into wxOgreXML format

Export Path.
1) Store new animation into wxOgre XML format.
2) Use converter written in Python to convert wxOGre XML to Ogre-Skeleton-XML
The purpose here is to add and improve animations.
3) Use OgreXMLConverter.EXE to generate *.skeleton file.
4) Use *.skeleton as usual.

Moving Bones
Ogre allows bones to be moved manually, So basically, you need to load a mesh
with skeleton and then move the bone. Next the movement gets captured.
Once the desire animation is complete, it can be tested by creating a Frame Animation.

Here is a sample code for moving a bone. It creates a simple scene with a ninja
The motion for the bone is encoded like this:

txt = "0,0,0:0,0,0"
self.capturedList.append(txt)

The bone is selected from the table below and self.nodeListIndex is updated accordingly.
self.nodeListIndex = 3

#index, name, realname
# 0 Joint1 ninja, itself
# 1 Joint2 ninja, itself
# 2 Joint3 torso,lower
# 3 Joint4 torso,waist


# -----------------------------------------------------------------------------
# This code is auto generated by wxOgre
# This code is free and can be used for any purpose.
# Disclaimer: This code is provided 'as is' without warranty of any kind,
# either express or implied.
# -----------------------------------------------------------------------------

import sys
import time
import ogre.renderer.OGRE as ogre
import ogre.io.OIS as OIS
from classOgreCore import classOgreCore
from classInputManager import InputManager

class sceneApp(classOgreCore):
def _build_scene(self):
self.sm = self.root.createSceneManager(ogre.ST_GENERIC)
self.rn = self.sm.getRootSceneNode()

self.sm.setAmbientLight(ogre.ColourValue(1.000,1.000,1.000))
self.sm.setSkyDome(True, 'Examples/CloudySky',10.00, 10.00, 4000.00)



self.camera0 = self.sm.createCamera('camera0')
self.camera0.setPosition(0.0,100.0,300.0)
self.camera0.setNearClipDistance(5.0)
self.camera0.setFarClipDistance(10000.0)

self.nodecamera0 = self.rn.createChildSceneNode('nodecamera0')
self.nodecamera0.setPosition(ogre.Vector3(0.0, 0.0, 0.0))
self.nodecamera0.yaw(ogre.Degree(d=0.000))
self.nodecamera0.pitch(ogre.Degree(d=0.000))
self.nodecamera0.roll(ogre.Degree(d=0.000))
self.nodecamera0.setScale(1.000, 1.000, 1.000)
self.nodecamera0.attachObject(self.camera0)


self.viewport0 = self.renderWindow.addViewport(self.camera0,1,0.00,0.00,1.00,1.00)
self.viewport0.setBackgroundColour(ogre.ColourValue(0.000,0.000,0.000))


plane = ogre.Plane()
plane.normal = ogre.Vector3(0,1,0)
plane.d = 0
mm = ogre.MeshManager.getSingleton()
mm.createPlane('plane_0', 'General', plane, 20000, 20000,
20, 20, True, 1, 100, 100,
ogre.Vector3(0,0,1),
ogre.HardwareBuffer.HBU_STATIC_WRITE_ONLY,
ogre.HardwareBuffer.HBU_STATIC_WRITE_ONLY,
True, True)

self.entityentityplane_0 = self.sm.createEntity('entityplane_0','plane_0')
self.subentityentityplane_0 = self.entityentityplane_0.getSubEntity(0)
self.subentityentityplane_0.setMaterialName('Examples/RustySteel')
self.nodeentityplane_0 = self.rn.createChildSceneNode('nodeentityplane_0')
self.nodeentityplane_0.setPosition(ogre.Vector3(0.0, 0.0, 0.0))
self.nodeentityplane_0.yaw(ogre.Degree(d=0.000))
self.nodeentityplane_0.pitch(ogre.Degree(d=0.000))
self.nodeentityplane_0.roll(ogre.Degree(d=0.000))
self.nodeentityplane_0.setScale(1.000, 1.000, 1.000)
self.nodeentityplane_0.attachObject(self.entityentityplane_0)

self.entityninja_1 = self.sm.createEntity('ninja_1','ninja.mesh')
self.subentityninja_1 = self.entityninja_1.getSubEntity(0)
self.subentityninja_1.setMaterialName('Examples/Ninja')
self.subentityninja_1 = self.entityninja_1.getSubEntity(1)
self.subentityninja_1.setMaterialName('Examples/Ninja')
self.nodeninja_1 = self.rn.createChildSceneNode('nodeninja_1')
self.nodeninja_1.setPosition(ogre.Vector3(0.0, 0.0, 0.0))
self.nodeninja_1.yaw(ogre.Degree(d=0.000))
self.nodeninja_1.pitch(ogre.Degree(d=0.000))
self.nodeninja_1.roll(ogre.Degree(d=0.000))
self.nodeninja_1.setScale(1.000, 1.000, 1.000)
self.nodeninja_1.attachObject(self.entityninja_1)


InputManager.setCamera(self.input_manager,'camera0')


animationNames=[]
animSet = self.entityninja_1.getAllAnimationStates()
iterator = animSet.getAnimationStateIterator()

while iterator.hasMoreElements() :
anim = iterator.getNext()
# store each animation name in a list
animationNames.append(anim.getAnimationName())

print animationNames



self.nodeList=[]
pSkeleton = self.entityninja_1.getSkeleton()
BoneIter = pSkeleton.getBoneIterator()
ii = 0
while BoneIter.hasMoreElements():
pBone = BoneIter.getNext()
pBone.setManuallyControlled(True)

name = pBone.getName()
#parent = pBone.getParent()
#print name, parent

pos = pBone.getPosition()
ori = pBone.getOrientation()

print str(ii), name, pos, ori

self.nodeList.append(pBone)
ii = ii + 1

self.CreateKeyFrameAnimation()



def CreateKeyFrameAnimation(self):

#self.animationList=[]
self.capturedList =[]

txt = "0,0,0:0,0,0"
self.capturedList.append(txt)

txt = "0,0,0:0,45,0"
self.capturedList.append(txt)

txt = "0,0,0:0,90,0"
self.capturedList.append(txt)

txt = "0,0,0:0,135,0"
self.capturedList.append(txt)

txt = "0,0,0:0,225,0"
self.capturedList.append(txt)

txt = "0,0,0:0,0,0"
self.capturedList.append(txt)

print self.capturedList


print 'Creating Animation'
self.animationName = "TorsoMovement"
self.animationTime = 5.0

self.nodeListIndex = 3

#index, name, realname
# 0 Joint1 ninja, itself
# 1 Joint2 ninja, itself
# 2 Joint3 torso,lower
# 3 Joint4 torso,waist
# 4 Joint5 torso,upper
# 5 Joint6 torso, chest
# 6 Joint7 neck, exorcist
# 7 Joint8 neck 2
# 8 Joint9 right clavicula
# 9 Joint10 right shoulder
# 10 Joint11 right, elbow
# 11 Joint12 right, wrist
# 12 Joint13 sword
# 13 Joint29 ????
# 14 Joint14 left. clav
# 15 Joint15 left. shoulder
# 16 Joint16 left. elbow
# 17 Joint17 left. wrist
# 18 Joint18 right. upper leg
# 19 Joint19 right. knee
# 20 Joint20 right. ankle
# 21 Joint21 right. foot
# 22 Joint22 ???
# 23 Joint23 left. upper leg
# 24 Joint24 left. knee
# 25 Joint25 left. ankle
# 26 Joint26 left. foot
# 27 Joint27



self.node = self.nodeList[self.nodeListIndex]

# set up spline animation of node
self.animation = self.sm.createAnimation(self.animationName, self.animationTime)
self.animation.interpolationMode = ogre.Animation.IM_SPLINE

self.entry = self.capturedList[0]
pos, quat = self.entry.split(':')

x,y,z = pos.split(',')
posx = float(x)
posy = float(y)
posz = float(z)
self.node.setPosition(posx,posy,posz)

p,y,r = quat.split(',')
pitch = float(p)
yaw = float (y)
roll = float (r)

self.node.resetOrientation()
self.node.yaw(ogre.Degree(d=yaw))
self.node.pitch(ogre.Degree(d=pitch))
self.node.roll(ogre.Degree(d=roll))
scale = self.node.getScale()


self.track = self.animation.createNodeTrack(0, self.node)

self.animationTimeStart = 0.0
count = len(self.capturedList)
self.interval = self.animationTime/count

for index in range (0,count):

self.animationTimeStart = self.animationTimeStart + self.interval
self.key = self.track.createNodeKeyFrame(self.animationTimeStart)

self.entry = self.capturedList[index]
pos, quat = self.entry.split(':')
print self.entry

x,y,z = pos.split(',')
posx = float(x)
posy = float(y)
posz = float(z)
self.key.setTranslate(ogre.Vector3(posx,posy,posz))

p,y,r = quat.split(',')
pitch = float(p)
yaw = float (y)
roll = float (r)

self.node.resetOrientation()
self.node.yaw(ogre.Degree(d=yaw))
self.node.pitch(ogre.Degree(d=pitch))
self.node.roll(ogre.Degree(d=roll))

quaternion = self.node.getOrientation()
self.key.setRotation(quaternion)
self.key.setScale(scale)

self.animationState = self.sm.createAnimationState(self.animationName)
self.animationState.Enabled = True
self.animationState.Loop = True


def key_down(self,evt):
pass

def key_up(self, evt):
pass

def frame_started(self):
pass

def frame_ended(self):

self.animationState.addTime(0.001)
pass

def mousePressed(self, evt, btn):
pass

def mouseReleased(self, evt, btn):
pass

def mouseMoved(self, evt):
pass

def onClose(self):
pass


def main():
app = sceneApp(fullscreen=False,width=640,height=480)
while not app.renderWindow.isClosed():
ogre.WindowEventUtilities().messagePump()
if app.renderWindow.isActive():
app.render_one()
time.sleep(0.0001)
else:
time.sleep(.1)
app.shutdown()


if __name__ == "__main__":
main()




Capturing Bone Movement and Mocap Systems

wxOgre will allow the user to move one bone at a time by using two buttons: Position and Orientation.
This approach can be very time consumming. But, wxOgre will provide the ability to use
other motion capture system to move more than one bone at a time.

People have use the wii controller to capture motion, others the iphone, there are cameras
and other systems. So this is very open for other collaborators to participate.


To do
1) Define an XML format for storing new animation. It will be very similar to Ogre.Skeleton.XML format. Maybe easier to read.

2) I will implement the basic Panel for wxOgre that can detect skeleton resources, load the bones
into a listbox. From the listbox, the user can select a bone to move. Then the movement will be captured.
This code is very similar to the wxPanelTracking but intead of moving Meshes, it will move bones.

I'm not sure that I will fully implement the export and import path but I will store new animations to an wxOgre XML file,
so that all that hard work is not lost. So, please feel free to cooperate here:

Carnegie University has a large database of motion captured files that can be imported.
Python apps to convert wxOGre XML files to Ogre.Skeleton.XML
Python apps to convert Ogre.Skeleton.XML to wxOGre XML
Add mocap capabilities.


Here are some useful links
http://en.wikipedia.org/wiki/Motion_capture

http://www.youtube.com/watch?v=0CUkcc6Sf2g

This link contains many motion capture files.
http://mocap.cs.cmu.edu/


Best Regards,

Skorpio

skorpio

10-06-2009 07:36:49

Hello,

Here is sample code of an Ogre.Skeleton.XML that relates to animations.



<animation name="Attack2" length="1.16667">
<tracks>
<track bone="Joint1">
<keyframes>
<keyframe time="0">
<translate x="0" y="-14.8238" z="0" />
<rotate angle="0">
<axis x="1" y="0" z="0" />
</rotate>
</keyframe>
<keyframe time="0.25">
<translate x="0" y="-10.5884" z="0" />
<rotate angle="0">
<axis x="1" y="0" z="0" />
</rotate>
</keyframe>
<keyframe time="1.08333">
<translate x="0" y="-14.8238" z="0" />
<rotate angle="0">
<axis x="1" y="0" z="0" />
</rotate>
</keyframe>
</keyframes>
</track>
</tracks>
</animation>


I'm proposing these options for wxOgre XML format:

Option 1 very similar to original format

<animation animname="Attack2" nodename="" time="1.16667">
<bone name= "Joint1" keyframe="0.000" position="0,5,-5" orientation="0.000,0.000,0.000"/>
<bone name= "Joint1" keyframe="0.250" position="0,5,-402" orientation="0.000,0.000,0.000"/>
<bone name= "Joint1" keyframe="1.083" position="-13,5,-3050" orientation="0.000,37.000,0.000"/>

<bone name= "Joint2" keyframe="0.000" position="0,5,-5" orientation="0.000,0.000,0.000"/>
<bone name= "Joint2" keyframe="0.250" position="0,5,-402" orientation="0.000,0.000,0.000"/>
<bone name= "Joint2" keyframe="1.483" position="-13,5,-3050" orientation="0.000,37.000,0.000"/>
</animation>


Option 2, timing will be derived from total time/number of entries. So keyframe time would be 1.6667/3

<animation animname="Attack2" nodename="" time="1.16667">
<bone name= "Joint1" position="0,5,-5" orientation="0.000,0.000,0.000"/>
<bone name= "Joint1" position="0,5,-402" orientation="0.000,0.000,0.000"/>
<bone name= "Joint1" position="-13,5,-3050" orientation="0.000,37.000,0.000"/>

<bone name= "Joint2" position="0,5,-5" orientation="0.000,0.000,0.000"/>
<bone name= "Joint2" position="0,5,-402" orientation="0.000,0.000,0.000"/>
<bone name= "Joint2" position="-13,5,-3050" orientation="0.000,37.000,0.000"/>
</animation>


Option 3. Animations are timed-grouped

<animation animname="Attack2" nodename="" time="1.16667">
<key time="0" name= "Joint1" position="0,5,-5" orientation="0.000,0.000,0.000"/>
<key time="0" name= "Joint2" position="0,5,-5" orientation="0.000,0.000,0.000"/>

<key time="0.25" name= "Joint1" position="0,5,-5" orientation="0.000,0.000,0.000"/>
<key time="0.25" name= "Joint2" position="0,5,-5" orientation="0.000,0.000,0.000"/>

<key time="0.6" name= "Joint3" position="0,5,-5" orientation="0.000,0.000,0.000"/>

<key time="0.863" name= "Joint5" position="0,5,-5" orientation="0.000,0.000,0.000"/>
<key time="0.863" name= "Joint1" position="0,5,-5" orientation="0.000,0.000,0.000"/>

</animation>


Option 4. Animations are timed-grouped but time is indexed separately so it can be changed easily

<animation animname="Attack2" nodename="" time="1.16667" timeidex="0,0.25,0.6,0.863">
<key time="0" name= "Joint1" position="0,5,-5" orientation="0.000,0.000,0.000"/>
<key time="0" name= "Joint2" position="0,5,-5" orientation="0.000,0.000,0.000"/>

<key time="1" name= "Joint1" position="0,5,-5" orientation="0.000,0.000,0.000"/>
<key time="1" name= "Joint2" position="0,5,-5" orientation="0.000,0.000,0.000"/>

<key time="2" name= "Joint3" position="0,5,-5" orientation="0.000,0.000,0.000"/>

<key time="3" name= "Joint5" position="0,5,-5" orientation="0.000,0.000,0.000"/>
<key time="3" name= "Joint1" position="0,5,-5" orientation="0.000,0.000,0.000"/>

</animation>



From the point of view of a MoCap system the sampling time is constant. Let' say ~40Hz
So every 1/40th of second, all the bones are sampled, their position and orientation are saved.
The keyframe time is more or less constant. The number of entries (bone) will be fixed, it is
determined by the original skeleton. The XML may look like this:

where:
freq is in Hz. (40)
samples is 4. The total animation-time-length is 1/40 * samples
each time slot contains all the bones,
In this example, the skeleton has only 3 bones

Option 5

<animation animname="Attack2" nodename="" samples="4" freq="40">
<key time="0" name= "Joint1" position="0,5,-5" orientation="0.000,0.000,0.000"/>
<key time="0" name= "Joint2" position="0,5,-5" orientation="0.000,0.000,0.000"/>
<key time="0" name= "Joint3" position="0,5,-5" orientation="0.000,0.000,0.000"/>

<key time="1" name= "Joint1" position="0,5,-5" orientation="0.000,0.000,0.000"/>
<key time="1" name= "Joint2" position="0,5,-5" orientation="0.000,0.000,0.000"/>
<key time="1" name= "Joint3" position="0,5,-5" orientation="0.000,0.000,0.000"/>

<key time="2" name= "Joint1" position="0,5,-5" orientation="0.000,0.000,0.000"/>
<key time="2" name= "Joint2" position="0,5,-5" orientation="0.000,0.000,0.000"/>
<key time="2" name= "Joint3" position="0,5,-5" orientation="0.000,0.000,0.000"/>

<key time="3" name= "Joint1" position="0,5,-5" orientation="0.000,0.000,0.000"/>
<key time="3" name= "Joint2" position="0,5,-5" orientation="0.000,0.000,0.000"/>
<key time="3" name= "Joint3" position="0,5,-5" orientation="0.000,0.000,0.000"/>
</animation>


This format may be simplified further, if bone sequence is fixed (Joint1,Joint2,Joint3) and the number of samples is known(4)
So time and name tags can be removed to this: <key position="0,5,-5" orientation="0.000,0.000,0.000"/>
Although it may be harder for humans to read.

So I think Option5 is probably the best option at this moment. It is readable, simple, it will work well with
Mocap systems and wxOgre Panel, it is interchangeable to other options ( XML format). Changing the Freq
would make the animation run faster or slower.


Best regards,

Skorpio

dermont

10-06-2009 07:59:44

Maybe you could check the following link, if you haven't already, from GSoC 2008 - Motion Synthesis based Character Animation. They have a BVH/OgreXMLConverter converter(link page 3) which never made the mainstream.

http://ogre.svn.sourceforge.net/viewvc/ ... iew=markup

If you want to people to help, submit changes etc. your best bet would be set up a Sourceforge subversion repository.

skorpio

11-06-2009 09:20:01

Hello Dermont,

Thanks, for your link. I was not aware of this resource. I will look into it.
Also, your comment about, helping is good. The original idea of this project was:

- Share the code so others can contribute.
- Build more tools as time goes by.
- Make the code available to anyone.

With sourceforge SVN, I believe, permission needs to be granted by the author to edit, anyway.

I don't know why this project has not taken off. This project has been going on for more than 1 year,
so I think my commitment has been demonstrated. It could be the lack of documentation or the fact it is not in SVN
or the code is too messy, or the basic architecture is flawed or there is no specified goals.
whatever the problem is, nobody has told me.

Anyway, here is a screen capture of my attempt to doing animation,
Here the ninja's torse, it was moved, and rotated. For some reason the image is getting cropped.
But you could open the thumbnail in another window to view the image fully and see the panel





Best Regards,

Skorpio

chpod

11-06-2009 12:48:33

Hi Skorpio,

I sometimes contributed proposing patches to wxOgre. I really like this project.

Maybe some thoughts why it has not taken off, yet (i think it still can):
- Public SVN version needed
- More publicity on python-ogre.org (actually most people starting with python should consider it)
- Need to re-think about using Qt instead of wx (which could not be used at the beginning of the project because of license issues that are solved now)
- Make more "sexy" demos

I have not spent much time on python-ogre in the last months, but I will soon be back. I would love to implement some timeline/animation panels to wxOgre.

Hope to read from you soon,
Keep it up!
chpod

skorpio

12-06-2009 09:09:55

Hello Chpod,

Yes, I think I will look into doing SVN and I agree with you about the python-ogre statement.

I confessed that when I started working with Ogre, I didn't want to learn python.
After trying to code stuff in C++ and incorporated other features, I ran into so many
problems that I thought about looking into python. What I discovered is that Python
is really easy and the Object-oriented part makes project a lot easier. Now I hate to
program in C++, it is so arcane, python is so nice when handling strings!!

As far as Qt is concerned, I don't have any experience with it, but I willing to look at something
that would make wxOgre more attractive. Also, I was not concerned about the licensing because
wxOgre was free and far from commerciable. It was tool for showcasing Ogre.

I agree that we need more sexy demos. I thought with all the stuff in wxOgre thus far,
other users would create scenes similar to Stone Henge and post them here. So I'm not
sure if people are actually using it for anything usefull, I know I am. Also I don't know
what is missing from wxOgre that is preventing the "sexyness" to show up.

By the way, thanks for your contributions, I think I have credited you and everybody
that has contributed to this project. If I haven't I apologize, it hasn't been intentional.


Best Regards,

Skorpio

skorpio

29-06-2009 02:11:24

Hello,

Here is the latest version of the code. It implements the skeleton panel.
Now, you can create new animations from wxOgre. The controls are similar to the AnimTrack Panel.



(my browser crashed when I was writing all the steps. so here is the short version)

Steps
1) Load entities with skeleton from the entity panel then switch to the Skeleton Panel.
2) Click the desired skeleton, click the + button to add more frames
3) Click frame '0', Click the bone you want to animate
4) Click Orientate PYR button to move desired bone.
5) Click the next frame and repeat until all frames have the desired bone.

Click Create Anim button to test and Create classAnimation*.py to save.

I have added a demo_dragon.py. It has a skeleton animation running in a loop. It moves the head and the tail. Very simple but shows the potential.
Also it has another animation that moves the dragon along, so it looks like it is flying, I used the AnimTrack panel to do this.
You can start the animations by pressing 1 and 2 to stop it.


Dragon resource
http://www.mediafire.com/file/tznmkzuttww/dragon1.zip



wxOgre Rev 54
http://www.mediafire.com/file/nmwmkxmzn ... _rev54.zip

How about the Ninja doing the Macarena?
Have fun!


Best Regards,

Skorpio

skorpio

30-06-2009 07:20:14

Hello,

I just found a bug when deleting an animation. This function is called when the CreateAnim button is clicked.

self.animStateNameList=[] is no longer used.
animationState can retrieve its own name by using getAnimationName()

Please update this function with this code.


def _RemoveAnimationStateList(self):

count = len(self.animStateList)

for ii in range (0,count):
animStateName = self.animStateList[ii]
animationStateName = animStateName.getAnimationName()

try:
self.sm.destroyAnimation(animationStateName)

except ogre.OgreItemIdentityException:
print "animationStete error"







Best Regards.

Skorpio

skorpio

07-07-2009 06:58:54

Hello,

Here is the latest patch. It fixes most of the bugs that I encountered in my debugging.
I added two mapping functions to rename bones for the Ninja and Robot
It is a lot easier to animate when you know what bones you are moving.





Please replace old copy of wxPanelSkeleton.py with this

import wx
import ogre.renderer.OGRE as ogre

class XmlSkeletonStruct:
pass

class wxPanelSkeleton(wx.Panel):
def __init__(self, parent, id, ogrewin, wxwin):
wx.Panel.__init__(self, parent, id, size=(640, 480) )

self.id = id
self.parent = parent
self.ogreWin = ogrewin
self.wxwin = wxwin

self.sm = self.ogreWin.sceneManager
self.rn = self.sm.getRootSceneNode()
self.capturedList = []

self.animation=None
self.animationState = None
self.animStateList=[]
self.node = None


self.frameList=[]
self.boneList=[]
self.boneNodeList=[]
self.skeletonList=[]
self.frameTimeList=[]

self.skeletonListIndex = -1
self.capturedIndex = -1
self.boneListIndex = -1
self.frameListIndex = -1
self.frameId = 0

self.skeletonStructList=[]
self.animStateNameList=[]

self.animationTimeStart = 0.0

self.animationName = 'SkeletonAnim'
wx.StaticText(self, -1, 'Animation Name:', (300, 250))
self.wxAnimNameEditbox = wx.TextCtrl(self, -1, self.animationName, pos=(300, 265), size=(100,20))

self.animationTime = 5.0
wx.StaticText(self, -1, 'Animation Length:', (300, 290))
self.wxcurrTimeEditbox = wx.TextCtrl(self, -1, str(self.animationTime), pos=(300, 305), size=(100,20))

self.animationCaptured = ''
wx.StaticText(self, -1, 'Edit Captured Position:', (300, 330))
self.wxAnimCapturedEditbox = wx.TextCtrl(self, -1, self.animationCaptured, pos=(300, 345), size=(300,20))

self.wxUpdateButton = wx.Button(self, -1, "Update",(300, 380), (120, -1))
self.Bind(wx.EVT_BUTTON, self._OnUpdateButton, self.wxUpdateButton)
self.wxUpdateButton.Disable()


self._wxLoadCapturedList()


self.wxLockButton = wx.Button(self, -1, "Lock Position",(10, 260), (150, -1))
self.Bind(wx.EVT_BUTTON, self._OnLockButton, self.wxLockButton)
self.wxLockButton.Disable()

self.wxCreateButton = wx.Button(self, -1, "Create Anim",(10, 290), (150, -1))
self.Bind(wx.EVT_BUTTON, self._OnCreateKeyFrameButton, self.wxCreateButton)
self.wxCreateButton.Disable()
#self.wxCreateButton.Enable()

self.wxRunAnimationButton = wx.Button(self, -1, "Run Anim",(10, 320), (150, -1))
self.Bind(wx.EVT_BUTTON, self._OnRunAnimButton, self.wxRunAnimationButton)
self.wxRunAnimationButton.Disable()

self.wxStopAnimationButton = wx.Button(self, -1, "Stop Anim",(10, 350), (150, -1))
self.Bind(wx.EVT_BUTTON, self._OnStopAnimButton, self.wxStopAnimationButton)
self.wxStopAnimationButton.Disable()

self.wxCreateClassButton = wx.Button(self, -1, "Create classAnimation*.py",(10, 380), (150, -1))
self.Bind(wx.EVT_BUTTON, self._OnCreateClassButton, self.wxCreateClassButton)
self.wxCreateClassButton.Disable()

self.wxMoveXZButton = wx.ToggleButton(self, -1, "Translate XZ-Y",(10, 410), (150, -1))
self.Bind(wx.EVT_TOGGLEBUTTON, self._OnMoveEntityButton, self.wxMoveXZButton)
self.wxMoveXZButton.Disable()

self.wxMoveYButton = wx.ToggleButton(self, -1, "Orientate PYR",(10, 440), (150, -1))
self.Bind(wx.EVT_TOGGLEBUTTON, self._OnOrientateEntityButton, self.wxMoveYButton)
self.wxMoveYButton.Disable()

self._wxLoadSkeletonList()
self._wxLoadBoneList()
self._wxLoadFrameList()



def _wxLoadCapturedList(self):
wx.StaticText(self, -1, 'Captured Position:', (5, 2))

LISTBOX_CAPTURED_LIST = wx.NewId()
self.wxCapturedList = wx.ListBox(self, LISTBOX_CAPTURED_LIST, (5, 15), (280, 230), self.capturedList, wx.LB_SINGLE) ##wx.LB_EXTENDED) #

self.Bind(wx.EVT_LISTBOX, self._OnCapturedListClick, id=LISTBOX_CAPTURED_LIST)
#self.Bind(wx.EVT_LISTBOX_DCLICK, self._OnCapturedListDClick, id=LISTBOX_CAPTURED_LIST)


def _wxLoadSkeletonList(self):
wx.StaticText(self, -1, 'Available Skeleton:', (290, 2))
LISTBOX_SELECTNODE = wx.NewId()
self.wxListBoxSkeleton = wx.ListBox(self, LISTBOX_SELECTNODE, (290, 15), (130, 230), self.skeletonList, wx.LB_SINGLE)
self.Bind(wx.EVT_LISTBOX, self._OnLoadSkeletonList, id=LISTBOX_SELECTNODE)


def _wxLoadBoneList(self):
wx.StaticText(self, -1, 'Available Bones:', (495, 2))
LISTBOX_SELECTBONE = wx.NewId()
self.wxListBoxBone = wx.ListBox(self, LISTBOX_SELECTBONE, (490,15), (130, 230), self.boneList, wx.LB_SINGLE)
self.Bind(wx.EVT_LISTBOX, self._OnLoadBoneList, id=LISTBOX_SELECTBONE)


def _wxLoadFrameList(self):
wx.StaticText(self, -1, 'Frame:', (420, 2))
LISTBOX_FRAME = wx.NewId()
self.wxListBoxFrame = wx.ListBox(self, LISTBOX_FRAME, (425,15), (60, 230), self.frameList, wx.LB_SINGLE)
self.Bind(wx.EVT_LISTBOX, self._OnFrameListClick, id=LISTBOX_FRAME)

self.wxAddFrameButton = wx.Button(self, -1, "+",(425, 250), (60, -1))
self.Bind(wx.EVT_BUTTON, self._OnAddButtonClick, self.wxAddFrameButton)
self.wxAddFrameButton.Disable()


def _OnFrameListClick(self, event):
index = event.GetSelection()
self.frameListIndex = index

self.wxCapturedList.Clear()

count = len(self.skeletonStructList[self.skeletonListIndex].frameList)
if count > 2:
self.wxCreateButton.Enable()

capturedList = self.skeletonStructList[self.skeletonListIndex].frameList[self.frameListIndex]
self.wxCapturedList.Set(capturedList)


def _OnAddButtonClick(self,event):

if self.skeletonListIndex != -1:
count = len(self.skeletonStructList[self.skeletonListIndex].frameList) + 1
frameid=0
framelist=[]
for i in range (0,count):
framelist.append(str(frameid))
frameid = frameid + 1

self.wxListBoxFrame.Set(framelist)

capturedList = []
self.skeletonStructList[self.skeletonListIndex].frameList.append(capturedList)



def _OnExternalLoadEntity(self, name):

entityname = str(name)
found = False
for it in self.skeletonList:
if entityname == it:
found = True

if found == False:
entityhandle = self.ogreWin.sm.getEntity(entityname)
if entityhandle.hasSkeleton() == True:
self.skeletonList.append(entityname)

pSkeleton = entityhandle.getSkeleton()
BoneIter = pSkeleton.getBoneIterator()
boneList=[]
boneNodeList=[]
capturedList=[]
frameList=[]
while BoneIter.hasMoreElements():
pBone = BoneIter.getNext()
pBone.setManuallyControlled(True)

bonename = str(pBone.getName())
boneName = bonename

found = entityname.find('ninja')
if found != -1:
boneName = self.renameNinjaBones(bonename)


found = entityname.find('robot')
if found != -1:
boneName = self.renameRobotBones(bonename)


pos = pBone.getPosition()
ori = pBone.getOrientation()
boneList.append(boneName)
boneNodeList.append(pBone)

txt = "%s:%.3f,%.3f,%.3f:%.3f,%.3f,%.3f" % (boneName,pos.x,pos.y,pos.z, ori.x,ori.y,ori.z)
capturedList.append(txt)

#print capturedList
capturedList=[]
frameList.append(capturedList)

skel = XmlSkeletonStruct()
skel.entityname = entityname
skel.frameId = self.frameId
skel.boneList = boneList
skel.boneNodeList = boneNodeList
skel.frameList = frameList

self.skeletonStructList.append(skel)


self.wxListBoxSkeleton.Set(self.skeletonList)
return found

def renameNinjaBones (self, bonename):
bone = bonename
if bonename == 'Joint1':
bone = 'Root.pivot.Foot'
if bonename == 'Joint2':
bone = 'Root.Pivot.Waist'
if bonename == 'Joint3':
bone = 'torso.Lower'
if bonename == 'Joint4':
bone = 'torso.Waist'
if bonename == 'Joint5':
bone = 'torso.Upper'
if bonename == 'Joint6':
bone = 'torso.Chest'
if bonename == 'Joint7':
bone = 'Neck1'
if bonename == 'Joint8':
bone = 'Neck2'
if bonename == 'Joint9':
bone = 'Clav.Right'
if bonename == 'Joint10':
bone = 'Shoulder.Right'
if bonename == 'Joint11':
bone = 'Elbow.Right'
if bonename == 'Joint12':
bone = 'Wrist.Right'
if bonename == 'Joint13':
bone = 'Sword'
if bonename == 'Joint14':
bone = 'Clav.Left'
if bonename == 'Joint15':
bone = 'Shoulder.Left'
if bonename == 'Joint16':
bone = 'Elbow.Left'
if bonename == 'Joint17':
bone = 'Wrist.Left'
if bonename == 'Joint18':
bone = 'Leg.Upper.Right'
if bonename == 'Joint19':
bone = 'Knee.Right'
if bonename == 'Joint20':
bone = 'Ankle.Right'
if bonename == 'Joint21':
bone = 'Foot.Right'
if bonename == 'Joint23':
bone = 'Leg.Upper.Left'
if bonename == 'Joint24':
bone = 'Knee.Left'
if bonename == 'Joint25':
bone = 'Ankle.Left'
if bonename == 'Joint26':
bone = 'Foot.Left'

return bone

def renameRobotBones (self, bonename):

bone = bonename
if bonename == 'Joint1':
bone = 'Pivot.Waist'
if bonename == 'Joint2':
bone = 'Hip.Left'
if bonename == 'Joint3':
bone = 'Leg.Left'
if bonename == 'Joint4':
bone = 'Knee.Left'
if bonename == 'Joint5':
bone = 'Foot.Left'
if bonename == 'Joint6':
bone = 'Hip.Right'
if bonename == 'Joint7':
bone = 'Leg.Right'
if bonename == 'Joint8':
bone = 'Knee.Right'
if bonename == 'Joint9':
bone = 'Foot.Right'
if bonename == 'Joint10':
bone = 'Waist'
if bonename == 'Joint11':
bone = 'Chest'
if bonename == 'Joint12':
bone = 'Neck'
if bonename == 'Joint13':
bone = 'Shoulder.Left'
if bonename == 'Joint14':
bone = 'Elbow.Left'
if bonename == 'Joint15':
bone = 'Wrist.Left'
if bonename == 'Joint16':
bone = 'Shoulder.Right'
if bonename == 'Joint17':
bone = 'Elbow.Right'
if bonename == 'Joint18':
bone = 'Wrist.Right'

return bone


def _OnLoadBoneList(self,event):
index = event.GetSelection()
self.boneListIndex = index
self.node = self.boneNodeList[index]

if self.frameListIndex !=-1 and self.skeletonListIndex !=-1:
#self.wxLockButton.Enable()
#self.wxMoveXZButton.Enable()
self.wxMoveYButton.Enable()

def _OnLoadSkeletonList(self,event):
index = event.GetSelection()
self.skeletonListIndex = index
#print index

self.wxCapturedList.Clear()
self.wxListBoxBone.Clear()
self.wxListBoxFrame.Clear()
self.boneNodeList = -1
self.frameListIndex=-1
self.wxMoveXZButton.Disable()
self.wxMoveYButton.Disable()
self.wxUpdateButton.Disable()
self.wxCreateButton.Disable()
self.wxCreateClassButton.Disable()
self.wxRunAnimationButton.Disable()
self.wxStopAnimationButton.Disable()


count = len(self.skeletonStructList[self.skeletonListIndex].boneList)
self.boneList=[]
self.boneNodeList=[]
for i in range (0,count):
bonename = self.skeletonStructList[self.skeletonListIndex].boneList[i]
pbone = self.skeletonStructList[self.skeletonListIndex].boneNodeList[i]
self.boneList.append(bonename)
self.boneNodeList.append(pbone)

self.wxListBoxBone.Set(self.boneList)


count = len(self.skeletonStructList[self.skeletonListIndex].frameList)
frameid=0
framelist=[]
for i in range (0,count):
framelist.append(str(frameid))
frameid = frameid + 1

self.wxListBoxFrame.Set(framelist)
self.wxAddFrameButton.Enable()


def _OnExternalLoadNode(self,nodelist):
count = len (nodelist)
for i in range (0,count):
name = nodelist[i]
self.skeletonList.append(name)
self.wxListBoxSkeleton.Set(self.skeletonList)


def _OnCapturedListDClick (self,event):
index = event.GetSelection()
self.track = self.capturedList[index]
print index


def _OnCapturedListClick(self,event):
index = event.GetSelection()
self.capturedIndex = index

trackList = self.skeletonStructList[self.skeletonListIndex].frameList[self.frameListIndex]

self.animationCaptured = trackList[self.capturedIndex]
self.wxAnimCapturedEditbox.SetValue(self.animationCaptured )

count = len (self.animationCaptured)
if count > 0:
self.wxUpdateButton.Enable()


def _OnLockButton(self,event):
pos = self.node.getPosition()

bonename = self.boneList[self.boneListIndex]

p = self.ogreWin.Scene.EntityPitch
y = self.ogreWin.Scene.EntityYaw
r = self.ogreWin.Scene.EntityRoll

#txt = "%.3f,%.3f,%.3f:%.3f,%.3f,%.3f,%.3f" % (pos.x,pos.y,pos.z, o.w,o.x,o.y,o.z)
txt = "%s:%.3f,%.3f,%.3f:%.3f,%.3f,%.3f" % (bonename,pos.x,pos.y,pos.z, p,y,r)


if self.frameListIndex != -1 and self.skeletonListIndex != -1:
self.skeletonStructList[self.skeletonListIndex].frameList[self.frameListIndex].append(txt)

capturedlist = self.skeletonStructList[self.skeletonListIndex].frameList[self.frameListIndex]
self.wxCapturedList.Set(capturedlist)


def _RemoveAnimationStateList(self):

count = len(self.animStateList)

for ii in range (0,count):
animStateName = self.animStateList[ii]
animationStateName = animStateName.getAnimationName()

try:
self.sm.destroyAnimation(animationStateName)

except ogre.OgreItemIdentityException:
print "animationStete error"



def _OnCreateKeyFrameButton(self,event):

self._RemoveAnimationStateList()

self.animStateNameList=[]
self.animStateList=[]

self.capturedList=[]
bonecount = len(self.skeletonStructList[self.skeletonListIndex].boneList)
for jj in range (0,bonecount):

bonename = self.skeletonStructList[self.skeletonListIndex].boneList[jj]
boneList = []

count = len(self.skeletonStructList[self.skeletonListIndex].frameList)
for ii in range(0,count):

capturedList = self.skeletonStructList[self.skeletonListIndex].frameList[ii]
capcount = len ( capturedList )

for kk in range (0, capcount):
self.entry = capturedList[kk]
thisbone, pos,quat = self.entry.split(':')

if bonename == thisbone:
boneList.append(capturedList[kk])

self.capturedList.append(boneList)

#print self.capturedList[jj]
#print '\n'


self.animationTime = float(self.wxcurrTimeEditbox.GetValue())
bonecount = len(self.skeletonStructList[self.skeletonListIndex].boneList)
for jj in range (0,bonecount):

bonename = self.skeletonStructList[self.skeletonListIndex].boneList[jj]

count = len( self.capturedList[jj] )
if count >2:
self.animationName = self.skeletonStructList[self.skeletonListIndex].entityname + '_' + bonename
self.animStateNameList.append(self.animationName)
print self.animationName
print self.animationTime

self.animation = self.sm.createAnimation(self.animationName, self.animationTime)
self.animation.interpolationMode = ogre.Animation.IM_SPLINE

self.animationTimeStart = 0.0
self.interval = self.animationTime/len(self.skeletonStructList[self.skeletonListIndex].frameList)
self.node = self.skeletonStructList[self.skeletonListIndex].boneNodeList[jj]
print self.interval


self.track = self.animation.createNodeTrack(0, self.node)


for kk in range (0,count):

self.animationTimeStart = self.animationTimeStart + self.interval
self.key = self.track.createNodeKeyFrame(self.animationTimeStart)

self.entry = self.capturedList[jj][kk]
print self.entry

name,pos,quat = self.entry.split(':')

x,y,z = pos.split(',')
posx = float(x)
posy = float(y)
posz = float(z)

## Remove to allow position changes.
posx = float(0)
posy = float(0)
posz = float(0)

self.key.setTranslate(ogre.Vector3(posx,posy,posz))

p,y,r = quat.split(',')
pitch = float(p)
yaw = float (y)
roll = float (r)

self.node.resetOrientation()
self.node.yaw(ogre.Degree(d=yaw))
self.node.pitch(ogre.Degree(d=pitch))
self.node.roll(ogre.Degree(d=roll))

quaternion = self.node.getOrientation()
self.key.setRotation(quaternion)

animationState = self.sm.createAnimationState(self.animationName)
animationState.Enabled = False
animationState.Loop = False

self.animStateList.append(animationState)

self.wxRunAnimationButton.Enable()
self.wxCreateClassButton.Enable()
self.wxStopAnimationButton.Enable()



def _OnUpdateButton(self,event):
if self.frameListIndex != -1:
print "updating bone entry"
self.animationCaptured = self.wxAnimCapturedEditbox.GetValue()
track = self.skeletonStructList[self.skeletonListIndex].frameList[self.frameListIndex]
track [self.capturedIndex] = str(self.animationCaptured)

self.wxCapturedList.Set(track)


def _OnRunAnimButton(self,event):

self.wxStopAnimationButton.Enable()
count = len(self.animStateList)
for ii in range (0,count):
self.animationState = self.animStateList[ii]
self.animationState.setTimePosition(0)
self.animationState.Enabled = True

def _OnStopAnimButton(self,event):
self.wxRunAnimationButton.Enable()
self.wxCreateButton.Enable()
self.wxCreateClassButton.Enable()
self.wxUpdateButton.Enable()

count = len(self.animStateList)
for ii in range (0,count):
self.animationState = self.animStateList[ii]
self.animationState.setTimePosition(0)
self.animationState.Enabled = False


def frame_Started(self,event):
pass


def frame_Ended(self,event):

count = len(self.animStateList)
for ii in range (0,count):
self.animationState = self.animStateList[ii]
if self.animationState.Enabled == True:
self.animationState.addTime(0.001)
self.animStateList[ii] = self.animationState
pass


def _OnMoveEntityButton(self,event):
if self.boneListIndex != -1:
self.ogreWin.MoveEntity = event.Checked()

if (event.Checked()==False):
self.wxMoveXZButton.Disable()
self.wxMoveYButton.Enable()

else:
self.ogreWin.Scene.EntityNode = self.node
self.wxMoveYButton.Disable()
self.wxLockButton.Disable()
self.wxRunAnimationButton.Disable()
#self.wxCreateButton.Disable()
self.wxCreateClassButton.Disable()
self.wxUpdateButton.Disable()
self.wxStopAnimationButton.Disable()



def _OnOrientateEntityButton(self,event):
if self.skeletonListIndex != -1:
self.ogreWin.MoveYEntity = event.Checked()

if (event.Checked()==False):
self._OnLockButton(event)
#self.wxMoveXZButton.Enable()
self.wxMoveYButton.Enable()
self.wxUpdateButton.Enable()

if len(self.capturedList) > 1:
self.wxCreateButton.Enable()

else:
self.ogreWin.Scene.EntityNode = self.node

self.wxRunAnimationButton.Disable()
self.wxCreateClassButton.Disable()
self.wxUpdateButton.Disable()
self.wxStopAnimationButton.Disable()




def _OnCreateClassButton (self,event):

self.animationName = self.wxAnimNameEditbox.GetValue()
self.animationTime = float(self.wxcurrTimeEditbox.GetValue())

self.filename = 'classAnimation%s.py' % (self.animationName)

self.file = open(self.filename,'w')
print "Creating File %s" % self.filename
self._ProcessNotice()
self._ProcessImport()
self._ProcessClass()
self.file.close()
print "Closing File %s" % self.filename

self.wxwin.updatePanelImport(self.filename)


def _ProcessNotice(self):
self.file.write("# -----------------------------------------------------------------------------\n")
self.file.write("# This code is auto generated by wxOgre\n")
self.file.write("# This code is free and can be used for any purpose.\n")
self.file.write("# Disclaimer: This code is provided 'as is' without warranty of any kind,\n")
self.file.write("# either express or implied.\n")
self.file.write("# -----------------------------------------------------------------------------\n\n")


def _ProcessImport(self):
self.file.write("import ogre.renderer.OGRE as ogre\n")
self.file.write("import ogre.io.OIS as OIS\n")
self.file.write("\n")

def _ProcessClass(self):

self.animationName = self.wxAnimNameEditbox.GetValue()
self.file.write("class %sAnimation(object):\n" % (self.animationName) )
self.file.write(" def __init__(self, app, animname, entity):\n")
self.file.write(" self.animname = animname\n")
self.file.write(" self.app = app\n\n")

self.file.write(" self.sm = self.app.sm\n")
self.file.write(" self.rn = self.sm.getRootSceneNode()\n\n")

self.file.write(" self.entityhandle = entity\n")
self.file.write(" self.animStateList=[]\n")
self.file.write(" self.boneNodeList=[]\n\n")

self.file.write(" pSkeleton = self.entityhandle.getSkeleton()\n")
self.file.write(" BoneIter = pSkeleton.getBoneIterator()\n")
self.file.write(" while BoneIter.hasMoreElements():\n")
self.file.write(" pBone = BoneIter.getNext()\n" )
self.file.write(" pBone.setManuallyControlled(True)\n" )
self.file.write(" self.boneNodeList.append(pBone)\n\n" )


self.animationTime = float(self.wxcurrTimeEditbox.GetValue())
bonecount = len(self.skeletonStructList[self.skeletonListIndex].boneList)
for jj in range (0,bonecount):

bonename = self.skeletonStructList[self.skeletonListIndex].boneList[jj]

count = len( self.capturedList[jj] )
if count >2:
self.animationName = self.skeletonStructList[self.skeletonListIndex].entityname + '_' + bonename
self.animStateNameList.append(self.animationName)

self.file.write(" self.animname = '%s'\n" % (self.animationName))
self.file.write(" self.node = self.boneNodeList[%d]\n" % (jj))
self.file.write(" self.animation = self.sm.createAnimation(self.animname, %.3f)\n" % (self.animationTime))
self.file.write(" self.animation.interpolationMode = ogre.Animation.IM_SPLINE\n\n")
self.file.write(" self.track = self.animation.createNodeTrack(0, self.node)\n")

self.animationTimeStart = 0.0
self.interval = self.animationTime/len(self.skeletonStructList[self.skeletonListIndex].frameList)
self.node = self.skeletonStructList[self.skeletonListIndex].boneNodeList[jj]



for kk in range (0,count):

self.animationTimeStart = self.animationTimeStart + self.interval
self.file.write(" self.key = self.track.createNodeKeyFrame(%.3f)\n" % (self.animationTimeStart) )

self.entry = self.capturedList[jj][kk]
#print self.entry

name,pos,quat = self.entry.split(':')
pos = '0,0,0'
self.file.write(" self.key.setTranslate(ogre.Vector3(%s))\n" % (pos) )

p,y,r = quat.split(',')
pitch = float(p)
yaw = float (y)
roll = float (r)

self.node.resetOrientation()
self.node.yaw(ogre.Degree(d=yaw))
self.node.pitch(ogre.Degree(d=pitch))
self.node.roll(ogre.Degree(d=roll))


self.file.write(" self.node.resetOrientation()\n" )
self.file.write(" self.node.pitch(ogre.Degree(d=%3f))\n" % (pitch) )
self.file.write(" self.node.yaw(ogre.Degree(d=%3f))\n" % (yaw) )
self.file.write(" self.node.roll(ogre.Degree(d=%3f))\n" % (roll) )
self.file.write(" quaternion = self.node.getOrientation()\n" )
self.file.write(" self.key.setRotation(quaternion)\n\n" )


self.file.write("\n")
self.file.write(" self.animationState = self.sm.createAnimationState(self.animname)\n")
self.file.write(" self.animationState.Enabled = False\n")
self.file.write(" self.animationState.Loop = False\n\n")
self.file.write(" self.animStateList.append(self.animationState)\n\n")


self.file.write(" def frame_started(self):\n")
self.file.write(" pass\n\n")

self.file.write(" def frame_ended(self):\n")
self.file.write(" count = len(self.animStateList)\n")
self.file.write(" for ii in range (0,count):\n")
self.file.write(" self.animationState = self.animStateList[ii]\n")
self.file.write(" self.animationState.addTime(0.001)\n")
self.file.write("\n")


self.file.write(" def start_animation(self):\n")
self.file.write(" count = len(self.animStateList)\n")
self.file.write(" for ii in range (0,count):\n")
self.file.write(" self.animationState = self.animStateList[ii]\n")
self.file.write(" self.animationState.setTimePosition(0)\n")
self.file.write(" self.animationState.Enabled = True\n")
self.file.write("\n")



self.file.write(" def stop_animation(self):\n")
self.file.write(" count = len(self.animStateList)\n")
self.file.write(" for ii in range (0,count):\n")
self.file.write(" self.animationState = self.animStateList[ii]\n")
self.file.write(" self.animationState.Enabled = False\n")
self.file.write("\n")



Best Regards,

Skorpio

Swinely

08-07-2009 12:59:06

Hi Skorpio,

I've just been reading through some of these pages and have a question which may sound a little weird... what exactly is wxOgre and how does it relate to a basic framework? (as i've read your posts suggesting its use) As far as i'm understanding its to create scenes + animations stored as xml? Although i'm probably wrong :roll: .

Best regards

skorpio

09-07-2009 09:30:04

Hello Swinely,

wxOgre is a basic tool for creating python-ogre applications. The scene information is stored in an XML file.
wOgre is modular by design. It uses classes to encapsulate basic behavior, such as mouse and keyboard, etc.
similar to the basic framework but it doesn't use a FrameListener Class. Everything is visible.

Here is the generic overview of wxOgre.






wxOgre.py its main task is to build scenes easier by having a GUI front end to the python-ogre.
It creates an ogre window to render scenes in real time.
It uses wxPanels to facilitate access to python-ogre resources.

ogreWinWx.py implements the glue-code between wxOgre and python-ogre. It creates the a default camera and viewport, keys and mouse bindings.
Here minimum ogre resources are loaded such as axes.mesh. The resources here can be access by self.ogreWin or self.ogreWin.Scene pointer.

wxPanel*.py are wxpython frames that access python-ogre resources. This add modularity by creating panels for different purposes.
It provides access to ogre resources such as animations, skeleton manipulation, materials, entity, etc.

ogreXMLReader.py is a program that reads a XML file and converts it into actual python-code. The code is rendered by wxOgre.py

ogreXMLWriter.py is a program that create a XML file with the information generated by wxOgre.py

scene*.xml are XML files that contain information about the scene, cameras, entities, nodes, etc. It provides a way to contain information about a scene without any code. They contains event and key binding information too. Events are the main way to 'call' other python-ogre classes

ogreGenerator.py is a program that reads a XML and creates native python-ogre code.


class*.py are classes written in python to provide common code across many projects. This code is shared by the wxOgre and the final application. Two of the most important classes are classOgreCore.py and classInputManager.py, they are the base for the stand alone python application. Other classes are loaded through events.

classOgreCore.py is a class written in python that implements the simplest way to create a python application, load resources and render a single ogre frame.

classInputManager.py is a class written to provide keyboard and mouse interface to the python application.

So, your application requires, as a minimum, classOgreCore.py and classInputManager.py, to work.
If you look at some of the samples, you will see that all share the same generic structure

import
build scene
entities,etc
events
mouse binding
key binding

main()


and in a way wxOgre helps you create this structure.


I hope this clarifies some your questions. If it doesn't, don't hesitate to post again.
I would happy to help

Best Regards,

Skorpio,

PS. I'm including an old tutorial that my help. The information is a little old but mostly accurate.
http://www.mediafire.com/file/bygmmytnl ... l_rev3.zip

Swinely

19-09-2009 12:34:37

The wxOgre download link doesn't seem to have the file anymore? is there a new one around anywhere?

Thanks

chpod

22-09-2009 09:31:07

The wxOgre download link doesn't seem to have the file anymore? is there a new one around anywhere?
Did you pm skorpio regarding the download link?

I have already used and will use wxogre again on a project of mine in the next couple of months. Let's hope you will find it useful too!

Cheers,
chpod

Swinely

24-09-2009 20:21:38

I haven't actually pm'd him yet, might try that instead :)

skorpio

26-09-2009 23:39:41

Hello,

I was out for a little while, summer was nice, and now I'm coming back to re-start where I left of.

First, I would like to repost the latest code. The link went bad. I'm also reposting the tutorial files.

Second, I would like to share with you a few programs that I wrote for handling some of the
skeleton files. You may find them interesting.

Third, I was thinking that most of my time is taken by moving buttons, aligning checkbox. It would be nice to have
a way for wxOgre to be able to dynamically create wx Objects or to be able to move them. This would be a nice addition.
and a real time saver.

Fourth, I would like to get input from, as to what needs more improvements, I have had a gun-shot approach. Trying to
entice people to merge their own development with this. So there are a lot of unfinished features. If we can finish them
it would be great for the project.

Fifth, ongoing cleanup of the code. I would like to rename variables for wxWidgets as wxSomething. This will make the code
more readable. I would do this as I start to modify or improve things. It is a minor improvement.

and Lastly, please share your thoughts about this project.


Best Regards,

Skorpio



Rev 54
http://www.mediafire.com/file/tmmtzdmcj ... _rev54.zip

how to use the program
http://www.mediafire.com/file/ueyzozym4 ... l_rev3.zip

skorpio

27-09-2009 00:11:55

Hello,

Before the summer started, I was working on skeleton manipulation.
I have learned a lot. It was a lot of fun. I discovered the Blender through OGre export created
skeleton files. The nodes associated to each of this bones has some kind of offset.
The ninja has no offset all the angles are Zero to begin with. So manipulation is easy but
the dragon has offsets and moving the nodes yields some odd bone movements.

So most of my testing has been with nodes that have Zero offset for the angles.

import_bva.py


class BvaFileReader(object):

def __init__(self, name, attribute):
self.filename = name
self.attribute = attribute

self.file = open(self.filename, self.attribute)
print "Processing File %s" % self.filename

self.frameList=[]
self.segmentList=[]
self.FrameCountList=[]
self.FrameTimeList=[]
self.ChannelList=[]
self.UnitsList=[]

def __del__(self):
self.file.close()
print "Closing File %s" % self.filename


def ReadBones(self):

segmentList=[]
FrameCountList=[]
FrameTimeList=[]
ChannelList=[]
UnitsList=[]
thisbonemotionList=[]
motionList=[]

boneInfo = ""

isSegment = False
isFrameCount = False
isFrameTime = False
isChannel = False
isUnit = False
isMotion = False
isMotionFirst = False
jj=0

for line in self.file:
txt = line
#print txt


key1 = txt.find('Segment:')
key2 = txt.find('Frames:')
key3 = txt.find('Frame Time:')

if key1 != -1:
x = txt.replace('Segment:',"")
txt = x
x = txt.replace(' ',"")
txt = x
x = txt.replace('\n',"")
txt = x
print
print txt
segmentList.append(txt)
isSegment=True

if key2 != -1 and isSegment==True:
x = txt.replace('Frames:',"")
txt = x
x = txt.replace(' ',"")
txt = x
x = txt.replace('\n',"")
txt = x
print txt
FrameCountList.append(txt)
isFrameCount=True
jj = int(txt)


if isMotion==True:
if isMotionFirst==False:
isMotionFirst = True
thisbonemotionList=[]

x = txt.replace('\n',"")
txt = x

x = txt.replace('\t',",")
txt = x

thisbonemotionList.append(txt)
#print txt

jj = jj-1
if jj ==0:
isMotionFirst = False
isMotion=False
self.frameList.append(thisbonemotionList)
#print thisbonemotionList


if isChannel ==True:
x = txt.replace('\n',"")
txt = x
x = txt.replace('\t',",")
txt = x
UnitsList.append(txt)
isMotion=True
print txt
isChannel=False

if isFrameTime == True:
x = txt.replace('\n',"")
txt = x
x = txt.replace('\t',",")
txt = x
ChannelList.append(txt)
isChannel = True
print txt
isFrameTime=False

if key3 != -1 and isFrameCount==True:
x = txt.replace('Frame Time:',"")
txt = x
x = txt.replace(' ',"")
txt = x
x = txt.replace('\n',"")
txt = x
print txt
FrameTimeList.append(txt)
isFrameTime=True

self.segmentList = segmentList
self.FrameCountList = FrameCountList
self.FrameTimeList = FrameTimeList
self.ChannelList = ChannelList
self.UnitsList = UnitsList

print
print 'Bones: ',len(self.segmentList)
print self.segmentList
print
#print self.FrameCountList
#print
#print self.FrameTimeList
#print
#print self.ChannelList
#print
#print self.UnitsList
#print


#frame = self.frameList[0]
#print 'FrameList: ', len(frame)
#print frame

def main():

file = 'FrightenRun.bva'

handle = BvaFileReader(file,'r')
handle.ReadBones()


if __name__ == "__main__":
main()



FrightenRun.bva

Segment: Hips
Frames: 22
Frame Time: 0.033333
XTRAN YTRAN ZTRAN XROT YROT ZROT XSCALE YSCALE ZSCALE
INCHES INCHES INCHES DEGREES DEGREES DEGREES INCHES INCHES INCHES
-5.59 39.43 -41.18 -1.24 -4.17 1.01 5.21 5.21 5.21
-5.59 40.23 -37.53 -0.09 -5.66 1.89 5.21 5.21 5.21
-5.52 40.60 -33.76 0.88 -5.73 1.68 5.21 5.21 5.21
-5.41 40.36 -29.91 1.12 -4.58 0.34 5.21 5.21 5.21
-5.23 39.50 -26.02 0.26 -3.17 -1.42 5.21 5.21 5.21
-5.00 38.27 -22.20 -1.38 -2.35 -2.25 5.21 5.21 5.21
-4.76 37.16 -18.58 -2.91 -2.23 -1.42 5.21 5.21 5.21
-4.54 36.51 -15.17 -3.53 -2.53 0.14 5.21 5.21 5.21
-4.35 36.41 -11.82 -3.37 -2.82 0.93 5.21 5.21 5.21
-4.22 36.67 -8.40 -3.23 -2.67 0.81 5.21 5.21 5.21
-4.15 36.82 -4.88 -3.26 -2.33 0.50 5.21 5.21 5.21
-4.16 36.86 -1.27 -3.43 -1.89 0.09 5.21 5.21 5.21
-4.23 36.81 2.40 -3.68 -1.39 -0.38 5.21 5.21 5.21
-4.34 36.72 6.11 -3.98 -0.88 -0.85 5.21 5.21 5.21
-4.49 36.62 9.85 -4.28 -0.42 -1.29 5.21 5.21 5.21
-4.66 36.55 13.59 -4.54 -0.05 -1.66 5.21 5.21 5.21
-4.85 36.55 17.31 -4.68 0.18 -1.92 5.21 5.21 5.21
-5.03 36.64 20.98 -4.67 0.22 -2.03 5.21 5.21 5.21
-5.20 36.88 24.60 -4.43 0.01 -1.95 5.21 5.21 5.21
-5.35 37.30 28.14 -3.91 -0.48 -1.65 5.21 5.21 5.21
-5.47 37.93 31.57 -3.06 -1.31 -1.05 5.21 5.21 5.21
-5.55 38.75 35.00 -2.04 -2.72 0.01 5.21 5.21 5.21
Segment: Chest
Frames: 22
Frame Time: 0.033333
XTRAN YTRAN ZTRAN XROT YROT ZROT XSCALE YSCALE ZSCALE
INCHES INCHES INCHES DEGREES DEGREES DEGREES INCHES INCHES INCHES
-5.68 44.64 -41.30 29.52 -1.33 -6.09 18.65 18.65 18.65
-5.76 45.43 -37.54 29.42 2.16 -8.80 18.65 18.65 18.65
-5.68 45.81 -33.68 28.38 5.93 -11.23 18.65 18.65 18.65
-5.44 45.57 -29.81 26.58 9.20 -12.86 18.65 18.65 18.65
-5.10 44.70 -25.99 24.77 10.99 -13.72 18.65 18.65 18.65
-4.79 43.48 -22.33 23.60 10.56 -14.20 18.65 18.65 18.65
-4.63 42.36 -18.85 23.43 6.49 -14.59 18.65 18.65 18.65
-4.55 41.71 -15.49 23.88 -2.65 -14.43 18.65 18.65 18.65
-4.44 41.61 -12.13 24.62 -14.18 -13.55 18.65 18.65 18.65
-4.29 41.87 -8.69 25.91 -21.66 -12.21 18.65 18.65 18.65
-4.20 42.02 -5.18 26.86 -26.14 -10.72 18.65 18.65 18.65
-4.17 42.06 -1.59 27.53 -27.79 -9.15 18.65 18.65 18.65
-4.19 42.01 2.06 27.99 -27.24 -7.59 18.65 18.65 18.65
-4.26 41.92 5.75 28.25 -25.17 -6.10 18.65 18.65 18.65
-4.37 41.81 9.46 28.34 -22.21 -4.76 18.65 18.65 18.65
-4.51 41.74 13.17 28.30 -18.90 -3.60 18.65 18.65 18.65
-4.67 41.74 16.88 28.17 -15.61 -2.68 18.65 18.65 18.65
-4.85 41.83 20.56 28.04 -12.56 -2.04 18.65 18.65 18.65
-5.03 42.07 24.20 28.00 -9.88 -1.76 18.65 18.65 18.65
-5.20 42.49 27.78 28.15 -7.58 -1.93 18.65 18.65 18.65
-5.37 43.13 31.29 28.61 -5.63 -2.73 18.65 18.65 18.65
-5.55 43.95 34.81 29.22 -3.49 -4.32 18.65 18.65 18.65
Segment: Neck
Frames: 22
Frame Time: 0.033333
XTRAN YTRAN ZTRAN XROT YROT ZROT XSCALE YSCALE ZSCALE
INCHES INCHES INCHES DEGREES DEGREES DEGREES INCHES INCHES INCHES
-3.96 60.78 -32.11 54.61 -9.53 8.80 5.45 5.45 5.45
-3.28 61.49 -28.37 57.15 -0.68 -3.18 5.45 5.45 5.45
-2.48 61.91 -24.82 58.89 7.89 -13.05 5.45 5.45 5.45
-1.73 61.83 -21.47 59.72 14.70 -19.75 5.45 5.45 5.45
-1.08 61.15 -18.18 59.57 17.51 -21.71 5.45 5.45 5.45
-0.60 60.04 -14.86 58.98 15.14 -18.66 5.45 5.45 5.45
-0.32 58.92 -11.43 58.31 6.44 -11.64 5.45 5.45 5.45
-0.30 58.23 -7.94 58.21 -9.22 -2.14 5.45 5.45 5.45
-0.47 58.10 -4.36 57.76 -28.23 8.77 5.45 5.45 5.45
-0.74 58.27 -0.55 56.38 -40.80 17.46 5.45 5.45 5.45
-1.10 58.37 3.25 54.90 -48.89 25.07 5.45 5.45 5.45
-1.54 58.39 7.03 53.39 -52.62 31.42 5.45 5.45 5.45
-2.02 58.33 10.81 51.67 -52.57 36.31 5.45 5.45 5.45
-2.52 58.25 14.58 49.54 -49.75 39.91 5.45 5.45 5.45
-3.01 58.17 18.31 47.13 -45.54 42.63 5.45 5.45 5.45
-3.48 58.13 22.02 44.87 -41.08 44.57 5.45 5.45 5.45
-3.90 58.16 25.68 43.25 -36.97 45.52 5.45 5.45 5.45
-4.26 58.28 29.33 42.65 -33.31 45.10 5.45 5.45 5.45
-4.52 58.53 32.95 43.31 -29.91 42.79 5.45 5.45 5.45
-4.65 58.93 36.58 45.38 -26.36 37.93 5.45 5.45 5.45
-4.59 59.48 40.22 48.68 -21.94 29.67 5.45 5.45 5.45
-4.33 60.18 43.92 52.23 -15.64 18.30 5.45 5.45 5.45
Segment: Head
Frames: 22
Frame Time: 0.033333
XTRAN YTRAN ZTRAN XROT YROT ZROT XSCALE YSCALE ZSCALE
INCHES INCHES INCHES DEGREES DEGREES DEGREES INCHES INCHES INCHES
-4.44 63.90 -27.67 14.12 0.72 -3.29 3.87 3.87 3.87
-3.11 64.44 -23.80 16.08 4.26 -11.75 3.87 3.87 3.87
-1.85 64.65 -20.15 17.41 8.21 -16.97 3.87 3.87 3.87
-0.80 64.42 -16.76 18.15 11.74 -19.13 3.87 3.87 3.87
-0.06 63.72 -13.48 18.07 13.81 -18.37 3.87 3.87 3.87
0.30 62.70 -10.19 17.47 13.71 -15.51 3.87 3.87 3.87
0.26 61.73 -6.79 16.75 9.90 -13.36 3.87 3.87 3.87
-0.19 61.09 -3.31 17.70 1.24 -14.80 3.87 3.87 3.87
-0.91 60.97 0.25 20.93 -9.77 -17.74 3.87 3.87 3.87
-1.65 61.15 3.99 23.18 -16.81 -16.87 3.87 3.87 3.87
-2.43 61.21 7.71 23.95 -20.70 -12.59 3.87 3.87 3.87
-3.23 61.16 11.41 22.57 -21.45 -5.54 3.87 3.87 3.87
-4.02 61.06 15.09 19.28 -19.66 2.96 3.87 3.87 3.87
-4.78 60.96 18.72 14.99 -16.47 11.49 3.87 3.87 3.87
-5.52 60.90 22.31 10.69 -13.09 18.92 3.87 3.87 3.87
-6.19 60.88 25.86 7.09 -10.14 24.59 3.87 3.87 3.87
-6.73 60.94 29.42 4.60 -7.78 28.23 3.87 3.87 3.87
-7.10 61.11 33.02 3.42 -5.94 29.62 3.87 3.87 3.87
-7.21 61.44 36.69 3.73 -4.54 28.42 3.87 3.87 3.87
-7.00 61.95 40.46 5.60 -3.47 24.03 3.87 3.87 3.87
-6.37 62.61 44.31 8.80 -2.63 15.71 3.87 3.87 3.87
-5.38 63.35 48.22 12.11 -1.24 4.73 3.87 3.87 3.87
Segment: LeftUpLeg
Frames: 22
Frame Time: 0.033333
XTRAN YTRAN ZTRAN XROT YROT ZROT XSCALE YSCALE ZSCALE
INCHES INCHES INCHES DEGREES DEGREES DEGREES INCHES INCHES INCHES
-1.69 39.51 -40.90 -28.16 -0.97 6.86 18.34 18.34 18.34
-1.70 40.36 -37.14 -31.47 -2.43 6.54 18.34 18.34 18.34
-1.64 40.71 -33.37 -31.76 -2.33 6.46 18.34 18.34 18.34
-1.51 40.38 -29.60 -29.93 -0.84 6.55 18.34 18.34 18.34
-1.33 39.40 -25.80 -27.11 0.81 6.54 18.34 18.34 18.34
-1.09 38.12 -22.04 -24.37 1.31 6.18 18.34 18.34 18.34
-0.85 37.07 -18.43 -21.67 0.51 5.68 18.34 18.34 18.34
-0.63 36.53 -15.00 -17.86 -0.85 5.38 18.34 18.34 18.34
-0.45 36.49 -11.63 -11.95 -1.91 5.22 18.34 18.34 18.34
-0.31 36.74 -8.22 -4.65 -2.33 5.10 18.34 18.34 18.34
-0.25 36.87 -4.72 1.99 -2.49 5.22 18.34 18.34 18.34
-0.25 36.87 -1.15 7.83 -2.61 5.55 18.34 18.34 18.34
-0.32 36.79 2.49 12.58 -2.74 6.05 18.34 18.34 18.34
-0.43 36.66 6.17 15.61 -2.86 6.64 18.34 18.34 18.34
-0.58 36.53 9.88 16.25 -2.78 7.19 18.34 18.34 18.34
-0.75 36.44 13.59 14.77 -2.43 7.62 18.34 18.34 18.34
-0.94 36.41 17.29 11.56 -1.81 7.91 18.34 18.34 18.34
-1.12 36.50 20.97 6.91 -1.01 8.06 18.34 18.34 18.34
-1.30 36.75 24.60 0.98 -0.16 8.07 18.34 18.34 18.34
-1.44 37.19 28.17 -6.23 0.56 7.93 18.34 18.34 18.34
-1.56 37.86 31.66 -14.94 0.96 7.63 18.34 18.34 18.34
-1.65 38.75 35.18 -23.61 0.34 7.19 18.34 18.34 18.34
Segment: LeftLowLeg
Frames: 22
Frame Time: 0.033333
XTRAN YTRAN ZTRAN XROT YROT ZROT XSCALE YSCALE ZSCALE
INCHES INCHES INCHES DEGREES DEGREES DEGREES INCHES INCHES INCHES
0.24 23.45 -32.24 62.36 -1.89 21.06 17.37 17.37 17.37
0.08 24.81 -27.57 43.84 5.33 15.91 17.37 17.37 17.37
0.12 25.22 -23.72 26.72 9.20 12.81 17.37 17.37 17.37
0.30 24.59 -20.45 13.98 10.63 9.98 17.37 17.37 17.37
0.53 23.18 -17.44 8.29 11.01 7.16 17.37 17.37 17.37
0.71 21.51 -14.47 10.79 11.31 4.93 17.37 17.37 17.37
0.84 20.11 -11.66 18.75 11.45 3.70 17.37 17.37 17.37
1.00 19.15 -9.37 27.38 11.45 3.16 17.37 17.37 17.37
1.18 18.62 -7.83 33.36 11.35 2.85 17.37 17.37 17.37
1.32 18.53 -6.73 37.23 11.09 2.64 17.37 17.37 17.37
1.42 18.61 -5.36 43.08 11.02 2.32 17.37 17.37 17.37
1.51 18.79 -3.65 51.03 11.55 1.65 17.37 17.37 17.37
1.57 18.99 -1.50 60.41 13.07 0.39 17.37 17.37 17.37
1.61 19.12 1.24 70.02 15.90 -1.75 17.37 17.37 17.37
1.62 19.06 4.74 78.80 20.75 -5.42 17.37 17.37 17.37
1.60 18.86 8.91 87.35 50.36 -33.82 17.37 17.37 17.37
1.54 18.62 13.62 84.17 180.49 -162.99 17.37 17.37 17.37
1.43 18.48 18.76 79.08 190.26 -172.18 17.37 17.37 17.37
1.28 18.59 24.29 77.36 195.58 -177.32 17.37 17.37 17.37
1.07 19.13 30.16 79.90 204.90 -186.82 17.37 17.37 17.37
0.79 20.30 36.38 85.67 266.67 -248.97 17.37 17.37 17.37
0.46 22.08 42.53 75.39 347.31 -329.36 17.37 17.37 17.37
Segment: LeftFoot
Frames: 22
Frame Time: 0.033333
XTRAN YTRAN ZTRAN XROT YROT ZROT XSCALE YSCALE ZSCALE
INCHES INCHES INCHES DEGREES DEGREES DEGREES INCHES INCHES INCHES
3.14 15.93 -47.63 49.65 -1.35 20.42 3.46 3.46 3.46
3.52 12.77 -39.60 31.60 4.51 17.24 3.46 3.46 3.46
3.56 10.09 -31.53 15.34 8.51 14.70 3.46 3.46 3.46
3.22 7.99 -24.65 3.14 10.32 12.00 3.46 3.46 3.46
2.67 6.13 -19.95 -3.30 10.92 9.40 3.46 3.46 3.46
2.17 4.51 -17.72 -4.41 11.14 7.94 3.46 3.46 3.46
1.90 3.70 -17.25 -2.79 10.85 7.97 3.46 3.46 3.46
1.85 3.75 -17.36 -0.54 10.15 8.58 3.46 3.46 3.46
1.90 4.13 -17.38 1.54 9.46 8.89 3.46 3.46 3.46
1.95 4.71 -17.24 4.66 8.84 8.68 3.46 3.46 3.46
1.93 5.94 -17.22 12.78 8.23 8.06 3.46 3.46 3.46
1.82 7.87 -17.15 24.25 7.94 7.41 3.46 3.46 3.46
1.63 10.41 -16.61 36.75 8.01 6.99 3.46 3.46 3.46
1.43 13.19 -15.09 49.19 8.23 6.99 3.46 3.46 3.46
1.31 15.71 -12.29 62.03 8.43 7.51 3.46 3.46 3.46
1.15 18.19 -8.44 74.33 7.57 9.21 3.46 3.46 3.46
1.02 20.30 -3.66 84.18 -0.49 17.99 3.46 3.46 3.46
0.98 21.74 1.71 88.04 -100.07 117.98 3.46 3.46 3.46
1.10 22.39 7.34 85.92 -124.23 142.20 3.46 3.46 3.46
1.43 22.16 13.06 85.67 -78.09 95.80 3.46 3.46 3.46
2.02 20.77 19.06 78.23 -21.70 38.97 3.46 3.46 3.46
2.69 18.31 25.72 63.04 -7.02 24.61 3.46 3.46 3.46
Segment: RightUpLeg
Frames: 22
Frame Time: 0.033333
XTRAN YTRAN ZTRAN XROT YROT ZROT XSCALE YSCALE ZSCALE
INCHES INCHES INCHES DEGREES DEGREES DEGREES INCHES INCHES INCHES
-9.49 39.36 -41.47 14.37 -1.82 -8.02 17.63 17.63 17.63
-9.48 40.10 -37.91 20.72 -1.88 -7.91 17.63 17.63 17.63
-9.41 40.50 -34.15 24.73 -1.24 -8.01 17.63 17.63 17.63
-9.30 40.35 -30.22 26.28 -0.50 -7.96 17.63 17.63 17.63
-9.13 39.59 -26.23 25.53 -0.17 -7.70 17.63 17.63 17.63
-8.90 38.42 -22.36 22.46 -0.24 -7.27 17.63 17.63 17.63
-8.66 37.25 -18.74 16.70 -0.58 -6.73 17.63 17.63 17.63
-8.45 36.49 -15.34 7.85 -1.61 -6.28 17.63 17.63 17.63
-8.26 36.34 -12.01 -3.50 -3.26 -5.95 17.63 17.63 17.63
-8.12 36.61 -8.58 -15.96 -4.40 -5.68 17.63 17.63 17.63
-8.06 36.78 -5.04 -29.58 -5.36 -6.11 17.63 17.63 17.63
-8.07 36.84 -1.40 -40.14 -6.17 -7.12 17.63 17.63 17.63
-8.14 36.83 2.30 -43.03 -6.40 -8.17 17.63 17.63 17.63
-8.25 36.77 6.05 -40.12 -5.91 -8.89 17.63 17.63 17.63
-8.40 36.71 9.82 -36.34 -5.25 -9.51 17.63 17.63 17.63
-8.57 36.66 13.58 -31.86 -4.45 -9.96 17.63 17.63 17.63
-8.75 36.68 17.32 -26.83 -3.60 -10.22 17.63 17.63 17.63
-8.94 36.78 21.00 -21.25 -2.80 -10.27 17.63 17.63 17.63
-9.11 37.02 24.60 -15.08 -2.13 -10.13 17.63 17.63 17.63
-9.26 37.41 28.10 -8.13 -1.64 -9.76 17.63 17.63 17.63
-9.38 37.99 31.48 -0.12 -1.34 -9.14 17.63 17.63 17.63
-9.46 38.74 34.81 8.47 -1.45 -8.39 17.63 17.63 17.63
Segment: RightLowLeg
Frames: 22
Frame Time: 0.033333
XTRAN YTRAN ZTRAN XROT YROT ZROT XSCALE YSCALE ZSCALE
INCHES INCHES INCHES DEGREES DEGREES DEGREES INCHES INCHES INCHES
-11.87 22.45 -45.84 28.49 -17.58 -0.10 17.14 17.14 17.14
-11.75 23.76 -44.15 29.41 -20.03 -0.34 17.14 17.14 17.14
-11.64 24.64 -41.53 33.98 -23.00 -0.16 17.14 17.14 17.14
-11.49 24.69 -38.03 43.62 -24.03 0.27 17.14 17.14 17.14
-11.26 23.83 -33.83 58.03 -21.27 0.57 17.14 17.14 17.14
-10.96 22.26 -29.10 74.68 -14.49 -0.80 17.14 17.14 17.14
-10.64 20.48 -23.80 88.75 64.41 -75.36 17.14 17.14 17.14
-10.36 19.13 -17.75 80.41 156.55 -166.10 17.14 17.14 17.14
-10.08 18.84 -10.94 78.73 152.64 -162.50 17.14 17.14 17.14
-9.80 19.74 -3.73 83.71 124.63 -134.69 17.14 17.14 17.14
-9.69 21.54 3.66 81.80 27.11 -37.38 17.14 17.14 17.14
-9.74 23.47 9.96 71.80 5.41 -16.07 17.14 17.14 17.14
-9.97 24.07 14.33 62.46 -0.95 -10.47 17.14 17.14 17.14
-10.33 23.45 17.41 53.53 -4.88 -7.52 17.14 17.14 17.14
-10.74 22.70 20.27 45.66 -7.98 -5.20 17.14 17.14 17.14
-11.16 21.92 22.89 39.42 -10.40 -3.23 17.14 17.14 17.14
-11.54 21.19 25.27 34.89 -12.23 -1.57 17.14 17.14 17.14
-11.87 20.62 27.39 31.88 -13.60 -0.25 17.14 17.14 17.14
-12.10 20.26 29.19 30.09 -14.64 0.67 17.14 17.14 17.14
-12.22 20.21 30.60 29.25 -15.46 1.09 17.14 17.14 17.14
-12.18 20.59 31.51 29.10 -16.04 0.94 17.14 17.14 17.14
-12.00 21.49 32.21 28.84 -16.61 0.35 17.14 17.14 17.14
Segment: RightFoot
Frames: 22
Frame Time: 0.033333
XTRAN YTRAN ZTRAN XROT YROT ZROT XSCALE YSCALE ZSCALE
INCHES INCHES INCHES DEGREES DEGREES DEGREES INCHES INCHES INCHES
-11.90 7.38 -54.02 16.45 -16.07 -4.03 3.75 3.75 3.75
-11.84 8.83 -52.57 26.48 -19.48 -1.53 3.75 3.75 3.75
-11.68 10.43 -51.11 38.40 -24.42 2.24 3.75 3.75 3.75
-11.44 12.28 -49.85 50.95 -27.91 5.52 3.75 3.75 3.75
-11.17 14.75 -48.37 64.49 -26.48 6.51 3.75 3.75 3.75
-11.02 17.73 -45.63 78.64 -19.61 4.46 3.75 3.75 3.75
-11.00 20.39 -40.94 88.82 106.26 -117.22 3.75 3.75 3.75
-11.04 21.90 -34.65 82.95 147.30 -156.75 3.75 3.75 3.75
-11.09 22.03 -27.75 84.06 119.74 -129.28 3.75 3.75 3.75
-11.13 21.06 -20.77 81.54 37.74 -47.33 3.75 3.75 3.75
-11.17 19.59 -13.30 72.99 12.84 -22.80 3.75 3.75 3.75
-11.22 18.33 -6.32 63.31 3.76 -14.29 3.75 3.75 3.75
-11.41 16.28 -0.87 52.88 -0.73 -10.73 3.75 3.75 3.75
-11.67 13.35 3.63 42.14 -3.91 -8.83 3.75 3.75 3.75
-11.83 10.77 8.01 31.76 -6.55 -7.46 3.75 3.75 3.75
-11.91 8.70 12.01 22.41 -8.68 -6.55 3.75 3.75 3.75
-11.93 7.14 15.47 14.69 -10.35 -5.99 3.75 3.75 3.75
-11.93 6.06 18.34 8.96 -11.66 -5.69 3.75 3.75 3.75
-11.93 5.43 20.59 5.49 -12.69 -5.56 3.75 3.75 3.75
-11.93 5.26 22.22 4.50 -13.49 -5.53 3.75 3.75 3.75
-11.93 5.61 23.18 6.42 -14.06 -5.42 3.75 3.75 3.75
-11.91 6.48 23.95 10.96 -14.78 -4.96 3.75 3.75 3.75
Segment: LeftCollar
Frames: 22
Frame Time: 0.033333
XTRAN YTRAN ZTRAN XROT YROT ZROT XSCALE YSCALE ZSCALE
INCHES INCHES INCHES DEGREES DEGREES DEGREES INCHES INCHES INCHES
-3.21 57.64 -31.65 27.08 -16.88 16.75 5.54 5.54 5.54
-2.56 58.34 -27.97 27.99 -16.44 15.60 5.54 5.54 5.54
-1.78 58.75 -24.43 28.38 -15.01 13.44 5.54 5.54 5.54
-1.00 58.68 -21.06 27.96 -12.06 11.21 5.54 5.54 5.54
-0.35 58.01 -17.72 26.96 -7.27 11.42 5.54 5.54 5.54
0.10 56.91 -14.33 25.71 -0.95 13.27 5.54 5.54 5.54
0.23 55.78 -10.81 23.67 5.06 14.87 5.54 5.54 5.54
-0.05 55.07 -7.16 20.04 7.58 14.11 5.54 5.54 5.54
-0.58 54.96 -3.47 16.72 5.94 11.14 5.54 5.54 5.54
-1.06 55.15 0.33 16.96 3.41 7.83 5.54 5.54 5.54
-1.51 55.25 4.09 18.15 0.71 5.92 5.54 5.54 5.54
-1.92 55.26 7.85 19.39 -1.73 5.65 5.54 5.54 5.54
-2.30 55.19 11.60 20.41 -3.85 6.62 5.54 5.54 5.54
-2.63 55.09 15.34 21.18 -5.75 8.34 5.54 5.54 5.54
-2.94 55.00 19.06 21.80 -7.57 10.35 5.54 5.54 5.54
-3.22 54.97 22.75 22.36 -9.39 12.30 5.54 5.54 5.54
-3.47 55.01 26.40 22.90 -11.18 13.95 5.54 5.54 5.54
-3.68 55.15 30.02 23.45 -12.87 15.21 5.54 5.54 5.54
-3.83 55.42 33.61 24.02 -14.36 16.08 5.54 5.54 5.54
-3.89 55.82 37.20 24.66 -15.56 16.65 5.54 5.54 5.54
-3.81 56.37 40.79 25.43 -16.40 17.02 5.54 5.54 5.54
-3.56 57.06 44.42 26.34 -16.84 17.11 5.54 5.54 5.54
Segment: LeftUpArm
Frames: 22
Frame Time: 0.033333
XTRAN YTRAN ZTRAN XROT YROT ZROT XSCALE YSCALE ZSCALE
INCHES INCHES INCHES DEGREES DEGREES DEGREES INCHES INCHES INCHES
2.08 58.47 -30.22 6.44 -38.75 105.96 11.96 11.96 11.96
2.76 59.06 -26.59 7.12 -32.52 112.82 11.96 11.96 11.96
3.59 59.33 -23.17 7.00 -25.44 118.04 11.96 11.96 11.96
4.42 59.20 -20.04 6.12 -16.40 121.28 11.96 11.96 11.96
5.10 58.79 -17.09 4.01 -6.24 122.42 11.96 11.96 11.96
5.50 58.14 -14.25 0.20 3.93 120.88 11.96 11.96 11.96
5.52 57.38 -11.25 -4.87 14.32 116.81 11.96 11.96 11.96
5.22 56.65 -7.85 -9.61 24.63 110.62 11.96 11.96 11.96
4.80 56.19 -4.02 -13.41 33.71 103.41 11.96 11.96 11.96
4.41 56.00 0.02 -16.41 40.50 96.66 11.96 11.96 11.96
4.00 55.85 4.03 -18.71 44.13 90.42 11.96 11.96 11.96
3.59 55.75 8.00 -20.25 43.17 84.64 11.96 11.96 11.96
3.21 55.69 11.95 -20.88 30.87 79.33 11.96 11.96 11.96
2.85 55.69 15.86 -20.38 5.00 74.70 11.96 11.96 11.96
2.51 55.72 19.74 -18.68 -24.67 71.33 11.96 11.96 11.96
2.19 55.79 23.58 -16.24 -42.51 69.80 11.96 11.96 11.96
1.90 55.91 27.38 -13.47 -48.81 70.18 11.96 11.96 11.96
1.66 56.10 31.15 -10.36 -50.65 72.46 11.96 11.96 11.96
1.48 56.37 34.87 -6.72 -51.10 76.80 11.96 11.96 11.96
1.40 56.76 38.55 -2.55 -50.25 83.26 11.96 11.96 11.96
1.47 57.29 42.20 1.83 -48.01 91.54 11.96 11.96 11.96
1.72 57.94 45.86 5.16 -44.35 100.08 11.96 11.96 11.96
Segment: LeftLowArm
Frames: 22
Frame Time: 0.033333
XTRAN YTRAN ZTRAN XROT YROT ZROT XSCALE YSCALE ZSCALE
INCHES INCHES INCHES DEGREES DEGREES DEGREES INCHES INCHES INCHES
13.50 61.73 -31.56 -54.46 -72.24 27.98 9.93 9.93 9.93
13.69 63.66 -28.07 -59.48 -63.01 45.63 9.93 9.93 9.93
14.07 64.91 -24.63 -62.03 -45.59 70.54 9.93 9.93 9.93
14.58 65.38 -21.31 -61.58 -22.81 98.03 9.93 9.93 9.93
15.17 65.19 -17.93 -58.01 2.70 123.79 9.93 9.93 9.93
15.76 64.28 -14.29 -51.50 29.99 144.89 9.93 9.93 9.93
16.15 62.75 -10.24 -43.73 57.03 160.73 9.93 9.93 9.93
16.25 60.81 -5.85 -37.23 78.32 172.04 9.93 9.93 9.93
16.11 58.89 -1.24 -34.38 91.67 179.13 9.93 9.93 9.93
15.80 57.33 3.40 -35.66 100.56 183.72 9.93 9.93 9.93
15.33 55.93 7.86 -39.05 108.46 187.75 9.93 9.93 9.93
14.77 54.70 12.14 -45.12 116.68 192.19 9.93 9.93 9.93
14.19 53.63 16.21 -55.03 126.98 198.76 9.93 9.93 9.93
13.66 52.73 20.02 -69.68 145.75 214.68 9.93 9.93 9.93
13.24 52.10 23.57 -79.43 224.98 293.96 9.93 9.93 9.93
12.97 51.83 26.93 -65.28 273.42 346.00 9.93 9.93 9.93
12.84 51.97 30.17 -52.29 279.65 356.94 9.93 9.93 9.93
12.87 52.55 33.30 -44.54 280.82 361.89 9.93 9.93 9.93
13.04 53.66 36.27 -41.01 281.66 365.34 9.93 9.93 9.93
13.27 55.36 39.08 -40.95 282.76 368.68 9.93 9.93 9.93
13.42 57.61 41.82 -44.39 283.92 373.03 9.93 9.93 9.93
13.45 60.03 44.79 -50.02 285.20 379.76 9.93 9.93 9.93
Segment: LeftHand
Frames: 22
Frame Time: 0.033333
XTRAN YTRAN ZTRAN XROT YROT ZROT XSCALE YSCALE ZSCALE
INCHES INCHES INCHES DEGREES DEGREES DEGREES INCHES INCHES INCHES
16.21 56.64 -23.48 -55.15 -71.92 28.36 7.00 7.00 7.00
17.30 60.13 -19.52 -60.18 -62.63 46.07 7.00 7.00 7.00
18.46 63.36 -15.86 -62.88 -45.27 70.89 7.00 7.00 7.00
19.26 66.04 -12.58 -62.71 -22.22 98.69 7.00 7.00 7.00
19.54 68.11 -9.51 -59.31 3.98 125.28 7.00 7.00 7.00
19.32 69.33 -6.52 -52.55 31.82 147.21 7.00 7.00 7.00
18.52 69.53 -3.37 -43.99 58.67 163.09 7.00 7.00 7.00
17.35 68.64 0.15 -36.75 79.25 173.58 7.00 7.00 7.00
16.24 67.08 4.36 -33.65 92.01 179.72 7.00 7.00 7.00
15.28 65.38 9.19 -34.94 100.51 183.64 7.00 7.00 7.00
14.29 63.57 14.12 -38.43 108.06 187.12 7.00 7.00 7.00
13.29 61.55 19.18 -44.65 115.88 191.05 7.00 7.00 7.00
12.36 59.01 24.35 -54.73 125.64 197.13 7.00 7.00 7.00
11.70 55.56 29.34 -69.41 143.59 212.39 7.00 7.00 7.00
11.58 51.36 33.33 -79.58 219.81 288.70 7.00 7.00 7.00
11.96 47.80 35.95 -66.11 270.71 343.02 7.00 7.00 7.00
12.52 45.90 38.03 -53.27 277.84 354.65 7.00 7.00 7.00
13.11 45.48 40.26 -45.52 279.53 360.05 7.00 7.00 7.00
13.74 46.19 42.79 -41.94 280.73 363.93 7.00 7.00 7.00
14.40 47.94 45.59 -41.82 282.14 367.74 7.00 7.00 7.00
15.02 50.69 48.77 -45.18 283.65 372.64 7.00 7.00 7.00
15.61 54.02 52.39 -50.74 285.31 379.91 7.00 7.00 7.00
Segment: RightCollar
Frames: 22
Frame Time: 0.033333
XTRAN YTRAN ZTRAN XROT YROT ZROT XSCALE YSCALE ZSCALE
INCHES INCHES INCHES DEGREES DEGREES DEGREES INCHES INCHES INCHES
-5.44 57.90 -31.70 28.24 -2.21 -27.40 6.07 6.07 6.07
-4.78 58.64 -27.90 27.92 -1.95 -24.83 6.07 6.07 6.07
-3.98 59.08 -24.23 27.09 -3.44 -21.23 6.07 6.07 6.07
-3.20 59.02 -20.74 25.83 -7.30 -17.47 6.07 6.07 6.07
-2.53 58.36 -17.33 24.20 -12.78 -16.80 6.07 6.07 6.07
-2.08 57.29 -13.96 22.69 -18.83 -19.07 6.07 6.07 6.07
-1.95 56.24 -10.57 22.22 -24.12 -23.68 6.07 6.07 6.07
-2.20 55.67 -7.26 23.78 -27.53 -29.57 6.07 6.07 6.07
-2.63 55.70 -3.97 27.82 -29.10 -34.62 6.07 6.07 6.07
-3.02 55.94 -0.41 32.06 -31.88 -37.07 6.07 6.07 6.07
-3.40 56.07 3.21 35.14 -32.52 -38.37 6.07 6.07 6.07
-3.80 56.05 6.92 36.82 -31.28 -39.15 6.07 6.07 6.07
-4.21 55.93 10.69 37.22 -28.82 -39.61 6.07 6.07 6.07
-4.60 55.75 14.50 36.61 -25.63 -39.76 6.07 6.07 6.07
-4.98 55.57 18.32 35.29 -22.06 -39.52 6.07 6.07 6.07
-5.32 55.44 22.11 33.59 -18.38 -38.85 6.07 6.07 6.07
-5.61 55.39 25.86 31.81 -14.79 -37.78 6.07 6.07 6.07
-5.86 55.46 29.59 30.21 -11.43 -36.37 6.07 6.07 6.07
-6.03 55.67 33.27 28.96 -8.43 -34.72 6.07 6.07 6.07
-6.10 56.04 36.94 28.21 -5.95 -32.90 6.07 6.07 6.07
-6.03 56.58 40.60 28.08 -4.20 -30.96 6.07 6.07 6.07
-5.78 57.30 44.30 28.26 -2.95 -28.98 6.07 6.07 6.07
Segment: RightUpArm
Frames: 22
Frame Time: 0.033333
XTRAN YTRAN ZTRAN XROT YROT ZROT XSCALE YSCALE ZSCALE
INCHES INCHES INCHES DEGREES DEGREES DEGREES INCHES INCHES INCHES
-10.77 60.79 -31.90 3.71 -24.00 -110.47 11.82 11.82 11.82
-10.24 61.27 -28.08 2.08 -5.56 -107.93 11.82 11.82 11.82
-9.57 61.42 -24.55 1.64 2.83 -106.15 11.82 11.82 11.82
-8.84 61.15 -21.43 2.20 4.03 -104.80 11.82 11.82 11.82
-8.04 60.60 -18.55 3.72 3.55 -103.94 11.82 11.82 11.82
-7.26 59.88 -15.76 6.19 2.24 -103.85 11.82 11.82 11.82
-6.64 59.32 -12.87 9.65 0.78 -104.91 11.82 11.82 11.82
-6.33 59.31 -9.83 14.03 0.00 -107.59 11.82 11.82 11.82
-6.22 59.84 -6.58 18.24 0.27 -112.27 11.82 11.82 11.82
-6.10 60.41 -3.13 21.31 0.97 -118.19 11.82 11.82 11.82
-6.25 60.72 0.54 23.31 -0.53 -123.18 11.82 11.82 11.82
-6.63 60.79 4.40 24.41 -5.26 -127.03 11.82 11.82 11.82
-7.17 60.68 8.36 24.79 -13.45 -129.84 11.82 11.82 11.82
-7.81 60.45 12.40 24.60 -22.36 -131.72 11.82 11.82 11.82
-8.48 60.17 16.45 23.95 -29.59 -132.70 11.82 11.82 11.82
-9.14 59.88 20.51 22.89 -35.03 -132.78 11.82 11.82 11.82
-9.75 59.63 24.55 21.39 -39.64 -131.87 11.82 11.82 11.82
-10.29 59.48 28.55 19.39 -44.39 -129.92 11.82 11.82 11.82
-10.72 59.44 32.50 16.78 -50.08 -126.88 11.82 11.82 11.82
-11.01 59.57 36.39 13.50 -54.67 -122.79 11.82 11.82 11.82
-11.11 59.88 40.20 9.55 -56.41 -117.80 11.82 11.82 11.82
-11.01 60.36 44.03 5.73 -55.74 -113.06 11.82 11.82 11.82
Segment: RightLowArm
Frames: 22
Frame Time: 0.033333
XTRAN YTRAN ZTRAN XROT YROT ZROT XSCALE YSCALE ZSCALE
INCHES INCHES INCHES DEGREES DEGREES DEGREES INCHES INCHES INCHES
-21.82 64.92 -32.67 -33.85 -32.23 -127.05 10.65 10.65 10.65
-21.48 64.91 -28.51 -32.32 -26.20 -118.30 10.65 10.65 10.65
-20.92 64.71 -24.89 -30.25 -21.21 -112.11 10.65 10.65 10.65
-20.26 64.16 -21.89 -28.48 -19.05 -108.94 10.65 10.65 10.65
-19.49 63.44 -19.32 -27.34 -20.27 -108.76 10.65 10.65 10.65
-18.67 62.69 -17.04 -26.00 -23.62 -110.97 10.65 10.65 10.65
-17.90 62.32 -14.85 -23.74 -26.23 -114.32 10.65 10.65 10.65
-17.26 62.78 -12.69 -21.07 -25.04 -117.54 10.65 10.65 10.65
-16.61 64.10 -10.28 -18.74 -20.07 -120.21 10.65 10.65 10.65
-15.81 65.61 -7.42 -17.10 -14.44 -122.86 10.65 10.65 10.65
-15.34 66.66 -4.13 -16.61 -12.23 -126.89 10.65 10.65 10.65
-15.23 67.27 -0.49 -17.16 -13.18 -132.20 10.65 10.65 10.65
-15.41 67.55 3.41 -18.46 -16.21 -138.35 10.65 10.65 10.65
-15.83 67.61 7.47 -20.23 -20.31 -144.79 10.65 10.65 10.65
-16.42 67.50 11.66 -22.22 -24.74 -150.87 10.65 10.65 10.65
-17.13 67.28 15.91 -24.29 -29.04 -155.95 10.65 10.65 10.65
-17.95 66.98 20.24 -26.39 -33.01 -159.44 10.65 10.65 10.65
-18.84 66.63 24.62 -28.53 -36.52 -160.84 10.65 10.65 10.65
-19.78 66.23 29.08 -30.69 -39.32 -159.55 10.65 10.65 10.65
-20.67 65.79 33.63 -32.73 -40.81 -154.83 10.65 10.65 10.65
-21.43 65.31 38.24 -34.11 -39.85 -145.81 10.65 10.65 10.65
-21.83 64.97 42.85 -34.34 -36.25 -134.71 10.65 10.65 10.65
Segment: RightHand
Frames: 22
Frame Time: 0.033333
XTRAN YTRAN ZTRAN XROT YROT ZROT XSCALE YSCALE ZSCALE
INCHES INCHES INCHES DEGREES DEGREES DEGREES INCHES INCHES INCHES
-28.88 70.25 -26.74 -29.91 -31.93 -126.59 7.00 7.00 7.00
-29.41 69.18 -22.82 -27.81 -26.10 -118.24 7.00 7.00 7.00
-29.44 68.17 -19.53 -25.32 -21.32 -112.53 7.00 7.00 7.00
-29.11 67.20 -16.81 -23.35 -19.24 -109.60 7.00 7.00 7.00
-28.44 66.49 -14.43 -22.23 -20.40 -109.29 7.00 7.00 7.00
-27.61 66.12 -12.37 -21.01 -23.61 -111.15 7.00 7.00 7.00
-26.79 66.34 -10.56 -18.95 -26.13 -114.26 7.00 7.00 7.00
-26.07 67.37 -8.86 -16.51 -24.98 -117.58 7.00 7.00 7.00
-25.32 69.17 -6.86 -14.35 -20.12 -120.64 7.00 7.00 7.00
-24.36 71.13 -4.29 -12.84 -14.59 -123.72 7.00 7.00 7.00
-23.50 72.78 -1.09 -12.48 -12.43 -127.91 7.00 7.00 7.00
-22.76 74.10 2.65 -13.16 -13.38 -133.16 7.00 7.00 7.00
-22.13 75.10 6.78 -14.61 -16.37 -139.13 7.00 7.00 7.00
-21.59 75.77 11.16 -16.60 -20.43 -145.33 7.00 7.00 7.00
-21.21 76.11 15.68 -18.87 -24.81 -151.20 7.00 7.00 7.00
-21.09 76.14 20.30 -21.24 -29.07 -156.11 7.00 7.00 7.00
-21.30 75.91 24.97 -23.60 -33.00 -159.49 7.00 7.00 7.00
-21.92 75.47 29.71 -25.90 -36.47 -160.79 7.00 7.00 7.00
-22.97 74.81 34.52 -28.11 -39.21 -159.38 7.00 7.00 7.00
-24.48 73.90 39.39 -30.03 -40.60 -154.49 7.00 7.00 7.00
-26.38 72.61 44.22 -31.08 -39.52 -145.27 7.00 7.00 7.00
-28.08 71.16 48.86 -30.82 -35.88 -134.11 7.00 7.00 7.00



import_bvh.py


class BvhFileReader(object):

def __init__(self, name, attribute):
self.filename = name
self.attribute = attribute

self.file = open(self.filename, self.attribute)
print "Processing File %s" % self.filename
self.frameList=[]
self.BoneHierarchyList=[]
self.FrameTime=""

def __del__(self):
self.file.close()
print "Closing File %s" % self.filename


def ReadBones(self):

#j=0
txt = ""
isMotion = False

isRoot = False
isJoint = False
isEndSite = False
motionList=[]
channelList=[]

isOffset=False
isChannel=False
boneInfo = ""
boneList = []

channelListSize=[]

hierarchyList=[]
hierarchyList.append('ROOT')

#frameList=[]


for line in self.file:

txt = line

key1 = txt.find('ROOT')
key2 = txt.find('JOINT')
key3 = txt.find('End')
key4 = txt.find('Frame Time:')
key5 = txt.find('OFFSET')
key6 = txt.find('CHANNELS')

key7 = txt.find('{')
key8 = txt.find('}')



if isMotion==True:
motionList = txt.split(" ")
count = len (motionList)
#print "motion-chan " ,count

kk=0
thisboneList=[]
count = len( channelListSize)
for ii in range(0,count):

chancount = channelListSize[ii]
thisbone=""
#print "chan :" ,chancount
for jj in range (0, chancount):

if jj != (chancount-1):
thisbone = thisbone + motionList[kk] + ","
else:
thisbone = thisbone + motionList[kk]

kk=kk+1

thisboneList.append(thisbone)

#print thisboneList
#print
self.frameList.append(thisboneList)



if key7 != -1 and isRoot==True:
hierarchyList.append(boneInfo)
#print " push ", boneInfo

if key7 != -1 and isJoint==True:
hierarchyList.append(boneInfo)
#print " push ", boneInfo

if key7 != -1 and isEndSite==True:
hierarchyList.append(boneInfo)
#print " push ", boneInfo



if key8 != -1 :
parent = hierarchyList.pop()
#print "pop ", parent





if (isRoot == True or isJoint==True) and isOffset==True :
if key6 != -1:

#print " CHANNELS flag set"

x = txt.replace('CHANNELS ',"")
txt = x
x = txt.replace('\t',"")
txt = x
x = txt.replace('\n',"")
txt = x
x = txt.replace('position',"pos")
txt = x
x = txt.replace('rotation',"rot")
txt = x

channelList = txt.split(" ")
count = len (channelList)

#print channelList
channelListSize.append( int(channelList[0]) )

chan=""
for jj in range(1,count):
chan = chan + channelList[jj]
if jj != (count-1):
chan = chan + ","

boneInfo = boneInfo + chan

thisbone = hierarchyList.pop()
parent = hierarchyList.pop()
boneInfo = boneInfo + ":" + parent
hierarchyList.append(parent)
hierarchyList.append(thisbone)
#print "\n ",boneInfo,

isRoot=False
isOffset=False
isJoint=False
boneList.append(boneInfo)
self.BoneHierarchyList.append(boneInfo)
boneInfo=""



if key5 != -1:
x = txt.replace('OFFSET',"")
txt = x
x = txt.replace('\t',"")
txt = x
x = txt.replace('\n',"")
txt = x
x = txt.replace(' '," ")
txt = x


boneInfo = boneInfo + ":" + txt + ":"
isOffset = True
#print txt
#print " offset flag set"



if isEndSite==True and isOffset==True and isRoot == False and isJoint==False:

thisbone = hierarchyList.pop()
parent = hierarchyList.pop()
boneInfo = boneInfo + "NONE:" + parent
hierarchyList.append(parent)
hierarchyList.append(thisbone)

self.BoneHierarchyList.append(boneInfo)
#print "\n ",boneInfo
isEndSite=False
isOffset =False
#print




if key1 != -1:
x = txt.replace('ROOT ',"")
txt = x
x = txt.replace('\t',"")
txt = x
x = txt.replace('\n',"")

isRoot = True
boneInfo = x
#print " root flag set"


if key2 != -1:
x = txt.replace('JOINT ',"")
txt = x
x = txt.replace('\t',"")
txt = x
x = txt.replace('\n',"")
txt = x
x = txt.replace(' ',".")

isJoint = True
boneInfo = x
#print " joint flag set"


if key3 != -1:
x = txt.replace('End ',"")
txt = x
x = txt.replace('\t',"")
txt = x
x = txt.replace('\n',"")
boneInfo = x
isEndSite = True
#print " END flag set"


if key4 != -1:
isMotion=True
x = txt.replace('Frame Time: ',"")
txt = x
x = txt.replace('\n',"")
txt = x
self.FrameTime = txt
#print txt


def main():

file = 'sexy.bvh'
#file = 'list.bvh'
handle = BvhFileReader(file,'r')
handle.ReadBones()

count = len(handle.BoneHierarchyList)
print "\nBones: ", count
for ii in range(0,count):
print handle.BoneHierarchyList[ii]

print "\nFrame Time: ", handle.FrameTime

count = len(handle.frameList)
print "Frames: " ,count

if __name__ == "__main__":
main()


sexy.bvh

HIERARCHY
ROOT Hip
{
OFFSET 0.00 0.00 0.00
CHANNELS 6 Xposition Yposition Zposition Xrotation Zrotation Yrotation
JOINT Abdomen
{
OFFSET 0.000000 0.000000 0.000000
CHANNELS 3 Xrotation Zrotation Yrotation
JOINT Chest
{
OFFSET 0.000000 2.777286 -0.023671
CHANNELS 3 Xrotation Zrotation Yrotation
JOINT neckDummy
{
OFFSET 0.000000 9.927062 -0.986511
CHANNELS 3 Xrotation Yrotation Zrotation
JOINT Neck
{
OFFSET 0.000000 2.219609 0.201362
CHANNELS 3 Xrotation Zrotation Yrotation
JOINT Head
{
OFFSET 0.000000 3.192896 0.565150
CHANNELS 3 Xrotation Zrotation Yrotation
End Site
{
OFFSET 0.000000 10.377339 0.000000
}
}
}
}
JOINT Left Collar
{
OFFSET 0.586852 9.927062 -0.986511
CHANNELS 3 Yrotation Zrotation Xrotation
JOINT Left Shoulder
{
OFFSET 5.792460 0.910302 -0.408037
CHANNELS 3 Zrotation Yrotation Xrotation
JOINT Left Forearm
{
OFFSET 11.068519 -0.345045 -0.430691
CHANNELS 3 Yrotation Zrotation Xrotation
JOINT Left Hand
{
OFFSET 13.842951 -0.221455 0.465278
CHANNELS 3 Zrotation Yrotation Xrotation
End Site
{
OFFSET 10.377336 0.000000 0.000000
}
}
}
}
}
JOINT Right Collar
{
OFFSET -0.586852 9.927062 -0.986511
CHANNELS 3 Yrotation Zrotation Xrotation
JOINT Right Shoulder
{
OFFSET -5.792460 0.910302 -0.408037
CHANNELS 3 Zrotation Yrotation Xrotation
JOINT Right Forearm
{
OFFSET -11.068519 -0.345045 -0.430691
CHANNELS 3 Yrotation Zrotation Xrotation
JOINT Right Hand
{
OFFSET -13.842951 -0.221455 0.465278
CHANNELS 3 Zrotation Yrotation Xrotation
End Site
{
OFFSET -10.377336 0.000000 0.000000
}
}
}
}
}
}
}
JOINT Left Thigh
{
OFFSET 3.119614 -6.122939 -0.010087
CHANNELS 3 Xrotation Zrotation Yrotation
JOINT Left Shin
{
OFFSET -0.748289 -20.447297 -0.646383
CHANNELS 3 Xrotation Zrotation Yrotation
JOINT Left Foot
{
OFFSET -0.250011 -16.935575 -0.168725
CHANNELS 3 Xrotation Yrotation Zrotation
End Site
{
OFFSET 0.000000 0.000000 10.377336
}
}
}
}
JOINT Right Thigh
{
OFFSET -3.119614 -6.122939 -0.010087
CHANNELS 3 Xrotation Zrotation Yrotation
JOINT Right Shin
{
OFFSET 0.748289 -20.447297 -0.646383
CHANNELS 3 Xrotation Zrotation Yrotation
JOINT Right Foot
{
OFFSET 0.250011 -16.935575 -0.168725
CHANNELS 3 Xrotation Yrotation Zrotation
End Site
{
OFFSET 0.000000 0.000000 10.377336
}
}
}
}
}
MOTION
Frames: 20
Frame Time: 0.033333
0.033637 42.205128 1.524028 3.649013 -3.069552 6.275024 1.471821 2.406079 -4.111219 0.177351 1.662727 -13.709224 0.000000 0.000000 0.000000 0.524329 -0.059035 -1.146069 4.664011 -1.515386 11.454688 -11.638076 -3.809148 -0.196097 -72.585648 -12.857738 8.194395 -27.330011 0.000000 9.195996 -6.095202 -7.640958 0.061057 -3.863951 6.129982 -0.581274 68.606377 -15.515290 -2.211308 9.882620 0.000000 16.403736 5.812747 -0.716969 0.184766 11.043233 3.410159 -1.059404 16.410444 -4.615650 -2.625220 -3.119148 -1.195129 2.958230 -30.571278 0.529766 -5.574524 8.500704 1.388658 0.217625 0.364319 -8.253772 -0.301864
0.049719 41.740166 1.524028 4.050931 -4.296137 7.146695 0.572629 4.164570 -5.736820 0.314824 1.175085 -11.253574 0.000000 0.000000 0.000000 0.178410 0.407029 -1.335181 4.200935 -1.297554 9.377798 -10.242314 -5.180961 0.051865 -74.095589 -13.099730 13.216421 -30.582531 0.000000 9.014328 -2.426802 -13.757255 0.294750 -3.326567 9.751065 -0.456380 70.274620 -14.755496 -3.788837 8.102400 0.000000 4.760576 0.914530 -0.303190 -0.019962 10.001599 5.264215 -2.707337 27.880955 -4.052340 0.716346 6.110717 -4.457249 -0.461750 -26.161005 2.114099 -4.193523 3.972862 2.263568 -0.058356 8.920258 -9.747322 -2.569604
0.070976 41.731514 1.524028 5.399858 -4.868404 6.377546 -0.453485 5.148264 -4.470879 0.671400 0.909593 -8.089109 0.000000 0.000000 0.000000 0.035461 0.462079 -1.198271 3.797889 -1.079085 6.753572 -7.329588 -6.749838 -0.251759 -75.890015 -10.713328 16.468693 -31.836702 0.000000 12.887011 1.306084 -14.397549 0.189406 -2.581821 12.247764 -1.997238 72.202118 -13.408587 -6.335517 6.343472 0.000000 -1.496518 0.155499 -0.195849 -0.000322 1.047644 5.576208 -3.335476 45.434265 -4.253503 2.279416 12.906674 -5.169080 -2.744624 -25.728092 3.332417 -3.424220 11.070789 3.508053 -0.058061 4.491042 -9.552843 -5.060407
0.083012 42.309872 1.524028 5.685380 -4.466559 3.780599 -1.019706 4.352284 -2.381178 1.114708 1.043936 -4.915875 0.000000 0.000000 0.000000 -0.077623 0.212762 -0.726839 3.656110 -0.472750 3.967183 -2.572825 -6.720624 -0.589357 -78.042465 -6.166909 14.726253 -27.950478 0.000000 10.680548 1.182979 -12.563655 0.222653 -2.258664 10.726942 -5.538920 74.044624 -11.605340 -8.438681 6.676929 0.000000 -1.459563 1.797447 -2.901036 -0.056581 -9.625670 4.385253 -1.382316 54.985035 -2.742132 -1.045693 14.053508 0.517980 -4.633132 -20.129023 4.690709 -3.491037 10.858813 2.204756 -0.001634 -1.267726 -6.380565 -8.151768
0.079526 43.064907 1.524028 5.573509 -3.747152 0.425573 -1.073305 3.809995 -0.623300 1.926658 0.244373 -1.694594 0.000000 0.000000 0.000000 -0.161034 -0.106997 -0.188688 3.713642 0.129242 1.861759 2.432002 -5.595374 -0.541246 -79.423149 -1.410409 9.626211 -21.955070 0.000000 7.395554 -0.600774 -8.363064 0.243561 -1.555299 6.623583 -8.342672 75.879639 -9.526641 -8.321048 10.599443 0.000000 1.691405 4.995184 -7.635799 -0.350724 -21.105267 3.835485 -0.054471 63.932762 -2.014128 -4.199304 9.664289 9.268079 -4.652293 -12.341219 4.877847 -3.072900 5.090677 1.945730 0.142456 -1.263571 -2.709348 -8.289670
0.054584 43.538116 1.524028 5.562220 -2.810967 -2.089873 -1.255509 3.017254 0.090062 2.878665 -0.374891 1.756984 0.000000 0.000000 0.000000 -0.140586 -0.119259 0.189291 3.838876 0.548020 -0.116433 5.780151 -3.741207 0.814162 -79.377113 1.991196 3.254566 -16.618589 0.000000 4.526581 -1.813550 -4.246672 0.217113 0.664126 0.152545 -10.006464 77.633507 -7.310958 -6.132282 20.510214 0.000000 4.041486 4.792884 -3.573467 0.079326 -28.192652 3.850066 0.855943 60.030575 -2.703191 -5.642477 7.944763 11.426470 -2.933067 -6.437274 4.703012 -2.928423 0.820905 1.142054 -0.341456 -1.739974 0.249952 -8.082815
0.009895 43.747864 1.524028 5.813180 -1.565616 -2.648952 -1.632274 1.585317 -0.338312 3.372961 -0.868801 5.312413 0.000000 0.000000 0.000000 -0.140025 -0.034578 0.359503 3.842385 1.169853 -2.333798 6.774337 -1.632092 2.622766 -77.149452 4.609591 -2.866718 -13.699683 0.000000 0.939090 -1.150065 -0.743626 0.224056 4.252098 -4.164732 -11.497287 78.996162 -5.162397 -3.582826 28.518940 0.000000 3.524830 4.072457 -2.203157 -0.056715 -31.311226 2.621631 1.427362 49.353092 -1.467712 -2.830355 2.431664 5.844039 -1.005978 -1.849695 3.041505 -3.022135 0.346918 1.175645 -0.881813 -4.300439 2.010597 -7.134179
-0.046280 43.625595 1.524028 6.141676 0.056794 -3.124899 -1.649508 -0.404605 -0.060694 2.043275 -1.244674 8.701845 0.000000 0.000000 0.000000 -0.171162 0.439806 0.290436 4.083677 1.821164 -5.384973 6.200631 -0.453932 2.379789 -74.385391 7.785020 -8.618123 -11.167847 0.000000 -0.206776 0.126812 3.552292 0.428533 7.901174 -4.057142 -11.955876 77.997818 -2.384353 -0.966527 32.386066 0.000000 0.946508 3.535443 0.318990 0.013835 -30.307581 0.872614 2.832393 27.088341 -0.368032 1.085193 -2.957128 0.430646 1.064680 2.846038 1.487594 -2.538595 1.671501 0.982845 -0.672326 -5.131299 2.711067 -6.207324
-0.039665 43.041237 1.524028 5.953593 0.494957 -4.426476 -0.670920 -1.075746 1.698316 0.145348 -1.429100 10.836525 0.000000 0.000000 0.000000 -0.173533 0.902300 0.160198 4.378221 2.196363 -7.396379 6.540327 -0.315207 1.461457 -72.317726 10.573610 -11.646926 -8.726796 0.000000 2.864478 0.416057 7.812849 0.383369 8.012686 -4.197780 -10.812477 76.083359 0.833981 2.611199 33.779667 0.000000 0.580107 3.515579 5.126849 0.336984 -28.667410 -0.009335 4.804595 9.337081 -0.174060 1.429702 -6.562768 1.247304 1.476256 9.102274 0.520020 0.884654 1.350562 0.841119 -1.208081 -4.072673 3.069206 -4.286437
0.027360 42.385796 1.524028 5.875046 0.997443 -6.312782 0.128935 -1.843416 3.921386 -1.413562 -1.687496 11.506305 0.000000 0.000000 0.000000 -0.164483 1.352303 0.110148 4.443833 2.001732 -8.527884 6.396396 -0.470113 0.422318 -71.878700 12.830772 -15.974785 -6.217421 0.000000 6.558769 0.025367 12.063758 0.291975 7.175827 -3.666205 -8.542708 74.038666 3.661018 6.333336 34.690216 0.000000 1.505282 3.996653 13.093304 0.867731 -29.260523 -0.886333 7.388702 0.143901 -0.505283 0.353586 -2.688866 3.912454 1.845935 13.901141 -1.035863 3.393086 4.064837 0.162366 -1.692679 -1.579659 1.887360 -1.561619
0.177215 41.893688 1.524028 5.996363 2.040097 -8.465416 -0.366490 -2.295755 5.430657 -1.717214 -1.903840 11.533957 0.000000 0.000000 0.000000 -0.144290 1.648260 0.317607 3.935269 1.003935 -8.240232 5.343716 -0.223463 -0.231990 -75.489822 13.840339 -19.751760 -3.834222 0.000000 7.673912 -0.401823 16.280724 0.347084 5.989960 -0.662424 -6.114860 73.083305 5.900692 9.883739 34.559875 0.000000 3.429096 4.840519 15.181495 0.791163 -29.009418 -0.520989 9.394113 0.868890 -1.528385 -0.185214 4.320621 5.992270 1.875193 15.510613 -3.305975 3.372680 10.027036 -0.197297 -0.570091 5.758199 0.702908 0.842912
0.353130 41.686394 1.524028 6.138906 3.415051 -9.949876 -1.519377 -2.696918 5.686477 -1.082543 -2.090688 10.894991 0.000000 0.000000 0.000000 -0.112795 1.057659 1.039605 3.197870 0.188410 -6.863252 3.562958 -1.429711 -0.286695 -81.091637 13.094898 -22.418726 -1.305967 0.000000 6.898374 -0.359099 18.197271 0.259643 4.422549 2.738739 -4.201732 74.265053 6.593126 11.604026 33.334728 0.000000 5.638592 5.475395 8.249313 0.238420 -27.742434 -1.097129 9.850668 6.429503 -2.847167 -0.405717 10.467781 5.428185 3.361440 13.386729 -5.566969 2.106815 19.853960 -0.279938 0.600212 16.096556 -1.580234 1.279920
0.457955 41.880508 1.524028 6.136812 4.588883 -9.535280 -2.181119 -3.119838 4.843689 0.414396 -2.330528 9.437711 0.000000 0.000000 0.000000 -0.143223 0.716349 0.999386 2.942777 -0.189089 -4.993290 1.501384 -1.849095 -0.630857 -84.966026 10.729839 -22.991610 -1.073633 0.000000 5.335367 -1.074666 16.524576 0.106371 2.174798 3.629051 -2.676554 76.966171 5.245250 11.550295 27.739941 0.000000 6.537721 4.980315 3.767014 0.216823 -24.669817 -2.753689 8.865177 10.026933 -3.291704 -0.238008 7.001721 4.720722 4.981394 -0.697776 -6.812459 0.388333 44.271240 -0.119646 2.038449 11.765763 -2.966697 0.306350
0.445205 42.470028 1.524028 6.004223 4.726407 -7.110747 -2.503715 -3.307273 2.795688 1.572687 -2.253207 7.113348 0.000000 0.000000 0.000000 -0.198657 0.326680 0.765752 3.487429 -0.208595 -2.997273 -0.580524 -1.929564 -1.239862 -85.003258 6.672083 -18.239044 -2.845787 0.000000 3.917876 -2.930542 11.724393 0.029052 -0.775538 3.528285 -1.492077 78.104645 2.082707 10.026459 21.117067 0.000000 5.907916 3.355832 1.567616 0.151201 -20.652859 -4.131987 6.417383 11.862975 -3.295533 -0.314324 3.101876 4.048058 4.631410 -12.037504 -6.609136 0.457448 57.811207 0.515268 2.080219 11.321990 -5.285818 -0.344846
0.370453 43.127430 1.524028 5.892173 3.297400 -3.995338 -2.387489 -2.633331 0.673300 2.324158 -1.197777 4.144133 0.000000 0.000000 0.000000 -0.263634 -0.008522 0.433100 4.214414 -0.224659 -0.945507 -2.746363 -1.903796 -1.915236 -82.255699 1.596807 -10.621786 -5.193584 0.000000 2.383679 -3.803981 7.265489 -0.202231 -3.787981 3.040963 -0.565369 77.501282 -1.653566 6.945381 16.752539 0.000000 4.762767 1.094412 -0.853464 -0.027322 -16.595417 -4.191212 3.825305 12.808127 -3.155293 -0.337719 1.128731 3.143940 4.181888 -20.957129 -4.372149 -1.424768 63.614681 -0.218992 1.608306 11.122765 -6.439705 -1.291172
0.291338 43.585564 1.524028 5.716556 1.479379 -1.515101 -1.937371 -1.391371 -0.333888 2.685618 0.237538 0.723495 0.000000 0.000000 0.000000 -0.339443 -0.151557 0.017409 4.875978 -0.818190 1.142550 -5.083361 -2.063403 -2.625750 -78.877495 -3.095798 -4.662541 -8.322824 0.000000 0.083962 -4.116396 5.818627 -0.328726 -6.221522 2.742348 -0.477294 75.367752 -5.630934 2.274905 15.942350 0.000000 4.444883 -0.160074 -3.019870 -0.014699 -13.658679 -3.154752 1.858016 14.463067 -3.011229 -0.397070 -0.106570 2.634922 4.216075 -29.666065 -2.805402 -2.596283 64.149780 0.175178 1.335567 8.220274 -6.052086 -2.547879
0.208562 43.724689 1.524028 5.455887 -0.105103 0.291246 -1.076492 -0.080319 -0.571476 1.983600 0.533647 -3.600996 0.000000 0.000000 0.000000 0.017625 0.136488 -0.106947 5.301512 -1.465266 3.361341 -7.448280 -2.965097 -2.908117 -75.236252 -7.266407 -1.406829 -11.220800 0.000000 0.361287 -4.557943 7.012810 -0.183000 -8.012290 3.058141 -0.686476 72.023201 -9.258370 -2.283810 15.704026 0.000000 6.504557 0.208348 -3.918636 0.006836 -7.736023 -1.584397 0.617703 13.525551 -3.171737 -0.544870 -2.648979 1.384148 4.777616 -33.423996 -1.737680 -3.176106 57.839184 0.524540 0.166623 -0.160606 -5.095408 -3.156537
0.118383 43.603096 1.524028 4.963239 -1.176246 2.579602 -0.339402 0.584503 -0.877168 1.082645 1.458813 -8.210505 0.000000 0.000000 0.000000 0.520410 0.169795 -0.490884 5.324917 -2.391470 6.654341 -9.503895 -3.259481 -2.418858 -72.431297 -9.778449 0.164285 -13.996252 0.000000 1.233618 -4.763908 4.645976 -0.113402 -7.372869 4.186839 -0.786821 68.568939 -12.257798 -5.166246 14.760238 0.000000 12.917177 1.725236 -3.409450 0.158240 -0.991425 -0.332721 0.225049 10.828863 -3.005135 -1.822804 -5.604009 0.491539 4.416662 -36.893665 -1.047522 -5.297336 47.449165 -0.878537 0.364359 -7.732908 -5.521752 -1.587060
0.062570 43.085953 1.524028 4.333839 -1.612010 4.423526 0.474906 0.883426 -1.677374 0.352567 2.193359 -11.772671 0.000000 0.000000 0.000000 1.043792 0.013690 -0.833155 5.115610 -2.856335 9.799644 -10.869012 -3.131790 -1.518900 -71.448158 -11.323499 1.371951 -18.862829 0.000000 4.343899 -5.935376 0.746637 -0.012955 -5.918207 5.064364 -0.726906 67.311905 -14.535771 -5.396156 13.745064 0.000000 18.885632 3.332561 -2.207848 0.004709 5.245737 0.629688 0.168859 9.695539 -2.378698 -3.663313 -3.026520 0.923702 3.363493 -36.346233 -1.044628 -5.812767 32.840508 -1.405682 0.097240 -10.763579 -5.997941 -0.209795
0.033637 42.205128 1.524028 3.649013 -3.069552 6.275024 1.471821 2.406079 -4.111219 0.177351 1.662727 -13.709224 0.000000 0.000000 0.000000 0.524329 -0.059035 -1.146069 4.664011 -1.515386 11.454688 -11.638076 -3.809148 -0.196097 -72.585648 -12.857738 8.194395 -27.330011 0.000000 9.195996 -6.095202 -7.640958 0.061057 -3.863951 6.129982 -0.581274 68.606377 -15.515290 -2.211308 9.882620 0.000000 16.403736 5.812747 -0.716969 0.184766 11.043233 3.410159 -1.059404 16.410444 -4.615650 -2.625220 -3.119148 -1.195129 2.958230 -30.571278 0.529766 -5.574524 8.500704 1.388658 0.217625 0.364319 -8.253772 -0.301864



There are few application that can transform other formats to bvh.

This link contains many motion capture files: http://mocap.cs.cmu.edu/

That can exported to Bvh by using the following tool.

http://vipbase.net/amc2bvh/

Then you can use the program that I wrote to parse through the data.

Here is an image of the movement.


The ninja looks double jointed, the elbows are incorrect. As a matter of fact most of the bones move oddly.
But it is a good beginning.

I found this code, that I would like to share. I didn't use any of the stuff here but it was good for reference.

http://www.mediafire.com/file/tde4ynz1gru/Dagger.zip



Best Regards,

Skorpio

skorpio

01-11-2011 05:19:43

Hello,

It is good to post be post back, I have not forgotten about this great forum.
To fill you in, I have been working on my pet project: VisualPanel which evolved from wxOgre.

VisualPanel is a tool for bridging the gap between StoryBoarding (2D) and the Final Movie.
The idea is to work out some of the issues before they become a problem.

After many months of working, on this project. I happy to announce that the first Test Movie
is available on Amazon Studios.

http://studios.amazon.com/movies/10951

Also check my website for the movie making tools:
https://sites.google.com/site/panelsuite/home

I still have some issues with the skeletal animation that need fixing that is why
the characters are mostly static. Now that the pressure is over,
I will be focusing on fixing those issues and using this forum to resolve them

Thanks and Best Regards,

Skorpio

dermont

01-11-2011 06:15:45

Cool, nice to see you back, hopefully you will continue your work on wxOgre it never really got the credit it deserved.

skorpio

02-11-2011 14:43:59

Hello Dermont,

Thank you, I'm glad to be back.

It has been a lot of fun programing using python-ogre.
The project's website has some images of the new interface.

Can't seem to upload, I got this error
Sorry, the board attachment quota has been reached.

I was trying to upload 1-image.

Best regards,
Skorpio

dermont

03-11-2011 12:06:41


The project's website has some images of the new interface.

Can't seem to upload, I got this error
Sorry, the board attachment quota has been reached.

I was trying to upload 1-image.

Best regards,
Skorpio


Yeah I encountered the same error, I'm assuming they have introduced some form of quota for the amount you can upload.

You can go to your User Control panel and delete some old updates/images. I guess doing so will allow you to upload your image. I've just deleted all my uploads on here/main forum. Hope that helps them out.

skorpio

03-11-2011 16:56:25

Ok,

Thanks for the tip

Here are some pictures of the new interface:





Skorpio

skorpio

03-11-2011 17:30:13

Hello,

I have delayed looking into compositor. Most of the examples in the ogre-media do not work.

This is the old movie compositor.


Here is a comparison of the NightVision on Ogre and VisualPanel


and


My understanding is that compositors operate on the ViewPort but viewport don't have material properties, or do they?
So, I'm using the Fade overlay material to load the compositor material there.

This code doesn't seem to do anything

compMgr = ogre.CompositorManager.getSingleton()
self.viewport = self.ogreWin.renderWindow.getViewport(0)
compMgr.addCompositor(self.viewport, "mat_NightVision",0)
compMgr.setCompositorEnabled(self.viewport, "mat_NightVision",True)





Suggestions are greatly appreciated.

-Skorpio

dermont

06-11-2011 17:12:51

There is an example on the wiki.
http://wiki.python-ogre.org/index.php/CodeSnippits_DOF

Your first linked image doesn't appear to be related to Ogre it shows one of your google meesages(?). You may want to change that.

skorpio

28-12-2011 16:48:40

Hello,

I would like to share a little code that I wrote for wxOgre, a very simple python wrapper for the OgreCommandLineTools.
I have been using version 1.6.3, but I'm pretty sure that it will work for other versions too.

It only supports the most common conversions from Blender. But it can customized to suit your needs.

Place the python code (ogrecommand.py) in the same folder where your command line EXEs are, then run it.
It uses subprocess import Popen and PIPE to call EXE from within python.

Th

Enjoy,


import wx
import os
import time
import shlex, subprocess
import shutil
import xml.dom.minidom
import ConfigParser


from subprocess import Popen, PIPE

class MyApp(wx.Frame):

def __init__(self, parent, id, title):
wx.Frame.__init__(self, parent, id, title, wx.DefaultPosition, wx.Size(1000, 750))

menubar = wx.MenuBar()
file = wx.Menu()
edit = wx.Menu()
help = wx.Menu()
file.Append(101, '&Open', 'Open a new document')
file.Append(102, '&Save', 'Save the document')
file.AppendSeparator()
quit = wx.MenuItem(file, 105, '&Quit\tCtrl+Q', 'Quit the Application')
#quit.SetBitmap(wx.Image('stock_exit-16.png', wx.BITMAP_TYPE_PNG).ConvertToBitmap())
file.AppendItem(quit)

menubar.Append(file, '&File')
menubar.Append(edit, '&Edit')
menubar.Append(help, '&Help')
self.SetMenuBar(menubar)
self.CreateStatusBar()

self.meshname=''
self.meshrotation=''
self.filename=[]
self.matlist=[]
self.texturelist=[]
self.skinfilelist=[]
self.texturename=''
self.apppath=''
self.srcpathflag = False
self.dstpathflag = False
self.apppathflag = False

# build list
self.wxlist = wx.ListCtrl( self, -1, size=(460,280), pos=(0,0), style=wx.LC_REPORT )

self.wxlist.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnListClick)
#self.wxlist.Bind(wx.EVT_LIST_ITEM_ACTIVATED,self.OnListDClick)

self.populateFileList()

# build list2
#self.wxlist2 = wx.ListCtrl( self, -1, size=(300,200), pos=(600,0),style=wx.LC_REPORT )
#self.wxlist2.InsertColumn(0, 'Name')
#self.wxlist2.InsertColumn(1, 'Ext')
#self.wxlist2.InsertColumn(2, 'Size', wx.LIST_FORMAT_RIGHT)
#self.wxlist2.InsertColumn(3, 'Modified')

#self.wxlist2.SetColumnWidth(0, 150)
#self.wxlist2.SetColumnWidth(1, 100)
#self.wxlist2.SetColumnWidth(2, 100)
#self.wxlist2.SetColumnWidth(3, 150)


self.wxbtnMeshToXml = wx.Button(self, -1,"mesh->XML",pos=(360,300), size=(100,20))
self.wxbtnMeshToXml.Bind(wx.EVT_BUTTON, self.onMeshToXml)
#self.wxbtnMeshToXml.Show(False)

self.wxbtnXmlToMesh = wx.Button(self, -1,"XML->mesh",pos=(360,330), size=(100,20))
self.wxbtnXmlToMesh.Bind(wx.EVT_BUTTON, self.onXml2Mesh)
#self.wxbtnXmlToMesh.Show(False)

self.wxbtnRefresh = wx.Button(self, -1,"Refresh",pos=(470,10), size=(100,20))
self.wxbtnRefresh.Bind(wx.EVT_BUTTON, self.onBtnRefresh)

self.wxbtnOpenMeshy = wx.Button(self, -1,"Open Viewer",pos=(470,40), size=(100,20))
self.wxbtnOpenMeshy.Bind(wx.EVT_BUTTON, self.onBtnOpenMeshy)


self.wxbtnSubmesh = wx.Button(self, -1,"SubMesh->mesh",pos=(470,550), size=(100,20))
self.wxbtnSubmesh.Bind(wx.EVT_BUTTON, self.onBtnSubmesh)

self.wxbtnMaterial = wx.Button(self, -1,"Create Mat File",pos=(470,580), size=(100,20))
self.wxbtnMaterial.Bind(wx.EVT_BUTTON, self.onBtnCreateMaterial)

self.wxbtnSkeleton = wx.Button(self, -1,"Rename Skeleton",pos=(470,620), size=(100,20))
self.wxbtnSkeleton.Bind(wx.EVT_BUTTON, self.onBtnRenameSkeleton)


self.wxbtnOpenSource = wx.Button(self, -1,"Open Source",pos=(600,10), size=(100,20))
self.wxbtnOpenSource.Bind(wx.EVT_BUTTON, self.onBtnOpenSource)

self.wxbtnOpenDest = wx.Button(self, -1,"Open Destination",pos=(600,40), size=(100,20))
self.wxbtnOpenDest.Bind(wx.EVT_BUTTON, self.onBtnOpenDst)

self.wxbtnOpenApp = wx.Button(self, -1,"Open VisualPanel",pos=(600,70), size=(100,20))
self.wxbtnOpenApp.Bind(wx.EVT_BUTTON, self.onBtnOpenApp)


self.wxbtnCopyDst= wx.Button(self, -1,"Copy->Dest",pos=(600,200), size=(100,20))
self.wxbtnCopyDst.Bind(wx.EVT_BUTTON, self.onBtnCopyDest)
self.wxbtnCopyDst.Disable()

wx.StaticText(self, -1, 'Rotation a/P/Y/R', (5, 300))
self.rotX = wx.TextCtrl(self, -1, "-90/1/0/0", pos=(120, 300), size=(120,20))
self.wxbtnRotate = wx.Button(self, -1,"rotate mesh",pos=(250,300), size=(100,20))
self.wxbtnRotate.Bind(wx.EVT_BUTTON, self.onBtnRotate)


wx.StaticText(self, -1, 'scale X/Y/Z', (5, 330))
self.scX = wx.TextCtrl(self, -1, "100/100/100", pos=(120, 330), size=(120,20))
self.wxbtnScale = wx.Button(self, -1,"scale mesh",pos=(250,330), size=(100,20))
self.wxbtnScale.Bind(wx.EVT_BUTTON, self.onBtnScale)


wx.StaticText(self, -1, 'Submesh material: Use semicolon to rename Submesh. Use colon to add image file', (5, 360))
self.txtMaterials=''
self.wxtxtMaterials = wx.TextCtrl(self, -1, self.txtMaterials, pos=(5,380), size=(450,220) ,style=wx.TE_MULTILINE)

wx.StaticText(self, -1, 'Skeleton:', (5, 620))
self.txtSkelenton=''
self.wxtxtSkeleton = wx.TextCtrl(self, -1, self.txtSkelenton, pos=(100,620), size=(350,25) )##,style=wx.TE_MULTILINE)

#wx.StaticText(self, -1, 'Submesh Texture:', (5, 530))
#self.txtTextures=''
#self.wxlistTextures = wx.TextCtrl(self, -1, self.txtTextures, pos=(5,550), size=(320,100) ,style=wx.TE_MULTILINE)
#self.wxlistTextures = wx.ListBox(self, -1, (5, 550), (320, 100), self.skinfilelist, wx.LB_EXTENDED) ##wx.LB_SINGLE)
#self.wxlistTextures.Bind(wx.EVT_LISTBOX, self.onBtnTextures)

self.populateSkinFileList()


config = ConfigParser.RawConfigParser()
config.read('ogrecommand.cfg')
self.dstRootpath = config.get('destination', 'rootpath')
print self.dstRootpath

config = ConfigParser.RawConfigParser()
config.read('ogrecommand.cfg')
self.srcRootpath = config.get('source', 'rootpath')
print self.srcRootpath

config = ConfigParser.RawConfigParser()
config.read('ogrecommand.cfg')
self.apppath = config.get('app', 'rootpath')
print self.apppath



self.changeButtonState(False)
self.Show(True)


def onBtnRefresh (self, event):
self.populateFileList()
self.populateSkinFileList()
self.changeButtonState(False)


def readXMLmaterials(self,name):

print "Reading XML file...", name
fin = open (name,'r')

self.texturelist=[]
self.matlist=[]
material_string = ''
skeletonname=''

for line in fin:
txt = str(line)
pos1 = txt.rfind("submesh")
pos2 = txt.rfind("material")
pos3 = txt.rfind("skeletonlink")
pos4 = txt.rfind("name")
if pos1 !=-1 and pos2 !=-1:
matlen = len('material="')
mat = txt[pos2+matlen:]

newmat,par,rest = mat.partition('"')
mat = newmat
print mat
material_string = material_string + mat + "\n"
self.matlist.append(mat)

if pos3 !=-1 and pos4 !=-1:
matlen = len('name="')
mat = txt[pos4+matlen:]
##<skeletonlink name="./animations/horse.skeleton" />
skeletonname,par,rest = mat.partition('"')

fin.close()

self.wxtxtMaterials.SetValue (material_string)
self.wxtxtSkeleton.SetValue(skeletonname)

return

pos = name.rfind(".mesh.xml")
if pos ==-1:
self.wxtxtMaterials.SetValue("")
self.wxtxtSkeleton.SetValue("")
return

doc = xml.dom.minidom.parse(name)
print "xml name: " , name


material_list=[]
material_string=''
for node in doc.getElementsByTagName("submeshes"):
node_section = node.getElementsByTagName("submesh")
for node2 in node_section:
mat = node2.getAttribute("material")
print mat
#newmat = "skin_pine"
#node2.setAttribute("material",newmat)
#print newmat
#mat = node2.getAttribute("material")
#print mat
material_list.append(mat)
material_string = material_string + mat + "\n"

#print material_list
self.wxtxtMaterials.SetValue (material_string)

skeletonname=''
for node in doc.getElementsByTagName("skeletonlink"):
skeletonname = node.getAttribute("name")
print skeletonname
self.wxtxtSkeleton.SetValue(skeletonname)


def populateFileList(self):

self.wxlist.ClearAll()
self.meshname = ""
self.filename=[]

self.wxlist.InsertColumn(0, 'Name')
self.wxlist.InsertColumn(1, 'Ext')
self.wxlist.InsertColumn(2, 'Size', wx.LIST_FORMAT_RIGHT)
self.wxlist.InsertColumn(3, 'Modified')

self.wxlist.SetColumnWidth(0, 150)
self.wxlist.SetColumnWidth(1, 70)
self.wxlist.SetColumnWidth(2, 100)
self.wxlist.SetColumnWidth(3, 130)

self.list_items = os.listdir('.')
j = 0
for i in self.list_items:
(name, ext) = os.path.splitext(i)
ex = ext[1:]
size = os.path.getsize(i)
sec = os.path.getmtime(i)
if ex=="skeleton" or ex=="mesh" or ex=="xml":
self.wxlist.InsertStringItem(j, name+"."+ex)
self.wxlist.SetStringItem(j, 1, ex)
self.wxlist.SetStringItem(j, 2, str(size) + ' B')
self.wxlist.SetStringItem(j, 3, time.strftime('%Y-%m-%d %I:%M %p', time.localtime(sec)))

if ex== "skeleton":
self.wxlist.SetItemTextColour(j, 'blue')
if ex== "mesh":
self.wxlist.SetItemTextColour(j, 'red')
j = j + 1
self.filename.append(i)


def populateSkinFileList(self):

self.texturename=''
self.skinfilelist=[]
self.list_items = os.listdir('.')
j = 0
for i in self.list_items:
(name, ext) = os.path.splitext(i)
ex = ext[1:]
size = os.path.getsize(i)
sec = os.path.getmtime(i)
if ex=="jpg" or ex=="png" or ex=="bmp":
self.skinfilelist.append(i)

print self.skinfilelist
#self.wxlistTextures.Set(self.skinfilelist)


def changeButtonState(self,state):

if state == True:
self.wxbtnXmlToMesh.Enable()
self.wxbtnMeshToXml.Enable()
self.wxbtnRotate.Enable()
self.wxbtnScale.Enable()
#self.wxbtnMaterial.Enable()
self.wxbtnSubmesh.Enable()
#self.wxbtnCopyDst.Enable()
else:
self.wxbtnXmlToMesh.Disable()
self.wxbtnMeshToXml.Disable()
self.wxbtnRotate.Disable()
self.wxbtnScale.Disable()
#self.wxbtnMaterial.Disable()
self.wxbtnSubmesh.Disable()
#self.wxbtnCopyDst.Disable()

def onMeshToXml(self,event):
#wx.CallAfter(self.lc.SetItemState, self.structindex , wx.LIST_STATE_SELECTED, wx.LIST_STATE_SELECTED)

if self.meshname=="":
return

pos = self.meshname.rfind(".xml")
if pos !=-1:
return

self.changeButtonState(False)

print '________________________________'
prgname = "OgreXMLConverter.exe"
arg = self.meshname + "\n"

cmdline = prgname + " " + arg
print cmdline

args = shlex.split(cmdline)
print args

(stdout, stderr) = Popen(args,stdout=PIPE).communicate()
print stdout
print "OgreXMLConverter XML D0NE->MESH"

self.populateFileList()
self.changeButtonState(True)


def onBtnOpenMeshy(self,event):
os.startfile("C:\OgreCommandLineTools1.6.3\OgreMeshy\Ogre Meshy.exe")


def onXml2Mesh(self,event):

if self.meshname=="":
return

pos1 = self.meshname.rfind(".mesh.xml")
pos2 = self.meshname.rfind(".skeleton.xml")

if pos1>0:

self.changeButtonState(False)

meshname = self.meshname.replace(".xml","")
scale = "1/1/1"

print '________________________________'
prgname = "OgreXMLConverter.exe"
arg = meshname + ".xml\n"

cmdline = prgname + " " + arg
print cmdline

args = shlex.split(cmdline)
print args

(stdout, stderr) = Popen(args,stdout=PIPE).communicate()
print stdout
print "OgreXMLConverter XML D0NE->MESH"


print '________________________________'
prgname = "meshmagick.exe"
arg = "transform -scale=" + scale + " " + meshname + "\n"

cmdline = prgname + " " + arg
print cmdline

args = shlex.split(cmdline)
print args

(stdout, stderr) = Popen(args,stdout=PIPE).communicate()
print stdout
print "meshmagick scale DONE"


print '________________________________'
prgname = "meshmagick.exe"
arg = "transform -zalign=center " + meshname + "\n"

cmdline = prgname + " " + arg
print cmdline

args = shlex.split(cmdline)
print args

(stdout, stderr) = Popen(args,stdout=PIPE).communicate()
print stdout
print "meshmagick align center DONE"


print '________________________________'
prgname = "meshmagick.exe"
arg = "transform -xalign=center " + meshname + "\n"

cmdline = prgname + " " + arg
print cmdline

args = shlex.split(cmdline)
print args

(stdout, stderr) = Popen(args,stdout=PIPE).communicate()
print stdout
print "meshmagick align center DONE"



print '________________________________'
prgname = "meshmagick.exe"
arg = "transform -yalign=bottom " + meshname + "\n"
#arg = "transform -yalign=-15 " + meshname + "\n"

cmdline = prgname + " " + arg
print cmdline

args = shlex.split(cmdline)
print args

(stdout, stderr) = Popen(args,stdout=PIPE).communicate()
print stdout
print "meshmagick align bottom DONE"



print '________________________________'
prgname = "OgreXMLConverter.exe"
arg = meshname + "\n"

cmdline = prgname + " " + arg
print cmdline

args = shlex.split(cmdline)
print args

(stdout, stderr) = Popen(args,stdout=PIPE).communicate()
print stdout
print "OgreXMLConverter D0NE MESH->XML"
self.populateFileList()

if pos2>0:

meshname = self.meshname.replace(".xml","")
scale = "1/1/1"

print '________________________________'
prgname = "OgreXMLConverter.exe"
arg = meshname + ".xml\n"

cmdline = prgname + " " + arg
print cmdline

args = shlex.split(cmdline)
print args

(stdout, stderr) = Popen(args,stdout=PIPE).communicate()
print stdout
print "OgreXMLConverter XML D0NE->MESH"

self.changeButtonState(True)
self.populateFileList()


def OnListClick(self,event):
index = self.wxlist.GetNextItem(item=-1, geometry=wx.LIST_NEXT_ALL, state=wx.LIST_STATE_SELECTED)
entry = self.filename[index]
print "clicking ", index, entry
self.meshname = entry

#rot = self.rotX.GetValue()
#angle, pitch, yaw, roll = rot.split("/")
#scale = self.scX.GetValue()
#xscale, yscale, zscale = scale.split("/")
#print pitch, yaw, roll, xscale, yscale, zscale

pos = self.meshname.rfind(".xml")
if pos != -1:
## xml files
self.wxbtnXmlToMesh.Enable()
self.wxbtnMeshToXml.Disable()
self.wxbtnRotate.Disable()
self.wxbtnScale.Disable()
self.wxbtnMaterial.Enable()
self.wxbtnSkeleton.Enable()
self.wxbtnSubmesh.Enable()


pos = self.meshname.rfind(".skeleton.xml")
if pos != -1:
self.wxbtnMaterial.Disable()
self.wxbtnSubmesh.Disable()
#self.wxbtnCopyDst.Disable()
else:
self.wxbtnMaterial.Enable()
#self.wxbtnCopyDst.Enable()
pass

self.wxbtnSubmesh.Enable()
self.readXMLmaterials(entry)

else:
## mesh files
self.wxbtnXmlToMesh.Disable()
self.wxbtnMeshToXml.Enable()
self.wxbtnRotate.Enable()
self.wxbtnScale.Enable()
self.wxbtnMaterial.Disable()
self.wxbtnSkeleton.Disable()
self.wxbtnSubmesh.Disable()
#self.wxbtnCopyDst.Disable()
self.wxtxtMaterials.Clear()



def OnListDClick(self,event):
return
index = self.wxlist.GetNextItem(item=-1, geometry=wx.LIST_NEXT_ALL, state=wx.LIST_STATE_SELECTED)
entry = self.filename[index]
print "Dclicking ", index, entry
self.meshname = entry

self.onXml2Mesh(event)
self.onMeshToXml(event)

def onBtnRotate(self,event):
#wx.CallAfter(self.lc.SetItemState, self.structindex , wx.LIST_STATE_SELECTED, wx.LIST_STATE_SELECTED)

if self.meshname=="":
return

pos = self.meshname.rfind(".xml")
if pos !=-1:
return

self.changeButtonState(False)

print '________________________________'
meshname = self.meshname
rotation = str(self.rotX.GetValue())

prgname = "meshmagick.exe"
arg = "transform -rotate=" + rotation + " " + meshname + "\n"

cmdline = prgname + " " + arg
print cmdline


args = shlex.split(cmdline)
print args

(stdout, stderr) = Popen(args,stdout=PIPE).communicate()
print stdout
print "meshmagick rotate DONE"


meshname = self.meshname
print '________________________________'
prgname = "OgreXMLConverter.exe"
arg = meshname + "\n"

cmdline = prgname + " " + arg
print cmdline

args = shlex.split(cmdline)
print args

(stdout, stderr) = Popen(args,stdout=PIPE).communicate()
print stdout
print "OgreXMLConverter D0NE MESH->XML"

self.populateFileList()
self.changeButtonState(True)



def onBtnScale(self,event):
#wx.CallAfter(self.lc.SetItemState, self.structindex , wx.LIST_STATE_SELECTED, wx.LIST_STATE_SELECTED)

if self.meshname=="":
return

pos = self.meshname.rfind(".xml")
if pos !=-1:
return

self.changeButtonState(False)

print '________________________________'
meshname = self.meshname
scale = str(self.scX.GetValue())

prgname = "meshmagick.exe"
arg = "transform -scale=" + scale + " " + meshname + "\n"

cmdline = prgname + " " + arg
print cmdline

args = shlex.split(cmdline)
print args

(stdout, stderr) = Popen(args,stdout=PIPE).communicate()
print stdout
print "meshmagick scale DONE"


meshname = self.meshname
print '________________________________'
prgname = "OgreXMLConverter.exe"
arg = meshname + "\n"

cmdline = prgname + " " + arg
print cmdline

args = shlex.split(cmdline)
print args

(stdout, stderr) = Popen(args,stdout=PIPE).communicate()
print stdout
print "OgreXMLConverter D0NE MESH->XML"

self.populateFileList()
self.changeButtonState(True)



def onBtnSubmesh (self,event):

if self.meshname=="":
return

#self.changeButtonState(False)
self.wxtxtMaterials.Disable()
self.wxtxtSkeleton.Disable()
self.Update()

txt = self.wxtxtMaterials.GetValue()

multisplit=[]
multisplit= txt.split("\n")

newsubmeshlist = []
count = len(multisplit)
for ii in range(0,count):
txt = multisplit[ii]
if txt != '':
pos = txt.rfind(";")
print txt, str(pos)
oldmeshname, par, newmeshname = txt.partition(";")
newsubmeshlist.append(newmeshname)

print "_____________________________"
print newsubmeshlist


xmlname = self.meshname
doc = xml.dom.minidom.parse(xmlname)
print "xml name: " , xmlname

index = 0
for node in doc.getElementsByTagName("submeshes"):
node_section = node.getElementsByTagName("submesh")
for node2 in node_section:

newmat = newsubmeshlist[index]
if newmat !='':
node2.setAttribute("material",newmat)
index = index + 1


skeletonname=str(self.wxtxtSkeleton.GetValue())
for node in doc.getElementsByTagName("skeletonlink"):
node.setAttribute("name",skeletonname)

filexmlname = xmlname
print filexmlname
f = open(filexmlname, 'w')
f.write(doc.toxml())
f.close()


print '________________________________'
prgname = "OgreXMLConverter.exe"
arg = filexmlname + "\n"

cmdline = prgname + " " + arg
print cmdline

args = shlex.split(cmdline)
print args

(stdout, stderr) = Popen(args,stdout=PIPE).communicate()
print stdout
print "OgreXMLConverter XML D0NE->MESH"

#self.createMatFile()

self.populateFileList()
self.wxtxtMaterials.SetValue('')
self.wxtxtSkeleton.SetValue('')
self.wxtxtMaterials.Enable()
self.wxtxtSkeleton.Enable()


def onBtnRenameSkeleton (self,event):

if self.meshname=="":
return

#self.changeButtonState(False)
self.wxtxtMaterials.Disable()
self.wxtxtSkeleton.Disable()
self.Update()


xmlname = self.meshname
doc = xml.dom.minidom.parse(xmlname)
print "xml name: " , xmlname

skeletonname=str(self.wxtxtSkeleton.GetValue())
for node in doc.getElementsByTagName("skeletonlink"):
node.setAttribute("name",skeletonname)

filexmlname = xmlname
print filexmlname
f = open(filexmlname, 'w')
f.write(doc.toxml())
f.close()


print '________________________________'
prgname = "OgreXMLConverter.exe"
arg = filexmlname + "\n"

cmdline = prgname + " " + arg
print cmdline

args = shlex.split(cmdline)
print args

(stdout, stderr) = Popen(args,stdout=PIPE).communicate()
print stdout
print "OgreXMLConverter XML D0NE->MESH"

#self.createMatFile()

self.populateFileList()
self.wxtxtMaterials.SetValue('')
self.wxtxtSkeleton.SetValue('')
self.wxtxtMaterials.Enable()
self.wxtxtSkeleton.Enable()


def onBtnCreateMaterial(self,event):
self.createMatFile()



def createMatFile(self):

if self.meshname=="":
return

self.wxtxtMaterials.Disable()
#self.wxtxtSkeleton.Disable()
self.Update()
txt = self.wxtxtMaterials.GetValue()
multisplit=[]
multisplit= txt.split("\n")

newsubmeshlist = []
listindexList=[]
count = len(multisplit)
for ii in range(0,count):
txt = multisplit[ii]
if txt != '':
pos = txt.rfind(":")
print txt, str(pos)
oldmeshname, par, newmeshname = txt.partition(":")
listindexList.append(newmeshname)
newsubmeshlist.append(oldmeshname)

print "_____________________________"
print listindexList
print newsubmeshlist

count1 = len(listindexList)
count2 = len(newsubmeshlist)
print count1, count2

if count1 != count2 and (count1==0 or count2==0):
self.wxtxtMaterials.Enable()
return

print "Creating Material File..."

fname = self.meshname.replace(".xml","")
meshname = fname

fname = meshname.replace(".mesh","")
meshname = fname

fname = "mesh_" + meshname + ".material"
fout = open (fname,'w')

count = len(listindexList)
for jj in range(0,count):
texturename = listindexList[jj]
skinname = newsubmeshlist[jj]

txt = "material " + skinname + "\n"
fout.write(txt)

txt = "{\n"
fout.write(txt)

txt = " receive_shadows on\n"
fout.write(txt)

txt = " technique\n"
fout.write(txt)
txt = " {\n"
fout.write(txt)
txt = " pass\n"
fout.write(txt)
txt = " {\n"
fout.write(txt)

txt = " //cull_software none\n"
fout.write(txt)
txt = " //cull_hardware none\n"
fout.write(txt)

txt = " texture_unit\n"
fout.write(txt)
txt = " {\n"
fout.write(txt)
txt = " texture %s\n" % (texturename)
fout.write(txt)

txt = " //filtering trilinear\n"
fout.write(txt)

txt = " }\n"
fout.write(txt)
txt = " }\n"
fout.write(txt)
txt = " }\n"
fout.write(txt)
txt = "}\n"
fout.write(txt)

txt = "\n"
fout.write(txt)

fout.close()
os.startfile(fname)
self.wxtxtMaterials.Enable()

def createMatFileOld(self):
print "Creating Material File..."

fname = self.meshname.replace(".xml","")
meshname = fname

fname = meshname.replace(".mesh","")
meshname = fname

fname = "mesh_" + meshname + ".material"

fout = open (fname,'w')

listindexList = self.wxlistTextures.GetSelections()
count = len(listindexList)
for jj in range(0,count):
index = listindexList[jj]
textname = self.skinfilelist[index]
print textname

count = len (self.matlist)
for ii in range (0,count):

txt = "material " + self.matlist[ii] + "\n"
fout.write(txt)

txt = "{\n"
fout.write(txt)

txt = " receive_shadows on\n"
fout.write(txt)

txt = " technique\n"
fout.write(txt)
txt = " {\n"
fout.write(txt)
txt = " pass\n"
fout.write(txt)
txt = " {\n"
fout.write(txt)

txt = " //cull_software none\n"
fout.write(txt)
txt = " //cull_hardware none\n"
fout.write(txt)

txt = " texture_unit\n"
fout.write(txt)
txt = " {\n"
fout.write(txt)
txt = " texture %s\n" % (textname)
fout.write(txt)
txt = " }\n"
fout.write(txt)
txt = " }\n"
fout.write(txt)
txt = " }\n"
fout.write(txt)
txt = "}\n"
fout.write(txt)

txt = "\n"
fout.write(txt)

fout.close()
os.startfile(fname)


def onBtnCopyDest (self,event):


pos2 = self.meshname.rfind(".skeleton")
if pos2 !=-1:
print "skeleton -not copy"
return

pos1 = self.meshname.rfind(".xml")
if pos1 == -1:
print "mesh.xml -not copy"
return


#print self.meshname
print "_____________________"

meshname = self.meshname.replace(".xml","")
print meshname

skelname = self.wxtxtSkeleton.GetValue()
print skelname

config = ConfigParser.RawConfigParser()
config.read('ogrecommand.cfg')
modelfolder = config.get('destination', 'models')
meshpath = self.dstRootpath + modelfolder + "\\" + meshname
print meshpath
shutil.copy(meshname, meshpath)

skelname = self.wxtxtSkeleton.GetValue()
if skelname !="":
meshpath = self.dstRootpath + modelfolder + "\\" + skelname
print meshpath
shutil.copy(skelname, meshpath)


fname = self.meshname.replace(".xml","")
meshname = fname

fname = meshname.replace(".mesh","")
meshname = fname

fname = "mesh_" + meshname + ".material"

config = ConfigParser.RawConfigParser()
config.read('ogrecommand.cfg')
sciptfolder = config.get('destination', 'scripts')
scriptpath = self.dstRootpath + sciptfolder + "\\" + fname
print scriptpath
shutil.copy(fname, scriptpath)

config = ConfigParser.RawConfigParser()
config.read('ogrecommand.cfg')
texturefolder = config.get('destination', 'textures')
texturepath = self.dstRootpath + texturefolder + "\\" + self.texturename
print texturepath
shutil.copy(self.texturename, texturepath)




def onBtnOpenSource(self,event):

try:
os.startfile(self.srcRootpath)
self.srcpathflag = True
except:
if self.srcpathflag == False:
msg ="The source path was not found.\nSearch?"
rsp = wx.MessageBox(msg, 'Source Path', wx.YES_NO)

if rsp == wx.YES:
dlg = wx.FileDialog(self)
#dlg.SetPath('\\')
#dlg.SetWildcard("scene*.xml")
ok = False
if dlg.ShowModal() == wx.ID_OK:
self.path = dlg.GetPath()
ok = True
dlg.Destroy()

if ok==True:
path, file = os.path.split(self.path)
print path
self.srcpathflag = True
self.srcRootpath = path



def onBtnOpenDst(self,event):
os.startfile(self.dstRootpath)

def onBtnOpenApp(self,event):
os.startfile(self.apppath)


def onBtnTextures (self,event):
index = event.GetSelection()
self.texturename = self.skinfilelist[index]

print "___________________________"
listindexList = self.wxlistTextures.GetSelections()
count = len(listindexList)
for i in range(0,count):
index = listindexList
textname = self.skinfilelist[index]
print textname





pos = self.meshname.rfind(".skeleton")
if pos !=-1:
#self.wxbtnMaterial.Disable()
#self.wxbtnCopyDst.Disable()
pass
else:
#self.wxbtnMaterial.Enable()
#self.wxbtnCopyDst.Enable()
pass


app = wx.App(0)
MyApp(None,-1,"OgreCommand")
app.MainLoop()




here is the config file (ogrecommand.cfg)



[destination]
rootpath=C:\PythonOgre\demos\ogre\media

programs = \programs
scripts = \scripts
textures = \textures
models = \models

[source]
rootpath=C:\3d_objects\creatures

[app]
rootpath=C:\PythonOgre\demos\visual



Best Regards,

Skorpio

skorpio

30-07-2012 01:55:49

Hello,

Recently, I had the good fortune to start playing around with linux: Linux Mint 13.
This version of linux: Mint 13 is based on Ubuntu. It is the most common distro according to distrowatch.com
Mint comes with python 2.7.3 already installed and other goodies.

Anyway, I'm now in the processes of trying to build python-ogre on Mint13 without much success.
I have tried several instructions:

http://wiki.python-ogre.org/index.php/LinuxBuildV2
http://wiki.python-ogre.org/index.php/LinuxBuildV4
http://python-ogre.svn.sourceforge.net/ ... iew=markup

None have worked.

I modified this shell script found on LinuxBuildV4 above


#! /bin/sh

#__version__ 0.0.2.20110116-1

echo "_________________________________________________________________________________________________________________"
echo "STEP 1. Installing Packages"
echo "_________________________________________________________________________________________________________________"
sudo apt-get install subversion
sudo apt-get install cvs
sudo apt-get install scons
sudo apt-get install

#wget http://mirrors.kernel.org/ubuntu/pool/universe/c/celementtree/python-celementtree_1.0.5-10_i386.deb
#wget http://ftp.us.debian.org/debian/pool/main/e/elementtree/python-elementtree_1.2.6-12_all.deb
#sudo dpkg -i python-elementtree_1.0.5-10_i386.deb
#sudo dpkg -i python-celementtree_1.0.5-10_i386.deb

echo "_________________________________________________________________________________________________________________"
echo "STEP 2. Getting python-ogre Trunk"
echo "_________________________________________________________________________________________________________________"

#svn co https://python-ogre.svn.sourceforge.net/svnroot/python-ogre/branches/v1-6-4 python-ogre
svn co https://python-ogre.svn.sourceforge.net/svnroot/python-ogre/trunk/python-ogre python-ogre

ln -s python-ogre/scripts/00-PreReqs.sh .
sh ./00-PreReqs.sh


echo "_________________________________________________________________________________________________________________"
echo "STEP 1. Installing Packages"
echo "_________________________________________________________________________________________________________________"

sudo apt-get install cmake libboost-thread-dev libboost-date-time-dev scons
sudo apt-get install libfreeimage-dev libfreeimage3 libzzip-dev bjam



#python python-ogre/BuildModule.py -r cg pygccxml pyplusplus gccxml
#python python-ogre/BuildModule.py -b gccxml pygccxml cg pyplusplus boost_python --usesystem

python python-ogre/BuildModule.py -r boost_python --usesystem
python python-ogre/BuildModule.py -b boost_python --usesystem

python python-ogre/BuildModule.py -r cmake gccxml boost cg scons freeimage zziplib pygccxml pyplusplus
python python-ogre/BuildModule.py -b cmake gccxml boost cg scons freeimage zziplib pygccxml pyplusplus

svn co http://pygccxml.svn.sourceforge.net/svnroot/pygccxml/pyplusplus_dev pyplusplus
cd pyplusplus/
sudo python setup.py install
cd ..
python python-ogre/BuildModule.py -r ois ogre cegui
python python-ogre/BuildModule.py -b ois ogre --usesystem
python python-ogre/BuildModule.py -b cegui --usesystem
python python-ogre/BuildModule.py -g -c ogre --usesystem
python python-ogre/BuildModule.py -g -c ois cegui --usesystem
python python-ogre/BuildModule.py -b install --usesystem


Any help would be appreciated.

Best regards,

Skorpio

dermont

30-07-2012 03:00:23

Hello,

Recently, I had the good fortune to start playing around with linux: Linux Mint 13.
This version of linux: Mint 13 is based on Ubuntu. It is the most common distro according to distrowatch.com
Mint comes with python 2.7.3 already installed and other goodies.

Anyway, I'm now in the processes of trying to build python-ogre on Mint13 without much success.
I have tried several instructions:

http://wiki.python-ogre.org/index.php/LinuxBuildV2
http://wiki.python-ogre.org/index.php/LinuxBuildV4
http://python-ogre.svn.sourceforge.net/ ... iew=markup

None have worked.

I modified this shell script found on LinuxBuildV4 above


#! /bin/sh

#__version__ 0.0.2.20110116-1

echo "_________________________________________________________________________________________________________________"
echo "STEP 1. Installing Packages"
echo "_________________________________________________________________________________________________________________"
sudo apt-get install subversion
sudo apt-get install cvs
sudo apt-get install scons
sudo apt-get install

#wget http://mirrors.kernel.org/ubuntu/pool/u ... 0_i386.deb
#wget http://ftp.us.debian.org/debian/pool/ma ... 12_all.deb
#sudo dpkg -i python-elementtree_1.0.5-10_i386.deb
#sudo dpkg -i python-celementtree_1.0.5-10_i386.deb

echo "_________________________________________________________________________________________________________________"
echo "STEP 2. Getting python-ogre Trunk"
echo "_________________________________________________________________________________________________________________"

#svn co https://python-ogre.svn.sourceforge.net ... hes/v1-6-4 python-ogre
svn co https://python-ogre.svn.sourceforge.net ... ython-ogre python-ogre

ln -s python-ogre/scripts/00-PreReqs.sh .
sh ./00-PreReqs.sh


echo "_________________________________________________________________________________________________________________"
echo "STEP 1. Installing Packages"
echo "_________________________________________________________________________________________________________________"

sudo apt-get install cmake libboost-thread-dev libboost-date-time-dev scons
sudo apt-get install libfreeimage-dev libfreeimage3 libzzip-dev bjam



#python python-ogre/BuildModule.py -r cg pygccxml pyplusplus gccxml
#python python-ogre/BuildModule.py -b gccxml pygccxml cg pyplusplus boost_python --usesystem

python python-ogre/BuildModule.py -r boost_python --usesystem
python python-ogre/BuildModule.py -b boost_python --usesystem

python python-ogre/BuildModule.py -r cmake gccxml boost cg scons freeimage zziplib pygccxml pyplusplus
python python-ogre/BuildModule.py -b cmake gccxml boost cg scons freeimage zziplib pygccxml pyplusplus

svn co http://pygccxml.svn.sourceforge.net/svn ... usplus_dev pyplusplus
cd pyplusplus/
sudo python setup.py install
cd ..
python python-ogre/BuildModule.py -r ois ogre cegui
python python-ogre/BuildModule.py -b ois ogre --usesystem
python python-ogre/BuildModule.py -b cegui --usesystem
python python-ogre/BuildModule.py -g -c ogre --usesystem
python python-ogre/BuildModule.py -g -c ois cegui --usesystem
python python-ogre/BuildModule.py -b install --usesystem


Any help would be appreciated.

Best regards,

Skorpio


Can you you post a link to your log.out or the actual error you are encountering.

A couple of things looking at your script there appears to be some duplication, e.g:
you install freeimage,boost,scons,cmake,zziplib from apt then have the build system retrieve and build these, best to just install from apt so you can skip the retrieve/build.

Also there should be a more recent versions of cg and gccxml via apt and it makes things easier.
>> sudo apt-get install nvidia-cg-toolkit
>> sudo apt-get install gccxml

Edit:

Since you have installed apt versions of libboost-*-dev it would probably be advisable to use the apt version of libboost-python-dev so everything is in sync (I don't think it is a requirement to build boost python any more though I could be wrong).

skorpio

31-07-2012 07:28:42

Hello,

Thanks for your help. Based on your suggestions I edited the Ogre.sh file to avoid duplication
However some packages were not available as apt-get.


#! /bin/sh
#__version__ 0.0.2.20110116-1

echo "_________________________________________________________________________________________________________________"
echo "STEP 1. Installing Packages"
echo "_________________________________________________________________________________________________________________"
sudo apt-get install subversion
sudo apt-get install cvs
sudo apt-get install scons
sudo apt-get install cmake
sudo apt-get install libboost-thread1.48.0
sudo apt-get install libboost-date-time1.48.0
sudo apt-get install libboost-python1.48.0
sudo apt-get install libfreeimage3
sudo apt-get install libzzip-0-13
sudo apt-get install gccxml
sudo apt-get install python-pygccxml
sudo apt-get install nvidia-cg-toolkit
sudo apt-get install bjam
sudo apt-get install cg

echo
echo "_________________________________________________________________________________________________________________"
echo "STEP 2. Getting python-ogre Trunk"
echo "_________________________________________________________________________________________________________________"

#svn co https://python-ogre.svn.sourceforge.net ... hes/v1-6-4 python-ogre
svn co https://python-ogre.svn.sourceforge.net ... ython-ogre python-ogre

echo
echo "_________________________________________________________________________________________________________________"
echo "STEP 3. Installing Packages from /python-ogre/scripts"
echo "_________________________________________________________________________________________________________________"

ln -s python-ogre/scripts/00-PreReqs.sh
sh ./00-PreReqs.sh

echo
echo "_________________________________________________________________________________________________________________"
echo "STEP 4. Retrieving Packages"
echo "_________________________________________________________________________________________________________________"

python python-ogre/BuildModule.py -r cg
python python-ogre/BuildModule.py -r pyplusplus

echo
echo "_________________________________________________________________________________________________________________"
echo "STEP 5. Building Packages"
echo "_________________________________________________________________________________________________________________"

python python-ogre/BuildModule.py -b cg
python python-ogre/BuildModule.py -b pyplusplus


#python python-ogre/BuildModule.py -b gccxml pygccxml cg pyplusplus boost_python --usesystem
#python python-ogre/BuildModule.py -r boost_python --usesystem
#python python-ogre/BuildModule.py -b boost_python --usesystem

#python python-ogre/BuildModule.py -r cmake gccxml boost cg scons freeimage zziplib pygccxml pyplusplus
#python python-ogre/BuildModule.py -b cmake gccxml boost cg scons freeimage zziplib pygccxml pyplusplus



#svn co http://pygccxml.svn.sourceforge.net/svn ... usplus_dev pyplusplus
cd pyplusplus/
sudo python setup.py install
cd ..

echo
echo "_________________________________________________________________________________________________________________"
echo "STEP 6 Retrieving python-ogre packages"
echo "_________________________________________________________________________________________________________________"

python python-ogre/BuildModule.py -r ois
python python-ogre/BuildModule.py -r ogre
python python-ogre/BuildModule.py -r cegui

export LD_LIBRARY_PATH=~/home/dev/root/usr/lib/
echo
echo "_________________________________________________________________________________________________________________"
echo "STEP 7 Building python-ogre packages"
echo "_________________________________________________________________________________________________________________"

python python-ogre/BuildModule.py -b ois --usesystem
python python-ogre/BuildModule.py -b cegui --usesystem
python python-ogre/BuildModule.py -g -c ois --usesystem
python python-ogre/BuildModule.py -g -c cegui --usesystem

echo "_________________________________________________________________________________________________________________"
echo "STEP 8 Building python-ogre"
echo "_________________________________________________________________________________________________________________"

python python-ogre/BuildModule.py -b ogre --usesystem
python python-ogre/BuildModule.py -g -c ogre --usesystem
python python-ogre/BuildModule.py -b install --usesystem




I edited this file: 00-PreReqs.sh in the /python-ogre/scripts to reflect latest lib available

#!/bin/bash
# Part of the Python-Ogre installation
# python-celementtree \
# python2.6-clementtree \
if [ -x /usr/bin/apt-get ]; then
sudo apt-get install \
g++ \
libfreetype6 \
libpcre3 \
autoconf \
automake \
libgl1-mesa-glx \
libx11-6 \
libglut3-dev \
libtool \
libxaw7 \
libxxf86vm1 \
patch \
libxrandr2 \
cvs \
subversion \
libxt6 \
libexpat1 \
python \
libglew1.6 \
jam \
cmake libboost-thread1.48.0 libboost-date-time1.48.0 scons \
libfreeimage3 libzzip-0-13 bjam \

fi




Here is the dump from the code above

_________________________________________________________________________________________________________________
STEP 1. Installing Packages
_________________________________________________________________________________________________________________
Reading package lists... Done
Building dependency tree
Reading state information... Done
subversion is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 9 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
cvs is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 9 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
scons is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 9 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
cmake is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 9 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
libboost-thread1.48.0 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 9 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
libboost-date-time1.48.0 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 9 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
libboost-python1.48.0 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 9 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
libfreeimage3 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 9 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
libzzip-0-13 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 9 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
gccxml is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 9 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-pygccxml is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 9 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
nvidia-cg-toolkit is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 9 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package bjam is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
libboost1.48-dev:i386 libboost1.46-dev:i386 libboost1.48-dev libboost1.46-dev

E: Package 'bjam' has no installation candidate
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package cg

_________________________________________________________________________________________________________________
STEP 2. Getting python-ogre Trunk
_________________________________________________________________________________________________________________
Restored 'python-ogre/stdint.h'
Checked out revision 1154.

_________________________________________________________________________________________________________________
STEP 3. Installing Packages from /python-ogre/scripts
_________________________________________________________________________________________________________________
ln: failed to create symbolic link `./00-PreReqs.sh': File exists
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package bjam is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
libboost1.48-dev:i386 libboost1.46-dev:i386 libboost1.48-dev libboost1.46-dev

E: Unable to locate package libglut3-dev
E: Package 'bjam' has no installation candidate

_________________________________________________________________________________________________________________
STEP 4. Retrieving Packages
_________________________________________________________________________________________________________________
PythonOgre.BuildModule: INFO Retrieving http://developer.download.nvidia.com/cg ... x86_64.tgz
PythonOgre.BuildModule: INFO Retrieving co http://pygccxml.svn.sourceforge.net/svn ... usplus_dev pyplusplus

_________________________________________________________________________________________________________________
STEP 5. Building Packages
_________________________________________________________________________________________________________________
PythonOgre.BuildModule: INFO Build Command tar xvzf /home/dev/downloads/Cg-2.2_October2009_x86_64.tgz --overwrite
PythonOgre.BuildModule: INFO Build Command python setup.py install --prefix=/home/dev/root/usr
running install
running build
running build_py
running install_lib
running install_egg_info
Removing /usr/local/lib/python2.7/dist-packages/Py_-1.0.0.egg-info
Writing /usr/local/lib/python2.7/dist-packages/Py_-1.0.0.egg-info

_________________________________________________________________________________________________________________
STEP 6 Retrieving python-ogre packages
_________________________________________________________________________________________________________________
PythonOgre.BuildModule: INFO Retrieving -z3 -d:pserver:anonymous@wgois.cvs.sourceforge.net:/cvsroot/wgois co -D 01Jan2009 -P ois
PythonOgre.BuildModule: INFO Retrieving http://sourceforge.net/projects/ogre/fi ... -2.tar.bz2
PythonOgre.BuildModule: INFO Retrieving http://prdownloads.sourceforge.net/cray ... 7.5.tar.gz

_________________________________________________________________________________________________________________
STEP 7 Building python-ogre packages
_________________________________________________________________________________________________________________
PythonOgre.BuildModule: INFO Build Command ./bootstrap
PythonOgre.BuildModule: INFO Build Command ./configure --prefix=/usr --includedir=/usr/include
PythonOgre.BuildModule: WARNING Task Failed
PythonOgre.BuildModule: INFO Build Command make
PythonOgre.BuildModule: WARNING Task Failed
PythonOgre.BuildModule: INFO Build Command sudo make install
PythonOgre.BuildModule: WARNING Task Failed
PythonOgre.BuildModule: INFO Build Command tar zxf /home/dev/downloads/CEGUI-0.7.5.tar.gz --overwrite
PythonOgre.BuildModule: INFO Build Command ./bootstrap
PythonOgre.BuildModule: INFO Build Command ./configure --prefix=/usr --enable-freeimage=yes --enable-ogre-renderer=yes --with-default-xml-parser=TinyXMLParser --includedir=/usr/include
PythonOgre.BuildModule: WARNING Task Failed
PythonOgre.BuildModule: INFO Build Command make
PythonOgre.BuildModule: WARNING Task Failed
PythonOgre.BuildModule: INFO Build Command sudo make install
PythonOgre.BuildModule: WARNING Task Failed
PythonOgre.BuildModule: INFO Building Source code for ois
PythonOgre.BuildModule: WARNING Task Failed
PythonOgre.BuildModule: INFO Compiling Source code for ois
PythonOgre.BuildModule: WARNING Task Failed
PythonOgre.BuildModule: INFO Building Source code for cegui
PythonOgre.BuildModule: WARNING Task Failed
PythonOgre.BuildModule: INFO Compiling Source code for cegui
PythonOgre.BuildModule: WARNING Task Failed
_________________________________________________________________________________________________________________
STEP 8 Building python-ogre
_________________________________________________________________________________________________________________
PythonOgre.BuildModule: INFO Build Command tar jxf /home/dev/downloads/ogre_src_v1-7-2.tar.bz2 --overwrite
PythonOgre.BuildModule: INFO Build Command mv ogre_src_v1-7-2 ogre
PythonOgre.BuildModule: INFO Build Command cmake . -DOGRE_INSTALL_PLUGINS_HEADERS=TRUE -DCMAKE_INSTALL_PREFIX:PATH=/usr
PythonOgre.BuildModule: WARNING Task Failed
PythonOgre.BuildModule: INFO Build Command make
PythonOgre.BuildModule: WARNING Task Failed
PythonOgre.BuildModule: INFO Build Command sudo make install
PythonOgre.BuildModule: WARNING Task Failed
PythonOgre.BuildModule: INFO Building Source code for ogre
PythonOgre.BuildModule: WARNING Task Failed
PythonOgre.BuildModule: INFO Compiling Source code for ogre
PythonOgre.BuildModule: WARNING Task Failed
PythonOgre.BuildModule: INFO Build Command sudo python setup.py install


In order to get this far, I had to comment out this:

class hydrax(pymodule):
name = "hydrax"
version = "0.5.1"
parent = "ogre/addons"
cflags = ""
include_dirs = [
boost.PATH,
Config.PATH_INCLUDE_Ogre,
Config.PATH_INCLUDE_hydrax,
'C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\PlatformSDK\Include'
]
lib_dirs = [
boost.PATH_LIB,
Config.PATH_LIB_Ogre_OgreMain,
Config.PATH_LIB_Ogre_Dependencies,
# Config.PATH_LIB_hydrax,
'C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\PlatformSDK\Lib'
]
libs = [ boost.lib, 'OgreMain'] #, 'Hydrax' ]

#<---------------- MODED HERE--------------------------------------> moduleLibs = [ os.path.join(Config.PATH_LIB_hydrax, 'Hydrax')]


ModuleName = "hydrax"
descText = "Fantastic water/ocean effects"
descLink = "http://www.ogre3d.org/";

CCFLAGS = " /fp:fast " #-D_RELEASE -D_WIN32 "
LINKFLAGS = " /LTCG /DYNAMICBASE:NO /MACHINE:X86 "

# testing dll linkage..
if False:
libs.append('Hydrax')
lib_dirs.append(Config.PATH_LIB_hydrax)
for p in Config.PATH_INCLUDE_hydrax_modules:
include_dirs.insert(0, p)



It can't find cg, and bjam in STEP 1
and OIS in STEP 7, I get this dump from log.out


07-30 23:34 PythonOgre.BuildModule INFO Build Command ./bootstrap
07-30 23:34 PythonOgre.BuildModule DEBUG Spawning './bootstrap' in '/home/dev/ois'
07-30 23:34 PythonOgre.BuildModule INFO Build Command ./configure --prefix=/usr --includedir=/usr/include
07-30 23:34 PythonOgre.BuildModule DEBUG Spawning './configure --prefix=/usr --includedir=/usr/include' in '/home/dev/ois'
07-30 23:34 PythonOgre.BuildModule WARNING Task Failed
07-30 23:34 PythonOgre.BuildModule DEBUG checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking whether gcc and cc understand -c and -o together... yes
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for mt... mt
checking if mt is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether to use STLPort... (cached) no
checking X11/Xaw/Command.h usability... no
checking X11/Xaw/Command.h presence... no
checking for X11/Xaw/Command.h... no

07-30 23:34 PythonOgre.BuildModule DEBUG configure: error: "libxaw headers not found"

07-30 23:34 PythonOgre.BuildModule INFO Build Command make
07-30 23:34 PythonOgre.BuildModule DEBUG Spawning 'make' in '/home/dev/ois'
07-30 23:34 PythonOgre.BuildModule WARNING Task Failed
07-30 23:34 PythonOgre.BuildModule DEBUG
07-30 23:34 PythonOgre.BuildModule DEBUG make: *** No targets specified and no makefile found. Stop.

07-30 23:34 PythonOgre.BuildModule INFO Build Command sudo make install
07-30 23:34 PythonOgre.BuildModule DEBUG Spawning 'sudo make install' in '/home/dev/ois'
07-30 23:34 PythonOgre.BuildModule WARNING Task Failed
07-30 23:34 PythonOgre.BuildModule DEBUG
07-30 23:34 PythonOgre.BuildModule DEBUG make: *** No rule to make target `install'. Stop.




Thanks for all your help,

Skorpio

dermont

31-07-2012 10:16:15

1. bjam and boost headers should be included via libboost1.48-dev
2. cg should be libcg
3. libglut3-dev, use freeglut3-dev
4. OIS problem you are missing libxaw7-dev other dev packages appear to be missing from step 1. For some reason you have removed the "-dev" from all the script files, this was the original:

if [ -x /usr/bin/apt-get ]; then
sudo apt-get install \
g++ \
libfreetype6-dev \
libpcre3-dev \
autoconf \
automake1.9 \
libgl1-mesa-dev \
libx11-dev \
libglut3-dev \
libtool \
libxaw7-dev \
libxxf86vm-dev \
patch \
libxrandr-dev \
cvs \
subversion \
libxt-dev \
libexpat1-dev \
python \
python-dev \
libglew-dev \
jam \
cmake libboost-thread-dev libboost-date-time-dev scons \
libfreeimage-dev libfreeimage3 libzzip-dev bjam \


Open up a terminal and install the dependencies or update your script to install the development libs.
>> sudo apt-get install libxaw7-dev libxxf86vm-dev libxrandr-dev libxt-dev libglew1.6-dev libboost1.48-dev freeglut3-dev libcg libboost-thread1.48-dev libboost-python1.48-dev libboost-date-time1.48-dev libfreeimage-dev libfreeimage3 libzzip-dev libfreetype6-dev libpcre3-dev python-dev libgl1-mesa-dev libx11-dev


There may be others for Ogre, if you run into similar problems, open up a terminal and search for the missing lib/development files, e.g:
>> apt-cache search libXt

Edit:
And you are mixing libs again with Cg, you shouldn't need to download and install Cg if you are using the one supplied via apt.
#python python-ogre/BuildModule.py -b cg

skorpio

01-08-2012 07:17:03

Thanks again,

Yes, I did modified the scripts file because it was my understanding that *-dev libraries were not release version
and I did not want to build python-ogre with such libraries. In any case, I reverted back per your recommendations.

After I apt-get all the files you mentioned it got it to go just a little further.

python python-ogre/BuildModule.py -b ois --usesystem PASS
python python-ogre/BuildModule.py -g -c ois --usesystem FAILED see below

07-31 23:11 PythonOgre.BuildModule INFO Building Source code for ois
07-31 23:11 PythonOgre.BuildModule DEBUG Spawning 'python generate_code.py --usesystem' in '/home/dev/python-ogre/code_generators/ois'
07-31 23:11 PythonOgre.BuildModule WARNING Task Failed
07-31 23:11 PythonOgre.BuildModule DEBUG
07-31 23:11 PythonOgre.BuildModule DEBUG Traceback (most recent call last):
File "generate_code.py", line 28, in <module>
import common_utils
File "../common_utils/__init__.py", line 3, in <module>
import shared_ptr
File "../common_utils/shared_ptr.py", line 3, in <module>
from pyplusplus import messages
File "/usr/local/lib/python2.7/dist-packages/pyplusplus/__init__.py", line 23, in <module>
import code_creators
File "/usr/local/lib/python2.7/dist-packages/pyplusplus/code_creators/__init__.py", line 96, in <module>
from calldef_ctypes import function_definition_t
File "/usr/local/lib/python2.7/dist-packages/pyplusplus/code_creators/calldef_ctypes.py", line 13, in <module>
CCT = declarations.CALLING_CONVENTION_TYPES
AttributeError: 'module' object has no attribute 'CALLING_CONVENTION_TYPES'

07-31 23:11 PythonOgre.BuildModule INFO Compiling Source code for ois
07-31 23:11 PythonOgre.BuildModule DEBUG Spawning 'scons -j6 PROJECTS=ois' in '/home/dev/python-ogre'


python python-ogre/BuildModule.py -b cegui --usesystem FAILED see below
python python-ogre/BuildModule.py -g -c cegui --usesystem Not tested


07-31 23:09 PythonOgre.BuildModule INFO Build Command tar zxf /home/dev/downloads/CEGUI-0.7.5.tar.gz --overwrite
07-31 23:09 PythonOgre.BuildModule DEBUG Spawning 'tar zxf /home/dev/downloads/CEGUI-0.7.5.tar.gz --overwrite' in '/home/dev'
07-31 23:09 PythonOgre.BuildModule INFO Build Command ./bootstrap
07-31 23:09 PythonOgre.BuildModule DEBUG Spawning './bootstrap' in '/home/dev/CEGUI-0.7.5'
07-31 23:09 PythonOgre.BuildModule INFO Build Command ./configure --prefix=/usr --enable-freeimage=yes --enable-ogre-renderer=yes --with-default-xml-parser=TinyXMLParser --includedir=/usr/include
07-31 23:09 PythonOgre.BuildModule DEBUG Spawning './configure --prefix=/usr --enable-freeimage=yes --enable-ogre-renderer=yes --with-default-xml-parser=TinyXMLParser --includedir=/usr/include' in '/home/dev/CEGUI-0.7.5'
07-31 23:10 PythonOgre.BuildModule INFO Build Command make
07-31 23:10 PythonOgre.BuildModule DEBUG Spawning 'make' in '/home/dev/CEGUI-0.7.5'
07-31 23:10 PythonOgre.BuildModule WARNING Task Failed
07-31 23:10 PythonOgre.BuildModule DEBUG Making all in .
make[1]: Entering directory `/home/dev/CEGUI-0.7.5'
make[1]: Nothing to be done for `all-am'.
make[1]: Leaving directory `/home/dev/CEGUI-0.7.5'
Making all in cegui
make[1]: Entering directory `/home/dev/CEGUI-0.7.5/cegui'
Making all in .
make[2]: Entering directory `/home/dev/CEGUI-0.7.5/cegui'
make[2]: Nothing to be done for `all-am'.
make[2]: Leaving directory `/home/dev/CEGUI-0.7.5/cegui'
Making all in src
make[2]: Entering directory `/home/dev/CEGUI-0.7.5/cegui/src'
Making all in .
make[3]: Entering directory `/home/dev/CEGUI-0.7.5/cegui/src'
/bin/bash ../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I../../cegui/include -I../../cegui/include -I/usr/include/freetype2 -I/usr/include -L/usr/lib -L/usr/lib64 -MT libCEGUIBase_la-CEGUIAffector.lo -MD -MP -MF .deps/libCEGUIBase_la-CEGUIAffector.Tpo -c -o libCEGUIBase_la-CEGUIAffector.lo `test -f 'CEGUIAffector.cpp' || echo './'`CEGUIAffector.cpp
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../../cegui/include -I../../cegui/include -I/usr/include/freetype2 -I/usr/include -L/usr/lib -L/usr/lib64 -MT libCEGUIBase_la-CEGUIAffector.lo -MD -MP -MF .deps/libCEGUIBase_la-CEGUIAffector.Tpo -c CEGUIAffector.cpp -fPIC -DPIC -o .libs/libCEGUIBase_la-CEGUIAffector.o
make[3]: Leaving directory `/home/dev/CEGUI-0.7.5/cegui/src'
make[2]: Leaving directory `/home/dev/CEGUI-0.7.5/cegui/src'
make[1]: Leaving directory `/home/dev/CEGUI-0.7.5/cegui'

07-31 23:10 PythonOgre.BuildModule DEBUG In file included from ../../cegui/include/CEGUIAffector.h:33:0,
from CEGUIAffector.cpp:30:
../../cegui/include/CEGUIString.h:65:11: error: 'ptrdiff_t' does not name a type
make[3]: *** [libCEGUIBase_la-CEGUIAffector.lo] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1

07-31 23:10 PythonOgre.BuildModule INFO Build Command sudo make install
07-31 23:10 PythonOgre.BuildModule DEBUG Spawning 'sudo make install' in '/home/dev/CEGUI-0.7.5'
07-31 23:10 PythonOgre.BuildModule WARNING Task Failed
07-31 23:10 PythonOgre.BuildModule DEBUG Making install in .
make[1]: Entering directory `/home/dev/CEGUI-0.7.5'
make[2]: Entering directory `/home/dev/CEGUI-0.7.5'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/home/dev/CEGUI-0.7.5'
make[1]: Leaving directory `/home/dev/CEGUI-0.7.5'
Making install in cegui
make[1]: Entering directory `/home/dev/CEGUI-0.7.5/cegui'
Making install in .
make[2]: Entering directory `/home/dev/CEGUI-0.7.5/cegui'
make[3]: Entering directory `/home/dev/CEGUI-0.7.5/cegui'
make[3]: Nothing to be done for `install-exec-am'.
test -z "/usr/lib/pkgconfig" || /bin/mkdir -p "/usr/lib/pkgconfig"
/usr/bin/install -c -m 644 CEGUI.pc CEGUI-OPENGL.pc CEGUI-OGRE.pc '/usr/lib/pkgconfig'
make[3]: Leaving directory `/home/dev/CEGUI-0.7.5/cegui'
make[2]: Leaving directory `/home/dev/CEGUI-0.7.5/cegui'
Making install in src
make[2]: Entering directory `/home/dev/CEGUI-0.7.5/cegui/src'
Making install in .
make[3]: Entering directory `/home/dev/CEGUI-0.7.5/cegui/src'
/bin/bash ../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I../../cegui/include -I../../cegui/include -I/usr/include/freetype2 -I/usr/include -L/usr/lib -L/usr/lib64 -MT libCEGUIBase_la-CEGUIAffector.lo -MD -MP -MF .deps/libCEGUIBase_la-CEGUIAffector.Tpo -c -o libCEGUIBase_la-CEGUIAffector.lo `test -f 'CEGUIAffector.cpp' || echo './'`CEGUIAffector.cpp
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../../cegui/include -I../../cegui/include -I/usr/include/freetype2 -I/usr/include -L/usr/lib -L/usr/lib64 -MT libCEGUIBase_la-CEGUIAffector.lo -MD -MP -MF .deps/libCEGUIBase_la-CEGUIAffector.Tpo -c CEGUIAffector.cpp -fPIC -DPIC -o .libs/libCEGUIBase_la-CEGUIAffector.o
make[3]: Leaving directory `/home/dev/CEGUI-0.7.5/cegui/src'
make[2]: Leaving directory `/home/dev/CEGUI-0.7.5/cegui/src'
make[1]: Leaving directory `/home/dev/CEGUI-0.7.5/cegui'

07-31 23:10 PythonOgre.BuildModule DEBUG In file included from ../../cegui/include/CEGUIAffector.h:33:0,
from CEGUIAffector.cpp:30:
../../cegui/include/CEGUIString.h:65:11: error: 'ptrdiff_t' does not name a type
make[3]: *** [libCEGUIBase_la-CEGUIAffector.lo] Error 1
make[2]: *** [install-recursive] Error 1
make[1]: *** [install-recursive] Error 1
make: *** [install-recursive] Error 1



python python-ogre/BuildModule.py -b ogre --usesystem PASSED
python python-ogre/BuildModule.py -g -c ogre --usesystem FAILED see below
python python-ogre/BuildModule.py -b install --usesystem Not tested



07-31 23:15 PythonOgre.BuildModule INFO Building Source code for ogre
07-31 23:15 PythonOgre.BuildModule DEBUG Spawning 'python generate_code.py --usesystem' in '/home/dev/python-ogre/code_generators/ogre'
07-31 23:15 PythonOgre.BuildModule WARNING Task Failed
07-31 23:15 PythonOgre.BuildModule DEBUG
07-31 23:15 PythonOgre.BuildModule DEBUG Traceback (most recent call last):
File "generate_code.py", line 27, in <module>
import common_utils
File "../common_utils/__init__.py", line 3, in <module>
import shared_ptr
File "../common_utils/shared_ptr.py", line 3, in <module>
from pyplusplus import messages
File "/usr/local/lib/python2.7/dist-packages/pyplusplus/__init__.py", line 23, in <module>
import code_creators
File "/usr/local/lib/python2.7/dist-packages/pyplusplus/code_creators/__init__.py", line 96, in <module>
from calldef_ctypes import function_definition_t
File "/usr/local/lib/python2.7/dist-packages/pyplusplus/code_creators/calldef_ctypes.py", line 13, in <module>
CCT = declarations.CALLING_CONVENTION_TYPES
AttributeError: 'module' object has no attribute 'CALLING_CONVENTION_TYPES'

07-31 23:15 PythonOgre.BuildModule INFO Compiling Source code for ogre
07-31 23:15 PythonOgre.BuildModule DEBUG Spawning 'scons -j6 PROJECTS=ogre' in '/home/dev/python-ogre'



Thanks for all your help

Best Regards

Skorpio

dermont

01-08-2012 08:17:44

Thanks again,

Yes, I did modified the scripts file because it was my understanding that *-dev libraries were not release version
and I did not want to build python-ogre with such libraries. In any case, I reverted back per your recommendations.

After I apt-get all the files you mentioned it got it to go just a little further.

python python-ogre/BuildModule.py -b ois --usesystem PASS
python python-ogre/BuildModule.py -g -c ois --usesystem FAILED see below

07-31 23:11 PythonOgre.BuildModule INFO Building Source code for ois
07-31 23:11 PythonOgre.BuildModule DEBUG Spawning 'python generate_code.py --usesystem' in '/home/dev/python-ogre/code_generators/ois'
07-31 23:11 PythonOgre.BuildModule WARNING Task Failed
07-31 23:11 PythonOgre.BuildModule DEBUG
07-31 23:11 PythonOgre.BuildModule DEBUG Traceback (most recent call last):
File "generate_code.py", line 28, in <module>
import common_utils
File "../common_utils/__init__.py", line 3, in <module>
import shared_ptr
File "../common_utils/shared_ptr.py", line 3, in <module>
from pyplusplus import messages
File "/usr/local/lib/python2.7/dist-packages/pyplusplus/__init__.py", line 23, in <module>
import code_creators
File "/usr/local/lib/python2.7/dist-packages/pyplusplus/code_creators/__init__.py", line 96, in <module>
from calldef_ctypes import function_definition_t
File "/usr/local/lib/python2.7/dist-packages/pyplusplus/code_creators/calldef_ctypes.py", line 13, in <module>
CCT = declarations.CALLING_CONVENTION_TYPES
AttributeError: 'module' object has no attribute 'CALLING_CONVENTION_TYPES'

07-31 23:11 PythonOgre.BuildModule INFO Compiling Source code for ois
07-31 23:11 PythonOgre.BuildModule DEBUG Spawning 'scons -j6 PROJECTS=ois' in '/home/dev/python-ogre'


python python-ogre/BuildModule.py -b cegui --usesystem FAILED see below
python python-ogre/BuildModule.py -g -c cegui --usesystem Not tested


07-31 23:09 PythonOgre.BuildModule INFO Build Command tar zxf /home/dev/downloads/CEGUI-0.7.5.tar.gz --overwrite
07-31 23:09 PythonOgre.BuildModule DEBUG Spawning 'tar zxf /home/dev/downloads/CEGUI-0.7.5.tar.gz --overwrite' in '/home/dev'
07-31 23:09 PythonOgre.BuildModule INFO Build Command ./bootstrap
07-31 23:09 PythonOgre.BuildModule DEBUG Spawning './bootstrap' in '/home/dev/CEGUI-0.7.5'
07-31 23:09 PythonOgre.BuildModule INFO Build Command ./configure --prefix=/usr --enable-freeimage=yes --enable-ogre-renderer=yes --with-default-xml-parser=TinyXMLParser --includedir=/usr/include
07-31 23:09 PythonOgre.BuildModule DEBUG Spawning './configure --prefix=/usr --enable-freeimage=yes --enable-ogre-renderer=yes --with-default-xml-parser=TinyXMLParser --includedir=/usr/include' in '/home/dev/CEGUI-0.7.5'
07-31 23:10 PythonOgre.BuildModule INFO Build Command make
07-31 23:10 PythonOgre.BuildModule DEBUG Spawning 'make' in '/home/dev/CEGUI-0.7.5'
07-31 23:10 PythonOgre.BuildModule WARNING Task Failed
07-31 23:10 PythonOgre.BuildModule DEBUG Making all in .
make[1]: Entering directory `/home/dev/CEGUI-0.7.5'
make[1]: Nothing to be done for `all-am'.
make[1]: Leaving directory `/home/dev/CEGUI-0.7.5'
Making all in cegui
make[1]: Entering directory `/home/dev/CEGUI-0.7.5/cegui'
Making all in .
make[2]: Entering directory `/home/dev/CEGUI-0.7.5/cegui'
make[2]: Nothing to be done for `all-am'.
make[2]: Leaving directory `/home/dev/CEGUI-0.7.5/cegui'
Making all in src
make[2]: Entering directory `/home/dev/CEGUI-0.7.5/cegui/src'
Making all in .
make[3]: Entering directory `/home/dev/CEGUI-0.7.5/cegui/src'
/bin/bash ../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I../../cegui/include -I../../cegui/include -I/usr/include/freetype2 -I/usr/include -L/usr/lib -L/usr/lib64 -MT libCEGUIBase_la-CEGUIAffector.lo -MD -MP -MF .deps/libCEGUIBase_la-CEGUIAffector.Tpo -c -o libCEGUIBase_la-CEGUIAffector.lo `test -f 'CEGUIAffector.cpp' || echo './'`CEGUIAffector.cpp
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../../cegui/include -I../../cegui/include -I/usr/include/freetype2 -I/usr/include -L/usr/lib -L/usr/lib64 -MT libCEGUIBase_la-CEGUIAffector.lo -MD -MP -MF .deps/libCEGUIBase_la-CEGUIAffector.Tpo -c CEGUIAffector.cpp -fPIC -DPIC -o .libs/libCEGUIBase_la-CEGUIAffector.o
make[3]: Leaving directory `/home/dev/CEGUI-0.7.5/cegui/src'
make[2]: Leaving directory `/home/dev/CEGUI-0.7.5/cegui/src'
make[1]: Leaving directory `/home/dev/CEGUI-0.7.5/cegui'

07-31 23:10 PythonOgre.BuildModule DEBUG In file included from ../../cegui/include/CEGUIAffector.h:33:0,
from CEGUIAffector.cpp:30:
../../cegui/include/CEGUIString.h:65:11: error: 'ptrdiff_t' does not name a type
make[3]: *** [libCEGUIBase_la-CEGUIAffector.lo] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1

07-31 23:10 PythonOgre.BuildModule INFO Build Command sudo make install
07-31 23:10 PythonOgre.BuildModule DEBUG Spawning 'sudo make install' in '/home/dev/CEGUI-0.7.5'
07-31 23:10 PythonOgre.BuildModule WARNING Task Failed
07-31 23:10 PythonOgre.BuildModule DEBUG Making install in .
make[1]: Entering directory `/home/dev/CEGUI-0.7.5'
make[2]: Entering directory `/home/dev/CEGUI-0.7.5'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/home/dev/CEGUI-0.7.5'
make[1]: Leaving directory `/home/dev/CEGUI-0.7.5'
Making install in cegui
make[1]: Entering directory `/home/dev/CEGUI-0.7.5/cegui'
Making install in .
make[2]: Entering directory `/home/dev/CEGUI-0.7.5/cegui'
make[3]: Entering directory `/home/dev/CEGUI-0.7.5/cegui'
make[3]: Nothing to be done for `install-exec-am'.
test -z "/usr/lib/pkgconfig" || /bin/mkdir -p "/usr/lib/pkgconfig"
/usr/bin/install -c -m 644 CEGUI.pc CEGUI-OPENGL.pc CEGUI-OGRE.pc '/usr/lib/pkgconfig'
make[3]: Leaving directory `/home/dev/CEGUI-0.7.5/cegui'
make[2]: Leaving directory `/home/dev/CEGUI-0.7.5/cegui'
Making install in src
make[2]: Entering directory `/home/dev/CEGUI-0.7.5/cegui/src'
Making install in .
make[3]: Entering directory `/home/dev/CEGUI-0.7.5/cegui/src'
/bin/bash ../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I../../cegui/include -I../../cegui/include -I/usr/include/freetype2 -I/usr/include -L/usr/lib -L/usr/lib64 -MT libCEGUIBase_la-CEGUIAffector.lo -MD -MP -MF .deps/libCEGUIBase_la-CEGUIAffector.Tpo -c -o libCEGUIBase_la-CEGUIAffector.lo `test -f 'CEGUIAffector.cpp' || echo './'`CEGUIAffector.cpp
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../../cegui/include -I../../cegui/include -I/usr/include/freetype2 -I/usr/include -L/usr/lib -L/usr/lib64 -MT libCEGUIBase_la-CEGUIAffector.lo -MD -MP -MF .deps/libCEGUIBase_la-CEGUIAffector.Tpo -c CEGUIAffector.cpp -fPIC -DPIC -o .libs/libCEGUIBase_la-CEGUIAffector.o
make[3]: Leaving directory `/home/dev/CEGUI-0.7.5/cegui/src'
make[2]: Leaving directory `/home/dev/CEGUI-0.7.5/cegui/src'
make[1]: Leaving directory `/home/dev/CEGUI-0.7.5/cegui'

07-31 23:10 PythonOgre.BuildModule DEBUG In file included from ../../cegui/include/CEGUIAffector.h:33:0,
from CEGUIAffector.cpp:30:
../../cegui/include/CEGUIString.h:65:11: error: 'ptrdiff_t' does not name a type
make[3]: *** [libCEGUIBase_la-CEGUIAffector.lo] Error 1
make[2]: *** [install-recursive] Error 1
make[1]: *** [install-recursive] Error 1
make: *** [install-recursive] Error 1



python python-ogre/BuildModule.py -b ogre --usesystem PASSED
python python-ogre/BuildModule.py -g -c ogre --usesystem FAILED see below
python python-ogre/BuildModule.py -b install --usesystem Not tested



07-31 23:15 PythonOgre.BuildModule INFO Building Source code for ogre
07-31 23:15 PythonOgre.BuildModule DEBUG Spawning 'python generate_code.py --usesystem' in '/home/dev/python-ogre/code_generators/ogre'
07-31 23:15 PythonOgre.BuildModule WARNING Task Failed
07-31 23:15 PythonOgre.BuildModule DEBUG
07-31 23:15 PythonOgre.BuildModule DEBUG Traceback (most recent call last):
File "generate_code.py", line 27, in <module>
import common_utils
File "../common_utils/__init__.py", line 3, in <module>
import shared_ptr
File "../common_utils/shared_ptr.py", line 3, in <module>
from pyplusplus import messages
File "/usr/local/lib/python2.7/dist-packages/pyplusplus/__init__.py", line 23, in <module>
import code_creators
File "/usr/local/lib/python2.7/dist-packages/pyplusplus/code_creators/__init__.py", line 96, in <module>
from calldef_ctypes import function_definition_t
File "/usr/local/lib/python2.7/dist-packages/pyplusplus/code_creators/calldef_ctypes.py", line 13, in <module>
CCT = declarations.CALLING_CONVENTION_TYPES
AttributeError: 'module' object has no attribute 'CALLING_CONVENTION_TYPES'

07-31 23:15 PythonOgre.BuildModule INFO Compiling Source code for ogre
07-31 23:15 PythonOgre.BuildModule DEBUG Spawning 'scons -j6 PROJECTS=ogre' in '/home/dev/python-ogre'



Thanks for all your help

Best Regards

Skorpio


No the "-dev" are the headers (sdk) and in some cases development libs.

Hi, what does importing pygccxml directly report:

>> python
>> from pygccxml import declarations
>> dir(declarations.CALLING_CONVENTION_TYPES)
['CDECL', 'FASTCALL', 'STDCALL', 'SYSTEM_DEFAULT', 'THISCALL', 'UNKNOWN', '__doc__', '__module__', 'all', 'extract', 'pattern']


From PythonOgreConfig_system.py needs a path to the code. I'm not sure if
setting the pyplusplus_install_dir to "/usr/local/lib/python2.7/dist-packages" would work.
# and the Py++ directory as sometimes we need access to the code repository there
pyplusplus_install_dir = os.path.join(BASE_DIR,'pygccxml')

If the original error still it may be a mismatch between the apt version of pygccxml and the pyplusplus you installed, your best bet would be to remove the apt version of pygccxml and install pygccxml via python-ogre (hopefully there won't be an issue with gccxml).

python python-ogre/BuildModule.py -r -b pygccxml
python python-ogre/BuildModule.py -b pygccxml --usesystem

For the cegui error.
http://www.cegui.org.uk/phpBB2/viewtopic.php?f=3&t=5546
You may want to leave cegui to last they have there own python bindings which you can build when compiling CEGUI. They appear to work OK with python-ogre last time I tested.

When building the ois or other modules make sure you have generated the ogre module first, from the wiki.

Generate the wrapper code(-g), compile(-c) and install it - Ensure ogre is generated before any other module !

skorpio

02-08-2012 09:00:51

Hello,

Thanks for all your help. I think it is working !!!

Trying to import pygccxml (from pygccxml import declarations ) crashes. So I followed your recommendations of doing:


python python-ogre/BuildModule.py -r -b pygccxml
python python-ogre/BuildModule.py -b pygccxml --usesystem



Next I compiled ogre. This took forever and then OIS. I don't need CEGUI so I will postpone that.

Here is the updated script Ogre.sh

#! /bin/sh
#__version__ 0.0.2.20110116-1

echo "_________________________________________________________________________________________________________________"
echo "STEP 1. Installing Packages"
echo "_________________________________________________________________________________________________________________"
sudo apt-get install subversion
sudo apt-get install cvs
sudo apt-get install scons
sudo apt-get install cmake
sudo apt-get install libboost-thread1.48.0
sudo apt-get install libboost-date-time1.48.0
sudo apt-get install libboost-python1.48.0
sudo apt-get install libfreeimage3
sudo apt-get install libzzip-0-13
sudo apt-get install gccxml
sudo apt-get install python-pygccxml
sudo apt-get install nvidia-cg-toolkit
sudo apt-get install bjam
sudo apt-get install libcg


sudo apt-get install libxaw7-dev
sudo apt-get install libxxf86vm-dev
sudo apt-get install libxrandr-dev
sudo apt-get install libxt-dev
sudo apt-get install libglew1.6-dev
sudo apt-get install libboost1.48-dev
sudo apt-get install freeglut3-dev
sudo apt-get install libcg
sudo apt-get install libboost-thread1.48-dev
sudo apt-get install libboost-python1.48-dev
sudo apt-get install libboost-date-time1.48-dev
sudo apt-get install libfreeimage-dev
sudo apt-get install libfreeimage3
sudo apt-get install libzzip-dev
sudo apt-get install libfreetype6-dev
sudo apt-get install libpcre3-dev
sudo apt-get install python-dev
sudo apt-get install libgl1-mesa-dev
sudo apt-get install libx11-dev

echo
echo "_________________________________________________________________________________________________________________"
echo "STEP 2. Getting python-ogre Trunk"
echo "_________________________________________________________________________________________________________________"

#svn co https://python-ogre.svn.sourceforge.net ... hes/v1-6-4 python-ogre
svn co https://python-ogre.svn.sourceforge.net ... ython-ogre python-ogre

echo
echo "_________________________________________________________________________________________________________________"
echo "STEP 3. Installing Packages from /python-ogre/scripts"
echo "_________________________________________________________________________________________________________________"

ln -s python-ogre/scripts/00-PreReqs.sh
sh ./00-PreReqs.sh

echo
echo "_________________________________________________________________________________________________________________"
echo "STEP 4. Installing py++ "
echo "_________________________________________________________________________________________________________________"

python python-ogre/BuildModule.py -r pyplusplus
python python-ogre/BuildModule.py -b pyplusplus --usesystem

echo
echo "_________________________________________________________________________________________________________________"
echo "STEP 5. Installing pygccxml"
echo "_________________________________________________________________________________________________________________"

python python-ogre/BuildModule.py -r pygccxml
python python-ogre/BuildModule.py -b pygccxml --usesystem


#python python-ogre/BuildModule.py -b gccxml pygccxml cg pyplusplus boost_python --usesystem
#python python-ogre/BuildModule.py -r boost_python --usesystem
#python python-ogre/BuildModule.py -b boost_python --usesystem
#python python-ogre/BuildModule.py -r cmake gccxml boost cg scons freeimage zziplib pygccxml pyplusplus
#python python-ogre/BuildModule.py -b cmake gccxml boost cg scons freeimage zziplib pygccxml pyplusplus
#svn co http://pygccxml.svn.sourceforge.net/svn ... usplus_dev pyplusplus

cd pyplusplus/
sudo python setup.py install
cd ..

echo
echo "_________________________________________________________________________________________________________________"
echo "STEP 6 Installing ogre"
echo "_________________________________________________________________________________________________________________"

python python-ogre/BuildModule.py -r ogre
python python-ogre/BuildModule.py -b ogre --usesystem
python python-ogre/BuildModule.py -g -c ogre --usesystem
python python-ogre/BuildModule.py -b install --usesystem


#export LD_LIBRARY_PATH=~/home/dev/root/usr/lib/

echo "_________________________________________________________________________________________________________________"
echo "STEP 7 Installing OIS"
echo "_________________________________________________________________________________________________________________"

python python-ogre/BuildModule.py -r ois
python python-ogre/BuildModule.py -b ois --usesystem
python python-ogre/BuildModule.py -g -c ois --usesystem
python python-ogre/BuildModule.py -b install --usesystem



I will test Ogre.sh on a new partition of Mint 64 to make sure python-ogre installs correctly.
Also, I will post more detail installation instructions.


Now, that python-ogre running on Mint13 64-bit, I will start porting over the wxOgre app with all the new features that I added through the years.
I'm not sure which source repository is the best to do this. Any suggestions?

Thanks Dermont, Kudos!


Best Regards,
Skorpio

dermont

02-08-2012 09:48:58


Next I compiled ogre. This took forever and then OIS. I don't need CEGUI so I will postpone that.
Skorpio


Yeah the build time is pretty restrictive, check the size of _ogre_.so it should be around 70-80MB; if it's around 200MB+ you may have run into the problem with the order of the build command.
viewtopic.php?f=3&t=14906

As a quick hack you can update the SConstruct file:

# Stores signatures in a separate .sconsign file
# in each directory as the single one was getting huge
_env.SConsignFile(os.path.join( cls.generated_dir, "sconsign") )
--> _env['CXX'] ='g++ -O3 -Wno-deprecated -DBOOST_PYTHON_MAX_ARITY=19 -DBOOST_PYTHON_NO_PY_SIGNATURES '



I'm not sure which source repository is the best to do this. Any suggestions?
Skorpio


Whatever source repository you feel comfortable using git/mercurial/svn.

http://code.google.com/
https://github.com/
https://bitbucket.org/
http://sourceforge.net/apps/trac/source ... /Mercurial
http://sourceforge.net/apps/trac/source ... Subversion
....

For your previous problems with the hydrax module (which I think you use) it should be as simple as adding the paths in PythonOgreConfig_*.py

PATH_LIB_hydrax=os.path.join(PATH_THIRDPARTY, 'Hydrax')
PATH_INCLUDE_hydrax= os.path.join(PATH_THIRDPARTY, 'Hydrax')


If you are feeling adventurous and you see a need for it in your editor you could try out the procedural/recast modules.
viewtopic.php?f=3&t=14708
viewtopic.php?f=3&t=29437

skorpio

03-08-2012 07:07:39

Hello,

Yes, that file is over 280Mb! I will start looking at that, as soon as I verify that building Ogre is a iron-out.

So, today I created another partition for Mint 13 64-bit and I ran the script Ogre.sh. This is what I got:


08-02 22:36 PythonOgre.BuildModule INFO Compiling Source code for ogre
08-02 22:36 PythonOgre.BuildModule DEBUG Spawning 'scons -j6 PROJECTS=ogre' in '/home/dev/python-ogre'
08-02 22:36 PythonOgre.BuildModule WARNING Task Failed
08-02 22:36 PythonOgre.BuildModule DEBUG scons: Reading SConscript files ...
SCONS: Building ogre
WARNING: Over-Writing /home/dev/python-ogre/generated/ogre_1.7.2/SConscript as it already exists
scons: done reading SConscript files.
scons: Building targets ...
g++ -o build_dir_2.7/ogre_1.7.2/AbstractNode.pypp.os -c `pkg-config --cflags OGRE` -I -O3 -I./ -DBOOST_PYTHON_MAX_ARITY=19 -DBOOST_PYTHON_NO_PY_SIGNATURES -I/home/dev/python-ogre/generated/ogre_1.7.2 -D__PYTHONOGRE_BUILD_CODE -I/usr/include -L/usr/lib -L/usr/lib64 -fPIC -I/usr/include/boost -I/usr/include/OGRE -I/usr/include/OGRE/Property -I/usr/include/python2.7 -I/usr/include/python2.7 -I/usr/include/boost generated/ogre_1.7.2/AbstractNode.pypp.cpp
g++ -o build_dir_2.7/ogre_1.7.2/AliasTextureIterator.pypp.os -c `pkg-config --cflags OGRE` -I -O3 -I./ -DBOOST_PYTHON_MAX_ARITY=19 -DBOOST_PYTHON_NO_PY_SIGNATURES -I/home/dev/python-ogre/generated/ogre_1.7.2 -D__PYTHONOGRE_BUILD_CODE -I/usr/include -L/usr/lib -L/usr/lib64 -fPIC -I/usr/include/boost -I/usr/include/OGRE -I/usr/include/OGRE/Property -I/usr/include/python2.7 -I/usr/include/python2.7 -I/usr/include/boost generated/ogre_1.7.2/AliasTextureIterator.pypp.cpp
g++ -o build_dir_2.7/ogre_1.7.2/AlignedMemory.pypp.os -c `pkg-config --cflags OGRE` -I -O3 -I./ -DBOOST_PYTHON_MAX_ARITY=19 -DBOOST_PYTHON_NO_PY_SIGNATURES -I/home/dev/python-ogre/generated/ogre_1.7.2 -D__PYTHONOGRE_BUILD_CODE -I/usr/include -L/usr/lib -L/usr/lib64 -fPIC -I/usr/include/boost -I/usr/include/OGRE -I/usr/include/OGRE/Property -I/usr/include/python2.7 -I/usr/include/python2.7 -I/usr/include/boost generated/ogre_1.7.2/AlignedMemory.pypp.cpp
g++ -o build_dir_2.7/ogre_1.7.2/AllocatedObjectCategorisedAllocPolicy.pypp.os -c `pkg-config --cflags OGRE` -I -O3 -I./ -DBOOST_PYTHON_MAX_ARITY=19 -DBOOST_PYTHON_NO_PY_SIGNATURES -I/home/dev/python-ogre/generated/ogre_1.7.2 -D__PYTHONOGRE_BUILD_CODE -I/usr/include -L/usr/lib -L/usr/lib64 -fPIC -I/usr/include/boost -I/usr/include/OGRE -I/usr/include/OGRE/Property -I/usr/include/python2.7 -I/usr/include/python2.7 -I/usr/include/boost generated/ogre_1.7.2/AllocatedObjectCategorisedAllocPolicy.pypp.cpp
g++ -o build_dir_2.7/ogre_1.7.2/AllocatedObjectCategorisedAllocPolicy_1.pypp.os -c `pkg-config --cflags OGRE` -I -O3 -I./ -DBOOST_PYTHON_MAX_ARITY=19 -DBOOST_PYTHON_NO_PY_SIGNATURES -I/home/dev/python-ogre/generated/ogre_1.7.2 -D__PYTHONOGRE_BUILD_CODE -I/usr/include -L/usr/lib -L/usr/lib64 -fPIC -I/usr/include/boost -I/usr/include/OGRE -I/usr/include/OGRE/Property -I/usr/include/python2.7 -I/usr/include/python2.7 -I/usr/include/boost generated/ogre_1.7.2/AllocatedObjectCategorisedAllocPolicy_1.pypp.cpp
g++ -o build_dir_2.7/ogre_1.7.2/AllocatedObjectCategorisedAllocPolicy_2.pypp.os -c `pkg-config --cflags OGRE` -I -O3 -I./ -DBOOST_PYTHON_MAX_ARITY=19 -DBOOST_PYTHON_NO_PY_SIGNATURES -I/home/dev/python-ogre/generated/ogre_1.7.2 -D__PYTHONOGRE_BUILD_CODE -I/usr/include -L/usr/lib -L/usr/lib64 -fPIC -I/usr/include/boost -I/usr/include/OGRE -I/usr/include/OGRE/Property -I/usr/include/python2.7 -I/usr/include/python2.7 -I/usr/include/boost generated/ogre_1.7.2/AllocatedObjectCategorisedAllocPolicy_2.pypp.cpp
scons: building terminated because of errors.

08-02 22:36 PythonOgre.BuildModule DEBUG
scons: warning: BuildDir() and the build_dir keyword have been deprecated;
use VariantDir() and the variant_dir keyword instead.
File "/home/dev/python-ogre/SConstruct", line 228, in <module>
In file included from /usr/include/boost/python/detail/prefix.hpp:13:0,
from /usr/include/boost/python/args.hpp:8,
from /usr/include/boost/python.hpp:11,
from generated/ogre_1.7.2/python_ogre_precompiled.h:2,
from generated/ogre_1.7.2/AbstractNode.pypp.cpp:3:
/usr/include/boost/python/detail/wrap_python.hpp:75:24: fatal error: patchlevel.h: No such file or directory
compilation terminated.
In file included from /usr/include/boost/python/detail/prefix.hpp:13:0,
from /usr/include/boost/python/args.hpp:8,
from /usr/include/boost/python.hpp:11,
from generated/ogre_1.7.2/python_ogre_precompiled.h:2,
from generated/ogre_1.7.2/AliasTextureIterator.pypp.cpp:3:
/usr/include/boost/python/detail/wrap_python.hpp:75:24: fatal error: patchlevel.h: No such file or directory
compilation terminated.
In file included from /usr/include/boost/python/detail/prefix.hpp:13:0,
from /usr/include/boost/python/args.hpp:8,
from /usr/include/boost/python.hpp:11,
from generated/ogre_1.7.2/python_ogre_precompiled.h:2,
from generated/ogre_1.7.2/AlignedMemory.pypp.cpp:3:
/usr/include/boost/python/detail/wrap_python.hpp:75:24: fatal error: patchlevel.h: No such file or directory
compilation terminated.
In file included from /usr/include/boost/python/detail/prefix.hpp:13:0,
from /usr/include/boost/python/args.hpp:8,
from /usr/include/boost/python.hpp:11,
from generated/ogre_1.7.2/python_ogre_precompiled.h:2,
from generated/ogre_1.7.2/AllocatedObjectCategorisedAllocPolicy.pypp.cpp:3:
/usr/include/boost/python/detail/wrap_python.hpp:75:24: fatal error: patchlevel.h: No such file or directory
compilation terminated.
In file included from /usr/include/boost/python/detail/prefix.hpp:13:0,
from /usr/include/boost/python/args.hpp:8,
from /usr/include/boost/python.hpp:11,
from generated/ogre_1.7.2/python_ogre_precompiled.h:2,
from generated/ogre_1.7.2/AllocatedObjectCategorisedAllocPolicy_1.pypp.cpp:3:
/usr/include/boost/python/detail/wrap_python.hpp:75:24: fatal error: patchlevel.h: No such file or directory
compilation terminated.
scons: *** [build_dir_2.7/ogre_1.7.2/AbstractNode.pypp.os] Error 1
scons: *** [build_dir_2.7/ogre_1.7.2/AliasTextureIterator.pypp.os] Error 1
scons: *** [build_dir_2.7/ogre_1.7.2/AlignedMemory.pypp.os] Error 1
scons: *** [build_dir_2.7/ogre_1.7.2/AllocatedObjectCategorisedAllocPolicy.pypp.os] Error 1
In file included from /usr/include/boost/python/detail/prefix.hpp:13:0,
from /usr/include/boost/python/args.hpp:8,
from /usr/include/boost/python.hpp:11,
from generated/ogre_1.7.2/python_ogre_precompiled.h:2,
from generated/ogre_1.7.2/AllocatedObjectCategorisedAllocPolicy_2.pypp.cpp:3:
/usr/include/boost/python/detail/wrap_python.hpp:75:24: fatal error: patchlevel.h: No such file or directory
compilation terminated.
scons: *** [build_dir_2.7/ogre_1.7.2/AllocatedObjectCategorisedAllocPolicy_1.pypp.os] Error 1
scons: *** [build_dir_2.7/ogre_1.7.2/AllocatedObjectCategorisedAllocPolicy_2.pypp.os] Error 1



I did get some errors on STEP1


The following NEW packages will be installed:
libboost-python1.48-dev libexpat1-dev libssl-dev libssl-doc python-dev python2.7-dev
The following packages will be upgraded:
libssl1.0.0
1 upgraded, 6 newly installed, 0 to remove and 102 not upgraded.
Need to get 3,576 kB/33.7 MB of archives.
After this operation, 49.4 MB of additional disk space will be used.
Do you want to continue [Y/n]? Y
Err http://archive.ubuntu.com/ubuntu/ precise-updates/main libssl1.0.0 amd64 1.0.1-4ubuntu5 404 Not Found [IP: 91.189.92.152 80]
Err http://archive.ubuntu.com/ubuntu/ precise-updates/main libssl-dev amd64 1.0.1-4ubuntu5 404 Not Found [IP: 91.189.92.152 80]
Err http://archive.ubuntu.com/ubuntu/ precise-updates/main libssl-doc all 1.0.1-4ubuntu5 404 Not Found [IP: 91.189.92.152 80]
Failed to fetch http://archive.ubuntu.com/ubuntu/pool/m ... _amd64.deb 404 Not Found [IP: 91.189.92.152 80]
Failed to fetch http://archive.ubuntu.com/ubuntu/pool/m ... _amd64.deb 404 Not Found [IP: 91.189.92.152 80]
Failed to fetch http://archive.ubuntu.com/ubuntu/pool/m ... u5_all.deb 404 Not Found [IP: 91.189.92.152 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
Reading package lists... Done
Building dependency tree
Reading state information... Done


I don't remember seeing this error before.

I'm hoping I can have solid script that would install python-ogre correctly from scratch.
Thanks for all your help.

Best Regards.

Skorpio

PS: Also the Hydrax patch did not work, It still crashes.

Here is the Ogre.sh again


#! /bin/sh
#__version__ 0.0.2.20110116-1

echo "_________________________________________________________________________________________________________________"
echo "STEP 1. Installing Packages"
echo "_________________________________________________________________________________________________________________"
sudo apt-get install subversion
sudo apt-get install cvs
sudo apt-get install scons
sudo apt-get install cmake
sudo apt-get install gccxml
sudo apt-get install python-pygccxml
sudo apt-get install nvidia-cg-toolkit

sudo apt-get install libxaw7-dev
sudo apt-get install libxxf86vm-dev
sudo apt-get install libxrandr-dev
sudo apt-get install libxt-dev
sudo apt-get install libglew1.6-dev
sudo apt-get install libboost1.48-dev
sudo apt-get install freeglut3-dev
sudo apt-get install libcg
sudo apt-get install libboost-thread1.48-dev
sudo apt-get install libboost-python1.48-dev
sudo apt-get install libboost-date-time1.48-dev
sudo apt-get install libfreeimage-dev
sudo apt-get install libfreeimage3
sudo apt-get install libzzip-dev
sudo apt-get install libfreetype6-dev
sudo apt-get install libpcre3-dev
sudo apt-get install python-dev
sudo apt-get install libgl1-mesa-dev
sudo apt-get install libx11-dev

echo
echo "_________________________________________________________________________________________________________________"
echo "STEP 2. Getting python-ogre Trunk"
echo "_________________________________________________________________________________________________________________"

#svn co https://python-ogre.svn.sourceforge.net ... hes/v1-6-4 python-ogre
svn co https://python-ogre.svn.sourceforge.net ... ython-ogre python-ogre

echo
echo "_________________________________________________________________________________________________________________"
echo "STEP 3. Installing Packages from /python-ogre/scripts"
echo "_________________________________________________________________________________________________________________"

ln -s python-ogre/scripts/00-PreReqs.sh
sh ./00-PreReqs.sh

echo
echo "_________________________________________________________________________________________________________________"
echo "STEP 4. Installing py++ "
echo "_________________________________________________________________________________________________________________"

python python-ogre/BuildModule.py -r pyplusplus
python python-ogre/BuildModule.py -b pyplusplus --usesystem
cd pyplusplus/
sudo python setup.py install
cd ..

echo
echo "_________________________________________________________________________________________________________________"
echo "STEP 5. Installing pygccxml"
echo "_________________________________________________________________________________________________________________"

python python-ogre/BuildModule.py -r pygccxml
python python-ogre/BuildModule.py -b pygccxml --usesystem
cd pygccxml/
sudo python setup.py install
cd ..

echo
echo "_________________________________________________________________________________________________________________"
echo "STEP 6 Installing ogre"
echo "_________________________________________________________________________________________________________________"

python python-ogre/BuildModule.py -r ogre
python python-ogre/BuildModule.py -b ogre --usesystem
python python-ogre/BuildModule.py -g ogre --usesystem
python python-ogre/BuildModule.py -c ogre --usesystem
python python-ogre/BuildModule.py -b install --usesystem


#export LD_LIBRARY_PATH=~/home/dev/root/usr/lib/

echo "_________________________________________________________________________________________________________________"
echo "STEP 7 Installing OIS"
echo "_________________________________________________________________________________________________________________"

python python-ogre/BuildModule.py -r ois
python python-ogre/BuildModule.py -b ois --usesystem
python python-ogre/BuildModule.py -g ois --usesystem
python python-ogre/BuildModule.py -c ois --usesystem
python python-ogre/BuildModule.py -b install --usesystem

dermont

03-08-2012 09:37:35

Looking at http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/ for example it doesn't appear that the file your trying to update exits, there appears to have been recent updates.

You could maybe try resynchronize the package index files
>> sudo apt-get update

Normally I would wait 24-48 hours for changes to propagate through or switch repositories. Your best bet would be to check on the Linux Mint forum.

For the hydrax problem, looking at sourceforge you could try setting the lib path as follows:
PATH_LIB_hydrax=PATH_THIRDPARTY

This is my settings, if you still encounter a problem can you post the error message.
environment.py

class hydrax(pymodule):
version = "0.5.1"
parent = "ogre/addons"
cflags = ""
include_dirs = [
boost.PATH,
Config.PATH_INCLUDE_hydrax,
Config.PATH_INCLUDE_Ogre,
]
lib_dirs = [
boost.PATH_LIB,
Config.PATH_LIB_Ogre_OgreMain,
]
libs = [ boost.lib, 'OgreMain' ]
ModuleName = "hydrax"
descText = "Fantastic water/ocean effects"

if isWindows():
CCFLAGS = " /fp:fast "
LINKFLAGS = " /LTCG /DYNAMICBASE:NO /MACHINE:X86 "

# testing dll linkage..
if False:
libs.append('Hydrax')
lib_dirs.append(Config.PATH_LIB_hydrax)
for p in Config.PATH_INCLUDE_hydrax_modules:
include_dirs.insert(0, p)


*Config*.py

PATH_LIB_hydrax=os.path.join(PATH_THIRDPARTY, 'Hydrax')
PATH_INCLUDE_hydrax= os.path.join(PATH_THIRDPARTY, 'Hydrax')

skorpio

04-08-2012 18:22:53

Hello,

I guess I can try within 24-hours to see if the thing is updated. Thanks,

Another thing, now that a copy of python-ogre is in Linux Mint, I started to port over wxOgre. After removing a lot of stuff, I got it to come up
but it is not working:

1 The ogre windows is in another windows not insize wx. This is minor
2 The ogre window doesn't render anything. It is just a black screen


So I went back to /python-ogre/demos/ogre/Demo_WX.py and ran it and it worked.
So I moved the files to my desktop and I got it to work there too.

Once I knew I had a base I could start merging my code with the Demo_Wx.py hoping that at some
point things will start working again. While doing that, I made and accidental discovery by changing a few lines on OgreWindowWx.py:

was

carryOn = self.ogreRoot.showConfigDialog()
if not carryOn:
sys.exit('Quit from Config Dialog')


new

if False:
carryOn = self.ogreRoot.showConfigDialog()
if not carryOn:
exit('Quit from Config Dialog')


and now the code that was working (rendering) it is not. My guess is that the config Dialog is initializing everything correcly,
while skipping it doesn't.

Here is that I found:

[url=http://www.ogre3d.org/docs/api/html/cla]http://www.ogre3d.org/docs/api/html/cla ... 6f6b672620


So I patched the code per documentation above


if False:
carryOn = self.ogreRoot.showConfigDialog()
if not carryOn:
exit('Quit from Config Dialog')

self.ogreRoot.initialise(False)

renderParameters = ogre.NameValuePairList()
renderParameters['tittle'] = "wxOgre"
renderParameters['colourDepth'] = "32"
renderParameters['left'] = "650"
renderParameters['top'] = "0"
renderParameters['depthBuffer'] = "True"
renderParameters['externalWindowHandle']="0"
renderParameters['externalGLControl'] = "False"
renderParameters['externalGLContext'] = "0"
#renderParameters['parentWindowHandle'] = "0"
renderParameters['FSAA'] = "0"
renderParameters['displayFrequency'] = "60"
renderParameters['vsync'] = "False"
renderParameters['vsyncInterval'] = "1"
renderParameters['border'] = "resize"
renderParameters['outerDimensions'] = "False"
renderParameters['useNVPerfHUD'] = "False"
renderParameters['gamma'] = "False"

renderWindow = self.ogreRoot.createRenderWindow('wxPython render window', size[0], size[1], False, renderParameters)
renderWindow.active = True
self.renderWindow = renderWindow
ogre.ResourceGroupManager.getSingleton().initialiseAllResourceGroups()


I added the code above and still doesn't render anything, I get the same black screen.
If I enable the config Dialog again, rendering works. Any ideas?

Best Regards

Skorpio

dermont

05-08-2012 04:19:01


I guess I can try within 24-hours to see if the thing is updated. Thanks,

As I said did you try to resynchronize your package index files?


Another thing, now that a copy of python-ogre is in Linux Mint, I started to port over wxOgre. After removing a lot of stuff, I got it to come up
but it is not working:
1 The ogre windows is in another windows not insize wx. This is minor
2 The ogre window doesn't render anything. It is just a black screen


1. You may need to show/resize(?) your widget prior to creating your renderwindow or defer the renderwindow creation to guarantee you have a valid window handle, whether is the correct window handle I don't know.
http://linode.ogre3d.org/addonforums/vi ... f=3&t=4739

self.Bind(wx.EVT_PAINT, self.OnPaint)
self.initialised = False
self.renderwindow = None
self.root = None

def OnPaint(self, event):
if not self.initialised:
self.initialised = True
.... do all ogre related set-up up here

Then in other code
if not self.renderwindow is None:
update, etc.


2 Try updating the render window after calling renderOneFrame

self.root.renderOneFrame()
self.renderwindow.update(True)


You will probably need to manually resize the render window in your resize event.

if sys.platform.startswith ('linux'):
self.renderWindow.resize(event.GetSize().width, event.GetSize().height)



So I went back to /python-ogre/demos/ogre/Demo_WX.py and ran it and it worked.
So I moved the files to my desktop and I got it to work there too.

Once I knew I had a base I could start merging my code with the Demo_Wx.py hoping that at some
point things will start working again. While doing that, I made and accidental discovery by changing a few lines on OgreWindowWx.py:

was

carryOn = self.ogreRoot.showConfigDialog()
if not carryOn:
sys.exit('Quit from Config Dialog')


new

if False:
carryOn = self.ogreRoot.showConfigDialog()
if not carryOn:
exit('Quit from Config Dialog')


and now the code that was working (rendering) it is not. My guess is that the config Dialog is initializing everything correcly,
while skipping it doesn't.

Here is that I found:

[url=http://www.ogre3d.org/docs/api/html/cla]http://www.ogre3d.org/docs/api/html/cla ... 6f6b672620


So I patched the code per documentation above


if False:
carryOn = self.ogreRoot.showConfigDialog()
if not carryOn:
exit('Quit from Config Dialog')

self.ogreRoot.initialise(False)

renderParameters = ogre.NameValuePairList()
renderParameters['tittle'] = "wxOgre"
renderParameters['colourDepth'] = "32"
renderParameters['left'] = "650"
renderParameters['top'] = "0"
renderParameters['depthBuffer'] = "True"
renderParameters['externalWindowHandle']="0"
renderParameters['externalGLControl'] = "False"
renderParameters['externalGLContext'] = "0"
#renderParameters['parentWindowHandle'] = "0"
renderParameters['FSAA'] = "0"
renderParameters['displayFrequency'] = "60"
renderParameters['vsync'] = "False"
renderParameters['vsyncInterval'] = "1"
renderParameters['border'] = "resize"
renderParameters['outerDimensions'] = "False"
renderParameters['useNVPerfHUD'] = "False"
renderParameters['gamma'] = "False"

renderWindow = self.ogreRoot.createRenderWindow('wxPython render window', size[0], size[1], False, renderParameters)
renderWindow.active = True
self.renderWindow = renderWindow
ogre.ResourceGroupManager.getSingleton().initialiseAllResourceGroups()


I added the code above and still doesn't render anything, I get the same black screen.
If I enable the config Dialog again, rendering works. Any ideas?


I don't know the answer to your config dialog problem but the renderwindow update should resolve the issue.

You could also use a GLCanvas for Linux, it's been so long since I've used wxPython I don't know if the following will still work:

#!/usr/bin/python

import wx
import wx.glcanvas
import sys
import os
sys.path.insert(0,'..')
import PythonOgreConfig
import ogre.renderer.OGRE as ogre


class wxOgreCanvas(wx.glcanvas.GLCanvas):
"""A simple class for using Ogre with wxPython."""

## Open GL attributes
attribList = [
wx.glcanvas.WX_GL_MIN_RED, 8,
wx.glcanvas.WX_GL_MIN_GREEN, 8,
wx.glcanvas.WX_GL_MIN_BLUE, 8,
#glcanvas.WX_GL_STENCIL_SIZE, 8,
wx.glcanvas.WX_GL_DOUBLEBUFFER,
wx.glcanvas.WX_GL_DEPTH_SIZE, 24
]

def __init__(self, parent,sharedContext):

canvas = wx.glcanvas.GLCanvasWithContext(parent, sharedContext,
wx.ID_ANY, attribList=self.attribList,
pos=wx.DefaultPosition,size=wx.DefaultSize,
style=wx.FULL_REPAINT_ON_RESIZE)

self.PostCreate(canvas)

self.mRenderWindow = None
self.mSceneManager = None
self.mCamera = None
self.mViewport = None
self.mAnimState = None
self.bInitiliased = False
self.mPrimaryWindow = False
self.renderFrame=True

# Set the event handlers.
self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnEraseBackGround) ## stop flickering windows ??
self.Bind(wx.EVT_SIZE, self.OnResize)
self.Bind(wx.EVT_PAINT, self.OnPaint)
self.Bind(wx.EVT_IDLE, self.OnIdle)
self.Bind(wx.EVT_KEY_DOWN, self.OnKeyDown)
self.Bind(wx.EVT_CHAR, self.OnKeyDown)

self.Bind(wx.EVT_SET_FOCUS, self.OnSetFocus)
self.Bind(wx.EVT_KILL_FOCUS, self.OnLoseFocus)

# set canvas attributes
self.SetMinSize(wx.Size(300,300));
self.SetBackgroundStyle(wx.BG_STYLE_CUSTOM)


def canRender(self):
return not self.mRenderWindow is None

def Initialise(self):
"""Create Ogre RenderWindow and Scene."""

mRoot = ogre.Root.getSingletonPtr()
ClientSize = self.GetClientSize()
self.SetCurrent()

# create render window based on shared context
suffix = str(self.GetId())
params = ogre.NameValuePairList()
params['currentGLContext'] = "True"
params['externalGLContext'] = "True"

self.mRenderWindow = mRoot.createRenderWindow("OGRE Render Window" + suffix,
ClientSize.x, ClientSize.y, False, params)

if (self.mPrimaryWindow):
self.mSceneManager = mRoot.createSceneManager(ogre.ST_GENERIC, "OgreTest")
else:
self.mSceneManager = mRoot.getSceneManager("OgreTest")
self.mCamera = self.mSceneManager.createCamera("TestCam" + suffix)

# Camera
self.mCamera.setPosition(ogre.Vector3(0, 0, 500))
self.mCamera.lookAt(ogre.Vector3(0, 0, -300))
self.mCamera.setAutoAspectRatio(False)
self.mCamera.setNearClipDistance(5)

# Set the viewport
self.mViewport = self.mRenderWindow.addViewport(self.mCamera)

# Set up viewport/window
self.setBackgroundColour(ogre.ColourValue(0.4, 0.4, 0.4))
self.resizeRenderWindow( ClientSize.x, ClientSize.y)

# resources only initialised once
if (self.mPrimaryWindow):
ogre.ResourceGroupManager.getSingleton().initialiseAllResourceGroups()

self.mSceneManager.setAmbientLight(ogre.ColourValue(1.0, 1.0, 1.0))

# Create entity and attach it to a scene node
ent = self.mSceneManager.createEntity("Robot" + suffix, "robot.mesh")
node = self.mSceneManager.getRootSceneNode().createChildSceneNode("RobotNode" + suffix)
node.attachObject(ent)
self.mAnimState = ent.getAnimationState("Walk")
self.mAnimState.setEnabled(True)
self.mAnimState.setLoop(True)

def resizeRenderWindow(self, width, height):
"""Resize Ogre Render Window."""
if self.canRender():
self.mRenderWindow.resize(width, height)
self.mRenderWindow.windowMovedOrResized()
if ( (height>0) and (width>0) ):
self.mCamera.setAspectRatio(float(width) / float(height))
self.mViewport._updateDimensions()

def setBackgroundColour(self, col):
if self.mViewport:
self.mViewport.setBackgroundColour(col)

def updateAnimation(self):
"""Update Scene Animation."""
# resources only initialised once
if (self.mPrimaryWindow):
self.mAnimState.addTime(self.mRenderWindow.getBestFPS()/10000.0)

def updateRenderWindow(self, bSwapBuffers):
"""Render Ogre Frame."""
if self.canRender() and self.renderFrame:
self.SetCurrent()
self.renderFrame = False
self.SetCurrent()
mRoot = ogre.Root.getSingleton()
mRoot._fireFrameStarted()
self.mRenderWindow.update(bSwapBuffers)
mRoot._fireFrameRenderingQueued() ## needed for anim
mRoot._fireFrameEnded()
self.renderFrame = True

def OnEraseBackGround(self, event):
"""Stub to avoid flashing on Windows."""
pass

def OnIdle(self, event):
"""Update Ogre RenderWindow/ Animation etc."""

# todo implement simple timer, no guarentee when OnIdle may be called
# so will lead to jerky animation
if self.canRender():
self.updateAnimation()
self.updateRenderWindow(False)
self.SwapBuffers()
event.RequestMore(True)

def OnKeyDown( self, event ):
"""Simple Key Event Handling."""
keycode = event.GetKeyCode()
key=''
if keycode < 255:
key = chr(keycode)

if ( keycode == wx.WXK_RIGHT or key == 'A' ):
self.mCamera.moveRelative(ogre.Vector3(-2,0,0))
elif ( keycode == wx.WXK_LEFT or key == 'D' ):
self.mCamera.moveRelative(ogre.Vector3(2,0,0))
elif ( keycode == wx.WXK_DOWN or key == 'W'):
self.mCamera.moveRelative(ogre.Vector3(0,0,2))
elif ( keycode == wx.WXK_UP or key == 'S'):
self.mCamera.moveRelative(ogre.Vector3(0,0,-2))
event.Skip()
self.Refresh(False)

def OnLoseFocus(self, event):
self.setBackgroundColour(ogre.ColourValue(0.4, 0.4, 0.4))
event.Skip()

def OnPaint(self, event):
"""Paint Event, create Ogre RenderWindow on first paint to ensure valid context for Ogre to share."""

##wxAutoBufferedPaintDC dc(this);
self.SetCurrent()
if not self.bInitiliased:
mRoot = ogre.Root.getSingletonPtr()
# first render window
if (mRoot.getRenderSystem() is None):
self.mPrimaryWindow = True
else:
self.mPrimaryWindow = False

## create ogre render system if not already created, creation defered to ensure Ogre
##can (automatically) obtain and share the GLCanvas's Display pointer.
if (self.mPrimaryWindow):
rsys = mRoot.getRenderSystemByName("OpenGL Rendering Subsystem")
# Some standard rendering system configurations
rsys.setConfigOption("Full Screen", "No")
rsys.setConfigOption("VSync", "No")
#rsys.setConfigOption("Display Frequency", "60 MHz")
rsys.setConfigOption("FSAA", "0")
rsys.setConfigOption("RTT Preferred Mode", "FBO")
rsys.setConfigOption("sRGB Gamma Conversion", "No")

mRoot.setRenderSystem(rsys)
##mRoot.restoreConfig();
mRoot.initialise(False)
self.Initialise()
self.bInitiliased = True

def OnResize(self, evt):
"""Resize Event Handling."""
self.resizeRenderWindow( evt.GetSize().x, evt.GetSize().y)
self.Refresh(False)
evt.Skip()

def OnSetFocus(self, event):
self.setBackgroundColour(ogre.ColourValue(0.6, 0.6, 0.6))
event.Skip()



class OgreFrame( wx.Frame):

def __init__(self, parent, title, pos=wx.DefaultPosition, size=wx.DefaultSize):
wx.Frame.__init__(self,parent, wx.ID_ANY, title, pos)
self.SetBackgroundStyle(wx.BG_STYLE_CUSTOM)


self.menuFile = wx.Menu()
item = self.menuFile.Append( wx.ID_EXIT, "E&xit" )
self.menuBar = wx.MenuBar()
self.menuBar.Append( self.menuFile, "&File" )
self.SetMenuBar( self.menuBar )
self.Bind(wx.EVT_MENU, self.OnExit, item )


self.CreateStatusBar()
self.SetStatusText( "Welcome to wxWindows!" )
self.SetMinSize(wx.Size(300,300))

self.sizer = wx.GridSizer(2,2,hgap=5, vgap=5)
self.SetAutoLayout(True)
self.mOgreCanvas = wxOgreCanvas(self, None)
self.Show() # need this here to obtain initial context
self.mOgreCanvas2 = wxOgreCanvas(self, self.mOgreCanvas.GetContext())
self.mOgreCanvas3 = wxOgreCanvas(self, self.mOgreCanvas.GetContext())
self.mOgreCanvas4 = wxOgreCanvas(self, self.mOgreCanvas.GetContext())
self.sizer.Add(self.mOgreCanvas2, 0, wx.ALL|wx.EXPAND)
self.sizer.Add(self.mOgreCanvas, 1, wx.ALL|wx.EXPAND)
self.sizer.Add(self.mOgreCanvas3, 2, wx.ALL|wx.EXPAND)
self.sizer.Add(self.mOgreCanvas4, 3, wx.ALL|wx.EXPAND)
self.SetSizerAndFit(self.sizer)
self.Layout()

def OnExit(self, event):
self.Close(True)


class MainApp( wx.App):

def __init__(self):
wx.App.__init__(self)
self.mFrame = None

plugin_path = os.path.join(os.getcwd(),'..','plugins.cfg.posix')
if not os.path.exists(plugin_path):
sys.stderr.write("\n"
"** Warning: Unable to locate a suitable plugins.cfg 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 a suitable 'plugins' file", "")
exit(1)

self.root = ogre.Root(plugin_path, "ogre.config", "ogre.log")

config = ogre.ConfigFile()
config.load('../resources.cfg')
seci = config.getSectionIterator()
while seci.hasMoreElements():
SectionName = seci.peekNextKey()
Section = seci.getNext()
for item in Section:
ogre.ResourceGroupManager.getSingleton().\
addResourceLocation(item.value, item.key, SectionName)

def OnCleanUp(self):
if not self.root is None:
del self.root

def OnInit(self):
self.mFrame = OgreFrame(None, "Ogre Render Test")
self.SetTopWindow(self.mFrame)
return True

def main():
app = MainApp()
app.MainLoop()
app.OnCleanUp()
app.Destroy()

if __name__ == "__main__":
main()

skorpio

06-08-2012 06:54:04

Hello Dermont,

Kudos again!, the code you sent me (wxpython.py) is what I was looking for. After a few minor tweaks, I got it running.
Then I used it to merge my code with wxpython.py to create the new wxogre.py for Linux.

I happy to report that I have been able to merge about +70% the code. In the process I found about 10 bugs
that I have fixed. Some functionality got lost, which I need to revisit and fix later.

Here is that I need to do:
1) Add support for Caelum. Since it didn't compile, my version of python-ogre doesn't support.
2) Add support for Particle Universe. Since it didn't compile, my version of python-ogre doesn't support.
3) Add menu support, this should not be too hard.
4) Fix bugs and standardize code.

Here is the first image:

https://bitbucket.org/wxogre_linux/screenshots/src/



Best Regards,
Skorpio


PS. Some of the other suggestions did not work for me. I think there is something simple that I missing.
Nonetheless your help has been invaluable. thanks!

dermont

06-08-2012 12:12:53


Here is that I need to do:
1) Add support for Caelum. Since it didn't compile, my version of python-ogre doesn't support.
2) Add support for Particle Universe. Since it didn't compile, my version of python-ogre doesn't support.
3) Add menu support, this should not be too hard.
4) Fix bugs and standardize code.
!


1) The version of Caelum quite old - 0.5 I think, what is the compile problem?
I'll try and update to the latest version (0.6 or 0.6.1 I think it is). I'll also look at updating SkyX.

2) I don't think there is a free version of Particle Universe any more so you are pretty much on your own.


PS. Some of the other suggestions did not work for me. I think there is something simple that I missing.
Nonetheless your help has been invaluable. thanks!

Are these the suggestions regarding wxPython and the Ogre render window? If so can you upload a really simple "externalWindow" handle Linux example.

Nice screen shots btw.

skorpio

07-08-2012 07:11:08

Hello,

1) I think I got caelum to install as caelum.so in the proper folder. However,I'm getting this error.

>>> import ogre.addons.caelum as caelum
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/ogre/addons/caelum/__init__.py", line 1, in <module>
from _caelum_ import *
RuntimeError: extension class wrapper for base class Ogre::Plugin has not been created yet


2) I tried to see how far I could get trying to build this library. I located the missing files it was complaining.
which are here: (1zip, 2 h files)

https://bitbucket.org/wxogre_linux/screenshots/src/

a) I had to edit a few files in the environment.py

class particleuniverse(pymodule):
version = "0.81"
active = False
name = 'particleuniverse'
parent = "ogre/addons"
cflags = ""
source = [
### [wget, "http://www.fxpression.com/files/download/ParticleUniverseV0.81.zip";, downloadPath]
]

buildCmds = [
[0, unzip + os.path.join(downloadPath, "ParticleUniverseV0.81.zip"), Config.PATH_Ogre],
### [0, "patch -s -N -i " + os.path.join(os.getcwd(), "python-ogre", "patch", "ParticleUniverse_0.8.patch") + " -p0 ", os.path.join(Config.PATH_Ogre, 'Plugins', 'ParticleUniverse') ],
[0, "echo *** NOW build ParticleUniverse with MSVC from " + Config.PATH_Ogre, '']
]
include_dirs = [
boost.PATH,
Config.PATH_INCLUDE_Ogre,
Config.PATH_INCLUDE_particleuniverse
]
lib_dirs = [
boost.PATH_LIB,
Config.PATH_LIB_Ogre_OgreMain,
Config.PATH_LIB_particleuniverse
]
libs = [ boost.lib, 'OgreMain', 'ParticleUniverse' ]
ModuleName = "particleuniverse"


b) I copy the zip to the /download file
c) created a folder in /usr/ogre
d) renaned the unzipped folder from Plugins to PlugIns
e) copy h files to the /usr/ogre/PlugIns/ParticleUniverse/include
f) also instead of patching the files because the path was messed up, I just copied the files in the /python-ogre/code-generators/particleuniverse
to /usr/ogre/PlugIns/ParticleUniverse/include
g) python python-ogre/BuildModule.py -b particleuniverse --usesystem
h) python python-ogre/BuildModule.py -g particleuniverse --usesystem

08-06 22:25 PythonOgre.BuildModule INFO Building Source code for particleuniverse
08-06 22:25 PythonOgre.BuildModule DEBUG Spawning 'python generate_code.py --usesystem' in '/home/dev/python-ogre/code_generators/particleuniverse'
08-06 22:25 PythonOgre.BuildModule WARNING Task Failed
08-06 22:25 PythonOgre.BuildModule DEBUG
08-06 22:25 PythonOgre.BuildModule DEBUG INFO Creating xml file "/home/dev/python-ogre/code_generators/cache/particleuniverse_0.81_cache.xml" from source file "/home/dev/python-ogre/code_generators/particleuniverse/python_particleuniverse.h" ...
INFO gccxml cmd: /usr/bin/gccxml -I"/home/dev/python-ogre" -I"/usr/include/boost" -I"/usr/include/OGRE" -I"/usr/ogre/PlugIns/ParticleUniverse/include" -D"OGRE_NONCLIENT_BUILD" -D"OGRE_GCC_VISIBILITY" -D"PARTICLE_UNIVERSE_EXPORTS" -D"__PYTHONOGRE_BUILD_CODE" -D"VERSION_0.81" "/home/dev/python-ogre/code_generators/particleuniverse/python_particleuniverse.h" -fxml="/home/dev/python-ogre/code_generators/cache/particleuniverse_0.81_cache.xml"
Traceback (most recent call last):
File "generate_code.py", line 330, in <module>
generate_code()
File "generate_code.py", line 247, in generate_code
, cflags=environment.particleuniverse.cflags
File "/usr/local/lib/python2.7/dist-packages/pyplusplus/module_builder/boost_python_builder.py", line 95, in __init__
, indexing_suite_version)
File "/usr/local/lib/python2.7/dist-packages/pyplusplus/module_builder/boost_python_builder.py", line 138, in __parse_declarations
decls = reader.read_files( files, compilation_mode )
File "/usr/local/lib/python2.7/dist-packages/pygccxml/parser/project_reader.py", line 217, in read_files
return self.__parse_file_by_file(files)
File "/usr/local/lib/python2.7/dist-packages/pygccxml/parser/project_reader.py", line 254, in __parse_file_by_file
reader.create_xml_file( header, prj_file.cached_source_file )
File "/usr/local/lib/python2.7/dist-packages/pygccxml/parser/source_reader.py", line 179, in create_xml_file
raise error
pygccxml.parser.source_reader.gccxml_runtime_error_t: Error occured while running GCC-XML: In file included from /usr/include/c++/4.6/tr1/unordered_map:39,
from /usr/include/OGRE/OgreStdHeaders.h:40,
from /usr/include/OGRE/OgrePrerequisites.h:315,
from /usr/include/OGRE/Ogre.h:31,
from /usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniversePrerequisites.h:20,
from /usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseSystemManager.h:20,
from /home/dev/python-ogre/code_generators/particleuniverse/python_particleuniverse.h:2:
/usr/include/c++/4.6/tr1/type_traits:211: error: a function call cannot appear in a constant-expression
/usr/include/c++/4.6/tr1/type_traits:211: error: template argument 2 is invalid
/usr/include/c++/4.6/tr1/type_traits:217: error: a function call cannot appear in a constant-expression
/usr/include/c++/4.6/tr1/type_traits:217: error: template argument 2 is invalid
/usr/include/c++/4.6/tr1/type_traits:223: error: a function call cannot appear in a constant-expression
/usr/include/c++/4.6/tr1/type_traits:223: error: template argument 2 is invalid
/usr/include/c++/4.6/tr1/type_traits:230: error: expected nested-name-specifier before '...' token
/usr/include/c++/4.6/tr1/type_traits:230: error: expected '>' before '...' token
/usr/include/c++/4.6/tr1/type_traits:231: error: '_ArgTypes' was not declared in this scope
/usr/include/c++/4.6/tr1/type_traits:231: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp> struct std::tr1::is_function'
/usr/include/c++/4.6/tr1/type_traits:231: error: expected a type, got '(_Res)(<expression error>)'
/usr/include/c++/4.6/tr1/type_traits:233: error: expected nested-name-specifier before '...' token
/usr/include/c++/4.6/tr1/type_traits:233: error: expected '>' before '...' token
/usr/include/c++/4.6/tr1/type_traits:234: error: '_ArgTypes' was not declared in this scope
/usr/include/c++/4.6/tr1/type_traits:234: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp> struct std::tr1::is_function'
/usr/include/c++/4.6/tr1/type_traits:234: error: expected a type, got '(_Res)(<expression error>)'
/usr/include/c++/4.6/tr1/type_traits:236: error: expected nested-name-specifier before '...' token
/usr/include/c++/4.6/tr1/type_traits:236: error: expected '>' before '...' token
/usr/include/c++/4.6/tr1/type_traits:237: error: '_ArgTypes' was not declared in this scope
/usr/include/c++/4.6/tr1/type_traits:237: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp> struct std::tr1::is_function'
/usr/include/c++/4.6/tr1/type_traits:237: error: expected a type, got '(_Res)(<expression error>)'
/usr/include/c++/4.6/tr1/type_traits:239: error: expected nested-name-specifier before '...' token
/usr/include/c++/4.6/tr1/type_traits:239: error: expected '>' before '...' token
/usr/include/c++/4.6/tr1/type_traits:240: error: '_ArgTypes' was not declared in this scope
/usr/include/c++/4.6/tr1/type_traits:240: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp> struct std::tr1::is_function'
/usr/include/c++/4.6/tr1/type_traits:240: error: expected a type, got '(_Res)(<expression error>)'
/usr/include/c++/4.6/tr1/type_traits:242: error: expected nested-name-specifier before '...' token
/usr/include/c++/4.6/tr1/type_traits:242: error: expected '>' before '...' token
/usr/include/c++/4.6/tr1/type_traits:243: error: '_ArgTypes' was not declared in this scope
/usr/include/c++/4.6/tr1/type_traits:243: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp> struct std::tr1::is_function'
/usr/include/c++/4.6/tr1/type_traits:243: error: expected a type, got '(_Res)(<expression error>)'
/usr/include/c++/4.6/tr1/type_traits:245: error: expected nested-name-specifier before '...' token
/usr/include/c++/4.6/tr1/type_traits:245: error: expected '>' before '...' token
/usr/include/c++/4.6/tr1/type_traits:246: error: '_ArgTypes' was not declared in this scope
/usr/include/c++/4.6/tr1/type_traits:246: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp> struct std::tr1::is_function'
/usr/include/c++/4.6/tr1/type_traits:246: error: expected a type, got '(_Res)(<expression error>)'
/usr/include/c++/4.6/tr1/type_traits:248: error: expected nested-name-specifier before '...' token
/usr/include/c++/4.6/tr1/type_traits:248: error: expected '>' before '...' token
/usr/include/c++/4.6/tr1/type_traits:249: error: '_ArgTypes' was not declared in this scope
/usr/include/c++/4.6/tr1/type_traits:249: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp> struct std::tr1::is_function'
/usr/include/c++/4.6/tr1/type_traits:249: error: expected a type, got '(_Res)(<expression error>)'
/usr/include/c++/4.6/tr1/type_traits:251: error: expected nested-name-specifier before '...' token
/usr/include/c++/4.6/tr1/type_traits:251: error: expected '>' before '...' token
/usr/include/c++/4.6/tr1/type_traits:252: error: '_ArgTypes' was not declared in this scope
/usr/include/c++/4.6/tr1/type_traits:252: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp> struct std::tr1::is_function'
/usr/include/c++/4.6/tr1/type_traits:252: error: expected a type, got '(_Res)(<expression error>)'
/usr/include/c++/4.6/tr1/type_traits:337: error: a function call cannot appear in a constant-expression
/usr/include/c++/4.6/tr1/type_traits:337: error: template argument 2 is invalid
/usr/include/c++/4.6/tr1/type_traits:343: error: a function call cannot appear in a constant-expression
/usr/include/c++/4.6/tr1/type_traits:343: error: template argument 2 is invalid
/usr/include/c++/4.6/tr1/type_traits:349: error: a function call cannot appear in a constant-expression
/usr/include/c++/4.6/tr1/type_traits:349: error: template argument 2 is invalid
/usr/include/c++/4.6/tr1/type_traits:582: error: expected primary-expression before ',' token
/usr/include/c++/4.6/tr1/type_traits:582: error: expected primary-expression before ')' token
/usr/include/c++/4.6/tr1/type_traits:582: error: a function call cannot appear in a constant-expression
/usr/include/c++/4.6/tr1/type_traits:676: error: requested alignment is not a constant
In file included from /usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseTechnique.h:31,
from /usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseSystem.h:22,
from /usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseScriptParser.h:21,
from /usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseScriptTokeniser.h:21,
from /usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseSystemManager.h:21,
from /home/dev/python-ogre/code_generators/particleuniverse/python_particleuniverse.h:2:
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h: In static member function 'static void ParticleUniverse::Hook<T>::_prepare(std::vector<T*, std::allocator<T*> >*, ParticleUniverse::ParticleTechnique*)':
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h:39: error: expected `;' before 'it'
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h:40: error: expected `;' before 'itEnd'
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h:41: error: 'it' was not declared in this scope
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h:41: error: 'itEnd' was not declared in this scope
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h: In static member function 'static void ParticleUniverse::Hook<T>::_notifyStart(std::vector<T*, std::allocator<T*> >*)':
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h:54: error: expected `;' before 'it'
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h:55: error: expected `;' before 'itEnd'
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h:56: error: 'it' was not declared in this scope
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h:56: error: 'itEnd' was not declared in this scope
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h: In static member function 'static void ParticleUniverse::Hook<T>::_notifyStop(std::vector<T*, std::allocator<T*> >*)':
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h:69: error: expected `;' before 'it'
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h:70: error: expected `;' before 'itEnd'
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h:71: error: 'it' was not declared in this scope
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h:71: error: 'itEnd' was not declared in this scope
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h: In static member function 'static void ParticleUniverse::Hook<T>::_preProcessParticles(std::vector<T*, std::allocator<T*> >*, ParticleUniverse::ParticleTechnique*, Ogre::Real)':
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h:86: error: expected `;' before 'it'
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h:87: error: expected `;' before 'itEnd'
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h:88: error: 'it' was not declared in this scope
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h:88: error: 'itEnd' was not declared in this scope
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h: In static member function 'static void ParticleUniverse::Hook<T>::_processParticle(std::vector<T*, std::allocator<T*> >*, ParticleUniverse::ParticleTechnique*, ParticleUniverse::Particle*, Ogre::Real, bool)':
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h:105: error: expected `;' before 'it'
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h:106: error: expected `;' before 'itEnd'
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h:107: error: 'it' was not declared in this scope
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h:107: error: 'itEnd' was not declared in this scope
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h: In static member function 'static void ParticleUniverse::Hook<T>::_postProcessParticles(std::vector<T*, std::allocator<T*> >*, ParticleUniverse::ParticleTechnique*, Ogre::Real)':
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h:122: error: expected `;' before 'it'
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h:123: error: expected `;' before 'itEnd'
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h:124: error: 'it' was not declared in this scope
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h:124: error: 'itEnd' was not declared in this scope
In file included from /usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseTechnique.h:32,
from /usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseSystem.h:22,
from /usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseScriptParser.h:21,
from /usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseScriptTokeniser.h:21,
from /usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseSystemManager.h:21,
from /home/dev/python-ogre/code_generators/particleuniverse/python_particleuniverse.h:2:
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseSpatialHashTable.h: In constructor 'ParticleUniverse::SpatialHashTable<T>::SpatialHashTable()':
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseSpatialHashTable.h:39: error: expected identifier before '{' token
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseSpatialHashTable.h:39: error: expected `(' before '{' token
In file included from /usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseScriptTokeniser.h:21,
from /usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseSystemManager.h:21,
from /home/dev/python-ogre/code_generators/particleuniverse/python_particleuniverse.h:2:
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseScriptParser.h: In member function 'const Ogre::String& ParticleUniverse::ParticleScriptParser::getNextTokenLabel() const':
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseScriptParser.h:73: error: passing 'const ParticleUniverse::ParticleScriptParser' as 'this' argument of 'const Ogre::String& Ogre::Compiler2Pass::getNextTokenLabel()' discards qualifiers
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseScriptParser.h: In member function 'size_t ParticleUniverse::ParticleScriptParser::getRemainingTokensForAction() const':
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseScriptParser.h:80: error: 'getRemainingTokensForAction' is not a member of 'Ogre::Compiler2Pass'
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseScriptParser.h: In member function 'const Ogre::String& ParticleUniverse::ParticleScriptParser::getCurrentTokenLexeme() const':
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseScriptParser.h:87: error: 'getCurrentTokenLexeme' is not a member of 'Ogre::Compiler2Pass'
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseScriptParser.h: In member function 'size_t ParticleUniverse::ParticleScriptParser::getNextTokenID() const':
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseScriptParser.h:94: error: 'getNextTokenID' is not a member of 'Ogre::Compiler2Pass'
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseScriptParser.h: In member function 'const Ogre::String& ParticleUniverse::ParticleScriptParser::getNextTokenLexeme() const':
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseScriptParser.h:101: error: 'getNextTokenLexeme' is not a member of 'Ogre::Compiler2Pass'
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseScriptParser.h: In member function 'void ParticleUniverse::ParticleScriptParser::skipToken() const':
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseScriptParser.h:108: error: 'skipToken' is not a member of 'Ogre::Compiler2Pass'
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseScriptParser.h: In member function 'float ParticleUniverse::ParticleScriptParser::getNextTokenValue() const':
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseScriptParser.h:115: error: passing 'const ParticleUniverse::ParticleScriptParser' as 'this' argument of 'float Ogre::Compiler2Pass::getNextTokenValue()' discards qualifiers
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseScriptParser.h: In member function 'bool ParticleUniverse::ParticleScriptParser::testNextTokenID(size_t) const':
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseScriptParser.h:122: error: 'testNextTokenID' is not a member of 'Ogre::Compiler2Pass'
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseScriptParser.h: In member function 'const Ogre::String& ParticleUniverse::ParticleScriptParser::getGroupName() const':
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseScriptParser.h:129: error: 'mSourceName' was not declared in this scope
In file included from /usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseSystemManager.h:21,
from /home/dev/python-ogre/code_generators/particleuniverse/python_particleuniverse.h:2:
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseScriptTokeniser.h: In member function 'void ParticleUniverse::ParticleScriptTokeniser::parseScript(Ogre::DataStreamPtr&, const Ogre::String&)':
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseScriptTokeniser.h:68: error: no matching function for call to 'ParticleUniverse::ParticleScriptTokeniser::compile(Ogre::String, const std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)'
/usr/ogre/PlugIns/ParticleUniverse/include/OgreCompiler2Pass.h:407: note: candidates are: bool Ogre::Compiler2Pass::compile(const Ogre::String&)


I think you are right, trying to get particle universe seem pretty doomed. Too bad because I had a really nice interface for it (windows anyway)
I think Caelum may work, at least I get further in the setup/install process.

windows images for caelum and pu tabs.
https://bitbucket.org/wxogre_linux/scre ... um_tab.jpg
https://bitbucket.org/wxogre_linux/scre ... pu_tab.jpg

I think these are my tasks:
T1) Clean up code on new wxogre and add missing support.
T2) Test Ogre.sh in a new machine to make sure it installs. Last time, It did not work.
T3) Try to get Caelum to work

I don't think I would be this far along the porting processes without your help. Thanks!

Best regards,
Skorpio

dermont

07-08-2012 08:53:23



1) I think I got caelum to install as caelum.so in the proper folder. However,I'm getting this error.

>>> import ogre.addons.caelum as caelum
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/ogre/addons/caelum/__init__.py", line 1, in <module>
from _caelum_ import *
RuntimeError: extension class wrapper for base class Ogre::Plugin has not been created yet



You need to import the ogre module first so that the base (ogre) classes required by the caelum module have already been registered.

>>> import ogre.renderer.OGRE as ogre
>>> import ogre.addons.caelum as caelum

I already updated the caelum module to 0.6 so I'll upload the changes after doing the same for SkyX.



2) I tried to see how far I could get trying to build this library. I located the missing files it was complaining.
which are here: (1zip, 2 h files)

https://bitbucket.org/wxogre_linux/screenshots/src/

a) I had to edit a few files in the environment.py

class particleuniverse(pymodule):
version = "0.81"
active = False
name = 'particleuniverse'
parent = "ogre/addons"
cflags = ""
source = [
### [wget, "http://www.fxpression.com/files/download/ParticleUniverseV0.81.zip";, downloadPath]
]

buildCmds = [
[0, unzip + os.path.join(downloadPath, "ParticleUniverseV0.81.zip"), Config.PATH_Ogre],
### [0, "patch -s -N -i " + os.path.join(os.getcwd(), "python-ogre", "patch", "ParticleUniverse_0.8.patch") + " -p0 ", os.path.join(Config.PATH_Ogre, 'Plugins', 'ParticleUniverse') ],
[0, "echo *** NOW build ParticleUniverse with MSVC from " + Config.PATH_Ogre, '']
]
include_dirs = [
boost.PATH,
Config.PATH_INCLUDE_Ogre,
Config.PATH_INCLUDE_particleuniverse
]
lib_dirs = [
boost.PATH_LIB,
Config.PATH_LIB_Ogre_OgreMain,
Config.PATH_LIB_particleuniverse
]
libs = [ boost.lib, 'OgreMain', 'ParticleUniverse' ]
ModuleName = "particleuniverse"


b) I copy the zip to the /download file
c) created a folder in /usr/ogre
d) renaned the unzipped folder from Plugins to PlugIns
e) copy h files to the /usr/ogre/PlugIns/ParticleUniverse/include
f) also instead of patching the files because the path was messed up, I just copied the files in the /python-ogre/code-generators/particleuniverse
to /usr/ogre/PlugIns/ParticleUniverse/include


Don't simply copy header files from previous versions of Ogre, issues such as header changes need to patched in the particle universe source code. I don't know what the license for 0.81 is and what the implications of doing so are and don't really want to look at the code.


g) python python-ogre/BuildModule.py -b particleuniverse --usesystem
h) python python-ogre/BuildModule.py -g particleuniverse --usesystem


Unfortunately it is not as simple as that, your (-b) build command needs to know how to build particle universe. This is normally defined in environment.py, take a look at some of the other modules. For Windows it simply informs the user to build using msvc, for other platforms you will need to create your own build system.

There are other alternatives but since the source is not available for download from the site etc. it would be best to concentrate on other modules. Anyway I would have thought python-ogre would be ideal for creating/shipping your own particle system.




08-06 22:25 PythonOgre.BuildModule INFO Building Source code for particleuniverse
08-06 22:25 PythonOgre.BuildModule DEBUG Spawning 'python generate_code.py --usesystem' in '/home/dev/python-ogre/code_generators/particleuniverse'
08-06 22:25 PythonOgre.BuildModule WARNING Task Failed
08-06 22:25 PythonOgre.BuildModule DEBUG
08-06 22:25 PythonOgre.BuildModule DEBUG INFO Creating xml file "/home/dev/python-ogre/code_generators/cache/particleuniverse_0.81_cache.xml" from source file "/home/dev/python-ogre/code_generators/particleuniverse/python_particleuniverse.h" ...
INFO gccxml cmd: /usr/bin/gccxml -I"/home/dev/python-ogre" -I"/usr/include/boost" -I"/usr/include/OGRE" -I"/usr/ogre/PlugIns/ParticleUniverse/include" -D"OGRE_NONCLIENT_BUILD" -D"OGRE_GCC_VISIBILITY" -D"PARTICLE_UNIVERSE_EXPORTS" -D"__PYTHONOGRE_BUILD_CODE" -D"VERSION_0.81" "/home/dev/python-ogre/code_generators/particleuniverse/python_particleuniverse.h" -fxml="/home/dev/python-ogre/code_generators/cache/particleuniverse_0.81_cache.xml"
Traceback (most recent call last):
File "generate_code.py", line 330, in <module>
generate_code()
File "generate_code.py", line 247, in generate_code
, cflags=environment.particleuniverse.cflags
File "/usr/local/lib/python2.7/dist-packages/pyplusplus/module_builder/boost_python_builder.py", line 95, in __init__
, indexing_suite_version)
File "/usr/local/lib/python2.7/dist-packages/pyplusplus/module_builder/boost_python_builder.py", line 138, in __parse_declarations
decls = reader.read_files( files, compilation_mode )
File "/usr/local/lib/python2.7/dist-packages/pygccxml/parser/project_reader.py", line 217, in read_files
return self.__parse_file_by_file(files)
File "/usr/local/lib/python2.7/dist-packages/pygccxml/parser/project_reader.py", line 254, in __parse_file_by_file
reader.create_xml_file( header, prj_file.cached_source_file )
File "/usr/local/lib/python2.7/dist-packages/pygccxml/parser/source_reader.py", line 179, in create_xml_file
raise error
pygccxml.parser.source_reader.gccxml_runtime_error_t: Error occured while running GCC-XML: In file included from /usr/include/c++/4.6/tr1/unordered_map:39,
from /usr/include/OGRE/OgreStdHeaders.h:40,
from /usr/include/OGRE/OgrePrerequisites.h:315,
from /usr/include/OGRE/Ogre.h:31,
from /usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniversePrerequisites.h:20,
from /usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseSystemManager.h:20,
from /home/dev/python-ogre/code_generators/particleuniverse/python_particleuniverse.h:2:
/usr/include/c++/4.6/tr1/type_traits:211: error: a function call cannot appear in a constant-expression
/usr/include/c++/4.6/tr1/type_traits:211: error: template argument 2 is invalid
/usr/include/c++/4.6/tr1/type_traits:217: error: a function call cannot appear in a constant-expression
/usr/include/c++/4.6/tr1/type_traits:217: error: template argument 2 is invalid
/usr/include/c++/4.6/tr1/type_traits:223: error: a function call cannot appear in a constant-expression
/usr/include/c++/4.6/tr1/type_traits:223: error: template argument 2 is invalid
/usr/include/c++/4.6/tr1/type_traits:230: error: expected nested-name-specifier before '...' token
/usr/include/c++/4.6/tr1/type_traits:230: error: expected '>' before '...' token
/usr/include/c++/4.6/tr1/type_traits:231: error: '_ArgTypes' was not declared in this scope
/usr/include/c++/4.6/tr1/type_traits:231: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp> struct std::tr1::is_function'
/usr/include/c++/4.6/tr1/type_traits:231: error: expected a type, got '(_Res)(<expression error>)'
/usr/include/c++/4.6/tr1/type_traits:233: error: expected nested-name-specifier before '...' token
/usr/include/c++/4.6/tr1/type_traits:233: error: expected '>' before '...' token
/usr/include/c++/4.6/tr1/type_traits:234: error: '_ArgTypes' was not declared in this scope
/usr/include/c++/4.6/tr1/type_traits:234: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp> struct std::tr1::is_function'
/usr/include/c++/4.6/tr1/type_traits:234: error: expected a type, got '(_Res)(<expression error>)'
/usr/include/c++/4.6/tr1/type_traits:236: error: expected nested-name-specifier before '...' token
/usr/include/c++/4.6/tr1/type_traits:236: error: expected '>' before '...' token
/usr/include/c++/4.6/tr1/type_traits:237: error: '_ArgTypes' was not declared in this scope
/usr/include/c++/4.6/tr1/type_traits:237: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp> struct std::tr1::is_function'
/usr/include/c++/4.6/tr1/type_traits:237: error: expected a type, got '(_Res)(<expression error>)'
/usr/include/c++/4.6/tr1/type_traits:239: error: expected nested-name-specifier before '...' token
/usr/include/c++/4.6/tr1/type_traits:239: error: expected '>' before '...' token
/usr/include/c++/4.6/tr1/type_traits:240: error: '_ArgTypes' was not declared in this scope
/usr/include/c++/4.6/tr1/type_traits:240: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp> struct std::tr1::is_function'
/usr/include/c++/4.6/tr1/type_traits:240: error: expected a type, got '(_Res)(<expression error>)'
/usr/include/c++/4.6/tr1/type_traits:242: error: expected nested-name-specifier before '...' token
/usr/include/c++/4.6/tr1/type_traits:242: error: expected '>' before '...' token
/usr/include/c++/4.6/tr1/type_traits:243: error: '_ArgTypes' was not declared in this scope
/usr/include/c++/4.6/tr1/type_traits:243: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp> struct std::tr1::is_function'
/usr/include/c++/4.6/tr1/type_traits:243: error: expected a type, got '(_Res)(<expression error>)'
/usr/include/c++/4.6/tr1/type_traits:245: error: expected nested-name-specifier before '...' token
/usr/include/c++/4.6/tr1/type_traits:245: error: expected '>' before '...' token
/usr/include/c++/4.6/tr1/type_traits:246: error: '_ArgTypes' was not declared in this scope
/usr/include/c++/4.6/tr1/type_traits:246: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp> struct std::tr1::is_function'
/usr/include/c++/4.6/tr1/type_traits:246: error: expected a type, got '(_Res)(<expression error>)'
/usr/include/c++/4.6/tr1/type_traits:248: error: expected nested-name-specifier before '...' token
/usr/include/c++/4.6/tr1/type_traits:248: error: expected '>' before '...' token
/usr/include/c++/4.6/tr1/type_traits:249: error: '_ArgTypes' was not declared in this scope
/usr/include/c++/4.6/tr1/type_traits:249: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp> struct std::tr1::is_function'
/usr/include/c++/4.6/tr1/type_traits:249: error: expected a type, got '(_Res)(<expression error>)'
/usr/include/c++/4.6/tr1/type_traits:251: error: expected nested-name-specifier before '...' token
/usr/include/c++/4.6/tr1/type_traits:251: error: expected '>' before '...' token
/usr/include/c++/4.6/tr1/type_traits:252: error: '_ArgTypes' was not declared in this scope
/usr/include/c++/4.6/tr1/type_traits:252: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp> struct std::tr1::is_function'
/usr/include/c++/4.6/tr1/type_traits:252: error: expected a type, got '(_Res)(<expression error>)'
/usr/include/c++/4.6/tr1/type_traits:337: error: a function call cannot appear in a constant-expression
/usr/include/c++/4.6/tr1/type_traits:337: error: template argument 2 is invalid
/usr/include/c++/4.6/tr1/type_traits:343: error: a function call cannot appear in a constant-expression
/usr/include/c++/4.6/tr1/type_traits:343: error: template argument 2 is invalid
/usr/include/c++/4.6/tr1/type_traits:349: error: a function call cannot appear in a constant-expression
/usr/include/c++/4.6/tr1/type_traits:349: error: template argument 2 is invalid
/usr/include/c++/4.6/tr1/type_traits:582: error: expected primary-expression before ',' token
/usr/include/c++/4.6/tr1/type_traits:582: error: expected primary-expression before ')' token
/usr/include/c++/4.6/tr1/type_traits:582: error: a function call cannot appear in a constant-expression
/usr/include/c++/4.6/tr1/type_traits:676: error: requested alignment is not a constant
In file included from /usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseTechnique.h:31,
from /usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseSystem.h:22,
from /usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseScriptParser.h:21,
from /usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseScriptTokeniser.h:21,
from /usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseSystemManager.h:21,
from /home/dev/python-ogre/code_generators/particleuniverse/python_particleuniverse.h:2:
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h: In static member function 'static void ParticleUniverse::Hook<T>::_prepare(std::vector<T*, std::allocator<T*> >*, ParticleUniverse::ParticleTechnique*)':
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h:39: error: expected `;' before 'it'
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h:40: error: expected `;' before 'itEnd'
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h:41: error: 'it' was not declared in this scope
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h:41: error: 'itEnd' was not declared in this scope
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h: In static member function 'static void ParticleUniverse::Hook<T>::_notifyStart(std::vector<T*, std::allocator<T*> >*)':
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h:54: error: expected `;' before 'it'
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h:55: error: expected `;' before 'itEnd'
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h:56: error: 'it' was not declared in this scope
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h:56: error: 'itEnd' was not declared in this scope
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h: In static member function 'static void ParticleUniverse::Hook<T>::_notifyStop(std::vector<T*, std::allocator<T*> >*)':
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h:69: error: expected `;' before 'it'
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h:70: error: expected `;' before 'itEnd'
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h:71: error: 'it' was not declared in this scope
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h:71: error: 'itEnd' was not declared in this scope
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h: In static member function 'static void ParticleUniverse::Hook<T>::_preProcessParticles(std::vector<T*, std::allocator<T*> >*, ParticleUniverse::ParticleTechnique*, Ogre::Real)':
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h:86: error: expected `;' before 'it'
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h:87: error: expected `;' before 'itEnd'
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h:88: error: 'it' was not declared in this scope
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h:88: error: 'itEnd' was not declared in this scope
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h: In static member function 'static void ParticleUniverse::Hook<T>::_processParticle(std::vector<T*, std::allocator<T*> >*, ParticleUniverse::ParticleTechnique*, ParticleUniverse::Particle*, Ogre::Real, bool)':
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h:105: error: expected `;' before 'it'
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h:106: error: expected `;' before 'itEnd'
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h:107: error: 'it' was not declared in this scope
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h:107: error: 'itEnd' was not declared in this scope
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h: In static member function 'static void ParticleUniverse::Hook<T>::_postProcessParticles(std::vector<T*, std::allocator<T*> >*, ParticleUniverse::ParticleTechnique*, Ogre::Real)':
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h:122: error: expected `;' before 'it'
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h:123: error: expected `;' before 'itEnd'
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h:124: error: 'it' was not declared in this scope
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseHook.h:124: error: 'itEnd' was not declared in this scope
In file included from /usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseTechnique.h:32,
from /usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseSystem.h:22,
from /usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseScriptParser.h:21,
from /usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseScriptTokeniser.h:21,
from /usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseSystemManager.h:21,
from /home/dev/python-ogre/code_generators/particleuniverse/python_particleuniverse.h:2:
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseSpatialHashTable.h: In constructor 'ParticleUniverse::SpatialHashTable<T>::SpatialHashTable()':
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseSpatialHashTable.h:39: error: expected identifier before '{' token
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseSpatialHashTable.h:39: error: expected `(' before '{' token
In file included from /usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseScriptTokeniser.h:21,
from /usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseSystemManager.h:21,
from /home/dev/python-ogre/code_generators/particleuniverse/python_particleuniverse.h:2:
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseScriptParser.h: In member function 'const Ogre::String& ParticleUniverse::ParticleScriptParser::getNextTokenLabel() const':
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseScriptParser.h:73: error: passing 'const ParticleUniverse::ParticleScriptParser' as 'this' argument of 'const Ogre::String& Ogre::Compiler2Pass::getNextTokenLabel()' discards qualifiers
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseScriptParser.h: In member function 'size_t ParticleUniverse::ParticleScriptParser::getRemainingTokensForAction() const':
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseScriptParser.h:80: error: 'getRemainingTokensForAction' is not a member of 'Ogre::Compiler2Pass'
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseScriptParser.h: In member function 'const Ogre::String& ParticleUniverse::ParticleScriptParser::getCurrentTokenLexeme() const':
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseScriptParser.h:87: error: 'getCurrentTokenLexeme' is not a member of 'Ogre::Compiler2Pass'
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseScriptParser.h: In member function 'size_t ParticleUniverse::ParticleScriptParser::getNextTokenID() const':
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseScriptParser.h:94: error: 'getNextTokenID' is not a member of 'Ogre::Compiler2Pass'
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseScriptParser.h: In member function 'const Ogre::String& ParticleUniverse::ParticleScriptParser::getNextTokenLexeme() const':
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseScriptParser.h:101: error: 'getNextTokenLexeme' is not a member of 'Ogre::Compiler2Pass'
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseScriptParser.h: In member function 'void ParticleUniverse::ParticleScriptParser::skipToken() const':
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseScriptParser.h:108: error: 'skipToken' is not a member of 'Ogre::Compiler2Pass'
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseScriptParser.h: In member function 'float ParticleUniverse::ParticleScriptParser::getNextTokenValue() const':
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseScriptParser.h:115: error: passing 'const ParticleUniverse::ParticleScriptParser' as 'this' argument of 'float Ogre::Compiler2Pass::getNextTokenValue()' discards qualifiers
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseScriptParser.h: In member function 'bool ParticleUniverse::ParticleScriptParser::testNextTokenID(size_t) const':
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseScriptParser.h:122: error: 'testNextTokenID' is not a member of 'Ogre::Compiler2Pass'
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseScriptParser.h: In member function 'const Ogre::String& ParticleUniverse::ParticleScriptParser::getGroupName() const':
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseScriptParser.h:129: error: 'mSourceName' was not declared in this scope
In file included from /usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseSystemManager.h:21,
from /home/dev/python-ogre/code_generators/particleuniverse/python_particleuniverse.h:2:
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseScriptTokeniser.h: In member function 'void ParticleUniverse::ParticleScriptTokeniser::parseScript(Ogre::DataStreamPtr&, const Ogre::String&)':
/usr/ogre/PlugIns/ParticleUniverse/include/ParticleUniverseScriptTokeniser.h:68: error: no matching function for call to 'ParticleUniverse::ParticleScriptTokeniser::compile(Ogre::String, const std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)'
/usr/ogre/PlugIns/ParticleUniverse/include/OgreCompiler2Pass.h:407: note: candidates are: bool Ogre::Compiler2Pass::compile(const Ogre::String&)


You need to add the following line to the top of python-ogre/code_generators/particleuniverse/python_particleuniverse.h

#include "../ogre/python_ogre_include_OGRE.h"

skorpio

08-08-2012 07:57:13

Hello

1) I never pay to much attention to the order. In my old code their order were swapped.
Caelum is working somewhat.

>>> import ogre.renderer.OGRE as ogre
>>> import ogre.addons.caelum as caelum

The Caelum version that I was using in windows was 0.4, this one is 0.5 and there some differences
the clouds show up on the floor, the skybox is missing and the moon is big and not real.
Perhaps those issues were fixed on 0.6.

2) The code is available as part of another project.
hg clone https://code.google.com/p/q-gears/
Also I uploaded the zip file here: https://bitbucket.org/wxogre_linux/scre ... eV0.81.zip

I will try your suggestion and see what happens.

#include "../ogre/python_ogre_include_OGRE.h"



Update:
I got Caelum to show up as a tab on wxogre
On resize form, I got the raytracing to work.
Added Timer for calling frame start/end so that they happen at 30FPS
Fix Animation frameEnded, it seems to be working now
Fix Skeleton frameEnded, it seems to be working now.

Testing continuous, Thanks again.

Best regards,

Skorpio

skorpio

16-08-2012 04:17:42

Hello,

Is there an equivalent program for ogrexmlmeshserializer that runs on linux?
I need to modify some .mesh files but I can't find a program and I don't want to go back
to windows unless I really have to.


Best regards,

Skorpio

dermont

16-08-2012 09:42:49

Hello,

Is there an equivalent program for ogrexmlmeshserializer that runs on linux?
I need to modify some .mesh files but I can't find a program and I don't want to go back
to windows unless I really have to.


Best regards,

Skorpio


OgreXMLConverter?

I'm not sure what program "ogrexmlmeshserializer" is. I seem to recall OgreXMLConverter may have been named as that on Windows at some point in the past. I could be wrong.

skorpio

18-08-2012 08:06:07

Yes, OgreXMLConverter,
Is there anything similar on the Linux side?

Another thing.
I created a new partition of Mint13 64-bit and I thought I could install python-ogre but I'm still having issues.
I broke down the steps into different sh scripts.

step1.sh

echo "_________________________________________________________________________________________________________________"
echo "STEP 1. Installing Packages"
echo "_________________________________________________________________________________________________________________"
sudo apt-get install subversion
sudo apt-get install cvs
sudo apt-get install scons
sudo apt-get install cmake
#sudo apt-get install libboost-thread1.48.0
#sudo apt-get install libboost-date-time1.48.0
#sudo apt-get install libboost-python1.48.0
#sudo apt-get install libfreeimage3
#sudo apt-get install libzzip-0-13
sudo apt-get install gccxml
sudo apt-get install python-pygccxml
sudo apt-get install nvidia-cg-toolkit
#sudo apt-get install bjam
#sudo apt-get install libcg

sudo apt-get install libxaw7-dev
sudo apt-get install libxxf86vm-dev
sudo apt-get install libxrandr-dev
sudo apt-get install libxt-dev
sudo apt-get install libglew1.6-dev
sudo apt-get install libboost1.48-dev
sudo apt-get install freeglut3-dev
sudo apt-get install libcg
sudo apt-get install libboost-thread1.48-dev
sudo apt-get install libboost-python1.48-dev
sudo apt-get install libboost-date-time1.48-dev
sudo apt-get install libfreeimage-dev
sudo apt-get install libfreeimage3
sudo apt-get install libzzip-dev
sudo apt-get install libfreetype6-dev
sudo apt-get install libpcre3-dev
sudo apt-get install python-dev
sudo apt-get install libgl1-mesa-dev
sudo apt-get install libx11-dev


step2.sh

echo
echo "_________________________________________________________________________________________________________________"
echo "STEP 2. Getting python-ogre Trunk"
echo "_________________________________________________________________________________________________________________"
svn co https://python-ogre.svn.sourceforge.net ... ython-ogre python-ogre



step3.sh needs some editing (ie hydrax)


echo
echo "_________________________________________________________________________________________________________________"
echo "STEP 3. Installing Packages from /python-ogre/scripts"
echo "_________________________________________________________________________________________________________________"
echo

ln -s python-ogre/scripts/00-PreReqs.sh
sh ./00-PreReqs.sh
echo

echo "_________________________________________________________________________________________________________________"
echo
echo "modify file: python-ogre/environment.py"
echo "line ~1877, comment out: #moduleLibs = [ os.path.join(Config.PATH_LIB_hydrax, 'Hydrax')]"
echo "_________________________________________________________________________________________________________________"
echo
echo


step4.sh

echo "_________________________________________________________________________________________________________________"
echo "STEP 4a. Installing py++ "
echo "_________________________________________________________________________________________________________________"

python python-ogre/BuildModule.py -r pyplusplus
python python-ogre/BuildModule.py -b pyplusplus --usesystem
cd pyplusplus/
sudo python setup.py install
cd ..

echo
echo "_________________________________________________________________________________________________________________"
echo "STEP 4b. Installing pygccxml"
echo "_________________________________________________________________________________________________________________"

python python-ogre/BuildModule.py -r pygccxml
python python-ogre/BuildModule.py -b pygccxml --usesystem
cd pygccxml/
sudo python setup.py install
cd ..

echo
echo "_________________________________________________________________________________________________________________"
echo "STEP 4c. Installing cg"
echo "_________________________________________________________________________________________________________________"

python python-ogre/BuildModule.py -r cg
python python-ogre/BuildModule.py -b cg --usesystem


step5.sh

echo
echo "_________________________________________________________________________________________________________________"
echo "STEP 5 Installing ogre"
echo "_________________________________________________________________________________________________________________"

python python-ogre/BuildModule.py -r ogre
python python-ogre/BuildModule.py -b ogre --usesystem
python python-ogre/BuildModule.py -g -c ogre --usesystem
python python-ogre/BuildModule.py -b install

python python-ogre/BuildModule.py -r ois
python python-ogre/BuildModule.py -b ois --usesystem
python python-ogre/BuildModule.py -g -c ois --usesystem
python python-ogre/BuildModule.py -b install


Here is the error after building ogre (python python-ogre/BuildModule.py -b ogre --usesystem )
It is failing on some missing lib, which I have already installed on step1.

08-17 23:36 PythonOgre.BuildModule INFO Build Command tar jxf /home/dev/downloads/ogre_src_v1-7-2.tar.bz2 --overwrite
08-17 23:36 PythonOgre.BuildModule DEBUG Spawning 'tar jxf /home/dev/downloads/ogre_src_v1-7-2.tar.bz2 --overwrite' in '/home/dev'
08-17 23:36 PythonOgre.BuildModule INFO Build Command mv ogre_src_v1-7-2 ogre
08-17 23:36 PythonOgre.BuildModule DEBUG Spawning 'mv ogre_src_v1-7-2 ogre' in '/home/dev'
08-17 23:36 PythonOgre.BuildModule WARNING Task Failed
08-17 23:36 PythonOgre.BuildModule DEBUG
08-17 23:36 PythonOgre.BuildModule DEBUG mv: cannot move `ogre_src_v1-7-2' to `ogre/ogre_src_v1-7-2': Directory not empty

08-17 23:36 PythonOgre.BuildModule INFO Build Command cmake . -DOGRE_INSTALL_PLUGINS_HEADERS=TRUE -DCMAKE_INSTALL_PREFIX:PATH=/usr
08-17 23:36 PythonOgre.BuildModule DEBUG Spawning 'cmake . -DOGRE_INSTALL_PLUGINS_HEADERS=TRUE -DCMAKE_INSTALL_PREFIX:PATH=/usr' in 'ogre'
08-17 23:36 PythonOgre.BuildModule WARNING Task Failed
08-17 23:36 PythonOgre.BuildModule DEBUG -- Configuring OGRE 1.7.2
-- Detected g++ 4.6

-- Enabling GCC visibility flags
-- Search path: /home/dev/ogre/Dependencies;/home/dev/ogre/Dependencies;/home/dev/ogre/../Dependencies;/home/dev/ogre/../Dependencies
-- Looking for ZLIB...
-- Could not locate ZLIB
-- Looking for FreeImage...
-- checking for module 'freeimage'
-- package 'freeimage' not found
-- Found FreeImage: optimized;/usr/lib/libfreeimage.so;debug;/usr/lib/libfreeimage.so
-- Looking for FREETYPE...
-- CMAKE_PREFIX_PATH: /home/dev/ogre/Dependencies;/home/dev/ogre/Dependencies;/home/dev/ogre/../Dependencies;/home/dev/ogre/../Dependencies;/usr/local
-- Could not locate FREETYPE
-- Looking for Cg...
-- checking for module 'Cg'
-- package 'Cg' not found
-- Could not locate Cg
-- Looking for POCO...
-- checking for module 'POCO'
-- package 'POCO' not found
-- Could not locate POCO
-- Looking for TBB...
-- Could not locate TBB
-- Looking for OIS...
-- Found OIS: optimized;/usr/lib/libOIS.so;debug;/usr/lib/libOIS.so
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
-- Looking for CppUnit...
-- checking for module 'cppunit'
-- package 'cppunit' not found
-- Could not locate CppUnit
-- Configuring incomplete, errors occurred!

08-17 23:36 PythonOgre.BuildModule DEBUG CMake Error at CMake/Utils/MacroLogFeature.cmake:100 (MESSAGE):



-----------------------------------------------------------------------------


-- The following REQUIRED packages could NOT be located on your system.

-- Please install them before continuing this software installation.

-- If you are in Windows, try passing -DOGRE_DEPENDENCIES_DIR=<path to
dependencies>


-----------------------------------------------------------------------------


+ freetype: Portable font engine <http://www.freetype.org>;

+ X11: X Window system <http://www.x.org>;

+ Xt: X Toolkit <http://www.x.org>;

+ Xaw: X11 Athena widget set <http://www.x.org>;


-----------------------------------------------------------------------------
Call Stack (most recent call first):
CMake/Dependencies.cmake:216 (MACRO_DISPLAY_FEATURE_LOG)
CMakeLists.txt:180 (include)



08-17 23:36 PythonOgre.BuildModule INFO Build Command make
08-17 23:36 PythonOgre.BuildModule DEBUG Spawning 'make' in 'ogre'
08-17 23:36 PythonOgre.BuildModule WARNING Task Failed
08-17 23:36 PythonOgre.BuildModule DEBUG
08-17 23:36 PythonOgre.BuildModule DEBUG make: *** No targets specified and no makefile found. Stop.

08-17 23:36 PythonOgre.BuildModule INFO Build Command sudo make install
08-17 23:36 PythonOgre.BuildModule DEBUG Spawning 'sudo make install' in 'ogre'
08-17 23:36 PythonOgre.BuildModule WARNING Task Failed
08-17 23:36 PythonOgre.BuildModule DEBUG
08-17 23:36 PythonOgre.BuildModule DEBUG make: *** No rule to make target `install'. Stop.



I don't know what is wrong. Any suggestions?

Thanks,

Skorpio

dermont

18-08-2012 09:56:45

Yes, OgreXMLConverter,
Is there anything similar on the Linux side?


Yes on Linux it should be installed in wherever you installed Ogre bin directory. In your case I think it is /usr/bin.

There are OGRE_BUILD_TOOLS and OGRE_INSTALL_TOOLS flags for CMake but these should be enabled by default. You should maybe install cmake-qt-gui (it requires Qt) to see what flags are set etc.


Another thing.
I created a new partition of Mint13 64-bit and I thought I could install python-ogre but I'm still having issues.
I broke down the steps into different sh scripts.

...
This part looks dodgy ???

08-17 23:36 PythonOgre.BuildModule INFO Build Command tar jxf /home/dev/downloads/ogre_src_v1-7-2.tar.bz2 --overwrite
08-17 23:36 PythonOgre.BuildModule DEBUG Spawning 'tar jxf /home/dev/downloads/ogre_src_v1-7-2.tar.bz2 --overwrite' in '/home/dev'
08-17 23:36 PythonOgre.BuildModule INFO Build Command mv ogre_src_v1-7-2 ogre
08-17 23:36 PythonOgre.BuildModule DEBUG Spawning 'mv ogre_src_v1-7-2 ogre' in '/home/dev'
08-17 23:36 PythonOgre.BuildModule WARNING Task Failed
08-17 23:36 PythonOgre.BuildModule DEBUG
08-17 23:36 PythonOgre.BuildModule DEBUG mv: cannot move `ogre_src_v1-7-2' to `ogre/ogre_src_v1-7-2': Directory not empty

....





I don't the answer to your question but on Ubuntu some libraries were moved to /usr/lib/i386-linux-gnu on 32bit machine. Maybe do a dir /usr/lib/i386-linux-gnu (or whatever equivalent for 64 bit machine is) to see if your libs are there.

As a guess I would say that you've copied across some stuff and your ogre build dir CMakeCache.txt points to some old paths. Go the Ogre build dir and remove the CMake cache file CMakeCache.txt and try again.

Failing that I know Cabalistic did some updates to handle the above. I'll try to see exactly what and you may have to patch the CMake files.

skorpio

20-08-2012 07:44:20

Hello,

Thanks for the tip, I will try your recommendations on /dev/sda10. However the same files that I tried on /dev/sda10
worked just fine with /dev/sda11

This is the what I have tested so far:
1) on partition /dev/sda5, python is installed and working with minimal addons. Shell files mixed dev and non-dev libraries
2) on partition /dev/sda10, it doesn't build because it has missing libraries. I will try recomendations mentioned here - thanks.
3) on partition /dev/sda11, is it working and many addons were compiled, including ogreXMLconverter.
4) on partition /dev/sda1, it is working just like 1)

So 3/4 versions worked! All partitions are Linux Mint13, 64-bit which is based on ubuntu/debian, yet the result are a little inconsistent
I have 2 Ubuntu partitions that I would like to try installing python-ogre and see how the new shell scripts perform.

I added the shell scripts files here:
https://bitbucket.org/wxogre_linux/scre ... 3d06dc53f6

Note: These are the same shell files used to build python-ogre on /dev/sda11. It seems to be the best installation that worked for me.

Thanks for all your help

Thanks,

Skorpio

dermont

20-08-2012 10:02:30


So 3/4 versions worked! All partitions are Linux Mint13, 64-bit which is based on ubuntu/debian, yet the result are a little inconsistent
Thanks for the tip, I will try your recommendations on /dev/sda10. However the same files that I tried on /dev/sda10
worked just fine with /dev/sda11


There shouldn't be any inconsistencies between different partitions since you are using the same distro/version for each partition.

Having said that I don't know how you are running your script from each partition.

Are you:
a) retrieving/building python-ogre and all the dependencies from scratch?
b) copying across an already retrieved/built python-ogre from another partition?

If (a) there shouldn't be an issue.

If (b), as I said you may have stale CMake Cache build for Ogre. For example the cache
is pointing to say freetype in /usr/lib and a recent apt update has moved it to /usr/lib/i386-linux-gnu/ I've been stung with this in the past.

Also check your ld cache to see the libraries are installed etc (maybe run sudo ldconfig). It could be there is a step missing in your script.

ldconfig -p | grep 'libXt'
libXtst.so.6 (libc6) => /usr/lib/i386-linux-gnu/libXtst.so.6
libXt.so.6 (libc6) => /usr/lib/i386-linux-gnu/libXt.so.6
libXt.so (libc6) => /usr/lib/i386-linux-gnu/libXt.so

ldconfig -p | grep 'libfreetype'
libfreetype.so.6 (libc6) => /usr/lib/i386-linux-gnu/libfreetype.so.6
libfreetype.so (libc6) => /usr/lib/i386-linux-gnu/libfreetype.so



If I were you and you already know that the code retrieval works correctly and you don't want to waste bandwidth I would have a pristine copy of python-ogre and the source tar files for copying across and skip the "-r" part of the build.

skorpio

21-08-2012 06:44:30

Hello,

Yes, I agree that the inconsistencies may be due to scripts that were not quite right.
The latest version installed on /dev/sda11 is the best and I would think that the scripts are now OK.
That is why I posted them. I figure, it took 4 different installation to get the scripts right (for the most part)

On /dev/sda10, as you mentioned the CMAKE was corrupted, the operating system was not
able to even find it. I did a: sudo apt-get remove cmake and sudo apt-get install cmake and
I re-installed it again. Then, I least I was able to type cmake the prompt and I got something.

By the way, every installation started with a fresh copy of everything:
Linux Mint 13 64-bits
Similar scripts which were in a state of flux at the time of installation
and clean fetch from the repositories.

I thought about copying the files over across different partition, which Mint13 mounts automatically when they are double-clicked them,
but I wanted to stick to the same methodology until the scripts were iron out.

Thanks for all your help. I'm looking forward about continuing development of wxogre.

Skorpio

skorpio

27-10-2012 17:37:19

Hello,

Today, I tried installing python-ogre but I'm getting this error. It should definitely mention that this version of python-ogre is special
since it is running as Virtual Machine within a macbook using a program called Parallels. Parallels allows to run Linux within OSX.
So I installed Linux Mint 64, and I started installing all the ogre libraries but I got to this error.

Thanks for all your help
Best regards,

Skorpio


python python-ogre/BuildModule.py -g -c ogre --usesystem


the output

10-27 08:56 PythonOgre.BuildModule INFO Building Source code for ogre
10-27 08:56 PythonOgre.BuildModule DEBUG Spawning 'python generate_code.py --usesystem' in '/home/dev/python-ogre/code_generators/ogre'
10-27 08:58 PythonOgre.BuildModule INFO Compiling Source code for ogre
10-27 08:58 PythonOgre.BuildModule DEBUG Spawning 'scons -j3 PROJECTS=ogre' in '/home/dev/python-ogre'
10-27 08:58 PythonOgre.BuildModule WARNING Task Failed
10-27 08:58 PythonOgre.BuildModule DEBUG scons: Reading SConscript files ...
SCONS: Building ogre
WARNING: Over-Writing /home/dev/python-ogre/generated/ogre_1.7.2/SConscript as it already exists
scons: done reading SConscript files.
scons: Building targets ...
g++ -o build_dir_2.7/ogre_1.7.2/ogre.so `pkg-config --libs OGRE` -lstdc++ -shared -Wl,-rpath=\/../../lib build_dir_2.7/ogre_1.7.2/AbstractNode.pypp.os build_dir_2.7/ogre_1.7.2/AliasTextureIterator.pypp.os build_dir_2.7/ogre_1.7.2/AlignedMemory.pypp.os build_dir_2.7/ogre_1.7.2/AllocatedObjectCategorisedAllocPolicy.pypp.os

removing stuff... posting.... to ... big .... more than.... 60000 chars

build_dir_2.7/ogre_1.7.2/vectorTechniqueGPUVendorRule.pypp.os build_dir_2.7/ogre_1.7.2/vectorTexturePtr.pypp.os build_dir_2.7/ogre_1.7.2/vectorTextureUnitState.pypp.os build_dir_2.7/ogre_1.7.2/vectorVector2.pypp.os build_dir_2.7/ogre_1.7.2/vectorVector3.pypp.os build_dir_2.7/ogre_1.7.2/vectorVector4.pypp.os build_dir_2.7/ogre_1.7.2/vectorVertexDataHardwareAnimationData.pypp.os build_dir_2.7/ogre_1.7.2/vectorVertexData_const.pypp.os build_dir_2.7/ogre_1.7.2/vectorVertexPoseKeyFramePoseRef.pypp.os -L/usr/lib -L/usr/lib/python2.7/libs -lboost_python -lOgreMain -lOgreProperty
scons: building terminated because of errors.

10-27 08:58 PythonOgre.BuildModule DEBUG
scons: warning: BuildDir() and the build_dir keyword have been deprecated;
use VariantDir() and the variant_dir keyword instead.
File "/home/dev/python-ogre/SConstruct", line 228, in <module>
collect2: ld terminated with signal 9 [Killed]
scons: *** [build_dir_2.7/ogre_1.7.2/ogre.so] Error 1



NOTE:
The output was trimmed because the posting exceeded 60000 chars, Also I could not upload the file here. because *.txt, *.doc , *.html are not allowed.

dermont

03-11-2012 06:37:44

Hello,

Today, I tried installing python-ogre but I'm getting this error. It should definitely mention that this version of python-ogre is special
since it is running as Virtual Machine within a macbook using a program called Parallels. Parallels allows to run Linux within OSX.
So I installed Linux Mint 64, and I started installing all the ogre libraries but I got to this error.

Thanks for all your help
Best regards,

Skorpio


python python-ogre/BuildModule.py -g -c ogre --usesystem


the output

10-27 08:56 PythonOgre.BuildModule INFO Building Source code for ogre
10-27 08:56 PythonOgre.BuildModule DEBUG Spawning 'python generate_code.py --usesystem' in '/home/dev/python-ogre/code_generators/ogre'
10-27 08:58 PythonOgre.BuildModule INFO Compiling Source code for ogre
10-27 08:58 PythonOgre.BuildModule DEBUG Spawning 'scons -j3 PROJECTS=ogre' in '/home/dev/python-ogre'
10-27 08:58 PythonOgre.BuildModule WARNING Task Failed
10-27 08:58 PythonOgre.BuildModule DEBUG scons: Reading SConscript files ...
SCONS: Building ogre
WARNING: Over-Writing /home/dev/python-ogre/generated/ogre_1.7.2/SConscript as it already exists
scons: done reading SConscript files.
scons: Building targets ...
g++ -o build_dir_2.7/ogre_1.7.2/ogre.so `pkg-config --libs OGRE` -lstdc++ -shared -Wl,-rpath=\/../../lib build_dir_2.7/ogre_1.7.2/AbstractNode.pypp.os build_dir_2.7/ogre_1.7.2/AliasTextureIterator.pypp.os build_dir_2.7/ogre_1.7.2/AlignedMemory.pypp.os build_dir_2.7/ogre_1.7.2/AllocatedObjectCategorisedAllocPolicy.pypp.os

removing stuff... posting.... to ... big .... more than.... 60000 chars

build_dir_2.7/ogre_1.7.2/vectorTechniqueGPUVendorRule.pypp.os build_dir_2.7/ogre_1.7.2/vectorTexturePtr.pypp.os build_dir_2.7/ogre_1.7.2/vectorTextureUnitState.pypp.os build_dir_2.7/ogre_1.7.2/vectorVector2.pypp.os build_dir_2.7/ogre_1.7.2/vectorVector3.pypp.os build_dir_2.7/ogre_1.7.2/vectorVector4.pypp.os build_dir_2.7/ogre_1.7.2/vectorVertexDataHardwareAnimationData.pypp.os build_dir_2.7/ogre_1.7.2/vectorVertexData_const.pypp.os build_dir_2.7/ogre_1.7.2/vectorVertexPoseKeyFramePoseRef.pypp.os -L/usr/lib -L/usr/lib/python2.7/libs -lboost_python -lOgreMain -lOgreProperty
scons: building terminated because of errors.

10-27 08:58 PythonOgre.BuildModule DEBUG
scons: warning: BuildDir() and the build_dir keyword have been deprecated;
use VariantDir() and the variant_dir keyword instead.
File "/home/dev/python-ogre/SConstruct", line 228, in <module>
collect2: ld terminated with signal 9 [Killed]
scons: *** [build_dir_2.7/ogre_1.7.2/ogre.so] Error 1



NOTE:
The output was trimmed because the posting exceeded 60000 chars, Also I could not upload the file here. because *.txt, *.doc , *.html are not allowed.


Without the complete build log I would guess that the issue is insufficient memory when linking the ogre module. Look on the forum I think someone else had this issue, try setting the optimization flags for the SCons build as discussed previously.

viewtopic.php?f=3&t=14906

skorpio

04-11-2012 19:41:29

Hello,

Dermont, your insight into code are so uncanny.
I increased the size of the RAM to 4GB in Parallel Configuration and python-ogre compiled!
The memory leak was probably what caused it not to compile. I had the RAM at 2GB.

[url=http://bitbucket.org/wxogre_linux/scree]http://bitbucket.org/wxogre_linux/scree ... enshot.png


Best Regards,
Skorpio