Blender .Scene Exporter

What it says on the tin: a place to discuss proposed new features.
reimpell
OGRE Contributor
OGRE Contributor
Posts: 570
Joined: Mon Mar 01, 2004 10:35 am
Location: Hamburg, Germany

Re: script updated?

Post by reimpell »

turkeypotpie wrote:I'm still seeing the same problem.
Maybe you need to press the reload button of your web browser. The fix is trivial: In the export method in the class ObjectExporterTree you have to change the line "for exporter in self:" into "for exporter in self.rootExporterList:".
turkeypotpie
Halfling
Posts: 53
Joined: Thu Apr 28, 2005 12:09 am
x 1

Post by turkeypotpie »

Yeah, must've been a sticky cache. Works fine now :)
Thanks for your work on this; it's a very nice thing to have.

I've got a slightly OT question about the (non-dotscene) exporter ... or maybe this is just a blender thing. Can lightmaps be generated and exported?

I noticed that blender has a 'Texture Baker' script, but this only attempts to render the material to the texture, ie. it doesn't take into account lighting or shadows.

I also noticed that the radiosity can be exported via vertex colors, which is nice, but requires simple geometry like walls to be subdivided greatly in order to get a nice effect.
reimpell
OGRE Contributor
OGRE Contributor
Posts: 570
Joined: Mon Mar 01, 2004 10:35 am
Location: Hamburg, Germany

Post by reimpell »

turkeypotpie wrote:Can lightmaps be generated and exported?
AFAIK the ogrefsrad addon project can handle dotScene files.
reimpell
OGRE Contributor
OGRE Contributor
Posts: 570
Joined: Mon Mar 01, 2004 10:35 am
Location: Hamburg, Germany

Ortho camera mode

Post by reimpell »

With version 2.37, Blender no longer fakes the orthographic camera mode. If you need orhographic cameras, please update your dotScene export script to revision 1.3 or newer and Blender to version 2.37 or newer.
dermont
Bugbear
Posts: 812
Joined: Thu Dec 09, 2004 2:51 am
x 42

Post by dermont »

I'm using windows, blender version 2.37 and export script revision 1.3.

I start the script, select my objects for export and click on the select export dir button <Select>, nothing happens. Only after exporting to the default path am I then able to select a path.

Also I have trouble exporting the world environment, in _WriteEnvironment the world.mode always seems to be zero. The only way I can get it to export is by replacing:

(world.mode & 1) with (world.getSkytype() & 1)
<fog .. mode=linear ..> with <fog .. mode='linear' ..>
reimpell
OGRE Contributor
OGRE Contributor
Posts: 570
Joined: Mon Mar 01, 2004 10:35 am
Location: Hamburg, Germany

Post by reimpell »

dermont wrote:I start the script, select my objects for export and click on the select export dir button <Select>, nothing happens. Only after exporting to the default path am I then able to select a path.
Thanks, it's a bug in Blender's BPy introduced in 2.37. I'll write a workaround.
dermont wrote:Also I have trouble exporting the world environment, in _WriteEnvironment the world.mode always seems to be zero.
Works here, if "Mist" is enabled in the world buttons.
dermont wrote:<fog .. mode=linear ..> with <fog .. mode='linear' ..>
Yes, thanks again!
dermont
Bugbear
Posts: 812
Joined: Thu Dec 09, 2004 2:51 am
x 42

Post by dermont »

Yep, sorry didn't have "Mist" enabled. I was also wondering if, as part of future release, you were intending to include physics attributes using the physics properties from the Game Logic buttons and/or scripts. Then it would be possible using pyode / blender's ode(?) and some scripts to encapsulate say, OgreOde, and use blender to test out physics / ragdoll stuff etc.
reimpell
OGRE Contributor
OGRE Contributor
Posts: 570
Joined: Mon Mar 01, 2004 10:35 am
Location: Hamburg, Germany

Post by reimpell »

dermont wrote:I was also wondering if, as part of future release, you were intending to include physics attributes using the physics properties from the Game Logic buttons and/or scripts.
You can already export all logic properties using the "Logic Properties" export option. For the physics settings scattered around Blender's interface, I haven't decided yet. Anyway, the exporter is designed so it can easily be customized.
reimpell
OGRE Contributor
OGRE Contributor
Posts: 570
Joined: Mon Mar 01, 2004 10:35 am
Location: Hamburg, Germany

Post by reimpell »

reimpell wrote:
dermont wrote:I start the script, select my objects for export and click on the select export dir button <Select>, nothing happens. Only after exporting to the default path am I then able to select a path.
Thanks, it's a bug in Blender's BPy introduced in 2.37. I'll write a workaround.
Revision 1.4 should work.
dermont
Bugbear
Posts: 812
Joined: Thu Dec 09, 2004 2:51 am
x 42

Post by dermont »

Works fine, thanks.
nfz
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 1263
Joined: Wed Sep 24, 2003 4:00 pm
Location: Halifax, Nova Scotia, Canada

Post by nfz »

I finally got around to merging my Blender to Lua scene exporter with the GUI portion of ogredotscene.py. Really nice job on the GUI classes Reimpell.

Here are some notes on some things I found in ogredotscene.py.

I noticed that when exporting a scene that has entities parented to another entity, the child entities get exported twice in the dot scene file. I traced the problem back to ObjectExporterTreeIterator class. In the next() method, self.stack.extend(exporter.getChildren()) adds on the children to the stack but ObjectExporter.export() already iterates through the children therefore double output for children.

I commented out the line that had self.stack.extend(exporter.getChildren()) and no more double export of children.

Output of position and orientation for scene nodes does not take into acount the different axis between Blender and Ogre but I don't use the dot scene loader so this may not be a problem in the dot scene loader since it may use the same format for position and orientation as Blender. I do the following in the exporter so I can read it directly into Ogre format:

Code: Select all

matrix = objectMatrix*inverseParentMatrix
# position
pos = matrix.translationPart()
fileObject.write(self._indent(indent+1) + \
  "<position x=\"%.6f\" y=\"%.6f\" z=\"%.6f\"/>\n" % (pos.x, pos.z, -pos.y) ))
# rotation
rot = matrix.toQuat()
fileObject.write(self._indent(indent+1) + \
  "<rotation qx=\"%.6f\" qy=\"%.6f\" qz=\"%.6f\" qw=\"%.6f\"/>\n" % (rot.x, rot.z, -rot.y, rot.w))
nfz
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 1263
Joined: Wed Sep 24, 2003 4:00 pm
Location: Halifax, Nova Scotia, Canada

Post by nfz »

I guess I should have read this thread all the way through ie page 2. The parenting problem had already been picked up and you used a slightly different fix to the problem ie changing self to self.rootExporterList. But then overriding __iter__ for ObjectExporterTree class is a waste of code since it never gets used :D .

It turns out that I was at rev 1.3 of the exporter instead of 1.4 in cvs, I thought I updated before starting the merge of the projects. All well, I learned more Python and Blender python API so it wasn't a waste.
sgrgc
Greenskin
Posts: 130
Joined: Thu May 12, 2005 1:42 pm

Post by sgrgc »

it is a good plugin.
you can post it to elysiun forums so they can help too
RCRuiz
Kobold
Posts: 27
Joined: Mon Apr 11, 2005 1:11 am

Post by RCRuiz »

It will sound a little out of subject but, why not write your blender scene data (ligth, camara, mesh, etc) directy on to a .h to be load it directly to our application?. No .scene need it.

Un Saludo
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Post by jacmoe »

So you want to recompile your .scene loading app for every level?
I don't think so. :wink:
RCRuiz
Kobold
Posts: 27
Joined: Mon Apr 11, 2005 1:11 am

Post by RCRuiz »

mmmmmm let me explaing, the way that I work now (maybe is the incorrect way) is that I do all my models, apply radiosity , apply uvm (if necesary), I create my scene directly using scenemaneger puting extra ligths, camara positions and everything else that my scene need inside of a class and if I need a new scene I create a new class , and so on. All my scene classes are in one .h so the creation and destruction of a "n" scenes are compile only one time.

Now , what I'm saing is that is relativly easy to do a py that create or add info to the .h file.

Yes, I know that I can not modify any of my scenes configuration with out recompile but I do not think thats necesary, do you?

Un Saludos
ogx
Gnoblar
Posts: 7
Joined: Mon Sep 05, 2005 9:02 am

Post by ogx »

i found a dotscene export problem:

i think the dotscene script dont export the range of light attenuation of spot and point lamp it is always remain (lightAttenuation range=5000.0)
reimpell
OGRE Contributor
OGRE Contributor
Posts: 570
Joined: Mon Mar 01, 2004 10:35 am
Location: Hamburg, Germany

Post by reimpell »

ogx wrote:i think the dotscene script dont export the range of light attenuation of spot and point lamp it is always remain (lightAttenuation range=5000.0)
Blender's "Spot" lamp does only have a "Clip End" if "Buf. shadow" is enabled. The other lamp types don't support clipping and are therefore exported with Ogre's default range.
Marco_ma
Gnoblar
Posts: 6
Joined: Thu May 31, 2007 8:46 am

Post by Marco_ma »

HI !
I am a student of computer science at the university of Udine and a I love Blender ;)

I try to use Blender whit Ogre.

This is my Workflow

1- export whit dotscene the scene
2- export whit ogremeshexporter the single object (whit Game Material actived)

3 - use OgreXMLconverter from OgreCommandLineTool for convert the mesh.xml in .mesh (cube.mesh.xml in cube.mesh)

This is my first try :

http://linediconsine.googlepages.com/Bl ... ported.zip

but the player based on Ogre say that I have a problem about dotsceneoctreescenemanager.

I never developed the palyer so, I want to undestand where is the problem (exporter , bad work process... etc)

Thanks for helps !

Ogre + Blender sound Great ;D
artheseus
Gnoblar
Posts: 5
Joined: Thu May 03, 2007 3:27 am

Post by artheseus »

Is the exporter compatible with blender 2.44?

I'm getting the following error when trying to export: 'Blender Lamp' object has no attribute 'getName'
artheseus
Gnoblar
Posts: 5
Joined: Thu May 03, 2007 3:27 am

Post by artheseus »

Hello? Is this thread dead?
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Post by jacmoe »

Yes. And not it is locked. :)


**** locked ****


Ask in this topic instead:

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

*stickied*
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Locked