sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    Mac User? | Join the Rayscaper Beta for Mac Learn More

    [Plugin] TextureImporter = Batch images > material-textures, inc. PBR, Collection export...

    Scheduled Pinned Locked Moved Extensions & Applications Discussions
    22 Posts 3 Posters 315 Views 3 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.
    • TIGT
      TIG Moderator
      last edited by

      @rich-o-brien
      I'm thinking of adding a closing option.
      'Save as Materials Collection...'
      That has 'Yes|No'
      Obviously 'No' does nothing.
      'Yes' exports the new textured-materials into a folder chosen from a dialog - the default folder is the Materials folder set up in users Preferences, with a suggested subfolder named after the folder-name where the seed-images were. The user can name another folder, pick another folder etc. If it's a new folder then it's made, otherwise the folder is chosen. The exported collection is separated into Materials and PBR-Materials subfolders...
      I'd appreciate your ideas before I start coding ??

      TIG

      1 Reply Last reply
      Reply Quote 2
      • Rich O BrienR
        Rich O Brien Moderator
        last edited by

        Works great!
        One thing I spotted is that if the term basecolor is missing from the color image TextImporter will apply a color value to the material but ignore the user's dimension and default to 2.5cm x 2.5cm.

        Adding 'Save as Collection' would be a good addition.

        Download the free D'oh Book for SketchUp πŸ“–

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

          I can import a PBR with the suffix '_Color' and the size stays fixed at say my setting of 1m x 1m ?
          The current [case insensitive] suffixes processed in order are: xxx_???
          basecolor base_color base-color albedo albedo_srgb color diffuse diff col col_srgb bc base
          I thought this caught most...
          So what is yours ?
          Can you perhaps give me one example PBR set to test...

          TIG

          1 Reply Last reply
          Reply Quote 0
          • Rich O BrienR
            Rich O Brien Moderator
            last edited by

            Maybe I didn't explain myself correctly.

            In the outlier case where you have a folder with PBR textures but the basecolor, color, diffuse etc 'flag' is missing eg. asphalt-01.png

            In this instance your extension still imports the other maps and assigns a dimension 2.5cm x 2.5cm despite the dialog calling for 100cm x 100cm.

            It's not really an issue with the extension more a user issue. But it was something I noticed.

            What interesting is that the material created gets a colour value that can't be changed because it expects an image in the texture slot. You get a greyed out panel.

            Again, it's an observation rather than a bug. Extension works great when the user has the expected PBR maps.

            Download the free D'oh Book for SketchUp πŸ“–

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

              Here's v1.3
              https://sketchucation.com/pluginstore?pln=TextureImporter
              It traps for missing 'xx_basecolor' file for PBR sets - using the unsuffixed 'xx' image if available.
              Avoiding messing up selected image XY size.
              It also offers the option to export the new materials into a collection - splitting SKMs into Material and PBR-Material subfolders as appropriate.

              TIG

              1 Reply Last reply
              Reply Quote 1
              • Rich O BrienR
                Rich O Brien Moderator
                last edited by Rich O Brien

                Works flawlessly.

                Feature request if possible? Set the Normal Map to GL or DX prior to import.

                Download the free D'oh Book for SketchUp πŸ“–

                panixiaP 1 Reply Last reply
                Reply Quote 0
                • panixiaP
                  panixia @Rich O Brien
                  last edited by

                  @Rich-O-Brien said:

                  Set the Normal Map to GL or DX prior to import

                  That would be awesome, BUT..
                  How do you expect the plugin should detect it?
                  Unless you include it in the name e.g "MyBeautifulNormal_DirectX.png" AFAIK there's no way to tell how the normal is supposed to work (there's no metadata to identify it).
                  Of course there are Substance texture-packing presets which automatically include the DX vs OpenGL in the naming convention, but the vast majority of normal map out there don't.

                  Rich O BrienR 1 Reply Last reply
                  Reply Quote 0
                  • Rich O BrienR
                    Rich O Brien Moderator @panixia
                    last edited by

                    @panixia said:

                    How do you expect the plugin should detect it?

                    I don't expect the plugin to know. If I know my maps are DX then I could set the importer to treat the normal maps as DX when importing. Or vice versa.

                    Download the free D'oh Book for SketchUp πŸ“–

                    panixiaP 1 Reply Last reply
                    Reply Quote 0
                    • panixiaP
                      panixia @Rich O Brien
                      last edited by

                      @Rich-O-Brien ah ok.. I understood that you were asking for an "auto-detect"

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

                        It sets the Normal to DX or GL if there's a suitably named image set in the PBR set.

                        The Normal suffixes it currently considers [in order and case-insensitive] are:

                        normalgl normal-ogl normal_ogl normalogl nrm_ogl
                        normal norm nrm nor normal_map normalmap
                        normaldx normal-dx normal_dx normaldx nrm_dx

                        I don't know what your PBR set includes...

                        What Normal image files are present ?

                        As you see - it considers suffix GL types first, then 'none', then DX

                        So if you have another variant that could be getting used first.

                        This is a breakdown of the Normal suffixes and their 'popularity'...

                        1. _Normal (or _normal): The most widely used suffix across modern game engines (Unreal Engine, Unity) and baking tools (Substance Painter, Marmoset Toolbag).
                        2. _NRM (or _nrm): A heavily used shorthand standard, frequently exported by Substance Designer, Quixel Megascans, and older production pipelines.
                        3. _N (or _n): Common in streamlined or strict character-limit naming conventions, especially in custom studio pipelines.
                        4. _Nor (or _nor): Frequently used by Blender artists, Poliigon, and open-source texture libraries.
                        5. _Norm (or _norm): Occasional middle-ground abbreviation used in various indie and web-based asset stores (like Sketchfab).

                        Coordinate Space Variants (Important Distinction)
                        Because normal maps encode X, Y, and Z directional data differently depending on the graphics API, you will often see format-specific suffixes appended to the end:
                        β€’ _Normal_DirectX / _Normal_DX: Used by Unreal Engine, 3ds Max, and DirectX-based applications (Green channel/Y-axis is inverted).
                        β€’ _Normal_OpenGL / _Normal_GL: Used by Unity, Blender, Maya, and OpenGL-based applications (Green channel/Y-axis points up).

                        Less Common / Legacy Suffixes
                        β€’ _NML: Seen in some older proprietary engines and CAD software.
                        β€’ _DDN: Stands for Detail Diffuse Normal, famously used in CryEngine.

                        I'll expand that list it uses to make sure ALL get considered.

                        Here's my proposal

                        normal nrm n nor norm normal_map normalmap
                        normal_directx normal_dx normaldx normal-directx normal-dx normaldx nrm_dx
                        normal_opengl normal_gl normal-ogl normalgl normalogl nrm_ogl nml ddn

                        Some PBR sets contain both Normal_DX and Normal_GL variants - some I propose to consider the _DX one first - if found... ?
                        Before I commit this tweak to a new version do you have any other files format suffixes to be trapped for ?

                        The 4 'Normal' ones are as listed above, but there's also other suffix possibilities [is order of consideration]...

                        basecolor base_color base-color albedo albedo_srgb color diffuse diff col col_srgb bc base

                        metallic metalness metal met mtl metallicity

                        roughness rough rgh rough_map roughness_map

                        ambientocclusion ambient_occlusion ambient-occlusion ambientocculsion ao ao_map aomap occlusion occ cavity

                        I think that SketchUp ignores any other possible PBR suffixes like
                        'height' 'displacement' 'opacity' 'alpha' 'emmisive' 'glow' 'specular' 'glossy' 'sss' 'curvature' and 'packed-maps'

                        TIG

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

                          After some more investigation...

                          normal_opengl normal_gl normal-ogl normalgl normalogl nrm_ogl nml ddn
                          normal nrm n nor norm normal_map normalmap
                          normal_directx normal_dx normaldx normal-directx normal-dx normaldx nrm_dx

                          SketchUp uses OpenGL anyway so GL is better - BUT if the DX alternative is there I'll give the user an option to use that instead...

                          TIG

                          1 Reply Last reply
                          Reply Quote 0
                          • panixiaP
                            panixia @TIG
                            last edited by panixia

                            @TIG said:

                            DDN: Stands for Detail Diffuse Normal, famously used in CryEngine

                            Also "ddna" (Amazon Lumberyard/Cry Engine).

                            I didn't even know it existed until a couple of minutes ago, but I'm just double-checking in the Substance Painter export templates list and found this, maybe you can add it at this point. 😁
                            Substance export this naming convention to a DX normal for both the presets.

                            The "Mesh Maps" preset in Substance also output some "normal_base" (can be both DX or OGL depending on project settings).

                            You may also want to add to the dictionary "NormalsMap" which is the default name in the 3dsMax scanline texture-baker (at least in the version I use). In most cases DirectX by default, unless specifyed by user.

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

                              Thanks - looking into an expanded list right now...

                              TIG

                              panixiaP 1 Reply Last reply
                              Reply Quote 0
                              • panixiaP
                                panixia @TIG
                                last edited by

                                @TIG I wrote (and corrected) a mistake above.
                                Max default is DirectX.
                                I made confusion with the GLTF format I recently used the most (gltf/glb use OpenGL).

                                1 Reply Last reply
                                Reply Quote 0
                                • Rich O BrienR
                                  Rich O Brien Moderator
                                  last edited by

                                  In some instances my maps are suffixed with just _normal TextureImporter applies the GL normal flag. Which is fine is most cases.

                                  But in cases where SomeImage_normal is DX and you discover this after import you need to set each map to DX in the Material panel.

                                  It's not a big issue to add the correct suffix in Windows Explorer using PowerToys. Not a big deal.

                                  Download the free D'oh Book for SketchUp πŸ“–

                                  1 Reply Last reply
                                  Reply Quote 0
                                  • panixiaP
                                    panixia
                                    last edited by

                                    Found some weird Substance Painter presets with "NormalMap" (same 3dsMax camel font, but without "s")

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

                                      The new update will spot if there's a 'normal_DX' file AND another type say 'normal_GL' or plain '_normal' and offer you the choice to use the DX version...

                                      TIG

                                      1 Reply Last reply
                                      Reply Quote 0

                                      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                      With your input, this post could be even better πŸ’—

                                      Register Login
                                      • 1
                                      • 2
                                      • 1 / 2
                                      • First post
                                        Last post
                                      Buy SketchPlus
                                      Buy SUbD
                                      Buy WrapR
                                      Buy eBook
                                      Buy Modelur
                                      Buy Vertex Tools
                                      Buy SketchCuisine
                                      Buy FormFonts

                                      Advertisement