| Code: |
| import bpy
def main(context): for ob in context.scene.objects: print(ob) class SimpleOperator2(bpy.types.Operator): """Tooltip""" bl_idname = "object.simple_operator2" bl_label = "Simple Object Operator2" @classmethod def poll(cls, context): return context.active_object is not None def execute(self, context): context.object.location.y += 1 return {'FINISHED'} class SimpleOperator(bpy.types.Operator): """Tooltip""" bl_idname = "object.simple_operator" bl_label = "Simple Object Operator" @classmethod def poll(cls, context): return context.active_object is not None def execute(self, context): #main(context) bpy.ops.mesh.select_all(action='SELECT') print(bpy.ops.transform.resize('INVOKE_DEFAULT')) bpy.ops.mesh.select_all(action='DESELECT') context.object.location.z += 2 print(context.active_operator) bpy.ops.object.simple_operator2() return {'FINISHED'} def register(): bpy.utils.register_class(SimpleOperator) bpy.utils.register_class(SimpleOperator2) def unregister(): bpy.utils.unregister_class(SimpleOperator) bpy.utils.unregister_class(SimpleOperator2) if __name__ == "__main__": register() # test call #bpy.ops.object.simple_operator() |