This commit is contained in:
Matt Ebb 2009-08-25 01:37:08 +00:00
commit ea97a37383
54 changed files with 903 additions and 2126 deletions

@ -251,8 +251,8 @@ IF(WIN32)
IF(WITH_JACK)
SET(JACK ${LIBDIR}/jack)
SET(JACK_INC ${JACK}/include/jack)
SET(JACK_LIB jack)
SET(JACK_INC ${JACK}/include/jack ${JACK}/include)
SET(JACK_LIB libjack)
SET(JACK_LIBPATH ${JACK}/lib)
ENDIF(WITH_JACK)

@ -580,11 +580,11 @@ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc'):
'${LCGDIR}/ffmpeg/lib/avformat-52.dll',
'${LCGDIR}/ffmpeg/lib/avdevice-52.dll',
'${LCGDIR}/ffmpeg/lib/avutil-50.dll',
'${LCGDIR}/ffmpeg/lib/libfaad-2.dll',
'${LCGDIR}/ffmpeg/lib/libfaac-0.dll',
'${LCGDIR}/ffmpeg/lib/libmp3lame-0.dll',
'${LCGDIR}/ffmpeg/lib/libx264-67.dll',
'${LCGDIR}/ffmpeg/lib/xvidcore.dll',
# '${LCGDIR}/ffmpeg/lib/libfaad-2.dll',
# '${LCGDIR}/ffmpeg/lib/libfaac-0.dll',
# '${LCGDIR}/ffmpeg/lib/libmp3lame-0.dll',
# '${LCGDIR}/ffmpeg/lib/libx264-67.dll',
# '${LCGDIR}/ffmpeg/lib/xvidcore.dll',
'${LCGDIR}/ffmpeg/lib/swscale-0.dll']
if env['WITH_BF_JACK']:
dllsources += ['${LCGDIR}/jack/lib/libjack.dll']

@ -22,9 +22,9 @@ BF_OPENAL_LIB = 'wrap_oal'
BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
WITH_BF_FFMPEG = False
BF_FFMPEG_LIB = 'avformat swscale avcodec avutil avdevice xvidcore x264'
BF_FFMPEG_LIBPATH = LIBDIR + '/gcc/ffmpeg/lib'
BF_FFMPEG_INC = LIBDIR + '/gcc/ffmpeg/include'
BF_FFMPEG_LIB = 'avformat-52 avcodec-52 avdevice-52 avutil-50 swscale-0'
BF_FFMPEG_LIBPATH = LIBDIR + '/ffmpeg/lib'
BF_FFMPEG_INC = LIBDIR + '/ffmpeg/include'
BF_LIBSAMPLERATE = LIBDIR + '/samplerate'
BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'

@ -4,7 +4,7 @@ LIBDIR = '${LCGDIR}'
# enable ffmpeg support
WITH_BF_FFMPEG = True # -DWITH_FFMPEG
BF_FFMPEG = LIBDIR +'/ffmpeg'
BF_FFMPEG_INC = '${BF_FFMPEG}/include'
BF_FFMPEG_INC = '${BF_FFMPEG}/include ${BF_FFMPEG}/include/msvc'
BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
BF_FFMPEG_LIB = 'avformat-52.lib avcodec-52.lib avdevice-52.lib avutil-50.lib swscale-0.lib'

@ -635,11 +635,89 @@ def write_pov_ini(filename_ini, filename_pov, filename_image):
file.close()
# Radiosity panel, use in the scene for now.
FloatProperty= bpy.types.Scene.FloatProperty
IntProperty= bpy.types.Scene.IntProperty
BoolProperty= bpy.types.Scene.BoolProperty
# Not a real pov option, just to know if we should write
BoolProperty( attr="pov_radio_enable",
name="Enable Radiosity",
description="Enable povrays radiosity calculation.",
default= False)
BoolProperty( attr="pov_radio_display_advanced",
name="Advanced Options",
description="Show advanced options.",
default= False)
# Real pov options
FloatProperty( attr="pov_radio_adc_bailout",
name="ADC Bailout",
description="The adc_bailout for radiosity rays. Use adc_bailout = 0.01 / brightest_ambient_object for good results.",
min=0.0, max=1000.0, soft_min=0.0, soft_max=1.0, default= 0.01)
BoolProperty( attr="pov_radio_always_sample",
name="Always Sample",
description="Only use the data from the pretrace step and not gather any new samples during the final radiosity pass..",
default= True)
FloatProperty( attr="pov_radio_brightness",
name="Brightness",
description="Ammount objects are brightened before being returned upwards to the rest of the system.",
min=0.0, max=1000.0, soft_min=0.0, soft_max=10.0, default= 1.0)
IntProperty( attr="pov_radio_count",
name="Ray Count",
description="number of rays that are sent out whenever a new radiosity value has to be calculated.",
min=1, max=1600, default= 35)
FloatProperty( attr="pov_radio_error_bound",
name="Error Bound",
description="one of the two main speed/quality tuning values, lower values are more accurate.",
min=0.0, max=1000.0, soft_min=0.1, soft_max=10.0, default= 1.8)
FloatProperty( attr="pov_radio_gray_threshold",
name="Gray Threshold",
description="one of the two main speed/quality tuning values, lower values are more accurate.",
min=0.0, max=1.0, soft_min=0, soft_max=1, default= 0.0)
FloatProperty( attr="pov_radio_low_error_factor",
name="Low Error Factor",
description="If you calculate just enough samples, but no more, you will get an image which has slightly blotchy lighting.",
min=0.0, max=1.0, soft_min=0.0, soft_max=1.0, default= 0.5)
# max_sample - not available yet
BoolProperty( attr="pov_radio_media",
name="Media",
description="Radiosity estimation can be affected by media.",
default= False)
FloatProperty( attr="pov_radio_minimum_reuse",
name="Minimum Reuse",
description="Fraction of the screen width which sets the minimum radius of reuse for each sample point (At values higher than 2% expect errors).",
min=0.0, max=1.0, soft_min=0.1, soft_max=0.1, default= 0.015)
IntProperty( attr="pov_radio_nearest_count",
name="Nearest Count",
description="Number of old ambient values blended together to create a new interpolated value.",
min=1, max=20, default= 5)
BoolProperty( attr="pov_radio_normal",
name="Normals",
description="Radiosity estimation can be affected by normals.",
default= False)
IntProperty( attr="pov_radio_recursion_limit",
name="Recursion Limit",
description="how many recursion levels are used to calculate the diffuse inter-reflection.",
min=1, max=20, default= 3)
class PovrayRender(bpy.types.RenderEngine):
__idname__ = 'POVRAY_RENDER'
__label__ = "Povray"
DELAY = 0.02
def _export(self, scene):
import tempfile
@ -761,11 +839,8 @@ class PovrayRender(bpy.types.RenderEngine):
self._cleanup()
bpy.types.register(PovrayRender)
# Use some of the existing buttons.
import buttons_scene
buttons_scene.SCENE_PT_render.COMPAT_ENGINES.add('POVRAY_RENDER')
@ -800,89 +875,10 @@ class RenderButtonsPanel(bpy.types.Panel):
rd = context.scene.render_data
return (rd.use_game_engine==False) and (rd.engine in self.COMPAT_ENGINES)
# Radiosity panel, use in the scene for now.
FloatProperty= bpy.types.Scene.FloatProperty
IntProperty= bpy.types.Scene.IntProperty
BoolProperty= bpy.types.Scene.BoolProperty
class SCENE_PT_povray_radiosity(RenderButtonsPanel):
__label__ = "Radiosity"
COMPAT_ENGINES = set(['POVRAY_RENDER'])
__props__ = [ \
# Not a real pov option, just to know if we should write
BoolProperty( attr="pov_radio_enable",
name="Enable Radiosity",
description="Enable povrays radiosity calculation.",
default= False),
BoolProperty( attr="pov_radio_display_advanced",
name="Advanced Options",
description="Show advanced options.",
default= False),
# Real pov options
FloatProperty( attr="pov_radio_adc_bailout",
name="ADC Bailout",
description="The adc_bailout for radiosity rays. Use adc_bailout = 0.01 / brightest_ambient_object for good results.",
min=0.0, max=1000.0, soft_min=0.0, soft_max=1.0, default= 0.01),
BoolProperty( attr="pov_radio_always_sample",
name="Always Sample",
description="Only use the data from the pretrace step and not gather any new samples during the final radiosity pass..",
default= True),
FloatProperty( attr="pov_radio_brightness",
name="Brightness",
description="Ammount objects are brightened before being returned upwards to the rest of the system.",
min=0.0, max=1000.0, soft_min=0.0, soft_max=10.0, default= 1.0),
IntProperty( attr="pov_radio_count",
name="Ray Count",
description="number of rays that are sent out whenever a new radiosity value has to be calculated.",
min=1, max=1600, default= 35),
FloatProperty( attr="pov_radio_error_bound",
name="Error Bound",
description="one of the two main speed/quality tuning values, lower values are more accurate.",
min=0.0, max=1000.0, soft_min=0.1, soft_max=10.0, default= 1.8),
FloatProperty( attr="pov_radio_gray_threshold",
name="Gray Threshold",
description="one of the two main speed/quality tuning values, lower values are more accurate.",
min=0.0, max=1.0, soft_min=0, soft_max=1, default= 0.0),
FloatProperty( attr="pov_radio_low_error_factor",
name="Low Error Factor",
description="If you calculate just enough samples, but no more, you will get an image which has slightly blotchy lighting.",
min=0.0, max=1.0, soft_min=0.0, soft_max=1.0, default= 0.5),
# max_sample - not available yet
BoolProperty( attr="pov_radio_media",
name="Media",
description="Radiosity estimation can be affected by media.",
default= False),
FloatProperty( attr="pov_radio_minimum_reuse",
name="Minimum Reuse",
description="Fraction of the screen width which sets the minimum radius of reuse for each sample point (At values higher than 2% expect errors).",
min=0.0, max=1.0, soft_min=0.1, soft_max=0.1, default= 0.015),
IntProperty( attr="pov_radio_nearest_count",
name="Nearest Count",
description="Number of old ambient values blended together to create a new interpolated value.",
min=1, max=20, default= 5),
BoolProperty( attr="pov_radio_normal",
name="Normals",
description="Radiosity estimation can be affected by normals.",
default= False),
IntProperty( attr="pov_radio_recursion_limit",
name="Recursion Limit",
description="how many recursion levels are used to calculate the diffuse inter-reflection.",
min=1, max=20, default= 3),
]
def draw_header(self, context):
layout = self.layout
scene = context.scene

@ -74,10 +74,13 @@ class BONE_PT_bone(BoneButtonsPanel):
def draw(self, context):
layout = self.layout
ob = context.object
bone = context.bone
arm = context.armature
if not bone:
bone = context.edit_bone
else:
pchan = ob.pose.pose_channels[context.bone.name]
split = layout.split()
@ -103,6 +106,17 @@ class BONE_PT_bone(BoneButtonsPanel):
col.itemR(bone, "draw_wire", text="Wireframe")
col.itemR(bone, "hidden", text="Hide")
if ob and pchan:
split = layout.split()
col = split.column()
col.itemL(text="Bone Group:")
col.item_pointerR(pchan, "bone_group", ob.pose, "bone_groups", text="")
col = split.column()
col.itemL(text="Custom Shape:")
col.itemR(pchan, "custom_shape", text="")
class BONE_PT_inverse_kinematics(BoneButtonsPanel):
__label__ = "Inverse Kinematics"
__default_closed__ = True

@ -397,19 +397,29 @@ class DATA_PT_modifiers(DataButtonsPanel):
col = split.column()
col.itemR(md, "normals")
sub = col.row(align=True)
sub = col.column()
sub.active = md.normals
sub.itemR(md, "x_normal", text="X", toggle=True)
sub.itemR(md, "y_normal", text="Y", toggle=True)
sub.itemR(md, "z_normal", text="Z", toggle=True)
sub.itemR(md, "x_normal", text="X")
sub.itemR(md, "y_normal", text="Y")
sub.itemR(md, "z_normal", text="Z")
flow = layout.column_flow()
flow.itemR(md, "time_offset")
flow.itemR(md, "lifetime")
flow.itemR(md, "damping_time")
flow.itemR(md, "falloff_radius")
flow.itemR(md, "start_position_x")
flow.itemR(md, "start_position_y")
split = layout.split()
col = split.column()
col.itemL(text="Time:")
sub = col.column(align=True)
sub.itemR(md, "time_offset", text="Offset")
sub.itemR(md, "lifetime", text="Life")
col.itemR(md, "damping_time", text="Damping")
col = split.column()
col.itemL(text="Position:")
sub = col.column(align=True)
sub.itemR(md, "start_position_x", text="X")
sub.itemR(md, "start_position_y", text="Y")
col.itemR(md, "falloff_radius", text="Falloff")
layout.itemS()
layout.itemR(md, "start_position_object")
layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
@ -420,6 +430,8 @@ class DATA_PT_modifiers(DataButtonsPanel):
elif md.texture_coordinates == 'OBJECT':
layout.itemR(md, "texture_coordinates_object")
layout.itemS()
flow = layout.column_flow()
flow.itemR(md, "speed", slider=True)
flow.itemR(md, "height", slider=True)

@ -317,7 +317,7 @@ class IMAGE_PT_game_properties(bpy.types.Panel):
class IMAGE_PT_view_properties(bpy.types.Panel):
__space_type__ = 'IMAGE_EDITOR'
__region_type__ = 'UI'
__label__ = "View Properties"
__label__ = "Display"
def poll(self, context):
sima = context.space_data
@ -335,26 +335,33 @@ class IMAGE_PT_view_properties(bpy.types.Panel):
col = split.column()
if ima:
col.itemR(ima, "display_aspect")
col.itemR(ima, "display_aspect", text="Aspect Ratio")
col = split.column()
col.itemL(text="Coordinates:")
col.itemR(sima, "draw_repeated", text="Repeat")
if show_uvedit:
col.itemR(uvedit, "normalized_coordinates", text="Normalized")
elif show_uvedit:
col.itemL(text="Coordinates:")
col.itemR(uvedit, "normalized_coordinates", text="Normalized")
if show_uvedit:
col = layout.column()
row = col.row()
row.itemR(uvedit, "edge_draw_type", expand=True)
row = col.row()
row.itemR(uvedit, "draw_smooth_edges", text="Smooth")
row.itemR(uvedit, "draw_modified_edges", text="Modified")
row = col.row()
row.itemR(uvedit, "draw_stretch", text="Stretch")
row.itemR(uvedit, "draw_stretch_type", text="")
split = layout.split()
col = split.column()
col.itemR(uvedit, "draw_stretch", text="Stretch")
sub = col.column()
sub.active = uvedit.draw_stretch
sub.row().itemR(uvedit, "draw_stretch_type", expand=True)
col = split.column()
col.itemR(uvedit, "draw_smooth_edges", text="Smooth")
col.itemR(uvedit, "draw_modified_edges", text="Modified")
#col.itemR(uvedit, "draw_edges")
#col.itemR(uvedit, "draw_faces")

@ -22,7 +22,7 @@ class TIME_HT_header(bpy.types.Header):
sub.itemM("TIME_MT_frame")
sub.itemM("TIME_MT_playback")
layout.itemR(scene, "use_preview_range", text="PR", toggle=True)
layout.itemR(scene, "use_preview_range", text="PR")
row = layout.row(align=True)
if not scene.use_preview_range:

@ -24,8 +24,7 @@ class VIEW3D_HT_header(bpy.types.Header):
sub.itemM("VIEW3D_MT_view")
# Select Menu
if mode_string not in ('EDIT_TEXT', 'SCULPT', 'PAINT_WEIGHT', 'PAINT_VERTEX', 'PAINT_TEXTURE', 'PARTICLE'):
# XXX: Particle Mode has Select Menu.
if mode_string not in ('EDIT_TEXT', 'SCULPT', 'PAINT_WEIGHT', 'PAINT_VERTEX', 'PAINT_TEXTURE'):
sub.itemM("VIEW3D_MT_select_%s" % mode_string)
if edit_object:
@ -33,17 +32,44 @@ class VIEW3D_HT_header(bpy.types.Header):
elif object:
ob_mode_string = object.mode
if ob_mode_string == 'OBJECT':
sub.itemM("VIEW3D_MT_object")
elif ob_mode_string == 'SCULPT':
sub.itemM("VIEW3D_MT_sculpt")
elif ob_mode_string == 'VERTEX_PAINT':
sub.itemM("VIEW3D_MT_vertex_paint")
if mode_string not in ['PAINT_WEIGHT', 'PAINT_TEXTURE']:
sub.itemM("VIEW3D_MT_%s" % mode_string)
layout.template_header_3D()
# ********** Menu **********
# ********** Utilities **********
class VIEW3D_MT_showhide(bpy.types.Menu):
__space_type__ = "VIEW_3D"
__label__ = "Show/Hide"
_operator_name = ""
def draw(self, context):
layout = self.layout
layout.itemO("%s.reveal" % self._operator_name, text="Show Hidden")
layout.itemO("%s.hide" % self._operator_name, text="Hide Selected")
layout.item_booleanO("%s.hide" % self._operator_name, "unselected", True, text="Hide Unselected")
class VIEW3D_MT_snap(bpy.types.Menu):
__space_type__ = "VIEW_3D"
__label__ = "Snap"
def draw(self, context):
layout = self.layout
layout.itemO("view3d.snap_selected_to_grid", text="Selection to Grid")
layout.itemO("view3d.snap_selected_to_cursor", text="Selection to Cursor")
layout.itemO("view3d.snap_selected_to_center", text="Selection to Center")
layout.itemS()
layout.itemO("view3d.snap_cursor_to_selected", text="Cursor to Selected")
layout.itemO("view3d.snap_cursor_to_grid", text="Cursor to Grid")
layout.itemO("view3d.snap_cursor_to_active", text="Cursor to Active")
# ********** View menus **********
class VIEW3D_MT_view(bpy.types.Menu):
@ -63,7 +89,7 @@ class VIEW3D_MT_view(bpy.types.Menu):
layout.item_enumO("view3d.viewnumpad", "type", 'FRONT')
layout.item_enumO("view3d.viewnumpad", "type", 'RIGHT')
# layout.itemM("VIEW3D_MT_view_cameras", text="Cameras")
layout.itemM("VIEW3D_MT_view_cameras", text="Cameras")
layout.itemS()
@ -71,24 +97,15 @@ class VIEW3D_MT_view(bpy.types.Menu):
layout.itemS()
# layout.itemO("view3d.view_show_all_layers")
# layout.itemS()
# layout.itemO("view3d.view_local_view")
# layout.itemO("view3d.view_global_view")
# layout.itemS()
layout.itemM("VIEW3D_MT_view_navigation")
# layout.itemM("VIEW3D_MT_view_align", text="Align View")
layout.itemM("VIEW3D_MT_view_align")
layout.itemS()
layout.operator_context = "INVOKE_REGION_WIN"
layout.itemO("view3d.clip_border")
layout.itemO("view3d.zoom_border")
layout.itemO("view3d.clip_border", text="Clipping Border...")
layout.itemO("view3d.zoom_border", text="Zoom Border...")
layout.itemS()
@ -107,9 +124,6 @@ class VIEW3D_MT_view_navigation(bpy.types.Menu):
def draw(self, context):
layout = self.layout
# layout.itemO("view3d.view_fly_mode")
# layout.itemS()
layout.items_enumO("view3d.view_orbit", "type")
layout.itemS()
@ -121,6 +135,22 @@ class VIEW3D_MT_view_navigation(bpy.types.Menu):
layout.item_floatO("view3d.zoom", "delta", 1.0, text="Zoom In")
layout.item_floatO("view3d.zoom", "delta", -1.0, text="Zoom Out")
class VIEW3D_MT_view_align(bpy.types.Menu):
__space_type__ = "VIEW_3D"
__label__ = "Align View"
def draw(self, context):
layout = self.layout
layout.itemO("view3d.view_center")
class VIEW3D_MT_view_cameras(bpy.types.Menu):
__space_type__ = "VIEW_3D"
__label__ = "Cameras"
def draw(self, context):
layout = self.layout
# ********** Select menus, suffix from context.mode **********
class VIEW3D_MT_select_OBJECT(bpy.types.Menu):
@ -138,8 +168,8 @@ class VIEW3D_MT_select_OBJECT(bpy.types.Menu):
layout.itemO("object.select_inverse", text="Inverse")
layout.itemO("object.select_random", text="Random")
layout.itemO("object.select_by_layer", text="Select All by Layer")
layout.item_enumO("object.select_by_type", "type", "", text="Select All by Type")
layout.itemO("object.select_grouped", text="Select Grouped")
layout.item_enumO("object.select_by_type", "type", "", text="Select All by Type...")
layout.itemO("object.select_grouped", text="Select Grouped...")
class VIEW3D_MT_select_POSE(bpy.types.Menu):
__space_type__ = 'VIEW_3D'
@ -148,7 +178,7 @@ class VIEW3D_MT_select_POSE(bpy.types.Menu):
def draw(self, context):
layout = self.layout
layout.itemO("view3d.select_border")
layout.itemO("view3d.select_border", text="Border Select...")
layout.itemS()
@ -187,9 +217,6 @@ class VIEW3D_MT_select_PARTICLE(bpy.types.Menu):
layout.itemS()
#layout.itemO("particle.select_last")
#layout.itemO("particle.select_first")
layout.itemO("particle.select_more")
layout.itemO("particle.select_less")
@ -200,7 +227,7 @@ class VIEW3D_MT_select_EDIT_MESH(bpy.types.Menu):
def draw(self, context):
layout = self.layout
layout.itemO("view3d.select_border")
layout.itemO("view3d.select_border", text="Border Select...")
layout.itemS()
@ -244,8 +271,8 @@ class VIEW3D_MT_select_EDIT_CURVE(bpy.types.Menu):
def draw(self, context):
layout = self.layout
layout.itemO("view3d.select_border")
layout.itemO("view3d.select_circle")
layout.itemO("view3d.select_border", text="Border Select...")
layout.itemO("view3d.select_circle", text="Circle Select...")
layout.itemS()
@ -273,8 +300,8 @@ class VIEW3D_MT_select_EDIT_SURFACE(bpy.types.Menu):
def draw(self, context):
layout = self.layout
layout.itemO("view3d.select_border")
layout.itemO("view3d.select_circle")
layout.itemO("view3d.select_border", text="Border Select...")
layout.itemO("view3d.select_circle", text="Circle Select...")
layout.itemS()
@ -303,12 +330,12 @@ class VIEW3D_MT_select_EDIT_METABALL(bpy.types.Menu):
layout.itemS()
layout.itemL(text="Select/Deselect All")
layout.itemL(text="Inverse")
layout.itemO("mball.select_deselect_all_metaelems")
layout.itemO("mball.select_inverse_metaelems")
layout.itemS()
layout.itemL(text="Random")
layout.itemO("mball.select_random_metaelems")
class VIEW3D_MT_select_EDIT_LATTICE(bpy.types.Menu):
__space_type__ = 'VIEW_3D'
@ -330,7 +357,7 @@ class VIEW3D_MT_select_EDIT_ARMATURE(bpy.types.Menu):
def draw(self, context):
layout = self.layout
layout.itemO("view3d.select_border")
layout.itemO("view3d.select_border", text="Border Select...")
layout.itemS()
@ -363,7 +390,7 @@ class VIEW3D_MT_select_FACE(bpy.types.Menu):# XXX no matching enum
# ********** Object menu **********
class VIEW3D_MT_object(bpy.types.Menu):
class VIEW3D_MT_OBJECT(bpy.types.Menu):
__space_type__ = 'VIEW_3D'
__context__ = "objectmode"
__label__ = "Object"
@ -371,27 +398,27 @@ class VIEW3D_MT_object(bpy.types.Menu):
def draw(self, context):
layout = self.layout
layout.itemM("VIEW3D_MT_object_clear")
layout.itemM("VIEW3D_MT_object_snap")
layout.itemM("VIEW3D_MT_OBJECT_clear")
layout.itemM("VIEW3D_MT_snap")
layout.itemS()
layout.itemO("anim.insert_keyframe_menu")
layout.itemO("anim.delete_keyframe_v3d")
layout.itemO("anim.insert_keyframe_menu", text="Insert Keyframe...")
layout.itemO("anim.delete_keyframe_v3d", text="Delete Keyframe...")
layout.itemS()
layout.itemO("object.duplicate")
layout.item_booleanO("object.duplicate", "linked", True, text="Duplicate Linked")
layout.itemO("object.delete")
layout.itemO("object.proxy_make")
layout.itemO("object.delete", text="Delete...")
layout.itemO("object.proxy_make", text="Make Proxy...")
layout.itemS()
layout.itemM("VIEW3D_MT_object_parent")
layout.itemM("VIEW3D_MT_object_track")
layout.itemM("VIEW3D_MT_object_group")
layout.itemM("VIEW3D_MT_object_constraints")
layout.itemM("VIEW3D_MT_OBJECT_parent")
layout.itemM("VIEW3D_MT_OBJECT_track")
layout.itemM("VIEW3D_MT_OBJECT_group")
layout.itemM("VIEW3D_MT_OBJECT_constraints")
layout.itemS()
@ -399,58 +426,41 @@ class VIEW3D_MT_object(bpy.types.Menu):
layout.itemS()
layout.itemM("VIEW3D_MT_object_show")
layout.itemM("VIEW3D_MT_OBJECT_showhide")
class VIEW3D_MT_object_clear(bpy.types.Menu):
class VIEW3D_MT_OBJECT_clear(bpy.types.Menu):
__space_type__ = 'VIEW_3D'
__label__ = "Clear"
def draw(self, context):
layout = self.layout
layout.itemO("object.location_clear")
layout.itemO("object.rotation_clear")
layout.itemO("object.scale_clear")
layout.itemO("object.origin_clear")
layout.itemO("object.location_clear", text="Location")
layout.itemO("object.rotation_clear", text="Rotation")
layout.itemO("object.scale_clear", text="Scale")
layout.itemO("object.origin_clear", text="Origin")
class VIEW3D_MT_object_snap(bpy.types.Menu):
__space_type__ = 'VIEW_3D'
__label__ = "Snap"
def draw(self, context):
layout = self.layout
layout.itemO("view3d.snap_selected_to_grid")
layout.itemO("view3d.snap_selected_to_cursor")
layout.itemO("view3d.snap_selected_to_center")
layout.itemS()
layout.itemO("view3d.snap_cursor_to_selected")
layout.itemO("view3d.snap_cursor_to_grid")
layout.itemO("view3d.snap_cursor_to_active")
class VIEW3D_MT_object_parent(bpy.types.Menu):
class VIEW3D_MT_OBJECT_parent(bpy.types.Menu):
__space_type__ = 'VIEW_3D'
__label__ = "Parent"
def draw(self, context):
layout = self.layout
layout.itemO("object.parent_set")
layout.itemO("object.parent_clear")
layout.itemO("object.parent_set", text="Set")
layout.itemO("object.parent_clear", text="Clear")
class VIEW3D_MT_object_track(bpy.types.Menu):
class VIEW3D_MT_OBJECT_track(bpy.types.Menu):
__space_type__ = 'VIEW_3D'
__label__ = "Track"
def draw(self, context):
layout = self.layout
layout.itemO("object.track_set")
layout.itemO("object.track_clear")
layout.itemO("object.track_set", text="Set")
layout.itemO("object.track_clear", text="Clear")
class VIEW3D_MT_object_group(bpy.types.Menu):
class VIEW3D_MT_OBJECT_group(bpy.types.Menu):
__space_type__ = 'VIEW_3D'
__label__ = "Group"
@ -465,7 +475,7 @@ class VIEW3D_MT_object_group(bpy.types.Menu):
layout.itemO("group.objects_add_active")
layout.itemO("group.objects_remove_active")
class VIEW3D_MT_object_constraints(bpy.types.Menu):
class VIEW3D_MT_OBJECT_constraints(bpy.types.Menu):
__space_type__ = 'VIEW_3D'
__label__ = "Constraints"
@ -475,20 +485,20 @@ class VIEW3D_MT_object_constraints(bpy.types.Menu):
layout.itemO("object.constraint_add_with_targets")
layout.itemO("object.constraints_clear")
class VIEW3D_MT_object_show(bpy.types.Menu):
class VIEW3D_MT_OBJECT_showhide(bpy.types.Menu):
__space_type__ = 'VIEW_3D'
__label__ = "Show/Hide"
def draw(self, context):
layout = self.layout
layout.itemO("object.restrictview_clear")
layout.itemO("object.restrictview_set")
layout.itemO("object.restrictview_clear", text="Show Hidden")
layout.itemO("object.restrictview_set", text="Hide Selected")
layout.item_booleanO("object.restrictview_set", "unselected", True, text="Hide Unselected")
# ********** Vertex paint menu **********
class VIEW3D_MT_vertex_paint(bpy.types.Menu):
class VIEW3D_MT_PAINT_VERTEX(bpy.types.Menu):
__space_type__ = 'VIEW_3D'
__label__ = "Paint"
@ -503,7 +513,7 @@ class VIEW3D_MT_vertex_paint(bpy.types.Menu):
# ********** Sculpt menu **********
class VIEW3D_MT_sculpt(bpy.types.Menu):
class VIEW3D_MT_SCULPT(bpy.types.Menu):
__space_type__ = 'VIEW_3D'
__label__ = "Sculpt"
@ -537,24 +547,175 @@ class VIEW3D_MT_sculpt(bpy.types.Menu):
layout.itemR(brush, "persistent")
layout.itemO("sculpt.set_persistent_base")
# ********** Edit Menus, suffix from ob.type **********
# ********** Particle menu **********
class VIEW3D_MT_edit_snap(bpy.types.Menu):
class VIEW3D_MT_PARTICLE(bpy.types.Menu):
__space_type__ = 'VIEW_3D'
__label__ = "Snap"
__label__ = "Particle"
def draw(self, context):
layout = self.layout
layout.itemO("view3d.snap_selected_to_grid")
layout.itemO("view3d.snap_selected_to_cursor")
layout.itemO("view3d.snap_selected_to_center")
particle_edit = context.tool_settings.particle_edit
layout.itemO("particle.mirror")
layout.itemS()
layout.itemO("view3d.snap_cursor_to_selected")
layout.itemO("view3d.snap_cursor_to_grid")
layout.itemO("view3d.snap_cursor_to_active")
layout.itemO("particle.remove_doubles")
layout.itemO("particle.delete")
if particle_edit.selection_mode == 'POINT':
layout.itemO("particle.subdivide")
layout.itemO("particle.rekey")
layout.itemS()
layout.itemM("VIEW3D_MT_PARTICLE_showhide")
class VIEW3D_MT_PARTICLE_showhide(VIEW3D_MT_showhide):
_operator_name = "particle"
# ********** Pose Menu **********
class VIEW3D_MT_POSE(bpy.types.Menu):
__space_type__ = "VIEW_3D"
__label__ = "Pose"
def draw(self, context):
layout = self.layout
arm = context.active_object.data
if arm.drawtype in ('BBONE', 'ENVELOPE'):
layout.item_enumO("tfm.transform", "mode", 'BONESIZE', text="Scale Envelope Distance")
layout.itemM("VIEW3D_MT_POSE_transform")
layout.itemS()
layout.itemO("anim.insert_keyframe_menu", text="Insert Keyframe...")
layout.itemO("anim.delete_keyframe_v3d", text="Delete Keyframe...")
layout.itemS()
layout.itemO("pose.apply")
layout.itemS()
layout.itemO("pose.copy")
layout.itemO("pose.paste")
layout.item_booleanO("pose.paste", "flipped", True, text="Paste X-Flipped Pose")
layout.itemS()
layout.itemM("VIEW3D_MT_POSE_pose")
layout.itemM("VIEW3D_MT_POSE_motion")
layout.itemM("VIEW3D_MT_POSE_group")
layout.itemS()
layout.itemM("VIEW3D_MT_POSE_ik")
layout.itemM("VIEW3D_MT_POSE_constraints")
layout.itemS()
layout.item_enumO("pose.autoside_names", "axis", 'XAXIS', text="AutoName Left/Right")
layout.item_enumO("pose.autoside_names", "axis", 'YAXIS', text="AutoName Front/Back")
layout.item_enumO("pose.autoside_names", "axis", 'ZAXIS', text="AutoName Top/Bottom")
layout.itemO("pose.flip_names")
layout.itemS()
layout.itemO("pose.armature_layers", text="Change Armature Layers...")
layout.itemO("pose.bone_layers", text="Change Bone Layers...")
layout.itemS()
layout.itemM("VIEW3D_MT_POSE_showhide")
layout.item_menu_enumO("pose.flags_set", 'mode', text="Bone Settings")
class VIEW3D_MT_POSE_transform(bpy.types.Menu):
__space_type__ = "VIEW_3D"
__label__ = "Clear Transform"
def draw(self, context):
layout = self.layout
layout.itemL(text="User Transform")
layout.itemO("pose.loc_clear", text="Location")
layout.itemO("pose.rot_clear", text="Rotation")
layout.itemO("pose.scale_clear", text="Scale")
layout.itemL(text="Origin")
class VIEW3D_MT_POSE_pose(bpy.types.Menu):
__space_type__ = "VIEW_3D"
__label__ = "Pose Library"
def draw(self, context):
layout = self.layout
layout.itemO("poselib.browse_interactive", text="Browse Poses...")
layout.itemS()
layout.itemO("poselib.pose_add", text="Add Pose...")
layout.itemO("poselib.pose_rename", text="Rename Pose...")
layout.itemO("poselib.pose_remove", text="Remove Pose...")
class VIEW3D_MT_POSE_motion(bpy.types.Menu):
__space_type__ = "VIEW_3D"
__label__ = "Motion Paths"
def draw(self, context):
layout = self.layout
layout.itemO("pose.paths_calculate", text="Calculate")
layout.itemO("pose.paths_clear", text="Clear")
class VIEW3D_MT_POSE_group(bpy.types.Menu):
__space_type__ = "VIEW_3D"
__label__ = "Bone Groups"
def draw(self, context):
layout = self.layout
layout.itemO("pose.group_add")
layout.itemO("pose.group_remove")
layout.itemS()
layout.itemO("pose.group_assign")
layout.itemO("pose.group_unassign")
class VIEW3D_MT_POSE_ik(bpy.types.Menu):
__space_type__ = "VIEW_3D"
__label__ = "Inverse Kinematics"
def draw(self, context):
layout = self.layout
layout.itemO("pose.ik_add")
layout.itemO("pose.ik_clear")
class VIEW3D_MT_POSE_constraints(bpy.types.Menu):
__space_type__ = "VIEW_3D"
__label__ = "Constraints"
def draw(self, context):
layout = self.layout
layout.itemO("pose.constraint_add_with_targets", text="Add (With Targets)...")
layout.itemO("pose.constraints_clear")
class VIEW3D_MT_POSE_showhide(VIEW3D_MT_showhide):
_operator_name = "pose"
# ********** Edit Menus, suffix from ob.type **********
# Edit MESH
class VIEW3D_MT_edit_MESH(bpy.types.Menu):
@ -571,17 +732,17 @@ class VIEW3D_MT_edit_MESH(bpy.types.Menu):
layout.itemS()
layout.itemM("VIEW3D_MT_edit_snap")
layout.itemM("VIEW3D_MT_snap")
layout.itemS()
layout.itemO("uv.mapping_menu")
layout.itemO("uv.mapping_menu", text="UV Unwrap...")
layout.itemS()
layout.itemO("mesh.extrude")
layout.itemO("mesh.duplicate")
layout.itemO("mesh.delete")
layout.itemO("mesh.delete", text="Delete...")
layout.itemS()
@ -626,7 +787,6 @@ class VIEW3D_MT_edit_MESH_edges(bpy.types.Menu):
layout.itemO("mesh.edge_face_add")
layout.itemO("mesh.subdivide")
layout.item_floatO("mesh.subdivide", "smoothness", 1.0, text="Subdivide Smooth")
layout.itemS()
@ -679,16 +839,8 @@ class VIEW3D_MT_edit_MESH_normals(bpy.types.Menu):
layout.itemO("mesh.flip_normals")
class VIEW3D_MT_edit_MESH_showhide(bpy.types.Menu):
__space_type__ = 'VIEW_3D'
__label__ = "Show/Hide"
def draw(self, context):
layout = self.layout
layout.itemO("mesh.reveal")
layout.itemO("mesh.hide")
layout.item_booleanO("mesh.hide", "unselected", True, text="Hide Unselected")
class VIEW3D_MT_edit_MESH_showhide(VIEW3D_MT_showhide):
_operator_name = "mesh"
# Edit CURVE
@ -698,7 +850,7 @@ def draw_CURVE(self, context):
settings = context.tool_settings
layout.itemM("VIEW3D_MT_edit_snap")
layout.itemM("VIEW3D_MT_snap")
layout.itemS()
@ -707,7 +859,7 @@ def draw_CURVE(self, context):
layout.itemO("curve.separate")
layout.itemO("curve.make_segment")
layout.itemO("curve.cyclic_toggle")
layout.itemO("curve.delete")
layout.itemO("curve.delete", text="Delete...")
layout.itemS()
@ -757,16 +909,8 @@ class VIEW3D_MT_edit_CURVE_segments(bpy.types.Menu):
layout.itemO("curve.subdivide")
layout.itemO("curve.switch_direction")
class VIEW3D_MT_edit_CURVE_showhide(bpy.types.Menu):
__space_type__ = 'VIEW_3D'
__label__ = "Show/Hide"
def draw(self, context):
layout = self.layout
layout.itemO("curve.reveal")
layout.itemO("curve.hide")
layout.item_booleanO("curve.hide", "unselected", True, text="Hide Unselected")
class VIEW3D_MT_edit_CURVE_showhide(VIEW3D_MT_showhide):
_operator_name = "curve"
# Edit SURFACE
class VIEW3D_MT_edit_SURFACE(bpy.types.Menu):
@ -838,11 +982,11 @@ class VIEW3D_MT_edit_META(bpy.types.Menu):
layout.itemS()
layout.itemM("VIEW3D_MT_edit_snap")
layout.itemM("VIEW3D_MT_snap")
layout.itemS()
layout.itemO("mball.delete_metaelems")
layout.itemO("mball.delete_metaelems", text="Delete...")
layout.itemO("mball.duplicate_metaelems")
layout.itemS()
@ -861,8 +1005,8 @@ class VIEW3D_MT_edit_META_showhide(bpy.types.Menu):
def draw(self, context):
layout = self.layout
layout.itemO("mball.reveal_metaelems")
layout.itemO("mball.hide_metaelems")
layout.itemO("mball.reveal_metaelems", text="Show Hidden")
layout.itemO("mball.hide_metaelems", text="Hide Selected")
layout.item_booleanO("mball.hide_metaelems", "unselected", True, text="Hide Unselected")
# Edit LATTICE
@ -875,7 +1019,7 @@ class VIEW3D_MT_edit_LATTICE(bpy.types.Menu):
settings = context.tool_settings
layout.itemM("VIEW3D_MT_edit_snap")
layout.itemM("VIEW3D_MT_snap")
layout.itemS()
@ -897,7 +1041,7 @@ class VIEW3D_MT_edit_ARMATURE(bpy.types.Menu):
edit_object = context.edit_object
arm = edit_object.data
layout.itemM("VIEW3D_MT_edit_snap")
layout.itemM("VIEW3D_MT_snap")
layout.itemM("VIEW3D_MT_edit_ARMATURE_roll")
if arm.drawtype == 'ENVELOPE':
@ -920,8 +1064,7 @@ class VIEW3D_MT_edit_ARMATURE(bpy.types.Menu):
layout.itemS()
layout.itemO("armature.subdivide_simple")
layout.itemO("armature.subdivide_multi")
layout.itemO("armature.subdivide_multi", text="Subdivide")
layout.itemS()
@ -950,8 +1093,8 @@ class VIEW3D_MT_edit_ARMATURE_parent(bpy.types.Menu):
def draw(self, context):
layout = self.layout
layout.itemO("armature.parent_set")
layout.itemO("armature.parent_clear")
layout.itemO("armature.parent_set", text="Make")
layout.itemO("armature.parent_clear", text="Clear")
class VIEW3D_MT_edit_ARMATURE_roll(bpy.types.Menu):
__space_type__ = 'VIEW_3D'
@ -1108,6 +1251,8 @@ bpy.types.register(VIEW3D_HT_header) # Header
bpy.types.register(VIEW3D_MT_view) #View Menus
bpy.types.register(VIEW3D_MT_view_navigation)
bpy.types.register(VIEW3D_MT_view_align)
bpy.types.register(VIEW3D_MT_view_cameras)
bpy.types.register(VIEW3D_MT_select_OBJECT) # Select Menus
bpy.types.register(VIEW3D_MT_select_POSE)
@ -1120,20 +1265,31 @@ bpy.types.register(VIEW3D_MT_select_EDIT_LATTICE)
bpy.types.register(VIEW3D_MT_select_EDIT_ARMATURE)
bpy.types.register(VIEW3D_MT_select_FACE) # XXX todo
bpy.types.register(VIEW3D_MT_object) # Object Menu
bpy.types.register(VIEW3D_MT_object_clear)
bpy.types.register(VIEW3D_MT_object_snap)
bpy.types.register(VIEW3D_MT_object_parent)
bpy.types.register(VIEW3D_MT_object_track)
bpy.types.register(VIEW3D_MT_object_group)
bpy.types.register(VIEW3D_MT_object_constraints)
bpy.types.register(VIEW3D_MT_object_show)
bpy.types.register(VIEW3D_MT_OBJECT) # Object Menu
bpy.types.register(VIEW3D_MT_OBJECT_clear)
bpy.types.register(VIEW3D_MT_OBJECT_parent)
bpy.types.register(VIEW3D_MT_OBJECT_track)
bpy.types.register(VIEW3D_MT_OBJECT_group)
bpy.types.register(VIEW3D_MT_OBJECT_constraints)
bpy.types.register(VIEW3D_MT_OBJECT_showhide)
bpy.types.register(VIEW3D_MT_sculpt) # Sculpt Menu
bpy.types.register(VIEW3D_MT_SCULPT) # Sculpt Menu
bpy.types.register(VIEW3D_MT_vertex_paint)
bpy.types.register(VIEW3D_MT_PAINT_VERTEX)
bpy.types.register(VIEW3D_MT_edit_snap) # Edit Menus
bpy.types.register(VIEW3D_MT_PARTICLE) # Particle Menu
bpy.types.register(VIEW3D_MT_PARTICLE_showhide)
bpy.types.register(VIEW3D_MT_POSE) # POSE Menu
bpy.types.register(VIEW3D_MT_POSE_transform)
bpy.types.register(VIEW3D_MT_POSE_pose)
bpy.types.register(VIEW3D_MT_POSE_motion)
bpy.types.register(VIEW3D_MT_POSE_group)
bpy.types.register(VIEW3D_MT_POSE_ik)
bpy.types.register(VIEW3D_MT_POSE_constraints)
bpy.types.register(VIEW3D_MT_POSE_showhide)
bpy.types.register(VIEW3D_MT_snap) # Edit Menus
bpy.types.register(VIEW3D_MT_edit_MESH)
bpy.types.register(VIEW3D_MT_edit_MESH_vertices)

@ -78,6 +78,7 @@
#include "BKE_main.h"
#include "BKE_anim.h"
#include "BKE_action.h"
#include "BKE_bmesh.h"
// XXX #include "BKE_booleanops.h"
#include "BKE_cloth.h"

@ -79,6 +79,7 @@
#include "UI_view2d.h"
#include "ED_anim_api.h"
#include "ED_keyframing.h"
#include "ED_keyframes_edit.h" // XXX move the select modes out of there!
#include "ED_screen.h"
#include "ED_space_api.h"
@ -1869,13 +1870,14 @@ void ANIM_channel_setting_set (bAnimContext *ac, bAnimListElem *ale, int setting
// XXX hardcoded size of icons
#define ICON_WIDTH 17
// XXX hardcoded width of sliders
#define SLIDER_WIDTH 70
/* Draw the given channel */
// TODO: make this use UI controls for the buttons
void ANIM_channel_draw (bAnimContext *ac, bAnimListElem *ale, float yminc, float ymaxc)
{
bAnimChannelType *acf= ANIM_channel_get_typeinfo(ale);
View2D *v2d= &ac->ar->v2d;
short selected, offset;
float y, ymid, ytext;
@ -1970,27 +1972,7 @@ void ANIM_channel_draw (bAnimContext *ac, bAnimListElem *ale, float yminc, float
offset += 3;
UI_DrawString(offset, ytext, name);
}
/* step 6) draw mute+protection toggles + (sliders) ....................... */
/* reset offset - now goes from RHS of panel */
offset = 0;
// TODO: we need a mechanism of drawing over (and hiding) stuff from here...
// TODO: when drawing sliders, make those draw instead of these toggles if not enough space
if (v2d) {
/* protect... */
if (acf->has_setting(ac, ale, ACHANNEL_SETTING_PROTECT)) {
/* just skip - drawn as widget now */
offset += ICON_WIDTH;
}
/* mute... */
if (acf->has_setting(ac, ale, ACHANNEL_SETTING_MUTE)) {
/* just skip - drawn as widget now */
offset += ICON_WIDTH;
}
}
}
/* ------------------ */
@ -2000,6 +1982,44 @@ static void achannel_setting_widget_cb(bContext *C, void *poin, void *poin2)
WM_event_add_notifier(C, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
}
/* callback for widget sliders - insert keyframes */
static void achannel_setting_slider_cb(bContext *C, void *id_poin, void *fcu_poin)
{
ID *id= (ID *)id_poin;
FCurve *fcu= (FCurve *)fcu_poin;
Scene *scene= CTX_data_scene(C);
PointerRNA id_ptr, ptr;
PropertyRNA *prop;
short flag=0, done=0;
float cfra;
/* get current frame */
// NOTE: this will do for now...
cfra= (float)CFRA;
/* get flags for keyframing */
if (IS_AUTOKEY_FLAG(INSERTNEEDED))
flag |= INSERTKEY_NEEDED;
if (IS_AUTOKEY_FLAG(AUTOMATKEY))
flag |= INSERTKEY_MATRIX;
/* get RNA pointer, and resolve the path */
RNA_id_pointer_create(id, &id_ptr);
/* try to resolve the path stored in the F-Curve */
if (RNA_path_resolve(&id_ptr, fcu->rna_path, &ptr, &prop)) {
/* insert a keyframe for this F-Curve */
done= insert_keyframe_direct(ptr, prop, fcu, cfra, flag);
if (done)
WM_event_add_notifier(C, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
}
}
/* Draw a widget for some setting */
static void draw_setting_widget (bAnimContext *ac, bAnimListElem *ale, bAnimChannelType *acf, uiBlock *block, int xpos, int ypos, int setting)
{
@ -2164,6 +2184,28 @@ void ANIM_channel_draw_widgets (bAnimContext *ac, bAnimListElem *ale, uiBlock *b
// TODO: when drawing sliders, make those draw instead of these toggles if not enough space
if (v2d) {
short draw_sliders = 0;
/* check if we need to show the sliders */
if ((ac->sa) && ELEM(ac->spacetype, SPACE_ACTION, SPACE_IPO)) {
switch (ac->spacetype) {
case SPACE_ACTION:
{
SpaceAction *saction= (SpaceAction *)ac->sa->spacedata.first;
draw_sliders= (saction->flag & SACTION_SLIDERS);
}
break;
case SPACE_IPO:
{
SpaceIpo *sipo= (SpaceIpo *)ac->sa->spacedata.first;
draw_sliders= (sipo->flag & SIPO_SLIDERS);
}
break;
}
}
/* check if there's enough space for the toggles if the sliders are drawn too */
if ( !(draw_sliders) || ((v2d->mask.xmax-v2d->mask.xmin) > ACHANNEL_BUTTON_WIDTH/2) ) {
/* protect... */
if (acf->has_setting(ac, ale, ACHANNEL_SETTING_PROTECT)) {
offset += ICON_WIDTH;
@ -2175,6 +2217,44 @@ void ANIM_channel_draw_widgets (bAnimContext *ac, bAnimListElem *ale, uiBlock *b
draw_setting_widget(ac, ale, acf, block, (int)v2d->cur.xmax-offset, ymid, ACHANNEL_SETTING_MUTE);
}
}
/* draw slider
* - even if we can draw sliders for this view, we must also check that the channel-type supports them
* (only only F-Curves really can support them for now)
* - to make things easier, we use RNA-autobuts for this so that changes are reflected immediately,
* whereever they occurred. BUT, we don't use the layout engine, otherwise we'd get wrong alignment,
* and wouldn't be able to auto-keyframe...
* - slider should start before the toggles (if they're visible) to keep a clean line down the side
*/
if ((draw_sliders) && (ale->type == ANIMTYPE_FCURVE)) {
/* adjust offset */
offset += SLIDER_WIDTH;
/* need backdrop behind sliders... */
uiBlockSetEmboss(block, UI_EMBOSS);
if (ale->id) { /* Slider using RNA Access -------------------- */
FCurve *fcu= (FCurve *)ale->data;
PointerRNA id_ptr, ptr;
PropertyRNA *prop;
/* get RNA pointer, and resolve the path */
RNA_id_pointer_create(ale->id, &id_ptr);
/* try to resolve the path */
if (RNA_path_resolve(&id_ptr, fcu->rna_path, &ptr, &prop)) {
uiBut *but;
/* create the slider button, and assign relevant callback to ensure keyframes are inserted... */
but= uiDefAutoButR(block, &ptr, prop, fcu->array_index, "", 0, (int)v2d->cur.xmax-offset, ymid, SLIDER_WIDTH, (int)ymaxc-yminc);
uiButSetFunc(but, achannel_setting_slider_cb, ale->id, fcu);
}
}
else { /* Special Slider for stuff without RNA Access ---------- */
// TODO: only implement this case when we really need it...
}
}
}
}
/* *********************************************** */

@ -93,9 +93,8 @@ int geticon_anim_blocktype(short blocktype)
}
/* Write into "name" buffer, the name of the property (retrieved using RNA from the curve's settings)
* WARNING: name buffer we're writing to cannot exceed 128 chars (check action_draw.c for details)
* WARNING: name buffer we're writing to cannot exceed 256 chars (check anim_channels_defines.c for details)
*/
// TODO: have an extra var to indicate if prop was valid?
void getname_anim_fcurve(char *name, ID *id, FCurve *fcu)
{
/* sanity checks */

@ -740,6 +740,12 @@ short insert_keyframe_direct (PointerRNA ptr, PropertyRNA *prop, FCurve *fcu, fl
printf("ERROR: no F-Curve to add keyframes to \n");
return 0;
}
/* F-Curve not editable? */
if ( (fcu->flag & FCURVE_PROTECTED) || ((fcu->grp) && (fcu->grp->flag & AGRP_PROTECTED)) ) {
if (G.f & G_DEBUG)
printf("WARNING: not inserting keyframe for locked F-Curve \n");
return 0;
}
/* if no property given yet, try to validate from F-Curve info */
if ((ptr.id.data == NULL) && (ptr.data==NULL)) {
@ -911,8 +917,19 @@ short delete_keyframe (ID *id, bAction *act, const char group[], const char rna_
/* we don't check the validity of the path here yet, but it should be ok... */
fcu= verify_fcurve(act, group, rna_path, array_index, 0);
/* only continue if we have an F-Curve to remove keyframes from */
if (act && fcu) {
/* check if F-Curve exists and/or whether it can be edited */
if ELEM(NULL, act, fcu) {
printf("ERROR: no F-Curve and/or Action to delete keyframe from \n");
return 0;
}
if ( (fcu->flag & FCURVE_PROTECTED) || ((fcu->grp) && (fcu->grp->flag & AGRP_PROTECTED)) ) {
if (G.f & G_DEBUG)
printf("WARNING: not inserting keyframe for locked F-Curve \n");
return 0;
}
/* it should be fine to continue now... */
{
short found = -1;
int i;

@ -645,7 +645,6 @@ void uiTemplateImageLayers(uiLayout *layout, struct bContext *C, struct Image *i
void uiTemplateRunningJobs(uiLayout *layout, struct bContext *C);
void uiTemplateOperatorSearch(uiLayout *layout);
void uiTemplateHeader3D(uiLayout *layout, struct bContext *C);
void uiTemplate_view3d_select_metaballmenu(uiLayout *layout, struct bContext *C);
void uiTemplate_view3d_select_faceselmenu(uiLayout *layout, struct bContext *C);
void uiTemplateTextureImage(uiLayout *layout, struct bContext *C, struct Tex *tex);

@ -793,11 +793,11 @@ static void ui_item_rna_size(uiLayout *layout, char *name, int icon, PropertyRNA
}
else if(ui_layout_vary_direction(layout) == UI_ITEM_VARY_X) {
if(type == PROP_BOOLEAN && strcmp(name, "") != 0)
w += UI_UNIT_X;
w += UI_UNIT_X/5;
else if(type == PROP_ENUM)
w += UI_UNIT_X/2;
else if(type == PROP_FLOAT || type == PROP_INT)
w += UI_UNIT_X*2;
w += UI_UNIT_X*3;
}
*r_w= w;

@ -1085,7 +1085,7 @@ static struct uiWidgetColors wcol_tool= {
{255, 255, 255, 255},
1,
25, -25
15, -15
};
static struct uiWidgetColors wcol_box= {
@ -1897,7 +1897,7 @@ static void widget_swatch(uiBut *but, uiWidgetColors *wcol, rcti *rect, int stat
widget_init(&wtb);
/* half rounded */
round_box_edges(&wtb, roundboxalign, rect, 4.0f);
round_box_edges(&wtb, roundboxalign, rect, 5.0f);
ui_get_but_vectorf(but, col);
wcol->inner[0]= FTOCHAR(col[0]);
@ -1916,7 +1916,7 @@ static void widget_textbut(uiWidgetColors *wcol, rcti *rect, int state, int roun
widget_init(&wtb);
/* half rounded */
round_box_edges(&wtb, roundboxalign, rect, 5.0f);
round_box_edges(&wtb, roundboxalign, rect, 4.0f);
widgetbase_draw(&wtb, wcol);
@ -1950,8 +1950,8 @@ static void widget_pulldownbut(uiWidgetColors *wcol, rcti *rect, int state, int
widget_init(&wtb);
/* fully rounded */
round_box_edges(&wtb, 15, rect, rad);
/* half rounded */
round_box_edges(&wtb, 15, rect, 4.0f);
widgetbase_draw(&wtb, wcol);
}
@ -2049,8 +2049,8 @@ static void widget_roundbut(uiWidgetColors *wcol, rcti *rect, int state, int rou
widget_init(&wtb);
/* fully rounded */
round_box_edges(&wtb, roundboxalign, rect, rad);
/* half rounded */
round_box_edges(&wtb, roundboxalign, rect, 5.0f);
widgetbase_draw(&wtb, wcol);
}

@ -445,6 +445,7 @@ void ui_theme_init_userdef(void)
SETCOL(btheme->tv3d.text_hi, 255, 255, 255, 255);
SETCOLF(btheme->tv3d.header, 0.45, 0.45, 0.45, 1.0);
SETCOLF(btheme->tv3d.button, 0.45, 0.45, 0.45, 1.0);
SETCOL(btheme->tv3d.panel, 165, 165, 165, 127);
SETCOL(btheme->tv3d.shade1, 160, 160, 160, 100);

@ -4349,7 +4349,7 @@ void MESH_OT_vertices_smooth(wmOperatorType *ot)
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
RNA_def_int(ot->srna, "repeat", 1, 1, 100, "Number of times to smooth the mesh", "", 1, INT_MAX);
RNA_def_int(ot->srna, "repeat", 1, 1, 100, "Smooth Iterations", "", 1, INT_MAX);
}
void vertexnoise(Object *obedit, EditMesh *em)
@ -4475,7 +4475,8 @@ void MESH_OT_vertices_transform_to_sphere(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Vertices to Sphere";
ot->description= "Move selected vertices outward in a spherical shape.";
//added "around cursor" to differentiate between "TFM_OT_tosphere()"
ot->description= "Move selected vertices outward in a spherical shape around cursor.";
ot->idname= "MESH_OT_vertices_transform_to_sphere";
/* api callbacks */

@ -3329,7 +3329,6 @@ void ED_keymap_screen(wmWindowManager *wm)
WM_keymap_verify_item(keymap, "SCREEN_OT_repeat_history", F3KEY, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "SCREEN_OT_repeat_last", RKEY, KM_PRESS, KM_CTRL, 0);
WM_keymap_add_item(keymap, "SCREEN_OT_repeat_last", RKEY, KM_PRESS, KM_OSKEY, 0);
WM_keymap_add_item(keymap, "SCREEN_OT_repeat_last", F4KEY, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "SCREEN_OT_region_flip", F5KEY, KM_PRESS, 0, 0);
WM_keymap_verify_item(keymap, "SCREEN_OT_redo_last", F6KEY, KM_PRESS, 0, 0);
@ -3348,18 +3347,17 @@ void ED_keymap_screen(wmWindowManager *wm)
/* render */
WM_keymap_add_item(keymap, "SCREEN_OT_render", F12KEY, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "SCREEN_OT_render", RETKEY, KM_PRESS, KM_CTRL, 0);
WM_keymap_add_item(keymap, "SCREEN_OT_render", RETKEY, KM_PRESS, KM_OSKEY, 0);
// WM_keymap_add_item(keymap, "SCREEN_OT_render", RETKEY, KM_PRESS, KM_CTRL, 0);
// WM_keymap_add_item(keymap, "SCREEN_OT_render", RETKEY, KM_PRESS, KM_OSKEY, 0);
RNA_boolean_set(WM_keymap_add_item(keymap, "SCREEN_OT_render", F12KEY, KM_PRESS, KM_CTRL, 0)->ptr, "animation", 1);
RNA_boolean_set(WM_keymap_add_item(keymap, "SCREEN_OT_render", RETKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0)->ptr, "animation", 1);
RNA_boolean_set(WM_keymap_add_item(keymap, "SCREEN_OT_render", RETKEY, KM_PRESS, KM_OSKEY|KM_SHIFT, 0)->ptr, "animation", 1);
// RNA_boolean_set(WM_keymap_add_item(keymap, "SCREEN_OT_render", RETKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0)->ptr, "animation", 1);
// RNA_boolean_set(WM_keymap_add_item(keymap, "SCREEN_OT_render", RETKEY, KM_PRESS, KM_OSKEY|KM_SHIFT, 0)->ptr, "animation", 1);
WM_keymap_add_item(keymap, "SCREEN_OT_render_view_cancel", ESCKEY, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "SCREEN_OT_render_view_show", F11KEY, KM_PRESS, 0, 0);
/* user prefs */
WM_keymap_add_item(keymap, "SCREEN_OT_userpref_show", COMMAKEY, KM_PRESS, KM_CTRL, 0);
WM_keymap_add_item(keymap, "SCREEN_OT_userpref_show", COMMAKEY, KM_PRESS, KM_OSKEY, 0);
WM_keymap_add_item(keymap, "SCREEN_OT_userpref_show", UKEY, KM_PRESS, KM_ALT, 0);
/* Anim Playback ------------------------------------------------ */
keymap= WM_keymap_listbase(wm, "Frames", 0, 0);

@ -1,274 +0,0 @@
/*
* $Id$
*
* ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2007 by Nicholas Bishop
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL LICENSE BLOCK *****
*
* Storage and manipulation of sculptmode brush strokes.
*
*/
#include "MEM_guardedalloc.h"
#include "DNA_listBase.h"
#include "DNA_scene_types.h"
#include "BKE_sculpt.h"
#include "BLI_blenlib.h"
#include "BIF_gl.h"
#include "sculpt_intern.h"
#include <math.h>
/* Temporary storage of input stroke control points */
typedef struct StrokePoint {
struct StrokePoint *next, *prev;
short x, y;
} StrokePoint;
typedef struct SculptStroke {
short (*loc)[2];
int max;
int index;
float length;
ListBase final;
StrokePoint *final_mem;
float offset;
} SculptStroke;
SculptStroke *sculpt_stroke_new(const int max)
{
SculptStroke *stroke = MEM_callocN(sizeof(SculptStroke), "SculptStroke");
stroke->loc = MEM_callocN(sizeof(short) * 4 * max, "SculptStroke.loc");
stroke->max = max;
stroke->index = -1;
return stroke;
}
void sculpt_stroke_free(SculptStroke *stroke)
{
if(stroke) {
if(stroke->loc) MEM_freeN(stroke->loc);
if(stroke->final_mem) MEM_freeN(stroke->final_mem);
MEM_freeN(stroke);
}
}
void sculpt_stroke_add_point(SculptStroke *stroke, const short x, const short y)
{
const int next = stroke->index + 1;
if(stroke->index == -1) {
stroke->loc[0][0] = x;
stroke->loc[0][1] = y;
stroke->index = 0;
}
else if(next < stroke->max) {
const int dx = x - stroke->loc[stroke->index][0];
const int dy = y - stroke->loc[stroke->index][1];
stroke->loc[next][0] = x;
stroke->loc[next][1] = y;
stroke->length += sqrt(dx*dx + dy*dy);
stroke->index = next;
}
}
static void sculpt_stroke_smooth(SculptStroke *stroke)
{
/* Apply smoothing (exclude the first and last points)*/
StrokePoint *p = stroke->final.first;
if(p && p->next && p->next->next) {
for(p = p->next->next; p && p->next && p->next->next; p = p->next) {
p->x = p->prev->prev->x*0.1 + p->prev->x*0.2 + p->x*0.4 + p->next->x*0.2 + p->next->next->x*0.1;
p->y = p->prev->prev->y*0.1 + p->prev->y*0.2 + p->y*0.4 + p->next->y*0.2 + p->next->next->y*0.1;
}
}
}
static void sculpt_stroke_create_final(SculptStroke *stroke)
{
if(stroke) {
StrokePoint *p, *pnext;
int i;
/* Copy loc into final */
if(stroke->final_mem)
MEM_freeN(stroke->final_mem);
stroke->final_mem = MEM_callocN(sizeof(StrokePoint) * (stroke->index + 1) * 2, "SculptStroke.final");
stroke->final.first = stroke->final.last = NULL;
for(i = 0; i <= stroke->index; ++i) {
p = &stroke->final_mem[i];
p->x = stroke->loc[i][0];
p->y = stroke->loc[i][1];
BLI_addtail(&stroke->final, p);
}
/* Remove shortest edges */
if(stroke->final.first) {
for(p = ((StrokePoint*)stroke->final.first)->next; p && p->next; p = pnext) {
const int dx = p->x - p->prev->x;
const int dy = p->y - p->prev->y;
const float len = sqrt(dx*dx + dy*dy);
pnext = p->next;
if(len < 10) {
BLI_remlink(&stroke->final, p);
}
}
}
sculpt_stroke_smooth(stroke);
/* Subdivide edges */
for(p = stroke->final.first; p && p->next; p = pnext) {
StrokePoint *np = &stroke->final_mem[i++];
pnext = p->next;
np->x = (p->x + p->next->x) / 2;
np->y = (p->y + p->next->y) / 2;
BLI_insertlink(&stroke->final, p, np);
}
sculpt_stroke_smooth(stroke);
}
}
static float sculpt_stroke_seglen(StrokePoint *p1, StrokePoint *p2)
{
int dx = p2->x - p1->x;
int dy = p2->y - p1->y;
return sqrt(dx*dx + dy*dy);
}
static float sculpt_stroke_final_length(SculptStroke *stroke)
{
StrokePoint *p;
float len = 0;
for(p = stroke->final.first; p && p->next; ++p)
len += sculpt_stroke_seglen(p, p->next);
return len;
}
/* If partial is nonzero, cuts off apply after that length has been processed */
static StrokePoint *sculpt_stroke_apply_generic(Sculpt *sd, SculptStroke *stroke, const int partial)
{
const int sdspace = 0; //XXX: sd->spacing;
const short spacing = sdspace > 0 ? sdspace : 2;
const int dots = sculpt_stroke_final_length(stroke) / spacing;
int i;
StrokePoint *p = stroke->final.first;
float startloc = stroke->offset;
for(i = 0; i < dots && p && p->next; ++i) {
const float dotloc = spacing * i;
short co[2];
float len = sculpt_stroke_seglen(p, p->next);
float u, v;
/* Find edge containing dot */
while(dotloc > startloc + len && p && p->next && p->next->next) {
p = p->next;
startloc += len;
len = sculpt_stroke_seglen(p, p->next);
}
if(!p || !p->next || dotloc > startloc + len)
break;
if(partial && startloc > partial) {
/* Calculate offset for next stroke segment */
stroke->offset = startloc + len - dotloc;
break;
}
u = (dotloc - startloc) / len;
v = 1 - u;
co[0] = p->x*v + p->next->x*u;
co[1] = p->y*v + p->next->y*u;
//do_symmetrical_brush_actions(sd, a, co, NULL);
}
return p ? p->next : NULL;
}
void sculpt_stroke_apply(Sculpt *sd, SculptStroke *stroke)
{
/* TODO: make these values user-modifiable? */
const int partial_len = 100;
const int min_len = 200;
if(stroke) {
sculpt_stroke_create_final(stroke);
if(sculpt_stroke_final_length(stroke) > min_len) {
StrokePoint *p = sculpt_stroke_apply_generic(sd, stroke, partial_len);
/* Replace remaining values in stroke->loc with remaining stroke->final values */
stroke->index = -1;
stroke->length = 0;
for(; p; p = p->next) {
++stroke->index;
stroke->loc[stroke->index][0] = p->x;
stroke->loc[stroke->index][1] = p->y;
if(p->next) {
stroke->length += sculpt_stroke_seglen(p, p->next);
}
}
}
}
}
void sculpt_stroke_apply_all(Sculpt *sd, SculptStroke *stroke)
{
sculpt_stroke_create_final(stroke);
if(stroke) {
sculpt_stroke_apply_generic(sd, stroke, 0);
}
}
/* XXX: drawing goes elsewhere */
void sculpt_stroke_draw(SculptStroke *stroke)
{
if(stroke) {
StrokePoint *p;
/* Draws the original stroke */
/*glColor3f(1, 0, 0);
glBegin(GL_LINE_STRIP);
for(i = 0; i <= stroke->index; ++i)
glVertex2s(stroke->loc[i][0], stroke->loc[i][1]);
glEnd();*/
/* Draws the smoothed stroke */
glColor3f(0, 1, 0);
glBegin(GL_LINE_STRIP);
for(p = stroke->final.first; p; p = p->next)
glVertex2s(p->x, p->y);
glEnd();
}
}

@ -92,307 +92,7 @@
#include "ED_screen.h"
#include "ED_space_api.h"
#if 0 // XXX old includes for reference only
#include "BIF_editaction.h"
#include "BIF_editkey.h"
#include "BIF_editnla.h"
#include "BIF_drawgpencil.h"
#include "BIF_keyframing.h"
#include "BIF_language.h"
#include "BIF_space.h"
#include "BDR_editcurve.h"
#include "BDR_gpencil.h"
#include "BSE_drawnla.h"
#include "BSE_drawipo.h"
#include "BSE_drawview.h"
#include "BSE_editaction_types.h"
#include "BSE_editipo.h"
#include "BSE_headerbuttons.h"
#include "BSE_time.h"
#include "BSE_view.h"
#endif // XXX old defines for reference only
/* XXX */
extern void gl_round_box(int mode, float minx, float miny, float maxx, float maxy, float rad);
/********************************** Slider Stuff **************************** */
#if 0 // XXX all of this slider stuff will need a rethink!
/* sliders for shapekeys */
static void meshactionbuts(SpaceAction *saction, Object *ob, Key *key)
{
int i;
char str[64];
float x, y;
uiBlock *block;
uiBut *but;
/* lets make the shapekey sliders */
/* reset the damn myortho2 or the sliders won't draw/redraw
* correctly *grumble*
*/
mywinset(curarea->win);
myortho2(-0.375f, curarea->winx-0.375f, G.v2d->cur.ymin, G.v2d->cur.ymax);
sprintf(str, "actionbuttonswin %d", curarea->win);
block= uiNewBlock (&curarea->uiblocks, str, UI_EMBOSS);
x = ACHANNEL_NAMEWIDTH + 1;
y = 0.0f;
uiBlockSetEmboss(block, UI_EMBOSSN);
if (!(G.saction->flag & SACTION_SLIDERS)) {
ACTWIDTH = ACHANNEL_NAMEWIDTH;
but=uiDefIconButBitS(block, TOG, SACTION_SLIDERS, B_REDR,
ICON_DISCLOSURE_TRI_RIGHT,
ACHANNEL_NAMEWIDTH - XIC - 5, (short)y + CHANNELHEIGHT,
XIC,YIC-2,
&(G.saction->flag), 0, 0, 0, 0,
"Show action window sliders");
/* no hilite, the winmatrix is not correct later on... */
uiButSetFlag(but, UI_NO_HILITE);
}
else {
but= uiDefIconButBitS(block, TOG, SACTION_SLIDERS, B_REDR,
ICON_DISCLOSURE_TRI_DOWN,
ACHANNEL_NAMEWIDTH - XIC - 5, (short)y + CHANNELHEIGHT,
XIC,YIC-2,
&(G.saction->flag), 0, 0, 0, 0,
"Hide action window sliders");
/* no hilite, the winmatrix is not correct later on... */
uiButSetFlag(but, UI_NO_HILITE);
ACTWIDTH = ACHANNEL_NAMEWIDTH + SLIDERWIDTH;
/* sliders are open so draw them */
BIF_ThemeColor(TH_FACE);
glRects(ACHANNEL_NAMEWIDTH, 0, ACHANNEL_NAMEWIDTH+SLIDERWIDTH, curarea->winy);
uiBlockSetEmboss(block, UI_EMBOSS);
for (i=1; i < key->totkey; i++) {
make_rvk_slider(block, ob, i,
(int)x, (int)y, SLIDERWIDTH-2, CHANNELHEIGHT-1, "Slider to control Shape Keys");
y-=CHANNELHEIGHT+CHANNELSKIP;
/* see sliderval array in editkey.c */
if (i >= 255) break;
}
}
uiDrawBlock(C, block);
}
static void icu_slider_func(void *voidicu, void *voidignore)
{
/* the callback for the icu sliders ... copies the
* value from the icu->curval into a bezier at the
* right frame on the right ipo curve (creating both the
* ipo curve and the bezier if needed).
*/
IpoCurve *icu= voidicu;
BezTriple *bezt=NULL;
float cfra, icuval;
cfra = frame_to_float(CFRA);
if (G.saction->pin==0 && OBACT)
cfra= get_action_frame(OBACT, cfra);
/* if the ipocurve exists, try to get a bezier
* for this frame
*/
bezt = get_bezt_icu_time(icu, &cfra, &icuval);
/* create the bezier triple if one doesn't exist,
* otherwise modify it's value
*/
if (bezt == NULL) {
insert_vert_icu(icu, cfra, icu->curval, 0);
}
else {
bezt->vec[1][1] = icu->curval;
}
/* make sure the Ipo's are properly processed and
* redraw as necessary
*/
sort_time_ipocurve(icu);
testhandles_ipocurve(icu);
/* nla-update (in case this affects anything) */
synchronize_action_strips();
/* do redraw pushes, and also the depsgraph flushes */
if (OBACT->pose || ob_get_key(OBACT))
DAG_object_flush_update(G.scene, OBACT, OB_RECALC);
else
DAG_object_flush_update(G.scene, OBACT, OB_RECALC_OB);
allqueue(REDRAWVIEW3D, 0);
allqueue(REDRAWACTION, 0);
allqueue(REDRAWNLA, 0);
allqueue(REDRAWIPO, 0);
allspace(REMAKEIPO, 0);
allqueue(REDRAWBUTSALL, 0);
}
static void make_icu_slider(uiBlock *block, IpoCurve *icu,
int x, int y, int w, int h, char *tip)
{
/* create a slider for the ipo-curve*/
uiBut *but;
if(icu == NULL) return;
if (IS_EQ(icu->slide_max, icu->slide_min)) {
if (IS_EQ(icu->ymax, icu->ymin)) {
if (ELEM(icu->blocktype, ID_CO, ID_KE)) {
/* hack for constraints and shapekeys (and maybe a few others) */
icu->slide_min= 0.0;
icu->slide_max= 1.0;
}
else {
icu->slide_min= -100;
icu->slide_max= 100;
}
}
else {
icu->slide_min= icu->ymin;
icu->slide_max= icu->ymax;
}
}
if (icu->slide_min >= icu->slide_max) {
SWAP(float, icu->slide_min, icu->slide_max);
}
but=uiDefButF(block, NUMSLI, REDRAWVIEW3D, "",
x, y , w, h,
&(icu->curval), icu->slide_min, icu->slide_max,
10, 2, tip);
uiButSetFunc(but, icu_slider_func, icu, NULL);
// no hilite, the winmatrix is not correct later on...
uiButSetFlag(but, UI_NO_HILITE);
}
/* sliders for ipo-curves of active action-channel */
static void action_icu_buts(SpaceAction *saction)
{
ListBase act_data = {NULL, NULL};
bActListElem *ale;
int filter;
void *data;
short datatype;
char str[64];
float x, y;
uiBlock *block;
/* lets make the action sliders */
/* reset the damn myortho2 or the sliders won't draw/redraw
* correctly *grumble*
*/
mywinset(curarea->win);
myortho2(-0.375f, curarea->winx-0.375f, G.v2d->cur.ymin, G.v2d->cur.ymax);
sprintf(str, "actionbuttonswin %d", curarea->win);
block= uiNewBlock (&curarea->uiblocks, str, UI_EMBOSS);
x = (float)ACHANNEL_NAMEWIDTH + 1;
y = 0.0f;
uiBlockSetEmboss(block, UI_EMBOSSN);
if (G.saction->flag & SACTION_SLIDERS) {
/* sliders are open so draw them */
/* get editor data */
data= get_action_context(&datatype);
if (data == NULL) return;
/* build list of channels to draw */
filter= (ACTFILTER_FORDRAWING|ACTFILTER_VISIBLE|ACTFILTER_CHANNELS);
actdata_filter(&act_data, filter, data, datatype);
/* draw backdrop first */
BIF_ThemeColor(TH_FACE); // change this color... it's ugly
glRects(ACHANNEL_NAMEWIDTH, (short)G.v2d->cur.ymin, ACHANNEL_NAMEWIDTH+SLIDERWIDTH, (short)G.v2d->cur.ymax);
uiBlockSetEmboss(block, UI_EMBOSS);
for (ale= act_data.first; ale; ale= ale->next) {
const float yminc= y-CHANNELHEIGHT/2;
const float ymaxc= y+CHANNELHEIGHT/2;
/* check if visible */
if ( IN_RANGE(yminc, G.v2d->cur.ymin, G.v2d->cur.ymax) ||
IN_RANGE(ymaxc, G.v2d->cur.ymin, G.v2d->cur.ymax) )
{
/* determine what needs to be drawn */
switch (ale->type) {
case ACTTYPE_CONCHAN: /* constraint channel */
{
bActionChannel *achan = (bActionChannel *)ale->owner;
IpoCurve *icu = (IpoCurve *)ale->key_data;
/* only show if owner is selected */
if ((ale->ownertype == ACTTYPE_OBJECT) || SEL_ACHAN(achan)) {
make_icu_slider(block, icu,
(int)x, (int)y, SLIDERWIDTH-2, CHANNELHEIGHT-2,
"Slider to control current value of Constraint Influence");
}
}
break;
case ACTTYPE_ICU: /* ipo-curve channel */
{
bActionChannel *achan = (bActionChannel *)ale->owner;
IpoCurve *icu = (IpoCurve *)ale->key_data;
/* only show if owner is selected */
if ((ale->ownertype == ACTTYPE_OBJECT) || SEL_ACHAN(achan)) {
make_icu_slider(block, icu,
(int)x, (int)y, SLIDERWIDTH-2, CHANNELHEIGHT-2,
"Slider to control current value of IPO-Curve");
}
}
break;
case ACTTYPE_SHAPEKEY: /* shapekey channel */
{
Object *ob= (Object *)ale->id;
IpoCurve *icu= (IpoCurve *)ale->key_data;
// TODO: only show if object is active
if (icu) {
make_icu_slider(block, icu,
(int)x, (int)y, SLIDERWIDTH-2, CHANNELHEIGHT-2,
"Slider to control ShapeKey");
}
else if (ob && ale->index) {
make_rvk_slider(block, ob, ale->index,
(int)x, (int)y, SLIDERWIDTH-2, CHANNELHEIGHT-1, "Slider to control Shape Keys");
}
}
break;
}
}
/* adjust y-position for next one */
y-=CHANNELHEIGHT+CHANNELSKIP;
}
/* free tempolary channels */
BLI_freelistN(&act_data);
}
uiDrawBlock(C, block);
}
#endif // XXX all of this slider stuff will need a rethink
/* ************************************************************************* */
/* Channel List */
@ -518,7 +218,6 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *ar)
adt= ANIM_nla_mapping_get(ac, NULL);
/* start and end of action itself */
// TODO: this has not had scaling applied
calc_action_range(ac->data, &act_start, &act_end, 0);
}
@ -550,43 +249,14 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *ar)
if ( IN_RANGE(yminc, v2d->cur.ymin, v2d->cur.ymax) ||
IN_RANGE(ymaxc, v2d->cur.ymin, v2d->cur.ymax) )
{
bAnimChannelType *acf= ANIM_channel_get_typeinfo(ale);
int sel=0;
/* determine if any need to draw channel */
if (ale->datatype != ALE_NONE) {
/* determine if channel is selected */
switch (ale->type) {
case ANIMTYPE_SCENE:
{
Scene *sce= (Scene *)ale->data;
sel = SEL_SCEC(sce);
}
break;
case ANIMTYPE_OBJECT:
{
Base *base= (Base *)ale->data;
sel = SEL_OBJC(base);
}
break;
case ANIMTYPE_GROUP:
{
bActionGroup *agrp = (bActionGroup *)ale->data;
sel = SEL_AGRP(agrp);
}
break;
case ANIMTYPE_FCURVE:
{
FCurve *fcu = (FCurve *)ale->data;
sel = SEL_FCU(fcu);
}
break;
case ANIMTYPE_GPLAYER:
{
bGPDlayer *gpl = (bGPDlayer *)ale->data;
sel = SEL_GPL(gpl);
}
break;
}
if (acf->has_setting(ac, ale, ACHANNEL_SETTING_SELECT))
sel= ANIM_channel_setting_get(ac, ale, ACHANNEL_SETTING_SELECT);
if (ELEM(ac->datatype, ANIMCONT_ACTION, ANIMCONT_DOPESHEET)) {
switch (ale->type) {

@ -404,13 +404,13 @@ void action_header_buttons(const bContext *C, ARegion *ar)
if (saction->flag & SACTION_DRAWTIME) {
uiDefButC(block, MENU, B_REDR,
"Auto-Snap Keyframes %t|No Snap %x0|Second Step %x1|Nearest Second %x2|Nearest Marker %x3",
xco,yco,70,YIC, &(saction->autosnap), 0, 1, 0, 0,
xco,yco,90,YIC, &(saction->autosnap), 0, 1, 0, 0,
"Auto-snapping mode for keyframes when transforming");
}
else {
uiDefButC(block, MENU, B_REDR,
"Auto-Snap Keyframes %t|No Snap %x0|Frame Step %x1|Nearest Frame %x2|Nearest Marker %x3",
xco,yco,70,YIC, &(saction->autosnap), 0, 1, 0, 0,
xco,yco,90,YIC, &(saction->autosnap), 0, 1, 0, 0,
"Auto-snapping mode for keyframes when transforming");
}

@ -243,7 +243,7 @@ static void action_channel_area_draw(const bContext *C, ARegion *ar)
/* data */
if (ANIM_animdata_get_context(C, &ac)) {
draw_channel_names(C, &ac, saction, ar);
draw_channel_names((bContext *)C, &ac, saction, ar);
}
/* reset view matrix */
@ -294,6 +294,7 @@ static void action_channel_area_listener(ARegion *ar, wmNotifier *wmn)
case NC_SCENE:
switch(wmn->data) {
case ND_OB_ACTIVE:
case ND_FRAME:
ED_region_tag_redraw(ar);
break;
}

@ -280,6 +280,7 @@ void CONSOLE_OT_move(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Move Cursor";
ot->description= "Move cursor position.";
ot->idname= "CONSOLE_OT_move";
/* api callbacks */
@ -324,6 +325,7 @@ void CONSOLE_OT_insert(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Insert";
ot->description= "Insert text at cursor position.";
ot->idname= "CONSOLE_OT_insert";
/* api callbacks */
@ -391,6 +393,7 @@ void CONSOLE_OT_delete(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Delete";
ot->description= "Delete text by cursor position.";
ot->idname= "CONSOLE_OT_delete";
/* api callbacks */
@ -434,6 +437,7 @@ void CONSOLE_OT_clear(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Clear";
ot->description= "Clear text by type.";
ot->idname= "CONSOLE_OT_clear";
/* api callbacks */
@ -478,6 +482,7 @@ void CONSOLE_OT_history_cycle(wmOperatorType *ot)
{
/* identifiers */
ot->name= "History Cycle";
ot->description= "Cycle through history.";
ot->idname= "CONSOLE_OT_history_cycle";
/* api callbacks */
@ -525,6 +530,7 @@ void CONSOLE_OT_history_append(wmOperatorType *ot)
{
/* identifiers */
ot->name= "History Append";
ot->description= "Append history at cursor position.";
ot->idname= "CONSOLE_OT_history_append";
/* api callbacks */
@ -572,6 +578,7 @@ void CONSOLE_OT_scrollback_append(wmOperatorType *ot)
/* identifiers */
ot->name= "Scrollback Append";
ot->description= "Append scrollback text by type.";
ot->idname= "CONSOLE_OT_scrollback_append";
/* api callbacks */
@ -614,6 +621,7 @@ void CONSOLE_OT_copy(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Copy to Clipboard";
ot->description= "Copy selected text to clipboard.";
ot->idname= "CONSOLE_OT_copy";
/* api callbacks */
@ -648,6 +656,7 @@ void CONSOLE_OT_paste(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Paste from Clipboard";
ot->description= "Paste text from clipboard.";
ot->idname= "CONSOLE_OT_paste";
/* api callbacks */
@ -679,6 +688,9 @@ void CONSOLE_OT_zoom(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Console Zoom";
/*optionals -
"Zoom view font." */
ot->description= "Zoom screen area.";
ot->idname= "CONSOLE_OT_zoom";
/* api callbacks */

@ -114,6 +114,7 @@ void CONSOLE_OT_report_replay(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Replay Operators";
ot->description= "Replay selected reports.";
ot->idname= "CONSOLE_OT_report_replay";
/* api callbacks */
@ -160,6 +161,7 @@ void CONSOLE_OT_select_pick(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Select report";
ot->description= "Select reports by index.";
ot->idname= "CONSOLE_OT_select_pick";
/* api callbacks */
@ -213,6 +215,7 @@ void CONSOLE_OT_select_all_toggle(wmOperatorType *ot)
{
/* identifiers */
ot->name= "(De)Select All";
ot->description= "(de)select all reports.";
ot->idname= "CONSOLE_OT_select_all_toggle";
/* api callbacks */
@ -304,6 +307,7 @@ void CONSOLE_OT_select_border(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Border Select";
ot->description= "Toggle border selection.";
ot->idname= "CONSOLE_OT_select_border";
/* api callbacks */
@ -357,6 +361,7 @@ void CONSOLE_OT_report_delete(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Delete Reports";
ot->description= "Delete selected reports.";
ot->idname= "CONSOLE_OT_report_delete";
/* api callbacks */
@ -401,6 +406,7 @@ void CONSOLE_OT_report_copy(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Copy Reports to Clipboard";
ot->description= "Copy selected reports to Clipboard.";
ot->idname= "CONSOLE_OT_report_copy";
/* api callbacks */

@ -81,6 +81,8 @@ static void graph_viewmenu(bContext *C, uiLayout *layout, void *arg_unused)
uiItemS(layout);
uiItemR(layout, NULL, 0, &spaceptr, "show_cframe_indicator", 0);
uiItemR(layout, NULL, 0, &spaceptr, "show_sliders", 0);
uiItemR(layout, NULL, 0, &spaceptr, "automerge_keyframes", 0);
if (sipo->flag & SIPO_NOHANDLES)
uiItemO(layout, "Show Handles", ICON_CHECKBOX_DEHLT, "GRAPH_OT_handles_view_toggle");
@ -88,7 +90,7 @@ static void graph_viewmenu(bContext *C, uiLayout *layout, void *arg_unused)
uiItemO(layout, "Show Handles", ICON_CHECKBOX_HLT, "GRAPH_OT_handles_view_toggle");
uiItemR(layout, NULL, 0, &spaceptr, "only_selected_curves_handles", 0);
uiItemR(layout, NULL, 0, &spaceptr, "automerge_keyframes", 0);
if (sipo->flag & SIPO_DRAWTIME)
uiItemO(layout, "Show Frames", 0, "ANIM_OT_time_toggle");

@ -1314,10 +1314,16 @@ static short draw_sensorbuttons(bSensor *sens, uiBlock *block, short xco, short
* proper compatibility with older .blend files. */
str= "Type %t|Left button %x1|Middle button %x2|"
"Right button %x4|Wheel Up %x5|Wheel Down %x6|Movement %x8|Mouse over %x16|Mouse over any%x32";
uiDefButS(block, MENU, B_REDR, str, xco+10, yco-44, width-20, 19,
uiDefButS(block, MENU, B_REDR, str, xco+10, yco-44, (width*0.8f)-20, 19,
&ms->type, 0, 31, 0, 0,
"Specify the type of event this mouse sensor should trigger on");
if(ms->type==32) {
uiDefButBitS(block, TOG, SENS_MOUSE_FOCUS_PULSE, B_REDR, "Pulse",(short)(xco + 10) + (width*0.8f)-20,(short)(yco - 44),
(short)(0.20 * (width-20)), 19, &ms->flag, 0.0, 0.0, 0, 0,
"Moving the mouse over a different object generates a pulse");
}
yco-= ysize;
break;
}

@ -215,6 +215,7 @@ void TEXT_OT_properties(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Properties";
ot->description= "Toggle text properties panel.";
ot->idname= "TEXT_OT_properties";
/* api callbacks */

@ -176,6 +176,7 @@ void TEXT_OT_new(wmOperatorType *ot)
{
/* identifiers */
ot->name= "New";
ot->description= "Create a new text data block.";
ot->idname= "TEXT_OT_new";
/* api callbacks */
@ -223,6 +224,7 @@ void TEXT_OT_open(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Open";
ot->description= "Open a new text data block.";
ot->idname= "TEXT_OT_open";
/* api callbacks */
@ -260,6 +262,7 @@ void TEXT_OT_reload(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Reload";
ot->description= "Reload active text data block from its file.";
ot->idname= "TEXT_OT_reload";
/* api callbacks */
@ -337,6 +340,7 @@ void TEXT_OT_unlink(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Unlink";
ot->description= "Unlink active text data block.";
ot->idname= "TEXT_OT_unlink";
/* api callbacks */
@ -367,6 +371,7 @@ void TEXT_OT_make_internal(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Make Internal";
ot->description= "Make active text file internal.";
ot->idname= "TEXT_OT_make_internal";
/* api callbacks */
@ -435,6 +440,7 @@ void TEXT_OT_save(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Save";
ot->description= "Save active text data block.";
ot->idname= "TEXT_OT_save";
/* api callbacks */
@ -490,6 +496,7 @@ void TEXT_OT_save_as(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Save As";
ot->description= "Save active text file with options.";
ot->idname= "TEXT_OT_save_as";
/* api callbacks */
@ -527,6 +534,7 @@ void TEXT_OT_run_script(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Run Script";
ot->description= "Run active script.";
ot->idname= "TEXT_OT_run_script";
/* api callbacks */
@ -583,6 +591,7 @@ void TEXT_OT_refresh_pyconstraints(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Refresh PyConstraints";
ot->description= "Refresh all pyconstraints.";
ot->idname= "TEXT_OT_refresh_pyconstraints";
/* api callbacks */
@ -704,6 +713,7 @@ void TEXT_OT_paste(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Paste";
ot->description= "Paste text from clipboard.";
ot->idname= "TEXT_OT_paste";
/* api callbacks */
@ -744,6 +754,7 @@ void TEXT_OT_copy(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Copy";
ot->description= "Copy selected text to clipboard.";
ot->idname= "TEXT_OT_copy";
/* api callbacks */
@ -774,6 +785,7 @@ void TEXT_OT_cut(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Cut";
ot->description= "Cut selected text to clipboard.";
ot->idname= "TEXT_OT_cut";
/* api callbacks */
@ -809,6 +821,7 @@ void TEXT_OT_indent(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Indent";
ot->description= "Indent selected text.";
ot->idname= "TEXT_OT_indent";
/* api callbacks */
@ -844,6 +857,7 @@ void TEXT_OT_unindent(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Unindent";
ot->description= "Unindent selected text.";
ot->idname= "TEXT_OT_unindent";
/* api callbacks */
@ -884,6 +898,7 @@ void TEXT_OT_line_break(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Line Break";
ot->description= "Insert line break at cursor position.";
ot->idname= "TEXT_OT_line_break";
/* api callbacks */
@ -916,6 +931,7 @@ void TEXT_OT_comment(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Comment";
ot->description= "Convert selected text to comment.";
ot->idname= "TEXT_OT_comment";
/* api callbacks */
@ -949,6 +965,7 @@ void TEXT_OT_uncomment(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Uncomment";
ot->description= "Convert selected comment to text.";
ot->idname= "TEXT_OT_uncomment";
/* api callbacks */
@ -1090,6 +1107,7 @@ void TEXT_OT_convert_whitespace(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Convert Whitespace";
ot->description= "Convert whitespaces by type.";
ot->idname= "TEXT_OT_convert_whitespace";
/* api callbacks */
@ -1120,6 +1138,7 @@ void TEXT_OT_select_all(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Select All";
ot->description= "Select all text.";
ot->idname= "TEXT_OT_select_all";
/* api callbacks */
@ -1147,6 +1166,7 @@ void TEXT_OT_select_line(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Select Line";
ot->description= "Select text by line.";
ot->idname= "TEXT_OT_select_line";
/* api clinebacks */
@ -1184,6 +1204,7 @@ void TEXT_OT_previous_marker(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Previous Marker";
ot->description= "Move to previous marker.";
ot->idname= "TEXT_OT_previous_marker";
/* api callbacks */
@ -1221,6 +1242,7 @@ void TEXT_OT_next_marker(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Next Marker";
ot->description= "Move to next marker";
ot->idname= "TEXT_OT_next_marker";
/* api callbacks */
@ -1248,6 +1270,7 @@ void TEXT_OT_markers_clear(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Clear All Markers";
ot->description= "Clear all markers.";
ot->idname= "TEXT_OT_markers_clear";
/* api callbacks */
@ -1531,6 +1554,7 @@ void TEXT_OT_move(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Move Cursor";
ot->description= "Move cursor to position type.";
ot->idname= "TEXT_OT_move";
/* api callbacks */
@ -1557,6 +1581,7 @@ void TEXT_OT_move_select(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Move Select";
ot->description= "Make selection from current cursor position to new cursor position type.";
ot->idname= "TEXT_OT_move_select";
/* api callbacks */
@ -1596,6 +1621,7 @@ void TEXT_OT_jump(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Jump";
ot->description= "Jump cursor to line.";
ot->idname= "TEXT_OT_jump";
/* api callbacks */
@ -1648,6 +1674,7 @@ void TEXT_OT_delete(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Delete";
ot->description= "Delete text by cursor position.";
ot->idname= "TEXT_OT_delete";
/* api callbacks */
@ -1828,6 +1855,10 @@ void TEXT_OT_scroll(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Scroll";
/*don't really see the difference between this and
scroll_bar. Both do basically the same thing (aside
from keymaps).*/
ot->description= "Scroll text screen.";
ot->idname= "TEXT_OT_scroll";
/* api callbacks */
@ -1876,6 +1907,10 @@ void TEXT_OT_scroll_bar(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Scrollbar";
/*don't really see the difference between this and
scroll. Both do basically the same thing (aside
from keymaps).*/
ot->description= "Scroll text screen.";
ot->idname= "TEXT_OT_scroll_bar";
/* api callbacks */
@ -2151,6 +2186,7 @@ void TEXT_OT_cursor_set(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Set Cursor";
ot->description= "Set cursor selection.";
ot->idname= "TEXT_OT_cursor_set";
/* api callbacks */
@ -2274,6 +2310,7 @@ void TEXT_OT_insert(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Insert";
ot->description= "Insert text at cursor position.";
ot->idname= "TEXT_OT_insert";
/* api callbacks */
@ -2378,6 +2415,7 @@ void TEXT_OT_find(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Find";
ot->description= "Find specified text.";
ot->idname= "TEXT_OT_find";
/* api callbacks */
@ -2396,6 +2434,7 @@ void TEXT_OT_replace(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Replace";
ot->description= "Replace text with specified text.";
ot->idname= "TEXT_OT_replace";
/* api callbacks */
@ -2414,6 +2453,7 @@ void TEXT_OT_mark_all(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Mark All";
ot->description= "Mark all specified text.";
ot->idname= "TEXT_OT_mark_all";
/* api callbacks */
@ -2443,6 +2483,7 @@ void TEXT_OT_find_set_selected(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Find Set Selected";
ot->description= "Find specified text and set as selected.";
ot->idname= "TEXT_OT_find_set_selected";
/* api callbacks */
@ -2469,6 +2510,7 @@ void TEXT_OT_replace_set_selected(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Replace Set Selected";
ot->description= "Replace text with specified text and set as selected.";
ot->idname= "TEXT_OT_replace_set_selected";
/* api callbacks */
@ -2631,6 +2673,7 @@ void TEXT_OT_to_3d_object(wmOperatorType *ot)
{
/* identifiers */
ot->name= "To 3D Object";
ot->description= "Create 3d text object from active text data block.";
ot->idname= "TEXT_OT_to_3d_object";
/* api callbacks */

@ -197,7 +197,6 @@ void draw_volume(Scene *scene, ARegion *ar, View3D *v3d, Base *base, GPUTexture
RegionView3D *rv3d= ar->regiondata;
float viewnormal[3];
// int res[3];
int i, j, n;
float d, d0, dd;
float *points = NULL;
@ -237,9 +236,12 @@ void draw_volume(Scene *scene, ARegion *ar, View3D *v3d, Base *base, GPUTexture
GPU_texture_bind(tex, 0);
if (!GLEW_ARB_texture_non_power_of_two)
{
cor[0] = (float)res[0]/(float)larger_pow2(res[0]);
cor[1] = (float)res[1]/(float)larger_pow2(res[1]);
cor[2] = (float)res[2]/(float)larger_pow2(res[2]);
}
// our slices are defined by the plane equation a*x + b*y +c*z + d = 0
// (a,b,c), the plane normal, are given by viewdir

File diff suppressed because it is too large Load Diff

@ -269,7 +269,7 @@ static void editmesh_apply_to_mirror(TransInfo *t)
/* tags the given ID block for refreshes (if applicable) due to
* Animation Editor editing
*/
static void animedit_refresh_id_tags (ID *id)
static void animedit_refresh_id_tags (Scene *scene, ID *id)
{
if (id) {
AnimData *adt= BKE_animdata_from_id(id);
@ -279,12 +279,11 @@ static void animedit_refresh_id_tags (ID *id)
adt->recalc |= ADT_RECALC_ANIM;
/* if ID-block is Object, set recalc flags */
// TODO: this should probably go through the depsgraph instead... but for now, let's be lazy
switch (GS(id->name)) {
case ID_OB:
{
Object *ob= (Object *)id;
ob->recalc |= OB_RECALC;
DAG_object_flush_update(scene, ob, OB_RECALC_DATA); /* sets recalc flags */
}
break;
}
@ -384,7 +383,7 @@ void recalcData(TransInfo *t)
/* just tag these animdata-blocks to recalc, assuming that some data there changed */
for (ale= anim_data.first; ale; ale= ale->next) {
/* set refresh tags for objects using this animation */
animedit_refresh_id_tags(ale->id);
animedit_refresh_id_tags(t->scene, ale->id);
}
/* now free temp channels */
@ -432,7 +431,7 @@ void recalcData(TransInfo *t)
calchandles_fcurve(fcu);
/* set refresh tags for objects using this animation */
animedit_refresh_id_tags(ale->id);
animedit_refresh_id_tags(t->scene, ale->id);
}
/* do resort and other updates? */
@ -463,7 +462,7 @@ void recalcData(TransInfo *t)
continue;
/* set refresh tags for objects using this animation */
animedit_refresh_id_tags(tdn->id);
animedit_refresh_id_tags(t->scene, tdn->id);
/* if cancelling transform, just write the values without validating, then move on */
if (t->state == TRANS_CANCEL) {

@ -148,6 +148,7 @@ void TFM_OT_select_orientation(struct wmOperatorType *ot)
/* identifiers */
ot->name = "Select Orientation";
ot->description= "Select orientation type.";
ot->idname = "TFM_OT_select_orientation";
/* api callbacks */
@ -308,6 +309,7 @@ void TFM_OT_translate(struct wmOperatorType *ot)
{
/* identifiers */
ot->name = "Translate";
ot->description= "Translate selected items.";
ot->idname = OP_TRANSLATION;
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
@ -333,6 +335,7 @@ void TFM_OT_resize(struct wmOperatorType *ot)
{
/* identifiers */
ot->name = "Resize";
ot->description= "Resize selected items.";
ot->idname = OP_RESIZE;
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
@ -359,6 +362,7 @@ void TFM_OT_trackball(struct wmOperatorType *ot)
{
/* identifiers */
ot->name = "Trackball";
ot->description= "Trackball style rotation of selected items.";
ot->idname = OP_TRACKBALL;
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
@ -380,6 +384,7 @@ void TFM_OT_rotate(struct wmOperatorType *ot)
{
/* identifiers */
ot->name = "Rotate";
ot->description= "Rotate selected items.";
ot->idname = OP_ROTATION;
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
@ -405,6 +410,10 @@ void TFM_OT_tilt(struct wmOperatorType *ot)
{
/* identifiers */
ot->name = "Tilt";
/*optionals -
"Tilt selected vertices."
"Specify an extra axis rotation for selected vertices of 3d curve." */
ot->description= "Tilt selected control vertices of 3d curve.";
ot->idname = OP_TILT;
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
@ -428,6 +437,7 @@ void TFM_OT_warp(struct wmOperatorType *ot)
{
/* identifiers */
ot->name = "Warp";
ot->description= "Warp selected items around the cursor.";
ot->idname = OP_WARP;
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
@ -452,6 +462,7 @@ void TFM_OT_shear(struct wmOperatorType *ot)
{
/* identifiers */
ot->name = "Shear";
ot->description= "Shear selected items along the horizontal screen axis.";
ot->idname = OP_SHEAR;
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
@ -476,6 +487,7 @@ void TFM_OT_shrink_fatten(struct wmOperatorType *ot)
{
/* identifiers */
ot->name = "Shrink/Fatten";
ot->description= "Shrink/fatten selected vertices along normals.";
ot->idname = OP_SHRINK_FATTEN;
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
@ -497,6 +509,8 @@ void TFM_OT_tosphere(struct wmOperatorType *ot)
{
/* identifiers */
ot->name = "To Sphere";
//added "around mesh center" to differentiate between "MESH_OT_vertices_to_sphere()"
ot->description= "Move selected vertices outward in a spherical shape around mesh center.";
ot->idname = OP_TOSPHERE;
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
@ -548,6 +562,7 @@ void TFM_OT_transform(struct wmOperatorType *ot)
/* identifiers */
ot->name = "Transform";
ot->description= "Transform selected items by mode type.";
ot->idname = "TFM_OT_transform";
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;

@ -239,6 +239,7 @@ void ED_OT_undo(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Undo";
ot->description= "Undo previous action.";
ot->idname= "ED_OT_undo";
/* api callbacks */
@ -250,6 +251,7 @@ void ED_OT_redo(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Redo";
ot->description= "Redo previous action.";
ot->idname= "ED_OT_redo";
/* api callbacks */

@ -318,6 +318,7 @@ GPUTexture *GPU_texture_create_3D(int w, int h, int depth, float *fpixels)
GPUTexture *tex;
GLenum type, format, internalformat;
void *pixels = NULL;
float vfBorderColor[4] = {0.0f, 0.0f, 0.0f, 0.0f};
tex = MEM_callocN(sizeof(GPUTexture), "GPUTexture");
tex->w = w;
@ -336,7 +337,7 @@ GPUTexture *GPU_texture_create_3D(int w, int h, int depth, float *fpixels)
return NULL;
}
// if (!GLEW_ARB_texture_non_power_of_two)
if (!GLEW_ARB_texture_non_power_of_two)
{
tex->w = larger_pow2(tex->w);
tex->h = larger_pow2(tex->h);
@ -357,24 +358,15 @@ GPUTexture *GPU_texture_create_3D(int w, int h, int depth, float *fpixels)
if (fpixels) {
glTexSubImage3D(tex->target, 0, 0, 0, 0, w, h, depth, format, type, pixels);
/*
if (tex->w > w)
GPU_glTexSubImageEmpty(tex->target, format, w, 0, tex->w-w, tex->h);
if (tex->h > h)
GPU_glTexSubImageEmpty(tex->target, format, 0, h, w, tex->h-h);
*/
}
// glTexImage3D(tex->target, 0, GL_RGBA, w, h, depth, 0, GL_RGBA, GL_FLOAT, fpixels);
glTexParameterfv(GL_TEXTURE_3D, GL_TEXTURE_BORDER_COLOR, vfBorderColor);
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S,GL_CLAMP_TO_BORDER);
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_T,GL_CLAMP_TO_BORDER);
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R,GL_CLAMP_TO_BORDER);
if (pixels)
MEM_freeN(pixels);

@ -13,6 +13,6 @@ incs = ['.',
'../../../makesdna']
incs += Split(env['BF_OPENEXR_INC'])
defs = []
defs = ['WITH_OPENEXR']
env.BlenderLib ('bf_openexr', source_files, incs, defs, libtype=['core','player'], priority = [225, 85])

@ -51,7 +51,6 @@ _CRTIMP void __cdecl _invalid_parameter_noinfo(void)
#include "IMB_imbuf.h"
#include "IMB_allocimbuf.h"
#define WITH_OPENEXR
#include "openexr_multi.h"
}

@ -178,6 +178,9 @@ typedef struct bJoystickSensor {
/* bMouseSensor->type: uses blender event defines */
/* bMouseSensor->flag: only pulse for now */
#define SENS_MOUSE_FOCUS_PULSE 1
/* propertysensor->type */
#define SENS_PROP_EQUAL 0
#define SENS_PROP_NEQUAL 1

@ -720,6 +720,7 @@ enum FileSortTypeE {
#define SIPO_DRAWTIME (1<<4)
#define SIPO_SELCUVERTSONLY (1<<5)
#define SIPO_DRAWNAMES (1<<6)
#define SIPO_SLIDERS (1<<7)
/* SpaceIpo->mode (Graph Editor Mode) */
enum {

@ -55,7 +55,7 @@ EnumPropertyItem modifier_type_items[] ={
{eModifierType_Multires, "MULTIRES", ICON_MOD_MULTIRES, "Multiresolution", ""},
{eModifierType_Subsurf, "SUBSURF", ICON_MOD_SUBSURF, "Subdivision Surface", ""},
{eModifierType_UVProject, "UV_PROJECT", ICON_MOD_UVPROJECT, "UV Project", ""},
{0, "", 0, "Deformers", ""},
{0, "", 0, "Deform", ""},
{eModifierType_Armature, "ARMATURE", ICON_MOD_ARMATURE, "Armature", ""},
{eModifierType_Cast, "CAST", ICON_MOD_CAST, "Cast", ""},
{eModifierType_Curve, "CURVE", ICON_MOD_CURVE, "Curve", ""},

@ -151,12 +151,72 @@ static int rna_PoseChannel_has_ik_get(PointerRNA *ptr)
return ED_pose_channel_in_IK_chain(ob, pchan);
}
static PointerRNA rna_PoseChannel_bone_group_get(PointerRNA *ptr)
{
Object *ob= (Object*)ptr->id.data;
bPose *pose= (ob) ? ob->pose : NULL;
bPoseChannel *pchan= (bPoseChannel*)ptr->data;
bActionGroup *grp;
if (pose)
grp= BLI_findlink(&pose->agroups, pchan->agrp_index-1);
else
grp= NULL;
return rna_pointer_inherit_refine(ptr, &RNA_BoneGroup, grp);
}
static void rna_PoseChannel_bone_group_set(PointerRNA *ptr, PointerRNA value)
{
Object *ob= (Object*)ptr->id.data;
bPose *pose= (ob) ? ob->pose : NULL;
bPoseChannel *pchan= (bPoseChannel*)ptr->data;
if (pose)
pchan->agrp_index= BLI_findindex(&pose->agroups, value.data) + 1;
else
pchan->agrp_index= 0;
}
static int rna_PoseChannel_bone_group_index_get(PointerRNA *ptr)
{
bPoseChannel *pchan= (bPoseChannel*)ptr->data;
return MAX2(pchan->agrp_index-1, 0);
}
static void rna_PoseChannel_bone_group_index_set(PointerRNA *ptr, int value)
{
bPoseChannel *pchan= (bPoseChannel*)ptr->data;
pchan->agrp_index= value+1;
}
static void rna_PoseChannel_bone_group_index_range(PointerRNA *ptr, int *min, int *max)
{
Object *ob= (Object*)ptr->id.data;
bPose *pose= (ob) ? ob->pose : NULL;
*min= 0;
if (pose) {
*max= BLI_countlist(&pose->agroups)-1;
*max= MAX2(0, *max);
}
else
*max= 0;
}
static PointerRNA rna_Pose_active_bone_group_get(PointerRNA *ptr)
{
bPose *pose= (bPose*)ptr->data;
return rna_pointer_inherit_refine(ptr, &RNA_BoneGroup, BLI_findlink(&pose->agroups, pose->active_group-1));
}
static void rna_Pose_active_bone_group_set(PointerRNA *ptr, PointerRNA value)
{
bPose *pose= (bPose*)ptr->data;
pose->active_group= BLI_findindex(&pose->agroups, value.data) + 1;
}
static int rna_Pose_active_bone_group_index_get(PointerRNA *ptr)
{
bPose *pose= (bPose*)ptr->data;
@ -305,59 +365,22 @@ static void rna_def_pose_channel(BlenderRNA *brna)
RNA_def_struct_path_func(srna, "rna_PoseChannel_path");
RNA_def_struct_idproperties_func(srna, "rna_PoseChannel_idproperties");
/* Bone Constraints */
prop= RNA_def_property(srna, "constraints", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "Constraint");
RNA_def_property_ui_text(prop, "Constraints", "Constraints that act on this PoseChannel.");
/* Name + Selection Status */
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_PoseChannel_name_set");
RNA_def_property_ui_text(prop, "Name", "");
RNA_def_struct_name_property(srna, prop);
prop= RNA_def_property(srna, "has_ik", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_PoseChannel_has_ik_get", NULL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Has IK", "Is part of an IK chain.");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
prop= RNA_def_property(srna, "ik_dof_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "ikflag", BONE_IK_NO_XDOF);
RNA_def_property_ui_text(prop, "IK X DoF", "Allow movement around the X axis.");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
prop= RNA_def_property(srna, "ik_dof_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "ikflag", BONE_IK_NO_YDOF);
RNA_def_property_ui_text(prop, "IK Y DoF", "Allow movement around the Y axis.");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
prop= RNA_def_property(srna, "ik_dof_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "ikflag", BONE_IK_NO_ZDOF);
RNA_def_property_ui_text(prop, "IK Z DoF", "Allow movement around the Z axis.");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
prop= RNA_def_property(srna, "ik_limit_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_XLIMIT);
RNA_def_property_ui_text(prop, "IK X Limit", "Limit movement around the X axis.");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
prop= RNA_def_property(srna, "ik_limit_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_YLIMIT);
RNA_def_property_ui_text(prop, "IK Y Limit", "Limit movement around the Y axis.");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
prop= RNA_def_property(srna, "ik_limit_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_ZLIMIT);
RNA_def_property_ui_text(prop, "IK Z Limit", "Limit movement around the Z axis.");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "selectflag", BONE_SELECTED);
RNA_def_property_ui_text(prop, "Selected", "");
prop= RNA_def_property(srna, "bone_group_index", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "agrp_index");
RNA_def_property_ui_text(prop, "Bone Group Index", "Bone Group this pose channel belongs to (0=no group).");
/* Baked Bone Path cache data s*/
prop= RNA_def_property(srna, "path_start_frame", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "pathsf");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
@ -370,6 +393,7 @@ static void rna_def_pose_channel(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Bone Paths Calculation End Frame", "End frame of range of frames to use for Bone Path calculations.");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
/* Relationships to other bones */
prop= RNA_def_property(srna, "bone", PROP_POINTER, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "Bone");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
@ -385,6 +409,7 @@ static void rna_def_pose_channel(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Child", "Child of this pose channel.");
/* Transformation settings */
prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "loc");
RNA_def_property_ui_text(prop, "Location", "");
@ -429,6 +454,7 @@ static void rna_def_pose_channel(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Constraint Inverse Matrix", "4x4 matrix, defines transform from final position to unconstrained position."); */
/* Head/Tail Coordinates (in Pose Space) - Automatically calculated... */
prop= RNA_def_property(srna, "pose_head", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Pose Head Position", "Location of head of the channel's bone.");
@ -437,6 +463,43 @@ static void rna_def_pose_channel(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Pose Tail Position", "Location of tail of the channel's bone.");
/* IK Settings */
prop= RNA_def_property(srna, "has_ik", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_PoseChannel_has_ik_get", NULL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Has IK", "Is part of an IK chain.");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
prop= RNA_def_property(srna, "ik_dof_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "ikflag", BONE_IK_NO_XDOF);
RNA_def_property_ui_text(prop, "IK X DoF", "Allow movement around the X axis.");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
prop= RNA_def_property(srna, "ik_dof_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "ikflag", BONE_IK_NO_YDOF);
RNA_def_property_ui_text(prop, "IK Y DoF", "Allow movement around the Y axis.");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
prop= RNA_def_property(srna, "ik_dof_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "ikflag", BONE_IK_NO_ZDOF);
RNA_def_property_ui_text(prop, "IK Z DoF", "Allow movement around the Z axis.");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
prop= RNA_def_property(srna, "ik_limit_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_XLIMIT);
RNA_def_property_ui_text(prop, "IK X Limit", "Limit movement around the X axis.");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
prop= RNA_def_property(srna, "ik_limit_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_YLIMIT);
RNA_def_property_ui_text(prop, "IK Y Limit", "Limit movement around the Y axis.");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
prop= RNA_def_property(srna, "ik_limit_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_ZLIMIT);
RNA_def_property_ui_text(prop, "IK Z Limit", "Limit movement around the Z axis.");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
prop= RNA_def_property(srna, "ik_min_x", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "limitmin[0]");
RNA_def_property_range(prop, -180.0f, 0.0f);
@ -497,10 +560,30 @@ static void rna_def_pose_channel(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "IK Stretch", "Allow scaling of the bone for IK.");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
prop= RNA_def_property(srna, "custom", PROP_POINTER, PROP_NONE);
/* custom bone shapes */
prop= RNA_def_property(srna, "custom_shape", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "custom");
RNA_def_property_struct_type(prop, "Object");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Custom Object", "Object that defines custom draw type for this bone.");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
/* bone groups */
prop= RNA_def_property(srna, "bone_group_index", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "agrp_index");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_int_funcs(prop, "rna_PoseChannel_bone_group_index_get", "rna_PoseChannel_bone_group_index_set", "rna_PoseChannel_bone_group_index_range");
RNA_def_property_ui_text(prop, "Bone Group Index", "Bone Group this pose channel belongs to (0=no group).");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
prop= RNA_def_property(srna, "bone_group", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "BoneGroup");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_pointer_funcs(prop, "rna_PoseChannel_bone_group_get", "rna_PoseChannel_bone_group_set", NULL);
RNA_def_property_ui_text(prop, "Bone Group", "Bone Group this pose channel belongs to");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
/* transform locks */
prop= RNA_def_property(srna, "lock_location", PROP_BOOLEAN, PROP_XYZ);
RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_LOCX);
RNA_def_property_array(prop, 3);
@ -541,8 +624,9 @@ static void rna_def_pose(BlenderRNA *brna)
prop= RNA_def_property(srna, "active_bone_group", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "BoneGroup");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_pointer_funcs(prop, "rna_Pose_active_bone_group_get", "rna_Pose_active_bone_group_set", NULL);
RNA_def_property_ui_text(prop, "Active Bone Group", "Bone groups of the pose.");
RNA_def_property_ui_text(prop, "Active Bone Group", "Active bone group for this pose.");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
prop= RNA_def_property(srna, "active_bone_group_index", PROP_INT, PROP_NONE);

@ -1075,6 +1075,10 @@ static void rna_def_space_graph(BlenderRNA *brna)
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NODRAWCFRANUM);
RNA_def_property_ui_text(prop, "Show Frame Number Indicator", "Show frame number beside the current frame indicator line.");
prop= RNA_def_property(srna, "show_sliders", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_SLIDERS);
RNA_def_property_ui_text(prop, "Show Sliders", "Show sliders beside F-Curve channels.");
prop= RNA_def_property(srna, "show_handles", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_NOHANDLES);
RNA_def_property_ui_text(prop, "Show Handles", "Show handles of Bezier control points.");

@ -311,8 +311,6 @@ void RNA_api_ui_layout(StructRNA *srna)
func= RNA_def_function(srna, "template_header_3D", "uiTemplateHeader3D");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
func= RNA_def_function(srna, "view3d_select_metaballmenu", "uiTemplate_view3d_select_metaballmenu");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
func= RNA_def_function(srna, "view3d_select_faceselmenu", "uiTemplate_view3d_select_faceselmenu");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);

@ -1662,16 +1662,19 @@ static void rna_def_userdef_view(BlenderRNA *brna)
prop= RNA_def_property(srna, "show_mini_axis", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_SHOW_ROTVIEWICON);
RNA_def_property_ui_text(prop, "Show Mini Axis", "Show a small rotating 3D axis in the bottom left corner of the 3D View.");
RNA_def_property_update(prop, NC_WINDOW, NULL);
prop= RNA_def_property(srna, "mini_axis_size", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "rvisize");
RNA_def_property_range(prop, 10, 64);
RNA_def_property_ui_text(prop, "Mini Axis Size", "The axis icon's size.");
RNA_def_property_update(prop, NC_WINDOW, NULL);
prop= RNA_def_property(srna, "mini_axis_brightness", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "rvibright");
RNA_def_property_range(prop, 0, 10);
RNA_def_property_ui_text(prop, "Mini Axis Brightness", "The brightness of the icon.");
RNA_def_property_update(prop, NC_WINDOW, NULL);
/* middle mouse button */
prop= RNA_def_property(srna, "middle_mouse_rotate", PROP_BOOLEAN, PROP_NONE);
@ -1705,16 +1708,19 @@ static void rna_def_userdef_view(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_manipulator", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "tw_flag", 1);
RNA_def_property_ui_text(prop, "Manipulator", "Use 3d transform manipulator.");
RNA_def_property_update(prop, NC_WINDOW, NULL);
prop= RNA_def_property(srna, "manipulator_size", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "tw_size");
RNA_def_property_range(prop, 2, 40);
RNA_def_property_ui_text(prop, "Manipulator Size", "Diameter of widget, in 10 pixel units.");
RNA_def_property_update(prop, NC_WINDOW, NULL);
prop= RNA_def_property(srna, "manipulator_handle_size", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "tw_handlesize");
RNA_def_property_range(prop, 2, 40);
RNA_def_property_ui_text(prop, "Manipulator Handle Size", "Size of widget handles as percentage of widget radius.");
RNA_def_property_update(prop, NC_WINDOW, NULL);
prop= RNA_def_property(srna, "manipulator_hotspot", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "tw_hotspot");
@ -1725,6 +1731,7 @@ static void rna_def_userdef_view(BlenderRNA *brna)
RNA_def_property_int_sdna(prop, NULL, "obcenter_dia");
RNA_def_property_range(prop, 4, 10);
RNA_def_property_ui_text(prop, "Object Center Size", "Diameter in Pixels for Object/Lamp center display.");
RNA_def_property_update(prop, NC_WINDOW, NULL);
prop= RNA_def_property(srna, "ndof_pan_speed", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "ndof_pan");

@ -720,6 +720,7 @@ int wm_search_menu_poll(bContext *C)
{
if(CTX_wm_window(C)==NULL) return 0;
if(CTX_wm_area(C) && CTX_wm_area(C)->spacetype==SPACE_CONSOLE) return 0; // XXX - so we can use the shortcut in the console
if(CTX_wm_area(C) && CTX_wm_area(C)->spacetype==SPACE_TEXT) return 0; // XXX - so we can use the spacebar in the text editor
return 1;
}
@ -1908,22 +1909,22 @@ void wm_window_keymap(wmWindowManager *wm)
/* note, this doesn't replace existing keymap items */
WM_keymap_verify_item(keymap, "WM_OT_window_duplicate", WKEY, KM_PRESS, KM_CTRL|KM_ALT, 0);
WM_keymap_add_item(keymap, "WM_OT_read_homefile", NKEY, KM_PRESS, KM_CTRL, 0);
WM_keymap_add_item(keymap, "WM_OT_read_homefile", NKEY, KM_PRESS, KM_OSKEY, 0);
// WM_keymap_add_item(keymap, "WM_OT_read_homefile", NKEY, KM_PRESS, KM_CTRL, 0);
WM_keymap_add_item(keymap, "WM_OT_read_homefile", XKEY, KM_PRESS, KM_CTRL, 0);
WM_keymap_add_item(keymap, "WM_OT_read_homefile", NKEY, KM_PRESS, KM_OSKEY, 0);
WM_keymap_add_item(keymap, "WM_OT_save_homefile", UKEY, KM_PRESS, KM_CTRL, 0);
WM_keymap_add_item(keymap, "WM_OT_save_homefile", UKEY, KM_PRESS, KM_OSKEY, 0);
WM_keymap_add_item(keymap, "WM_OT_open_recentfile", OKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0);
WM_keymap_add_item(keymap, "WM_OT_open_recentfile", OKEY, KM_PRESS, KM_SHIFT|KM_OSKEY, 0);
WM_keymap_add_item(keymap, "WM_OT_open_mainfile", OKEY, KM_PRESS, KM_CTRL, 0);
WM_keymap_add_item(keymap, "WM_OT_open_mainfile", OKEY, KM_PRESS, KM_OSKEY, 0);
// WM_keymap_add_item(keymap, "WM_OT_open_mainfile", OKEY, KM_PRESS, KM_CTRL, 0);
WM_keymap_add_item(keymap, "WM_OT_open_mainfile", F1KEY, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "WM_OT_save_mainfile", SKEY, KM_PRESS, KM_CTRL, 0);
WM_keymap_add_item(keymap, "WM_OT_save_mainfile", SKEY, KM_PRESS, KM_OSKEY, 0);
WM_keymap_add_item(keymap, "WM_OT_open_mainfile", OKEY, KM_PRESS, KM_OSKEY, 0);
// WM_keymap_add_item(keymap, "WM_OT_save_mainfile", SKEY, KM_PRESS, KM_CTRL, 0);
WM_keymap_add_item(keymap, "WM_OT_save_mainfile", WKEY, KM_PRESS, KM_CTRL, 0);
WM_keymap_add_item(keymap, "WM_OT_save_as_mainfile", SKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0);
WM_keymap_add_item(keymap, "WM_OT_save_as_mainfile", SKEY, KM_PRESS, KM_SHIFT|KM_OSKEY, 0);
WM_keymap_add_item(keymap, "WM_OT_save_mainfile", SKEY, KM_PRESS, KM_OSKEY, 0);
// WM_keymap_add_item(keymap, "WM_OT_save_as_mainfile", SKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0);
WM_keymap_add_item(keymap, "WM_OT_save_as_mainfile", F2KEY, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "WM_OT_save_as_mainfile", SKEY, KM_PRESS, KM_SHIFT|KM_OSKEY, 0);
WM_keymap_verify_item(keymap, "WM_OT_window_fullscreen_toggle", F11KEY, KM_PRESS, KM_SHIFT, 0);
WM_keymap_verify_item(keymap, "WM_OT_exit_blender", QKEY, KM_PRESS, KM_CTRL, 0);

@ -261,6 +261,34 @@ IF(WITH_INSTALL)
COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\xvidcore.dll\" \"${TARGETDIR}\\\"
)
ENDIF(WITH_FFMPEG)
IF(WITH_SNDFILE)
ADD_CUSTOM_COMMAND(TARGET blender
POST_BUILD
MAIN_DEPENDENCY blender
COMMAND copy /Y \"${WIN_LIBDIR}\\sndfile\\lib\\libsndfile-1.dll\" \"${TARGETDIR}\\\"
)
ENDIF(WITH_SNDFILE)
IF(WITH_JACK)
ADD_CUSTOM_COMMAND(TARGET blender
POST_BUILD
MAIN_DEPENDENCY blender
COMMAND copy /Y \"${WIN_LIBDIR}\\jack\\lib\\libjack.dll\" \"${TARGETDIR}\\\"
)
ENDIF(WITH_JACK)
IF(WITH_OPENAL)
ADD_CUSTOM_COMMAND(TARGET blender
POST_BUILD
MAIN_DEPENDENCY blender
COMMAND copy /Y \"${WIN_LIBDIR}\\openal\\lib\\OpenAL32.dll\" \"${TARGETDIR}\\\"
COMMAND copy /Y \"${WIN_LIBDIR}\\openal\\lib\\wrap_oal.dll\" \"${TARGETDIR}\\\"
)
ENDIF(WITH_OPENAL)
ENDIF(WIN32)
ENDIF(WITH_INSTALL)

@ -2485,10 +2485,10 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
}
}
if (occlusion)
kxscene->SetDbvtOcclusionRes(blenderscene->world->occlusionRes);
kxscene->SetDbvtOcclusionRes(blenderscene->gm.occlusionRes);
}
if (blenderscene->world)
kxscene->GetPhysicsEnvironment()->setNumTimeSubSteps(blenderscene->world->physubstep);
kxscene->GetPhysicsEnvironment()->setNumTimeSubSteps(blenderscene->gm.physubstep);
// now that the scenegraph is complete, let's instantiate the deformers.
// We need that to create reusable derived mesh and physic shapes

@ -536,6 +536,7 @@ void BL_ConvertSensors(struct Object* blenderobject,
starty,
keytype,
trackfocus,
(bmouse->flag & SENS_MOUSE_FOCUS_PULSE) ? true:false,
kxscene,
kxengine,
gameobj);

@ -40,16 +40,17 @@ class SCA_PropertyEventManager : public SCA_EventManager
class SCA_LogicManager* m_logicmgr;
public:
#ifdef WITH_CXX_GUARDEDALLOC
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_PropertyEventManager"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
SCA_PropertyEventManager(class SCA_LogicManager* logicmgr);
virtual ~SCA_PropertyEventManager();
virtual void NextFrame();
//SCA_LogicManager* GetLogicManager() { return m_logicmgr;}
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_PropertyEventManager"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif //__KX_PROPERTYEVENTMANAGER

@ -382,12 +382,12 @@ void KX_KetsjiEngine::StartEngine(bool clearIpo)
m_firstframe = true;
m_bInitialized = true;
// there is always one scene enabled at startup
World* world = m_scenes[0]->GetBlenderScene()->world;
if (world)
Scene* scene = m_scenes[0]->GetBlenderScene();
if (scene)
{
m_ticrate = world->ticrate ? world->ticrate : DEFAULT_LOGIC_TIC_RATE;
m_maxLogicFrame = world->maxlogicstep ? world->maxlogicstep : 5;
m_maxPhysicsFrame = world->maxphystep ? world->maxlogicstep : 5;
m_ticrate = scene->gm.ticrate ? scene->gm.ticrate : DEFAULT_LOGIC_TIC_RATE;
m_maxLogicFrame = scene->gm.maxlogicstep ? scene->gm.maxlogicstep : 5;
m_maxPhysicsFrame = scene->gm.maxphystep ? scene->gm.maxlogicstep : 5;
}
else
{

@ -61,11 +61,13 @@ KX_MouseFocusSensor::KX_MouseFocusSensor(SCA_MouseManager* eventmgr,
int starty,
short int mousemode,
int focusmode,
bool bTouchPulse,
KX_Scene* kxscene,
KX_KetsjiEngine *kxengine,
SCA_IObject* gameobj)
: SCA_MouseSensor(eventmgr, startx, starty, mousemode, gameobj),
m_focusmode(focusmode),
m_bTouchPulse(bTouchPulse),
m_kxscene(kxscene),
m_kxengine(kxengine)
{
@ -77,6 +79,7 @@ void KX_MouseFocusSensor::Init()
m_mouse_over_in_previous_frame = (m_invert)?true:false;
m_positive_event = false;
m_hitObject = 0;
m_hitObject_Last = NULL;
m_reset = true;
m_hitPosition.setValue(0,0,0);
@ -108,6 +111,9 @@ bool KX_MouseFocusSensor::Evaluate()
if (!m_mouse_over_in_previous_frame) {
result = true;
}
else if(m_bTouchPulse && (m_hitObject != m_hitObject_Last)) {
result = true;
}
}
if (reset) {
// force an event
@ -123,6 +129,7 @@ bool KX_MouseFocusSensor::Evaluate()
}
m_mouse_over_in_previous_frame = obHasFocus;
m_hitObject_Last = (void *)m_hitObject;
return result;
}
@ -378,6 +385,7 @@ PyAttributeDef KX_MouseFocusSensor::Attributes[] = {
KX_PYATTRIBUTE_RO_FUNCTION("hitObject", KX_MouseFocusSensor, pyattr_get_hit_object),
KX_PYATTRIBUTE_RO_FUNCTION("hitPosition", KX_MouseFocusSensor, pyattr_get_hit_position),
KX_PYATTRIBUTE_RO_FUNCTION("hitNormal", KX_MouseFocusSensor, pyattr_get_hit_normal),
KX_PYATTRIBUTE_BOOL_RW("usePulseFocus", KX_MouseFocusSensor,m_bTouchPulse),
{ NULL } //Sentinel
};

@ -49,11 +49,12 @@ class KX_MouseFocusSensor : public SCA_MouseSensor
public:
KX_MouseFocusSensor(class SCA_MouseManager* keybdmgr,
KX_MouseFocusSensor(class SCA_MouseManager* eventmgr,
int startx,
int starty,
short int mousemode,
int focusmode,
bool bTouchPulse,
KX_Scene* kxscene,
KX_KetsjiEngine* kxengine,
SCA_IObject* gameobj);
@ -107,6 +108,7 @@ class KX_MouseFocusSensor : public SCA_MouseSensor
/* --------------------------------------------------------------------- */
SCA_IObject* m_hitObject;
void* m_hitObject_Last; /* only use for comparison, never access */
private:
/**
@ -119,6 +121,11 @@ class KX_MouseFocusSensor : public SCA_MouseSensor
*/
bool m_mouse_over_in_previous_frame;
/**
* Flags whether changes in hit object should trigger a pulse
*/
bool m_bTouchPulse;
/**
* Flags whether the previous test evaluated positive.
*/

@ -2419,6 +2419,8 @@ class KX_MouseFocusSensor(SCA_MouseSensor):
@type hitPosition: list (vector of 3 floats)
@ivar hitNormal: the worldspace normal from the face at point of intersection.
@type hitNormal: list (normalized vector of 3 floats)
@ivar usePulseFocus: When enabled, moving the mouse over a different object generates a pulse. (only used when the 'Mouse Over Any' sensor option is set)
@type usePulseFocus: bool
"""
#{ Deprecated
def getHitNormal():
@ -2480,7 +2482,7 @@ class KX_TouchSensor(SCA_ISensor):
@ivar useMaterial: Determines if the sensor is looking for a property or material.
KX_True = Find material; KX_False = Find property
@type useMaterial: boolean
@ivar usePulseCollision: The last collided object.
@ivar usePulseCollision: When enabled, changes to the set of colliding objects generate a pulse.
@type usePulseCollision: bool
@ivar hitObject: The last collided object. (read-only)
@type hitObject: L{KX_GameObject} or None