Patch [#23759] more replace self.properties.foo --> self.foo for bf-extensions/trunk...
authorThomas Dinges <blender@dingto.org>
Fri, 10 Sep 2010 23:39:43 +0000 (23:39 +0000)
committerThomas Dinges <blender@dingto.org>
Fri, 10 Sep 2010 23:39:43 +0000 (23:39 +0000)
by Filiciss Muhgue (filiciss). Thanks a lot!

Part 1: Trunk, second part of patch will be committed to Extensions.

release/scripts/io/netrender/__init__.py
release/scripts/op/io_mesh_ply/__init__.py
release/scripts/op/io_scene_fbx/__init__.py
release/scripts/op/io_scene_obj/__init__.py
release/scripts/op/io_shape_mdd/__init__.py
release/scripts/ui/properties_data_armature_rigify.py

index 52921770910631a404c138aec86d67f72afdc11d..241bb7eba85050ac08db9f383d292cd5fe81a75a 100644 (file)
@@ -56,5 +56,5 @@ def register():
 
 def unregister():
     import bpy
-    bpy.types.Scene.RemoveProperty("network_render")
+    del bpy.types.Scene.network_render
 
index c174b16f46c27b3670dad3af6bcb82d147fc457c..18820dea549062bae9070d2342ebf8530414bc0c 100644 (file)
@@ -44,21 +44,20 @@ class ExportPLY(bpy.types.Operator, ExportHelper):
         return context.active_object != None
 
     def execute(self, context):
-        filepath = self.properties.filepath
+        filepath = self.filepath
         filepath = bpy.path.ensure_ext(filepath, self.filename_ext)
         import io_mesh_ply.export_ply
         return io_mesh_ply.export_ply.save(self, context, **self.properties)
 
     def draw(self, context):
         layout = self.layout
-        props = self.properties
 
         row = layout.row()
-        row.prop(props, "use_modifiers")
-        row.prop(props, "use_normals")
+        row.prop(self.properties, "use_modifiers")
+        row.prop(self.properties, "use_normals")
         row = layout.row()
-        row.prop(props, "use_uv_coords")
-        row.prop(props, "use_colors")
+        row.prop(self.properties, "use_uv_coords")
+        row.prop(self.properties, "use_colors")
 
 
 def menu_func(self, context):
index 5eb48868dd81880103f299fff28690be41b5ca5f..d1bf5e168e41bde36ed37f12f8e388fae28a278e 100644 (file)
@@ -69,7 +69,7 @@ class ExportFBX(bpy.types.Operator, ExportHelper):
     def execute(self, context):
         import math
         from mathutils import Matrix
-        if not self.properties.filepath:
+        if not self.filepath:
             raise Exception("filepath not set")
 
         mtx4_x90n = Matrix.Rotation(-math.pi / 2.0, 4, 'X')
@@ -77,12 +77,12 @@ class ExportFBX(bpy.types.Operator, ExportHelper):
         mtx4_z90n = Matrix.Rotation(-math.pi / 2.0, 4, 'Z')
 
         GLOBAL_MATRIX = Matrix()
-        GLOBAL_MATRIX[0][0] = GLOBAL_MATRIX[1][1] = GLOBAL_MATRIX[2][2] = self.properties.TX_SCALE
-        if self.properties.TX_XROT90:
+        GLOBAL_MATRIX[0][0] = GLOBAL_MATRIX[1][1] = GLOBAL_MATRIX[2][2] = self.TX_SCALE
+        if self.TX_XROT90:
             GLOBAL_MATRIX = mtx4_x90n * GLOBAL_MATRIX
-        if self.properties.TX_YROT90:
+        if self.TX_YROT90:
             GLOBAL_MATRIX = mtx4_y90n * GLOBAL_MATRIX
-        if self.properties.TX_ZROT90:
+        if self.TX_ZROT90:
             GLOBAL_MATRIX = mtx4_z90n * GLOBAL_MATRIX
 
         import io_scene_fbx.export_fbx
index d3791d1cd9586a2fcb2c2f595466c005038d9474..7220084cc7eb0a8de7734f7b5ea343b0c068c4c7 100644 (file)
@@ -57,17 +57,17 @@ class ImportOBJ(bpy.types.Operator, ImportHelper):
         import io_scene_obj.import_obj
         return io_scene_obj.import_obj.load(self, context, **self.properties)
         '''
-        load_obj(self.properties.filepath,
+        load_obj(self.filepath,
                  context,
-                 self.properties.CLAMP_SIZE,
-                 self.properties.CREATE_FGONS,
-                 self.properties.CREATE_SMOOTH_GROUPS,
-                 self.properties.CREATE_EDGES,
-                 self.properties.SPLIT_OBJECTS,
-                 self.properties.SPLIT_GROUPS,
-                 self.properties.ROTATE_X90,
-                 self.properties.IMAGE_SEARCH,
-                 self.properties.POLYGROUPS)
+                 self.CLAMP_SIZE,
+                 self.CREATE_FGONS,
+                 self.CREATE_SMOOTH_GROUPS,
+                 self.CREATE_EDGES,
+                 self.SPLIT_OBJECTS,
+                 self.SPLIT_GROUPS,
+                 self.ROTATE_X90,
+                 self.IMAGE_SEARCH,
+                 self.POLYGROUPS)
         '''
 
         return {'FINISHED'}
@@ -113,7 +113,7 @@ class ExportOBJ(bpy.types.Operator, ExportHelper):
 
     def execute(self, context):
         import io_scene_obj.export_obj
-        print(self.properties.keys())
+        print(self.keys())
         return io_scene_obj.export_obj.save(self, context, **self.properties)
 
 
index 0af4af92b7c3d6e432dd6c129076513369b3c1ba..9e54477afbb560831636ed4dc488a238f0549abb 100644 (file)
@@ -49,8 +49,8 @@ class ImportMDD(bpy.types.Operator, ImportHelper):
 
         # initialize from scene if unset
         scene = context.scene
-        if not self.properties.is_property_set("frame_start"):
-            self.properties.frame_start = scene.frame_current
+        if not self.frame_start:
+            self.frame_start = scene.frame_current
         
         import io_shape_mdd.import_mdd
         return io_shape_mdd.import_mdd.load(self, context, **self.properties)
@@ -83,12 +83,12 @@ class ExportMDD(bpy.types.Operator, ExportHelper):
     def execute(self, context):
         # initialize from scene if unset
         scene = context.scene
-        if not self.properties.is_property_set("frame_start"):
-            self.properties.frame_start = scene.frame_start
-        if not self.properties.is_property_set("frame_end"):
-            self.properties.frame_end = scene.frame_end
-        if not self.properties.is_property_set("fps"):
-            self.properties.fps = scene.render.fps
+        if not self.frame_start:
+            self.frame_start = scene.frame_start
+        if not self.frame_end:
+            self.frame_end = scene.frame_end
+        if not self.fps:
+            self.fps = scene.render.fps
 
         import io_shape_mdd.export_mdd
         return io_shape_mdd.export_mdd.save(self, context, **self.properties)
index ef96e094928f386dcee210362c1775bbb7d7c0ec..f796182127749884c100dcc07c54fa144f242ea4 100644 (file)
@@ -187,8 +187,8 @@ class Sample(bpy.types.Operator):
     def execute(self, context):
         import rigify
         reload(rigify)
-        final = (self.properties.metarig_type == "")
-        objects = rigify.generate_test(context, metarig_type=self.properties.metarig_type, GENERATE_FINAL=final)
+        final = (self.metarig_type == "")
+        objects = rigify.generate_test(context, metarig_type=self.metarig_type, GENERATE_FINAL=final)
 
         if len(objects) > 1:
             for i, (obj_meta, obj_gen) in enumerate(objects):
@@ -238,7 +238,7 @@ class AsScript(bpy.types.Operator):
         reload(rigify_utils)
         obj = context.object
         code = rigify_utils.write_meta_rig(obj)
-        path = self.properties.filepath
+        path = self.filepath
         file = open(path, "w")
         file.write(code)
         file.close()
@@ -248,7 +248,7 @@ class AsScript(bpy.types.Operator):
     def invoke(self, context, event):
         import os
         obj = context.object
-        self.properties.filepath = os.path.splitext(bpy.data.filepath)[0] + "-" + bpy.path.clean_name(obj.name) + ".py"
+        self.filepath = os.path.splitext(bpy.data.filepath)[0] + "-" + bpy.path.clean_name(obj.name) + ".py"
         wm = context.window_manager
         wm.add_fileselect(self)
         return {'RUNNING_MODAL'}