GE Lua Documentation

Press F to search!

splitWithoutExt

Definition


-- @/lua/common/utils.lua:1086

-- filename DOES NOT contain the extension
path.splitWithoutExt = function(filepath, compositeExtension)
  local dir, filename, ext = path.split(filepath, compositeExtension)
  filename = filename:gsub('.'..ext, "")
  return dir, filename, ext
end

Callers

@/lua/ge/extensions/core/flowgraphManager.lua
    for i, filename in ipairs(FS:findFiles(stateTemplatePath, '*state.flow.json', -1, true, false)) do
      local dirname, fn, e = path.splitWithoutExt(filename, true)
      local path = dirname:sub(string.len(stateTemplatePath) + 1)
@/lua/ge/extensions/career/modules/loanerVehicles.lua
    if vehicleInfo.owningOrganization == organizationId then
      local _, configFilename, ext = path.splitWithoutExt(vehicleInfo.config.partConfigFilename)
      local configInfo = core_vehicles.getConfig(vehicleInfo.model, configFilename)
    local organization = freeroam_organizations.getOrganization(veh.owningOrganization)
    local _, configFilename, ext = path.splitWithoutExt(vehInfo.config.partConfigFilename)
    local configInfo = core_vehicles.getConfig(vehInfo.model, configFilename)
@/lua/ge/extensions/flowgraph/nodes/ui/vehicleSelector.lua
  --if self.pinIn.config.value and self.pinIn.model.value then
  --  local _, configFn, _ = path.splitWithoutExt(self.pinIn.config.value)
  --  data.vehicle = {
@/lua/ge/extensions/util/testJSONFilesSyntax.lua
  for _, filePath in ipairs(filePaths) do
    local dir, fileName, _ = path.splitWithoutExt(filePath)
    local fileText = readFile(filePath)
@/lua/ge/extensions/editor/rendererComponents.lua
    ) then
      local dir = path.splitWithoutExt(value)
      openFileDialog(dir)
@/lua/ge/extensions/gameplay/crawl/utils.lua
  for _, filePath in ipairs(prefabFileList or {}) do
    local _, fn = path.splitWithoutExt(filePath)
    local scenetreeObject = spawnPrefab(Sim.getUniqueName(fn), filePath, 0 .. " " .. 0 .. " " .. 0, "0 0 1 0", "1 1 1", false)
@/lua/ge/extensions/editor/resourceChecker/resourceUtil.lua
            job.yield()
            local dir, basefilename, ext = path.splitWithoutExt(d)
            if d and d ~= "" then
    for k,v in ipairs(meshFiles) do
      local dir, basefilename, ext = path.splitWithoutExt(v)
      if job.progress < 75 then job.progress = job.progress + 0.01 end
            elseif matName and not FS:fileExists(file) then
              local dir = path.splitWithoutExt(matName)
              local d, base, ext = path.splitWithoutExt(matName)
              local dir = path.splitWithoutExt(matName)
              local d, base, ext = path.splitWithoutExt(matName)
              if d and base and FS:fileExists(d..file) then
      if FS:fileSize(v) > 0 then
        local dir, basefilename = path.splitWithoutExt(v)
        forestInternals[basefilename:gsub('.forest4', '')] = true
      job.yield()
      local dir, basefilename, ext = path.splitWithoutExt(k)
      if basefilename then
      job.yield()
      local dir, basefilename, ext = path.splitWithoutExt(v)
      if models[string.lower(v)] then
      if v and not FS:fileExists(v:gsub('.dds', '.png')) then
        local dir, basefilename = path.splitWithoutExt(v)
        local filepathIn = v
@/lua/ge/extensions/flowgraph/nodes/gameplay/race/raceHighscoresLap.lua
      local config = {Name = "Custom Config"}
      local _, fn, ext = path.splitWithoutExt(vData.config.partConfigFilename)
      for k, c in pairs(mData.configs) do
@/lua/ge/extensions/editor/materialEditor.lua
  if im.BeginPopup(popupId) then
    local _, base = path.splitWithoutExt(res or '')
    im.Text('['..((base and base ~= '') and base or tostring(res))..']')
  for index, filePath in ipairs(previewMeshes) do
    local _, file, _ = path.splitWithoutExt(filePath)
    previewMeshes[index] = {path = filePath, name = file}
      -- Open up lastPath dir in case there's no texture path set
      -- (absPath == "" and lastPath or path.splitWithoutExt(absPath)),
      -- Open up material's dir in case there's no texture path set
      -- Open up material's dir in case there's no texture path set
      (absPath == "" and (path.splitWithoutExt(currentMaterial:getFilename()) or lastPath) or path.splitWithoutExt(absPath)),
      true
      -- Open up material's dir in case there's no texture path set
      (absPath == "" and (path.splitWithoutExt(currentMaterial:getFilename()) or lastPath) or path.splitWithoutExt(absPath)),
      true
      false,
      path.splitWithoutExt(selectedCubemapObj:getField("cubeFace", index)),
      true
    if filepath then
      dir, filename, ext = path.splitWithoutExt(filepath)
    end
@/lua/ge/extensions/editor/crawlEditor/trails.lua
      local oldFilePath = trail._filePath
      local dir, _, ext = path.splitWithoutExt(oldFilePath, true)
@/lua/ge/extensions/scenario/scenariosLoader.lua
      if string.endswith(prefabPath, ".json") then
        dir, pathScenarioName, ext = path.splitWithoutExt(prefabPath, ".prefab.json")
      else
      else
        dir, pathScenarioName, ext = path.splitWithoutExt(prefabPath, ".prefab")
      end

      local dir, fn, ext = path.splitWithoutExt(fgPath, true)
      if fgData.isScenario then
@/lua/ge/extensions/editor/crawlEditor/paths.lua
      local oldFilePath = path._filePath
      local dir, _, ext = utilPath.splitWithoutExt(oldFilePath, true)
      local newFilePath = dir .. newFileName .. "." .. ext
@/lua/ge/extensions/gameplay/missions/missions.lua
    for _,missionFile in ipairs(FS:findFiles(missionTypesDir, missionTypeConstructorFilename..'.lua', 1, false, true)) do
      local dir,_,_ = path.splitWithoutExt(missionFile)
      local splitPath = split(dir,'/')
@/lua/ge/extensions/core/camera.lua
    for _,file in ipairs(FS:findFiles(camDirectory, "*.lua", 1, false, false)) do
      local _,camMode,_ = path.splitWithoutExt(file)
      constructorsCache[camMode] = require('core/cameraModes/' .. camMode)
@/lua/vehicle/controller/drivingDynamics/sensors/vehicleData.lua
  if v.config.partConfigFilename then
    local _, configName = path.splitWithoutExt(v.config.partConfigFilename)
    local configFilePath = string.format("%sdrivingDynamics/%s.stat.json", vehiclePath, configName)
@/lua/ge/extensions/tech/techCore.lua
  local infoPath = request['path']
  local scenarioDir, infoFile, _ = path.splitWithoutExt(infoPath)
  local prefabPath = scenarioDir .. infoFile .. '.prefab.json'
@/lua/ge/extensions/gameplay/rally/notebook/path.lua
  if not self.fname then return nil end
  local _, filename, _ = path.splitWithoutExt(self.fname)
  _, filename, _ = path.splitWithoutExt(filename)
  local _, filename, _ = path.splitWithoutExt(self.fname)
  _, filename, _ = path.splitWithoutExt(filename)
  return filename
@/lua/ge/extensions/editor/vehicleDetailViewer.lua
      for lidx, layoutFilename in ipairs(availableLayoutFiles) do
        local _, baseFilename = path.splitWithoutExt(layoutFilename, '.vehicleDetailSetting.json')
        if loadedLayoutBaseFilename == baseFilename then
@/lua/ge/extensions/gameplay/traffic/vehicle.lua
  local modelData = core_vehicles.getModel(obj.jbeam).model
  local _, configKey = path.splitWithoutExt(obj.partConfig)
  local configData = core_vehicles.getModel(obj.jbeam).configs[configKey]
    local partConfigStr = obj.partConfig
    local _, key = path.splitWithoutExt(partConfigStr)
    key = string.match(key, '%w*')
@/lua/ge/extensions/core/trailerRespawn.lua
  if vehicleData.config.partConfigFilename then -- this property is nil if the config was not from a file
    local _, configName, _ = path.splitWithoutExt(vehicleData.config.partConfigFilename)
    configInfo = core_vehicles.getConfig(vehicleData.config.model, configName)
@/lua/common/extensions/tech/techCapture.lua
local function getAllRelatedFiles(pathToFile, completeMatch, intermediateMatch)
  local dirname, baseFilename, extension = path.splitWithoutExt(pathToFile)
  baseFilename = baseFilename:gmatch("([^%.]+)")() -- change file. into file
@/lua/ge/extensions/tech/capturePlayer.lua

  local dirname, baseFilename, _ = path.splitWithoutExt(captureName)
  if dirname == nil then dirname = '' end
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/veJBeamSpellchecker.lua
  for _, filePath in ipairs(filePaths) do
    local dir, fileName, _ = path.splitWithoutExt(filePath)
@/lua/ge/extensions/util/export.lua
  local bufferViewID = _addBufferView(gltfRoot, bufferIDTexture, 0, fileSize, filepath)
  local dir, filename, ext = path.splitWithoutExt(filepath)
  if filename:endswith(".dds") then filename = filename:sub(1, -5) end
  if not M.embedBuffers then
    local dir, filename, ext = path.splitWithoutExt(filename)
    if dir == nil then
@/lua/ge/extensions/editor/api/object.lua
  local prefabFilename = string.match(newPrefabFilename, "[^/]*$")
  local dir, prefabName, ext = path.splitWithoutExt(prefabFilename, ".prefab.json")
  if not objName then
@/lua/ge/client/lighting.lua
  for _,filepath in ipairs(files) do
    local dir, filename, ext = path.splitWithoutExt(filepath)
    -- log('I', 'lightManager', '     loading manager   '..tostring(dir..filename))
  for _,filepath in ipairs(files) do
    local dir, filename, ext = path.splitWithoutExt(filepath)
    -- log('I', 'lightManager', '     loading manager   '..tostring(dir..filename))
@/lua/ge/extensions/scenario/scenarios.lua
  for i, filename in ipairs(scenario.prefabs) do
    local _, objNameNew, _ = path.splitWithoutExt(filename, ".prefab.json")
    local _, objNameOld, _ = path.splitWithoutExt(filename, ".prefab")
    local _, objNameNew, _ = path.splitWithoutExt(filename, ".prefab.json")
    local _, objNameOld, _ = path.splitWithoutExt(filename, ".prefab")
    local objName = string.lower(objNameNew or objNameOld)
@/lua/ge/extensions/core/vehicleTriggers.lua
      if vData.config then
        local dir, filename, ext = path.splitWithoutExt(tostring(vData.config.partConfigFilename))
        im.TextUnformatted(filename)
@/lua/ge/extensions/core/modmanager.lua
  if not originArchivePath then return nil end
  local _, filename, ext = path.splitWithoutExt(originArchivePath)
  return mods[filename]

  local dir, basefilename, ext = path.splitWithoutExt(filename)
  local targetPathOrg = '/mods/unpacked/' .. basefilename
  end
  local modpath, modname, modext = path.splitWithoutExt( dirPath:gsub('/$', '')..'.zip' )
  if not mods[modname] then
  end
  local dir, basefilename, ext = path.splitWithoutExt(filename)
  if ext == 'zip' and FS:fileExists(filename) and (type == 'added' or type == 'modified') then
@/lua/ge/extensions/gameplay/crawl/saveSystem.lua
  item._filePath = filePath
  local dir, fileName, ext = path.splitWithoutExt(filePath, true)
  item._fileName = fileName
@/lua/ge/extensions/gameplay/speedTrapLeaderboards.lua
    if leaderboardFileData then
      local _, levelName = path.splitWithoutExt(filePath)
      leaderboards[levelName] = leaderboardFileData
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/veJBeamVariablesChecker.lua
    for _, jbeamFilePath in ipairs(jbeamFilePaths) do
      local dir, fileName, _ = path.splitWithoutExt(jbeamFilePath)
@/lua/ge/extensions/util/inputSystemUtils.lua
      if not info.vidpid then
        local dir, filename, ext = path.splitWithoutExt(filepath)
        info.vidpid = filename:upper()
@/lua/ge/extensions/editor/barriersEditor.lua
    if not prefabsIndex[f] then
      local dir, filename, ext = path.splitWithoutExt(f)
      local scenetreeObject = spawnPrefab("prefab_temp_" .. filename ..os.time(), f, "0 0 0 ", "0 0 1", "1 1 1")
      local short = f:sub(levelPartLength)
      local dirInLevel, _,_ = path.splitWithoutExt(short)
      dirInLevel = dirInLevel or ""
@/lua/ge/extensions/gameplay/traffic/trafficUtils.lua
    for _, v in ipairs(files) do
      local _, fn = path.splitWithoutExt(v)
      if string.find(fn, string.lower(options.name)) then
@/lua/ge/extensions/editor/fileDialog.lua
      s.path = fn
      _, s.nameWithoutExt, s.extension = path.splitWithoutExt(fn)
      s.extension = string.lower(s.extension)
@/lua/ge/extensions/editor/trafficManager.lua

    local fp, fn = path.splitWithoutExt(filePath)
    local prefabFilePath = fp..fn..".prefab.json"

  local fp, fn = path.splitWithoutExt(filePath)
  local prefabFilePath = fp..fn..".prefab.json"
@/lua/ge/extensions/util/docCreator.lua
    -- try to use PIDVID from file name
    out.filename = string.lower(select(2, path.splitWithoutExt(inputmapPath)))
    out.identifier = string.match(out.filename, "^[^_]+") -- remove '_whatever' suffixes, used for additional secondary inputmaps
@/lua/ge/extensions/editor/crawlEditor/startingPositions.lua
      local oldFilePath = startingPosition._filePath
      local dir, _, ext = path.splitWithoutExt(oldFilePath, true)
      local newFilePath = dir .. newFileName .. "." .. ext
@/lua/ge/extensions/editor/resourceChecker.lua
  if im.BeginPopup("Popup_" .. res..count) then
    local dir, basefilename, ext = path.splitWithoutExt(res)
    if basefilename and basefilename ~= "" then
@/lua/ge/extensions/util/resaveMaterials.lua
  for _, fn in ipairs(files) do
    local dir, basefilename, ext = path.splitWithoutExt(fn)
    local objects = {}
@/lua/ge/extensions/editor/crawlEditor/boundaries.lua
      local oldFilePath = boundary._filePath
      local dir, _, ext = path.splitWithoutExt(oldFilePath, true)
      local newFilePath = dir ..  newFileName .. "." .. ext
@/lua/ge/ge_utils.lua
      if config then
        local _, configKey = path.splitWithoutExt(config)
        local configData = core_vehicles.getModel(model).configs[configKey or 0]
    vehicleData = {}
    local _, config, _ = path.splitWithoutExt(vehicle.partConfig)
    vehicleData.config = config
@/lua/ge/extensions/c2/panelPlugins/tileManager.lua
             if mat then
              local _, filename, _ = path.splitWithoutExt(mat)
              if filename then decalType = filename else decalType = mat end
@/lua/ge/extensions/editor/raceEditor.lua
  currentPath._dir = previousFilepath
  local dir, filename, ext = path.splitWithoutExt(previousFilename, true)
  currentPath._fnWithoutExt = filename
  race._dir = dir
  local a, fn2, b = path.splitWithoutExt(previousFilename, true)
  race._fnWithoutExt = fn2
  p._dir = dir
  local a, fn2, b = path.splitWithoutExt(previousFilename, true)
  p._fnWithoutExt = fn2
    currentPath._dir = previousFilepath
    local dir, filename, ext = path.splitWithoutExt(previousFilename, true)
    currentPath._fnWithoutExt = filename
@/lua/ge/main.lua
  log('I', 'convertPrefabtoJson', 'Converting cs prefab: ' .. tostring(filepath) )
  local dir, filename, ext = path.splitWithoutExt(filepath, ".prefab")
  log('I', 'convertPrefabtoJson', '  spawning prefab as = ' .. tostring(filename) )
  log('I', 'validatePrefabJson', 'Validating json prefab: ' .. tostring(filepath) )
  local dir, filename, ext = path.splitWithoutExt(filepath, ".prefab.json")
  log('I', 'validatePrefabJson', '  Validating prefab as = ' .. tostring(filename) )
@/lua/ge/extensions/gameplay/discover.lua
  for _, file in ipairs(discoverFiles) do
    local dir, fn, ext = path.splitWithoutExt(file)
    local discover = require(dir..fn)
@/lua/ge/extensions/editor/crawlEditor.lua
        trail._filePath = newFilePath
        local _, fileName, _ = path.splitWithoutExt(newFilePath, true)
        trail._fileName = fileName
        pathh._filePath = newFilePath
        local _, fileName, _ = path.splitWithoutExt(newFilePath, true)
        pathh._fileName = fileName
        boundary._filePath = newFilePath
        local _, fileName, _ = path.splitWithoutExt(newFilePath, true)
        boundary._fileName = fileName
        startingPosition._filePath = newFilePath
        local _, fileName, _ = path.splitWithoutExt(newFilePath, true)
        startingPosition._fileName = fileName
@/lua/ge/extensions/flowgraph/nodes/util/project.lua
    self.pinOut.hasFilename.value = true
    local dir, fn, ext = path.splitWithoutExt(self.mgr.savedFilename, true)
    self.pinOut.filename.value = fn
@/lua/ge/extensions/scenario/quickRaceLoader.lua
        --file.ignoreAsMission = true
        local dir, filename, ext = path.splitWithoutExt(trackFile, true)
        file.trackName = filename
@/lua/ge/extensions/flowgraph/nodes/states/stateNode.lua
      function(data)
        local dir, filename, ext = path.splitWithoutExt(data.filepath, true)
        local saveData = self:_onSerializeState()
@/lua/ge/extensions/flowgraph/nodes/gameplay/race/raceHighscoresComplete.lua
      local config = {Name = "Custom Config"}
      local _, fn, ext = path.splitWithoutExt(vData.config.partConfigFilename)
      for k, c in pairs(mData.configs) do
@/lua/ge/extensions/editor/flowgraph/examples.lua

      local dirname, fn, e = path.splitWithoutExt(filename, true)
      local path = dirname:sub(string.len(stateTemplatePath) + 1)
@/lua/ge/extensions/freeroam/freeroam.lua
local function onClientPreStartMission(levelPath)
  local path, file, ext = path.splitWithoutExt(levelPath)
  file = path .. 'mainLevel'
local function onClientStartMission(levelPath)
  local path, file, ext = path.splitWithoutExt(levelPath)
  file = path .. 'mainLevel'
  if not mainLevel then return end
  local path, file, ext = path.splitWithoutExt(levelPath)
  extensions.unload(path .. 'mainLevel')
@/lua/ge/extensions/career/modules/inventory.lua
    if vehicle.JBeam and vehicleData.config and vehicleData.config.partConfigFilename then
      local dir, configName, ext = path.splitWithoutExt(vehicleData.config.partConfigFilename)
      local baseConfig = core_vehicles.getConfig(vehicle.JBeam, configName)
  if not model then return nil end
  local _, configKey = path.splitWithoutExt(vehInfo.config.partConfigFilename)
  local config = model.configs[configKey]