Blender26 Ogre Exporter

The place for artists, modellers, level designers et al to discuss their approaches for creating content for OGRE.
Post Reply
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: Blender25 Ogre Exporter + extended .scene format

Post by jacmoe »

I wouldn't report any bugs regarding Blender beta. :)
If you look at the latest changelog you'll see that the Python interface underwent huge, breaking changes.
So check the exporter first.
IMO. :)
Really looking forward to when it's stable.
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
racoon
Gnoblar
Posts: 15
Joined: Fri Jul 23, 2010 6:34 pm

Re: Blender25 Ogre Exporter + extended .scene format

Post by racoon »

No I haven't send in a Bug report yet.
I first want to verify it.
But it is a bug which appears without the exporter.
Even if it isn't installed and you do the steps I described in my last post
the orientation of the object gets screwed up.
I also tryed to fix it changing the code inside the exporter but the quaternions
are just wrong.

Cheers

racoon
User avatar
LiMuBei
Goblin
Posts: 297
Joined: Mon Jun 09, 2008 3:56 pm
Location: Karlsruhe, Germany
x 10

Re: Blender25 Ogre Exporter + extended .scene format

Post by LiMuBei »

Definitely seems like Blender is doing something strange with the quaternions. I get the same behaviour as you using 2.56a. I would report it to the Blender devs.
User avatar
so0os
Bugbear
Posts: 833
Joined: Thu Apr 15, 2010 7:42 am
Location: Poznan, Poland
x 33

Re: Blender25 Ogre Exporter + extended .scene format

Post by so0os »

Yeah this sucks pretty much. You can actually reset the quats yourself, but this will break EVERY animation ultimately.
Sos Sosowski :)
http://www.sos.gd
racoon
Gnoblar
Posts: 15
Joined: Fri Jul 23, 2010 6:34 pm

Re: Blender25 Ogre Exporter + extended .scene format

Post by racoon »

Hi,

I reported it to the Blender dev community and the error is fixed in the current svn version.
http://projects.blender.org/tracker/ind ... 9&atid=498
But now there is another problem. :)

The script crashes now giveing following error message:
line 4610, in get_parent_matrix
if not ob.parent: return mathutils.Matrix([1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0
,0,1])
TypeError: mathutils.Matrix(): expects no args or 2-4 numeric sequences
It seems they have changed something in mathutils.Matrix.
Does anybody know a fix for this ??
As far as I understand [1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1] are 4 numeric sequences, or not?

Cheers

raccon
Whyte
Gnoblar
Posts: 3
Joined: Fri Jan 14, 2011 5:45 pm

Re: Blender25 Ogre Exporter + extended .scene format

Post by Whyte »

racoon wrote: It seems they have changed something in mathutils.Matrix.
Does anybody know a fix for this ??
As far as I understand [1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1] are 4 numeric sequences, or not?
Actually they look more like 4 numeric lists to me. Sure, lists are sequences, but maybe it expects a different type of sequence? Does changing the square brackets into round parentheses do anything?
[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1] -> (1,0,0,0),(0,1,0,0),(0,0,1,0),(0,0,0,1)
racoon
Gnoblar
Posts: 15
Joined: Fri Jul 23, 2010 6:34 pm

Re: Blender25 Ogre Exporter + extended .scene format

Post by racoon »

Hi Whyte

changing it to

Code: Select all

mathutils.Matrix(((1,0,0,0),(0,1,0,0),(0,0,1,0),(0,0,0,1))) 
worked.
It has to be

Code: Select all

((1,0,0,0),(0,1,0,0),(0,0,1,0),(0,0,0,1))
and not

Code: Select all

(1,0,0,0),(0,1,0,0),(0,0,1,0),(0,0,0,1)
.
Wouldn't this make it a sequence of 4 sequences??
My Python skills are a little bit rusted atm cause I am using C again for the last 3 years ;)

Here is an updated version of your patched script.

It works quite well for me now.

@hartsantler
Would it be possible to but the code in the google source repro?
As far I see the source it not in there. I would like to add some stuff to the addon.
For example:
-better material handling
-and the ability to export path animations (which would also expand the dotScene format)

I also could add my dotScene Loader


Cheers

Sebastian
Attachments
addon_ogreDotScene3.0b.zip
New version of 0.3 with the patch from Whyte and a fix for the current svn Blender 2.56
(67.04 KiB) Downloaded 355 times
Netich
Halfling
Posts: 40
Joined: Tue Oct 06, 2009 8:52 am

Re: Blender25 Ogre Exporter + extended .scene format

Post by Netich »

Latest version (addon_ogreDotScene3.0b.zip) doesnt work for me.

If I use blender svn (from ppa), the addon doesnt even load. This could be a problem with the ppa itself, though.
With blender 2.56a a get an error when exporting.

Just to post it here, i know blender api is quite unstable, and i can wait.

Thanks hartsantler, and also whyte and raccon.

PD: OgreMeshy 0.9 has now support for linux, one less step to the perfect blender->ogre workflow!
User avatar
Brocan
Orc
Posts: 441
Joined: Tue Aug 01, 2006 1:43 am
Location: Spain!!
x 8

Re: Blender25 Ogre Exporter + extended .scene format

Post by Brocan »

I've a few problems with this exporter in Blender 2.56a beta, the mesh is only a head, so it hasn't skeleton.

- First, it's not possible to use shared vertex? or an option of removing duplicated vertex?
- Second, i think that the shappes aren't exporting correctly. My mesh suffers cracks when I load in ogre and execute a pose. Thus, i see that the vertex which are moving in the pose are wrong, so seems that maybe the vertex in the pose are wrong indexed (the mesh has around ~10000 vertex, so i cannot check one by one...).

I use meshmagick to remove the duplicated vertex, the faces are correctly reindexed but i don't know if the pose references are reindexed...

Thanks in advance!
Hakuhonoo
Gnoblar
Posts: 1
Joined: Wed Feb 09, 2011 8:18 pm

Re: Blender25 Ogre Exporter + extended .scene format

Post by Hakuhonoo »

Can`t export anything...
Always have error like this:

Code: Select all

ogre export-> D:\Models\untitled.scene
--------------- exporting root -> <bpy_struct, Object("SurfSphere")>
Traceback (most recent call last):
  File "D:\Blender\2.56\scripts\addons\addon_ogreDotScene.py", line 4109, in exe
cute
    def execute(self, context): self.ogre_export(  self.filepath, context ); ret
urn {'FINISHED'}
  File "D:\Blender\2.56\scripts\addons\addon_ogreDotScene.py", line 4395, in ogr
e_export
    xmlparent=nodes
  File "D:\Blender\2.56\scripts\addons\addon_ogreDotScene.py", line 4418, in _no
de_export
    o = _ogre_node_helper( doc, ob, objects )
  File "D:\Blender\2.56\scripts\addons\addon_ogreDotScene.py", line 4616, in _og
re_node_helper
    mat = get_parent_matrix(ob, objects).invert() * ob.matrix_world
  File "D:\Blender\2.56\scripts\addons\addon_ogreDotScene.py", line 4610, in get
_parent_matrix
    if not ob.parent: return mathutils.Matrix(((1,0,0,0),(0,1,0,0),(0,0,1,0),(0,
0,0,1)))
RuntimeError: matrix(): row and column sizes must be between 2 and 4

location:<unknown location>:-1

location:<unknown location>:-1
Any ideas?
iridium77Ir
Gnoblar
Posts: 2
Joined: Tue Jul 06, 2010 8:42 pm

Re: Blender25 Ogre Exporter + extended .scene format

Post by iridium77Ir »

I had the same error. I attached a quick fix to the python script.
Attachments
addon_ogreDotScene3.0b.zip
(70.64 KiB) Downloaded 334 times
SRombauts
Kobold
Posts: 39
Joined: Mon Feb 28, 2011 6:58 pm
Location: Paris, France
x 2
Contact:

Re: Blender25 Ogre Exporter + extended .scene format

Post by SRombauts »

@hartsantler Are you still maintaining this great exporter ?

I am asking because the last download in the Google Project page (http://code.google.com/p/blender2ogre/downloads/list) is from January 06 and is not usable without the above quick fix provided by iridium77Ir : this is reflected by a still open issue on the project page.

And could you update your first post on this topic to provide the above download link instead of the obsolete ZIP file ?

If you do not have enough time by yourself, would you be kind to give permission on the Google project to other maintainer ? And perhaps as well to release the sources on the google hg repository ? I would love to help at least with those kind of maintenance tasks !

Thanks a lot !

Regards,
SRombauts
http://www.srombauts.fr, comments from an Android developer
hartsantler
Greenskin
Posts: 107
Joined: Tue Nov 16, 2010 7:33 am
x 15

Re: Blender25 Ogre Exporter + extended .scene format

Post by hartsantler »

hi everybody,
thanks for all the good comments.
i've been working on other projects and haven't had time to revisit the exporter, im currently playing with Realxtend, Tundra and Kinect.

Great work by LiMuBei and Whyte on not just fixing bugs but also making it run faster. Speed is a bit of a problem, it would be nice to also remove the hack that makes exporting smooth normals so slow - it should be nearly as fast as flat shading which is 100x faster. I am planing to come back to the exporter and add some new features, but that won't be for a few more months.

Thanks to SRombauts for offering to help keep the version in sync on google code. If anybody else wants to be a maintainer on the google project just send me a private message with your gmail and i will add you.
-hart
Pforce
Kobold
Posts: 27
Joined: Wed Apr 07, 2010 12:45 am

Re: Blender25 Ogre Exporter + extended .scene format

Post by Pforce »

Hi hartsantler,

I think you might know me from rex dev circles. You exported is good, I read some of the code and tested it out. Few problems that I see currently.
  • As the "extended" scene format is for realXtend Tundra client/server. Id like the filename to be .txml so you can immediately drag and drop it to your world after export. Minor detail really.
  • If I read the code right its trying to find (hard coded) the ogre xml converter executable straight from /usr/bin. I'd like to see support for windows users there too, I for one had to go and mod it myself with an absolute path. Maybe add a UI element to give the path that it would remember when you set it once.
  • One other semi-linux hard coding i guess was some os.username() or something, I think that borked for me under windows and stopped the whole script. It was just used as the author name for the scene files. Maybe wrap a try except there to avoid it failing all togerther.
  • Another minor UI related thing, if I uncheck eg. camera and light export. They are back in checked state when i come back for another import. I dont know what blender provides to store these kind of things? Same config would apply to the above thing.
  • Materials are in one big file, the material ref is always same in the .txml data for all meshes. This is ok for pure ogre usage. But having multiple materials in one .material file is no usable either in Naali or the new Tundra tech. There is no plans to change how our material refs or asset api works with materials at this point. The best solution for this would be a simple split of the big Scene.material. Get all material { } blocks to own files, remember the filenames and insert those only to the .txml materiaRef attributes. I think this is quite trivial to implement and it will make the artist very happy :) Without current situation they have to manually split the big .material file. Open the .txml file and modify the refs to point to the correct "single material files" by hand. This is too much to ask for complex scenes when it can be done with code quite easily.
Your exporter is the best one for realXtend artists. If we can do these things together we can make the artist even more happy and ease their worldflow :) Please add me as a contributor if you will jonne@adminotech.com We can also discuss over IRC what you have time to do and what I can help with.

Also I would like to ask is the vertex groups as ogre submeshes working correctly? I tried to used but I only got one submesh to the exported meshes. If someone could explain the proper way to export the groups as submeshes I would appriciate it :) Also there was some weirdness when scale for an object in blender was != 1,1,1 it did some weird offset things when putting the .txml to Tundra. I suppose the fix for this is not to change the scale ever but mod the size in the edit mode in blender.

Btw. Did you include these fine ogre folks performance/bug fixes already?
antont
Gnoblar
Posts: 22
Joined: Fri Mar 11, 2005 8:12 am
Location: Oulu, Finland
x 1
Contact:

Re: Blender25 Ogre Exporter + extended .scene format

Post by antont »

Having all the materials does work fine for Tundra usage -- the dotscene import in Tundra creates individual files for the materials. This is how we've been using the blender 2.4 exporter too, that also makes a single .material file. Which I think is good. Or do you think there is some advantage in splitting in Blender already?

~Toni
Pforce
Kobold
Posts: 27
Joined: Wed Apr 07, 2010 12:45 am

Re: Blender25 Ogre Exporter + extended .scene format

Post by Pforce »

Oh I did not know that .scene import does that. We'll I guess my next question would be then why does it generate the .txml file then if its not formed properly and is not ready for use. Kind of confusing.

edit. Discussed with toni on irc and it seems the .txml gets physic collisions too with our rigid body component. I think this is great, but having the mat refs wrong makes the .txml really not usable, so I still believe it should be fixed even if the .scene import would do this for you. As that is again missing the physics components.
SRombauts
Kobold
Posts: 39
Joined: Mon Feb 28, 2011 6:58 pm
Location: Paris, France
x 2
Contact:

Re: Blender25 Ogre Exporter + extended .scene format

Post by SRombauts »

This is what I proposed in private to improve the current plugin, but it will take time :
  • Wiki : install/dependencies instruction, perhaps with a QuickStart tutorial
    Forum : trying to follow and answer on the few threads in the ogre3d forum
    Forum : perhaps also on the Blender forum side ?
    Dev : setting up the hg repository
    Dev : improving quality/maintainability by splitting source code in a few files
    Dev : path to some tools could be automatic (for instance D:\Ogre\OgreXmlConverter is in my PATH var on Windows 7)
    Dev : adding some configuration interface (for exotic path like /opt/ogre/xxx on Linux)
    Dev : trying to follow some of the Blender scripts guidelines
Regards,
SRombauts
http://www.srombauts.fr, comments from an Android developer
SRombauts
Kobold
Posts: 39
Joined: Mon Feb 28, 2011 6:58 pm
Location: Paris, France
x 2
Contact:

Re: Blender25 Ogre Exporter + extended .scene format

Post by SRombauts »

Hi,

I took the time to extract from your posts your issue descriptions, to update our bug-tracker : http://code.google.com/p/blender2ogre/issues/list
I encourage you to use it and leave comment on issue you encounter with the exporter !

I also set up the Mercurial (hg) repository on Google Code so that developments can be shared easily : http://code.google.com/p/blender2ogre/source/list

Then I corrected issue 1 (os.getlogin() unreliable 0.3.1) and issue 5 (speed optimization) thanks to your submitted patch int this topic.
=> Thus I updated the download list with this small 0.3.1 bugfix release : http://code.google.com/p/blender2ogre/downloads/list (still not Blender SVN compatible)

Finally, I copy our short Install Instruction on a Wiki page, that could be useful for newcomers : http://code.google.com/p/blender2ogre/wiki/Installation

Thanks all for your help !
SRombauts
http://www.srombauts.fr, comments from an Android developer
Pforce
Kobold
Posts: 27
Joined: Wed Apr 07, 2010 12:45 am

Re: Blender25 Ogre Exporter + extended .scene format

Post by Pforce »

Great work, thanks for the fixes! One question: does google code enable you to use svn or git at the same time with hg. I guess that would get quite confusing. I'd love git there but I guess I need to learn hg to get involved :) And yes lets use the google code issue tracker actively instead of rambling in random forums.

If we could get IRC channel up to freenode or something that would be nice too. Maybe mark down that to wiki so people who need help can come and talk. I might also write some realXtend related help to the wiki page when I have time.

hartsantler: when you have time please add me as a contributor. I'd maybe have time to take some peaks at the weekend!
SRombauts
Kobold
Posts: 39
Joined: Mon Feb 28, 2011 6:58 pm
Location: Paris, France
x 2
Contact:

Re: Blender25 Ogre Exporter + extended .scene format

Post by SRombauts »

Pforce wrote:Great work, thanks for the fixes! One question: does google code enable you to use svn or git at the same time with hg. I guess that would get quite confusing. I'd love git there but I guess I need to learn hg to get involved :)
In Google Project, hg is exclusive with svn, and git is not supported : but it is not hard to use if you know git !

SRombauts
http://www.srombauts.fr, comments from an Android developer
User avatar
Klaim
Old One
Posts: 2565
Joined: Sun Sep 11, 2005 1:04 am
Location: Paris, France
x 56
Contact:

Re: Blender25 Ogre Exporter + extended .scene format

Post by Klaim »

If you use git, you can easily clone and do transactions from an hg repository.
User avatar
sparkprime
Ogre Magi
Posts: 1137
Joined: Mon May 07, 2007 3:43 am
Location: Ossining, New York
x 13
Contact:

Re: Blender25 Ogre Exporter + extended .scene format

Post by sparkprime »

I just tried this with latest blender svn, followed the installation instructions but blender is not opening the .py file (verified with strace). Has something changed in blender?
User avatar
sparkprime
Ogre Magi
Posts: 1137
Joined: Mon May 07, 2007 3:43 am
Location: Ossining, New York
x 13
Contact:

Re: Blender25 Ogre Exporter + extended .scene format

Post by sparkprime »

Same behaviour in blender-2.56a-beta-linux-glibc27-i686

adding the .py file to the addons directory does not cause it to be read by blender
SRombauts
Kobold
Posts: 39
Joined: Mon Feb 28, 2011 6:58 pm
Location: Paris, France
x 2
Contact:

Re: Blender25 Ogre Exporter + extended .scene format

Post by SRombauts »

Hum, this could be a Linux issue, could you please try with the 0.3.0 script to compare it?
http://www.srombauts.fr, comments from an Android developer
mifth
Gnoblar
Posts: 6
Joined: Mon Sep 27, 2010 11:46 am

Re: Blender25 Ogre Exporter + extended .scene format

Post by mifth »

Hi. I have the same issue with blender 2.56 svn. Linux Ubuntu 64bit.
0.3.0 and 0.3.1 do not load into addons.
Post Reply