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

    [Plugin] Import OBJ with Materials v2.1 20131118

    Scheduled Pinned Locked Moved Plugins
    279 Posts 87 Posters 379.1k Views 87 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.
    • K Offline
      Khai
      last edited by

      hmm a suggestion for a future release would be the option to swap the Z and Y axis on import.

      1 Reply Last reply Reply Quote 0
      • Chris FullmerC Offline
        Chris Fullmer
        last edited by

        And thanks!

        Lately you've been tan, suspicious for the winter.
        All my Plugins I've written

        1 Reply Last reply Reply Quote 0
        • CadFatherC Offline
          CadFather
          last edited by

          another very useful gem TIG - ThankYou.....

          1 Reply Last reply Reply Quote 0
          • EarthMoverE Offline
            EarthMover
            last edited by

            Thanks TIG, this will come in very handy! Thanks to Jim as well for his initial contribution.

            3D Artist at Clearstory 3D Imaging
            Guide Tool at Winning With Sketchup
            Content Creator at Skapeup

            1 Reply Last reply Reply Quote 0
            • MALAISEM Offline
              MALAISE
              last edited by

              Thanks TIG, to enhance Jim's plugin

              Quite useful when having OBJ library.

              MALAISE 👍 👍

              La Connaissance n'a de valeur que partagée

              1 Reply Last reply Reply Quote 0
              • R Offline
                richcat
                last edited by

                Thanks TIG 👍 & Jim 👍

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

                  Here's v1.1
                  http://forums.sketchucation.com/viewtopic.php?p=172790#p172790

                  Existing Materials re-used/make variant option added.
                  Swap Y & Z axes ? Yes/No, option added.

                  TIG

                  1 Reply Last reply Reply Quote 0
                  • Chris FullmerC Offline
                    Chris Fullmer
                    last edited by

                    I'm confused Bagatelo. What are you asking? This is a plugin that will import .obj into SU. The inverse would be an .obj exporter.

                    Chris

                    Lately you've been tan, suspicious for the winter.
                    All my Plugins I've written

                    1 Reply Last reply Reply Quote 0
                    • K Offline
                      Khai
                      last edited by

                      @tig said:

                      Here's v1.1
                      http://forums.sketchucation.com/viewtopic.php?p=172790#p172790

                      Existing Materials re-used/make variant option added.
                      Swap Y & Z axes ? Yes/No, option added.

                      thank you!!!!!!!!

                      1 Reply Last reply Reply Quote 0
                      • K Offline
                        Khai
                        last edited by

                        okies the Swap Z/Y is working perfectly 😄

                        the sizing is not atm 😞 (tried importing OBJ's from trueSpace, UVmapper and Hexagon) it's almost there tho...

                        Edit

                        Thanks to the notes inside the Ruby I was able to reset my units to Metres and now things are coming in the right size 😄

                        1 Reply Last reply Reply Quote 0
                        • W Offline
                          Whaat
                          last edited by

                          Hi TIG,

                          I can't quite tell from your description if your script imports UVs correctly. If you are looking to add this feature, I was working on an OBJ importer awhile ago that imported materials and UVs. If you would like the code, let me know and you can have it. I don't think I'll ever get around to releasing it officially.

                          Thanks for another great script!

                          SketchUp Plugins for Professionals

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

                            @whaat said:

                            Hi TIG,

                            I can't quite tell from your description if your script imports UVs correctly. If you are looking to add this feature, I was working on an OBJ importer a while ago that imported materials and UVs. If you would like the code, let me know and you can have it. I don't think I'll ever get around to releasing it officially.

                            Thanks for another great script!

                            My tool imports materials and textures. It doesn't deal with UVs as most of the example OBJs I have didn't have that info in their MTLs. Thus any imported material has it's colour and opacity set correctly, AND also has the correct texture added BUT without any UVs scaling etc - it uses the default 10" square version... However if you already have a pre-existing material with a matching name that has UVs set etc it asks if you want to use it or make a new variant - if you answer Yes it uses the existing material...

                            Am I right in understanding you, that some OBJ/MTLs have UV mapping info ? SUp exported OBJ/MTLs don't seem to ? Please PM me your half-baked UV code and I'll look at incorporating it [with credit to you, as appropriate]... Thanks for the offer.

                            TIG

                            1 Reply Last reply Reply Quote 0
                            • K Offline
                              Khai
                              last edited by

                              yup UV information is a core part of the OBJ Format.. makes it very useful for transfering between programs, such as Maya to trueSpace to Max....

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

                                @khai said:

                                yup UV information is a core part of the OBJ Format.. makes it very useful for transfering between programs, such as Maya to trueSpace to Max....

                                Where is it stored in the files ?

                                TIG

                                1 Reply Last reply Reply Quote 0
                                • K Offline
                                  Khai
                                  last edited by

                                  I think it's stored as the VT entries.

                                  ah yes here we go

                                  http://local.wasp.uwa.edu.au/~pbourke/dataformats/obj/ - Full OBJ Format Spec

                                  @unknownuser said:

                                  vt u v w

                                  Vertex statement for both polygonal and free-form geometry.
                                  
                                  Specifies a texture vertex and its coordinates. A 1D texture
                                  requires only u texture coordinates, a 2D texture requires both u
                                  and v texture coordinates, and a 3D texture requires all three
                                  coordinates.
                                  
                                  u is the value for the horizontal direction of the texture.
                                  
                                  v is an optional argument.
                                  
                                  v is the value for the vertical direction of the texture. The
                                  default is 0.
                                  
                                  w is an optional argument.
                                  
                                  w is a value for the depth of the texture. The default is 0.
                                  
                                  1 Reply Last reply Reply Quote 0
                                  • bagateloB Offline
                                    bagatelo
                                    last edited by

                                    @chris fullmer said:

                                    I'm confused Bagatelo. What are you asking? This is a plugin that will import .obj into SU. The inverse would be an .obj exporter.

                                    Chris

                                    Yes, I mistake. I have think about EXPORT model with obj file types. But .3ds is very good.

                                    I try to import this model ( http://www.evermotion.org/modelshop/show_product/sculpture-01-am34/1806/0/0/ ) into sketchup and the plugin don't work properly. Export with 3ds Files from MAX result crash in Sketchup.

                                    FBX files maybe can be de very best option.

                                    While the cat's away, the mice will play

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

                                      @khai said:

                                      I think it's stored as the VT entries.

                                      ah yes here we go

                                      http://local.wasp.uwa.edu.au/~pbourke/dataformats/obj/ - Full OBJ Format Spec

                                      @unknownuser said:

                                      vt u v w

                                      Vertex statement for both polygonal and free-form geometry.
                                      
                                      Specifies a texture vertex and its coordinates. A 1D texture
                                      requires only u texture coordinates, a 2D texture requires both u
                                      and v texture coordinates, and a 3D texture requires all three
                                      coordinates.
                                      
                                      u is the value for the horizontal direction of the texture.
                                      
                                      v is an optional argument.
                                      
                                      v is the value for the vertical direction of the texture. The
                                      default is 0.
                                      
                                      w is an optional argument.
                                      
                                      w is a value for the depth of the texture. The default is 0.
                                      

                                      Thanks - I see it now... wait for update...

                                      TIG

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

                                        @bagatelo said:

                                        @chris fullmer said:

                                        I'm confused Bagatelo. What are you asking? This is a plugin that will import .obj into SU. The inverse would be an .obj exporter.

                                        Chris

                                        Yes, I mistake. I have think about EXPORT model with obj file types. But .3ds is very good.

                                        I try to import this model ( http://www.evermotion.org/modelshop/show_product/sculpture-01-am34/1806/0/0/ ) into sketchup and the plugin don't work properly. Export with 3ds Files from MAX result crash in Sketchup.

                                        FBX files maybe can be de very best option.

                                        Since I'm not going to pay $35 for a model of a small statue I can't see how the actual file is structured - looks like it might be very complex though !!! The current OBJ Importersare quite limited...

                                        TIG

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

                                          Cool, thanks TIG. I've been using Jim's importer for a long time.

                                          One thing I've encountered with materials. You are assuming that the 'd' tag comes after the Kd tag, but it doesn't necessarily. It can show up anywhere in the list. The obj format doesn't require a specific order. So, if 'd' comes first, the plugin is crashing.

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

                                            Thanks for the info... I'm looking at uv mapping to so a fix might be soon...
                                            I also need to trap mtl's with a texture but no colour [using texture.average_color if no Kd ?]... I am looking at various fixes and other improvements... Please check out the Ruby Forum over the coming days...

                                            TIG

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

                                            Advertisement