Skip to content

Commit

Permalink
Deployed ef1e69b with MkDocs version: 1.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
kolibril13 committed Oct 16, 2024
1 parent bc9a67a commit 7c47e57
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
8 changes: 6 additions & 2 deletions getting_started/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -378,11 +378,15 @@ <h1 id="using-in-gui-mode">Using in GUI-mode</h1>
</span></code></pre></div></p>
<p>Now you can select the Blender kernel in Jupyter Lab.</p>
<p>Note: in GUI-mode, you can also use other notebook environments, e.g. VS Code notebooks or Saryrn notebooks.</p>
<iframe width="100%" height="400px" src="https://streamable.com/e/1cca8s" frameborder="0" allowfullscreen></iframe>
<!-- <iframe width="100%" height="400px" src="https://streamable.com/e/1cca8s" frameborder="0" allowfullscreen></iframe> -->

<!-- ![alt text](out.gif) -->

<p><img alt="alt text" src="../out.gif" /></p>
<p>Last try:</p>
<p>Version A)</p>
<video controls src="../video.mp4" title="Title"></video>
<p>Version B)</p>
<video controls src="video.mp4" title="Title"></video>



Expand Down
3 changes: 3 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,10 @@ <h1 id="blender-snippet-gallery-2">Blender Snippet Gallery 2</h1>
</span></span></code></pre></div>
<p><img src="image.png" alt="alt text" width="300"/></p>
<p>and another one:</p>
<p>Version A)</p>
<video controls src="../video.mp4" title="Title"></video>
<p>Version B)</p>
<video controls src="video.mp4" title="Title"></video>



Expand Down
2 changes: 1 addition & 1 deletion search/search_index.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Blender Snippet Gallery 2","text":"<pre><code>import bpy\nfrom IPython.display import display, Image\n\npath = \"test.png\"\nbpy.context.scene.render.resolution_x = 500\nbpy.context.scene.render.resolution_y = 200\nbpy.ops.render.render()\nbpy.data.images[\"Render Result\"].save_render(filepath=path)\ndisplay(Image(filename=path))\n</code></pre> <p>and another one:</p>"},{"location":"getting_started/","title":"Getting Started","text":""},{"location":"getting_started/#how-can-i-use-blender-with-python","title":"How can I use Blender with Python?","text":"<p>It's amazing that Blender has an internal Python editor, but sometimes it can be useful to use a more advanced Python environment like Jupyter notebooks, or VS Code notebooks.</p> <p>There are two ways to use blender in a notebook: </p> <ol> <li>headless-mode. The Blender Python module \"bpy\" will be installed from PyPi and the Blender GUI won't open while using bpy in your notebook. It will work even if you don't have a Blender version installed.</li> <li>gui-mode. Here, we'll us the Blender version installe on your system, so that you can interact with Blender from the GUI and send commands from the notebook.</li> </ol>"},{"location":"getting_started/#using-in-headless-mode","title":"Using in headless-mode","text":"<p>We're using the package manager uv. On mac, you can install uv by <code>curl -LsSf https://astral.sh/uv/install.sh | sh</code></p> <p>The notebook starts now with: <code>uvx --python 3.11 --with bpy==4.2.0 jupyter lab</code></p> <p>The convenient thing about uv: We can run the same command again, and it uses the version that uv cached internally. No need to use vitual environments, and also no need to manage the python installation yourself.</p> <p></p> Code <pre><code>import bpy\nfrom IPython.display import display, Image\nbpy.ops.render.render()\nbpy.data.images[\"Render Result\"].save_render(filepath=\"test.png\")\ndisplay(Image(filename=\"test.png\"))\n</code></pre> <p>Note, that headless-mode will only run with Python 3.11. (as of Blender 4.2)</p>"},{"location":"getting_started/#using-in-gui-mode","title":"Using in GUI-mode","text":"<p>We first need to install blender_notebook in order to register the blender kernel to our notebook environment.</p> <p>Also here, we're using the package manager uv.</p> <p>On MacOS, that's done by <pre><code>uvx blender_notebook install --blender-exec=\"/Applications/Blender.app/Contents/MacOS/Blender\"\nuvx --python 3.11 jupyter lab\n</code></pre></p> <p>On Windows, that's #TODO: TEST THIS FIRST, MAYBE ADJUST PATH <pre><code>uvx blender_notebook install --blender-exec=\"C:\\Program Files\\Blender Foundation\\Blender 4.2\\blender.exe\"\nuvx --python 3.11 jupyter lab\n</code></pre></p> <p>Now you can select the Blender kernel in Jupyter Lab.</p> <p>Note: in GUI-mode, you can also use other notebook environments, e.g. VS Code notebooks or Saryrn notebooks.</p> <p></p> <p>Last try:</p>"}]}
{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Blender Snippet Gallery 2","text":"<pre><code>import bpy\nfrom IPython.display import display, Image\n\npath = \"test.png\"\nbpy.context.scene.render.resolution_x = 500\nbpy.context.scene.render.resolution_y = 200\nbpy.ops.render.render()\nbpy.data.images[\"Render Result\"].save_render(filepath=path)\ndisplay(Image(filename=path))\n</code></pre> <p>and another one:</p> <p>Version A)</p> <p>Version B)</p>"},{"location":"getting_started/","title":"Getting Started","text":""},{"location":"getting_started/#how-can-i-use-blender-with-python","title":"How can I use Blender with Python?","text":"<p>It's amazing that Blender has an internal Python editor, but sometimes it can be useful to use a more advanced Python environment like Jupyter notebooks, or VS Code notebooks.</p> <p>There are two ways to use blender in a notebook: </p> <ol> <li>headless-mode. The Blender Python module \"bpy\" will be installed from PyPi and the Blender GUI won't open while using bpy in your notebook. It will work even if you don't have a Blender version installed.</li> <li>gui-mode. Here, we'll us the Blender version installe on your system, so that you can interact with Blender from the GUI and send commands from the notebook.</li> </ol>"},{"location":"getting_started/#using-in-headless-mode","title":"Using in headless-mode","text":"<p>We're using the package manager uv. On mac, you can install uv by <code>curl -LsSf https://astral.sh/uv/install.sh | sh</code></p> <p>The notebook starts now with: <code>uvx --python 3.11 --with bpy==4.2.0 jupyter lab</code></p> <p>The convenient thing about uv: We can run the same command again, and it uses the version that uv cached internally. No need to use vitual environments, and also no need to manage the python installation yourself.</p> <p></p> Code <pre><code>import bpy\nfrom IPython.display import display, Image\nbpy.ops.render.render()\nbpy.data.images[\"Render Result\"].save_render(filepath=\"test.png\")\ndisplay(Image(filename=\"test.png\"))\n</code></pre> <p>Note, that headless-mode will only run with Python 3.11. (as of Blender 4.2)</p>"},{"location":"getting_started/#using-in-gui-mode","title":"Using in GUI-mode","text":"<p>We first need to install blender_notebook in order to register the blender kernel to our notebook environment.</p> <p>Also here, we're using the package manager uv.</p> <p>On MacOS, that's done by <pre><code>uvx blender_notebook install --blender-exec=\"/Applications/Blender.app/Contents/MacOS/Blender\"\nuvx --python 3.11 jupyter lab\n</code></pre></p> <p>On Windows, that's #TODO: TEST THIS FIRST, MAYBE ADJUST PATH <pre><code>uvx blender_notebook install --blender-exec=\"C:\\Program Files\\Blender Foundation\\Blender 4.2\\blender.exe\"\nuvx --python 3.11 jupyter lab\n</code></pre></p> <p>Now you can select the Blender kernel in Jupyter Lab.</p> <p>Note: in GUI-mode, you can also use other notebook environments, e.g. VS Code notebooks or Saryrn notebooks.</p> <p>Last try:</p> <p>Version A)</p> <p>Version B)</p>"}]}

0 comments on commit 7c47e57

Please sign in to comment.