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

    [Plugin][Code]SKMtools,Material/ImageTools

    Scheduled Pinned Locked Moved Plugins
    176 Posts 36 Posters 264.3k Views 36 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 Online
      TIG Moderator
      last edited by

      Have you installed all of the files in the subfolder as they come packaged in the zip file ?
      The imported Image MUST be a PNG file, and have a transparent background [note semi-transparent pixels within the image are regarded as 'to be removed' too... so edit the image file before importing it; flatten it, add a transparent layer back, pick the background color[s] using a magic-wand and delete those pixels so the background shows as fully transparent, tidy up loose pixels, very thing parts etc, save it and import!].
      The PNG Image needs to be a reasonable size...
      Do you get error messages in the Ruby Console.
      Is Java properly enabled on your computer [Control-panel > Java] ?
      Are .jar files set to be be allowed to execute locally ?
      Are .jar files associated with Java and not erroneously with some 'Compression' software ?
      Do you have full-permissions to your Plugins folder and all of its subfolders ?
      Do you have access-permissions to execute the '.jar' files needed to process the image ?
      Is anything made in a subfolder in the folder with the SKP - if so what ?
      Have you tried running Sketchup as administrator ?
      πŸ˜•
      There are many possibilities.
      If you real the posts in this thread you will see the list of mess ups. and how fixing the issues, that has allowed every user to get things working properly [eventually]...
      πŸ€“

      TIG

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

        I tried to make Java the default program to open .jar files. Got an error message.

        I tried to open Sketchup as administrator. The trimmer seemed to fail once but did work the second time ? Anyway it did work! 😍

        Thank you very much for your help

        Marchorg

        1 Reply Last reply Reply Quote 0
        • pbacotP Offline
          pbacot
          last edited by

          I wonder if anyone can tell what I am doing wrong with Image Trimmer.

          If I run the image in the attached SU file. I get a component. Image Trimmer seems to complete all operations. But the component is just a few scattered dots. The rest of the image is gone.


          File with tricky image.

          MacOSX MojaveSketchUp Pro v19 Twilight v2 Thea v3 PowerCADD

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

            It's useful if you supply the original Image file too...
            For some reason it's failing to make a proper loop of the main 'face' - there a one pixel gap in the crook of her arm/hand [also a non-transparent white gap between the hands that needs sorting]...Capture.PNG To fix this, edit the component.
            Edit > Select-All
            Entity Info > untick 'hidden' so that all edges are now visible.
            Draw in some large diagonals and make faces [as above].
            You can quickly zoom into the problem area.
            Add in the missing edge to heal that gap and make all needed faces.
            To tidy up, use a 'DeleteCoplanarEdges' tool to remove the diagonal lines you've just added - or Erase them.
            Now open the Material Browser and find the image-material.
            Paint it onto the front AND back faces of the now-faced cutout.
            Select-All again, and deselect the Faces - either using a 'SelectionTool' or by holding ctrl+shift and clicking on the face[s].
            Use the Context-menu to Hide the still selected Edges.
            I'm unsure as to why it can't cope with this particular image - that one pixel seems to have scuppered it ! Perhaps editing the Image in Gimp osa would reveal an odd combo of solid and transparent pixels around this area - the simpler the PNG Image's outline is then the less prone ImageTrimmer is to errorsCapture2.PNG Shown here with all edges still unhidden for clarity...
            EDIT:
            I've edited the exported Image and made that 'crook' less sharp, also tidied up hair/hands, cropped it to optimize its size etc; Re-imported it etc...
            Now it ImageTrims quickly and faultlessly...Capture3.PNGImgTrimRedo.skp

            TIG

            1 Reply Last reply Reply Quote 0
            • pbacotP Offline
              pbacot
              last edited by

              TIG,

              Thank you so much for the explanation. I thought it was something more basically wrong with my usage. I did see that some of the shape could close and not other parts, and applied the texture but it looked wrong and I felt I was going the wrong direction with this.

              After previous tries I took the image into GIMP and applied a solid mask of the shape,looked for holes and flattened, trimmed again, and still got the result you saw. I now know that it WILL work but may need to reprocess some shapes further. The original image had a lot of translucent pixels in that crook area. Some GIMP process to make hard and simplified edges would help. I see you were able to put back in some of the holes, which I had filled, thinking they were part of the problem.

              Excellent plugin! Sorry I was such a bother.

              Peter

              MacOSX MojaveSketchUp Pro v19 Twilight v2 Thea v3 PowerCADD

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

                No worries...
                You'll appreciate that the algorithms in the files that have to find the edges around the 'solid' parts are quite complex, and occasionally you can contrive a set of pixels that it processes in a gapped result - in your case it was just one pixel ! A simple image-edit fixed it in a trice... Try to keep PNG files for trimming quite simple, with no single pixel 'inlets' or 'peninsulas' as these are ignored anyway as they cannot form a face because their two edges would be coincident and [rare] occasional combos can cause edges to get missed and face to fail to form...
                πŸ€“

                With Gimp I find the best way is to flatten the PNG, add a transparent alpha-layer back in and then use the 'magic-wand' to pick the background color pixels en mass, with a limited color-variation range + delete-key to remove them - you can then see the 'chequered-background' rather than the typical 'white'; then zoom in and pick any 'edge pixels' that have been 'anti-aliased' where the object's color and the background's color are 'merged'... and delete those too - always ensuring that small transparent holes or solid 'peninsulas' or 'islands' are at least 2 pixels wide... Finally auto-crop the PNG image to minimize the amount of 'blank' background, this is because every pixel needs to be considered, so because the transparent ones are not important to us in the final form you are best of to minimize how many of them there are in the image, before trimming it...
                β˜€

                TIG

                1 Reply Last reply Reply Quote 0
                • pbacotP Offline
                  pbacot
                  last edited by

                  @unknownuser said:

                  then zoom in and pick any 'edge pixels' that have been 'anti-aliased' where the object's color and the background's color are 'merged'.

                  Or this might be possible in most images using "grow" selection.

                  @unknownuser said:

                  Finally auto-crop the PNG image to minimize the amount of 'blank' background, this is because every pixel needs to be considered,

                  Thanks, that would not have occurred to me--somehow I thought it would just ignore those. Peter

                  MacOSX MojaveSketchUp Pro v19 Twilight v2 Thea v3 PowerCADD

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

                    It does ignore them BUT it has to look at them to find out they are to be ignored, so an image with masses of blank outer space will take longer to process simply because all of those [eventually] unused pixels must be examined; so if they are not going to be used in the image-trimming don't include them in the Image... That also goes for all tiny areas in an Image; any that are < 2 pixels across will [usually] not become either faces or 'holes' because their edges will be coincident when considered for trimming !

                    TIG

                    1 Reply Last reply Reply Quote 0
                    • G Offline
                      ggggito
                      last edited by

                      😍

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

                        Here's an update: http://sketchucation.com/forums/viewtopic.php?p=293677#p293677
                        The SKMtools Temp folder that is needed to process files etc, is now made in the User's Temp folder [OS specific] rather that the ../Plugins/SKMtools folder, avoiding potential permission issues...

                        TIG

                        1 Reply Last reply Reply Quote 0
                        • B Offline
                          Ben Ritter
                          last edited by

                          TIG,

                          Thank you for your generosity.

                          What am I doing wrong? I imported a .png and implement image trimmer, but I don't see anything different about it once the process is completed.

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

                            Number of possible issues...

                            Any messages in the Ruby Console ?

                            Do you have Java installed/enabled - it's need to run the JARDs that manipulate the files etc...
                            Do you have .JAR files set to open/execute in Java [their default] - some compression apps can hikack that filetype and so open it instead - change it back to the default.

                            ImageTrimmer needs a PNG image with an alpha-layer - that is a transparent background, but with other pixels 100% solid.
                            In Gimp or a similar image-editor...
                            Flatten the PNG image, then add the alpha-layer back, select the background's color [usually white or black] with a magic-wand and delete, so its now transparent.
                            Make sure the image is cropped tight to minimize the amount of trimming needed by the tool.
                            Export back as the PNG.
                            Re-Import and retry...

                            If you are still having problems post the PNG image so we can look at it directly.

                            TIG

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

                              I think I might have found a glitch... watch for updates...

                              TIG

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

                                @Ben

                                You were right !
                                There was a silly typo in the revised ImageTrimmer code I hadn't trapped...
                                Here's a link to the update http://sketchucation.com/forums/viewtopic.php?p=293677#p293677

                                It's updated in the PluginStore too...

                                TIG

                                1 Reply Last reply Reply Quote 0
                                • B Offline
                                  Ben Ritter
                                  last edited by

                                  TIG,

                                  Still no results. PNG image attached.

                                  Ruby Console:
                                  Error: #<Errno::ENOENT: No such file or directory -

                                  Thanks.


                                  PBfTree-T1.png

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

                                    Works for me. πŸ˜•

                                    Although you haven't flattened the PNG and re-added an alpha channel, it works after a fashion...

                                    As has been explained several times regarding different issues...
                                    You cannot have' non-ASCII characters' in the file name or paths that need to be processed by SketchUp's Ruby version [on PC]...
                                    It's a known PITA.

                                    So if your SKP is saved in a folder path containing even one tiny accented character - then it will fail to complete.
                                    What is your folder path ?
                                    The Image's name is OK, but if there's a rogue "ΓΆ" [or similar] in there, then it'll fall over !

                                    What is your OS / version - your User Profile is incomplete...


                                    Capture.PNG

                                    TIG

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

                                      There was a minor typo in the loader .rb's name...
                                      Making it non EW compliant. πŸ˜’
                                      Here's a link to the update http://sketchucation.com/forums/viewtopic.php?p=293677#p293677
                                      It's updated in the PluginStore too...

                                      TIG

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

                                        There has been some reworking of syntax to future-proof the code.
                                        Here's the update.
                                        http://sketchucation.com/forums/viewtopic.php?p=293677#p293677

                                        Get the latest version from the SCF PluginStore
                                        http://sketchucation.com/resources/pluginstore?pln=SKMtools

                                        TIG

                                        1 Reply Last reply Reply Quote 0
                                        • N Offline
                                          nasos.slab
                                          last edited by

                                          hey there, i did download the plugin and it comes up as skmtools_v20131214.rbz i did put in my plugins folder but is nowhere to be seen in Sketchup

                                          any ideas ?

                                          Thank you in advance nasos

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

                                            You didn't install the plugin. Take the .rbz file out of the Plugins folder and put it back in your Downloads folder or something. Open SketchUp and go to Preferences>Extensions. Click on Install Extension. Navigate to where you saved the .rbz file and select it. Click Open...

                                            Before you do any of that, make sure you have properly set the permissions for the Plugins folder. See TIG's thread at the top of the Plugins forum.

                                            Please complete your profile with SketchUp version and OS. Thanks.

                                            Etaoin Shrdlu

                                            %

                                            (THERE'S NO PLACE LIKE)

                                            G28 X0.0 Y0.0 Z0.0

                                            M30

                                            %

                                            1 Reply Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 5
                                            • 6
                                            • 7
                                            • 8
                                            • 9
                                            • 8 / 9
                                            • First post
                                              Last post
                                            Buy SketchPlus
                                            Buy SUbD
                                            Buy WrapR
                                            Buy eBook
                                            Buy Modelur
                                            Buy Vertex Tools
                                            Buy SketchCuisine
                                            Buy FormFonts

                                            Advertisement