diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2010-05-15 01:50:15 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2010-05-15 01:50:15 +0400 |
commit | cfc351afee68d99e65c74af450afd7bf82abcdf2 (patch) | |
tree | 80b72e483535b24160301b96f361a25f524236e8 /release | |
parent | bc993fcd55069906c43e1840003bb9a4f394e269 (diff) | |
parent | cd6332ca1ef3eab73a9db312ba7a790902391c4b (diff) |
Merged changes in the trunk up to revision 28772.
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/modules/bpy/utils.py | 51 | ||||
-rw-r--r-- | release/scripts/modules/rna_prop_ui.py | 2 | ||||
-rw-r--r-- | release/scripts/op/nla.py | 2 | ||||
-rw-r--r-- | release/scripts/op/presets.py | 4 | ||||
-rw-r--r-- | release/scripts/op/wm.py | 3 | ||||
-rw-r--r-- | release/scripts/ui/properties_particle.py | 3 | ||||
-rw-r--r-- | release/scripts/ui/properties_physics_cloth.py | 2 | ||||
-rw-r--r-- | release/scripts/ui/properties_physics_common.py | 12 | ||||
-rw-r--r-- | release/scripts/ui/properties_physics_smoke.py | 4 | ||||
-rw-r--r-- | release/scripts/ui/properties_physics_softbody.py | 2 | ||||
-rw-r--r-- | release/scripts/ui/space_node.py | 3 | ||||
-rw-r--r-- | release/scripts/ui/space_text.py | 19 | ||||
-rw-r--r-- | release/scripts/ui/space_userpref.py | 19 | ||||
-rw-r--r-- | release/scripts/ui/space_view3d.py | 4 |
14 files changed, 99 insertions, 31 deletions
diff --git a/release/scripts/modules/bpy/utils.py b/release/scripts/modules/bpy/utils.py index a3fee82e566..28e4e71a627 100644 --- a/release/scripts/modules/bpy/utils.py +++ b/release/scripts/modules/bpy/utils.py @@ -27,7 +27,7 @@ import bpy as _bpy import os as _os import sys as _sys -from _bpy import home_paths +from _bpy import home_paths, blend_paths def _test_import(module_name, loaded_modules): @@ -332,3 +332,52 @@ def preset_paths(subdir): ''' return (_os.path.join(_presets, subdir), ) + + +def smpte_from_seconds(time, fps=None): + ''' + Returns an SMPTE formatted string from the time in seconds: "HH:MM:SS:FF". + + If the fps is not given the current scene is used. + ''' + import math + + if fps is None: + fps = _bpy.context.scene.render.fps + + hours = minutes = seconds = frames = 0 + + if time < 0: + time = -time + neg = "-" + else: + neg = "" + + if time >= 3600.0: # hours + hours = int(time / 3600.0) + time = time % 3600.0 + if time >= 60.0: # mins + minutes = int(time / 60.0) + time = time % 60.0 + + seconds = int(time) + frames= int(round(math.floor( ((time - seconds) * fps)))) + + return "%s%02d:%02d:%02d:%02d" % (neg, hours, minutes, seconds, frames) + + +def smpte_from_frame(frame, fps=None, fps_base=None): + ''' + Returns an SMPTE formatted string from the frame: "HH:MM:SS:FF". + + If the fps and fps_base are not given the current scene is used. + ''' + + if fps is None: + fps = _bpy.context.scene.render.fps + + if fps_base is None: + fps_base = _bpy.context.scene.render.fps_base + + return smpte_from_seconds((frame * fps_base) / fps, fps) +
\ No newline at end of file diff --git a/release/scripts/modules/rna_prop_ui.py b/release/scripts/modules/rna_prop_ui.py index 246fa4bdb7d..7af57d265b9 100644 --- a/release/scripts/modules/rna_prop_ui.py +++ b/release/scripts/modules/rna_prop_ui.py @@ -253,7 +253,7 @@ class WM_OT_properties_add(bpy.types.Operator): class WM_OT_properties_remove(bpy.types.Operator): '''Internal use (edit a property path)''' bl_idname = "wm.properties_remove" - bl_label = "Add Property" + bl_label = "Remove Property" path = rna_path property = rna_property diff --git a/release/scripts/op/nla.py b/release/scripts/op/nla.py index e88586b6cb8..d0c53758ba9 100644 --- a/release/scripts/op/nla.py +++ b/release/scripts/op/nla.py @@ -130,7 +130,7 @@ from bpy.props import * class BakeAction(bpy.types.Operator): - '''Add a torus mesh''' + '''Bake animation to an Action''' bl_idname = "nla.bake" bl_label = "Bake Action" bl_options = {'REGISTER', 'UNDO'} diff --git a/release/scripts/op/presets.py b/release/scripts/op/presets.py index f02c1c62ab9..03d70afc43b 100644 --- a/release/scripts/op/presets.py +++ b/release/scripts/op/presets.py @@ -27,8 +27,8 @@ class AddPresetBase(bpy.types.Operator): subclasses must define - preset_values - preset_subdir ''' - bl_idname = "render.preset_add" - bl_label = "Add Render Preset" + bl_idname = "script.add_preset_base" + bl_label = "Add a Python Preset" name = bpy.props.StringProperty(name="Name", description="Name of the preset, used to make the path name", maxlen=64, default="") diff --git a/release/scripts/op/wm.py b/release/scripts/op/wm.py index 5893a9cf472..af72c96a412 100644 --- a/release/scripts/op/wm.py +++ b/release/scripts/op/wm.py @@ -24,8 +24,7 @@ from bpy.props import * class MESH_OT_delete_edgeloop(bpy.types.Operator): - '''Export a single object as a stanford PLY with normals, - colours and texture coordinates.''' + '''Delete an edge loop by merging the faces on each side to a single face loop''' bl_idname = "mesh.delete_edgeloop" bl_label = "Delete Edge Loop" diff --git a/release/scripts/ui/properties_particle.py b/release/scripts/ui/properties_particle.py index 6ec396bf7a1..a1bc4019c6d 100644 --- a/release/scripts/ui/properties_particle.py +++ b/release/scripts/ui/properties_particle.py @@ -269,10 +269,9 @@ class PARTICLE_PT_cache(ParticleButtonsPanel): return psys.settings.type in ('EMITTER', 'REACTOR') or (psys.settings.type == 'HAIR' and psys.hair_dynamics) def draw(self, context): - psys = context.particle_system - point_cache_ui(self, context, psys.point_cache, particle_panel_enabled(context, psys), not psys.hair_dynamics, 0) + point_cache_ui(self, context, psys.point_cache, True, 'HAIR' if psys.hair_dynamics else 'PSYS') class PARTICLE_PT_velocity(ParticleButtonsPanel): diff --git a/release/scripts/ui/properties_physics_cloth.py b/release/scripts/ui/properties_physics_cloth.py index 5aa15fe9403..67fc79eb4d1 100644 --- a/release/scripts/ui/properties_physics_cloth.py +++ b/release/scripts/ui/properties_physics_cloth.py @@ -142,7 +142,7 @@ class PHYSICS_PT_cloth_cache(PhysicButtonsPanel): def draw(self, context): md = context.cloth - point_cache_ui(self, context, md.point_cache, cloth_panel_enabled(md), 0, 0) + point_cache_ui(self, context, md.point_cache, cloth_panel_enabled(md), 'CLOTH') class PHYSICS_PT_cloth_collision(PhysicButtonsPanel): diff --git a/release/scripts/ui/properties_physics_common.py b/release/scripts/ui/properties_physics_common.py index cad1229a0de..eac2bc60f35 100644 --- a/release/scripts/ui/properties_physics_common.py +++ b/release/scripts/ui/properties_physics_common.py @@ -22,7 +22,8 @@ narrowui = 180 import bpy -def point_cache_ui(self, context, cache, enabled, particles, smoke): +#cachetype can be 'PSYS' 'HAIR' 'SMOKE' etc +def point_cache_ui(self, context, cache, enabled, cachetype): layout = self.layout wide_ui = context.region.width > narrowui @@ -35,7 +36,7 @@ def point_cache_ui(self, context, cache, enabled, particles, smoke): col.operator("ptcache.remove", icon='ZOOMOUT', text="") row = layout.row() - if particles: + if cachetype in {'PSYS', 'HAIR'}: row.prop(cache, "external") if cache.external: @@ -53,17 +54,17 @@ def point_cache_ui(self, context, cache, enabled, particles, smoke): split = layout.split() col = split.column(align=True) - if not particles: + if cachetype != 'PSYS': col.enabled = enabled col.prop(cache, "frame_start") col.prop(cache, "frame_end") - if not smoke: + if cachetype != 'SMOKE': col.prop(cache, "step") if wide_ui: col = split.column() - if not smoke: + if cachetype != 'SMOKE': sub = col.column() sub.enabled = enabled sub.prop(cache, "quick_cache") @@ -102,7 +103,6 @@ def point_cache_ui(self, context, cache, enabled, particles, smoke): col.operator("ptcache.free_bake_all", text="Free All Bakes") col.operator("ptcache.bake_all", text="Update All To Frame").bake = False - def effector_weights_ui(self, context, weights): layout = self.layout diff --git a/release/scripts/ui/properties_physics_smoke.py b/release/scripts/ui/properties_physics_smoke.py index b1cec9bb120..d4a40dc6788 100644 --- a/release/scripts/ui/properties_physics_smoke.py +++ b/release/scripts/ui/properties_physics_smoke.py @@ -166,7 +166,7 @@ class PHYSICS_PT_smoke_cache(PhysicButtonsPanel): md = context.smoke.domain_settings cache = md.point_cache_low - point_cache_ui(self, context, cache, (cache.baked is False), 0, 1) + point_cache_ui(self, context, cache, (cache.baked is False), 'SMOKE') class PHYSICS_PT_smoke_highres(PhysicButtonsPanel): @@ -222,7 +222,7 @@ class PHYSICS_PT_smoke_cache_highres(PhysicButtonsPanel): md = context.smoke.domain_settings cache = md.point_cache_high - point_cache_ui(self, context, cache, (cache.baked is False), 0, 1) + point_cache_ui(self, context, cache, (cache.baked is False), 'SMOKE') class PHYSICS_PT_smoke_field_weights(PhysicButtonsPanel): diff --git a/release/scripts/ui/properties_physics_softbody.py b/release/scripts/ui/properties_physics_softbody.py index 1cef6291c78..8e685b8a66c 100644 --- a/release/scripts/ui/properties_physics_softbody.py +++ b/release/scripts/ui/properties_physics_softbody.py @@ -97,7 +97,7 @@ class PHYSICS_PT_softbody_cache(PhysicButtonsPanel): def draw(self, context): md = context.soft_body - point_cache_ui(self, context, md.point_cache, softbody_panel_enabled(md), 0, 0) + point_cache_ui(self, context, md.point_cache, softbody_panel_enabled(md), 'SOFTBODY') class PHYSICS_PT_softbody_goal(PhysicButtonsPanel): diff --git a/release/scripts/ui/space_node.py b/release/scripts/ui/space_node.py index c49ee68f0bf..db641a48e38 100644 --- a/release/scripts/ui/space_node.py +++ b/release/scripts/ui/space_node.py @@ -108,6 +108,9 @@ class NODE_MT_select(bpy.types.Menu): layout.operator("node.select_all") layout.operator("node.select_linked_from") layout.operator("node.select_linked_to") + layout.operator("node.select_same_type") + layout.operator("node.select_same_type_next") + layout.operator("node.select_same_type_prev") class NODE_MT_node(bpy.types.Menu): diff --git a/release/scripts/ui/space_text.py b/release/scripts/ui/space_text.py index 9f52ae25121..8671e67bd87 100644 --- a/release/scripts/ui/space_text.py +++ b/release/scripts/ui/space_text.py @@ -274,6 +274,22 @@ class TEXT_MT_edit(bpy.types.Menu): layout.menu("TEXT_MT_edit_to3d") +class TEXT_MT_toolbox(bpy.types.Menu): + bl_label = "" + + def draw(self, context): + layout = self.layout + layout.operator_context = 'INVOKE_DEFAULT' + + layout.operator("text.cut") + layout.operator("text.copy") + layout.operator("text.paste") + + layout.separator() + + layout.operator("text.run_script") + + classes = [ TEXT_HT_header, TEXT_PT_properties, @@ -285,7 +301,8 @@ classes = [ TEXT_MT_edit_view, TEXT_MT_edit_select, TEXT_MT_edit_markers, - TEXT_MT_edit_to3d] + TEXT_MT_edit_to3d, + TEXT_MT_toolbox] def register(): diff --git a/release/scripts/ui/space_userpref.py b/release/scripts/ui/space_userpref.py index 0e6e4572fb9..21ee0d107f6 100644 --- a/release/scripts/ui/space_userpref.py +++ b/release/scripts/ui/space_userpref.py @@ -629,9 +629,10 @@ class USERPREF_PT_theme(bpy.types.Panel): col.prop(v3d, "bone_solid") col.prop(v3d, "bone_pose") col.prop(v3d, "edge_seam") + col.prop(v3d, "edge_select") + col.prop(v3d, "edge_facesel") col.prop(v3d, "edge_sharp") col.prop(v3d, "edge_crease") - #col.prop(v3d, "edge") Doesn't seem to work elif theme.theme_area == 'GRAPH_EDITOR': graph = theme.graph_editor @@ -932,18 +933,18 @@ class USERPREF_PT_theme(bpy.types.Panel): col.prop(prefs, "header_text") elif theme.theme_area == 'CONSOLE': - prefs = theme.console + console = theme.console col = split.column() - col.prop(prefs, "back") - col.prop(prefs, "header") + col.prop(console, "back") + col.prop(console, "header") col = split.column() - col.prop(prefs, "line_output") - col.prop(prefs, "line_input") - col.prop(prefs, "line_info") - col.prop(prefs, "line_error") - col.prop(prefs, "cursor") + col.prop(console, "line_output") + col.prop(console, "line_input") + col.prop(console, "line_info") + col.prop(console, "line_error") + col.prop(console, "cursor") class USERPREF_PT_file(bpy.types.Panel): diff --git a/release/scripts/ui/space_view3d.py b/release/scripts/ui/space_view3d.py index a8fc4eb89af..8be176843fc 100644 --- a/release/scripts/ui/space_view3d.py +++ b/release/scripts/ui/space_view3d.py @@ -523,7 +523,7 @@ class VIEW3D_MT_select_edit_curve(bpy.types.Menu): layout.operator("curve.select_all", text="Select/Deselect All") layout.operator("curve.select_inverse") layout.operator("curve.select_random") - layout.operator("curve.select_every_nth") + layout.operator("curve.select_nth", text="Every Nth Number of Points") layout.separator() @@ -552,7 +552,7 @@ class VIEW3D_MT_select_edit_surface(bpy.types.Menu): layout.operator("curve.select_all", text="Select/Deselect All") layout.operator("curve.select_inverse") layout.operator("curve.select_random") - layout.operator("curve.select_every_nth") + layout.operator("curve.select_nth", text="Every Nth Number of Points") layout.separator() |