Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'release/scripts/startup/bl_operators')
-rw-r--r--release/scripts/startup/bl_operators/add_mesh_torus.py2
-rw-r--r--release/scripts/startup/bl_operators/clip.py9
-rw-r--r--release/scripts/startup/bl_operators/object_quick_effects.py3
-rw-r--r--release/scripts/startup/bl_operators/presets.py5
-rw-r--r--release/scripts/startup/bl_operators/uvcalc_smart_project.py18
5 files changed, 20 insertions, 17 deletions
diff --git a/release/scripts/startup/bl_operators/add_mesh_torus.py b/release/scripts/startup/bl_operators/add_mesh_torus.py
index 056b3478c2b..5b28cdf44ae 100644
--- a/release/scripts/startup/bl_operators/add_mesh_torus.py
+++ b/release/scripts/startup/bl_operators/add_mesh_torus.py
@@ -86,7 +86,7 @@ class AddTorus(Operator):
'''Add a torus mesh'''
bl_idname = "mesh.primitive_torus_add"
bl_label = "Add Torus"
- bl_options = {'REGISTER', 'UNDO'}
+ bl_options = {'REGISTER', 'UNDO', 'PRESET'}
major_radius = FloatProperty(
name="Major Radius",
diff --git a/release/scripts/startup/bl_operators/clip.py b/release/scripts/startup/bl_operators/clip.py
index d085b7ea105..55592621112 100644
--- a/release/scripts/startup/bl_operators/clip.py
+++ b/release/scripts/startup/bl_operators/clip.py
@@ -155,7 +155,8 @@ class CLIP_OT_delete_proxy(Operator):
self._rmproxy(d + '_undistorted')
self._rmproxy(os.path.join(absproxy, 'proxy_' + str(x) + '.avi'))
- tc = ('free_run.blen_tc', 'interp_free_run.blen_tc', \
+ tc = ('free_run.blen_tc',
+ 'interp_free_run.blen_tc',
'record_run.blen_tc')
for x in tc:
@@ -280,10 +281,10 @@ class CLIP_OT_constraint_to_fcurve(Operator):
efra = max(efra, track.markers[-1].frame)
if sfra is None or efra is None:
- return
+ return
# Store object matrices
- for x in range(sfra, efra+1):
+ for x in range(sfra, efra + 1):
scene.frame_set(x)
matrices.append(ob.matrix_world.copy())
@@ -291,7 +292,7 @@ class CLIP_OT_constraint_to_fcurve(Operator):
# Apply matrices on object and insert keyframes
i = 0
- for x in range(sfra, efra+1):
+ for x in range(sfra, efra + 1):
scene.frame_set(x)
ob.matrix_world = matrices[i]
diff --git a/release/scripts/startup/bl_operators/object_quick_effects.py b/release/scripts/startup/bl_operators/object_quick_effects.py
index 490ee230220..a062ac6f4c5 100644
--- a/release/scripts/startup/bl_operators/object_quick_effects.py
+++ b/release/scripts/startup/bl_operators/object_quick_effects.py
@@ -105,8 +105,7 @@ class QuickFur(Operator):
psys.settings.child_type = 'INTERPOLATED'
obj.data.materials.append(mat)
- obj.particle_systems[-1].settings.material = \
- len(obj.data.materials)
+ psys.settings.material = len(obj.data.materials)
return {'FINISHED'}
diff --git a/release/scripts/startup/bl_operators/presets.py b/release/scripts/startup/bl_operators/presets.py
index ac19bab4c66..dca96b302fb 100644
--- a/release/scripts/startup/bl_operators/presets.py
+++ b/release/scripts/startup/bl_operators/presets.py
@@ -395,9 +395,8 @@ class AddPresetOperator(AddPresetBase, Operator):
options={'HIDDEN'},
)
- # XXX, not ideal
preset_defines = [
- "op = bpy.context.space_data.operator",
+ "op = bpy.context.active_operator",
]
@property
@@ -432,7 +431,7 @@ class WM_MT_operator_presets(Menu):
bl_label = "Operator Presets"
def draw(self, context):
- self.operator = context.space_data.operator.bl_idname
+ self.operator = context.active_operator.bl_idname
Menu.draw_preset(self, context)
@property
diff --git a/release/scripts/startup/bl_operators/uvcalc_smart_project.py b/release/scripts/startup/bl_operators/uvcalc_smart_project.py
index 66d0d72efc1..17e353ff238 100644
--- a/release/scripts/startup/bl_operators/uvcalc_smart_project.py
+++ b/release/scripts/startup/bl_operators/uvcalc_smart_project.py
@@ -212,8 +212,11 @@ def islandIntersectUvIsland(source, target, SourceOffset):
# Edge intersect test
for ed in edgeLoopsSource:
for seg in edgeLoopsTarget:
- i = geometry.intersect_line_line_2d(\
- seg[0], seg[1], SourceOffset+ed[0], SourceOffset+ed[1])
+ i = geometry.intersect_line_line_2d(seg[0],
+ seg[1],
+ SourceOffset+ed[0],
+ SourceOffset+ed[1],
+ )
if i:
return 1 # LINE INTERSECTION
@@ -773,15 +776,16 @@ def main_consts():
global ROTMAT_2D_POS_45D
global RotMatStepRotation
- ROTMAT_2D_POS_90D = Matrix.Rotation( radians(90.0), 2)
- ROTMAT_2D_POS_45D = Matrix.Rotation( radians(45.0), 2)
+ ROTMAT_2D_POS_90D = Matrix.Rotation(radians(90.0), 2)
+ ROTMAT_2D_POS_45D = Matrix.Rotation(radians(45.0), 2)
RotMatStepRotation = []
rot_angle = 22.5 #45.0/2
while rot_angle > 0.1:
- RotMatStepRotation.append([\
- Matrix.Rotation( radians(rot_angle), 2),\
- Matrix.Rotation( radians(-rot_angle), 2)])
+ RotMatStepRotation.append([
+ Matrix.Rotation(radians(+rot_angle), 2),
+ Matrix.Rotation(radians(-rot_angle), 2),
+ ])
rot_angle = rot_angle/2.0