Importing obj/dae from Sketchup

3998
11
10-11-2012 02:11 PM
JoanneO_Brien
Occasional Contributor
So I've been attempting to import some models into the new CityEngine 2012.1 from Sketchup and have been running into some issues.

1) Firstly, when I import as an obj file it looses all my textures.
2) When I bring it in as a collada dae it maintains most of the textures (although the glass seems to come out wrong) but it also has all the excess lines from sketchup which I don't really want in my model. (Note: I am not bringing the models in as static because I want to be able to modify part, does this make a difference?)
3) Had another issue with collada in that I brought a model through which was fairly large but as soon as I imported it, my cityEngine closed. It did this twice so I'm really not sure what was wrong with that import. When I reexported it as a smaller model from Sketchup and imported it it seemed to work, is there a file limit on imports or something?
4) Also when I imported two models that I'd exported from Sketchup seperately into CityEngine the buildings were imported at different heights, why was this?
5) Also am still having issues with importing them at the correct projection.

Thanks! :)

Joanne
0 Kudos
11 Replies
MatthiasBuehler1
Frequent Contributor II
hi ..

1]
- did you also copy the .mtl file ?
- did you check the file paths in the .mtl file ?

2]
- what's excess lines ?
- try to really edit the model in SketchUp to it's final form you use in CE:
-- When using as Shapes, you usually are mostly interested in the geometry for further usage with CGA
-- When using as Static Models, the 3d Model should already be final and done.

3]
- there's no file limit
- can you send me the file or point me to the file on the web somehow ?

4]
- no idea .. :) would need to test this myself too.
- did you import as static model or shapes ?

5]
- correct position = georeferenced position ? if yes, use KML files.


Let me know !
0 Kudos
JoanneO_Brien
Occasional Contributor
1) Both the obj and mtl files are saved in the same location (you can see the image in my first screen shot with the lack of textures)
2)When I talk about excess lines I mean all the diagonal lines you can see in the second Screen Shot, this image looks finalised without any lines in sketchup but in collada all these lines appear.
3)I no longer have this file (although I do have the error reports if that helps?) but i'll see if  I can replicate it again and send you the files.
4) I imported these as static models, you can see it in the third screen shot. The blue line circles the difference in heights, the red line circles an area which might be the cause, this is mean to be an underground carpark but when it is imported it looses the location and seems to bring it up to groundlevel...hence the differences in height. Is there a way for it to know that that section is meant to be underground?
5)I've finally managed to bring in kmz files in the right location :)

Thanks!
0 Kudos
MatthiasBuehler1
Frequent Contributor II
Hey there ..

1]
If CE does not find the texture, either the texture is actually missing or the file path to it is wrong.

Use the standard file navigation conventions :
Examples:
images/myTexture.jpg                --> CE will search the image in the images folder.
images/myFolder/myTexture.jpg   --> CE will search the image in images/myFolder.

I assume this is the issue, so please double check both the paths and if the textures really are there. CE does not search further than that given path. Subfolders are NOT checked.

If you open a COLLADA file in a text editor and search for the file paths, you can also see this:
../myFolder/myTexture.jpg

'..' means go up one directory, then go to the folder called 'myFolder' to find the file. That structure would be used if the collada file is in 1 folder and it's textures in an other. Adapt all those paths according to your file structure if CE does not find them.

TIP :
'Search and Replace' works also over multiple files with some text editors. E.g. with the free tool called 'NotePad++'  ( http://notepad-plus-plus.org/ ) , you can search and replace texts in folders and subfolders, editing 100s of files if needed !

2]
Those 'excess lines' are the edges of the polygons which result from the triangulation process you did specifically at the export from SketchUp. All polygons which have more than 3 edges will be broken down into triangles, which then get displayed of course in CE.

Triangles can be ignored if they're on Static Models, but if the assets are imported as Shapes, they're not so cool. For this, in 2012 a new 'Cleanup Shapes' tool was introduced for this precise step. Use this to un-triangulate the geometries again in CE. Note that the topology is probably a little different than in SketchUp.
Check the little screenshot from the toolbar where you find the tool.

3]
Better I get the file if the problem continues. Or a similar file in future. Let's see then.. :)

4]
Ah .. Separate files get aligned in height individually. This automatic behavior is not optimal in all cases. Try to combine those files in 1 file.

5]
YAY ! :)


Let me know how it goes !

Matt
0 Kudos
JoanneO_Brien
Occasional Contributor
1) Thanks for that info, I'll have a little play around with it and hopefully get it all working!

2) That's a useful tool to know! Does solve some issues but unfortunately not all. In order for me to get the current models from sketchup into the correct geolocation I was exporting the models as collada and reimporting them into sketchup to place in the correct geolocation. Once I was satisfied with the location I exported it as a kmz file and imported it into cityengine. The issue is that because it wasn't imported as Collada in cityengine that cleanup tool cannot be used on it. Would you know the best format to export and reimport a model into sketchup to apply the geolocation functions on it other than collada?

3)I was going through my models and I found that file which was causing this issue but the zip file is too large to attach, it's 4.62MB. Is there an email address I could send it to you through?

Thanks for all your help!

Regards

Joanne
0 Kudos
JoanneO_Brien
Occasional Contributor
3) Actually this just happened to me again but this time with a kmz file rather than a collada file. I tried to import the file which I'd just exported from sketchup and CE closed instantly. I was able to bring in the exact same model as a collada dae although this brings it into the wrong location of course, so am not sure why some files are forcing CE to close!

I tried exporting it from sketchup again and importing it into CE, this time I got as far as it asking what the coordinate system was, and when I selected mine it shut down, quite frustrating!

Unfortunately this kmz file is also too large to attach on the forum but should be fine to send as an email attachment.
0 Kudos
MatthiasBuehler1
Frequent Contributor II
hi !

mail address : see PM.


1]
An other thing to do: Import the kml file as Static MODEL in the scene, then it's placed correctly. Then convert this model to a Shape with RMB> Convert Models to Shapes.

The option to import kml files directly as shapes just was never implemented. Noted this down.

2]
You could also use ArcGIS to convert the model to a textured MultiPatch in a GDB. That would be an other option, but is obviously more work.


Ok ?
0 Kudos
JoanneO_Brien
Occasional Contributor
On hindsight this thread should probably be in import/export...

anyway any news on those files that are causing my CE to close? It seems I can't import any kmz file, every one I've tried instantly shuts down CE, so as a result it gets very frustrating!
0 Kudos
JoanneO_Brien
Occasional Contributor
New query as well (sorry about all the questions!)

So When I import as collada dae from sketchup why are not all my textures included? Check out the image attached. Basically this building should have all the roof the same texture (this is what it is in sketchup) but as you can see when it's imported some of the roof's turn up blank! how can I fix this?

thanks!!!
0 Kudos
MatthiasBuehler1
Frequent Contributor II
On hindsight this thread should probably be in import/export...

anyway any news on those files that are causing my CE to close? It seems I can't import any kmz file, every one I've tried instantly shuts down CE, so as a result it gets very frustrating!


Hi ..

I had sent you a mail with a first reply on Oct 25th .. Let me know if you did not get it ..

:)
0 Kudos