# 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
• If this answer solved Your problem, please accept it. If not, I can still help You. – Piotr Kowalczyk May 12 '19 at 20:54
• Hi, I'm sorry, it's my first time asking a question here on this site, so I don't know how things work here, no idea how to accept something. I upvoted your answer but somehow it doesn't show up either. And no, unfortunately I wasn't able to achieve what I want yet, as I have no idea how to deal with your code. All I want is to display those number fields in my custom panel, so I can use them there instead of going to the keymap settings. – TheRedWaxPolice May 13 '19 at 14:08