minor adjustments to python scripts to make them easier to run outside of blender.

This commit is contained in:
Campbell Barton 2010-08-10 18:21:33 +00:00
parent 76b17eaac5
commit 7c0216c7a0
6 changed files with 15 additions and 13 deletions

@ -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

@ -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

@ -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)

@ -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()

@ -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)")

@ -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)