Simplified.

This commit is contained in:
Hansly Saw 2022-05-07 11:03:51 +08:00 committed by GitHub
parent 7a0a1c4441
commit 24daffb5fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -18,6 +18,8 @@
},
"source": [
"# Blender Render Script for Colab\n",
"_Uses some codes of [BlenderRender](https://urlzs.com/4hkfp) by [aniquetahir](https://urlzs.com/ToHpE)._\n",
"\n",
"Render Blender files online, for free. "
]
},
@ -151,21 +153,27 @@
" raise TypeError(\"No! Please run this in \" + formatting.font.bold + 'Google CoLab' + formatting.clear + '. ')\n",
"\n",
"def install(what, isCritical = False):\n",
" info.status('Installing ' + what + ' and all its dependencies…')\n",
" try:\n",
" if what == \"blender\": \n",
" if os.system('apt install blender libboost-all-dev libgl1-mesa-dev -y') > 0: \n",
" if os.system('apt-get install blender libboost-all-dev libgl1-mesa-dev -y') > 0: raise\n",
" except:\n",
" errorMsg = ('Either ' + what + ' and/or its dependencies could not get installed. ')\n",
" if isCritical: \n",
" raise SystemError(errorMsg + 'Unfortunately, this module is required. ')\n",
" else:\n",
" info.err(errorMsg)\n",
" if what == \"required\":\n",
" install(\"blender\", True)\n",
" install(\"libboost-all-dev\")\n",
" install(\"libgl1-mesa-dev\")\n",
" else:\n",
" info.status('Installing ' + what + '…')\n",
" try:\n",
" if os.system('apt install ' + what + ' -y') > 0: \n",
" if os.system('apt-get install ' + what + ' -y') > 0: \n",
" if os.system('apt install --fix-broken ' + what + ' -y'): raise\n",
" except:\n",
" errorMsg = (what + ' could not get installed. ')\n",
" if isCritical: raise SystemError(errorMsg + 'Unfortunately, this module is required. ')\n",
" else: info.err(errorMsg)\n",
" else: \n",
" os.system('apt clean && apt autoremove -y')\n",
" info.success('Installed '+ what + '.')\n",
"\n",
"def main():\n",
" check_compatibility()\n",
" install(\"blender\", True)\n",
" install(\"required\")\n",
"\n",
"main()"
]
@ -658,6 +666,9 @@
}
],
"source": [
"# Command line arguments from here: https://urlzs.com/MiUkt\n",
"# Some explanation here: https://urlzs.com/au5z7\n",
"\n",
"!blender -b $filename -noaudio -o ./test_ -E $renderer -x 1"
]
},