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:
authorCampbell Barton <ideasman42@gmail.com>2010-08-10 22:21:33 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-08-10 22:21:33 +0400
commit7c0216c7a0d853d2d98a900e946f25beac6d9954 (patch)
tree25b0a2193335b4485817b11d0334299d4c5928f9
parent76b17eaac58bd65e84190c9c4b48e18ce9bc6737 (diff)
minor adjustments to python scripts to make them easier to run outside of blender.
-rw-r--r--release/scripts/ui/properties_data_armature_rigify.py11
-rw-r--r--release/scripts/ui/properties_material.py2
-rw-r--r--release/scripts/ui/properties_object.py2
-rw-r--r--release/scripts/ui/properties_render.py2
-rw-r--r--release/scripts/ui/space_info.py6
-rw-r--r--release/scripts/ui/space_view3d_toolbar.py5
6 files changed, 15 insertions, 13 deletions
diff --git a/release/scripts/ui/properties_data_armature_rigify.py b/release/scripts/ui/properties_data_armature_rigify.py
index 070f1fb7678..0dbd964acb5 100644
--- a/release/scripts/ui/properties_data_armature_rigify.py
+++ b/release/scripts/ui/properties_data_armature_rigify.py
@@ -95,12 +95,13 @@ class DATA_PT_template(bpy.types.Panel):
subsubrow.operator("pose.metarig_assign", text="Assign")
subsubrow.operator("pose.metarig_clear", text="Clear")
- subsubrow = subrow.split(percentage=0.8)
- subsubrow.operator("pose.metarig_sample_add", text="Sample").metarig_type = self.templates[pose_templates.active_template_index]
- subsubrow.operator("pose.metarig_sample_add", text="All").metarig_type = "" # self.templates[pose_templates.active_template_index]
+ if self.templates:
+ subsubrow = subrow.split(percentage=0.8)
+ subsubrow.operator("pose.metarig_sample_add", text="Sample").metarig_type = self.templates[pose_templates.active_template_index]
+ subsubrow.operator("pose.metarig_sample_add", text="All").metarig_type = "" # self.templates[pose_templates.active_template_index]
- sub = row.column(align=True)
- sub.operator("pose.metarig_reload", icon="FILE_REFRESH", text="")
+ sub = row.column(align=True)
+ sub.operator("pose.metarig_reload", icon="FILE_REFRESH", text="")
# operators
diff --git a/release/scripts/ui/properties_material.py b/release/scripts/ui/properties_material.py
index d14c8c05c63..5034f4f40ae 100644
--- a/release/scripts/ui/properties_material.py
+++ b/release/scripts/ui/properties_material.py
@@ -24,7 +24,7 @@ from rna_prop_ui import PropertyPanel
def active_node_mat(mat):
# TODO, 2.4x has a pipeline section, for 2.5 we need to communicate
# which settings from node-materials are used
- if mat:
+ if mat is not None:
mat_node = mat.active_node_material
if mat_node:
return mat_node
diff --git a/release/scripts/ui/properties_object.py b/release/scripts/ui/properties_object.py
index 6923e60a3df..3af0cdef1e4 100644
--- a/release/scripts/ui/properties_object.py
+++ b/release/scripts/ui/properties_object.py
@@ -252,7 +252,7 @@ class OBJECT_PT_animation(ObjectButtonsPanel, bpy.types.Panel):
col.prop(ob, "time_offset_edit", text="Edit")
row = col.row()
row.prop(ob, "time_offset_particle", text="Particle")
- row.active = len(ob.particle_systems) != 0
+ row.active = bool(ob.particle_systems)
row = col.row()
row.prop(ob, "time_offset_parent", text="Parent")
row.active = (ob.parent is not None)
diff --git a/release/scripts/ui/properties_render.py b/release/scripts/ui/properties_render.py
index cd11179dc25..6e8ebb10691 100644
--- a/release/scripts/ui/properties_render.py
+++ b/release/scripts/ui/properties_render.py
@@ -440,7 +440,7 @@ class RENDER_PT_encoding(RenderButtonsPanel, bpy.types.Panel):
# Audio:
sub = layout.column()
- if rd.ffmpeg_format not in ('MP3'):
+ if rd.ffmpeg_format not in ('MP3', ):
sub.prop(rd, "ffmpeg_audio_codec", text="Audio Codec")
sub.separator()
diff --git a/release/scripts/ui/space_info.py b/release/scripts/ui/space_info.py
index 618cd3c51c9..db9e4df8967 100644
--- a/release/scripts/ui/space_info.py
+++ b/release/scripts/ui/space_info.py
@@ -27,7 +27,7 @@ class INFO_HT_header(bpy.types.Header):
layout = self.layout
wm = context.manager
- if wm and len(wm.operators):
+ if wm and wm.operators:
last_op = wm.operators[-1]
else:
last_op = None
@@ -131,7 +131,7 @@ class INFO_MT_file_import(bpy.types.Menu):
bl_label = "Import"
def draw(self, context):
- if "collada_import" in dir(bpy.ops.wm):
+ if hasattr(bpy.types, "WM_OT_collada_import"):
self.layout.operator("wm.collada_import", text="COLLADA (.dae)")
@@ -140,7 +140,7 @@ class INFO_MT_file_export(bpy.types.Menu):
bl_label = "Export"
def draw(self, context):
- if "collada_export" in dir(bpy.ops.wm):
+ if hasattr(bpy.types, "WM_OT_collada_export"):
self.layout.operator("wm.collada_export", text="COLLADA (.dae)")
diff --git a/release/scripts/ui/space_view3d_toolbar.py b/release/scripts/ui/space_view3d_toolbar.py
index 56abbb3cb14..8981369f3b0 100644
--- a/release/scripts/ui/space_view3d_toolbar.py
+++ b/release/scripts/ui/space_view3d_toolbar.py
@@ -487,7 +487,7 @@ class PaintPanel():
elif context.particle_edit_object:
return ts.particle_edit
- return False
+ return None
class VIEW3D_PT_tools_brush(PaintPanel, bpy.types.Panel):
@@ -753,7 +753,7 @@ class VIEW3D_PT_tools_brush_texture(PaintPanel, bpy.types.Panel):
col.separator()
col = layout.column()
- col.active = tex_slot.map_mode in ('FIXED')
+ col.active = tex_slot.map_mode in ('FIXED', )
col.label(text="Angle:")
col = layout.column()
@@ -963,6 +963,7 @@ class VIEW3D_PT_tools_brush_curve(PaintPanel, bpy.types.Panel):
layout = self.layout
settings = self.paint_settings(context)
+
brush = settings.brush
layout.template_curve_mapping(brush, "curve", brush=True)