svn merge -r39781:39792 https://svn.blender.org/svnroot/bf-blender/trunk/blender, merge pepper, manually merged source/blender/editors/transform/transform_generics.c

This commit is contained in:
2011-09-01 00:35:30 +00:00
432 changed files with 66798 additions and 23877 deletions

View File

@@ -84,8 +84,7 @@ def bake(frame_start,
do_pose=True,
do_object=True,
do_constraint_clear=False,
action=None,
):
action=None):
scene = bpy.context.scene
obj = bpy.context.object
@@ -200,19 +199,32 @@ class BakeAction(Operator):
bl_label = "Bake Action"
bl_options = {'REGISTER', 'UNDO'}
frame_start = IntProperty(name="Start Frame",
frame_start = IntProperty(
name="Start Frame",
description="Start frame for baking",
default=1, min=1, max=300000)
frame_end = IntProperty(name="End Frame",
min=0, max=300000,
default=1,
)
frame_end = IntProperty(
name="End Frame",
description="End frame for baking",
default=250, min=1, max=300000)
step = IntProperty(name="Frame Step",
min=1, max=300000,
default=250,
)
step = IntProperty(
name="Frame Step",
description="Frame Step",
default=1, min=1, max=120)
only_selected = BoolProperty(name="Only Selected",
default=True)
clear_consraints = BoolProperty(name="Clear Constraints",
default=False)
min=1, max=120,
default=1,
)
only_selected = BoolProperty(
name="Only Selected",
default=True,
)
clear_consraints = BoolProperty(
name="Clear Constraints",
default=False,
)
bake_types = EnumProperty(
name="Bake Data",
options={'ENUM_FLAG'},
@@ -256,3 +268,38 @@ class BakeAction(Operator):
def invoke(self, context, event):
wm = context.window_manager
return wm.invoke_props_dialog(self)
#################################
class ClearUselessActions(bpy.types.Operator):
'''Mark actions with no F-Curves for deletion after save+reload of file preserving "action libraries"'''
bl_idname = "anim.clear_useless_actions"
bl_label = "Clear Useless Actions"
bl_options = {'REGISTER', 'UNDO'}
only_unused = BoolProperty(name="Only Unused",
description="Only unused (Fake User only) actions get considered",
default=True)
@classmethod
def poll(cls, context):
return len(bpy.data.actions) != 0
def execute(self, context):
removed = 0
for action in bpy.data.actions:
# if only user is "fake" user...
if ((self.only_unused is False) or
(action.use_fake_user and action.users == 1)):
# if it has F-Curves, then it's a "action library" (i.e. walk, wave, jump, etc.)
# and should be left alone as that's what fake users are for!
if not action.fcurves:
# mark action for deletion
action.user_clear()
removed += 1
self.report({'INFO'}, "Removed %d empty and/or fake-user only Actions" % (removed))
return {'FINISHED'}

View File

@@ -685,3 +685,44 @@ class ClearAllRestrictRender(Operator):
for obj in context.scene.objects:
obj.hide_render = False
return {'FINISHED'}
class TransformsToDeltasAnim(bpy.types.Operator):
'''Convert object animation for normal transforms to delta transforms'''
bl_idname = "object.anim_transforms_to_deltas"
bl_label = "Animated Transforms to Deltas"
bl_options = {'REGISTER', 'UNDO'}
@classmethod
def poll(cls, context):
obs = context.selected_editable_objects
return (obs is not None)
def execute(self, context):
for obj in context.selected_editable_objects:
# get animation data
adt = obj.animation_data
if (adt is None) or (adt.action is None):
self.report({'WARNING'}, "No animation data to convert on object: " + obj.name)
continue
# if F-Curve uses standard transform path, just append "delta_" to this path
for fcu in adt.action.fcurves:
if fcu.data_path == "location":
fcu.data_path = "delta_location"
obj.location.zero()
elif fcu.data_path == "rotation_euler":
fcu.data_path = "delta_rotation_euler"
obj.rotation_euler.zero()
elif fcu.data_path == "rotation_quaternion":
fcu.data_path = "delta_rotation_quaternion"
obj.rotation_quaternion.identity()
#elif fcu.data_path == "rotation_axis_angle": # XXX: currently not implemented
# fcu.data_path = "delta_rotation_axis_angle"
elif fcu.data_path == "scale":
fcu.data_path = "delta_scale"
obj.scale = (1, 1, 1)
# hack: force animsys flush by changing frame, so that deltas get run
context.scene.frame_set(context.scene.frame_current)
return {'FINISHED'}

View File

@@ -36,6 +36,7 @@ _modules = (
"properties_data_mesh",
"properties_data_metaball",
"properties_data_modifier",
"properties_data_speaker",
"properties_game",
"properties_material",
"properties_object_constraint",

View File

@@ -18,7 +18,7 @@
# <pep8 compliant>
import bpy
from bpy.types import Panel
from bpy.types import Panel, Menu
from rna_prop_ui import PropertyPanel
@@ -71,6 +71,9 @@ class DATA_PT_skeleton(ArmatureButtonsPanel, Panel):
flow.prop(arm, "use_deform_envelopes", text="Envelopes")
flow.prop(arm, "use_deform_preserve_volume", text="Quaternion")
if context.scene.render.engine == "BLENDER_GAME":
col = layout.column()
col.prop(arm, "vert_deformer")
class DATA_PT_display(ArmatureButtonsPanel, Panel):
bl_label = "Display"
@@ -97,6 +100,15 @@ class DATA_PT_display(ArmatureButtonsPanel, Panel):
col.prop(arm, "use_deform_delay", text="Delay Refresh")
class DATA_PT_bone_group_specials(Menu):
bl_label = "Bone Group Specials"
def draw(self, context):
layout = self.layout
layout.operator("pose.group_sort", icon='SORTALPHA')
class DATA_PT_bone_groups(ArmatureButtonsPanel, Panel):
bl_label = "Bone Groups"
@@ -109,16 +121,25 @@ class DATA_PT_bone_groups(ArmatureButtonsPanel, Panel):
ob = context.object
pose = ob.pose
group = pose.bone_groups.active
row = layout.row()
row.template_list(pose, "bone_groups", pose.bone_groups, "active_index", rows=2)
rows = 2
if group:
rows = 5
row.template_list(pose, "bone_groups", pose.bone_groups, "active_index", rows=rows)
col = row.column(align=True)
col.active = (ob.proxy is None)
col.operator("pose.group_add", icon='ZOOMIN', text="")
col.operator("pose.group_remove", icon='ZOOMOUT', text="")
col.menu("DATA_PT_bone_group_specials", icon='DOWNARROW_HLT', text="")
if group:
col.separator()
col.operator("pose.group_move", icon='TRIA_UP', text="").direction = 'UP'
col.operator("pose.group_move", icon='TRIA_DOWN', text="").direction = 'DOWN'
group = pose.bone_groups.active
if group:
col = layout.column()
col.active = (ob.proxy is None)

View File

@@ -0,0 +1,129 @@
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
import bpy
from rna_prop_ui import PropertyPanel
class DataButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "data"
@classmethod
def poll(cls, context):
engine = context.scene.render.engine
return context.speaker and (engine in cls.COMPAT_ENGINES)
class DATA_PT_context_speaker(DataButtonsPanel, bpy.types.Panel):
bl_label = ""
bl_options = {'HIDE_HEADER'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
def draw(self, context):
layout = self.layout
ob = context.object
speaker = context.speaker
space = context.space_data
split = layout.split(percentage=0.65)
if ob:
split.template_ID(ob, "data")
elif speaker:
split.template_ID(space, "pin_id")
class DATA_PT_speaker(DataButtonsPanel, bpy.types.Panel):
bl_label = "Sound"
COMPAT_ENGINES = {'BLENDER_RENDER'}
def draw(self, context):
layout = self.layout
speaker = context.speaker
split = layout.split(percentage=0.75)
split.template_ID(speaker, "sound", open="sound.open_mono")
split.prop(speaker, "muted")
split = layout.split()
row = split.row()
row.prop(speaker, "volume")
row.prop(speaker, "pitch")
class DATA_PT_distance(DataButtonsPanel, bpy.types.Panel):
bl_label = "Distance"
COMPAT_ENGINES = {'BLENDER_RENDER'}
def draw(self, context):
layout = self.layout
speaker = context.speaker
split = layout.split()
col = split.column()
col.label("Volume:")
col.prop(speaker, "volume_min", text="Minimum")
col.prop(speaker, "volume_max", text="Maximum")
col.prop(speaker, "attenuation")
col = split.column()
col.label("Distance:")
col.prop(speaker, "distance_max", text="Maximum")
col.prop(speaker, "distance_reference", text="Reference")
class DATA_PT_cone(DataButtonsPanel, bpy.types.Panel):
bl_label = "Cone"
COMPAT_ENGINES = {'BLENDER_RENDER'}
def draw(self, context):
layout = self.layout
speaker = context.speaker
split = layout.split()
col = split.column()
col.label("Angle:")
col.prop(speaker, "cone_angle_outer", text="Outer")
col.prop(speaker, "cone_angle_inner", text="Inner")
col = split.column()
col.label("Volume:")
col.prop(speaker, "cone_volume_outer", text="Outer")
class DATA_PT_custom_props_speaker(DataButtonsPanel, PropertyPanel, bpy.types.Panel):
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
_context_path = "object.data"
_property_type = bpy.types.Speaker
if __name__ == "__main__": # only for live edit.
bpy.utils.register_module(__name__)

View File

@@ -343,6 +343,7 @@ class RENDER_PT_game_performance(RenderButtonsPanel, Panel):
row = layout.row()
row.prop(gs, "use_frame_rate")
row.prop(gs, "use_display_lists")
row.prop(gs, "restrict_animation_updates")
class RENDER_PT_game_display(RenderButtonsPanel, Panel):
@@ -361,21 +362,6 @@ class RENDER_PT_game_display(RenderButtonsPanel, Panel):
flow.prop(gs, "show_mouse", text="Mouse Cursor")
class RENDER_PT_game_sound(RenderButtonsPanel, Panel):
bl_label = "Sound"
COMPAT_ENGINES = {'BLENDER_GAME'}
def draw(self, context):
layout = self.layout
scene = context.scene
layout.prop(scene, "audio_distance_model")
layout.prop(scene, "audio_doppler_speed", text="Speed")
layout.prop(scene, "audio_doppler_factor")
class WorldButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'

View File

@@ -477,6 +477,11 @@ class ConstraintButtonsPanel():
row.label(text="Clamp Region:")
row.prop(con, "limit_mode", text="")
row = layout.row()
row.prop(con, "use_transform_limit")
row.label()
def STRETCH_TO(self, context, layout, con):
self.target_template(layout, con)

View File

@@ -596,9 +596,8 @@ class RENDER_PT_encoding(RenderButtonsPanel, Panel):
col = split.column()
col.prop(rd, "ffmpeg_audio_bitrate")
col.prop(rd, "ffmpeg_audio_mixrate")
split.prop(rd, "ffmpeg_audio_volume", slider=True)
col = split.column()
col.prop(rd, "ffmpeg_audio_volume", slider=True)
class RENDER_PT_bake(RenderButtonsPanel, Panel):

View File

@@ -44,6 +44,36 @@ class SCENE_PT_scene(SceneButtonsPanel, Panel):
layout.prop(scene, "background_set", text="Background")
class SCENE_PT_audio(SceneButtonsPanel, Panel):
bl_label = "Audio"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
def draw(self, context):
layout = self.layout
scene = context.scene
rd = context.scene.render
layout.prop(scene, "audio_volume")
layout.operator("sound.bake_animation")
split = layout.split()
col = split.column()
col.label("Listener:")
col.prop(scene, "audio_distance_model", text="")
col.prop(scene, "audio_doppler_speed", text="Speed")
col.prop(scene, "audio_doppler_factor", text="Doppler")
col = split.column()
col.label("Format:")
col.prop(rd, "ffmpeg_audio_channels", text="")
col.prop(rd, "ffmpeg_audio_mixrate", text="Rate")
layout.operator("sound.mixdown")
class SCENE_PT_unit(SceneButtonsPanel, Panel):
bl_label = "Units"
COMPAT_ENGINES = {'BLENDER_RENDER'}

View File

@@ -34,41 +34,10 @@ def dopesheet_filter(layout, context, genericFiltersOnly=False):
row.prop(dopesheet, "show_only_selected", text="")
row.prop(dopesheet, "show_hidden", text="")
if is_nla:
row.prop(dopesheet, "show_missing_nla", text="")
if not genericFiltersOnly:
row = layout.row(align=True)
row.prop(dopesheet, "show_transforms", text="")
if is_nla:
row.prop(dopesheet, "show_missing_nla", text="")
row = layout.row(align=True)
row.prop(dopesheet, "show_scenes", text="")
row.prop(dopesheet, "show_worlds", text="")
row.prop(dopesheet, "show_nodes", text="")
if bpy.data.meshes:
row.prop(dopesheet, "show_meshes", text="")
if bpy.data.shape_keys:
row.prop(dopesheet, "show_shapekeys", text="")
if bpy.data.materials:
row.prop(dopesheet, "show_materials", text="")
if bpy.data.lamps:
row.prop(dopesheet, "show_lamps", text="")
if bpy.data.textures:
row.prop(dopesheet, "show_textures", text="")
if bpy.data.cameras:
row.prop(dopesheet, "show_cameras", text="")
if bpy.data.curves:
row.prop(dopesheet, "show_curves", text="")
if bpy.data.metaballs:
row.prop(dopesheet, "show_metaballs", text="")
if bpy.data.lattices:
row.prop(dopesheet, "show_lattices", text="")
if bpy.data.armatures:
row.prop(dopesheet, "show_armatures", text="")
if bpy.data.particles:
row.prop(dopesheet, "show_particles", text="")
if bpy.data.groups:
row = layout.row(align=True)
row.prop(dopesheet, "show_only_group_objects", text="")
@@ -81,6 +50,42 @@ def dopesheet_filter(layout, context, genericFiltersOnly=False):
if dopesheet.show_only_matching_fcurves:
row.prop(dopesheet, "filter_fcurve_name", text="")
if not genericFiltersOnly:
row = layout.row(align=True)
row.prop(dopesheet, "show_datablock_filters", text="Filters")
if dopesheet.show_datablock_filters:
row.prop(dopesheet, "show_scenes", text="")
row.prop(dopesheet, "show_worlds", text="")
row.prop(dopesheet, "show_nodes", text="")
row.prop(dopesheet, "show_transforms", text="")
if bpy.data.meshes:
row.prop(dopesheet, "show_meshes", text="")
if bpy.data.shape_keys:
row.prop(dopesheet, "show_shapekeys", text="")
if bpy.data.materials:
row.prop(dopesheet, "show_materials", text="")
if bpy.data.lamps:
row.prop(dopesheet, "show_lamps", text="")
if bpy.data.textures:
row.prop(dopesheet, "show_textures", text="")
if bpy.data.cameras:
row.prop(dopesheet, "show_cameras", text="")
if bpy.data.curves:
row.prop(dopesheet, "show_curves", text="")
if bpy.data.metaballs:
row.prop(dopesheet, "show_metaballs", text="")
if bpy.data.lattices:
row.prop(dopesheet, "show_lattices", text="")
if bpy.data.armatures:
row.prop(dopesheet, "show_armatures", text="")
if bpy.data.particles:
row.prop(dopesheet, "show_particles", text="")
if bpy.data.speakers:
row.prop(dopesheet, "show_speakers", text="")
#######################################
# DopeSheet Editor - General/Standard UI
@@ -277,7 +282,7 @@ class DOPESHEET_MT_key(Menu):
layout.operator("action.keyframe_insert")
layout.separator()
layout.operator("action.duplicate")
layout.operator("action.duplicate_move")
layout.operator("action.delete")
layout.separator()

View File

@@ -78,7 +78,7 @@ class GRAPH_MT_view(Menu):
layout.prop(st, "use_auto_merge_keyframes")
layout.separator()
layout.prop(st, "use_fancy_drawing")
layout.prop(st, "use_beauty_drawing")
layout.separator()
if st.show_handles:
@@ -206,7 +206,7 @@ class GRAPH_MT_key(Menu):
layout.operator("graph.sound_bake")
layout.separator()
layout.operator("graph.duplicate")
layout.operator("graph.duplicate_move")
layout.operator("graph.delete")
layout.separator()

View File

@@ -294,6 +294,9 @@ class INFO_MT_add(Menu):
layout.operator("object.add", text="Empty", icon='OUTLINER_OB_EMPTY').type = 'EMPTY'
layout.separator()
layout.operator("object.speaker_add", text="Speaker", icon='OUTLINER_OB_SPEAKER')
layout.separator()
layout.operator("object.camera_add", text="Camera", icon='OUTLINER_OB_CAMERA')
layout.operator_context = 'EXEC_SCREEN'
layout.operator_menu_enum("object.lamp_add", "type", text="Lamp", icon='OUTLINER_OB_LAMP')

View File

@@ -69,7 +69,11 @@ class NLA_MT_view(Menu):
layout.separator()
layout.operator("anim.previewrange_set")
layout.operator("anim.previewrange_clear")
layout.separator()
layout.operator("nla.view_all")
layout.operator("nla.view_selected")
layout.separator()
layout.operator("screen.area_dupli")
layout.operator("screen.screen_full_area")
@@ -162,6 +166,7 @@ class NLA_MT_add(Menu):
layout.operator("nla.actionclip_add")
layout.operator("nla.transition_add")
layout.operator("nla.soundclip_add")
layout.separator()
layout.operator("nla.meta_add")

View File

@@ -113,7 +113,11 @@ class SEQUENCER_MT_view(Menu):
layout.operator("sequencer.view_selected")
layout.prop(st, "show_frames")
if st.show_frames:
layout.operator("anim.time_toggle", text="Show Seconds")
else:
layout.operator("anim.time_toggle", text="Show Frames")
layout.prop(st, "show_frame_indicator")
if st.display_mode == 'IMAGE':
layout.prop(st, "show_safe_margin")
@@ -643,8 +647,10 @@ class SEQUENCER_PT_sound(SequencerButtonsPanel, Panel):
row.prop(strip.sound, "use_memory_cache")
layout.prop(strip, "waveform")
layout.prop(strip, "volume")
layout.prop(strip, "attenuation")
layout.prop(strip, "pitch")
layout.prop(strip, "pan")
col = layout.column(align=True)
col.label(text="Trim Duration:")

View File

@@ -179,6 +179,10 @@ class VIEW3D_MT_transform(Menu):
layout.operator("object.randomize_transform")
layout.operator("object.align")
layout.separator()
layout.operator("object.anim_transforms_to_deltas")
class VIEW3D_MT_mirror(Menu):
@@ -1258,12 +1262,15 @@ class VIEW3D_MT_pose_transform(Menu):
layout.operator("pose.transforms_clear", text="All")
layout.separator()
layout.operator("pose.loc_clear", text="Location")
layout.operator("pose.rot_clear", text="Rotation")
layout.operator("pose.scale_clear", text="Scale")
layout.label(text="Origin")
layout.separator()
layout.operator("pose.user_transforms_clear", text="Reset unkeyed")
class VIEW3D_MT_pose_slide(Menu):
bl_label = "In-Betweens"