Is it possible to access the property of an operator (such as the filepath to the append operator) by python ?

  • 2
    $\begingroup$ Can you elaborate? $\endgroup$
    – batFINGER
    Aug 6, 2016 at 16:36
  • $\begingroup$ related: blender.stackexchange.com/questions/29134/… $\endgroup$
    – zeffii
    Aug 6, 2016 at 21:37
  • 1
    $\begingroup$ Possible duplicate of Return values of operators $\endgroup$
    – p2or
    Aug 7, 2016 at 12:03
  • $\begingroup$ poor this is not a duplicate of that Question, it's not about the return values but about the values that can be passed to the operator. $\endgroup$
    – zeffii
    Aug 20, 2016 at 11:34

1 Answer 1


Passing properties to an operator, here's a small example (see the test call towards the end). This snippet is an elaboration on TextEditor > Templates > Python > Operator Simple

import bpy

class SomeOperator(bpy.types.Operator):
    bl_idname = "object.some_operator"
    bl_label = "Simple Object Operator"
    property_one: bpy.props.StringProperty(default='state one')
    property_two: bpy.props.StringProperty(default='state two')

    def poll(cls, context):
        return True

    def execute(self, context):
        return {'FINISHED'}

def register():

def unregister():

if __name__ == "__main__":

    # test call
    bpy.ops.object.some_operator(property_one='woop_one', property_two='woop_two')

if you want to call such an operator from a layout element..

# if you want to pass a single property
row.operator('object.some_operator').property_one = 'some_new_value'

# if you want to pass multiple properties
some_op = row.operator('object.some_operator')
some_op.property_one = 'some new value one'
some_op.property_two = 'some new value two'


If you don't know the name of the properties, then you can use the Python console's autocomplete.

In this example hit ctrl+space after the parenthesis ( , here you see lines is the only property you can set.

enter image description here


Another resource is the current api docs use the search feature, type in for example bpy.ops.text.scroll and it will show the signature.

In the case of WM_OT_append you should be looking for bpy.ops.wm.append.


Use the tooltip that appears by default upon hovering of menu items / buttons:

enter image description here

  • $\begingroup$ Thank you for your reply but i'd like doing the same operation but with operators which i don't know name of the properties as the WM_OT_append operator. $\endgroup$
    – pistiwique
    Aug 6, 2016 at 20:17
  • $\begingroup$ @pistiwique how did you find the name of WM_OT_append ? $\endgroup$
    – zeffii
    Aug 20, 2016 at 11:36
  • $\begingroup$ By using the console's autocomplete typing bpy.types. $\endgroup$
    – pistiwique
    Aug 20, 2016 at 12:48
  • 1
    $\begingroup$ OK, then might I suggest using the tooltips that appear when hovering over menu items, that way you'll see the bpy.ops.* , when you autocomplete those , you will see the parameters as described above $\endgroup$
    – zeffii
    Aug 20, 2016 at 13:31

You must log in to answer this question.

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