Class: Sketchup::TextureWriter
| Relationships | |
| Inherits: | Object | 
Overview
The TextureWriter class is used primarily for writing the textures used in a SketchUp model out to files as part of an export for use in another application. These methods are usually invoked in this order:
- 1. load - load one or more textures from a model into the TextureWriter.
- 2. write_all or write - write the texture(s) to file.Instance Method Summary
- 
    
      #count  ⇒ Integer 
    
    The #length method is used to determine the number of textures loaded into the texture writer. 
- 
    
      #filename(handle)  ⇒ String 
    
    The filename method is used to retrieve the original filename for a particular texture. 
- 
    
      #handle(entity)  ⇒ Integer 
    
    The handle method is used to retrieve a handle or index for a specific texture in the texture writer. 
- 
    
      #length  ⇒ Integer 
    
    The #length method is used to determine the number of textures loaded into the texture writer. 
- 
    
      #load(entity)  ⇒ Integer 
    
    The load method is used to load one or more textures into the texture writer for writing out to a file. 
- 
    
      #write(entity, filename)  ⇒ Integer 
    
    The write method is used to write an individual textures, within the texture writer, to a file. 
- 
    
      #write_all(dirname, filename_format)  ⇒ Integer 
    
    The write_all method is used to write all of the textures within the texture writer to files. 
Instance Method Details
    #count  ⇒ Integer 
  
#filename(handle) ⇒ String
The filename method is used to retrieve the original filename for a particular texture.
    
      #handle(entity)  ⇒ Integer 
      #handle(face, side)  ⇒ Integer 
    
  
Integer 
      #handle(face, side)  ⇒ Integer 
    The handle method is used to retrieve a handle or index for a specific texture in the texture writer.
    #length  ⇒ Integer 
  
The #length method is used to determine the number of textures loaded into the texture writer.
The #count method is an alias for #length.
    
      #load(entity)  ⇒ Integer 
      #load(face, side)  ⇒ Integer 
    
  
Integer 
      #load(face, side)  ⇒ Integer 
    If you are passing a face in as the entity argument when loading a texture you will have to specify the second boolean argument, side. The argument side specifies which side of the face the texture will be loaded from.
The load method is used to load one or more textures into the texture writer for writing out to a file.
    
      #write(entity, filename)  ⇒ Integer 
      #write(entity, side, filename)  ⇒ Integer 
    
  
Integer 
      #write(entity, side, filename)  ⇒ Integer 
    If you are passing a face in as the entity argument when writing a texture you will have to specify the boolean argument, side. The argument side controls the side of the face from which the texture will be sampled before writing it.
The write method is used to write an individual textures, within the texture writer, to a file. An entity’s texture must have been loaded into the texture writer before this method can be used to write it’s texture.
This method will return one of the following status messages. (These are constants that are defined by the API.)
- 0 = FILE_WRITE_OK
- 1 = FILE_WRITE_FAILED_INVALID_TIFF
- 2 = FILE_WRITE_FAILED_UNKNOWN
    #write_all(dirname, filename_format)  ⇒ Integer 
  
The write_all method is used to write all of the textures within the texture writer to files. It will return one of three status numbers:
- 0 = FILE_WRITE_OK
- 1 = FILE_WRITE_FAILED_INVALID_TIFF
- 2 = FILE_WRITE_FAILED_UNKNOWN