
local num_files = gh_utils.drop_files_get_num_files()
if (num_files > 0) then

  local full_path_filename = gh_utils.drop_files_get_file_by_index(0)
  

  local PF_U8_RGB = 1
  local PF_U8_RGBA = 3
  local PF_F32_RGBA = 6
  local PF_F16_RGBA = 9
  local pixel_format = PF_U8_RGBA
  local gen_mipmaps = 0
  local compressed_texture = 0
 
  local tex = gh_texture.create_from_file_v6(full_path_filename, pixel_format, gen_mipmaps, compressed_texture)
  if (tex > 0) then
    gh_node.kill(matcap01)
    matcap01 = tex

    local filename, folder  = gh_utils.extract_filename_from_path(full_path_filename)
    matcap_filename = filename
    matcap_folder = folder


    local SAMPLER_FILTERING_LINEAR = 2
    local SAMPLER_FILTERING_TRILINEAR = 3
    local SAMPLER_ADDRESSING_WRAP = 1
    local SAMPLER_ADDRESSING_CLAMP_TO_EDGE = 2
    local SAMPLER_ADDRESSING_MIRROR = 3
    gh_texture.bind(tex, 0)
    gh_texture.set_sampler_params(tex, SAMPLER_FILTERING_LINEAR, SAMPLER_ADDRESSING_WRAP, 1.0)
    gh_texture.bind(0, 0)
    
   
  end
end  

