Merge with trunk r40991

This commit is contained in:
2011-10-13 21:43:02 +00:00
257 changed files with 4499 additions and 3616 deletions

View File

@@ -69,8 +69,6 @@ class EditExternally(Operator):
self.report({'ERROR'}, "Image path not set")
return {'CANCELLED'}
filepath = os.path.normpath(bpy.path.abspath(filepath))
if not os.path.exists(filepath):
self.report({'ERROR'},
"Image path %r not found, image may be packed or "
@@ -93,15 +91,16 @@ class EditExternally(Operator):
return {'FINISHED'}
def invoke(self, context, event):
import os
try:
filepath = context.space_data.image.filepath
except:
import traceback
traceback.print_exc()
self.report({'ERROR'}, "Image not found on disk")
image = context.space_data.image
except AttributeError:
self.report({'ERROR'}, "Context incorrect, image not found")
return {'CANCELLED'}
self.filepath = filepath
filepath = bpy.path.abspath(image.filepath, library=image.library)
self.filepath = os.path.normpath(filepath)
self.execute(context)
return {'FINISHED'}

View File

@@ -140,7 +140,7 @@ def align_objects(align_x,
for obj, bb_world in objs:
if bb_quality:
if bb_quality and obj.type == 'MESH':
GBB = GlobalBB_HQ(obj)
else:
GBB = GlobalBB_LQ(bb_world)
@@ -204,7 +204,7 @@ def align_objects(align_x,
matrix_world = obj.matrix_world.copy()
bb_world = [matrix_world * Vector(v[:]) for v in obj.bound_box]
if bb_quality:
if bb_quality and obj.type == 'MESH':
GBB = GlobalBB_HQ(obj)
else:
GBB = GlobalBB_LQ(bb_world)

View File

@@ -462,10 +462,10 @@ class QuickFluid(Operator):
if self.style == 'INFLOW':
mod.settings.type = 'INFLOW'
mod.settings.inflow_velocity = self.initial_velocity.copy()
mod.settings.inflow_velocity = self.initial_velocity
else:
mod.settings.type = 'FLUID'
mod.settings.initial_velocity = self.initial_velocity.copy()
mod.settings.initial_velocity = self.initial_velocity
obj.hide_render = not self.show_flows
if not self.show_flows:

View File

@@ -259,10 +259,11 @@ class DATA_PT_active_spline(CurveButtonsPanelActive, Panel):
if not is_surf:
split = layout.split()
col = split.column()
col.active = (curve.dimensions == '3D')
col.label(text="Interpolation:")
col.prop(act_spline, "tilt_interpolation", text="Tilt")
colsub = col.column()
colsub.active = (curve.dimensions == '3D')
colsub.prop(act_spline, "tilt_interpolation", text="Tilt")
col.prop(act_spline, "radius_interpolation", text="Radius")
layout.prop(act_spline, "use_smooth")

View File

@@ -382,10 +382,6 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
col.label(text="Mirror Object:")
col.prop(md, "mirror_object", text="")
def NAVMESH(self, layout, ob, md):
layout.operator("mesh.assign_navpolygon")
layout.operator("mesh.assign_new_navpolygon")
def MULTIRES(self, layout, ob, md):
layout.row().prop(md, "subdivision_type", expand=True)

View File

@@ -47,8 +47,9 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel, Panel):
layout.prop(game, "physics_type")
layout.separator()
#if game.physics_type == 'DYNAMIC':
if game.physics_type in {'DYNAMIC', 'RIGID_BODY'}:
physics_type = game.physics_type
if physics_type in {'DYNAMIC', 'RIGID_BODY'}:
split = layout.split()
col = split.column()
@@ -108,7 +109,7 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel, Panel):
col.prop(game, "lock_rotation_y", text="Y")
col.prop(game, "lock_rotation_z", text="Z")
elif game.physics_type == 'SOFT_BODY':
elif physics_type == 'SOFT_BODY':
col = layout.column()
col.prop(game, "use_actor")
col.prop(game, "use_ghost")
@@ -143,7 +144,7 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel, Panel):
sub.active = (soft.use_cluster_rigid_to_softbody or soft.use_cluster_soft_to_softbody)
sub.prop(soft, "cluster_iterations", text="Iterations")
elif game.physics_type == 'STATIC':
elif physics_type == 'STATIC':
col = layout.column()
col.prop(game, "use_actor")
col.prop(game, "use_ghost")
@@ -164,9 +165,18 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel, Panel):
subsub.active = game.use_anisotropic_friction
subsub.prop(game, "friction_coefficients", text="", slider=True)
elif game.physics_type in {'SENSOR', 'INVISIBLE', 'NO_COLLISION', 'OCCLUDE'}:
elif physics_type in {'SENSOR', 'INVISIBLE', 'NO_COLLISION', 'OCCLUDE'}:
layout.prop(ob, "hide_render", text="Invisible")
elif physics_type == 'NAVMESH':
layout.operator("mesh.navmesh_face_copy")
layout.operator("mesh.navmesh_face_add")
layout.separator()
layout.operator("mesh.navmesh_reset")
layout.operator("mesh.navmesh_clear")
class PHYSICS_PT_game_collision_bounds(PhysicsButtonsPanel, Panel):
bl_label = "Collision Bounds"
@@ -412,7 +422,7 @@ class SCENE_PT_game_navmesh(SceneButtonsPanel, bpy.types.Panel):
rd = context.scene.game_settings.recast_data
layout.operator("mesh.create_navmesh", text='Build navigation mesh')
layout.operator("mesh.navmesh_make", text='Build navigation mesh')
col = layout.column()
col.label(text="Rasterization:")
@@ -429,8 +439,8 @@ class SCENE_PT_game_navmesh(SceneButtonsPanel, bpy.types.Panel):
col.prop(rd, "agent_radius", text="Radius")
col = split.column()
col.prop(rd, "max_slope")
col.prop(rd, "max_climb")
col.prop(rd, "slope_max")
col.prop(rd, "climb_max")
col = layout.column()
col.label(text="Region:")

View File

@@ -60,7 +60,6 @@ class SEQUENCER_HT_header(Header):
layout.separator()
layout.operator("sequencer.refresh_all")
layout.template_running_jobs()
elif st.view_type == 'SEQUENCER_PREVIEW':
layout.separator()
layout.operator("sequencer.refresh_all")
@@ -76,6 +75,8 @@ class SEQUENCER_HT_header(Header):
row.prop(ed, "overlay_frame", text="")
row.prop(ed, "overlay_lock", text="", icon='LOCKED')
layout.template_running_jobs()
class SEQUENCER_MT_view_toggle(Menu):
bl_label = "View Type"

View File

@@ -121,19 +121,6 @@ class InputKeyMapPanel:
for entry in children:
self.draw_entry(display_keymaps, entry, col, level + 1)
@staticmethod
def draw_kmi_properties(box, properties, title=None):
box.separator()
if title:
box.label(text=title)
flow = box.column_flow(columns=2)
for pname, value in properties.bl_rna.properties.items():
if pname != "rna_type" and not properties.is_property_hidden(pname):
if isinstance(value, OperatorProperties):
InputKeyMapPanel.draw_kmi_properties(box, value, title=pname)
else:
flow.prop(properties, pname)
def draw_kmi(self, display_keymaps, kc, km, kmi, layout, level):
map_type = kmi.map_type
@@ -218,9 +205,7 @@ class InputKeyMapPanel:
subrow.prop(kmi, "key_modifier", text="", event=True)
# Operator properties
props = kmi.properties
if props is not None:
InputKeyMapPanel.draw_kmi_properties(box, props)
box.template_keymap_item_properties(kmi)
# Modal key maps attached to this operator
if not km.is_modal:

View File

@@ -721,11 +721,14 @@ class VIEW3D_MT_object(Menu):
layout.separator()
layout.menu("VIEW3D_MT_object_quick_effects")
layout.separator()
layout.menu("VIEW3D_MT_object_game")
layout.separator()
layout.operator("object.join_uvs")
layout.operator("object.join")
layout.separator()
@@ -879,8 +882,8 @@ class VIEW3D_MT_object_parent(Menu):
def draw(self, context):
layout = self.layout
layout.operator("object.parent_set", text="Set")
layout.operator("object.parent_clear", text="Clear")
layout.operator_menu_enum("object.parent_set", "type", text="Set")
layout.operator_menu_enum("object.parent_clear", "type", text="Clear")
class VIEW3D_MT_object_track(Menu):
@@ -889,8 +892,8 @@ class VIEW3D_MT_object_track(Menu):
def draw(self, context):
layout = self.layout
layout.operator("object.track_set", text="Set")
layout.operator("object.track_clear", text="Clear")
layout.operator_menu_enum("object.track_set", "type", text="Set")
layout.operator_menu_enum("object.track_clear", "type", text="Clear")
class VIEW3D_MT_object_group(Menu):
@@ -919,6 +922,18 @@ class VIEW3D_MT_object_constraints(Menu):
layout.operator("object.constraints_clear")
class VIEW3D_MT_object_quick_effects(Menu):
bl_label = "Quick Effects"
def draw(self, context):
layout = self.layout
layout.operator("object.quick_fur")
layout.operator("object.quick_explode")
layout.operator("object.quick_smoke")
layout.operator("object.quick_fluid")
class VIEW3D_MT_object_showhide(Menu):
bl_label = "Show/Hide"
@@ -968,6 +983,7 @@ class VIEW3D_MT_make_links(Menu):
layout.operator_enum("object.make_links_data", "type") # inline
layout.operator("object.join_uvs") # stupid place to add this!
class VIEW3D_MT_object_game(Menu):
bl_label = "Game"

View File

@@ -484,16 +484,18 @@ class VIEW3D_PT_tools_brush(PaintPanel, Panel):
# XXX This needs a check if psys is editable.
if context.particle_edit_object:
tool = settings.tool
# XXX Select Particle System
layout.column().prop(settings, "tool", expand=True)
if settings.tool != 'NONE':
if tool != 'NONE':
col = layout.column()
col.prop(brush, "size", slider=True)
if settings.tool != 'ADD':
if tool != 'ADD':
col.prop(brush, "strength", slider=True)
if settings.tool == 'ADD':
if tool == 'ADD':
col.prop(brush, "count")
col = layout.column()
col.prop(settings, "use_default_interpolate")
@@ -501,15 +503,16 @@ class VIEW3D_PT_tools_brush(PaintPanel, Panel):
sub.active = settings.use_default_interpolate
sub.prop(brush, "steps", slider=True)
sub.prop(settings, "default_key_count", slider=True)
elif settings.tool == 'LENGTH':
elif tool == 'LENGTH':
layout.prop(brush, "length_mode", expand=True)
elif settings.tool == 'PUFF':
elif tool == 'PUFF':
layout.prop(brush, "puff_mode", expand=True)
layout.prop(brush, "use_puff_volume")
# Sculpt Mode #
elif context.sculpt_object and brush:
tool = brush.sculpt_tool
col = layout.column()
@@ -526,12 +529,12 @@ class VIEW3D_PT_tools_brush(PaintPanel, Panel):
row.prop(brush, "use_pressure_size", toggle=True, text="")
if brush.sculpt_tool not in {'SNAKE_HOOK', 'GRAB', 'ROTATE'}:
if tool not in {'SNAKE_HOOK', 'GRAB', 'ROTATE'}:
col.separator()
row = col.row(align=True)
if brush.use_space and brush.sculpt_tool not in {'SMOOTH'}:
if brush.use_space and tool != 'SMOOTH':
if brush.use_space_atten:
row.prop(brush, "use_space_atten", toggle=True, text="", icon='LOCKED')
else:
@@ -540,26 +543,26 @@ class VIEW3D_PT_tools_brush(PaintPanel, Panel):
row.prop(brush, "strength", text="Strength", slider=True)
row.prop(brush, "use_pressure_strength", text="")
if brush.sculpt_tool not in {'SMOOTH'}:
if tool != 'SMOOTH':
col.separator()
row = col.row(align=True)
row.prop(brush, "auto_smooth_factor", slider=True)
row.prop(brush, "use_inverse_smooth_pressure", toggle=True, text="")
if brush.sculpt_tool in {'GRAB', 'SNAKE_HOOK'}:
if tool in {'GRAB', 'SNAKE_HOOK'}:
col.separator()
row = col.row(align=True)
row.prop(brush, "normal_weight", slider=True)
if brush.sculpt_tool in {'CREASE', 'BLOB'}:
if tool in {'CREASE', 'BLOB'}:
col.separator()
row = col.row(align=True)
row.prop(brush, "crease_pinch_factor", slider=True, text="Pinch")
if brush.sculpt_tool not in {'PINCH', 'INFLATE', 'SMOOTH'}:
if tool not in {'PINCH', 'INFLATE', 'SMOOTH'}:
row = col.row(align=True)
col.separator()
@@ -571,8 +574,8 @@ class VIEW3D_PT_tools_brush(PaintPanel, Panel):
row.prop(brush, "sculpt_plane", text="")
#if brush.sculpt_tool in {'CLAY', 'CLAY_TUBES', 'FLATTEN', 'FILL', 'SCRAPE'}:
if brush.sculpt_tool in {'CLAY', 'FLATTEN', 'FILL', 'SCRAPE'}:
#if tool in {'CLAY', 'CLAY_TUBES', 'FLATTEN', 'FILL', 'SCRAPE'}:
if tool in {'CLAY', 'FLATTEN', 'FILL', 'SCRAPE'}:
row = col.row(align=True)
row.prop(brush, "plane_offset", slider=True)
row.prop(brush, "use_offset_pressure", text="")
@@ -585,7 +588,7 @@ class VIEW3D_PT_tools_brush(PaintPanel, Panel):
row.active = brush.use_plane_trim
row.prop(brush, "plane_trim", slider=True, text="Distance")
if brush.sculpt_tool == 'LAYER':
if tool == 'LAYER':
row = col.row()
row.prop(brush, "height", slider=True, text="Height")
@@ -597,12 +600,12 @@ class VIEW3D_PT_tools_brush(PaintPanel, Panel):
col.separator()
col.row().prop(brush, "direction", expand=True)
if brush.sculpt_tool in {'DRAW', 'CREASE', 'BLOB', 'INFLATE', 'LAYER', 'CLAY'}:
if tool in {'DRAW', 'CREASE', 'BLOB', 'INFLATE', 'LAYER', 'CLAY'}:
col.separator()
col.prop(brush, "use_accumulate")
if brush.sculpt_tool == 'LAYER':
if tool == 'LAYER':
col.separator()
ob = context.sculpt_object

View File

@@ -353,14 +353,26 @@ class BUILTIN_KSI_WholeCharacter(KeyingSetInfo):
# custom properties
def doCustomProps(ksi, ks, bone):
prop_type_compat = {bpy.types.BooleanProperty,
bpy.types.IntProperty,
bpy.types.FloatProperty}
# go over all custom properties for bone
for prop, val in bone.items():
for prop in bone.keys():
# ignore special "_RNA_UI" used for UI editing
if prop == "_RNA_UI":
continue
# for now, just add all of 'em
ksi.addProp(ks, bone, '["%s"]' % (prop))
prop_rna = type(bone).bl_rna.properties.get(prop, None)
if prop_rna is None:
prop_path = '["%s"]' % prop
if bone.path_resolve(prop_path, False).rna_type in prop_type_compat:
ksi.addProp(ks, bone, prop_path)
elif prop_rna.is_animatable:
ksi.addProp(ks, bone, prop)
###############################