1
$\begingroup$

Is there a useful way to manually create and initialize an instance operator class, such as would be done when running it?

A bunch of stuff would be easier to figure out if I could poke around inside an active operator object to see how it's structured.

$\endgroup$

1 Answer 1

1
$\begingroup$

Operator.get_rna_type

This is not an instance of the operator, as documented it is an "Internal function for introspection"

for example the properties of the transform translate operator

>>> bpy.ops.transform.translate.get_rna_type(
get_rna_type(self)
Internal function for introspection
>>> rna = bpy.ops.transform.translate.get_rna_type()
>>> rna.properties['
                    constraint_axis']
                    cursor_transform']
                    gpencil_strokes']
                    mirror']
                    orient_matrix']
                    orient_matrix_type']
...

                    use_proportional_edit']
                    use_proportional_projected']
                    value']

Or directly after using the operator

>>> op = C.active_operator
>>> op
<bpy_struct, Operator("TRANSFORM_OT_translate") at 0x7f8cf52b8e88>

see also

Is there a way to access a bpy.types.Operator value

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .