jacobmake

I have creative ADD

jacobmake header image 2

Papervision 2.0 Collada Import DAE from Sketchup

April 18th, 2008 · 12 Comments · Code

Papervision Collada Import

I’ve been working how to get models from Google Sketchup to Papervision. They currently are working on Collada parsers specific to Sketchup. That should make textures a tad bit easier. Until then;

Here is a link to the source code and a working example.

Tags: ···

12 responses so far ↓

  • 1 cstockman // Jun 9, 2008 at 1:24 pm

    Where did you get your Collada parser specific to Sketchup? Did you make it yourself?

  • 2 jacobmake // Jun 9, 2008 at 5:40 pm

    This example uses the DAE parser. Some people were working on parsers for the Sketchup format.

    How to get a usable DAE file out of Google Sketchup for PaperVision3d.

    1. Build your model in Google Sketchup (free version is fine)
    2. When your model is ready to go; File > Export, export as Google Earth KMZ file.
    3. Change “.kmz” extension of exported file to “.zip”
    4. Unzip package and find DAE file

    I’m not sure what the status is with the SketchUp parser, you might snoop through the latest build to see if anything got committed.

  • 3 Kiyoshii // Sep 25, 2008 at 8:11 am

    Hello,
    Nice example.
    i have imported my own .dae file into your example.a more complex one with multole objects.
    i was trying to acsess an idividual objec within the new DAE () Object but with no sucsess…

    i tryed :

    var store:DisplayObject3D = holder.getChildByName(“Loja1″);

    do you how this is done ?

    thx.

  • 4 ge5 // Dec 3, 2008 at 3:34 pm

    no matter what i try the sketchup exports a .kmz and if i zip/unzip this it remains a .kmz and does not access any .dae info–are you using the “pro” version? my kmz files keep showing up in my FLA as wireframes/no materials/bitmaps export…any help?
    tHanks! ge5

  • 5 jacobmake // Dec 4, 2008 at 8:17 pm

    @ge5

    I was not using the pro version. You don’t have to necessarily “zip” or archive the file, Google creates the package. Uou should be able to just change the file name extension to “zip”. Then unzip it.

    The support for materials and bitmaps were non-existent when I wrote this. I think the best bet for that might be the Blender importer, but Sketchup has a much easier learning curve than Blender.

    Also, Sketchup has come out w/ a new version, which I haven’t tested with this method.

  • 6 jacobmake // Dec 4, 2008 at 8:32 pm

    @Kiyoshii

    var store:DisplayObject3D = holder.getChildByName(”Loja1″);

    In your example here, what kind of object is “Loja1″? It looks like getChildByName() is a supported method. Is Loja1 also a DisplayObject3d when it’s created?

  • 7 Frank // Dec 17, 2008 at 11:59 am

    @ge5

    (and all the other Sketchup version 6.+ users):

    You have to export as “Sketchup 5 kmz” format to have the DAE in the ZIP. I do not know why they did not implement the DAE in version 6+ kmz file format.

    Just starting my Papervision experience and stumbled upon this helpful blog. Thank you jacobmake!

  • 8 Alex Dobbs // Dec 28, 2008 at 2:26 am

    dude, you really should try making some models with Blender!!!!

    there is a collada export built right into Blender so you can poop the .dae files right out and plop them into your papervision engine

    I’m still learning the finer points of how this al works…. BUT!!! I did figure out this blender business is pretty simple as far as generation of Collada is concerned….

    ALSO

    Collada can not only transfer model data but it also can transfer a lot of other important data for material and physics and kinematic structure…. the trick is to make sure you have crossed all quad planes into triangles on your model so papervision doesn’t have a nervous break down…. (papervision is afraid of 4th corners on faces…. which makes sense because there is no subsurf generation in the engine, runtime of AS3 as of now couldn’t handle that… errrr or I’m sounding like an idiot now.)

    BARE IN MIND I only kinda know what I’m talking about….

    but yeah I’ll send you my links of materials and stuff….

    when you get blender google this kid super3boy

    this little 13 year old made some youtube tutorials that you can use to get enough modeling skills to make really nice models in Blender in a couple hours… it helps to have 2 computers or 2 monitors so you can have the video playing while you work in blender so you can follow along better….

    ALSO reading up on the Collada and what is is and where it came from is interesting and also informative at your range of use of this amazing tool…

    did you know it was invented for developing for the PS3 by sony? and afterwards was acquired by a open source company or something….

    Collada is also an evolving open source project.

    sketchup is a nice little toy but Blender is actually a powerful tool which is really wonderful to use, free, open source and is really about on par with maya in terms of power, modeling and rendering ability….

    but everything you need is there.

  • 9 jacobmake // Dec 29, 2008 at 11:58 pm

    @Alex – Thanks for the comments. I’ve tinkered around w/ Blender. Your right, it’s much more powerful than Sketchup, but I think some folks get scared off by the interface. I come from a 3-d background (Lightwave) and I found Blender to be a little more difficult to pickup vs. Sketchup, but probably worth the effort if someone wanted to invest the time.

    I did not know the history of the Collada file, thanks for sharing. It seems to be evolving and more and more 3d apps are allowing Collada exports which should soon make it easy to get PV3d models & textures from the apps of your choice.

  • 10 flamander // Mar 6, 2009 at 1:27 pm

    hi! quick question… how do I play an animation collada loaded by the parser?

  • 11 augusto // Jul 14, 2009 at 10:50 pm

    hello!! i sorry but my english is poor, i´m a brazillian programmer, and i start to create some projects with papervision3d, but i don´t have many experience with this language, can you help me? i see your tutorial and i have some questions… how i change dae to pv3d? with a flash component? i have a component to flash cs3, but doesn´t works correctly, he don´t create the code perfectli… what the programm i use do this? thanks for time…
    my email is guto@solucaobusiness.net

  • 12 David // Nov 15, 2009 at 10:37 am

    Hi, firstly id like to say this is really cool!
    I have a problem though, I downloaded your copy you have provided but when I compile it I get a few errors;

    Pultizer3d.as Line 39 – 1067: Implicit coercion of a value of type org.papervision3d.objects:DisplayObject3D to an unrelated type Number.

    Pultizer3d.as Line 58 – 1136: Incorrect number of arguments. Expected 0.

    Pultizer3d.as Line 64 – 1137: Incorrect number of arguments. Expected no more than 3.

    viewportLayer.as Line 76 – Warning: 3590: void used where a Boolean value was expected. The expression will be type coerced to Boolean.

    sophere.as Line 122 – Warning: 3590: void used where a Boolean value was expected. The expression will be type coerced to Boolean.

    Why am I getting these errors? I would like to develop this further but I’m stuck at the first hurdle :(

    please help me out…

Leave a Comment