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

    Failure to save file error

    Scheduled Pinned Locked Moved SketchUp Discussions
    sketchup
    18 Posts 4 Posters 1.9k Views 4 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.
    • D Offline
      driven
      last edited by

      hi, you have a typo in writable? it should not have [ e ] after [ t ]...
      but it's better to use...

      File.writable_real?(path)
      

      but best is to open it and see if a file is in there, as I mentioned in the other thread...

      %x(open -R "#{path}" )
      

      if the File is in there, open it directly with your preferred editor, edit and save to the same place with the same name...

      go back to SU and see if it updates...

      It did with 'Preview' for me, and after doing that, both SU and Preview let me edit Materials...

      I also reset the SU editor Preferences, i.e. changed to another one then restart changed back, then restart...
      maybe not required but it works now...

      to check it first you can use...

      plist = (ENV["XPC_SERVICE_NAME"]).split('.')[0..-2].join('.')
          editor = %x(defaults  read  #{@plist} Preferences | grep "Image Editor" )
      

      mine returns... "Image Editor" = "/Applications/Preview.app";

      john

      learn from the mistakes of others, you may not live long enough to make them all yourself...

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

        thanks john!
        a little closer.

        first i fixed the typo, and re-entered the info and for both options (the one i posted, as well as the preferred method you included) and received a value of true for both. πŸ‘

        then i verified which editor SU is seeing and the value returned preview when i had it set to preview and photoshop when i set it to photoshop. πŸ‘

        now the bad news, i still receive the failure to save popup window. πŸ‘Ž πŸ‘Ž

        this only occurs with textures not included with default sketchup make.
        i use podium, i download something from their warehouse and cannot edit it, used to be able to (SU8), but not now (SU2015). i read in the other thread that downloaded textures/materials are flagged. not sure how to identify that or whether it even be relevant to this issue.

        lastly, i can open the folder but the texture i want to edit is of course not in there because i am unable to even open the texture in the external editor in the first place, hence the error.

        i restarted, rebooted, did a dance and everything... cursed a little maybe too. 😲

        i don't get it and i don't know enough about programming to try other things. thanks for you help. if you have any other ideas, i'm all ears.

        andrew

        1 Reply Last reply Reply Quote 0
        • D Offline
          driven
          last edited by

          I'll dig up some code to remove the flags...

          I have a Ruby Console version somewhere...

          In the meantime, try downloading one of the SCF texture sets and see if you can edit those...

          This will demonstrate if it's the 'downloaded' flag or not...

          it may be Podium has locked the file???

          john

          learn from the mistakes of others, you may not live long enough to make them all yourself...

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

            ok. stupid qustion first,
            SCF texture set? what is that.
            i know... duh.

            i have a similar thread going on podiums forum and i presented the flagged content comment. we'll see what they say.

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

              SketchUcation > Shop > Textures > Normal...

              TIG

              1 Reply Last reply Reply Quote 0
              • D Offline
                driven
                last edited by

                @atrodler said:

                ...SCF texture set? what is that.

                Sketchup Community Forum aka. SketchUcation i.e. this forum...

                has user downloads in the store that include some texture sets...
                like here... http://sketchucation.com/shop/textures

                I only just noticed these are only free for premium members...
                john

                learn from the mistakes of others, you may not live long enough to make them all yourself...

                1 Reply Last reply Reply Quote 0
                • D Offline
                  driven
                  last edited by

                  this 'should' remove the flag from skm files...

                  
                          path = UI.openpanel("Select a .skm file in any folder or Cancel" )
                          if File.exist?(path.to_s)
                            dir = File.dirname(path)
                            files = ''
                            files << %x( mdfind -onlyin "#{dir}" 'kMDItemDisplayName == "*.skm" ')
                            files.split("\n").each{|file| %x(xattr -d com.apple.quarantine "#{file}")}
                          else #  File.exist?
                            puts 'cancled in no file?'
                          end #  File.exist?
                  

                  learn from the mistakes of others, you may not live long enough to make them all yourself...

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

                    yeah TIG i should've known that.
                    john, some have samples. i'll download, install, an see what happens.

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

                      okay, i'll try the latest. while you were doing that i discovered the following:

                      i've done this for SU8 with no problem, downloaded a few freebies, dropped them in the materials folder, and i was off and running. however, i do not have a materials folder in the SU2015 directory (Macintosh HD).

                      so where in the world is SU2015 pulling the default materials (skm files) from? ❓ ❗ ❓ πŸ‘Š

                      I looked in the (user) directory and i have a materials folder in there but nothing in it. i ran a search for skm files (both directories) and the only thing that turned up were the SFC samples i just downloaded. (excluding SU8 directory)

                      i have no idea where to place them to continue on with our initial experiment.

                      just to see, i place the downloaded freebies in the old SU8 materials folder but they do not show up when i open SU2015, and look in the respective materials menu. didn't expect them to be... but just to be sure.

                      this is whacked IMHO... thoroughly.

                      do i need to uninstall an reinstall SU2015? should i dump the SU8 folders?

                      update
                      input the info provided, a folder opens asking me to select skm files.
                      since i cannot find any of which to add the SCF samples, results still pending there.
                      as for the podium stuff. i download components just like from the SU warehouse, the texture is already in the component. when i click on the texture, whether on the model itself, or via the materials window, i cannot edit (current issue), so, results still pending there as well.

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

                        success with the downloaded skm files. followed suit and created appropriate folders, opened SU, applied new material, clicked to edit, editor opened!

                        So, yes, i can edit downloaded SCF files.

                        1 Reply Last reply Reply Quote 0
                        • D Offline
                          driven
                          last edited by

                          @atrodler said:

                          so where in the world is SU2015 pulling the default materials (skm files) from? :?: :!: :?: :knockout:

                          Default Materials are now completely separate from User materials, as they should be...

                          save a material and SU will make the folder in your User/Lib [ beside Plugins]...

                          or you can make your own in there...

                          Do NOT use any of the 'Default' names as two with the same name causes other issues...

                          e.g. User/.../Materials/my_Bricks/Brick_1.skm
                          use unique names...

                          the Podium ones appear to be 'Colors' not 'Textures' so I can't edit any I downloaded...

                          john

                          edit, I missed out "NOT"...oops

                          learn from the mistakes of others, you may not live long enough to make them all yourself...

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

                            i went to the podium browser and started importing items:

                            brought in the table set barbarrosa, i can edit both materials that come with it.
                            brought in the morella bench, good to gp.
                            brought in eagle roofing tile, cannot edit... failure to save file
                            brought in acer negundo, can edit leaf02, cannot edit leaf01 or bark.
                            brought in lucepian sky light fixture, can edit aluminum, other two n/a (i think because they are basic colors)

                            then i tried items from the SU warehouse:
                            brought in a random chair, can edit one of the four materials. the one i could edit was a wood texture, the uneditable items were, a color n/a, and two images.
                            brought in a train station, colors n/a, 2 textures- good, 2 google earth images - good, image of station- used as a texture- cannot edit.

                            random results to say the least.

                            1 Reply Last reply Reply Quote 0
                            • D Offline
                              driven
                              last edited by

                              are the ones you CAN edit shown using this?

                                model = Sketchup.active_model.materials.each do |mat|
                                  if mat.texture
                                    p mat.name
                                  end
                                end
                              

                              tip: if you switch model, use the UP arrow to re-use the same code on the next one...

                              john

                              learn from the mistakes of others, you may not live long enough to make them all yourself...

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

                                i guess so,
                                this one i can edit and is one of the downloaded SCF skm files

                                model = Sketchup.active_model.materials.each do |mat|
                                if mat.texture
                                p mat.name
                                end
                                end
                                "suc-paving-054"
                                #Sketchup::Materials:0x007ff7d9d66e28

                                this one was a material in a component from Podium, and i cannot edit it.

                                model = Sketchup.active_model.materials.each do |mat|
                                if mat.texture
                                p mat.name
                                end
                                end
                                "PDM_Wood_planks_01"
                                #Sketchup::Materials:0x007ff7dc9f8d38

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

                                  the following is from one of the podium guys:

                                  *One possible reason is that texture names in SU often have the full path of the file of the machine on which the texture was created in the texture name. If the file name, including the full path is too long, you can't do much with the files.

                                  If this happens, there is a trick you can use.

                                  Use the export script function (Generate) and open the renamed texture in your editor, alter it, and you can load it into SU. You should then be able to edit in in SU.*

                                  the generate function is for exporting scenes to batch render later. all materials regardless of name goes into the folder of your choosing. from that point i can open, edit, save, rename, and then bring back into SU. it works fine and is not too tedious of a work around. from there, any edits can be performed from within SU as usual.
                                  i can live with that. if you discover more, great but if not thats ok too. thanks all for your help and patience.

                                  1 Reply Last reply Reply Quote 0
                                  • D Offline
                                    driven
                                    last edited by

                                    glad you have an option, though I would question why they would distribute textures with hardcoded paths...

                                    trawling back into memory, the test could have been...

                                      model = Sketchup.active_model.materials.each do |mat|
                                        if mat.texture
                                          p mat.texture.filename
                                        end
                                      end
                                    
                                    

                                    at least that will show the culprit...

                                    john

                                    learn from the mistakes of others, you may not live long enough to make them all yourself...

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

                                      @atrodler said:

                                      Did you ever find a fix for this? I've been going through the same thing, following your (and some others) threads here and on reddit. Extremely frustrating bug. I'm getting the exact same results as you. Currently having to export textures in .dae format anytime I need to edit one. Then re-import, resize, replace, purge old, etc etc etc.

                                      1 Reply Last reply Reply Quote 0
                                      • 1 / 1
                                      • First post
                                        Last post
                                      Buy SketchPlus
                                      Buy SUbD
                                      Buy WrapR
                                      Buy eBook
                                      Buy Modelur
                                      Buy Vertex Tools
                                      Buy SketchCuisine
                                      Buy FormFonts

                                      Advertisement