# check it has a 'text' argument
for (arg_pos, (arg_kw, arg)) in enumerate(func.parameters.items()):
if ((arg_kw in translate_kw) and
- (arg.is_output == False) and
+ (arg.is_output is False) and
(arg.type == 'STRING')):
func_translate_args.setdefault(func_id, []).append((arg_kw,
if recursive:
for mod_name, mod_path in module_names(directory, True):
modules.append(("%s.%s" % (filename, mod_name),
- mod_path,
- ))
+ mod_path,
+ ))
return modules
ed_adj = edges[context_loop[-1]]
if len(ed_adj) != 2:
# the original edge had 2 other edges
- if other_dir and flipped == False:
+ if other_dir and flipped is False:
flipped = True # only flip the list once
context_loop.reverse()
ed_adj[:] = []
files = []
for directory in searchpaths:
files.extend([(f, os.path.join(directory, f))
- for f in os.listdir(directory)
- if (not f.startswith("."))
- if ((filter_ext is None) or
- (filter_ext(os.path.splitext(f)[1])))
+ for f in os.listdir(directory)
+ if (not f.startswith("."))
+ if ((filter_ext is None) or
+ (filter_ext(os.path.splitext(f)[1])))
])
files.sort()
from bpyml_test import *
draw = [
- ui()[
+ ui()[
split()[
column()[
prop(data='context.scene.render', property='use_stamp_time', text='Time'),
def add_scrollback(text, text_type):
for l in text.split("\n"):
bpy.ops.console.scrollback_append(text=l.replace("\t", " "),
- type=text_type)
+ type=text_type)
def replace_help(namespace):
# insert a new blank line
bpy.ops.console.history_append(text="", current_character=0,
- remove_duplicates=True)
+ remove_duplicates=True)
# Insert the output into the editor
# not quite correct because the order might have changed,
def add_scrollback(text, text_type):
for l in text.split("\n"):
bpy.ops.console.scrollback_append(text=l.replace("\t", " "),
- type=text_type)
+ type=text_type)
def shell_run(text):
# insert a new blank line
bpy.ops.console.history_append(text="", current_character=0,
- remove_duplicates=True)
+ remove_duplicates=True)
sc.prompt = os.getcwd() + PROMPT
return {'FINISHED'}
def get_arg_default(self, force=True):
default = self.default_str
- if default and (force or self.is_required == False):
+ if default and (force or self.is_required is False):
return "%s=%s" % (self.identifier, default)
return self.identifier
# Arrange so classes are always defined in the correct order
deps_ok = False
- while deps_ok == False:
+ while deps_ok is False:
deps_ok = True
rna_done = set()
if value_xml.startswith("#"):
# read hexidecimal value as float array
value_xml_split = value_xml[1:]
- value_xml_coerce = [int(value_xml_split[i:i + 2], 16) / 255 for i in range(0, len(value_xml_split), 2)]
+ value_xml_coerce = [int(value_xml_split[i:i + 2], 16) / 255 for i in range(0, len(value_xml_split), 2)]
del value_xml_split
else:
value_xml_split = value_xml.split()
angle = 2 * pi * minor_index / minor_seg
vec = quat * Vector((major_rad + (cos(angle) * minor_rad),
- 0.0,
- (sin(angle) * minor_rad),
- ))
+ 0.0,
+ (sin(angle) * minor_rad),
+ ))
verts.extend(vec[:])
)
def execute(self, context):
- if self.use_abso == True:
+ if self.use_abso is True:
extra_helper = (self.abso_major_rad - self.abso_minor_rad) * 0.5
self.major_radius = self.abso_minor_rad + extra_helper
self.minor_radius = extra_helper
'OBJECT' in self.bake_types,
self.clear_constraints,
True,
- )
+ )
if action is None:
self.report({'INFO'}, "Nothing to bake")
for action in bpy.data.actions:
# if only user is "fake" user...
- if ((self.only_unused is False) or
- (action.use_fake_user and action.users == 1)):
+ if ((self.only_unused is False) or
+ (action.use_fake_user and action.users == 1)):
# if it has F-Curves, then it's a "action library"
# (i.e. walk, wave, jump, etc.)
space_v3d.show_background_images = True
CLIP_spaces_walk(context, all_screens, 'VIEW_3D', 'VIEW_3D',
- set_background, clip, clip_user)
+ set_background, clip, clip_user)
def CLIP_camera_for_clip(context, clip):
if not con:
self.report({'ERROR'},
- "Motion Tracking constraint to be converted not found")
+ "Motion Tracking constraint to be converted not found")
return {'CANCELLED'}
if not clip:
self.report({'ERROR'},
- "Movie clip to use tracking data from isn't set")
+ "Movie clip to use tracking data from isn't set")
return {'CANCELLED'}
scene.camera = camob
camob.matrix_local = (Matrix.Translation((7.481, -6.508, 5.344)) *
- Matrix.Rotation(0.815, 4, 'Z') *
- Matrix.Rotation(0.011, 4, 'Y') *
- Matrix.Rotation(1.109, 4, 'X'))
+ Matrix.Rotation(0.815, 4, 'Z') *
+ Matrix.Rotation(0.011, 4, 'Y') *
+ Matrix.Rotation(1.109, 4, 'X'))
return camob
if need_stabilization:
tree.links.new(distortion.outputs["Image"],
- stabilize.inputs["Image"])
+ stabilize.inputs["Image"])
tree.links.new(stabilize.outputs["Image"], scale.inputs["Image"])
else:
tree.links.new(distortion.outputs["Image"], scale.inputs["Image"])
# insert a new blank line
bpy.ops.console.history_append(text="", current_character=0,
- remove_duplicates=True)
+ remove_duplicates=True)
return {'FINISHED'}
puvs[i] = tuple(uv.uv for uv in uv_loops[lstart:lend])
puvs_cpy[i] = tuple(uv.copy() for uv in puvs[i])
puvsel[i] = (False not in
- (uv.select for uv in uv_loops[lstart:lend]))
+ (uv.select for uv in uv_loops[lstart:lend]))
# Vert idx of the poly.
vidxs[i] = tuple(l.vertex_index for l in loops[lstart:lend])
# As we have no poly.center yet...
n2loc_to = v2_to + target_normals[i2] * edlen_to
pt = barycentric_transform(orig_shape_coords[i1],
- v2, v1, n1loc,
- v2_to, v1_to, n1loc_to)
+ v2, v1, n1loc,
+ v2_to, v1_to, n1loc_to)
median_coords[i1].append(pt)
pt = barycentric_transform(orig_shape_coords[i2],
- v1, v2, n2loc,
- v1_to, v2_to, n2loc_to)
+ v1, v2, n2loc,
+ v1_to, v2_to, n2loc_to)
median_coords[i2].append(pt)
# apply the offsets to the new shape
if obj_other != obj and obj_other.type == 'MESH':
mesh_other = obj_other.data
if mesh_other != mesh:
- if mesh_other.tag == False:
+ if mesh_other.tag is False:
mesh_other.tag = True
if len(mesh_other.loops) != nbr_loops:
len(mesh_other.polygons),
nbr_loops,
),
- )
+ )
else:
uv_other = mesh_other.uv_layers.active
if not uv_other:
if player_path == "":
player_path = guess_player_path(preset)
- if is_movie == False and preset in {'FRAMECYCLER', 'RV', 'MPLAYER'}:
+ if is_movie is False and preset in {'FRAMECYCLER', 'RV', 'MPLAYER'}:
# replace the number with '#'
file_a = rd.frame_path(frame=0)
except:
continue
- if value_orig == True:
+ if value_orig is True:
is_set = True
- elif value_orig == False:
+ elif value_orig is False:
pass
else:
self.report({'WARNING'}, "Non boolean value found: %s[ ].%s" %
"version %d.%d.%d and might not "
"function (correctly), "
"though it is enabled") %
- info_ver)
+ info_ver)
return {'FINISHED'}
else:
return {'CANCELLED'}
items = [('All', "All", ""),
('Enabled', "Enabled", ""),
('Disabled', "Disabled", ""),
- ]
+ ]
items_unique = set()
items=[('OFFICIAL', "Official", "Officially supported"),
('COMMUNITY', "Community", "Maintained by community developers"),
('TESTING', "Testing", "Newly contributed scripts (excluded from release builds)"),
- ],
+ ],
name="Support",
description="Display support level",
default={'OFFICIAL', 'COMMUNITY'},
row.prop(itasc, "damping_max", text="Damp", slider=True)
row.prop(itasc, "damping_epsilon", text="Eps", slider=True)
-from bl_ui.properties_animviz import (
- MotionPathButtonsPanel,
- OnionSkinButtonsPanel,
- )
+from bl_ui.properties_animviz import (MotionPathButtonsPanel,
+ OnionSkinButtonsPanel,
+ )
class DATA_PT_motion_paths(MotionPathButtonsPanel, Panel):
split.active = pchan.is_in_ik_chain
row = split.row()
row.prop(pchan, "ik_stiffness_x", text="Stiffness", slider=True)
- row.active = pchan.lock_ik_x == False and pchan.is_in_ik_chain
+ row.active = pchan.lock_ik_x is False and pchan.is_in_ik_chain
split = layout.split(percentage=0.25)
sub = split.row()
sub.prop(pchan, "use_ik_limit_x", text="Limit")
- sub.active = pchan.lock_ik_x == False and pchan.is_in_ik_chain
+ sub.active = pchan.lock_ik_x is False and pchan.is_in_ik_chain
sub = split.row(align=True)
sub.prop(pchan, "ik_min_x", text="")
sub.prop(pchan, "ik_max_x", text="")
- sub.active = pchan.lock_ik_x == False and pchan.use_ik_limit_x and pchan.is_in_ik_chain
+ sub.active = pchan.lock_ik_x is False and pchan.use_ik_limit_x and pchan.is_in_ik_chain
split = layout.split(percentage=0.25)
split.prop(pchan, "lock_ik_y", icon='LOCKED' if pchan.lock_ik_y else 'UNLOCKED', text="Y")
split.active = pchan.is_in_ik_chain
row = split.row()
row.prop(pchan, "ik_stiffness_y", text="Stiffness", slider=True)
- row.active = pchan.lock_ik_y == False and pchan.is_in_ik_chain
+ row.active = pchan.lock_ik_y is False and pchan.is_in_ik_chain
split = layout.split(percentage=0.25)
sub = split.row()
sub.prop(pchan, "use_ik_limit_y", text="Limit")
- sub.active = pchan.lock_ik_y == False and pchan.is_in_ik_chain
+ sub.active = pchan.lock_ik_y is False and pchan.is_in_ik_chain
sub = split.row(align=True)
sub.prop(pchan, "ik_min_y", text="")
sub.prop(pchan, "ik_max_y", text="")
- sub.active = pchan.lock_ik_y == False and pchan.use_ik_limit_y and pchan.is_in_ik_chain
+ sub.active = pchan.lock_ik_y is False and pchan.use_ik_limit_y and pchan.is_in_ik_chain
split = layout.split(percentage=0.25)
split.prop(pchan, "lock_ik_z", icon='LOCKED' if pchan.lock_ik_z else 'UNLOCKED', text="Z")
split.active = pchan.is_in_ik_chain
sub = split.row()
sub.prop(pchan, "ik_stiffness_z", text="Stiffness", slider=True)
- sub.active = pchan.lock_ik_z == False and pchan.is_in_ik_chain
+ sub.active = pchan.lock_ik_z is False and pchan.is_in_ik_chain
split = layout.split(percentage=0.25)
sub = split.row()
sub.prop(pchan, "use_ik_limit_z", text="Limit")
- sub.active = pchan.lock_ik_z == False and pchan.is_in_ik_chain
+ sub.active = pchan.lock_ik_z is False and pchan.is_in_ik_chain
sub = split.row(align=True)
sub.prop(pchan, "ik_min_z", text="")
sub.prop(pchan, "ik_max_z", text="")
- sub.active = pchan.lock_ik_z == False and pchan.use_ik_limit_z and pchan.is_in_ik_chain
+ sub.active = pchan.lock_ik_z is False and pchan.use_ik_limit_z and pchan.is_in_ik_chain
split = layout.split(percentage=0.25)
split.label(text="Stretch:")
col = layout.column()
- if md.use_mirror_merge == True:
+ if md.use_mirror_merge is True:
col.prop(md, "merge_threshold")
col.label(text="Mirror Object:")
col.prop(md, "mirror_object", text="")
col = split.column()
row = col.row()
- row.active = (md.object is None or md.use_object_screw_offset == False)
+ row.active = (md.object is None or md.use_object_screw_offset is False)
row.prop(md, "screw_offset")
row = col.row()
row.active = (md.object is not None)
row.prop(ob, "slow_parent_offset", text="Offset")
-from bl_ui.properties_animviz import (
- MotionPathButtonsPanel,
- OnionSkinButtonsPanel,
- )
+from bl_ui.properties_animviz import (MotionPathButtonsPanel,
+ OnionSkinButtonsPanel)
class OBJECT_PT_motion_paths(MotionPathButtonsPanel, Panel):
from bpy.types import Panel
from rna_prop_ui import PropertyPanel
-from bl_ui.properties_physics_common import (
- point_cache_ui,
- effector_weights_ui,
- basic_force_field_settings_ui,
- basic_force_field_falloff_ui,
- )
+from bl_ui.properties_physics_common import (point_cache_ui,
+ effector_weights_ui,
+ basic_force_field_settings_ui,
+ basic_force_field_falloff_ui,
+ )
def particle_panel_enabled(context, psys):
if not settings:
return False
- return settings.is_fluid == False and (engine in cls.COMPAT_ENGINES)
+ return settings.is_fluid is False and (engine in cls.COMPAT_ENGINES)
def particle_get_settings(context):
split = layout.split(percentage=0.32)
col = split.column()
col.label(text="Name:")
- if part.is_fluid == False:
+ if part.is_fluid is False:
col.label(text="Settings:")
col.label(text="Type:")
col = split.column()
col.prop(psys, "name", text="")
- if part.is_fluid == False:
+ if part.is_fluid is False:
row = col.row()
row.enabled = particle_panel_enabled(context, psys)
row.template_ID(psys, "settings", new="particle.new")
cloth = psys.cloth.settings
- layout.enabled = psys.use_hair_dynamics and psys.point_cache.is_baked == False
+ layout.enabled = psys.use_hair_dynamics and psys.point_cache.is_baked is False
split = layout.split()
sub.active = (part.use_strand_primitive is False)
sub.prop(part, "use_render_adaptive")
sub = col.column()
- sub.active = part.use_render_adaptive or part.use_strand_primitive == True
+ sub.active = part.use_render_adaptive or part.use_strand_primitive is True
sub.prop(part, "adaptive_angle")
sub = col.column()
sub.active = (part.use_render_adaptive is True and part.use_strand_primitive is False)
row = layout.row()
col = row.column()
- if part.type == 'HAIR' and part.use_strand_primitive == True and part.child_type == 'INTERPOLATED':
+ if part.type == 'HAIR' and part.use_strand_primitive is True and part.child_type == 'INTERPOLATED':
layout.prop(part, "use_simplify")
- if part.use_simplify == True:
+ if part.use_simplify is True:
row = layout.row()
row.prop(part, "simplify_refsize")
row.prop(part, "simplify_rate")
row = layout.row()
row.prop(part, "use_simplify_viewport")
sub = row.row()
- sub.active = part.use_simplify_viewport == True
+ sub.active = part.use_simplify_viewport is True
sub.prop(part, "simplify_viewport")
elif part.render_type == 'OBJECT':
if part.draw_percentage != 100 and psys is not None:
if part.type == 'HAIR':
- if psys.use_hair_dynamics and psys.point_cache.is_baked == False:
+ if psys.use_hair_dynamics and psys.point_cache.is_baked is False:
layout.row().label(text="Display percentage makes dynamics inaccurate without baking!")
else:
phystype = part.physics_type
- if phystype != 'NO' and phystype != 'KEYED' and psys.point_cache.is_baked == False:
+ if phystype != 'NO' and phystype != 'KEYED' and psys.point_cache.is_baked is False:
layout.row().label(text="Display percentage makes dynamics inaccurate without baking!")
row = layout.row()
import bpy
from bpy.types import Menu, Panel
-from bl_ui.properties_physics_common import (
- point_cache_ui,
- effector_weights_ui,
- )
+from bl_ui.properties_physics_common import (point_cache_ui,
+ effector_weights_ui)
def cloth_panel_enabled(md):
ob = context.object
cloth = context.cloth.settings
- layout.active = cloth.use_stiffness_scale and cloth_panel_enabled(md)
+ layout.active = (cloth.use_stiffness_scale and cloth_panel_enabled(md))
split = layout.split()
col = split.column()
- if cache.is_baked == True:
+ if cache.is_baked is True:
col.operator("ptcache.free_bake", text="Free Bake")
else:
col.operator("ptcache.bake", text="Bake").bake = True
import bpy
from bpy.types import Panel
-from bl_ui.properties_physics_common import (
- point_cache_ui,
- effector_weights_ui,
- )
+from bl_ui.properties_physics_common import (point_cache_ui,
+ effector_weights_ui,
+ )
class PhysicButtonsPanel():
import bpy
from bpy.types import Panel
-from bl_ui.properties_physics_common import (
- basic_force_field_settings_ui,
- basic_force_field_falloff_ui,
- )
+from bl_ui.properties_physics_common import (basic_force_field_settings_ui,
+ basic_force_field_falloff_ui,
+ )
class PhysicButtonsPanel():
import bpy
from bpy.types import Panel
-from bl_ui.properties_physics_common import (
- point_cache_ui,
- effector_weights_ui,
- )
+from bl_ui.properties_physics_common import (point_cache_ui,
+ effector_weights_ui)
class PhysicButtonsPanel():
import bpy
from bpy.types import Panel
-from bl_ui.properties_physics_common import (
- point_cache_ui,
- effector_weights_ui,
- )
+from bl_ui.properties_physics_common import (point_cache_ui,
+ effector_weights_ui)
def softbody_panel_enabled(md):
# TODO: Change the following to iterate over existing presets
custom_framerate = (fps_rate not in {23.98, 24, 25, 29.97, 30, 50, 59.94, 60})
- if custom_framerate == True:
+ if custom_framerate is True:
fps_label_text = "Custom (" + str(fps_rate) + " fps)"
else:
fps_label_text = str(fps_rate) + " fps"
engine = context.scene.render.engine
if not (hasattr(context, "texture_slot") or hasattr(context, "texture_node")):
return False
- return ((context.material or context.world or context.lamp or context.brush or context.texture or context.particle_system or isinstance(context.space_data.pin_id, ParticleSettings))
- and (engine in cls.COMPAT_ENGINES))
+ return ((context.material or
+ context.world or
+ context.lamp or
+ context.brush or
+ context.texture or
+ context.particle_system or
+ isinstance(context.space_data.pin_id, ParticleSettings)) and
+ (engine in cls.COMPAT_ENGINES))
def draw(self, context):
layout = self.layout
props.action = 'UPTO'
props = layout.operator("clip.clear_track_path",
- text="Clear Track Path")
+ text="Clear Track Path")
props.action = 'ALL'
layout.separator()
layout.separator()
props = layout.operator("clip.track_markers",
- text="Track Frame Backwards")
+ text="Track Frame Backwards")
props.backwards = True
props = layout.operator("clip.track_markers", text="Track Backwards")
def add_scrollback(text, text_type):
for l in text.split("\n"):
bpy.ops.console.scrollback_append(text=l.replace('\t', ' '),
- type=text_type)
+ type=text_type)
if __name__ == "__main__": # only for live edit.
bpy.utils.register_module(__name__)
continue
# check if addon should be visible with current filters
- if ((filter == "All") or
- (filter == info["category"]) or
- (filter == "Enabled" and is_enabled) or
- (filter == "Disabled" and not is_enabled)):
+ if ((filter == "All") or
+ (filter == info["category"]) or
+ (filter == "Enabled" and is_enabled) or
+ (filter == "Disabled" and not is_enabled)):
if search and search not in info["name"].lower():
if info["author"]:
layout.context_pointer_set("keymap", km)
filtered_items = [kmi for kmi in km.keymap_items
- if filter_text in kmi.idname.lower() or
- filter_text in kmi.name.lower()]
+ if (filter_text in kmi.idname.lower() or
+ filter_text in kmi.name.lower())]
if filtered_items:
col = layout.column()
layout.separator()
obj = context.object
- if (obj.type == 'ARMATURE' and obj.mode in {'EDIT', 'POSE'} and
- obj.data.draw_type in {'BBONE', 'ENVELOPE'}):
+ if (obj.type == 'ARMATURE' and obj.mode in {'EDIT', 'POSE'} and
+ obj.data.draw_type in {'BBONE', 'ENVELOPE'}):
layout.operator("transform.transform", text="Scale Envelope/BBone").mode = 'BONE_SIZE'
if context.edit_object and context.edit_object.type == 'ARMATURE':
layout.separator()
layout.operator("mesh.select_by_number_vertices", text="By Number of Verts")
- if context.scene.tool_settings.mesh_select_mode[2] == False:
+ if context.scene.tool_settings.mesh_select_mode[2] is False:
layout.operator("mesh.select_non_manifold", text="Non Manifold")
layout.operator("mesh.select_loose_verts", text="Loose Verts/Edges")
layout.operator_menu_enum("mesh.select_similar", "type", text="Similar")
if lock_object.type == 'ARMATURE':
col.prop_search(view, "lock_bone", lock_object.data,
"edit_bones" if lock_object.mode == 'EDIT'
- else "bones",
+ else "bones",
text="")
else:
col.prop(view, "lock_cursor", text="Lock to Cursor")
row = col.row(align=True)
ups = toolsettings.unified_paint_settings
- if ((ups.use_unified_size and ups.use_locked_size) or
- ((not ups.use_unified_size) and brush.use_locked_size)):
+ if ((ups.use_unified_size and ups.use_locked_size) or
+ ((not ups.use_unified_size) and brush.use_locked_size)):
self.prop_unified_size(row, context, brush, "use_locked_size", icon='LOCKED')
self.prop_unified_size(row, context, brush, "unprojected_radius", slider=True, text="Radius")
else:
@classmethod
def poll(cls, context):
settings = cls.paint_settings(context)
- return (settings and settings.brush and (context.sculpt_object or
- context.image_paint_object))
+ return (settings and settings.brush and
+ (context.sculpt_object or context.image_paint_object))
def draw(self, context):
layout = self.layout
@classmethod
def poll(cls, context):
settings = cls.paint_settings(context)
- return (settings and settings.brush and (context.sculpt_object or
- context.vertex_paint_object or
- context.weight_paint_object or
- context.image_paint_object))
+ return (settings and
+ settings.brush and
+ (context.sculpt_object or
+ context.vertex_paint_object or
+ context.weight_paint_object or
+ context.image_paint_object))
def draw(self, context):
layout = self.layout
# add rotation properties if they will
if bone.lock_rotations_4d:
# can check individually
- if (bone.lock_rotation == (False, False, False)) and (bone.lock_rotation_w == False):
+ if (bone.lock_rotation == (False, False, False)) and (bone.lock_rotation_w is False):
ksi.addProp(ks, bone, prop)
else:
- if bone.lock_rotation_w == False:
+ if bone.lock_rotation_w is False:
ksi.addProp(ks, bone, prop, 0) # w = 0
for i in range(3):