# How to display and use operator properties in a custom UI panel? [duplicate]

For example, as you can see in the keymap preferences, there are operators that have properties, like this Smooth Vertices:

With this little code row.operator("mesh.vertices_smooth") I can make a button to execute this operator in my UI panel

So how can I do the same with those properties and checkboxes, for them to show up in my custom panel, so then I can set some settings before clicking the button?

This is in blender 2.8 by the way..

Thanks...

You can set new property like this:

bpy.types.Scene.my_use_x=bpy.props.BoolProperty()
row.prop(context.scene, 'my_use_x')


And set property of operator like this:

operator = row.operator("mesh.vertices_smooth")
operator.use_x = context.scene.my_use_x
operator.use_y = False
operator.factor = 2


I do not use blender 2.8 and I did not test this. But it should work.

• Thanks for answering. Also I should probably say that I'm a python newbie, so I almost have no clue how to deal with your code haha. But I'll see what I can do with it. Thanks again. – TheRedWaxPolice May 8 '19 at 21:27