Merged changes in the trunk up to revision 28772.

This commit is contained in:
Tamito Kajiyama
2010-05-14 21:50:15 +00:00
96 changed files with 13723 additions and 11273 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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