Python Console Editor, bpy.ops exercise doesnt work #47359

Closed
opened 2016-02-08 02:20:30 +01:00 by eroMoD · 8 comments
Member

Im over here reading the Blender 2.76 manual
and the last exercise on this page doesnt work

https://www.blender.org/manual/editors/python_console.html

Im over here reading the Blender 2.76 manual and the last exercise on this page doesnt work https://www.blender.org/manual/editors/python_console.html
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'
Author
Member

Added subscriber: @eroMoD

Added subscriber: @eroMoD

Added subscriber: @ideasman42

Added subscriber: @ideasman42

Quick test works OK here.
Please give details on what doesn't work.

Quick test works OK here. Please give details on what doesn't work.
Author
Member

I copy/paste:
mylayers = [False] * 20

then hit return

then I copy/paste:
mylayers- [x] = True

then I hit return

then I copy/paste:
add_cube = bpy.ops.mesh.primitive_cube_add

then hit return

then I copy/paste:
for index in range(0, 5):
... add_cube(location=(index * 3, 0, 0), layers=mylayers)

then hit return

and this shows up in red:

File "<blender_console>", line 2
  ...     add_cube(location=(index * 3, 0, 0), layers=mylayers)
    ^

IndentationError: expected an indented block

I copy/paste: mylayers = [False] * 20 then hit return then I copy/paste: mylayers- [x] = True then I hit return then I copy/paste: add_cube = bpy.ops.mesh.primitive_cube_add then hit return then I copy/paste: for index in range(0, 5): ... add_cube(location=(index * 3, 0, 0), layers=mylayers) then hit return and this shows up in red: ``` File "<blender_console>", line 2 ... add_cube(location=(index * 3, 0, 0), layers=mylayers) ^ ``` IndentationError: expected an indented block

This issue was referenced by 1311

This issue was referenced by 1311

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Campbell Barton self-assigned this 2016-02-08 11:46:30 +01:00

This is showing what the python prompt will look like, you're not meant to type it in.
Yet its not really needed, and a bit confusing, removed rBM1311.

This is showing what the python prompt will look like, you're not meant to type it in. Yet its not really needed, and a bit confusing, removed rBM1311.
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-manual#47359
No description provided.