svn merge -r37793:37865 https://svn.blender.org/svnroot/bf-blender/trunk/blender
Merge info was /trunk/blender:36835-37793,37865-38157 so this should merge in missing files.
This commit is contained in:
@@ -19,7 +19,9 @@
|
||||
# <pep8 compliant>
|
||||
|
||||
import bpy
|
||||
from bpy.props import StringProperty, BoolProperty, IntProperty, FloatProperty
|
||||
from bpy.props import StringProperty, BoolProperty, IntProperty, \
|
||||
FloatProperty, EnumProperty
|
||||
|
||||
from rna_prop_ui import rna_idprop_ui_prop_get, rna_idprop_ui_prop_clear
|
||||
|
||||
|
||||
@@ -457,6 +459,66 @@ doc_id = StringProperty(name="Doc ID",
|
||||
doc_new = StringProperty(name="Edit Description",
|
||||
description="", maxlen=1024, default="")
|
||||
|
||||
data_path_iter = StringProperty(
|
||||
description="The data path relative to the context, must point to an iterable.")
|
||||
|
||||
data_path_item = StringProperty(
|
||||
description="The data path from each iterable to the value (int or float)")
|
||||
|
||||
|
||||
class WM_OT_context_collection_boolean_set(bpy.types.Operator):
|
||||
'''Set boolean values for a collection of items'''
|
||||
bl_idname = "wm.context_collection_boolean_set"
|
||||
bl_label = "Context Collection Boolean Set"
|
||||
bl_options = {'UNDO', 'REGISTER', 'INTERNAL'}
|
||||
|
||||
data_path_iter = data_path_iter
|
||||
data_path_item = data_path_item
|
||||
|
||||
type = EnumProperty(items=(
|
||||
('TOGGLE', "Toggle", ""),
|
||||
('ENABLE', "Enable", ""),
|
||||
('DISABLE', "Disable", ""),
|
||||
),
|
||||
name="Type")
|
||||
|
||||
def execute(self, context):
|
||||
data_path_iter = self.data_path_iter
|
||||
data_path_item = self.data_path_item
|
||||
|
||||
items = list(getattr(context, data_path_iter))
|
||||
items_ok = []
|
||||
is_set = False
|
||||
for item in items:
|
||||
try:
|
||||
value_orig = eval("item." + data_path_item)
|
||||
except:
|
||||
continue
|
||||
|
||||
if value_orig == True:
|
||||
is_set = True
|
||||
elif value_orig == False:
|
||||
pass
|
||||
else:
|
||||
self.report({'WARNING'}, "Non boolean value found: %s[ ].%s" %
|
||||
(data_path_iter, data_path_item))
|
||||
return {'CANCELLED'}
|
||||
|
||||
items_ok.append(item)
|
||||
|
||||
if self.type == 'ENABLE':
|
||||
is_set = True
|
||||
elif self.type == 'DISABLE':
|
||||
is_set = False
|
||||
else:
|
||||
is_set = not is_set
|
||||
|
||||
exec_str = "item.%s = %s" % (data_path_item, is_set)
|
||||
for item in items_ok:
|
||||
exec(exec_str)
|
||||
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
class WM_OT_context_modal_mouse(bpy.types.Operator):
|
||||
'''Adjust arbitrary values with mouse input'''
|
||||
@@ -464,8 +526,9 @@ class WM_OT_context_modal_mouse(bpy.types.Operator):
|
||||
bl_label = "Context Modal Mouse"
|
||||
bl_options = {'GRAB_POINTER', 'BLOCKING', 'INTERNAL'}
|
||||
|
||||
data_path_iter = StringProperty(description="The data path relative to the context, must point to an iterable.")
|
||||
data_path_item = StringProperty(description="The data path from each iterable to the value (int or float)")
|
||||
data_path_iter = data_path_iter
|
||||
data_path_item = data_path_item
|
||||
|
||||
input_scale = FloatProperty(default=0.01, description="Scale the mouse movement by this value before applying the delta")
|
||||
invert = BoolProperty(default=False, description="Invert the mouse input")
|
||||
initial_x = IntProperty(options={'HIDDEN'})
|
||||
|
||||
@@ -884,7 +884,7 @@ class MATERIAL_PT_volume_lighting(VolumeButtonsPanel, bpy.types.Panel):
|
||||
sub = col.column()
|
||||
sub.enabled = True
|
||||
sub.active = False
|
||||
sub.prop(vol, "use_light_cache")
|
||||
sub.label("Light Cache Enabled")
|
||||
col.prop(vol, "cache_resolution")
|
||||
|
||||
sub = col.column(align=True)
|
||||
|
||||
@@ -1106,17 +1106,18 @@ class VIEW3D_MT_sculpt(bpy.types.Menu):
|
||||
layout.operator_menu_enum("brush.curve_preset", "shape")
|
||||
layout.separator()
|
||||
|
||||
sculpt_tool = brush.sculpt_tool
|
||||
if brush is not None: # unlikely but can happen
|
||||
sculpt_tool = brush.sculpt_tool
|
||||
|
||||
if sculpt_tool != 'GRAB':
|
||||
layout.prop_menu_enum(brush, "stroke_method")
|
||||
if sculpt_tool != 'GRAB':
|
||||
layout.prop_menu_enum(brush, "stroke_method")
|
||||
|
||||
if sculpt_tool in {'DRAW', 'PINCH', 'INFLATE', 'LAYER', 'CLAY'}:
|
||||
layout.prop_menu_enum(brush, "direction")
|
||||
if sculpt_tool in {'DRAW', 'PINCH', 'INFLATE', 'LAYER', 'CLAY'}:
|
||||
layout.prop_menu_enum(brush, "direction")
|
||||
|
||||
if sculpt_tool == 'LAYER':
|
||||
layout.prop(brush, "use_persistent")
|
||||
layout.operator("sculpt.set_persistent_base")
|
||||
if sculpt_tool == 'LAYER':
|
||||
layout.prop(brush, "use_persistent")
|
||||
layout.operator("sculpt.set_persistent_base")
|
||||
|
||||
layout.separator()
|
||||
layout.prop(sculpt, "use_threaded", text="Threaded Sculpt")
|
||||
@@ -1251,7 +1252,7 @@ class VIEW3D_MT_pose(bpy.types.Menu):
|
||||
layout.separator()
|
||||
|
||||
layout.menu("VIEW3D_MT_pose_showhide")
|
||||
layout.operator_menu_enum("pose.flags_set", 'mode', text="Bone Settings")
|
||||
layout.menu("VIEW3D_MT_bone_options_toggle", text="Bone Settings")
|
||||
|
||||
|
||||
class VIEW3D_MT_pose_transform(bpy.types.Menu):
|
||||
@@ -1372,6 +1373,49 @@ class VIEW3D_MT_pose_apply(bpy.types.Menu):
|
||||
layout.operator("pose.visual_transform_apply")
|
||||
|
||||
|
||||
class BoneOptions:
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
options = [
|
||||
"show_wire",
|
||||
"use_deform",
|
||||
"use_envelope_multiply",
|
||||
"use_inherit_rotation",
|
||||
"use_inherit_scale",
|
||||
]
|
||||
|
||||
if context.mode == 'EDIT_ARMATURE':
|
||||
bone_props = bpy.types.EditBone.bl_rna.properties
|
||||
data_path_iter = "selected_bones"
|
||||
opt_suffix = ""
|
||||
options.append("lock")
|
||||
else: # posemode
|
||||
bone_props = bpy.types.Bone.bl_rna.properties
|
||||
data_path_iter = "selected_pose_bones"
|
||||
opt_suffix = "bone."
|
||||
|
||||
for opt in options:
|
||||
props = layout.operator("wm.context_collection_boolean_set", text=bone_props[opt].name)
|
||||
props.data_path_iter = data_path_iter
|
||||
props.data_path_item = opt_suffix + opt
|
||||
props.type = self.type
|
||||
|
||||
|
||||
class VIEW3D_MT_bone_options_toggle(bpy.types.Menu, BoneOptions):
|
||||
bl_label = "Toggle Bone Options"
|
||||
type = 'TOGGLE'
|
||||
|
||||
|
||||
class VIEW3D_MT_bone_options_enable(bpy.types.Menu, BoneOptions):
|
||||
bl_label = "Enable Bone Options"
|
||||
type = 'ENABLE'
|
||||
|
||||
|
||||
class VIEW3D_MT_bone_options_disable(bpy.types.Menu, BoneOptions):
|
||||
bl_label = "Disable Bone Options"
|
||||
type = 'DISABLE'
|
||||
|
||||
# ********** Edit Menus, suffix from ob.type **********
|
||||
|
||||
|
||||
@@ -1965,7 +2009,7 @@ class VIEW3D_MT_edit_armature(bpy.types.Menu):
|
||||
|
||||
layout.separator()
|
||||
|
||||
layout.operator_menu_enum("armature.flags_set", "mode", text="Bone Settings")
|
||||
layout.menu("VIEW3D_MT_bone_options_toggle", text="Bone Settings")
|
||||
|
||||
|
||||
class VIEW3D_MT_armature_specials(bpy.types.Menu):
|
||||
|
||||
@@ -999,7 +999,11 @@ class VIEW3D_PT_tools_brush_appearance(PaintPanel, bpy.types.Panel):
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return (context.sculpt_object and context.tool_settings.sculpt) or (context.vertex_paint_object and context.tool_settings.vertex_paint) or (context.weight_paint_object and context.tool_settings.weight_paint) or (context.image_paint_object and context.tool_settings.image_paint)
|
||||
ts = context.tool_settings
|
||||
return ((context.sculpt_object and ts.sculpt) or
|
||||
(context.vertex_paint_object and ts.vertex_paint) or
|
||||
(context.weight_paint_object and ts.weight_paint) or
|
||||
(context.image_paint_object and ts.image_paint))
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@@ -1007,6 +1011,10 @@ class VIEW3D_PT_tools_brush_appearance(PaintPanel, bpy.types.Panel):
|
||||
settings = __class__.paint_settings(context)
|
||||
brush = settings.brush
|
||||
|
||||
if brush is None: # unlikely but can happen
|
||||
layout.label(text="Brush Unset")
|
||||
return
|
||||
|
||||
col = layout.column()
|
||||
|
||||
if context.sculpt_object and context.tool_settings.sculpt:
|
||||
|
||||
Reference in New Issue
Block a user