In Blender2.74, I want to circle-select the vertices in the "3D View", using this: circle_select(x = 300, y = 400, radius = 30)
.
I found this question. So I know how to get the xy positions in the camera coordinate system.
Now I don't know how to use the API "bpy.ops.view3d.select_circle()". When I used the command in python console, the following error occured.
bpy.ops.view3d.select_circle(x=500, y=500, radius=10)
Traceback (most recent call last):
File "<blender_console>", line 1, in <module>
File "C:\Program Files\Blender Foundation\Blender\2.74\scripts\modules\bpy\ops.py",
line 189, in __call__
ret = op_call(self.idname_py(), None, kw)
RuntimeError: Operator bpy.ops.view3d.select_circle.poll() expected a view3d region
Can I use this API in the "Python Console?
And, I will probably have to convert the xy positions in the camera-cood to those in the "3D View". Please teach me this also.
location_3d_to_region_2d
to get X and Y and do the selection with math ( if P inside the circle ? ) , otherwise you have to be in the right context to useselect_circle
$\endgroup$select_circle
will be called many times. So I think it undesirable to check if each vertex in in inside the circle with Python. If possible, I want to use the API, which is called when I use the selection(circular region) in the GUI. But, I don't know its name. $\endgroup$