I run an operator in the console, but the operator properties are not shown in Tool Panel.
However, if I run the operator from search, the properties will be shown up.
How to show operator properties when running operator in scripts or console?
Blender Stack Exchange is a question and answer site for people who use Blender to create 3D graphics, animations, or games. It only takes a minute to sign up.
Sign up to join this communityThat is called the Redo Panel. Built in operators executed from the command line won't automatically show up here. You would need to make your own operator class with an execute function that has its own properties that are used in executing the operator.
import bpy
from bpy.props import IntProperty, FloatProperty
class BoxOperator(bpy.types.Operator):
"""example of making a box"""
bl_idname = "object.box_operator"
bl_label = "Simple Box Operator"
bl_options = {"REGISTER","UNDO"}
x_location = FloatProperty()
def execute(self, context):
bpy.ops.mesh.primitive_cube_add(enter_editmode=False, location=(self.x_location, 0, 0))
return {'FINISHED'}
def register():
bpy.utils.register_class(BoxOperator)
def unregister():
bpy.utils.unregister_class(BoxOperator)
if __name__ == "__main__":
register()
# test call
bpy.ops.object.box_operator('INVOKE_DEFAULT')
Executing this as a script will work. However, if you register this class and run it from the python console, you will still not get a redo panel. You would need to enter all of this line by line into the python console or execute the operator from the 3d view.