TRANSFORM_OT_translate documentation

Hi all you great Blender coding people.

I am looking for the documentation of the TRANSFORM_OT_translate
In the bpy.ops.mesh. extrude_region_move ( MESH_OT_extrude_region=None , TRANSFORM_OT_translate=None )

I am looking for the object description and what is required etc.

Can anybody help me?

I have looked in the blender Python API documentation, but have not been able to find this.

Thanks in advance

Assuming you’re trying to determine what context an operator expects, this is not something that’s well documented, but you can try to find the requirements yourself by passing an empty dictionary as override to the operator. This will make PyContext generate a list of missing context keys, and you can pick out what keys an operator expects.

If you type the following in the (interactive) console it will fail, but the warnings this generates can be useful to determine the context:

# empty dictionary
override = {}
bpy.ops.mesh.extrude_region_move(override)

This generates a long list of missing keys in the (other) console. You can ignore ‘screen’, ‘area’, ‘window’ and ‘region’ since they relate to the working area, and because the (empty) dictionary we passed has no keys in it, but if you come across anything that says ‘object’ or ‘edit’, you’ll know that the operator tried to access those keys from the dictionary.

Here’s what the above code generates. I’ve marked interesting keys with a <:

PyContext 'window' not found
PyContext 'edit_object' not found <
PyContext 'region' not found
PyContext 'area' not found
PyContext 'screen' not found
PyContext 'screen' not found
PyContext 'area' not found
PyContext 'window' not found
PyContext 'screen' not found
PyContext 'window' not found
PyContext 'edit_object' not found <
PyContext 'region' not found
PyContext 'area' not found
PyContext 'screen' not found
PyContext 'screen' not found
PyContext 'area' not found
PyContext 'window' not found
PyContext 'screen' not found
PyContext 'edit_object' not found <
PyContext 'region' not found
PyContext 'area' not found
PyContext 'screen' not found
PyContext 'screen' not found
PyContext 'area' not found
PyContext 'scene' not found
PyContext 'region' not found
PyContext 'area' not found
PyContext 'screen' not found
PyContext 'screen' not found
PyContext 'area' not found
PyContext 'scene' not found
PyContext 'region' not found
PyContext 'area' not found
PyContext 'screen' not found
PyContext 'screen' not found
PyContext 'area' not found
PyContext 'region' not found
PyContext 'area' not found
PyContext 'edit_object' not found <
PyContext 'region' not found
PyContext 'area' not found
PyContext 'screen' not found
PyContext 'screen' not found
PyContext 'area' not found
PyContext 'active_object' not found <
PyContext 'region' not found
PyContext 'area' not found
PyContext 'screen' not found
PyContext 'screen' not found
PyContext 'area' not found
PyContext 'gpencil_data' not found
PyContext 'region' not found
PyContext 'area' not found
PyContext 'screen' not found
PyContext 'screen' not found
PyContext 'area' not found
PyContext 'active_object' not found <
PyContext 'region' not found
PyContext 'area' not found
PyContext 'screen' not found
PyContext 'screen' not found
PyContext 'area' not found
PyContext 'active_object' not found <
PyContext 'region' not found
PyContext 'area' not found
PyContext 'screen' not found
PyContext 'screen' not found
PyContext 'area' not found
convertViewVec: called in an invalid context
PyContext 'scene' not found
PyContext 'region' not found
PyContext 'area' not found
PyContext 'screen' not found
PyContext 'screen' not found
PyContext 'area' not found
PyContext 'window' not found
PyContext 'region' not found
PyContext 'scene' not found
PyContext 'region' not found
PyContext 'area' not found
PyContext 'screen' not found
PyContext 'screen' not found
PyContext 'area' not found

From this list, we know the operator asked for:

bpy.context.edit_object and
bpy.context.active_object

You now can probably construct a new dictionary overriding these if that’s what you wanted, although I don’t see how that’s useful with this particular operator :stuck_out_tongue:

Okay I got it…
TRANSFORM_OT_translate is a dictionary type with the following key-value pairs.
TRANSFORM_OT_translate={"value": (0.3, 0.3, 0.3), "constraint_axis": (True, True, True), "constraint_orientation" :'NORMAL'}
I guess you know the rest, value is a tuple of x,y,z co-ordinates and so on…
There may be other key-value pairs but right now I only know of these but it seems it will get the job done…