Sketchup exporter for Ogre
-
- OGRE Moderator
- Posts: 7157
- Joined: Sun Jan 25, 2004 7:35 am
- Location: Brisbane, Australia
- x 534
Sketchup exporter for Ogre
Yes, it's download time. I've finished as much as I can be bothered doing for Version 1.0.0.
Sketchup Ogre Exporter Version 1.0.0 (edit: link is stuffing up)
Sketchup Ogre Exporter Version 1.0.0 alt link
Edit 13/06/06: Sketchup Ogre Exporter Version 1.0.1
All standard materials should be working now. Every model I throw at it comes out fine in Ogre (except for missing backfaces of course).
There's still more stuff to add, like dotScene support and visible edges, but that will come later. Unfortunately, configuration is via a text file for now. Remember to edit it before trying to export!
Remember, the free version of Sketchup is for non commercial use only. This exporter isn't tested with the Pro version, but I'm guessing it will work.
The exporter has a readme which explains installation and usage.
Enjoy.
Sketchup Ogre Exporter Version 1.0.0 (edit: link is stuffing up)
Sketchup Ogre Exporter Version 1.0.0 alt link
Edit 13/06/06: Sketchup Ogre Exporter Version 1.0.1
All standard materials should be working now. Every model I throw at it comes out fine in Ogre (except for missing backfaces of course).
There's still more stuff to add, like dotScene support and visible edges, but that will come later. Unfortunately, configuration is via a text file for now. Remember to edit it before trying to export!
Remember, the free version of Sketchup is for non commercial use only. This exporter isn't tested with the Pro version, but I'm guessing it will work.
The exporter has a readme which explains installation and usage.
Enjoy.
Last edited by Kojack on Mon Jun 12, 2006 4:38 am, edited 2 times in total.
-
- Orc
- Posts: 498
- Joined: Thu Mar 16, 2006 5:27 pm
-
- OGRE Moderator
- Posts: 7157
- Joined: Sun Jan 25, 2004 7:35 am
- Location: Brisbane, Australia
- x 534
-
- Gnome
- Posts: 346
- Joined: Thu May 19, 2005 10:32 am
- Location: Durban, South Africa, No London, wait, where?
-
- Minaton
- Posts: 997
- Joined: Sat Feb 25, 2006 8:14 pm
- Location: Wales, United Kingdom
-
- Gnome
- Posts: 336
- Joined: Wed Oct 12, 2005 1:50 pm
- Location: UK
-
- OGRE Moderator
- Posts: 7157
- Joined: Sun Jan 25, 2004 7:35 am
- Location: Brisbane, Australia
- x 534
Freaky. I can download it fine with a system which has never been to that site before, and I've used that host to give files on my forum for 2 years.
Oh well. Let's try again.
Here's another link
Now to get back to reinstalling windows... (only got firefox and kerio on, got so much to install)
Oh well. Let's try again.
Here's another link
Now to get back to reinstalling windows... (only got firefox and kerio on, got so much to install)
-
- Gnome
- Posts: 336
- Joined: Wed Oct 12, 2005 1:50 pm
- Location: UK
-
- OGRE Moderator
- Posts: 7157
- Joined: Sun Jan 25, 2004 7:35 am
- Location: Brisbane, Australia
- x 534
Last night I was going to add edge exporting (a lot of sketchup models use the visible edges to add detail to models instead of textures).
But I discovered that ogre's xml mesh format doesn't support line lists, line strips or point lists. So there's no easy way to do it, unless I either:
- patch the xml converter to accept them
- export thin boxes or cylinders (so the edge can be seen as the same thickness from any angle)
I think the next feature for the exporter will be dotscene exporting (groups and components will form scene nodes and entities, instead of the entire Sketchup scene being turned into a single mesh). Of course that will just be an option, the current export style will be kept too.
Now that I've got xp reinstalled and running well, I need to install xp 64 and linux. I've got both visual studios too.
But I discovered that ogre's xml mesh format doesn't support line lists, line strips or point lists. So there's no easy way to do it, unless I either:
- patch the xml converter to accept them
- export thin boxes or cylinders (so the edge can be seen as the same thickness from any angle)
I think the next feature for the exporter will be dotscene exporting (groups and components will form scene nodes and entities, instead of the entire Sketchup scene being turned into a single mesh). Of course that will just be an option, the current export style will be kept too.
Now that I've got xp reinstalled and running well, I need to install xp 64 and linux. I've got both visual studios too.
-
- Bronze Sponsor
- Posts: 614
- Joined: Mon Apr 14, 2003 11:48 pm
- Location: Was LA now France
- x 26
-
- OGRE Moderator
- Posts: 7157
- Joined: Sun Jan 25, 2004 7:35 am
- Location: Brisbane, Australia
- x 534
-
- Bronze Sponsor
- Posts: 614
- Joined: Mon Apr 14, 2003 11:48 pm
- Location: Was LA now France
- x 26
Thanks for considering it. I guess I could do it given time but it's unchartered territory for me. Actually both ruby and import/export areKojack wrote:It shouldn't be hard. Collada is a bit more complicated than ogre's xml format, but not too different.
I'll probably give it a try when I get time.
-
- Kobold
- Posts: 28
- Joined: Tue May 17, 2005 2:10 pm
- Location: Atlanta, Georgia
Great work, Kojack. I used your exporter to convert one of the Sketchup sample buildings (the Craftsman House) to an OGRE mesh, and then incorporated the mesh into a Blink3d environment. Here's a screenshot:
You can perhaps just make out a problem with the windows, which appear in front of everything, instead of appearing behind overlapping objects (like the porch columns). I manually edited the material file to turn depth_check on, which corrected the problem. Because of the backface issue, which you note, views through the transparent windows to the interior of the house go all the way to the horizon, as the walls are invisible from the inside. Aside from that, the export worked great. Thanks, again.
You can perhaps just make out a problem with the windows, which appear in front of everything, instead of appearing behind overlapping objects (like the porch columns). I manually edited the material file to turn depth_check on, which corrected the problem. Because of the backface issue, which you note, views through the transparent windows to the interior of the house go all the way to the horizon, as the walls are invisible from the inside. Aside from that, the export worked great. Thanks, again.
Glenn
-
- OGRE Moderator
- Posts: 7157
- Joined: Sun Jan 25, 2004 7:35 am
- Location: Brisbane, Australia
- x 534
-
- Kobold
- Posts: 28
- Joined: Tue May 17, 2005 2:10 pm
- Location: Atlanta, Georgia
I've made another test using one of the free, shared models in the Google/Sketchup 3D Warehouse (http://sketchup.google.com/3dwarehouse/ ... c553ce5e84):
Here is the model viewed in Sketchup:
and here is the exported OGRE mesh viewed in Blink:
You'll notice that the texture on one side of the tower did not make it through the export process. The faces of the tower are textured as a group, and that group is inside the larger group that encompasses the whole church, if that helps. Let me know what other info you might need to figure out what's going on here.
Here is the model viewed in Sketchup:
and here is the exported OGRE mesh viewed in Blink:
You'll notice that the texture on one side of the tower did not make it through the export process. The faces of the tower are textured as a group, and that group is inside the larger group that encompasses the whole church, if that helps. Let me know what other info you might need to figure out what's going on here.
Glenn
-
- OGRE Moderator
- Posts: 7157
- Joined: Sun Jan 25, 2004 7:35 am
- Location: Brisbane, Australia
- x 534
Hmm, freaky.
I've got the model loaded and I'm examining the data (the ruby console is handy)...
The face with the missing texture has no texture assigned to the front (it's nil). Normally a nil material will appear as the default material. But it seems that groups can be assigned materials too. A material assigned to a group will override the default material of all children of the group. In the case of the church, both the church group and the tower group have Material5, so any faces with no material show up as Material 5 too.
It shouldn't be hard to fix.
I've got the model loaded and I'm examining the data (the ruby console is handy)...
The face with the missing texture has no texture assigned to the front (it's nil). Normally a nil material will appear as the default material. But it seems that groups can be assigned materials too. A material assigned to a group will override the default material of all children of the group. In the case of the church, both the church group and the tower group have Material5, so any faces with no material show up as Material 5 too.
It shouldn't be hard to fix.
-
- Gnoblar
- Posts: 13
- Joined: Thu Aug 04, 2005 8:12 pm
-
- Bronze Sponsor
- Posts: 614
- Joined: Mon Apr 14, 2003 11:48 pm
- Location: Was LA now France
- x 26
-
- OGRE Moderator
- Posts: 7157
- Joined: Sun Jan 25, 2004 7:35 am
- Location: Brisbane, Australia
- x 534
Yep, that's to be expected. A lot of sketchup models on the net use backfaces, which the exporter doesn't handle yet. So most models with transparent bits will look wrong.
I've got a fix for the church model, but I've been busy and haven't released it yet. I'll try to get it out tonight. It turns out that not only do faces with no materials inherit from their parent, but their uv coords are different. A normal face has uv coords of around 0-1 (or more, for tiled textures), but faces with an inherited material return the absolute world coordinates of the vertices in inches as the uv coords. Luckily, I can ask textures what their size is in inches, and use that to calculate the real uv coords.
I've got a fix for the church model, but I've been busy and haven't released it yet. I'll try to get it out tonight. It turns out that not only do faces with no materials inherit from their parent, but their uv coords are different. A normal face has uv coords of around 0-1 (or more, for tiled textures), but faces with an inherited material return the absolute world coordinates of the vertices in inches as the uv coords. Luckily, I can ask textures what their size is in inches, and use that to calculate the real uv coords.
-
- Goblin
- Posts: 232
- Joined: Sat Apr 23, 2005 3:21 am
- Location: Atlanta, GA
-
- Silver Sponsor
- Posts: 2703
- Joined: Mon Aug 29, 2005 3:24 pm
- Location: Kuala Lumpur, Malaysia
- x 51
-
- OGRE Retired Team Member
- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 66
Ok, I'm really late to this party.
I love the idea of this. A quick and easy modeller for 'normal' people Hell, I might even be able to make something that doesn't look like a dogs arse in it (assuming I wasn't trying to model a dogs arse of course, in which case it would look like a yak's intestine).
I'm sure we could find space in ogreaddons for this, you game?
I love the idea of this. A quick and easy modeller for 'normal' people Hell, I might even be able to make something that doesn't look like a dogs arse in it (assuming I wasn't trying to model a dogs arse of course, in which case it would look like a yak's intestine).
I'm sure we could find space in ogreaddons for this, you game?
-
- OGRE Moderator
- Posts: 7157
- Joined: Sun Jan 25, 2004 7:35 am
- Location: Brisbane, Australia
- x 534
Damn work always getting in the way.
Here's Sketchup Ogre Exporter Version 1.0.1
The material problems with the church above should be fixed.
I've got some ideas for more features and better configuration. I'll try them out when I get free time.
I certainly wouldn't have any objections to the exporter being in ogreaddons.
Here's Sketchup Ogre Exporter Version 1.0.1
The material problems with the church above should be fixed.
I've got some ideas for more features and better configuration. I'll try them out when I get free time.
I certainly wouldn't have any objections to the exporter being in ogreaddons.