C# to Python 3
python setup.py install
import gflive2d
with open('model.moc.txt', 'rb') as f:
data = gflive2d.decrypt(f.read())
with open('model.moc', 'wb') as f:
f.write(data)
Extension Change Guide
- .moc.txt → .moc
- .mtn.txt → .mtn
- .txt → .json
# This code is an example and is not included within the module.
def extensionChanger(ext):
return {
'moc.txt': 'moc',
'mtn.txt': 'mtn',
'txt': 'json'
}.get(ext, ext)
filename = 'model.moc.txt'
filename, extension = filename.split('.', 1)
extension = extensionChanger(extension)
# filename='model', extension='moc'
版权属于: Perfare's Blog 原文地址: https://www.perfare.net/1162.html