Page MenuHome

bpy.ops.object.select_pattern() function not properly receiving parameters
Closed, ArchivedPublic

Description

Attempting to use the Python interface in version 2.72 to select objects using the bpy.ops.object.select_pattern() function. When passing no parameters the function properly selects all objects, but when passing any additional parameters I receive errors. For example the line bpy.ops.object.select_pattern('*') throws the following error

Traceback (most recent call last):
File "<blender_console>", line 1, in <module>
File "C:\Program Files\Blender Foundation\Blender\2.72\scripts\modules\bpy\ops.py", line 186, in __call__
  ret = op_call(self.idname_py(), C_dict, kw, C_exec, C_undo)
TypeError: Calling operator "bpy.ops.object.select_pattern" error, expected a string enum in ('INVOKE_DEFAULT', 'INVOKE_REGION_WIN',   'INVOKE_REGION_CHANNELS', 'INVOKE_REGION_PREVIEW', 'INVOKE_AREA', 'INVOKE_SCREEN', 'EXEC_DEFAULT', 'EXEC_REGION_WIN', 'EXEC_REGION_CHANNELS', 'EXEC_REGION_PREVIE)

the following line bpy.ops.object.select_pattern('*',True,True) throws the following

Traceback (most recent call last):
File "<blender_console>", line 1, in <module>
File "C:\Program Files\Blender Foundation\Blender\2.72\scripts\modules\bpy\ops.py", line 185, in __call__
  C_dict, C_exec, C_undo = BPyOpsSubModOp._parse_args(args)
File "C:\Program Files\Blender Foundation\Blender\2.72\scripts\modules\bpy\ops.py", line 142, in _parse_args
  raise ValueError("1-3 args execution context is supported")
ValueError: 1-3 args execution context is supported

Event Timeline

Keith (kbigoness) raised the priority of this task from to 90.
Keith (kbigoness) updated the task description. (Show Details)
Keith (kbigoness) edited a custom field.
Julian Eisel (Severin) lowered the priority of this task from 90 to 30.Jan 19 2015, 5:16 PM

What is the exact command you're using? bpy.ops.object.select_pattern('*')?

Bastien Montagne (mont29) changed the task status from Unknown Status to Archived.Jan 19 2015, 5:21 PM
Bastien Montagne (mont29) claimed this task.

All parameters to Blender py ops must be passed by keywords, not as positional args (those are reserved for some specific, generic options like context execution and context overriding). Please read http://www.blender.org/api/blender_python_api_2_73_2/bpy.ops.html#keywords-and-positional-arguments.

I apologize for my misunderstanding, thank you for the assistance.