misc uninteresting stuff (killing time at airport commit)

- pep8 updates
- RNA_TwoDFilterActuator --> RNA_Filter2DActuator
- minor changes to conolse namespace init.
This commit is contained in:
2010-05-03 16:00:42 +00:00
parent 0fdd003d9a
commit 245ab753f5
13 changed files with 46 additions and 39 deletions

View File

@@ -40,9 +40,9 @@ def get_console(console_id):
'''
from code import InteractiveConsole
try:
consoles = get_console.consoles
except:
consoles = getattr(get_console, "consoles", None)
if consoles is None:
consoles = get_console.consoles = {}
# clear all dead consoles, use text names as IDs
@@ -53,16 +53,17 @@ def get_console(console_id):
del consoles[id]
'''
try:
console, stdout, stderr = consoles[console_id]
console_data = consoles.get(console_id)
if console_data:
console, stdout, stderr = console_data
# XXX, bug in python 3.1.2 ?
# seems there is no way to clear StringIO objects for writing, have to make new ones each time.
import io
stdout = io.StringIO()
stderr = io.StringIO()
except:
else:
namespace = {'__builtins__': __builtins__, 'bpy': bpy}
console = InteractiveConsole(namespace)

View File

@@ -28,7 +28,7 @@ class EditExternally(bpy.types.Operator):
bl_label = "Image Edit Externally"
bl_options = {'REGISTER'}
path = StringProperty(name="File Path", description="Path to an image file", maxlen= 1024, default= "")
path = StringProperty(name="File Path", description="Path to an image file", maxlen=1024, default="")
def _editor_guess(self, context):
import platform

View File

@@ -303,7 +303,7 @@ class DATA_PT_texface(DataButtonsPanel):
ob = context.active_object
rd = context.scene.render
return (context.mode =='EDIT_MESH') and (rd.engine == 'BLENDER_GAME') and ob and ob.type == 'MESH'
return (context.mode == 'EDIT_MESH') and (rd.engine == 'BLENDER_GAME') and ob and ob.type == 'MESH'
def draw(self, context):
layout = self.layout

View File

@@ -54,7 +54,6 @@ def point_cache_ui(self, context, cache, enabled, particles, smoke):
col = split.column(align=True)
if not particles:
col.enabled = enabled
col.prop(cache, "frame_start")
col.prop(cache, "frame_end")
@@ -75,7 +74,6 @@ def point_cache_ui(self, context, cache, enabled, particles, smoke):
col.label(text=cache.info)
layout.separator()
split = layout.split()

View File

@@ -107,7 +107,6 @@ class RENDER_PT_layers(RenderButtonsPanel):
col.prop(rl, "zmask_layers", text="")
layout.separator()
layout.label(text="Include:")

View File

@@ -47,6 +47,7 @@ class TEXTURE_MT_envmap_specials(bpy.types.Menu):
from properties_material import active_node_mat
def context_tex_datablock(context):
idblock = context.material
if idblock:
@@ -71,7 +72,8 @@ class TextureButtonsPanel(bpy.types.Panel):
def poll(self, context):
tex = context.texture
if not tex or tex == None: return False
if not tex:
return False
engine = context.scene.render.engine
return (tex.type != 'NONE' or tex.use_nodes) and (engine in self.COMPAT_ENGINES)

View File

@@ -85,6 +85,7 @@ class OUTLINER_MT_view(bpy.types.Menu):
layout.operator("screen.area_dupli")
layout.operator("screen.screen_full_area")
class OUTLINER_MT_search(bpy.types.Menu):
bl_label = "Search"
@@ -98,6 +99,7 @@ class OUTLINER_MT_search(bpy.types.Menu):
col.prop(space, "match_case_sensitive")
col.prop(space, "match_complete")
class OUTLINER_MT_edit_datablocks(bpy.types.Menu):
bl_label = "Edit"

View File

@@ -518,7 +518,7 @@ class SEQUENCER_PT_input(SequencerButtonsPanel):
'CROSS', 'GAMMA_CROSS', 'MULTIPLY', 'OVER_DROP',
'PLUGIN',
'WIPE', 'GLOW', 'TRANSFORM', 'COLOR',
'MULTICAM','SPEED')
'MULTICAM', 'SPEED')
def draw_filename(self, context):
pass
@@ -611,6 +611,7 @@ class SEQUENCER_PT_input_image(SEQUENCER_PT_input):
col = split.column()
col.prop(elem, "filename", text="") # strip.elements[0] could be a fallback
class SEQUENCER_PT_input_secondary(SEQUENCER_PT_input):
bl_label = "Strip Input"
@@ -627,6 +628,7 @@ class SEQUENCER_PT_input_secondary(SEQUENCER_PT_input):
def draw_filename(self, context):
pass
class SEQUENCER_PT_sound(SequencerButtonsPanel):
bl_label = "Sound"

View File

@@ -107,14 +107,17 @@ KM_HIERARCHY = [
('View3D Zoom Modal', 'EMPTY', 'WINDOW', []),
]
def _km_exists_in(km, export_keymaps):
for km2, kc in export_keymaps:
if km2.name == km.name:
return True
return False
# kc1 takes priority over kc2
def _merge_keymaps(kc1, kc2):
""" note: kc1 takes priority over kc2
"""
merged_keymaps = [(km, kc1) for km in kc1.keymaps]
if kc1 != kc2:
merged_keymaps.extend([(km, kc2) for km in kc2.keymaps if not _km_exists_in(km, merged_keymaps)])

View File

@@ -65,7 +65,7 @@ static StructRNA* rna_Actuator_refine(struct PointerRNA *ptr)
case ACT_VISIBILITY:
return &RNA_VisibilityActuator;
case ACT_2DFILTER:
return &RNA_TwoDFilterActuator;
return &RNA_Filter2DActuator;
case ACT_PARENT:
return &RNA_ParentActuator;
case ACT_SHAPEACTION:
@@ -969,7 +969,7 @@ static void rna_def_twodfilter_actuator(BlenderRNA *brna)
// {ACT_2DFILTER_NUMBER_OF_FILTERS, "", 0, "Do not use it. Sentinel", ""},
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "TwoDFilterActuator", "Actuator");
srna= RNA_def_struct(brna, "Filter2DActuator", "Actuator");
RNA_def_struct_ui_text(srna, "2D Filter Actuator", "Actuator to ..");
RNA_def_struct_sdna_from(srna, "bTwoDFilterActuator", "data");