• Login
sketchucation logo sketchucation
  • Login
πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

[Plugin] OBJexporter v3.0 20130131

Scheduled Pinned Locked Moved Plugins
304 Posts 96 Posters 451.3k Views
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.
  • T Offline
    T_Osborn
    last edited by 24 Nov 2012, 20:19

    Is it inevitable, technically speaking, that SU geometry Group and Component associations are lost when exporting to an OBJ file? What I tried to do was open a SU model (interior room scene) in Blender so as to try and work with Blender's rendering features. Discreet objects within the SU outliner--entertainment center cabinet, wall(s), floor, mouldings, plantation shutters--were no longer discreet objects in Blender's outliner. In Blender's outliner there was only a very long list of 'meshes'. The model/scene itself displayed properly in Blender's viewport. If I placed the cursor over what had been the 'cabinet' in SU, then clicked to select, only a single mesh among the many comprising the cabinet would be selected. There was no practical way to determine which among the hundreds of meshes in the outliner were those that comprised the cabinet exclusively, and so I could not select it individually so as to make material assignments (color, sheen, and all that).

    1 Reply Last reply Reply Quote 0
    • T Offline
      TIG Moderator
      last edited by 24 Nov 2012, 20:49

      Much as with the Pro OBJ Exporter the geometry [mesh] is broken down by 'loose/group/component/image' and then within each of those subdivided 'by material'. So if you have a box-component with a different colored 'lid', then the component's mesh is inside a single 'container' [named after the original object], and its two meshes are made with their respective materials. Nested objects' container naming reflects those containers...

      TIG

      1 Reply Last reply Reply Quote 0
      • T Offline
        T_Osborn
        last edited by 24 Nov 2012, 21:58

        @tig said:

        Much as with the Pro OBJ Exporter the geometry [mesh] is broken down by 'loose/group/component/image' and then within each of those subdivided 'by material'....

        OK, I can see something of this now in Blender's outliner. After expanding the size of the outliner window, I do see that each mesh is identified as part of a component or group, or with the component name ('crown moulding') and material name. I just needed more screen space to reveal all of the text. I'm embarrassed, but Blender's interface is difficult for a modeling noob after a little time spent in SU.

        I think I can more effectively combine the relevant meshes into the singular objects they were meant to be, but it still will be tedious.

        1 Reply Last reply Reply Quote 0
        • A Offline
          andybot
          last edited by 25 Nov 2012, 01:40

          @t_osborn said:

          @tig said:

          Much as with the Pro OBJ Exporter the geometry [mesh] is broken down by 'loose/group/component/image' and then within each of those subdivided 'by material'....

          OK, I can see something of this now in Blender's outliner. After expanding the size of the outliner window, I do see that each mesh is identified as part of a component or group, or with the component name ('crown moulding') and material name. I just needed more screen space to reveal all of the text. I'm embarrassed, but Blender's interface is difficult for a modeling noob after a little time spent in SU.

          I think I can more effectively combine the relevant meshes into the singular objects they were meant to be, but it still will be tedious.

          That's correct, the OBJ exporter organizes the model by material, so everything with a material, even if it's in different components or groups will come in as one "mesh" into Blender. If you want your component and group heirarchy to be maintained, the best way is to use the 3DS exporter that's available in the pro SU version.

          Andy

          http://charlottesvillearchitecturalrendering.com/

          1 Reply Last reply Reply Quote 0
          • L Offline
            Lana
            last edited by 8 Dec 2012, 06:16

            God bless you . Thank you. 😍

            1 Reply Last reply Reply Quote 0
            • B Offline
              bomastudio
              last edited by 18 Dec 2012, 15:56

              TIG: thank you for all the plugin you share with all of us!!!! 😍

              A question: this plugin (well, OBJ format) can export cameras positions?
              Thanx.

              1 Reply Last reply Reply Quote 0
              • T Offline
                TIG Moderator
                last edited by 18 Dec 2012, 16:00

                No, OBJ format is for geometry only [faces] and their associated materials/textures.
                Some formats like DXF include data on the camera.
                There are some tools in the API to get a scene's view camera data, but after that it depends on the program into which you want to import that data, on how it can be suitably structured...
                What did you have in mind ?

                TIG

                1 Reply Last reply Reply Quote 0
                • B Offline
                  bomastudio
                  last edited by 18 Dec 2012, 16:12

                  Well I need to bypass the Octane exporter (as I use Ubuntu/Lubuntu+wine+SkecthUp) and the webdialogs doesn't work no more (with SU6 webdialog worked....). So exporting in OBJ format I can solve model+texture troubles, but I need to export also the scenes (cameras).

                  1 Reply Last reply Reply Quote 0
                  • T Offline
                    TIG Moderator
                    last edited by 18 Dec 2012, 16:22

                    So this is an Octane based query... only peripheral to Sketchup.
                    There are already two tools available on the Octane Sketchup forum for licensed users.
                    You need 'OctaneOCMbatchExporter.rb' - the tools allow you to batch-export your scenes' cameras and suns/shadows settings into Octane OCM files, which can then be loaded and used as 'nodes' in the matching OCS file, that you have made from the SKP exporter via OBJ/MTL files etc.
                    That forum's thread is named "Batch Cameras / Suns OCM Exporter v1.0"

                    TIG

                    1 Reply Last reply Reply Quote 0
                    • B Offline
                      bomastudio
                      last edited by 18 Dec 2012, 18:01

                      TIG, you are definitively the best source of info about SU!!!! thanx, how would I do without you? πŸ˜„ πŸ˜„

                      1 Reply Last reply Reply Quote 0
                      • E Offline
                        eubz
                        last edited by 25 Dec 2012, 04:31

                        nice. i love this exporter.

                        1 Reply Last reply Reply Quote 0
                        • S Offline
                          sceptile
                          last edited by 12 Jan 2013, 22:23

                          says the file can amage my computer?

                          1 Reply Last reply Reply Quote 0
                          • T Offline
                            TIG Moderator
                            last edited by 12 Jan 2013, 23:26

                            @sceptile said:

                            says the file can amage my computer?
                            Let us assume you mean 'damage'...
                            Who, what where, when, why and how ?
                            Yours might win this week's prize for the most useless error report / query... πŸ˜’

                            TIG

                            1 Reply Last reply Reply Quote 0
                            • S Offline
                              sceptile
                              last edited by 13 Jan 2013, 07:27

                              and i cant find the plug in folder i have sketchup 8 free where is it? thanks

                              1 Reply Last reply Reply Quote 0
                              • T Offline
                                TIG Moderator
                                last edited by 13 Jan 2013, 10:29

                                @sceptile said:

                                and i cant find the plug in folder i have sketchup 8 free where is it? thanks
                                Your questions get little clearer, and also show that maybe you aren't yet ready for using scripts...
                                There are extensive Sketchup Help files available to you.
                                For example under the Sketchup main menus Help > Learn About Plugins... opens a link which tells you exactly how to install Plugins etc...

                                Also you have not yet explained the '[d]amage' statement that you made earlier... πŸ˜’

                                TIG

                                1 Reply Last reply Reply Quote 0
                                • T Offline
                                  TIG Moderator
                                  last edited by 13 Jan 2013, 10:29

                                  @tig said:

                                  @sceptile said:

                                  and i cant find the plug in folder i have sketchup 8 free where is it? thanks
                                  Your questions get little clearer, and also show that maybe you aren't yet ready for using scripts...
                                  There are extensive Sketchup Help files available to you.
                                  For example under the Sketchup main menus Help > Learn About Plugins... opens a link which tells you exactly how to install Plugins etc... Giving the full paths for PC and MAC,

                                  Also you have not yet explained the '[d]amage' statement that you made earlier... πŸ˜’

                                  TIG

                                  1 Reply Last reply Reply Quote 0
                                  • S Offline
                                    Sound
                                    last edited by 25 Jan 2013, 18:50

                                    Hello TIG, thank you for writing such an useful plugin. I look forward for using it in a 3D printing workflow but I noticed two problems - the first one being more serious.

                                    1. Draw a cube and export it as OBJ. It contains 16 triangle facets, but I would expect 12. If you inspect the generated OBJ you'll notice that it generated a tetrahedron inside the cube by triangulating the internal space. Hence the four more facets. I think this problem needs to be addressed. What do you think about it?

                                    2. Resulting OBJ files contain lots of duplicate vertices. I think this is because you don't reuse vertices but you generate new ones all time. However this corrupts the topology of the generated OBJ file. If you open it with, say, Netfabb Studio Basic (a popular free utility for 3D printing) it will report all faces as unconnected. I don't know whether SketchUp API associates a unique ID with each vertex; in case it doesn't I think you could just build your own dictionary based on coordinates and check whether you already wrote that vertex and if so, just reuse its index when defining the new facet.

                                    Thank you for your work, and I really hope you can fix these two things.

                                    1 Reply Last reply Reply Quote 0
                                    • T Offline
                                      TIG Moderator
                                      last edited by 25 Jan 2013, 20:43

                                      @Sound

                                      I am afraid you are mistaken. πŸ˜•
                                      I have tested this extensively and a cube of 6 faces exports as a cube of 12 facets, because they are each triangulated.
                                      You can clearly see it in the OBJ code.
                                      If I import the OBJ it then arrives with 12 triangulated faces too.
                                      this occurs with many OBJ importing apps.

                                      IF you triangulate the faces manually before exporting you can create internal 'partitions' inside the cube depending on the order the diagonals are drawn, this should only make more that the visible 12 faces πŸ˜•

                                      So this suggests there is something wrong with your initial cube if it indeed has 16 facets when exported, or alternatively something wrong with the app into which you are importing it? There are many apps that import these OBJ files quite acceptably without new facets or complaints about unconnected facets...
                                      What are you using to import it ?

                                      The code takes faces in the same context using the same material, triangulates them as necessary and produces the facets to suit. This tool is used as the basis of several rendering apps. The Pro OBJ exporter exports a simple cube with a file that is all but identical to this tool's file, so I don't think there's anything wrong with it...

                                      Try the Pro version OBJ exporter and see it's the same...

                                      I suspect you are either mis-modeling the cube beforehand OR not using appropriate import settings and getting spurious results... I suggest you make an OBJ made from a 1m cube in the positive quadrant of the axes, bb.min at [0,0,0]. Then compare it with mine in the ZIP, which only has 12 facets...


                                      obj.zip

                                      TIG

                                      1 Reply Last reply Reply Quote 0
                                      • S Offline
                                        Sound
                                        last edited by 26 Jan 2013, 10:54

                                        Thank you for the answer. Yes, it looks like those internal faces were already in SketchUp. A new test shows 12 facets, and that's fine.

                                        Still, the other problem persists. Even when the exported cube results in 12 facets, the file contains 24 vertices (you can check this by opening the OBJ file with Meshlab or any other importer, or even by counting the "v" lines in the OBJ file). This looks very wrong, as the original geometry only has 8 vertices. Can you help me about this issue too? Thanks!

                                        1 Reply Last reply Reply Quote 0
                                        • T Offline
                                          TIG Moderator
                                          last edited by 26 Jan 2013, 12:04

                                          So no apology for putting me to unpaid trouble when it was entirely your error? πŸ˜’
                                          My exporter does work differently from the pro-OBJexporter, which minimizes the number of vertices by recycling them when possible.
                                          However, my version treats each context, material and face as a separate set, and doesn't reused vertices. The coding is such that it would be very awkward to effect...
                                          However, it has no noticeable effect on the resulting form and a ood 3rd party app should be able to cope with welding vertices etc anyway...
                                          Get Pro if you really do NEED this functionality, and are not just being 'anally retentive'.
                                          After all my tool is 'free' [donationware] and you cannot readily expect, let alone demand, changes to its functions... πŸ˜’

                                          TIG

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

                                          Advertisement