diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2012-12-19 05:49:58 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2012-12-19 05:49:58 +0400 |
commit | d433cd65f7127d60e17d05a824290423ad226eae (patch) | |
tree | f0a9c821f6046e97b74c6969d41269b558fd52ab /release/scripts/startup | |
parent | 10f0f66560234a04aed3295c74fff20adacbc57f (diff) | |
parent | f10dea7e3b9b431edae9c787fa1a9e09cd567ed7 (diff) |
Merged changes in the trunk up to revision 53146.
Conflicts resolved:
release/datafiles/startup.blend
source/blender/blenkernel/CMakeLists.txt
source/blender/blenlib/intern/bpath.c
source/blender/blenloader/intern/readfile.c
Diffstat (limited to 'release/scripts/startup')
-rw-r--r-- | release/scripts/startup/bl_operators/node.py | 87 | ||||
-rw-r--r-- | release/scripts/startup/bl_operators/wm.py | 2 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/properties_data_mesh.py | 4 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/properties_data_modifier.py | 42 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/properties_game.py | 18 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/properties_particle.py | 81 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/properties_physics_cloth.py | 2 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/properties_render.py | 18 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_sequencer.py | 4 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_userpref.py | 46 |
10 files changed, 221 insertions, 83 deletions
diff --git a/release/scripts/startup/bl_operators/node.py b/release/scripts/startup/bl_operators/node.py index fb264cb3429..071eb2e75f9 100644 --- a/release/scripts/startup/bl_operators/node.py +++ b/release/scripts/startup/bl_operators/node.py @@ -20,7 +20,92 @@ import bpy from bpy.types import Operator -from bpy.props import EnumProperty +from bpy.props import EnumProperty, StringProperty + +# Base class for node 'Add' operators +class NodeAddOperator(): + @staticmethod + def store_mouse_cursor(context, event): + space = context.space_data + v2d = context.region.view2d + + # convert mouse position to the View2D for later node placement + space.cursor_location = v2d.region_to_view(event.mouse_region_x, + event.mouse_region_y) + + def create_node(self, context, node_type): + space = context.space_data + tree = space.edit_tree + + # select only the new node + for n in tree.nodes: + n.select = False + + node = tree.nodes.new(type=node_type) + + node.select = True + tree.nodes.active = node + node.location = space.cursor_location + return node + + @classmethod + def poll(cls, context): + space = context.space_data + # needs active node editor and a tree to add nodes to + return (space.type == 'NODE_EDITOR' and space.edit_tree) + + # Default invoke stores the mouse position to place the node correctly + def invoke(self, context, event): + self.store_mouse_cursor(context, event) + return self.execute(context) + + +# Simple basic operator for adding a node +class NODE_OT_add_node(NodeAddOperator, Operator): + '''Add a node to the active tree''' + bl_idname = "node.add_node" + bl_label = "Add Node" + + type = StringProperty( + name="Node Type", + description="Node type", + ) + # optional group tree parameter for group nodes + group_tree = StringProperty( + name="Group tree", + description="Group node tree name", + ) + def execute(self, context): + node = self.create_node(context, self.type) + + # set the node group tree of a group node + if self.properties.is_property_set('group_tree'): + node.node_tree = bpy.data.node_groups[self.group_tree] + + return {'FINISHED'} + + +# Adds a node and immediately starts the transform operator for inserting in a tree +class NODE_OT_add_node_move(NODE_OT_add_node): + '''Add a node to the active tree and start transform''' + bl_idname = "node.add_node_move" + bl_label = "Add Node and Move" + + type = StringProperty( + name="Node Type", + description="Node type", + ) + # optional group tree parameter for group nodes + group_tree = StringProperty( + name="Group tree", + description="Group node tree name", + ) + + def invoke(self, context, event): + self.store_mouse_cursor(context, event) + self.execute(context) + return bpy.ops.transform.translate('INVOKE_DEFAULT') + # XXX These node item lists should actually be generated by a callback at # operator execution time (see node_type_items below), diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py index 105b532ac38..c24e0920213 100644 --- a/release/scripts/startup/bl_operators/wm.py +++ b/release/scripts/startup/bl_operators/wm.py @@ -1620,7 +1620,7 @@ class WM_OT_addon_disable(Operator): class WM_OT_theme_install(Operator): - "Install a theme" + "Load and apply a Blender XML theme file" bl_idname = "wm.theme_install" bl_label = "Install Theme..." diff --git a/release/scripts/startup/bl_ui/properties_data_mesh.py b/release/scripts/startup/bl_ui/properties_data_mesh.py index 6125540d491..e33bed7ec6d 100644 --- a/release/scripts/startup/bl_ui/properties_data_mesh.py +++ b/release/scripts/startup/bl_ui/properties_data_mesh.py @@ -36,8 +36,8 @@ class MESH_MT_vertex_group_specials(Menu): layout.operator("object.vertex_group_mirror", icon='ARROW_LEFTRIGHT') layout.operator("object.vertex_group_remove", icon='X', text="Delete All").all = True layout.separator() - layout.operator("object.vertex_group_lock", icon='LOCKED', text="Lock All").action = 'SELECT' - layout.operator("object.vertex_group_lock", icon='UNLOCKED', text="UnLock All").action = 'DESELECT' + layout.operator("object.vertex_group_lock", icon='LOCKED', text="Lock All").action = 'LOCK' + layout.operator("object.vertex_group_lock", icon='UNLOCKED', text="UnLock All").action = 'UNLOCK' layout.operator("object.vertex_group_lock", icon='LOCKED', text="Lock Invert All").action = 'INVERT' diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py index 62461d800f6..e90d1616929 100644 --- a/release/scripts/startup/bl_ui/properties_data_modifier.py +++ b/release/scripts/startup/bl_ui/properties_data_modifier.py @@ -1032,5 +1032,47 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): def TRIANGULATE(self, layout, ob, md): layout.prop(md, "use_beauty") + def UV_WARP(self, layout, ob, md): + split = layout.split() + col = split.column() + col.prop(md, "center"); + + col = split.column() + col.label(text="UV Axis:") + col.prop(md, "axis_u", text=""); + col.prop(md, "axis_v", text=""); + + split = layout.split() + col = split.column() + col.label(text="From:") + col.prop(md, "object_from", text="") + + col = split.column() + col.label(text="To:") + col.prop(md, "object_to", text="") + + split = layout.split() + col = split.column() + obj = md.object_from + if obj and obj.type == 'ARMATURE': + col.label(text="Bone:") + col.prop_search(md, "bone_from", obj.data, "bones", text="") + + col = split.column() + obj = md.object_to + if obj and obj.type == 'ARMATURE': + col.label(text="Bone:") + col.prop_search(md, "bone_to", obj.data, "bones", text="") + + split = layout.split() + + col = split.column() + col.label(text="Vertex Group:") + col.prop_search(md, "vertex_group", ob, "vertex_groups", text="") + + col = split.column() + col.label(text="UV Map:") + col.prop_search(md, "uv_layer", ob.data, "uv_textures", text="") + if __name__ == "__main__": # only for live edit. bpy.utils.register_module(__name__) diff --git a/release/scripts/startup/bl_ui/properties_game.py b/release/scripts/startup/bl_ui/properties_game.py index bf0c9eb762a..42f651de6df 100644 --- a/release/scripts/startup/bl_ui/properties_game.py +++ b/release/scripts/startup/bl_ui/properties_game.py @@ -402,14 +402,18 @@ class RENDER_PT_game_system(RenderButtonsPanel, Panel): layout = self.layout gs = context.scene.game_settings - - row = layout.row() - row.prop(gs, "use_frame_rate") - row.prop(gs, "restrict_animation_updates") - + col = layout.column() + row = col.row() + col = row.column() + col.prop(gs, "use_frame_rate") + col.prop(gs, "restrict_animation_updates") + col = row.column() + col.prop(gs, "use_display_lists") + col.active = gs.raster_storage != 'VERTEX_BUFFER_OBJECT' + row = layout.row() - row.prop(gs, "use_display_lists") - + row.prop(gs, "raster_storage") + row = layout.row() row.label("Exit Key") row.prop(gs, "exit_key", text="", event=True) diff --git a/release/scripts/startup/bl_ui/properties_particle.py b/release/scripts/startup/bl_ui/properties_particle.py index 3f672d2a977..2c2ced5db0c 100644 --- a/release/scripts/startup/bl_ui/properties_particle.py +++ b/release/scripts/startup/bl_ui/properties_particle.py @@ -490,11 +490,13 @@ class PARTICLE_PT_physics(ParticleButtonsPanel, Panel): col.prop(part, "integrator", text="") col.prop(part, "timestep") sub = col.row() - if part.adaptive_subframes: - sub.prop(part, "courant_target", text="Threshold") - else: - sub.prop(part, "subframes") - sub.prop(part, "adaptive_subframes", text="") + sub.prop(part, "subframes") + supports_courant = part.physics_type == 'FLUID' + subsub = sub.row() + subsub.enabled = supports_courant + subsub.prop(part, "adaptive_subframes", text="") + if supports_courant and part.adaptive_subframes: + col.prop(part, "courant_target", text="Threshold") row = layout.row() row.prop(part, "use_size_deflect") @@ -504,6 +506,10 @@ class PARTICLE_PT_physics(ParticleButtonsPanel, Panel): fluid = part.fluid split = layout.split() + sub = split.row() + sub.prop(fluid, "solver", expand=True) + + split = layout.split() col = split.column() col.label(text="Fluid properties:") @@ -514,13 +520,14 @@ class PARTICLE_PT_physics(ParticleButtonsPanel, Panel): col = split.column() col.label(text="Advanced:") - sub = col.row() - sub.prop(fluid, "repulsion", slider=fluid.factor_repulsion) - sub.prop(fluid, "factor_repulsion", text="") + if fluid.solver == 'DDR': + sub = col.row() + sub.prop(fluid, "repulsion", slider=fluid.factor_repulsion) + sub.prop(fluid, "factor_repulsion", text="") - sub = col.row() - sub.prop(fluid, "stiff_viscosity", slider=fluid.factor_stiff_viscosity) - sub.prop(fluid, "factor_stiff_viscosity", text="") + sub = col.row() + sub.prop(fluid, "stiff_viscosity", slider=fluid.factor_stiff_viscosity) + sub.prop(fluid, "factor_stiff_viscosity", text="") sub = col.row() sub.prop(fluid, "fluid_radius", slider=fluid.factor_radius) @@ -530,27 +537,37 @@ class PARTICLE_PT_physics(ParticleButtonsPanel, Panel): sub.prop(fluid, "rest_density", slider=fluid.factor_density) sub.prop(fluid, "factor_density", text="") - split = layout.split() - - col = split.column() - col.label(text="Springs:") - col.prop(fluid, "spring_force", text="Force") - col.prop(fluid, "use_viscoelastic_springs") - sub = col.column(align=True) - sub.active = fluid.use_viscoelastic_springs - sub.prop(fluid, "yield_ratio", slider=True) - sub.prop(fluid, "plasticity", slider=True) - - col = split.column() - col.label(text="Advanced:") - sub = col.row() - sub.prop(fluid, "rest_length", slider=fluid.factor_rest_length) - sub.prop(fluid, "factor_rest_length", text="") - col.label(text="") - sub = col.column() - sub.active = fluid.use_viscoelastic_springs - sub.prop(fluid, "use_initial_rest_length") - sub.prop(fluid, "spring_frames", text="Frames") + if fluid.solver == 'CLASSICAL': + # With the classical solver, it is possible to calculate the + # spacing between particles when the fluid is at rest. This + # makes it easier to set stable initial conditions. + particle_volume = part.mass / fluid.rest_density + spacing = pow(particle_volume, 1/3) + sub = col.row() + sub.label(text="Spacing: %g" % spacing) + + elif fluid.solver == 'DDR': + split = layout.split() + + col = split.column() + col.label(text="Springs:") + col.prop(fluid, "spring_force", text="Force") + col.prop(fluid, "use_viscoelastic_springs") + sub = col.column(align=True) + sub.active = fluid.use_viscoelastic_springs + sub.prop(fluid, "yield_ratio", slider=True) + sub.prop(fluid, "plasticity", slider=True) + + col = split.column() + col.label(text="Advanced:") + sub = col.row() + sub.prop(fluid, "rest_length", slider=fluid.factor_rest_length) + sub.prop(fluid, "factor_rest_length", text="") + col.label(text="") + sub = col.column() + sub.active = fluid.use_viscoelastic_springs + sub.prop(fluid, "use_initial_rest_length") + sub.prop(fluid, "spring_frames", text="Frames") elif part.physics_type == 'KEYED': split = layout.split() diff --git a/release/scripts/startup/bl_ui/properties_physics_cloth.py b/release/scripts/startup/bl_ui/properties_physics_cloth.py index 5a44294f0e0..91b4cc0ae49 100644 --- a/release/scripts/startup/bl_ui/properties_physics_cloth.py +++ b/release/scripts/startup/bl_ui/properties_physics_cloth.py @@ -91,7 +91,7 @@ class PHYSICS_PT_cloth(PhysicButtonsPanel, Panel): sub.prop(cloth, "pin_stiffness", text="Stiffness") col.label(text="Pre roll:") - col.prop(cloth, "pre_roll", text="Frame") + col.prop(cloth, "pre_roll", text="Frames") # Disabled for now """ diff --git a/release/scripts/startup/bl_ui/properties_render.py b/release/scripts/startup/bl_ui/properties_render.py index df43677601f..8031bd26bee 100644 --- a/release/scripts/startup/bl_ui/properties_render.py +++ b/release/scripts/startup/bl_ui/properties_render.py @@ -492,7 +492,7 @@ class RENDER_PT_bake(RenderButtonsPanel, Panel): layout.prop(rd, "bake_type") multires_bake = False - if rd.bake_type in ['NORMALS', 'DISPLACEMENT']: + if rd.bake_type in ['NORMALS', 'DISPLACEMENT', 'AO']: layout.prop(rd, "use_bake_multires") multires_bake = rd.use_bake_multires @@ -521,11 +521,19 @@ class RENDER_PT_bake(RenderButtonsPanel, Panel): sub.prop(rd, "bake_distance") sub.prop(rd, "bake_bias") else: - if rd.bake_type == 'DISPLACEMENT': - layout.prop(rd, "use_bake_lores_mesh") + split = layout.split() - layout.prop(rd, "use_bake_clear") - layout.prop(rd, "bake_margin") + col = split.column() + col.prop(rd, "use_bake_clear") + col.prop(rd, "bake_margin") + + if rd.bake_type == 'DISPLACEMENT': + col = split.column() + col.prop(rd, "use_bake_lores_mesh") + if rd.bake_type == 'AO': + col = split.column() + col.prop(rd, "bake_bias") + col.prop(rd, "bake_rays_number") if __name__ == "__main__": # only for live edit. diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py index fdfd43157c7..5b7a3a82aae 100644 --- a/release/scripts/startup/bl_ui/space_sequencer.py +++ b/release/scripts/startup/bl_ui/space_sequencer.py @@ -867,6 +867,10 @@ class SEQUENCER_PT_preview(SequencerButtonsPanel_Output, Panel): #col.active = render.use_sequencer_gl_preview col.prop(render, "sequencer_gl_preview", text="") + row = col.row() + row.active = render.sequencer_gl_preview == 'SOLID' + row.prop(render, "use_sequencer_gl_textured_solid") + class SEQUENCER_PT_view(SequencerButtonsPanel_Output, Panel): bl_label = "View Settings" diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py index 0bb25e98456..7c6c8dce954 100644 --- a/release/scripts/startup/bl_ui/space_userpref.py +++ b/release/scripts/startup/bl_ui/space_userpref.py @@ -84,7 +84,7 @@ class USERPREF_HT_header(Header): userpref = context.user_preferences layout.operator_context = 'EXEC_AREA' - layout.operator("wm.save_homefile", text="Save As Default") + layout.operator("wm.save_userpref") layout.operator_context = 'INVOKE_DEFAULT' @@ -445,6 +445,7 @@ class USERPREF_PT_system(Panel): col.label(text="Window Draw Method:") col.prop(system, "window_draw_method", text="") col.prop(system, "multi_sample", text="") + col.prop(system, "use_region_overlap") col.label(text="Text Draw Options:") col.prop(system, "use_text_antialiasing") col.label(text="Textures:") @@ -491,15 +492,15 @@ class USERPREF_PT_system(Panel): sub.active = system.use_weight_color_range sub.template_color_ramp(system, "weight_color_range", expand=True) - column.separator() - - column.prop(system, "use_international_fonts") - if system.use_international_fonts: - column.prop(system, "language") - row = column.row() - row.label(text="Translate:") - row.prop(system, "use_translate_interface", text="Interface") - row.prop(system, "use_translate_tooltips", text="Tooltips") + if 'INTERNATIONAL' in bpy.app.build_options: + column.separator() + column.prop(system, "use_international_fonts") + if system.use_international_fonts: + column.prop(system, "language") + row = column.row() + row.label(text="Translate:") + row.prop(system, "use_translate_interface", text="Interface") + row.prop(system, "use_translate_tooltips", text="Tooltips") class USERPREF_MT_interface_theme_presets(Menu): @@ -706,30 +707,6 @@ class USERPREF_PT_theme(Panel): col.separator() col.separator() - ui = theme.user_interface.panel - col.label("Panels:") - - row = col.row() - - subsplit = row.split(percentage=0.95) - - padding = subsplit.split(percentage=0.15) - colsub = padding.column() - colsub = padding.column() - rowsub = colsub.row() - rowsub.prop(ui, "show_header") - rowsub.label() - - subsplit = row.split(percentage=0.85) - - padding = subsplit.split(percentage=0.15) - colsub = padding.column() - colsub = padding.column() - colsub.row().prop(ui, "header") - - col.separator() - col.separator() - ui = theme.user_interface col.label("Axis Colors:") @@ -855,6 +832,7 @@ class USERPREF_PT_file(Panel): col.prop(paths, "recent_files") col.prop(paths, "use_save_preview_images") col.label(text="Auto Save:") + col.prop(paths, "use_keep_session") col.prop(paths, "use_auto_save_temporary_files") sub = col.column() sub.active = paths.use_auto_save_temporary_files |