~siretart/ubuntu/utopic/blender/libav10

« back to all changes in this revision

Viewing changes to release/scripts/templates/operator_simple.py

  • Committer: Bazaar Package Importer
  • Author(s): Kevin Roy
  • Date: 2011-02-08 22:20:54 UTC
  • mfrom: (1.4.2 upstream)
  • mto: (14.2.6 sid) (1.5.1)
  • mto: This revision was merged to the branch mainline in revision 27.
  • Revision ID: james.westby@ubuntu.com-20110208222054-kk0gwa4bu8h5lyq4
Tags: upstream-2.56.1-beta-svn34076
ImportĀ upstreamĀ versionĀ 2.56.1-beta-svn34076

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import bpy
 
2
 
 
3
def main(context):
 
4
    for ob in context.scene.objects:
 
5
        print(ob)
 
6
 
 
7
class SimpleOperator(bpy.types.Operator):
 
8
    ''''''
 
9
    bl_idname = "object.simple_operator"
 
10
    bl_label = "Simple Object Operator"
 
11
 
 
12
    @classmethod
 
13
    def poll(cls, context):
 
14
        return context.active_object != None
 
15
 
 
16
    def execute(self, context):
 
17
        main(context)
 
18
        return {'FINISHED'}
 
19
 
 
20
 
 
21
if __name__ == "__main__":
 
22
    bpy.ops.object.simple_operator()