From bfb1fc358301641c665617ea146b672d4c50a039 Mon Sep 17 00:00:00 2001 From: Hansly Saw <73412182+buzz-lightsnack-2007@users.noreply.github.com> Date: Sat, 7 May 2022 12:58:09 +0800 Subject: [PATCH] Fixed upload feature. --- BlenderRender.ipynb | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/BlenderRender.ipynb b/BlenderRender.ipynb index 312a79e..5fc836b 100644 --- a/BlenderRender.ipynb +++ b/BlenderRender.ipynb @@ -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", + "\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" ] }, {