Python script to extrude with scale restriction

I am working on a python script and to find the right function calls I have been cutting and pasting from the top bar of the scripting window after I do the step manually. It was going great. For instance, I went into edit on an object, selected some vertices and manually did and extrude restricting it to the Z axis. Then I put the code into my script:

bpy.ops.mesh.extrude_region_move(MESH_OT_extrude_region={"mirror":False},
TRANSFORM_OT_translate={"value":(0, 0, 0),
"constraint_axis":(False, False, False),
"constraint_orientation":'GLOBAL',
"mirror":False,
"proportional":'DISABLED',
"proportional_edit_falloff":'SMOOTH',
"proportional_size":1,
"snap":False,
"snap_target":'CLOSEST',
"snap_point":(0, 0, 0),
"snap_align":False,
"snap_normal":(0, 0, 0),
"gpencil_strokes":False,
"texture_space":False,
"remove_on_cancel":False,
"release_confirm":False})


and it worked fine.

But, then I selected a different ring of vertices and did an Extrude (E) -> Scale (S) then restricted the scaling to the XY plane (Shift+Z) and did the scaling extrusion. In the UI it worked fine. But, when I copy the code:

bpy.ops.mesh.extrude_region_move(MESH_OT_extrude_region={"mirror":False},
TRANSFORM_OT_resize={"value":(2.12492, 2.12492, 2.12492),
"constraint_axis":(True, True, False),
"constraint_orientation":'GLOBAL',
"mirror":False,
"proportional":'DISABLED',
"proportional_edit_falloff":'SMOOTH',
"proportional_size":1,
"snap":False,
"snap_target":'CLOSEST',
"snap_point":(0, 0, 0),
"snap_align":False,
"snap_normal":(0, 0, 0),
"gpencil_strokes":False,
"texture_space":False,
"remove_on_cancel":False,
"release_confirm":False})


to the script and run it, it says:

TypeError: Converting py args to operator properties: : keyword "TRANSFORM_OT_resize" unrecognized


Error: Python script fail, look in the console for now...

I searched for TRANSFORM_OT_resize and I can't find any ref to it.

• Just a hint: try splitting up your code so we don't have to scroll all the way to the side to see all of your code. It's easier to identify your code when all the text is on the screen at the same time. Aug 3 '17 at 22:34
• Hi James, I'd say this is a bug, at the very least in that the reported operator call is in error. TRANSFORM_OT_resize is the class name (TYPE_OperatorType_name naming convention) of the scale operator bpy.ops.transform.resize(...). TRANSFORM_OT_resize is not a property of bpy.ops.mesh.extrude_move, TRANSFORM_OT_translate is. Suggest reporting to the Bug Tracker Aug 4 '17 at 6:15
• Without testing, would say you can get around this by running extrude_move, followed by bpy.ops.transform.resize(value=(2, 2, 2), ...) Aug 4 '17 at 6:22
• This finally got added to the bug tracker developer.blender.org/T84148 Sep 18 at 3:10

    bpy.ops.object.mode_set(mode = 'EDIT')