Merge branch 'blender-v2.82-release'
This commit is contained in:
commit
21dee6f894
|
@ -64,7 +64,7 @@ def randnum(low=0.0, high=1.0, seed=0):
|
|||
(type=float)
|
||||
high - higher range
|
||||
(type=float)
|
||||
seed - the random seed number, if seed is 0, the current time will be used instead
|
||||
seed - the random seed number, if seed == 0, the current time will be used instead
|
||||
(type=int)
|
||||
Returns:
|
||||
a random number
|
||||
|
@ -99,14 +99,14 @@ def vTurbNoise(x, y, z, iScale=0.25, Size=1.0, Depth=6, Hard=False, Basis=0, See
|
|||
(type=int)
|
||||
basis - type of noise used for turbulence
|
||||
(type=int)
|
||||
Seed - the random seed number, if seed is 0, the current time will be used instead
|
||||
Seed - the random seed number, if seed == 0, the current time will be used instead
|
||||
(type=int)
|
||||
Returns:
|
||||
the generated turbulence vector.
|
||||
(type=3-float list)
|
||||
"""
|
||||
rand = randnum(-100, 100, Seed)
|
||||
if Basis is 9:
|
||||
if Basis == 9:
|
||||
Basis = 14
|
||||
vec = Vector((x / Size + rand, y / Size + rand, z / Size + rand))
|
||||
vTurb = Noise.turbulence_vector(vec, Depth, Hard)
|
||||
|
@ -142,7 +142,7 @@ def ProfileCurve(type=0, a=0.25, b=0.25):
|
|||
"""
|
||||
|
||||
newpoints = []
|
||||
if type is 1:
|
||||
if type == 1:
|
||||
# H:
|
||||
a *= 0.5
|
||||
b *= 0.5
|
||||
|
@ -153,7 +153,7 @@ def ProfileCurve(type=0, a=0.25, b=0.25):
|
|||
[1.0 - a, -b, 0.0], [-1.0 + a, -b, 0.0], [-1.0 + a, -1.0, 0.0],
|
||||
[-1.0, -1.0, 0.0]
|
||||
]
|
||||
elif type is 2:
|
||||
elif type == 2:
|
||||
# T:
|
||||
a *= 0.5
|
||||
newpoints = [
|
||||
|
@ -161,7 +161,7 @@ def ProfileCurve(type=0, a=0.25, b=0.25):
|
|||
[1.0, 1.0 - b, 0.0], [a, 1.0 - b, 0.0], [a, -1.0, 0.0],
|
||||
[-a, -1.0, 0.0], [-a, 1.0 - b, 0.0], [-1.0, 1.0 - b, 0.0]
|
||||
]
|
||||
elif type is 3:
|
||||
elif type == 3:
|
||||
# U:
|
||||
a *= 0.5
|
||||
newpoints = [
|
||||
|
@ -169,7 +169,7 @@ def ProfileCurve(type=0, a=0.25, b=0.25):
|
|||
[-1.0 + a, -1.0 + b, 0.0], [1.0 - a, -1.0 + b, 0.0], [1.0 - a, 1.0, 0.0],
|
||||
[1.0, 1.0, 0.0], [1.0, -1.0, 0.0], [-1.0, -1.0, 0.0]
|
||||
]
|
||||
elif type is 4:
|
||||
elif type == 4:
|
||||
# Z:
|
||||
a *= 0.5
|
||||
newpoints = [
|
||||
|
@ -209,7 +209,7 @@ def ArrowCurve(type=1, a=1.0, b=0.5):
|
|||
"""
|
||||
|
||||
newpoints = []
|
||||
if type is 0:
|
||||
if type == 0:
|
||||
# Arrow1:
|
||||
a *= 0.5
|
||||
b *= 0.5
|
||||
|
@ -219,7 +219,7 @@ def ArrowCurve(type=1, a=1.0, b=0.5):
|
|||
[-1.0 + a, -1.0, 0.0], [-1.0 + a, -b, 0.0],
|
||||
[-1.0, -b, 0.0]
|
||||
]
|
||||
elif type is 1:
|
||||
elif type == 1:
|
||||
# Arrow2:
|
||||
newpoints = [[-a, b, 0.0], [a, 0.0, 0.0], [-a, -b, 0.0], [0.0, 0.0, 0.0]]
|
||||
else:
|
||||
|
@ -251,7 +251,7 @@ def RectCurve(type=1, a=1.0, b=0.5, c=1.0):
|
|||
"""
|
||||
|
||||
newpoints = []
|
||||
if type is 1:
|
||||
if type == 1:
|
||||
# Rounded Rectangle:
|
||||
newpoints = [
|
||||
[-a, b - b * 0.2, 0.0], [-a + a * 0.05, b - b * 0.05, 0.0], [-a + a * 0.2, b, 0.0],
|
||||
|
@ -259,7 +259,7 @@ def RectCurve(type=1, a=1.0, b=0.5, c=1.0):
|
|||
[a, -b + b * 0.2, 0.0], [a - a * 0.05, -b + b * 0.05, 0.0], [a - a * 0.2, -b, 0.0],
|
||||
[-a + a * 0.2, -b, 0.0], [-a + a * 0.05, -b + b * 0.05, 0.0], [-a, -b + b * 0.2, 0.0]
|
||||
]
|
||||
elif type is 2:
|
||||
elif type == 2:
|
||||
# Rounded Rectangle II:
|
||||
newpoints = []
|
||||
x = a
|
||||
|
@ -410,10 +410,10 @@ def ArcCurve(sides=6, startangle=0.0, endangle=90.0, innerradius=0.5, outerradiu
|
|||
# Arc: turn cyclic curve flag off!
|
||||
|
||||
# Segment:
|
||||
if type is 2:
|
||||
if type == 2:
|
||||
newpoints.append([0, 0, 0])
|
||||
# Ring:
|
||||
elif type is 3:
|
||||
elif type == 3:
|
||||
j = sides - 1
|
||||
while j > -1:
|
||||
t = (j * step) + angle * startangle
|
||||
|
@ -574,7 +574,7 @@ def CycloidCurve(number=100, type=0, R=4.0, r=1.0, d=1.0):
|
|||
newpoints = []
|
||||
step = 2.0 / (number - 1)
|
||||
i = 0
|
||||
if type is 1:
|
||||
if type == 1:
|
||||
# Hypotrochoid / Hypocycloid
|
||||
while i < number:
|
||||
t = i * step
|
||||
|
@ -583,7 +583,7 @@ def CycloidCurve(number=100, type=0, R=4.0, r=1.0, d=1.0):
|
|||
z = 0
|
||||
newpoints.append([x, y, z])
|
||||
i += 1
|
||||
elif type is 2:
|
||||
elif type == 2:
|
||||
# Epitrochoid / Epycycloid
|
||||
while i < number:
|
||||
t = i * step
|
||||
|
@ -683,7 +683,7 @@ def NoiseCurve(type=0, number=100, length=2.0, size=0.5,
|
|||
newpoints = []
|
||||
step = (length / number)
|
||||
i = 0
|
||||
if type is 1:
|
||||
if type == 1:
|
||||
# noise circle
|
||||
while i < number:
|
||||
t = i * step
|
||||
|
@ -693,7 +693,7 @@ def NoiseCurve(type=0, number=100, length=2.0, size=0.5,
|
|||
z = v[2] * scale[2]
|
||||
newpoints.append([x, y, z])
|
||||
i += 1
|
||||
elif type is 2:
|
||||
elif type == 2:
|
||||
# noise knot / ball
|
||||
while i < number:
|
||||
t = i * step
|
||||
|
@ -1331,7 +1331,7 @@ class Curveaceous_galore(Operator, object_utils.AddObjectHelper):
|
|||
col.prop(self, "MiscCurveType")
|
||||
col.prop(self, "MiscCurvevar1", text="Width")
|
||||
col.prop(self, "MiscCurvevar2", text="Height")
|
||||
if self.MiscCurveType is 2:
|
||||
if self.MiscCurveType == 2:
|
||||
col.prop(self, "MiscCurvevar3", text="Corners")
|
||||
|
||||
elif self.ProfileType == 'Flower':
|
||||
|
@ -1391,7 +1391,7 @@ class Curveaceous_galore(Operator, object_utils.AddObjectHelper):
|
|||
col = box.column(align=True)
|
||||
col.prop(self, "cyclo_a")
|
||||
col.prop(self, "cyclo_b")
|
||||
if self.cycloType is not 0:
|
||||
if self.cycloType != 0:
|
||||
col.prop(self, "cyclo_d")
|
||||
|
||||
elif self.ProfileType == 'Helix':
|
||||
|
@ -1483,12 +1483,12 @@ class Curveaceous_galore(Operator, object_utils.AddObjectHelper):
|
|||
if self.ProfileType in ['Helix', 'Noise', 'Cycloid']:
|
||||
self.use_cyclic_u = False
|
||||
if self.ProfileType in ['Cycloid']:
|
||||
if self.cycloType is 0:
|
||||
if self.cycloType == 0:
|
||||
self.use_cyclic_u = False
|
||||
else:
|
||||
self.use_cyclic_u = True
|
||||
else:
|
||||
if self.ProfileType == 'Arc' and self.arcType is 1:
|
||||
if self.ProfileType == 'Arc' and self.arcType == 1:
|
||||
self.use_cyclic_u = False
|
||||
else:
|
||||
self.use_cyclic_u = True
|
||||
|
|
|
@ -109,34 +109,34 @@ def no_bias(a):
|
|||
|
||||
def shapes(x, y, z, shape=0):
|
||||
p = pi
|
||||
if shape is 1:
|
||||
if shape == 1:
|
||||
# ring
|
||||
x = x * p
|
||||
y = y * p
|
||||
s = cos(x**2 + y**2) / (x**2 + y**2 + 0.5)
|
||||
elif shape is 2:
|
||||
elif shape == 2:
|
||||
# swirl
|
||||
x = x * p
|
||||
y = y * p
|
||||
s = ((x * sin(x * x + y * y) + y * cos(x * x + y * y)) / (x**2 + y**2 + 0.5))
|
||||
elif shape is 3:
|
||||
elif shape == 3:
|
||||
# bumps
|
||||
x = x * p
|
||||
y = y * p
|
||||
z = z * p
|
||||
s = 1 - ((cos(x * p) + cos(y * p) + cos(z * p)) - 0.5)
|
||||
elif shape is 4:
|
||||
elif shape == 4:
|
||||
# wave
|
||||
x = x * p * 2
|
||||
y = y * p * 2
|
||||
s = sin(x + sin(y))
|
||||
elif shape is 5:
|
||||
elif shape == 5:
|
||||
# z grad.
|
||||
s = (z * p)
|
||||
elif shape is 6:
|
||||
elif shape == 6:
|
||||
# y grad.
|
||||
s = (y * p)
|
||||
elif shape is 7:
|
||||
elif shape == 7:
|
||||
# x grad.
|
||||
s = (x * p)
|
||||
else:
|
||||
|
@ -154,24 +154,24 @@ def marble_noise(x, y, z, origin, size, shape, bias, sharpnes, turb, depth, hard
|
|||
z += origin[2]
|
||||
value = s + turb * turbulence_vector((x, y, z), depth, hard, noise_basis=basis)[1]
|
||||
|
||||
if bias is 1:
|
||||
if bias == 1:
|
||||
value = cos_bias(value)
|
||||
elif bias is 2:
|
||||
elif bias == 2:
|
||||
value = tri_bias(value)
|
||||
elif bias is 3:
|
||||
elif bias == 3:
|
||||
value = saw_bias(value)
|
||||
else:
|
||||
value = sin_bias(value)
|
||||
|
||||
if sharpnes is 1:
|
||||
if sharpnes == 1:
|
||||
value = 1.0 - sharp(value)
|
||||
elif sharpnes is 2:
|
||||
elif sharpnes == 2:
|
||||
value = 1.0 - sharper(value)
|
||||
elif sharpnes is 3:
|
||||
elif sharpnes == 3:
|
||||
value = soft(value)
|
||||
elif sharpnes is 4:
|
||||
elif sharpnes == 4:
|
||||
value = sharp(value)
|
||||
elif sharpnes is 5:
|
||||
elif sharpnes == 5:
|
||||
value = sharper(value)
|
||||
else:
|
||||
value = 1.0 - soft(value)
|
||||
|
@ -557,7 +557,7 @@ def noise_gen(coords, props):
|
|||
x, y, z = coords
|
||||
|
||||
# Origin
|
||||
if rseed is 0:
|
||||
if rseed == 0:
|
||||
origin = x_offset, y_offset, z_offset
|
||||
origin_x = x_offset
|
||||
origin_y = y_offset
|
||||
|
|
|
@ -186,5 +186,5 @@ def get_commands_vi(cfg, clargs, **kwargs):
|
|||
An iterator with the 1st element as a tag (the `what` parameter) and the 2nd
|
||||
element as the iterator of the actual commands.
|
||||
"""
|
||||
ws = filter(lambda x: x is not "all", cfg["extensions"])
|
||||
ws = filter(lambda x: x != "all", cfg["extensions"])
|
||||
return chain.from_iterable(map(lambda w: get_commands(cfg, clargs, what=w, **kwargs), ws))
|
||||
|
|
|
@ -36,7 +36,7 @@ def checktools(tools):
|
|||
msg = ["BPSProxy couldn't find external dependencies:"]
|
||||
msg += [
|
||||
"[{check}] {tool}: {path}".format(
|
||||
check="v" if path is not "" else "X", tool=tool, path=path or "NOT FOUND"
|
||||
check="v" if path != "" else "X", tool=tool, path=path or "NOT FOUND"
|
||||
)
|
||||
for tool, path in check["tools"]
|
||||
]
|
||||
|
|
|
@ -41,7 +41,7 @@ def checktools(tools):
|
|||
msg = ["BPSRender couldn't find external dependencies:"]
|
||||
msg += [
|
||||
"[{check}] {tool}: {path}".format(
|
||||
check="v" if path is not "" else "X", tool=tool, path=path or "NOT FOUND"
|
||||
check="v" if path != "" else "X", tool=tool, path=path or "NOT FOUND"
|
||||
)
|
||||
for tool, path in check["tools"]
|
||||
]
|
||||
|
|
Loading…
Reference in New Issue