diff options
author | M.G. Kishalmi <lmg@kishalmi.net> | 2011-12-08 19:55:49 +0400 |
---|---|---|
committer | M.G. Kishalmi <lmg@kishalmi.net> | 2011-12-08 19:55:49 +0400 |
commit | 7797c1dc424b1f772f23a3b8730a8374012d8c8b (patch) | |
tree | e0a027f09ec1eab6f90b67b4b16e58348eb36b5c /release/scripts/startup/bl_operators | |
parent | 46626e4f5f3d7e56b83d51829491cb5fe9ed98a6 (diff) |
randomize transform operators 'rotation' property subtype changed
from TRANSLATION to EULER and tweaks needed along with that.
Diffstat (limited to 'release/scripts/startup/bl_operators')
-rw-r--r-- | release/scripts/startup/bl_operators/object_randomize_transform.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/release/scripts/startup/bl_operators/object_randomize_transform.py b/release/scripts/startup/bl_operators/object_randomize_transform.py index f0d2448b508..ed881fab5fd 100644 --- a/release/scripts/startup/bl_operators/object_randomize_transform.py +++ b/release/scripts/startup/bl_operators/object_randomize_transform.py @@ -20,13 +20,12 @@ import bpy from bpy.types import Operator - +from mathutils import Vector def randomize_selected(seed, delta, loc, rot, scale, scale_even, scale_min): import random from random import uniform - from mathutils import Vector random.seed(seed) @@ -86,6 +85,7 @@ def randomize_selected(seed, delta, loc, rot, scale, scale_even, scale_min): from bpy.props import (IntProperty, BoolProperty, FloatVectorProperty) +from math import pi class RandomizeLocRotSize(Operator): @@ -129,10 +129,10 @@ class RandomizeLocRotSize(Operator): rot = FloatVectorProperty( name="Rotation", description="Maximun rotation over each axis", - min=-180.0, - max=180.0, + min=-pi, + max=pi, default=(0.0, 0.0, 0.0), - subtype='TRANSLATION', + subtype='EULER', ) use_scale = BoolProperty( name="Randomize Scale", @@ -162,14 +162,12 @@ class RandomizeLocRotSize(Operator): ) def execute(self, context): - from math import radians - seed = self.random_seed delta = self.use_delta loc = None if not self.use_loc else self.loc - rot = None if not self.use_rot else self.rot * radians(1.0) + rot = None if not self.use_rot else Vector(self.rot) scale = None if not self.use_scale else self.scale scale_even = self.scale_even |