Getting/converting models under Linux

The place for artists, modellers, level designers et al to discuss their approaches for creating content for OGRE.
fabske
Kobold
Posts: 30
Joined: Thu Jan 26, 2012 10:29 am

Getting/converting models under Linux

Post by fabske »

I am using now Ogre under my Ubuntu 11.10 since weeks and I really like it! I made several applications with the buildin ogre-mesh models (ogrehead, ..).
Since one week I hardly try to get external models to work in ogre, without success :(

First I tried of course to load 3DS models to blender and then export them to ogre-format, but the ogre exporter is no more up tp date: http://www.ogre3d.org/forums/viewtopic.php?f=8&t=68906

Then I found the "3ds2mesh" program, which is not compilable due to wrong use of stdlib. I corrected that (<stdio> and using namespace) and compiled it. But when I try to convert a 3DS file I get an segmentation fault..

I even installed GoogleSketchUp under Wine and tried the export plugin, but it works officially only till version 7, but with my the downloaded version 7 it doesn't work at all..

Then I found the nice programm Wings3D which can open Blender and 3DS files. And There seems to be an exporter, but the links are dead: http://www.ogre3d.org/tikiwiki/Wings3D+Exporter

My question: How the hell can I convert any kind of model format to use in Ogre?
Or: Is there some repository of ogre-mesh? I need some houses and a cabriot car.
User avatar
duststorm
Minaton
Posts: 921
Joined: Sat Jul 31, 2010 6:29 pm
Location: Belgium
x 80

Re: Getting/converting models under Linux

Post by duststorm »

fabske wrote:First I tried of course to load 3DS models to blender and then export them to ogre-format, but the ogre exporter is no more up tp date: http://www.ogre3d.org/forums/viewtopic.php?f=8&t=68906
I think you misunderstood. The ogre IMPORTER for blender is no longer up to date (which imports ogre mesh files into blender)

For EXPORTING from Blender to Ogre there are enough alternatives that work really well.

If you use blender 2.4 or older:
http://www.ogre3d.org/tikiwiki/Blender+Exporter
http://www.ogre3d.org/forums/viewtopic.php?t=45922

If you use blender 2.5 or newer:
http://www.ogre3d.org/tikiwiki/Blender+2.5+Exporter
http://www.ogre3d.org/forums/viewtopic.php?f=8&t=64019

There is also another exporter for blender 2.5/2.6 with more fancy features:
http://www.ogre3d.org/forums/viewtopic.php?f=8&t=61485


So for getting your blender models to Ogre there are enough solutions that work very well.
And yes, I must admit that the wiki has gotten a little messy and confusing to beginners. The problem is that a lot of the material is outdated and it's often not clear what is old or still valid. I guess nobody really found the time to update it.
Developer @ MakeHuman.org
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 535

Re: Getting/converting models under Linux

Post by Kojack »

First I tried of course to load 3DS models to blender and then export them to ogre-format, but the ogre exporter is no more up tp date:
Which version of blender did you use? There's an ogre exporter which definitely supports 2.61 and possibly 2.62. Version 2.62 of blender is only a couple of weeks old.
http://www.ogre3d.org/forums/viewtopic.php?f=8&t=61485
I even installed GoogleSketchUp under Wine and tried the export plugin, but it works officially only till version 7, but with my the downloaded version 7 it doesn't work at all..
I don't know about the other exporters (there's a couple of sketchup exporters for ogre), but my one (the one in the ogre addons svn repository) works fine in sketchup 8.
Wine may be an issue. I've never tried the exporter with sketchup in wine. Then again, I've never used wine for anything else either. :)
Then I found the nice programm Wings3D which can open Blender and 3DS files. And There seems to be an exporter, but the links are dead:
Yep, those links aren't working. I'll fix them up soon.
The wings3d exporter is inside of the ogre source, in the tools directory. You can get it by cloning the mercurial repository of ogre, or downloading one of the source zips at http://www.ogre3d.org/download/source

No clue on the 3ds2mesh program. When I export from max, I use ogremax.
weitjong
Gnoblar
Posts: 3
Joined: Sat Jun 23, 2007 7:04 pm
Location: Singapore, 新加坡

Re: Getting/converting models under Linux

Post by weitjong »

I just manage to compile the "3ds2mesh" under Fedora 64-bit. I applied two patches to the code after SVN check out that I gathered from other forum threads. And on top of that I have added my own patch to make "3dsftk3" compatbile with 64-bit (this may be an overstatement :lol:, basically I just changed two lines; without them the program would crash in 64-bit). If you are still interested in "3ds2mesh", attached is the combined patches. So far I have tested it sucessfully on a few free 3ds models that I downloaded from internet to the corresponding Ogre mesh and material files.
wt-3ds2mesh-patch.txt
Things to note:
1. I use Fedora distro. My patch uses 'pkg-config' to supply the compiler and linker flags. I am not sure whether you have something like that in Ubuntu. If not then you may want to replace that with actual output value as shown below.

Code: Select all

$ pkg-config --cflags OGRE
-pthread -I/usr/include/OGRE

$ pkg-config --libs OGRE
-lOgreMain -lpthread
2. I am compiling against Ogre v1.8 where the method VertexDeclaration::getAutoOrganisedDeclaration() now has three boolean parameters instead of two. Adjust the caller code in 3ds2mesh.cpp accordingly if your Ogre version only expects two.
You do not have the required permissions to view the files attached to this post.