diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-04-23 11:06:29 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-04-23 11:06:29 +0400 |
commit | 53917c4e3a9afc243a7bc374950b8ed51d4659d6 (patch) | |
tree | 3b53b09921814dd4f809a902b5b24368759aa6fa /release/scripts | |
parent | 511451c8b87f9ab07df15ee36592f1071101b2d0 (diff) |
rna attribute consistency edits, use common prefix for booleans.
Diffstat (limited to 'release/scripts')
16 files changed, 180 insertions, 188 deletions
diff --git a/release/scripts/freestyle/style_modules/parameter_editor.py b/release/scripts/freestyle/style_modules/parameter_editor.py index 11398ef2ad8..e267b513ba4 100644 --- a/release/scripts/freestyle/style_modules/parameter_editor.py +++ b/release/scripts/freestyle/style_modules/parameter_editor.py @@ -59,24 +59,24 @@ class ScalarBlendModifier(StrokeShader): def blend(self, v1, v2): fac = self.__influence facm = 1.0 - fac - if self.__blend == "MIX": + if self.__blend == 'MIX': v1 = facm * v1 + fac * v2 - elif self.__blend == "ADD": + elif self.__blend == 'ADD': v1 += fac * v2 - elif self.__blend == "MULTIPLY": + elif self.__blend == 'MULTIPLY': v1 *= facm + fac * v2; - elif self.__blend == "SUBTRACT": + elif self.__blend == 'SUBTRACT': v1 -= fac * v2 - elif self.__blend == "DIVIDE": + elif self.__blend == 'DIVIDE': if v2 != 0.0: v1 = facm * v1 + fac * v1 / v2 - elif self.__blend == "DIFFERENCE": + elif self.__blend == 'DIFFERENCE': v1 = facm * v1 + fac * abs(v1 - v2) - elif self.__blend == "MININUM": + elif self.__blend == 'MININUM': tmp = fac * v1 if v1 > tmp: v1 = tmp - elif self.__blend == "MAXIMUM": + elif self.__blend == 'MAXIMUM': tmp = fac * v1 if v1 < tmp: v1 = tmp @@ -87,7 +87,7 @@ class ScalarBlendModifier(StrokeShader): class CurveMappingModifier(ScalarBlendModifier): def __init__(self, blend, influence, mapping, invert, curve): ScalarBlendModifier.__init__(self, blend, influence) - assert mapping in ("LINEAR", "CURVE") + assert mapping in {'LINEAR', 'CURVE'} self.__mapping = getattr(self, mapping) self.__invert = invert self.__curve = curve @@ -103,7 +103,7 @@ class CurveMappingModifier(ScalarBlendModifier): class ThicknessModifierMixIn: def __init__(self): scene = freestyle.getCurrentScene() - self.__persp_camera = (scene.camera.data.type == "PERSP") + self.__persp_camera = (scene.camera.data.type == 'PERSP') def set_thickness(self, sv, outer, inner): fe = sv.first_svertex.get_fedge(sv.second_svertex) nature = fe.nature @@ -129,16 +129,16 @@ class ThicknessBlenderMixIn(ThicknessModifierMixIn): self.__position = position self.__ratio = ratio def blend_thickness(self, outer, inner, v): - if self.__position == "CENTER": + if self.__position == 'CENTER': outer = self.blend(outer, v / 2) inner = self.blend(inner, v / 2) - elif self.__position == "INSIDE": + elif self.__position == 'INSIDE': outer = self.blend(outer, 0) inner = self.blend(inner, v) - elif self.__position == "OUTSIDE": + elif self.__position == 'OUTSIDE': outer = self.blend(outer, v) inner = self.blend(inner, 0) - elif self.__position == "RELATIVE": + elif self.__position == 'RELATIVE': outer = self.blend(outer, v * self.__ratio) inner = self.blend(inner, v * (1 - self.__ratio)) else: @@ -152,16 +152,16 @@ class BaseThicknessShader(StrokeShader, ThicknessModifierMixIn): def __init__(self, thickness, position, ratio): StrokeShader.__init__(self) ThicknessModifierMixIn.__init__(self) - if position == "CENTER": + if position == 'CENTER': self.__outer = thickness / 2 self.__inner = thickness / 2 - elif position == "INSIDE": + elif position == 'INSIDE': self.__outer = 0 self.__inner = thickness - elif position == "OUTSIDE": + elif position == 'OUTSIDE': self.__outer = thickness self.__inner = 0 - elif position == "RELATIVE": + elif position == 'RELATIVE': self.__outer = thickness * ratio self.__inner = thickness * (1 - ratio) else: @@ -350,84 +350,76 @@ class ThicknessDistanceFromObjectShader(ThicknessBlenderMixIn, CurveMappingModif # Material modifiers -def iter_material_color(stroke, material_attr): +def iter_material_color(stroke, material_attribute): func = CurveMaterialF0D() it = stroke.stroke_vertices_begin() while not it.is_end: material = func(Interface0DIterator(it)) - if material_attr == "DIFF": - color = (material.diffuse[0], - material.diffuse[1], - material.diffuse[2]) - elif material_attr == "SPEC": - color = (material.specular[0], - material.specular[1], - material.specular[2]) + if material_attribute == 'DIFF': + color = material.diffuse[:] + elif material_attribute == 'SPEC': + color = material.specular[:] else: - raise ValueError("unexpected material attribute: " + material_attr) + raise ValueError("unexpected material attribute: " + material_attribute) yield it, color it.increment() -def iter_material_value(stroke, material_attr): +def iter_material_value(stroke, material_attribute): func = CurveMaterialF0D() it = stroke.stroke_vertices_begin() while not it.is_end: material = func(Interface0DIterator(it)) - if material_attr == "DIFF": - r = material.diffuse[0] - g = material.diffuse[1] - b = material.diffuse[2] + if material_attribute == 'DIFF': + r, g, b = material.diffuse t = 0.35 * r + 0.45 * r + 0.2 * b - elif material_attr == "DIFF_R": + elif material_attribute == 'DIFF_R': t = material.diffuse[0] - elif material_attr == "DIFF_G": + elif material_attribute == 'DIFF_G': t = material.diffuse[1] - elif material_attr == "DIFF_B": + elif material_attribute == 'DIFF_B': t = material.diffuse[2] - elif material_attr == "SPEC": - r = material.specular[0] - g = material.specular[1] - b = material.specular[2] + elif material_attribute == 'SPEC': + r, g, b = material.specular t = 0.35 * r + 0.45 * r + 0.2 * b - elif material_attr == "SPEC_R": + elif material_attribute == 'SPEC_R': t = material.specular[0] - elif material_attr == "SPEC_G": + elif material_attribute == 'SPEC_G': t = material.specular[1] - elif material_attr == "SPEC_B": + elif material_attribute == 'SPEC_B': t = material.specular[2] - elif material_attr == "SPEC_HARDNESS": + elif material_attribute == 'SPEC_HARDNESS': t = material.shininess - elif material_attr == "ALPHA": + elif material_attribute == 'ALPHA': t = material.diffuse[3] else: - raise ValueError("unexpected material attribute: " + material_attr) + raise ValueError("unexpected material attribute: " + material_attribute) yield it, t it.increment() class ColorMaterialShader(ColorRampModifier): - def __init__(self, blend, influence, ramp, material_attr, use_ramp): + def __init__(self, blend, influence, ramp, material_attribute, use_ramp): ColorRampModifier.__init__(self, blend, influence, ramp) - self.__material_attr = material_attr + self.__material_attribute = material_attribute self.__use_ramp = use_ramp def shade(self, stroke): - if self.__material_attr in ["DIFF", "SPEC"] and not self.__use_ramp: - for it, b in iter_material_color(stroke, self.__material_attr): + if self.__material_attribute in {'DIFF', 'SPEC'} and not self.__use_ramp: + for it, b in iter_material_color(stroke, self.__material_attribute): sv = it.object a = sv.attribute.color sv.attribute.color = self.blend_ramp(a, b) else: - for it, t in iter_material_value(stroke, self.__material_attr): + for it, t in iter_material_value(stroke, self.__material_attribute): sv = it.object a = sv.attribute.color b = self.evaluate(t) sv.attribute.color = self.blend_ramp(a, b) class AlphaMaterialShader(CurveMappingModifier): - def __init__(self, blend, influence, mapping, invert, curve, material_attr): + def __init__(self, blend, influence, mapping, invert, curve, material_attribute): CurveMappingModifier.__init__(self, blend, influence, mapping, invert, curve) - self.__material_attr = material_attr + self.__material_attribute = material_attribute def shade(self, stroke): - for it, t in iter_material_value(stroke, self.__material_attr): + for it, t in iter_material_value(stroke, self.__material_attribute): sv = it.object a = sv.attribute.alpha b = self.evaluate(t) @@ -435,14 +427,14 @@ class AlphaMaterialShader(CurveMappingModifier): class ThicknessMaterialShader(ThicknessBlenderMixIn, CurveMappingModifier): def __init__(self, thickness_position, thickness_ratio, - blend, influence, mapping, invert, curve, material_attr, value_min, value_max): + blend, influence, mapping, invert, curve, material_attribute, value_min, value_max): ThicknessBlenderMixIn.__init__(self, thickness_position, thickness_ratio) CurveMappingModifier.__init__(self, blend, influence, mapping, invert, curve) - self.__material_attr = material_attr + self.__material_attribute = material_attribute self.__value_min = value_min self.__value_max = value_max def shade(self, stroke): - for it, t in iter_material_value(stroke, self.__material_attr): + for it, t in iter_material_value(stroke, self.__material_attribute): sv = it.object a = sv.attribute.thickness b = self.__value_min + self.evaluate(t) * (self.__value_max - self.__value_min) @@ -453,12 +445,12 @@ class ThicknessMaterialShader(ThicknessBlenderMixIn, CurveMappingModifier): class CalligraphicThicknessShader(ThicknessBlenderMixIn, ScalarBlendModifier): def __init__(self, thickness_position, thickness_ratio, - blend, influence, orientation, min_thickness, max_thickness): + blend, influence, orientation, thickness_min, thickness_max): ThicknessBlenderMixIn.__init__(self, thickness_position, thickness_ratio) ScalarBlendModifier.__init__(self, blend, influence) self.__orientation = mathutils.Vector((math.cos(orientation), math.sin(orientation))) - self.__min_thickness = min_thickness - self.__max_thickness = max_thickness + self.__thickness_min = thickness_min + self.__thickness_max = thickness_max def shade(self, stroke): func = VertexOrientation2DF0D() it = stroke.stroke_vertices_begin() @@ -469,7 +461,7 @@ class CalligraphicThicknessShader(ThicknessBlenderMixIn, ScalarBlendModifier): fac = abs(orthDir * self.__orientation) sv = it.object a = sv.attribute.thickness - b = self.__min_thickness + fac * (self.__max_thickness - self.__min_thickness) + b = self.__thickness_min + fac * (self.__thickness_max - self.__thickness_min) b = max(b, 0.0) c = self.blend_thickness(a[0], a[1], b) self.set_thickness(sv, c[0], c[1]) @@ -570,14 +562,14 @@ class Transform2DShader(StrokeShader): self.__pivot_y = pivot_y def shade(self, stroke): # determine the pivot of scaling and rotation operations - if self.__pivot == "START": + if self.__pivot == 'START': it = stroke.stroke_vertices_begin() pivot = it.object.point - elif self.__pivot == "END": + elif self.__pivot == 'END': it = stroke.stroke_vertices_end() it.decrement() pivot = it.object.point - elif self.__pivot == "PARAM": + elif self.__pivot == 'PARAM': p = None it = stroke.stroke_vertices_begin() while not it.is_end: @@ -593,7 +585,7 @@ class Transform2DShader(StrokeShader): else: delta = u - self.__pivot_u pivot = p + delta * (prev - p) - elif self.__pivot == "CENTER": + elif self.__pivot == 'CENTER': pivot = mathutils.Vector([0.0, 0.0]) n = 0 it = stroke.stroke_vertices_begin() @@ -604,7 +596,7 @@ class Transform2DShader(StrokeShader): it.increment() pivot.x = pivot.x / n pivot.y = pivot.y / n - elif self.__pivot == "ABSOLUTE": + elif self.__pivot == 'ABSOLUTE': pivot = mathutils.Vector([self.__pivot_x, self.__pivot_y]) # apply scaling and rotation operations cos_theta = math.cos(self.__angle) @@ -874,15 +866,15 @@ class AndBP1D(BinaryPredicate1D): # predicates for selection class LengthThresholdUP1D(UnaryPredicate1D): - def __init__(self, min_length=None, max_length=None): + def __init__(self, length_min=None, length_max=None): UnaryPredicate1D.__init__(self) - self._min_length = min_length - self._max_length = max_length + self._length_min = length_min + self._length_max = length_max def __call__(self, inter): length = inter.length_2d - if self._min_length is not None and length < self._min_length: + if self._length_min is not None and length < self._length_min: return False - if self._max_length is not None and length > self._max_length: + if self._length_max is not None and length > self._length_max: return False return True @@ -931,16 +923,16 @@ class MaterialBoundaryUP0D(UnaryPredicate0D): return idx1 != idx2 class Curvature2DAngleThresholdUP0D(UnaryPredicate0D): - def __init__(self, min_angle=None, max_angle=None): + def __init__(self, angle_min=None, angle_max=None): UnaryPredicate0D.__init__(self) - self._min_angle = min_angle - self._max_angle = max_angle + self._angle_min = angle_min + self._angle_max = angle_max self._func = Curvature2DAngleF0D() def __call__(self, inter): angle = math.pi - self._func(inter) - if self._min_angle is not None and angle < self._min_angle: + if self._angle_min is not None and angle < self._angle_min: return True - if self._max_angle is not None and angle > self._max_angle: + if self._angle_max is not None and angle > self._angle_max: return True return False @@ -984,13 +976,13 @@ def process(layer_name, lineset_name): selection_criteria = [] # prepare selection criteria by visibility if lineset.select_by_visibility: - if lineset.visibility == "VISIBLE": + if lineset.visibility == 'VISIBLE': selection_criteria.append( QuantitativeInvisibilityUP1D(0)) - elif lineset.visibility == "HIDDEN": + elif lineset.visibility == 'HIDDEN': selection_criteria.append( NotUP1D(QuantitativeInvisibilityUP1D(0))) - elif lineset.visibility == "RANGE": + elif lineset.visibility == 'RANGE': selection_criteria.append( QuantitativeInvisibilityRangeUP1D(lineset.qi_start, lineset.qi_end)) # prepare selection criteria by edge types @@ -1023,21 +1015,21 @@ def process(layer_name, lineset_name): if lineset.select_external_contour: upred = ExternalContourUP1D() edge_type_criteria.append(NotUP1D(upred) if lineset.exclude_external_contour else upred) - if lineset.edge_type_combination == "OR": + if lineset.edge_type_combination == 'OR': upred = join_unary_predicates(edge_type_criteria, OrUP1D) else: upred = join_unary_predicates(edge_type_criteria, AndUP1D) if upred is not None: - if lineset.edge_type_negation == "EXCLUSIVE": + if lineset.edge_type_negation == 'EXCLUSIVE': upred = NotUP1D(upred) selection_criteria.append(upred) # prepare selection criteria by face marks if lineset.select_by_face_marks: - if lineset.face_mark_condition == "BOTH": + if lineset.face_mark_condition == 'BOTH': upred = FaceMarkBothUP1D() else: upred = FaceMarkOneUP1D() - if lineset.face_mark_negation == "EXCLUSIVE": + if lineset.face_mark_negation == 'EXCLUSIVE': upred = NotUP1D(upred) selection_criteria.append(upred) # prepare selection criteria by group of objects @@ -1068,13 +1060,13 @@ def process(layer_name, lineset_name): Operators.select(upred) # join feature edges to form chains if linestyle.use_chaining: - if linestyle.chaining == "PLAIN": - if linestyle.same_object: + if linestyle.chaining == 'PLAIN': + if linestyle.use_same_object: Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(upred)) else: Operators.bidirectional_chain(ChainPredicateIterator(upred, TrueBP1D()), NotUP1D(upred)) - elif linestyle.chaining == "SKETCHY": - if linestyle.same_object: + elif linestyle.chaining == 'SKETCHY': + if linestyle.use_same_object: Operators.bidirectional_chain(pySketchyChainSilhouetteIterator(linestyle.rounds)) else: Operators.bidirectional_chain(pySketchyChainingIterator(linestyle.rounds)) @@ -1083,10 +1075,10 @@ def process(layer_name, lineset_name): # split chains if linestyle.material_boundary: Operators.sequential_split(MaterialBoundaryUP0D()) - if linestyle.use_min_angle or linestyle.use_max_angle: - min_angle = linestyle.min_angle if linestyle.use_min_angle else None - max_angle = linestyle.max_angle if linestyle.use_max_angle else None - Operators.sequential_split(Curvature2DAngleThresholdUP0D(min_angle, max_angle)) + if linestyle.use_angle_min or linestyle.use_angle_max: + angle_min = linestyle.angle_min if linestyle.use_angle_min else None + angle_max = linestyle.angle_max if linestyle.use_angle_max else None + Operators.sequential_split(Curvature2DAngleThresholdUP0D(angle_min, angle_max)) if linestyle.use_split_length: Operators.sequential_split(Length2DThresholdUP0D(linestyle.split_length), 1.0) if linestyle.use_split_pattern: @@ -1107,140 +1099,140 @@ def process(layer_name, lineset_name): SplitPatternStoppingUP0D(controller), sampling) # select chains - if linestyle.use_min_length or linestyle.use_max_length: - min_length = linestyle.min_length if linestyle.use_min_length else None - max_length = linestyle.max_length if linestyle.use_max_length else None - Operators.select(LengthThresholdUP1D(min_length, max_length)) + if linestyle.use_length_min or linestyle.use_length_max: + length_min = linestyle.length_min if linestyle.use_length_min else None + length_max = linestyle.length_max if linestyle.use_length_max else None + Operators.select(LengthThresholdUP1D(length_min, length_max)) # prepare a list of stroke shaders shaders_list = [] for m in linestyle.geometry_modifiers: if not m.use: continue - if m.type == "SAMPLING": + if m.type == 'SAMPLING': shaders_list.append(SamplingShader( m.sampling)) - elif m.type == "BEZIER_CURVE": + elif m.type == 'BEZIER_CURVE': shaders_list.append(BezierCurveShader( m.error)) - elif m.type == "SINUS_DISPLACEMENT": + elif m.type == 'SINUS_DISPLACEMENT': shaders_list.append(SinusDisplacementShader( m.wavelength, m.amplitude, m.phase)) - elif m.type == "SPATIAL_NOISE": + elif m.type == 'SPATIAL_NOISE': shaders_list.append(SpatialNoiseShader( - m.amplitude, m.scale, m.octaves, m.smooth, m.pure_random)) - elif m.type == "PERLIN_NOISE_1D": + m.amplitude, m.scale, m.octaves, m.smooth, m.use_pure_random)) + elif m.type == 'PERLIN_NOISE_1D': shaders_list.append(PerlinNoise1DShader( m.frequency, m.amplitude, m.octaves, m.angle, _seed.get(m.seed))) - elif m.type == "PERLIN_NOISE_2D": + elif m.type == 'PERLIN_NOISE_2D': shaders_list.append(PerlinNoise2DShader( m.frequency, m.amplitude, m.octaves, m.angle, _seed.get(m.seed))) - elif m.type == "BACKBONE_STRETCHER": + elif m.type == 'BACKBONE_STRETCHER': shaders_list.append(BackboneStretcherShader( m.backbone_length)) - elif m.type == "TIP_REMOVER": + elif m.type == 'TIP_REMOVER': shaders_list.append(TipRemoverShader( m.tip_length)) - elif m.type == "POLYGONIZATION": + elif m.type == 'POLYGONIZATION': shaders_list.append(PolygonalizationShader( m.error)) - elif m.type == "GUIDING_LINES": + elif m.type == 'GUIDING_LINES': shaders_list.append(GuidingLinesShader( m.offset)) - elif m.type == "BLUEPRINT": - if m.shape == "CIRCLES": + elif m.type == 'BLUEPRINT': + if m.shape == 'CIRCLES': shaders_list.append(pyBluePrintCirclesShader( m.rounds, m.random_radius, m.random_center)) - elif m.shape == "ELLIPSES": + elif m.shape == 'ELLIPSES': shaders_list.append(pyBluePrintEllipsesShader( m.rounds, m.random_radius, m.random_center)) - elif m.shape == "SQUARES": + elif m.shape == 'SQUARES': shaders_list.append(pyBluePrintSquaresShader( m.rounds, m.backbone_length, m.random_backbone)) - elif m.type == "2D_OFFSET": + elif m.type == '2D_OFFSET': shaders_list.append(Offset2DShader( m.start, m.end, m.x, m.y)) - elif m.type == "2D_TRANSFORM": + elif m.type == '2D_TRANSFORM': shaders_list.append(Transform2DShader( m.pivot, m.scale_x, m.scale_y, m.angle, m.pivot_u, m.pivot_x, m.pivot_y)) color = linestyle.color - if (not linestyle.use_chaining) or (linestyle.chaining == "PLAIN" and linestyle.same_object): + if (not linestyle.use_chaining) or (linestyle.chaining == 'PLAIN' and linestyle.use_same_object): thickness_position = linestyle.thickness_position else: - thickness_position = "CENTER" + thickness_position = 'CENTER' import bpy if bpy.app.debug_freestyle: - print("Warning: Thickness position options are applied when chaining is disabled") - print(" or the Plain chaining is used with the Same Object option enabled.") + print("Warning: Thickness position options are applied when chaining is disabled\n" + " or the Plain chaining is used with the Same Object option enabled.") shaders_list.append(BaseColorShader(color.r, color.g, color.b, linestyle.alpha)) shaders_list.append(BaseThicknessShader(linestyle.thickness, thickness_position, linestyle.thickness_ratio)) for m in linestyle.color_modifiers: if not m.use: continue - if m.type == "ALONG_STROKE": + if m.type == 'ALONG_STROKE': shaders_list.append(ColorAlongStrokeShader( m.blend, m.influence, m.color_ramp)) - elif m.type == "DISTANCE_FROM_CAMERA": + elif m.type == 'DISTANCE_FROM_CAMERA': shaders_list.append(ColorDistanceFromCameraShader( m.blend, m.influence, m.color_ramp, m.range_min, m.range_max)) - elif m.type == "DISTANCE_FROM_OBJECT": + elif m.type == 'DISTANCE_FROM_OBJECT': shaders_list.append(ColorDistanceFromObjectShader( m.blend, m.influence, m.color_ramp, m.target, m.range_min, m.range_max)) - elif m.type == "MATERIAL": + elif m.type == 'MATERIAL': shaders_list.append(ColorMaterialShader( - m.blend, m.influence, m.color_ramp, m.material_attr, + m.blend, m.influence, m.color_ramp, m.material_attribute, m.use_ramp)) for m in linestyle.alpha_modifiers: if not m.use: continue - if m.type == "ALONG_STROKE": + if m.type == 'ALONG_STROKE': shaders_list.append(AlphaAlongStrokeShader( m.blend, m.influence, m.mapping, m.invert, m.curve)) - elif m.type == "DISTANCE_FROM_CAMERA": + elif m.type == 'DISTANCE_FROM_CAMERA': shaders_list.append(AlphaDistanceFromCameraShader( m.blend, m.influence, m.mapping, m.invert, m.curve, m.range_min, m.range_max)) - elif m.type == "DISTANCE_FROM_OBJECT": + elif m.type == 'DISTANCE_FROM_OBJECT': shaders_list.append(AlphaDistanceFromObjectShader( m.blend, m.influence, m.mapping, m.invert, m.curve, m.target, m.range_min, m.range_max)) - elif m.type == "MATERIAL": + elif m.type == 'MATERIAL': shaders_list.append(AlphaMaterialShader( m.blend, m.influence, m.mapping, m.invert, m.curve, - m.material_attr)) + m.material_attribute)) for m in linestyle.thickness_modifiers: if not m.use: continue - if m.type == "ALONG_STROKE": + if m.type == 'ALONG_STROKE': shaders_list.append(ThicknessAlongStrokeShader( thickness_position, linestyle.thickness_ratio, m.blend, m.influence, m.mapping, m.invert, m.curve, m.value_min, m.value_max)) - elif m.type == "DISTANCE_FROM_CAMERA": + elif m.type == 'DISTANCE_FROM_CAMERA': shaders_list.append(ThicknessDistanceFromCameraShader( thickness_position, linestyle.thickness_ratio, m.blend, m.influence, m.mapping, m.invert, m.curve, m.range_min, m.range_max, m.value_min, m.value_max)) - elif m.type == "DISTANCE_FROM_OBJECT": + elif m.type == 'DISTANCE_FROM_OBJECT': shaders_list.append(ThicknessDistanceFromObjectShader( thickness_position, linestyle.thickness_ratio, m.blend, m.influence, m.mapping, m.invert, m.curve, m.target, m.range_min, m.range_max, m.value_min, m.value_max)) - elif m.type == "MATERIAL": + elif m.type == 'MATERIAL': shaders_list.append(ThicknessMaterialShader( thickness_position, linestyle.thickness_ratio, m.blend, m.influence, m.mapping, m.invert, m.curve, - m.material_attr, m.value_min, m.value_max)) - elif m.type == "CALLIGRAPHY": + m.material_attribute, m.value_min, m.value_max)) + elif m.type == 'CALLIGRAPHY': shaders_list.append(CalligraphicThicknessShader( thickness_position, linestyle.thickness_ratio, m.blend, m.influence, - m.orientation, m.min_thickness, m.max_thickness)) - if linestyle.caps == "ROUND": + m.orientation, m.thickness_min, m.thickness_max)) + if linestyle.caps == 'ROUND': shaders_list.append(RoundCapShader()) - elif linestyle.caps == "SQUARE": + elif linestyle.caps == 'SQUARE': shaders_list.append(SquareCapShader()) if linestyle.use_dashed_line: pattern = [] diff --git a/release/scripts/startup/bl_operators/rigidbody.py b/release/scripts/startup/bl_operators/rigidbody.py index ba1215c8a13..979cc01c0ad 100644 --- a/release/scripts/startup/bl_operators/rigidbody.py +++ b/release/scripts/startup/bl_operators/rigidbody.py @@ -40,7 +40,7 @@ class CopyRigidbodySettings(Operator): "friction", "restitution", "use_deactivation", - "start_deactivated", + "use_start_deactivated", "deactivate_linear_velocity", "deactivate_angular_velocity", "linear_damping", diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py index 71178e6afac..a99919f68ad 100644 --- a/release/scripts/startup/bl_ui/properties_data_modifier.py +++ b/release/scripts/startup/bl_ui/properties_data_modifier.py @@ -936,9 +936,9 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): layout.prop(md, "sharpness") layout.prop(md, "use_smooth_shade") - layout.prop(md, "remove_disconnected_pieces") + layout.prop(md, "use_remove_disconnected") row = layout.row() - row.active = md.remove_disconnected_pieces + row.active = md.use_remove_disconnected row.prop(md, "threshold") @staticmethod diff --git a/release/scripts/startup/bl_ui/properties_freestyle.py b/release/scripts/startup/bl_ui/properties_freestyle.py index fb97dffefb9..b4ab1a733f2 100644 --- a/release/scripts/startup/bl_ui/properties_freestyle.py +++ b/release/scripts/startup/bl_ui/properties_freestyle.py @@ -409,14 +409,14 @@ class RENDERLAYER_PT_freestyle_linestyle(RenderLayerFreestyleEditorButtonsPanel, prop.name = modifier.name elif modifier.type == 'MATERIAL': - box.prop(modifier, "material_attr", text="") + box.prop(modifier, "material_attribute", text="") self.draw_modifier_curve_common(box, modifier, False, True) elif modifier.type == 'CALLIGRAPHY': box.prop(modifier, "orientation") row = box.row(align=True) - row.prop(modifier, "min_thickness") - row.prop(modifier, "max_thickness") + row.prop(modifier, "thickness_min") + row.prop(modifier, "thickness_max") def draw_geometry_modifier(self, context, modifier): layout = self.layout @@ -448,7 +448,7 @@ class RENDERLAYER_PT_freestyle_linestyle(RenderLayerFreestyleEditorButtonsPanel, col.prop(modifier, "octaves") col = split.column() col.prop(modifier, "smooth") - col.prop(modifier, "pure_random") + col.prop(modifier, "use_pure_random") elif modifier.type == 'PERLIN_NOISE_1D': split = box.split() @@ -540,7 +540,7 @@ class RENDERLAYER_PT_freestyle_linestyle(RenderLayerFreestyleEditorButtonsPanel, col.prop(linestyle, "use_chaining", text="Enable Chaining") sub = col.row() sub.active = linestyle.use_chaining - sub.prop(linestyle, "same_object") + sub.prop(linestyle, "use_same_object") # Second column col = split.column() col.active = linestyle.use_chaining @@ -554,15 +554,15 @@ class RENDERLAYER_PT_freestyle_linestyle(RenderLayerFreestyleEditorButtonsPanel, # First column col = split.column() row = col.row(align=True) - row.prop(linestyle, "use_min_angle", text="") + row.prop(linestyle, "use_angle_min", text="") sub = row.row() - sub.active = linestyle.use_min_angle - sub.prop(linestyle, "min_angle") + sub.active = linestyle.use_angle_min + sub.prop(linestyle, "angle_min") row = col.row(align=True) - row.prop(linestyle, "use_max_angle", text="") + row.prop(linestyle, "use_angle_max", text="") sub = row.row() - sub.active = linestyle.use_max_angle - sub.prop(linestyle, "max_angle") + sub.active = linestyle.use_angle_max + sub.prop(linestyle, "angle_max") # Second column col = split.column() row = col.row(align=True) @@ -590,17 +590,17 @@ class RENDERLAYER_PT_freestyle_linestyle(RenderLayerFreestyleEditorButtonsPanel, # First column col = split.column() row = col.row(align=True) - row.prop(linestyle, "use_min_length", text="") + row.prop(linestyle, "use_length_min", text="") sub = row.row() - sub.active = linestyle.use_min_length - sub.prop(linestyle, "min_length") + sub.active = linestyle.use_length_min + sub.prop(linestyle, "length_min") # Second column col = split.column() row = col.row(align=True) - row.prop(linestyle, "use_max_length", text="") + row.prop(linestyle, "use_length_max", text="") sub = row.row() - sub.active = linestyle.use_max_length - sub.prop(linestyle, "max_length") + sub.active = linestyle.use_length_max + sub.prop(linestyle, "length_max") ## Caps layout.label(text="Caps:") diff --git a/release/scripts/startup/bl_ui/properties_game.py b/release/scripts/startup/bl_ui/properties_game.py index 1f05c8eea5a..fcafc7c816a 100644 --- a/release/scripts/startup/bl_ui/properties_game.py +++ b/release/scripts/startup/bl_ui/properties_game.py @@ -407,7 +407,7 @@ class RENDER_PT_game_system(RenderButtonsPanel, Panel): row = col.row() col = row.column() col.prop(gs, "use_frame_rate") - col.prop(gs, "restrict_animation_updates") + col.prop(gs, "use_restrict_animation_updates") col.prop(gs, "use_material_caching") col = row.column() col.prop(gs, "use_display_lists") diff --git a/release/scripts/startup/bl_ui/properties_object.py b/release/scripts/startup/bl_ui/properties_object.py index ff8cf6ee197..31023d49340 100644 --- a/release/scripts/startup/bl_ui/properties_object.py +++ b/release/scripts/startup/bl_ui/properties_object.py @@ -297,8 +297,8 @@ class OBJECT_PT_relations_extras(ObjectButtonsPanel, Panel): row.active = ((ob.parent is not None) and (ob.use_slow_parent)) row.prop(ob, "slow_parent_offset", text="Offset") - layout.prop(ob, "extra_recalc_object") - layout.prop(ob, "extra_recalc_data") + layout.prop(ob, "use_extra_recalc_object") + layout.prop(ob, "use_extra_recalc_data") from bl_ui.properties_animviz import (MotionPathButtonsPanel, diff --git a/release/scripts/startup/bl_ui/properties_particle.py b/release/scripts/startup/bl_ui/properties_particle.py index d4a16b56b43..dc73d5981d7 100644 --- a/release/scripts/startup/bl_ui/properties_particle.py +++ b/release/scripts/startup/bl_ui/properties_particle.py @@ -496,8 +496,8 @@ class PARTICLE_PT_physics(ParticleButtonsPanel, Panel): supports_courant = part.physics_type == 'FLUID' subsub = sub.row() subsub.enabled = supports_courant - subsub.prop(part, "adaptive_subframes", text="") - if supports_courant and part.adaptive_subframes: + subsub.prop(part, "use_adaptive_subframes", text="") + if supports_courant and part.use_adaptive_subframes: col.prop(part, "courant_target", text="Threshold") row = layout.row() @@ -524,20 +524,20 @@ class PARTICLE_PT_physics(ParticleButtonsPanel, Panel): if fluid.solver == 'DDR': sub = col.row() - sub.prop(fluid, "repulsion", slider=fluid.factor_repulsion) - sub.prop(fluid, "factor_repulsion", text="") + sub.prop(fluid, "repulsion", slider=fluid.use_factor_repulsion) + sub.prop(fluid, "use_factor_repulsion", text="") sub = col.row() - sub.prop(fluid, "stiff_viscosity", slider=fluid.factor_stiff_viscosity) - sub.prop(fluid, "factor_stiff_viscosity", text="") + sub.prop(fluid, "stiff_viscosity", slider=fluid.use_factor_stiff_viscosity) + sub.prop(fluid, "use_factor_stiff_viscosity", text="") sub = col.row() - sub.prop(fluid, "fluid_radius", slider=fluid.factor_radius) - sub.prop(fluid, "factor_radius", text="") + sub.prop(fluid, "fluid_radius", slider=fluid.use_factor_radius) + sub.prop(fluid, "use_factor_radius", text="") sub = col.row() - sub.prop(fluid, "rest_density", slider=fluid.factor_density) - sub.prop(fluid, "factor_density", text="") + sub.prop(fluid, "rest_density", slider=fluid.use_factor_density) + sub.prop(fluid, "use_factor_density", text="") if fluid.solver == 'CLASSICAL': # With the classical solver, it is possible to calculate the @@ -563,8 +563,8 @@ class PARTICLE_PT_physics(ParticleButtonsPanel, Panel): col = split.column() col.label(text="Advanced:") sub = col.row() - sub.prop(fluid, "rest_length", slider=fluid.factor_rest_length) - sub.prop(fluid, "factor_rest_length", text="") + sub.prop(fluid, "rest_length", slider=fluid.use_factor_rest_length) + sub.prop(fluid, "use_factor_rest_length", text="") col.label(text="") sub = col.column() sub.active = fluid.use_viscoelastic_springs diff --git a/release/scripts/startup/bl_ui/properties_physics_fluid.py b/release/scripts/startup/bl_ui/properties_physics_fluid.py index 78bb21e76a5..0935f9336e1 100644 --- a/release/scripts/startup/bl_ui/properties_physics_fluid.py +++ b/release/scripts/startup/bl_ui/properties_physics_fluid.py @@ -274,7 +274,7 @@ class PHYSICS_PT_domain_boundary(PhysicButtonsPanel, Panel): col.prop(fluid, "slip_type", text="") if fluid.slip_type == 'PARTIALSLIP': col.prop(fluid, "partial_slip_factor", slider=True, text="Amount") - col.prop(fluid, "surface_noobs") + col.prop(fluid, "use_surface_noobs") col = split.column() col.label(text="Surface:") diff --git a/release/scripts/startup/bl_ui/properties_physics_rigidbody.py b/release/scripts/startup/bl_ui/properties_physics_rigidbody.py index 77ea5a90344..cd701178976 100644 --- a/release/scripts/startup/bl_ui/properties_physics_rigidbody.py +++ b/release/scripts/startup/bl_ui/properties_physics_rigidbody.py @@ -118,7 +118,7 @@ class PHYSICS_PT_rigid_body_dynamics(PHYSICS_PT_rigidbody_panel, Panel): col.prop(rbo, "use_deactivation") sub = col.column() sub.active = rbo.use_deactivation - sub.prop(rbo, "start_deactivated") + sub.prop(rbo, "use_start_deactivated") sub.prop(rbo, "deactivate_linear_velocity", text="Linear Vel") sub.prop(rbo, "deactivate_angular_velocity", text="Angular Vel") # TODO: other params such as time? diff --git a/release/scripts/startup/bl_ui/properties_physics_rigidbody_constraint.py b/release/scripts/startup/bl_ui/properties_physics_rigidbody_constraint.py index a49c6d623ca..202c1c2506e 100644 --- a/release/scripts/startup/bl_ui/properties_physics_rigidbody_constraint.py +++ b/release/scripts/startup/bl_ui/properties_physics_rigidbody_constraint.py @@ -59,10 +59,10 @@ class PHYSICS_PT_rigid_body_constraint(PHYSICS_PT_rigidbody_constraint_panel, Pa sub.prop(rbc, "breaking_threshold", text="Threshold") row = layout.row() - row.prop(rbc, "override_solver_iterations", text="Override Iterations") + row.prop(rbc, "use_override_solver_iterations", text="Override Iterations") sub = row.row() - sub.active = rbc.override_solver_iterations - sub.prop(rbc, "num_solver_iterations", text="Iterations") + sub.active = rbc.use_override_solver_iterations + sub.prop(rbc, "solver_iterations", text="Iterations") if rbc.type == 'HINGE': col = layout.column(align=True) diff --git a/release/scripts/startup/bl_ui/properties_physics_smoke.py b/release/scripts/startup/bl_ui/properties_physics_smoke.py index 487f43aa973..4a1b99ee810 100644 --- a/release/scripts/startup/bl_ui/properties_physics_smoke.py +++ b/release/scripts/startup/bl_ui/properties_physics_smoke.py @@ -93,9 +93,9 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel, Panel): sub = col.column(align=True) - sub.prop(flow, "initial_velocity") + sub.prop(flow, "use_initial_velocity") sub = sub.column() - sub.active = flow.initial_velocity + sub.active = flow.use_initial_velocity sub.prop(flow, "velocity_factor") if flow.smoke_flow_source == "MESH": sub.prop(flow, "velocity_normal") @@ -244,7 +244,7 @@ class PHYSICS_PT_smoke_highres(PhysicButtonsPanel, Panel): col = split.column() col.label(text="Resolution:") col.prop(md, "amplify", text="Divisions") - col.prop(md, "smooth_emitter") + col.prop(md, "use_smooth_emitter") col = split.column() col.label(text="Noise Method:") diff --git a/release/scripts/startup/bl_ui/properties_scene.py b/release/scripts/startup/bl_ui/properties_scene.py index eed8c84a389..a04283de8bf 100644 --- a/release/scripts/startup/bl_ui/properties_scene.py +++ b/release/scripts/startup/bl_ui/properties_scene.py @@ -290,7 +290,7 @@ class SCENE_PT_rigid_body_world(SceneButtonsPanel, Panel): col = split.column() col.prop(rbw, "steps_per_second", text="Steps Per Second") - col.prop(rbw, "num_solver_iterations", text="Solver Iterations") + col.prop(rbw, "solver_iterations", text="Solver Iterations") class SCENE_PT_rigid_body_cache(SceneButtonsPanel, Panel): diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py index 5aadeb1153f..54a788f3e46 100644 --- a/release/scripts/startup/bl_ui/space_image.py +++ b/release/scripts/startup/bl_ui/space_image.py @@ -744,7 +744,7 @@ class IMAGE_PT_tools_brush_texture(BrushButtonsPanel, Panel): row.prop(brush, "use_primary_overlay", toggle=True, text="", icon='RESTRICT_VIEW_ON') sub = row.row() sub.prop(brush, "texture_overlay_alpha", text="Alpha") - sub.prop(brush, "cursor_overlay_override", toggle=True, text="", icon='BRUSH_DATA') + sub.prop(brush, "use_cursor_overlay_override", toggle=True, text="", icon='BRUSH_DATA') @@ -771,7 +771,7 @@ class IMAGE_PT_tools_mask_texture(BrushButtonsPanel, Panel): sub = row.row() sub.prop(brush, "texture_overlay_alpha", text="Alpha") - sub.prop(brush, "cursor_overlay_override", toggle=True, text="", icon='BRUSH_DATA') + sub.prop(brush, "use_cursor_overlay_override", toggle=True, text="", icon='BRUSH_DATA') class IMAGE_PT_tools_brush_tool(BrushButtonsPanel, Panel): diff --git a/release/scripts/startup/bl_ui/space_node.py b/release/scripts/startup/bl_ui/space_node.py index 86f25fd3995..f58679e836d 100644 --- a/release/scripts/startup/bl_ui/space_node.py +++ b/release/scripts/startup/bl_ui/space_node.py @@ -283,7 +283,7 @@ class NODE_PT_quality(bpy.types.Panel): col = layout.column() col.prop(tree, "use_opencl") col.prop(tree, "use_groupnode_buffer") - col.prop(tree, "two_pass") + col.prop(tree, "use_two_pass") col.prop(tree, "use_viewer_border") col.prop(snode, "show_highlight") col.prop(snode, "use_hidden_preview") diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py index 641f9fc529f..3477353ba0d 100644 --- a/release/scripts/startup/bl_ui/space_sequencer.py +++ b/release/scripts/startup/bl_ui/space_sequencer.py @@ -98,7 +98,7 @@ class SEQUENCER_HT_header(Header): row.prop(ed, "show_overlay", text="", icon='GHOST_ENABLED') if ed.show_overlay: row.prop(ed, "overlay_frame", text="") - row.prop(ed, "overlay_lock", text="", icon='LOCKED') + row.prop(ed, "use_overlay_lock", text="", icon='LOCKED') row = layout.row() row.prop(st, "overlay_type", text="") diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py index 8aae19e8bb0..6be5c0e6e04 100644 --- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py +++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py @@ -681,7 +681,7 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel): sub = row.row() sub.prop(brush, "cursor_overlay_alpha", text="Alpha") - sub.prop(brush, "cursor_overlay_override", toggle=True, text="", icon='BRUSH_DATA') + sub.prop(brush, "use_cursor_overlay_override", toggle=True, text="", icon='BRUSH_DATA') # Texture Paint Mode # @@ -717,7 +717,7 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel): sub = row.row() sub.prop(brush, "cursor_overlay_alpha", text="Alpha") - sub.prop(brush, "cursor_overlay_override", toggle=True, text="", icon='BRUSH_DATA') + sub.prop(brush, "use_cursor_overlay_override", toggle=True, text="", icon='BRUSH_DATA') # Weight Paint Mode # @@ -774,7 +774,7 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel): sub = row.row() sub.prop(brush, "cursor_overlay_alpha", text="Alpha") - sub.prop(brush, "cursor_overlay_override", toggle=True, text="", icon='BRUSH_DATA') + sub.prop(brush, "use_cursor_overlay_override", toggle=True, text="", icon='BRUSH_DATA') class VIEW3D_PT_tools_brush_texture(Panel, View3DPaintPanel): @@ -814,7 +814,7 @@ class VIEW3D_PT_tools_brush_texture(Panel, View3DPaintPanel): sub = row.row() sub.prop(brush, "texture_overlay_alpha", text="Alpha") - sub.prop(brush, "primary_overlay_override", toggle=True, text="", icon='BRUSH_DATA') + sub.prop(brush, "use_primary_overlay_override", toggle=True, text="", icon='BRUSH_DATA') class VIEW3D_PT_tools_mask_texture(View3DPanel, Panel): @@ -852,7 +852,7 @@ class VIEW3D_PT_tools_mask_texture(View3DPanel, Panel): sub = row.row() sub.prop(brush, "mask_overlay_alpha", text="Alpha") - sub.prop(brush, "secondary_overlay_override", toggle=True, text="", icon='BRUSH_DATA') + sub.prop(brush, "use_secondary_overlay_override", toggle=True, text="", icon='BRUSH_DATA') class VIEW3D_PT_tools_brush_stroke(Panel, View3DPaintPanel): |