2

This might be a really stupid question-I'm working in bpy right now and want to add a plane at a specific location...I know that How to add an object at a specific posistion in Blender Game Engine works for bge but am not sure if it'll work in bpy...

29374819
  • 331
  • 4
  • 10

2 Answers2

4

The tooltip of the Add > Mesh > Plane menu path shows this information, press Ctrl+C to copy it to clipboard.

Tooltip

enter image description here

All of these menu items trigger operators and take several optional arguments, location=(x,y,z) included. The same applies to the other items in the Curve, Surface Metaball etc., menus.

Docs

The total list can be found in several locations, in the docs

Blender's Python Console

use the auto complete feature (ctrl+space) in the Blender python console after typing bpy.ops.mesh.primitive_

enter image description here

The arguments to the bpy.ops.* can be found doing auto completion too

enter image description here

Info Panel

You can see the history of most of the code which has been triggered in the UI, in the Info panel if you drag it down

enter image description here

zeffii
  • 39,634
  • 9
  • 103
  • 186
  • "CTRL-C on a ToolTip" to copy the datapath or the Python function is a great TIP..works with SHIFT-CTRL-C on fields with values and checkboxes in all other windows – Master Heavy Oct 18 '19 at 06:27
0
bpy.ops.mesh.primitive_plane_add(location=(x,y,z)) 

does the trick

David
  • 49,291
  • 38
  • 159
  • 317
29374819
  • 331
  • 4
  • 10