Patch [#23759] more replace self.properties.foo --> self.foo for bf-extensions/trunk/py/scripts
by Filiciss Muhgue (filiciss). Thanks a lot! Part 1: Trunk, second part of patch will be committed to Extensions.
This commit is contained in:
@@ -56,5 +56,5 @@ def register():
|
||||
|
||||
def unregister():
|
||||
import bpy
|
||||
bpy.types.Scene.RemoveProperty("network_render")
|
||||
del bpy.types.Scene.network_render
|
||||
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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'}
|
||||
|
||||
Reference in New Issue
Block a user