Fixed upload feature.

This commit is contained in:
Hansly Saw 2022-05-07 12:58:09 +08:00 committed by GitHub
parent 24daffb5fc
commit bfb1fc3583
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -61,23 +61,36 @@
" try: from google.colab import files\n",
" except: raise TypeError(\"No! Please run this in \" + formatting.font.bold + 'Google CoLab' + formatting.clear + '. ')\n",
"\n",
"def getExtension(fileName): \n",
" import os\n",
" fileName_split = os.path.splitext(fileName)\n",
"\n",
" return fileName_split[1].lower()\n",
"\n",
"def UploadBlendFile(): # Make sure that the file is actually a Blender file. \n",
" check_compatibility()\n",
"\n",
" from google.colab import files\n",
" import pathlib; from google.colab import files\n",
" uploaded_file = files.upload()\n",
" \n",
" return uploaded_file\n",
"\n",
"\n",
"class configuration: \n",
" #@markdown ### Input\n",
" \n",
" upload_new = False #@param [True, False]\n",
" #@markdown Run this cell to upload the Blender file. \n",
" if upload_new == True: blendFile = UploadBlendFile()\n",
"\n",
" blendFile = UploadBlendFile()\n",
" blend_fileName = '' #@param {type: \"string\"}\n",
"\n",
" #@markdown ### Animation Processing\n",
" if getExtension(blend_fileName) != '.blend': blend_fileName = (str(blend_fileName) + '.blend')\n",
"\n",
" #@markdown ### Processing\n",
" renderer = \"CYCLES\" #@param [\"CYCLES\", \"BLENDER_EEVEE\", \"BLENDER_WORKBENCH\"]\n",
" frame = 1 #@param {type: \"number\"}\n"
" frame_start = 1 #@param {type: \"number\"}\n",
" frame_end = 1 #@param {type: \"number\"}\n"
]
},
{