def PackMod_External(mod_name, target):
    util.InitialiseLog(target + ".log")
    util.StartTimer()
    util.LogInfo("Skyrim-NX-Toolkit {} - pack_mod".format(
        util.GetToolkitVersion()))
    PackMod(mod_name, target)
    util.EndTimer()
Exemple #2
0
def ConvertPath_External(mod_name, target):
    util.InitialiseLog(target + ".log")
    util.StartTimer()
    util.LogInfo("Skyrim-NX-Toolkit {} - convert_path".format(
        util.GetToolkitVersion()))
    ConvertPath(mod_name, target)
    util.EndTimer()
Exemple #3
0
def LoadOrder_External(origin, target, loadOrderName):
    util.InitialiseLog(os.path.join(origin, loadOrderName) + ".log")
    util.StartTimer()
    util.LogInfo("Skyrim-NX-Toolkit {} - load_order".format(
        util.GetToolkitVersion()))
    LoadOrder(origin, target, loadOrderName)
    util.EndTimer()
Exemple #4
0
def ConvertMod_External(origin, target, oldrim):
	print("<{}>".format(origin))
	util.InitialiseLog(origin + ".log")
	util.StartTimer()
	util.LogInfo("Skyrim-NX-Toolkit {} - convert_mod".format(util.GetToolkitVersion()))
	ConvertMod(origin, target, oldrim)
	util.EndTimer()
def RepackMod_External(origin, target):
    util.InitialiseLog(origin + ".log")
    util.StartTimer()
    util.LogInfo("Skyrim-NX-Toolkit {} - repack_mod".format(
        util.GetToolkitVersion()))
    RepackMod(origin, target)
    util.EndTimer()
    while i < len(buffer):
        buffer[i:i] = b'\x00\x00\x00'
        i += 4

    util.LogDebug("BUFFER<{}>".format(buffer))
    with open(filename, "wb") as outFile:

        outFile.write(b'\xff\xfe\x00\x00')
        outFile.write(buffer)
    return True


def ConvertTXT(target, filename):
    return ConvertTXT_Internal(filename)


def ConvertTXTAsync(target, filename, logname, ret):
    util.InitialiseMPLog(logname)
    retVal = ConvertTXT(target, filename)
    ret["retVal"] = retVal


if __name__ == '__main__':
    filename = sys.argv[1]
    util.InitialiseLog(filename + ".log")
    util.StartTimer()
    util.LogInfo("Skyrim-NX-Toolkit {} - convert_txt".format(
        util.GetToolkitVersion()))
    ConvertTXT_Internal(filename)
    util.EndTimer()
Exemple #7
0
    if has_havoc:
        LogProgress(ConvertListHKX, "ConvertHKX", convert_hkx.ConvertHKX,
                    "HKX 32-bit", "MaxAnimationThreads")
    LogProgress(ConvertListHKX64, "ConvertHKX64", convert_hkx64.ConvertHKX64,
                "HKX 64-bit", "MaxAnimationThreads")
    LogProgress(ConvertListTXT, "ConvertTXT", convert_txt.ConvertTXT, "TXT",
                "MaxOtherThreads")
    LogProgress(ConvertListSound, "ConvertSound", convert_sound.ConvertSound,
                "Sounds", "MaxSoundThreads")
    if do_meshes:
        LogProgress(ConvertListMesh, "ConvertMesh", convert_nif.ConvertNIF,
                    "Meshes", "MaxMeshThreads")


def ConvertPath_External(mod_name, target):
    util.InitialiseLog(target + ".log")
    util.StartTimer()
    util.LogInfo("Skyrim-NX-Toolkit {} - convert_path".format(
        util.GetToolkitVersion()))
    ConvertPath(mod_name, target)
    util.EndTimer()


if __name__ == '__main__':
    mod_name = sys.argv[1]
    target = sys.argv[2]
    util.InitialiseLog(target + ".log")
    util.StartTimer()
    ConvertPath(mod_name, target)
    util.EndTimer()
    if is_nxopus:
        util.RemoveFile(filename_nxopus)
    else:
        util.RemoveFile(filename_dsp0)
        if channel_count > 1:
            util.RemoveFile(filename_dsp1)
        if has_fuz and lip_size == 0:
            util.RemoveFile(filename_fuz)

    return True


def ConvertSound(target, filepath_without_extension):
    return ConvertSound_Internal(filepath_without_extension)


def ConvertSoundAsync(target, filename, logname, ret):
    util.InitialiseMPLog(logname)
    retVal = ConvertSound(target, filename)
    ret["retVal"] = retVal


if __name__ == '__main__':
    import sys
    filepath = sys.argv[1]
    util.InitialiseLog(filepath + ".log")
    util.StartTimer()
    util.LogInfo("Skyrim-NX-Toolkit {} - convert_txt".format(
        util.GetToolkitVersion()))
    ConvertSound_Internal(filepath)
    util.EndTimer()
	newSkyrimIni = newSkyrimIni.replace(sResourceArchiveList, newResourceArchiveList)
	newSkyrimIni = newSkyrimIni.replace(sResourceArchiveList2, newResourceArchiveList2)
	newSkyrimIni = newSkyrimIni.replace(sArchiveToLoadInMemoryList, newArchiveToLoadInMemoryList)
	WriteIniFile("Skyrim.ini", newSkyrimIni)

	for languageIni in languageInis:
		liFilename = languageInis[languageIni]
		languageBuffer = open(liFilename, 'r').read()
		util.LogDebug("opening " + liFilename)
		
		liResourceArchiveList2 = GetArchiveList("sResourceArchiveList2", languageBuffer, re.MULTILINE)
		newLiResourceArchiveList2 = liResourceArchiveList2 + resourceArchiveList2Additions
		languageBuffer = languageBuffer.replace(liResourceArchiveList2, newLiResourceArchiveList2)
		WriteIniFile(languageIni, languageBuffer)

def PackedLoadOrder_External(origin, target, loadOrderName):
	util.InitialiseLog(os.path.join(origin, loadOrderName) + ".log")
	util.StartTimer()
	util.LogInfo("Skyrim-NX-Toolkit {} - packed_load_order".format(util.GetToolkitVersion()))
	LoadOrder(origin, target, loadOrderName)
	util.EndTimer()

if __name__ == '__main__':
	origin = sys.argv[1]
	target = sys.argv[2]
	loadOrderName = sys.argv[3]
	util.InitialiseLog(os.path.join(origin, loadOrderName) + ".log")
	util.StartTimer()
	LoadOrder(origin, target, loadOrderName)
	util.EndTimer()
Exemple #10
0
                util.LogDebug("Relative path {} OR Path {}".format(
                    relative_path, oldrim_path))
                oldrim_file_path = os.path.join(oldrim_path, relative_path)
                totalCount += 1
                util.LogDebug("Found {}, checking {}".format(
                    file_path, oldrim_file_path))
                if os.path.exists(oldrim_file_path):
                    util.LogDebug(
                        "Found {} match in oldrim".format(oldrim_file_path))
                    matchedCount += 1
                    CopyHKX.append((file_path, oldrim_file_path))
    util.LogInfo("Matched {}/{} hkx files in the mod".format(
        matchedCount, totalCount))

    for i in range(len(CopyHKX)):
        (copy_to, copy_from) = CopyHKX[i]
        util.LogDebug("Copying {}->{}".format(copy_from, copy_to))
        shutil.copy2(copy_from, copy_to)
        sys.stdout.write("Reconciled {}/{} \r".format(i + 1, len(CopyHKX)))
        sys.stdout.flush()
    sys.stdout.write("\n")


if __name__ == '__main__':
    mod_path = sys.argv[1]
    oldrim_path = sys.argv[2]
    util.InitialiseLog(mod_path + ".log")
    util.StartTimer()
    ReconcileHKX(mod_path, oldrim_path)
    util.EndTimer()
    util.LogDebug("Target Created")

    for root, subdirs, files in os.walk(origin):
        if root != origin:
            FoldersToCreate.append(root)
            util.LogDebug("Adding folder ({})".format(root))
        for filename in files:
            file_path = os.path.join(root, filename)
            FilesToCreate.append(file_path)
            util.LogDebug("Adding file ({})".format(file_path))
    for folderToCreate in FoldersToCreate:
        util.LogDebug("About to add folder ({})".format(folderToCreate))
        newFolderName = folderToCreate.replace(origin, target)
        util.LogDebug("New folder name is ({})".format(newFolderName))
        os.mkdir(newFolderName)

    for fileToCreate in FilesToCreate:
        util.LogDebug("About to add file ({})".format(fileToCreate))
        newFileName = fileToCreate.replace(origin, target)
        util.LogDebug("New filename is ({})".format(newFileName))
        with open(newFileName, "w") as myFile:
            myFile.write("TESTFILE")


if __name__ == '__main__':
    origin = sys.argv[1]
    target = sys.argv[2]
    util.InitialiseLog(origin + ".log")
    util.StartTimer()
    MakeTest(origin, target)
    util.EndTimer()
                        check_path = os.path.dirname(check_path)
                        util.LogDebug("Checking path {}".format(check_path))
                    for path_to_create in paths_to_create:
                        util.LogDebug("{} does not exist.".format(check_path))
                        os.mkdir(path_to_create)
                    shutil.move(file_path, temp_path)
                    currentFileSizeTally += file_size
                    filesArchived += 1
                    sys.stdout.write("Prepared {}/{} \r".format(
                        filesArchived, totalFileCount))
                    sys.stdout.flush()
    sys.stdout.write("\n")
    if currentFileSizeTally > 0:
        WriteBSA()

    util.LogInfo("Clean Up")

    os.chdir(script_path)
    return bsaFileWritten


if __name__ == '__main__':
    target_folder = sys.argv[1]
    origin_folder = sys.argv[2]
    bsa_basename = os.path.basename(origin_folder) + ".bsa"
    bsa_basename = bsa_basename.replace(" ", "")
    bsa_filename = os.path.join(target_folder, bsa_basename)
    util.InitialiseLog(bsa_filename + ".log")
    util.StartTimer()
    BsarchBSA(target_folder, bsa_basename)
    util.EndTimer()