code: def _make_texture(
      self,
      renderer,
      prim,
      tex_dict,
      color_mult=vray.AColor(1, 1, 1, 1),
      transfer_func=1,
      gamma=1,
  ):
      if tex_dict != None:
          tex_source_idx = tex_dict.get("index")
          if tex_source_idx != None:
              wrapU = 1
              wrapV = 1
  
              samplerIdx = self.textures[tex_source_idx].sampler
              if samplerIdx != None:
                  gltf_wrapS = self.samplers[samplerIdx].wrapS
                  if gltf_wrapS == 10497:  # The texture repeats in U
                      wrapU = 1
                  elif (
                      gltf_wrapS == 33071
                  ):  # Clamp to edge; V-Ray doesn't really have a matching mode, so just disable wrapping
                      wrapU = 0
                  elif gltf_wrapS == 33648:  # Mirrored repeat
                      wrapU = 2
  
                  gltf_wrapT = self.samplers[samplerIdx].wrapT
                  if gltf_wrapT == 10497:  # The texture repeats in V
                      wrapV = 1
                  elif (
                      gltf_wrapT == 33071
                  ):  # Clamp to edge; V-Ray doesn't really have a matching mode, so just disable wrapping
                      wrapV = 0
                  elif gltf_wrapT == 33648:  # Mirrored repeat
                      wrapV = 2
  
              tex_idx = self.textures[tex_source_idx].source
  
              bmb = renderer.classes.BitmapBuffer()
              bmb.file = self.images[tex_idx].file_loc
              bmb.transfer_function = transfer_func
              # bmb.allow_negative_colors = True
              bmb.gamma = gamma
              bmb.filter_type = 5  # Sharp mip-map filtering
  
              texture = renderer.classes.TexBitmap()
              texture.bitmap = bmb
              texture.color_mult = color_mult
  
              if wrapU != 0 or wrapV != 0:
                  texture.tile = 1
              else:
                  texture.tile = 0
  
              uvw_gen = renderer.classes.UVWGenChannel()
              uvw_gen.uvw_channel = -1
              uvw_gen.uvw_transform = TEXTURE_FLIP_TRANSFORM
              # uvw_gen.use_double_sided_mode = True
              uvw_gen.wrap_mode = 0
              uvw_gen.wrap_u = wrapU
              uvw_gen.wrap_v = wrapV
  
              tex_uv_channel_idx = tex_dict.get("texCoord")
              if tex_uv_channel_idx != None:
                  uvw_gen.uvw_channel = tex_uv_channel_idx
              else:
                  tex_uv_channel_idx = -1
  
              tex_source_ext = tex_dict.get("extensions")
              if tex_source_ext != None:
                  for ext in tex_source_ext.keys():
                      if ext == "KHR_texture_transform":
                          tex_trans_ext = tex_source_ext.get(
                              "KHR_texture_transform"
                          )
  
                          # Figure out the final UVW transformation
                          tex_transform = vray.Transform(
                              vray.Matrix.identity, vray.Vector(0, 0, 0)
                          )
  
                          gltf_tex_offset = tex_trans_ext.get("offset")
                          if gltf_tex_offset != None:
                              tex_transform = (
                                  tex_transform.replaceOffset(
                                      vray.Vector(
                                          gltf_tex_offset[0],
                                          gltf_tex_offset[1],
                                          0,
                                      )
                                  )
                              )
  
                          gltf_tex_rotate = tex_trans_ext.get(
                              "rotation"
                          )
                          if gltf_tex_rotate == None:
                              gltf_tex_rotate = 0.0
  
                          gltf_tex_scale = tex_trans_ext.get("scale")
                          if gltf_tex_scale == None:
                              gltf_tex_scale = [1.0, 1.0]
  
                          cs = math.cos(-gltf_tex_rotate)
                          sn = math.sin(-gltf_tex_rotate)
                          tex_transform = tex_transform.replaceMatrix(
                              vray.Matrix(
                                  vray.Vector(cs, sn, 0)
                                  * gltf_tex_scale[0],
                                  vray.Vector(-sn, cs, 0)
                                  * gltf_tex_scale[1],
                                  vray.Vector(0, 0, 1),
                              )
                          )
  
                          # First apply the transfrom from the extension, and then flip the Y direction
                          uvw_gen.uvw_transform = (
                              uvw_gen.uvw_transform * tex_transform
                          )
  
                          new_tex_coord = tex_trans_ext.get("texCoord")
                          if new_tex_coord != None:
                              meshUvs = vray.VectorList()
  
                              # for uvVal in self.accessors[new_tex_coord].data:
                              # 	meshUvs.append(vray.Vector(uvVal[0],uvVal[1],0.0))
  
                              # if tex_uv_channel_idx != -1:
                              # 	prim.vray_node_ref.geometry.map_channels[tex_uv_channel_idx] = meshUvs
                              # else:
                              # 	channels = []
                              # 	channels.append(meshUvs)
                              # 	prim.vray_node_ref.geometry.map_channels = channels
  
              texture.uvwgen = uvw_gen
  
              return texture
  
      return None
  
imports: from __future__ import print_function
  import os
  import sys
  import json
  import vray
  from .None import parserUtils
  from .None import cameraUtils
  import numpy
  from tempfile import mkstemp
  import math
  import pyquaternion
  import base64
  from ..None import testUtils
label_desc: Use image node_id 17 for calling the GltfParser obj's underlying member method code with example usage: obj._make_texture(renderer, prim, tex_dict, color_mult, transfer_func, gamma) and returns: None, texture