Blender importer [WIP]

The place for artists, modellers, level designers et al to discuss their approaches for creating content for OGRE.
User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
x 6
Contact:

Post by haffax »

Hello dermont,

this is an oversight and will be fixed. Thanks for spotting it. :) The shared vertices addition was rather quick and dirty it seems. An overhaul of the script is planned anyway and it is much needed.
team-pantheon programmer
creators of Rastullahs Lockenpracht
User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
x 6
Contact:

Post by haffax »

I just updated the importer to fix the two problems reported by dermont and discipline. The material creation is being worked on, but not activated in this version yet. I'll work on it tomorrow, with a bit luck I'll have it tackled then.

(As always it might take a while till this trickled down to public CVS.)
team-pantheon programmer
creators of Rastullahs Lockenpracht
dermont
Bugbear
Posts: 812
Joined: Thu Dec 09, 2004 2:51 am
x 42

Post by dermont »

Works for me, had to comment out some of the debug statements to speed things up. I updated the script to create vertex groups and everything works fine. Thanx
User avatar
discipline
OGRE Community Helper
OGRE Community Helper
Posts: 766
Joined: Mon May 16, 2005 12:09 am

Post by discipline »

I had to comment out some lines that had '>>>>>' and '<<<<<' near the file path variables for it to work. I suppose this was by design so the user will put in the path for their OgreXMLConverter?

Anyway, other than that it worked fine. When I load the mesh, I still only get a grey untextured image in my 3d window. It appears that UV coordinates are tied to the mesh though. If I create a new material and load in an image, then specify the ninja's skin and it gets mapped properly. Then I can render just fine. Even after doing this I still only see a grey image, so maybe it is just blender on linux, or how the debian maintaner compiled it.

Thanks haffax!
User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
x 6
Contact:

Post by haffax »

discipline wrote:I had to comment out some lines that had '>>>>>' and '<<<<<' near the file path variables for it to work. I suppose this was by design so the user will put in the path for their OgreXMLConverter?
No these are conflict markers. They are there because there we conflicts between my changes and the changes you made to your local copy. There are specialised edit tools that help you visualize the conflicts. (At least for windows that is, but there are probably linux tools out there too.) These lines aren't part of the file in CVS. You'll see that when you do a fresh checkout of the file.
discipline wrote: When I load the mesh, I still only get a grey untextured image in my 3d window. It appears that UV coordinates are tied to the mesh though. If I create a new material and load in an image, then specify the ninja's skin and it gets mapped properly. Then I can render just fine. Even after doing this I still only see a grey image, so maybe it is just blender on linux, or how the debian maintaner compiled it.
My update from last week, was solely there to fix the two reported bugs. Material import is not yet ready. This is rather tedious and I am a bit hampered by my limited Blender skills. (Oh. So many tiny buttons. ;) )
Anyway I am very close now here on my local copy. The texture is there in rendering, but it ignores uv coords. Probably just one or two flags. Just hadn't had the time to look them up yet.
team-pantheon programmer
creators of Rastullahs Lockenpracht
ibrown
Gremlin
Posts: 164
Joined: Wed Aug 18, 2004 6:41 pm
Location: London
Contact:

Post by ibrown »

Hi haffax, some time ago I fixed up bob holcomb's bsp import script so that it imported textures properly. It had the same problem as yours. I think the problem was due to confusion between materials and UV textures.

Anyhow, take a look at my script - it may help you. There are some subroutines you can copy which do the image set-up.

It's here:
http://www.ijbrown.net/blender/bsp_import.zip

and the original discussion on elysun is here:

http://www.elysiun.com/forum/viewtopic.php?t=42385

Ian
User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
x 6
Contact:

Post by haffax »

Hey ibrown. Thanks for the pointers. I'll definitly have a look at the scripts. Probably not today though, but I plan to bring out a new version this week.
team-pantheon programmer
creators of Rastullahs Lockenpracht
User avatar
discipline
OGRE Community Helper
OGRE Community Helper
Posts: 766
Joined: Mon May 16, 2005 12:09 am

Post by discipline »

haffax wrote:No these are conflict markers.
Oh, of course! I knew about those. Silly me. :oops:
User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
x 6
Contact:

Post by haffax »

I just committed a new version of the script.
Now render materials are created and I did a bit tidying-up in the script and added a new option for the log level. So output detail can be configured now.

The Ogre head rendered with Blender's built-in renderer:
Image

ibrown, your script was very helpful. Thanks again. :)
Last edited by haffax on Sat Aug 27, 2005 12:49 pm, edited 1 time in total.
team-pantheon programmer
creators of Rastullahs Lockenpracht
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 »

All Your Blend Are Belong To Us. 8) :wink:

Guess I just have to learn Blender, then. :P
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
discipline
OGRE Community Helper
OGRE Community Helper
Posts: 766
Joined: Mon May 16, 2005 12:09 am

Post by discipline »

jacmoe wrote:All Your Blend Are Belong To Us. 8) :wink:
Word.

Thanks haffax!
ibrown
Gremlin
Posts: 164
Joined: Wed Aug 18, 2004 6:41 pm
Location: London
Contact:

Post by ibrown »

haffax wrote: ibrown, your script was very helpful. Thanks again. :)
I'm glad it was helpful. The mesh import script is pretty important I think in the greater scheme of things - it allows more sharing of resources across projects and allows for migration from max to blender for projects that cannot afford max.

Ian
User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
x 6
Contact:

Post by haffax »

I recently commited a new bugfix release. Version 0.5.1 now imports Ogre meshes without normals or texture coordinates. Thanks to nfz for spotting this. :)

Today I started to work on skeleton import seriously. Depending on how much time I have at the weekend I can make skeleton import working next week. But I won't promise anything on this matter. :P
team-pantheon programmer
creators of Rastullahs Lockenpracht
tgraupmann
Gnoll
Posts: 696
Joined: Sun Feb 20, 2005 5:28 am
Contact:

Post by tgraupmann »

It doesn't seem like this plugin likes Python 2.4. I'll try 2.3.5 Yup works with Python 2.3
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 »

tgraupmann wrote:It doesn't seem like this plugin likes Python 2.4.
My guess is that it works with whatever Python Blender likes. :wink:
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
tgraupmann
Gnoll
Posts: 696
Joined: Sun Feb 20, 2005 5:28 am
Contact:

Post by tgraupmann »

Where do you get the "OgreXmlConverter.exe"?

Also I think you should add error handling for if it can't find the PYTHON variable, it should check in a default place, and then fail.

Found it:
http://www.ogre3d.org/index.php?option= ... t=category
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 »

tgraupmann wrote:Where do you get the "OgreXmlConverter.exe"?
Ogre - tools. :wink:
tgraupmann wrote:Also I think you should add error handling for if it can't find the PYTHON variable, it should check in a default place, and then fail.
Why? A succesful Python install makes use of a PYTHON envvar - if Blender is happy (Look at the Blender console) then Blender plugins are happy too. :)
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
tgraupmann
Gnoll
Posts: 696
Joined: Sun Feb 20, 2005 5:28 am
Contact:

Post by tgraupmann »

jacmoe wrote:Why? A succesful Python install makes use of a PYTHON envvar - if Blender is happy (Look at the Blender console) then Blender plugins are happy too. :)
From the importer readme:
Note that you need Python 2.3.x for it to work. After installing python
create an environment variable called PYTHON that contains the full path to
your python.exe
("C:\python23\python.exe" for the default installation destination).
Last edited by tgraupmann on Sun Aug 07, 2005 5:41 pm, edited 3 times in total.
tgraupmann
Gnoll
Posts: 696
Joined: Sun Feb 20, 2005 5:28 am
Contact:

Post by tgraupmann »

The importer plugin crashes when I try to import this simple mesh:
http://www.tagenigma.com/qa/albatross_shield.mesh
Timme
Greenskin
Posts: 122
Joined: Sun Mar 13, 2005 8:23 pm
Location: Germany

Post by Timme »

The mesh should be a XML - file. You have to convert yor mesh from .mesh to .mesh.xml with the OgreMeshViewer or the OgreXMLConverter.
User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
x 6
Contact:

Post by haffax »

tgraupmann, the importer is happy with the python Blender is happy with. This means Python 2.3 for Blender 2.37. Python 2.4 will probably be used to for Blender 2.40. The PYTHON environment variable is (or probably was, since it now works without here) used by Blender to determine what python installation to use.

Anyway. Your mesh could be imported just fine here. It looks like this: http://img151.imageshack.us/my.php?image=shield9gm.jpg

What was the error messages? What does your Blender console window have to say about it?
team-pantheon programmer
creators of Rastullahs Lockenpracht
tgraupmann
Gnoll
Posts: 696
Joined: Sun Feb 20, 2005 5:28 am
Contact:

Post by tgraupmann »

I tried to directly import the mesh and I get:

OgreXMLConverter.exe has encountered a problem and needs to close. We are sorry for the inconvenience.


Wanna tell microsoft...
User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
x 6
Contact:

Post by haffax »

Timme, the importer can convert mesh files to mesh.xml files for you, when you set the IMPORT_OGREXMLCONVERTER option inside the script to your local copy of the OgreXmlConverter. :)
team-pantheon programmer
creators of Rastullahs Lockenpracht
User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
x 6
Contact:

Post by haffax »

tgraupmann, but the mesh has nevertheless been converted has it? This is probably a bug in the OgreXmlConverter's clean-up code.
team-pantheon programmer
creators of Rastullahs Lockenpracht
tgraupmann
Gnoll
Posts: 696
Joined: Sun Feb 20, 2005 5:28 am
Contact:

Post by tgraupmann »

haffax wrote:Timme, the importer can convert mesh files to mesh.xml files for you, when you set the IMPORT_OGREXMLCONVERTER option inside the script to your local copy of the OgreXmlConverter. :)
I did:
IMPORT_OGREXMLCONVERTER = "c:\\ogretools\\OgreXMLConverter.exe"
Post Reply