Texture exporting from SU
-
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!
-
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 endIs this what you were looking for?
Whaat -
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.
-
Whaat, good to see you here at SketchUcation.
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 LoginAdvertisement