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

    Texture exporting from SU

    Scheduled Pinned Locked Moved Developers' Forum
    4 Posts 3 Posters 1.1k 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.
    • F Offline
      firkins
      last edited by

      I would like to export all the texture maps from a SU file to a folder to ease the export of the file into KT (yes I do use SU2KT, but the file is so large it regularly misses a number of texture maps). I checked the Ruby library (Didier) and it seems that the texture writer script should do what I am seeking. However, I cannot get it to work (v6 pro).

      Is there a problem with this script, or is there another ruby that can do what I am asking?

      Thanks!


      Michael

      %(#000080)["Those who would give up Essential Liberty
      to purchase a little Temporary Safety,
      deserve neither Liberty not Safety."]

      Ben Franklin

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

        Here's the code that I have been using in SkIndigo. It works pretty well for exporting all textures in your model (not just the ones in use). Of course, you will want to modify the output path.

        
        def export_textures
        
        
        tw=Sketchup.create_texture_writer
        model = Sketchup.active_model
        entities = model.active_entities
        
        helper_group=entities.add_group
        materials=model.materials
        
        for mat in materials
        	if (mat.respond_to?(;texture) and mat.texture !=nil)
        		helper_group.material=mat
        		tw.load(helper_group)
        	end
        
        end
        
        entities.erase_entities helper_group
        
        status=tw.write_all $g_su2in_path_textures+"\\"+$g_su2in_textures_prefix+$g_su2in_model_name,false
        tw=nil
        
        return status
        
        end
        

        Is this what you were looking for?
        Whaat

        SketchUp Plugins for Professionals

        1 Reply Last reply Reply Quote 0
        • F Offline
          firkins
          last edited by

          I'll try it, thanks.

          I also went back to the "old" place and did a search and came up with this suggestion:

          "Export your 3D model to an OBJ file. This will create a folder with all the texture files. Then you can delete the OBJ and MAT files if you don't need them."

          Not a ruby solution, but should work, too.


          Michael

          %(#000080)["Those who would give up Essential Liberty
          to purchase a little Temporary Safety,
          deserve neither Liberty not Safety."]

          Ben Franklin

          1 Reply Last reply Reply Quote 0
          • jujuJ Offline
            juju
            last edited by

            Whaat, good to see you here at SketchUcation.

            Save the Earth, it's the only planet with chocolate.

            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