Sketchup exporter for Ogre

The place for artists, modellers, level designers et al to discuss their approaches for creating content for OGRE.
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 534

Sketchup exporter for Ogre

Post by Kojack »

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. :)
Last edited by Kojack on Mon Jun 12, 2006 4:38 am, edited 2 times in total.
User avatar
Wretched_Wyx
Orc
Posts: 498
Joined: Thu Mar 16, 2006 5:27 pm

Post by Wretched_Wyx »

Awesome! Thanks Kojack! I'll let you know if I run into any problems.
User avatar
steven
Gnoll
Posts: 657
Joined: Mon Feb 28, 2005 1:53 pm
Location: Australia - Canberra (ex - Switzerland - Geneva)

Post by steven »

Thanks for this excellent work!

But I am not able to download !!
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 534

Post by Kojack »

Hmm, maybe you tried to get it at a bad time. It's only 16KB, but free web hosts usually suck. :)
User avatar
d3th_n1gG4
Gnome
Posts: 346
Joined: Thu May 19, 2005 10:32 am
Location: Durban, South Africa, No London, wait, where?

Post by d3th_n1gG4 »

yep getting a 404 as well
The cow it goes: "Shjazooo!"
User avatar
IFASS
Gnome
Posts: 387
Joined: Tue Jan 04, 2005 12:07 pm
Location: Netherlands

Post by IFASS »

same here
Image
User avatar
danharibo
Minaton
Posts: 997
Joined: Sat Feb 25, 2006 8:14 pm
Location: Wales, United Kingdom

Post by danharibo »

NOOOOOOOOOO 404!
User avatar
abstractcoder
Gnome
Posts: 336
Joined: Wed Oct 12, 2005 1:50 pm
Location: UK

Post by abstractcoder »

if its that small why dont you just add it to the wiki :) or i would be willing to host it on my website if not. just email it me if you want to.
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 534

Post by Kojack »

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)
User avatar
abstractcoder
Gnome
Posts: 336
Joined: Wed Oct 12, 2005 1:50 pm
Location: UK

Post by abstractcoder »

works fine for me now, shame we didnt have this a while ago. it would have been very useful as i am useless with modelling programs.

ive also just reinstalled windows too :), i hate installing everything. i even have to install two copies of VS as source sdk will only run on VS 2003 :(
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 534

Post by Kojack »

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. :)
Slicky
Bronze Sponsor
Bronze Sponsor
Posts: 614
Joined: Mon Apr 14, 2003 11:48 pm
Location: Was LA now France
x 26

Post by Slicky »

Just a thought - but how hard would it be to export to a collada file format?

It seems to me that being able to bring the asset into other 3d apps would be cool.
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 534

Post by Kojack »

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.
Slicky
Bronze Sponsor
Bronze Sponsor
Posts: 614
Joined: Mon Apr 14, 2003 11:48 pm
Location: Was LA now France
x 26

Post by Slicky »

Kojack 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.
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 are :o
ggunhouse
Kobold
Posts: 28
Joined: Tue May 17, 2005 2:10 pm
Location: Atlanta, Georgia

Post by ggunhouse »

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:

Image

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
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 534

Post by Kojack »

Cool. :)

All the models I tested had no transparent objects objects occluded by non transparents due to backface removal, so I didn't notice the material bug. I'll fix it in Version 1.0.1.
ggunhouse
Kobold
Posts: 28
Joined: Tue May 17, 2005 2:10 pm
Location: Atlanta, Georgia

Post by ggunhouse »

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:

Image

and here is the exported OGRE mesh viewed in Blink:

Image

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
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 534

Post by Kojack »

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.
stuartf
Gnoblar
Posts: 13
Joined: Thu Aug 04, 2005 8:12 pm

Post by stuartf »

Hi Kojack

Your sketchup exporter is brill - thanks - using like glenn to convert to Blink.
Slicky
Bronze Sponsor
Bronze Sponsor
Posts: 614
Joined: Mon Apr 14, 2003 11:48 pm
Location: Was LA now France
x 26

Post by Slicky »

I tested a file on Google's 3d site and it worked well. One problem was that a window made it possible to see all the way through the object. The inside wall did not show. I will look for the file again if needed.
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 534

Post by Kojack »

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.
User avatar
jmonw
Goblin
Posts: 232
Joined: Sat Apr 23, 2005 3:21 am
Location: Atlanta, GA

Post by jmonw »

Just for reference: the exporter works in the pro version (at least up to version 5.0.232 - don't know what the newest is)

Thanks very much for the great work!
User avatar
syedhs
Silver Sponsor
Silver Sponsor
Posts: 2703
Joined: Mon Aug 29, 2005 3:24 pm
Location: Kuala Lumpur, Malaysia
x 51

Post by syedhs »

@Kojack,

When can we get your updated plugin? Nothing urgent.. I am still not testing it.. but sounds wonderful.
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66

Post by sinbad »

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?
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 534

Post by Kojack »

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. :)