============ Run a script ============ .. index:: run script, load script, start script .. |a| image:: /images/all/blender-basics/a-scripts/script-start-100.png Objectives ========== .. tabularcolumns:: | c | l | :border: none +-------+-------------------------------------------------------------------------+ | |a| | Now that you learned about the basic structure of a script, we will | | | save, load and run the script to check if it does exactly what | | | the programmer (i.e. you) has thought. | +-------+-------------------------------------------------------------------------+ Instructions ============ :Tasks: 1. Create a project folder for all scripts. 2. Check and run the script discussed in the last station. 3. Activate all functions from the template. 4. Replace *pass* in function_1 with a *print* function. 5. Add a fourth function that is creating a new sphere in the 3D World at location (1,1,3) | Load script ... .. image:: /images/all/blender-basics/a-scripts/script-load.png | | Run script... .. image:: /images/all/blender-basics/a-scripts/script-run.png | | Output... .. image:: /images/all/blender-basics/a-scripts/output.png | .. image:: /images/all/label-windows.png :width: 32px | Windows: output .. image:: /images/all/blender-basics/a-scripts/output-win.png Start with console on MacOS =========================== .. index:: MAC console, console (MacOS) .. image:: /images/all/label-macos.png :width: 32px If you start Blender with a double click, no output will be shown. As a workaround start Blender within a console. Everybody who is familiar with a terminal, moves to the folder of blender.app and starts the application in the background with the following command: ./blender.app/Contents/MacOS/blender & A second way to start Blender, search Blender with *Finder* and open the package with a right mouse click: .. image:: /images/all/blender-basics/a-scripts/mac-search-blender.png | | move to the blender file and start it with a double click: | .. image:: /images/all/blender-basics/a-scripts/mac-start-blender.png Blender is starting and a terminal window is opened. Do not close this window until you want to quit Blender. Errors and print output is now visible in the terminal window.