sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    [Plugin] OBJexporter v3.0 20130131

    Scheduled Pinned Locked Moved Plugins
    304 Posts 96 Posters 451.3k Views 96 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • thomthomT Offline
      thomthom
      last edited by

      @tig said:

      The D.P. accuracy is not now applied to 'whole numbers', and any -0 values becomes 0.

      What made you chose to do this? Are there applications that doesn't handle these values well? I'm curious because I've been looking at the OBJ format this weekend.
      (Is there an official specification somewhere? I find multiple sources around...)

      Thomas Thomassen β€” SketchUp Monkey & Coding addict
      List of my plugins and link to the CookieWare fund

      1 Reply Last reply Reply Quote 0
      • pilouP Offline
        pilou
        last edited by

        See the external links at the end of the page πŸ˜„

        Frenchy Pilou
        Is beautiful that please without concept!
        My Little site :)

        1 Reply Last reply Reply Quote 0
        • thomthomT Offline
          thomthom
          last edited by

          @unknownuser said:

          See the external links at the end of the page πŸ˜„

          Is that the official specs though? "martinreddy.net" ...

          Thomas Thomassen β€” SketchUp Monkey & Coding addict
          List of my plugins and link to the CookieWare fund

          1 Reply Last reply Reply Quote 0
          • TIGT Offline
            TIG Moderator
            last edited by

            @thomthom said:

            @tig said:

            The D.P. accuracy is not now applied to 'whole numbers', and any -0 values becomes 0.

            What made you chose to do this? Are there applications that doesn't handle these values well? I'm curious because I've been looking at the OBJ format this weekend.
            (Is there an official specification somewhere? I find multiple sources around...)
            It just minimizes the OBJ file size, an importer reads 0 as 0.0, so making it 0.000000 is pointless, -0==0 so it might as well be 0 !... so all trailing zeros are now omitted, it speeds up the writing by a few % and I also the importing at the 3rd party end...
            There's an OBJ Wavefront Wiki...

            TIG

            1 Reply Last reply Reply Quote 0
            • thomthomT Offline
              thomthom
              last edited by

              Are you sure all importers manage to read an int instead of a float which the specs appear to indicate? Just wondering in case the parsing is implemented in a stricter language...

              @tig said:

              I also the importing at the 3rd party end...

              Something missing from that sentence? πŸ˜•

              @tig said:

              There's an OBJ Wavefront Wiki...

              This one? http://en.wikipedia.org/wiki/Wavefront_.obj_file

              Thomas Thomassen β€” SketchUp Monkey & Coding addict
              List of my plugins and link to the CookieWare fund

              1 Reply Last reply Reply Quote 0
              • TIGT Offline
                TIG Moderator
                last edited by

                I have used OBJ files exported like this in many apps [Octane, Blender, MeshLab, MeshMan, AC3D etc] and they all import just fine.
                As far as I can tell they expect a 'number', so 0 == 0.0 == 0.000000 etc, 1 == 1.0 == 1.000000...
                They even take -0 == 0 when -0 is not really a number.
                I also trap for 'NaN' and 'Infinity' which would break them...
                Sharing vertex data is also permissible if you correctly reference the vertices.

                Try it yourself using a box that is located at, and offset from, the ORIGIN by whole 'meter' distances. The native OBJ exporter using m/triangulation, flipped-YZ etc gives a similar result to my 'free' tool BUT 1.000000 >> 1 in mine... Now import the two OBJ files into an app like Blender and you get the exact same result... If you make the two much more complex you'll find mine loads into the app a tiny % faster. Of course it takes longer to write the file because the native exporter is a swifter exe...

                TIG

                1 Reply Last reply Reply Quote 0
                • thomthomT Offline
                  thomthom
                  last edited by

                  There are no way to define faces with holes in OBJ, is it?

                  I see that OBJ files can support bezier patches - which is interesting for Bezier Surface.

                  Thomas Thomassen β€” SketchUp Monkey & Coding addict
                  List of my plugins and link to the CookieWare fund

                  1 Reply Last reply Reply Quote 0
                  • M Offline
                    Mra
                    last edited by

                    I'm getting a crash during export, albeit its a large file, the obj gets up to about 5mb and sketchup crashes without warning.

                    I'm aware this would be highly scene dependant but is there anything I can do? I'd be happy to send in a scene somewhere for debug. πŸ˜„

                    1 Reply Last reply Reply Quote 0
                    • C Offline
                      chuckasaki
                      last edited by

                      Firstly thanks for such a great plugin. I think it's a big rough that google want us to go all the way to 500 bucks for an obj export, something that could be considered pretty standard, and clearly exporting means that they may not even need all sketchup pros power as the model will be used elsewhere. I'd would love to see a slightly less expensive option, cos I ain't going to 5 without a good reason.
                      Having said that... I don't want to seem like someone whining about a freebie for sure, I think what you done is great..... but I can't get an export that works.
                      The model goes some way and then crashes- bugsplat . I can open the obj...sure.. but only half of it comes in.
                      Is your plugin still compatible?
                      If I can get results I will definitely donate.
                      😒

                      1 Reply Last reply Reply Quote 0
                      • TIGT Offline
                        TIG Moderator
                        last edited by

                        As I have no way of knowing what it is you are trying to do then I don't have the feintest idea what's up.
                        My exported OBJ files have proved to be compatible with all of the standard apps that can import such files.
                        Have you tried exporting a simple box and seeing if that works...

                        Bugsplats during the export are very rare, if the SKP is large with complex geometry etc it can take a while to complete; so don't confuse a white-out with a 'crash'!
                        When Sketchup is doing intensive calculations it sometimes looses its screen focus and says it's 'unresponsive'.
                        However, it is still beavering away in the background writing the OBJ data etc.
                        Leave it alone until it's completed its tasks.
                        If you run it with the Ruby Console open do you get any error messages ?

                        If you still have issues and it's not just your impatience that's aborting things... then can you post [or PM] a sample of a SKP that is failing, so I can look at it...

                        For example do you have anything peculiar about your SKP files?
                        Like very small geometry, or very large geometry, edges and no faces, oddly grouped geometry, oddly layered faces/edges etc etc... ???

                        TIG

                        1 Reply Last reply Reply Quote 0
                        • cottyC Offline
                          cotty
                          last edited by

                          @chuckasaki said:

                          ... google want us to go all the way to 500 bucks for an obj export

                          It's not google anymore πŸ˜‰

                          my SketchUp gallery

                          1 Reply Last reply Reply Quote 0
                          • M Offline
                            mommykathy
                            last edited by

                            Thank You, Thank You, Thank You! Been going nuts trying to find something to do this and this is PERFECT. Have a great day!

                            1 Reply Last reply Reply Quote 0
                            • McGyverM Offline
                              McGyver
                              last edited by

                              Hi! I'd like to thank TIG once again for this truly awesome plugin as well as all the subsequent updates.
                              I frequently recommend this plugin for people who are new to SketchUp, showing them that their modeling efforts can be used in other programs besides SketchUp.
                              A lot of people tend to believe that SketchUp is very limited, has no export options for the free version and are not aware of all the amazing plugins that extend SU's capabilities and give it greater power.
                              I was just writing a short "How to" for people who wish to use their models in Poser/DAZ studio, but it occurred to me that while I giving instructions on how to install a ruby script such as "OBJexporter" I was not sure if there were any other plugins that needed to be installed for OBJexporter to work properly... I have quite a few and the thought came to me when I was describing the progress bar and "Model exported in X# of seconds" features... so I figured I'd ask-

                              Does OBJexporter require any other plugins such as Progressbar.rb to function properly?

                              Thats probably a pretty stupid question, but before I tell someone how something works, I figured I should probably include any relevant additional information.

                              Thanks in advance for any information any of you can provide!

                              [Visit My ShareCG Freebie Gallery](http://www.ShareCG.com/pf/full_uploads.php?pf_user_name)

                              1 Reply Last reply Reply Quote 0
                              • TIGT Offline
                                TIG Moderator
                                last edited by

                                My OBJexporter code is 'self-contained'.
                                It only 'requires' sketchup.rb, and that is installed by SketchUp itself in the Tools folder...
                                The progress reporting etc is built-in to my code and needs no 3rd party helpers...

                                TIG

                                1 Reply Last reply Reply Quote 0
                                • McGyverM Offline
                                  McGyver
                                  last edited by

                                  Thank you once again!

                                  [Visit My ShareCG Freebie Gallery](http://www.ShareCG.com/pf/full_uploads.php?pf_user_name)

                                  1 Reply Last reply Reply Quote 0
                                  • T Offline
                                    the_bored_gamer
                                    last edited by

                                    Hi, I press the OBJexporter button... then it ask to "convert all to png?".
                                    Wether I press Yes or No, I get nothing, it just close. Please help!

                                    1 Reply Last reply Reply Quote 0
                                    • TIGT Offline
                                      TIG Moderator
                                      last edited by

                                      Run with the Ruby Console open: this will report progress etc...
                                      Tell us any error messages.
                                      If you are working with a Selection it must contain Faces...

                                      Are no files [OBJ/MTL] or textures' folder made at all ?
                                      Do you have permissions to make files in the destination folder etc??

                                      TIG

                                      1 Reply Last reply Reply Quote 0
                                      • F Offline
                                        FantasyZone
                                        last edited by

                                        OMG TIG!!!!!!!
                                        I searched for a month a obj exporter for SketchUp and now I found your Obj Exporter an made an extra account on sketchucation just to download it and at last it worked!!!!!!!!!!!!! I am so happy now thank you for this FREE(!) ObjExporter

                                        FantasyZone 😍
                                        PS. TAHNK YOU!

                                        1 Reply Last reply Reply Quote 0
                                        • A Offline
                                          anar
                                          last edited by

                                          Thanks TIG for this plugin.

                                          It seems that groups are not exported with their SKP names.
                                          For example if my group is named "Cylinder" the exported group name is "test-GRP-Cylinder-566-Color_A01" which is a bit annoying because I have to rename all my groups after exporting.

                                          Also if I make a group with name "Level1" that contains 2 groups with names "Level2_A" and "Level2_B" without any other geometry, the group "Level1" won't export in the OBJ file.
                                          Therefore ther is only one level of hierarchy exported...
                                          Can it be a limitation of the OBJ format by itself ?

                                          Cheers !

                                          1 Reply Last reply Reply Quote 0
                                          • TIGT Offline
                                            TIG Moderator
                                            last edited by

                                            Anar

                                            The 'grouping' in the OBJexporter file format is effectively 'by material'.
                                            Each facet has a assigned a group based on:

                                            ModelName-ContainerType-Name-ID-MaterialName

                                            As Group names are no unique and Components can have multiple instances the ID is needed.

                                            So for your:

                                            test-GRP-Cylinder-566-Color_A01

                                            Working right to left the geometry is thus...

                                            MaterialName = Color_A01 [the Material's name, adjusted so its characters are OBJ compliant]
                                            ID = 566 [assigned by SketchUp for the container's definition, during that session]
                                            Name = Cylinder [the Container's name, adjusted so its characters are OBJ compliant]
                                            ContainerType = GRP [Group]
                                            ModelName = test [the Model's name, adjusted so its characters are OBJ compliant]

                                            Note that if you had say 'Black' end facets then they would grouped separately as:

                                            test-GRP-Cylinder-566-**Black**

                                            TIG

                                            1 Reply Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 10
                                            • 11
                                            • 12
                                            • 13
                                            • 14
                                            • 15
                                            • 16
                                            • 12 / 16
                                            • First post
                                              Last post
                                            Buy SketchPlus
                                            Buy SUbD
                                            Buy WrapR
                                            Buy eBook
                                            Buy Modelur
                                            Buy Vertex Tools
                                            Buy SketchCuisine
                                            Buy FormFonts

                                            Advertisement