From 24daffb5fcf52d7bcbb2e68915deae3e4e287d19 Mon Sep 17 00:00:00 2001 From: Hansly Saw <73412182+buzz-lightsnack-2007@users.noreply.github.com> Date: Sat, 7 May 2022 11:03:51 +0800 Subject: [PATCH] Simplified. --- BlenderRender.ipynb | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/BlenderRender.ipynb b/BlenderRender.ipynb index d0b0102..312a79e 100644 --- a/BlenderRender.ipynb +++ b/BlenderRender.ipynb @@ -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" ] },