Blender (software): Difference between revisions

From David's Wiki
Line 30: Line 30:


===Saving scripts outside===
===Saving scripts outside===
See [https://b3d.interplanety.org/en/using-external-ide-pycharm-for-writing-blender-scripts/ using external ide] and [https://blender.stackexchange.com/questions/51074/how-to-run-a-python-script-external-to-blender-to-run-bpy-commands-in-blendersp].
See [https://b3d.interplanety.org/en/using-external-ide-pycharm-for-writing-blender-scripts/ using external ide] and [https://blender.stackexchange.com/questions/51074/how-to-run-a-python-script-external-to-blender-to-run-bpy-commands-in-blendersp run external scripts].


By default, everything is stored in the <code>.blend</code> file including your custom scripts.
By default, everything is stored in the <code>.blend</code> file including your custom scripts.

Revision as of 17:04, 1 June 2021

Blender is an open-source 3D modelling software.
It can be used for creating 3D models for games, 2D/3D animations, and even video games.

Getting Started

Installation

Windows

Direct Download
From chocolatey:

choco install blender
Ubuntu

Blender is available on the Snap store

sudo snap install blender --classic

Modelling

Scripting

Blender Python API

Getting Started

Blender supports scripting as an alternative means of interaction. Most things are available in the bpy module.

See one of the following resources to get started:

Saving scripts outside

See using external ide and run external scripts.

By default, everything is stored in the .blend file including your custom scripts. If you want to store your scripts outside or use another IDE, you will need to have the script inside Blender call the script outside:

import bpy
filepath = bpy.path.abspath("//myscript.py")
exec(compile(open(filepath).read(), filename, 'exec'))

Resources