Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2013-01-27 03:49:13 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2013-01-27 03:49:13 +0400
commit556912792ad3c37c294256a558c96b39f264e7b5 (patch)
tree9b6ee8cf1ad92ee89c04f27a89be11599c5b40c0 /release/scripts/startup
parent9251d628db0abe599d927d79170025d8545c8ace (diff)
parentc84383301c5a2582e95259a7e4468a23a3566401 (diff)
Merged changes in the trunk up to revision 54110.
Conflicts resolved: source/blender/blenfont/SConscript source/blender/blenkernel/intern/subsurf_ccg.c source/blender/makesdna/intern/makesdna.c source/blender/makesrna/intern/rna_scene.c
Diffstat (limited to 'release/scripts/startup')
-rw-r--r--release/scripts/startup/bl_operators/__init__.py1
-rw-r--r--release/scripts/startup/bl_operators/node.py4
-rw-r--r--release/scripts/startup/bl_operators/object.py26
-rw-r--r--release/scripts/startup/bl_operators/object_align.py12
-rw-r--r--release/scripts/startup/bl_operators/object_quick_effects.py8
-rw-r--r--release/scripts/startup/bl_operators/object_randomize_transform.py8
-rw-r--r--release/scripts/startup/bl_operators/presets.py12
-rw-r--r--release/scripts/startup/bl_operators/rigidbody.py251
-rw-r--r--release/scripts/startup/bl_operators/uvcalc_follow_active.py15
-rw-r--r--release/scripts/startup/bl_operators/uvcalc_lightmap.py18
-rw-r--r--release/scripts/startup/bl_operators/wm.py23
-rw-r--r--release/scripts/startup/bl_ui/__init__.py3
-rw-r--r--release/scripts/startup/bl_ui/properties_data_mesh.py4
-rw-r--r--release/scripts/startup/bl_ui/properties_data_modifier.py56
-rw-r--r--release/scripts/startup/bl_ui/properties_game.py5
-rw-r--r--release/scripts/startup/bl_ui/properties_mask_common.py6
-rw-r--r--release/scripts/startup/bl_ui/properties_object.py1
-rw-r--r--release/scripts/startup/bl_ui/properties_object_constraint.py1
-rw-r--r--release/scripts/startup/bl_ui/properties_paint_common.py44
-rw-r--r--release/scripts/startup/bl_ui/properties_physics_common.py35
-rw-r--r--release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py2
-rw-r--r--release/scripts/startup/bl_ui/properties_physics_rigidbody.py133
-rw-r--r--release/scripts/startup/bl_ui/properties_physics_rigidbody_constraint.py208
-rw-r--r--release/scripts/startup/bl_ui/properties_physics_smoke.py24
-rw-r--r--release/scripts/startup/bl_ui/properties_render.py3
-rw-r--r--release/scripts/startup/bl_ui/properties_scene.py200
-rw-r--r--release/scripts/startup/bl_ui/properties_texture.py39
-rw-r--r--release/scripts/startup/bl_ui/space_clip.py18
-rw-r--r--release/scripts/startup/bl_ui/space_dopesheet.py4
-rw-r--r--release/scripts/startup/bl_ui/space_image.py5
-rw-r--r--release/scripts/startup/bl_ui/space_info.py7
-rw-r--r--release/scripts/startup/bl_ui/space_text.py2
-rw-r--r--release/scripts/startup/bl_ui/space_time.py1
-rw-r--r--release/scripts/startup/bl_ui/space_userpref.py38
-rw-r--r--release/scripts/startup/bl_ui/space_view3d.py37
-rw-r--r--release/scripts/startup/bl_ui/space_view3d_toolbar.py35
36 files changed, 1071 insertions, 218 deletions
diff --git a/release/scripts/startup/bl_operators/__init__.py b/release/scripts/startup/bl_operators/__init__.py
index c12b0b00f54..64851a3a4c1 100644
--- a/release/scripts/startup/bl_operators/__init__.py
+++ b/release/scripts/startup/bl_operators/__init__.py
@@ -35,6 +35,7 @@ _modules = [
"object_randomize_transform",
"object_quick_effects",
"presets",
+ "rigidbody",
"screen_play_rendered_anim",
"sequencer",
"uvcalc_follow_active",
diff --git a/release/scripts/startup/bl_operators/node.py b/release/scripts/startup/bl_operators/node.py
index 39e00f94953..bc0224db765 100644
--- a/release/scripts/startup/bl_operators/node.py
+++ b/release/scripts/startup/bl_operators/node.py
@@ -22,6 +22,7 @@ import bpy
from bpy.types import Operator
from bpy.props import BoolProperty, EnumProperty, StringProperty
+
# Base class for node 'Add' operators
class NodeAddOperator():
@staticmethod
@@ -78,8 +79,9 @@ class NODE_OT_add_node(NodeAddOperator, Operator):
use_transform = BoolProperty(
name="Use Transform",
description="Start transform operator after inserting the node",
- default = False,
+ default=False,
)
+
def execute(self, context):
node = self.create_node(context, self.type)
diff --git a/release/scripts/startup/bl_operators/object.py b/release/scripts/startup/bl_operators/object.py
index 9e449f325d6..567ea830409 100644
--- a/release/scripts/startup/bl_operators/object.py
+++ b/release/scripts/startup/bl_operators/object.py
@@ -110,6 +110,12 @@ class SelectCamera(Operator):
bl_label = "Select Camera"
bl_options = {'REGISTER', 'UNDO'}
+ extend = BoolProperty(
+ name="Extend",
+ description="Extend the selection",
+ default=False
+ )
+
def execute(self, context):
scene = context.scene
view = context.space_data
@@ -123,6 +129,8 @@ class SelectCamera(Operator):
elif camera.name not in scene.objects:
self.report({'WARNING'}, "Active camera is not in this scene")
else:
+ if not self.extend:
+ bpy.ops.object.select_all(action='DESELECT')
context.scene.objects.active = camera
camera.select = True
return {'FINISHED'}
@@ -297,7 +305,7 @@ class ShapeTransfer(Operator):
('RELATIVE_EDGE',
"Relative Edge",
"Calculate relative position (using edges)",
- ),
+ ),
),
name="Transformation Mode",
description="Relative shape positions to the new shape method",
@@ -674,7 +682,7 @@ class TransformsToDeltasAnim(Operator):
"scale" : "delta_scale"
}
DELTA_PATHS = STANDARD_TO_DELTA_PATHS.values()
-
+
# try to apply on each selected object
success = False
for obj in context.selected_editable_objects:
@@ -684,7 +692,7 @@ class TransformsToDeltasAnim(Operator):
"No animation data to convert on object: %r" %
obj.name)
continue
-
+
# first pass over F-Curves: ensure that we don't have conflicting
# transforms already (e.g. if this was applied already) [#29110]
existingFCurves = {}
@@ -700,7 +708,7 @@ class TransformsToDeltasAnim(Operator):
else:
# non-transform - ignore
continue
-
+
# a delta path like this for the same index shouldn't
# exist already, otherwise we've got a conflict
if dpath in existingFCurves:
@@ -708,8 +716,9 @@ class TransformsToDeltasAnim(Operator):
if fcu.array_index in existingFCurves[dpath]:
# conflict
self.report({'ERROR'},
- "Object '%r' already has '%r' F-Curve(s). Remove these before trying again" %
- (obj.name, dpath))
+ "Object '%r' already has '%r' F-Curve(s). "
+ "Remove these before trying again" %
+ (obj.name, dpath))
return {'CANCELLED'}
else:
# no conflict here
@@ -717,8 +726,7 @@ class TransformsToDeltasAnim(Operator):
else:
# no conflict yet
existingFCurves[dpath] = [fcu.array_index]
-
-
+
# if F-Curve uses standard transform path
# just append "delta_" to this path
for fcu in adt.action.fcurves:
@@ -758,7 +766,7 @@ class DupliOffsetFromCursor(Operator):
@classmethod
def poll(cls, context):
- return context.active_object is not None
+ return (context.active_object is not None)
def execute(self, context):
scene = context.scene
diff --git a/release/scripts/startup/bl_operators/object_align.py b/release/scripts/startup/bl_operators/object_align.py
index a32bb8c5353..dd647733850 100644
--- a/release/scripts/startup/bl_operators/object_align.py
+++ b/release/scripts/startup/bl_operators/object_align.py
@@ -114,14 +114,15 @@ def GlobalBB_HQ(obj):
return Vector((left, front, up)), Vector((right, back, down))
-def align_objects(align_x,
+def align_objects(context,
+ align_x,
align_y,
align_z,
align_mode,
relative_to,
bb_quality):
- cursor = bpy.context.scene.cursor_location
+ cursor = context.scene.cursor_location
Left_Front_Up_SEL = [0.0, 0.0, 0.0]
Right_Back_Down_SEL = [0.0, 0.0, 0.0]
@@ -130,7 +131,7 @@ def align_objects(align_x,
objs = []
- for obj in bpy.context.selected_objects:
+ for obj in context.selected_objects:
matrix_world = obj.matrix_world.copy()
bb_world = [matrix_world * Vector(v[:]) for v in obj.bound_box]
objs.append((obj, bb_world))
@@ -150,7 +151,7 @@ def align_objects(align_x,
# Active Center
- if obj == bpy.context.active_object:
+ if obj == context.active_object:
center_active_x = (Left_Front_Up[0] + Right_Back_Down[0]) / 2.0
center_active_y = (Left_Front_Up[1] + Right_Back_Down[1]) / 2.0
@@ -386,7 +387,8 @@ class AlignObjects(Operator):
def execute(self, context):
align_axis = self.align_axis
- ret = align_objects('X' in align_axis,
+ ret = align_objects(context,
+ 'X' in align_axis,
'Y' in align_axis,
'Z' in align_axis,
self.align_mode,
diff --git a/release/scripts/startup/bl_operators/object_quick_effects.py b/release/scripts/startup/bl_operators/object_quick_effects.py
index cd0b63a6b78..47012f0c459 100644
--- a/release/scripts/startup/bl_operators/object_quick_effects.py
+++ b/release/scripts/startup/bl_operators/object_quick_effects.py
@@ -72,7 +72,7 @@ class QuickFur(Operator):
)
def execute(self, context):
- fake_context = bpy.context.copy()
+ fake_context = context.copy()
mesh_objects = [obj for obj in context.selected_objects
if obj.type == 'MESH']
@@ -161,7 +161,7 @@ class QuickExplode(Operator):
)
def execute(self, context):
- fake_context = bpy.context.copy()
+ fake_context = context.copy()
obj_act = context.active_object
if obj_act is None or obj_act.type != 'MESH':
@@ -311,7 +311,7 @@ class QuickSmoke(Operator):
)
def execute(self, context):
- fake_context = bpy.context.copy()
+ fake_context = context.copy()
mesh_objects = [obj for obj in context.selected_objects
if obj.type == 'MESH']
min_co = Vector((100000.0, 100000.0, 100000.0))
@@ -432,7 +432,7 @@ class QuickFluid(Operator):
)
def execute(self, context):
- fake_context = bpy.context.copy()
+ fake_context = context.copy()
mesh_objects = [obj for obj in context.selected_objects
if (obj.type == 'MESH' and not 0.0 in obj.dimensions)]
min_co = Vector((100000, 100000, 100000))
diff --git a/release/scripts/startup/bl_operators/object_randomize_transform.py b/release/scripts/startup/bl_operators/object_randomize_transform.py
index a6efc9dfd85..38110328603 100644
--- a/release/scripts/startup/bl_operators/object_randomize_transform.py
+++ b/release/scripts/startup/bl_operators/object_randomize_transform.py
@@ -23,7 +23,8 @@ from bpy.types import Operator
from mathutils import Vector
-def randomize_selected(seed, delta, loc, rot, scale, scale_even, scale_min):
+def randomize_selected(context, seed, delta,
+ loc, rot, scale, scale_even, scale_min):
import random
from random import uniform
@@ -33,7 +34,7 @@ def randomize_selected(seed, delta, loc, rot, scale, scale_even, scale_min):
def rand_vec(vec_range):
return Vector(uniform(-val, val) for val in vec_range)
- for obj in bpy.context.selected_objects:
+ for obj in context.selected_objects:
if loc:
if delta:
@@ -180,6 +181,7 @@ class RandomizeLocRotSize(Operator):
#scale_min = self.scale_min
scale_min = 0
- randomize_selected(seed, delta, loc, rot, scale, scale_even, scale_min)
+ randomize_selected(context, seed, delta,
+ loc, rot, scale, scale_even, scale_min)
return {'FINISHED'}
diff --git a/release/scripts/startup/bl_operators/presets.py b/release/scripts/startup/bl_operators/presets.py
index ee9769d8b43..dac7adecaff 100644
--- a/release/scripts/startup/bl_operators/presets.py
+++ b/release/scripts/startup/bl_operators/presets.py
@@ -320,13 +320,13 @@ class AddPresetFluid(AddPresetBase, Operator):
preset_menu = "FLUID_MT_presets"
preset_defines = [
- "fluid = bpy.context.fluid"
- ]
+ "fluid = bpy.context.fluid"
+ ]
preset_values = [
- "fluid.settings.viscosity_base",
- "fluid.settings.viscosity_exponent",
- ]
+ "fluid.settings.viscosity_base",
+ "fluid.settings.viscosity_exponent",
+ ]
preset_subdir = "fluid"
@@ -477,7 +477,7 @@ class AddPresetNodeColor(AddPresetBase, Operator):
class AddPresetInterfaceTheme(AddPresetBase, Operator):
"""Add a theme preset"""
bl_idname = "wm.interface_theme_preset_add"
- bl_label = "Add Tracking Settings Preset"
+ bl_label = "Add Theme Preset"
preset_menu = "USERPREF_MT_interface_theme_presets"
preset_subdir = "interface_theme"
diff --git a/release/scripts/startup/bl_operators/rigidbody.py b/release/scripts/startup/bl_operators/rigidbody.py
new file mode 100644
index 00000000000..bad86163932
--- /dev/null
+++ b/release/scripts/startup/bl_operators/rigidbody.py
@@ -0,0 +1,251 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+# <pep8-80 compliant>
+
+import bpy
+from bpy.types import Operator
+from bpy.props import IntProperty
+from bpy.props import EnumProperty
+
+
+class CopyRigidbodySettings(Operator):
+ '''Copy Rigid Body settings from active object to selected'''
+ bl_idname = "rigidbody.object_settings_copy"
+ bl_label = "Copy Rigidbody Settings"
+ bl_options = {'REGISTER', 'UNDO'}
+
+ @classmethod
+ def poll(cls, context):
+ obj = context.object
+ return (obj and obj.rigid_body)
+
+ def execute(self, context):
+ obj = context.object
+ scn = context.scene
+
+ # deselect all but mesh objects
+ for o in context.selected_objects:
+ if o.type != 'MESH':
+ o.select = False
+
+ sel = context.selected_objects
+ if sel:
+ # add selected objects to active one groups and recalculate
+ bpy.ops.group.objects_add_active()
+ scn.frame_set(scn.frame_current)
+
+ # copy settings
+ for o in sel:
+ if o.rigid_body is None:
+ continue
+
+ o.rigid_body.type = obj.rigid_body.type
+ o.rigid_body.kinematic = obj.rigid_body.kinematic
+ o.rigid_body.mass = obj.rigid_body.mass
+ o.rigid_body.collision_shape = obj.rigid_body.collision_shape
+ o.rigid_body.use_margin = obj.rigid_body.use_margin
+ o.rigid_body.collision_margin = obj.rigid_body.collision_margin
+ o.rigid_body.friction = obj.rigid_body.friction
+ o.rigid_body.restitution = obj.rigid_body.restitution
+ o.rigid_body.use_deactivation = obj.rigid_body.use_deactivation
+ o.rigid_body.start_deactivated = obj.rigid_body.start_deactivated
+ o.rigid_body.deactivate_linear_velocity = obj.rigid_body.deactivate_linear_velocity
+ o.rigid_body.deactivate_angular_velocity = obj.rigid_body.deactivate_angular_velocity
+ o.rigid_body.linear_damping = obj.rigid_body.linear_damping
+ o.rigid_body.angular_damping = obj.rigid_body.angular_damping
+ o.rigid_body.collision_groups = obj.rigid_body.collision_groups
+
+ return {'FINISHED'}
+
+
+class BakeToKeyframes(Operator):
+ '''Bake rigid body transformations of selected objects to keyframes'''
+ bl_idname = "rigidbody.bake_to_keyframes"
+ bl_label = "Bake To Keyframes"
+ bl_options = {'REGISTER', 'UNDO'}
+
+ frame_start = IntProperty(
+ name="Start Frame",
+ description="Start frame for baking",
+ min=0, max=300000,
+ default=1,
+ )
+ frame_end = IntProperty(
+ name="End Frame",
+ description="End frame for baking",
+ min=1, max=300000,
+ default=250,
+ )
+ step = IntProperty(
+ name="Frame Step",
+ description="Frame Step",
+ min=1, max=120,
+ default=1,
+ )
+
+ @classmethod
+ def poll(cls, context):
+ obj = context.object
+ return (obj and obj.rigid_body)
+
+ def execute(self, context):
+ bake = []
+ objs = []
+ scene = context.scene
+ frame_orig = scene.frame_current
+ frames = list(range(self.frame_start, self.frame_end + 1, self.step))
+
+ # filter objects selection
+ for obj in context.selected_objects:
+ if not obj.rigid_body or obj.rigid_body.type != 'ACTIVE':
+ obj.select = False
+
+ objs = context.selected_objects
+
+ if objs:
+ # store transformation data
+ for f in list(range(self.frame_start, self.frame_end + 1)):
+ scene.frame_set(f)
+ if f in frames:
+ mat = {}
+ for i, obj in enumerate(objs):
+ mat[i] = obj.matrix_world.copy()
+ bake.append(mat)
+
+ # apply transformations as keyframes
+ for i, f in enumerate(frames):
+ scene.frame_set(f)
+ obj_prev = objs[0]
+ for j, obj in enumerate(objs):
+ mat = bake[i][j]
+
+ obj.location = mat.to_translation()
+
+ rot_mode = obj.rotation_mode
+ if rot_mode == 'QUATERNION':
+ obj.rotation_quaternion = mat.to_quaternion()
+ elif rot_mode == 'AXIS_ANGLE':
+ # this is a little roundabout but there's no better way right now
+ aa = mat.to_quaternion().to_axis_angle()
+ obj.rotation_axis_angle = (aa[1], ) + aa[0][:]
+ else: # euler
+ # make sure euler rotation is compatible to previous frame
+ obj.rotation_euler = mat.to_euler(rot_mode, obj_prev.rotation_euler)
+
+ obj_prev = obj
+
+ bpy.ops.anim.keyframe_insert(type='BUILTIN_KSI_LocRot', confirm_success=False)
+
+ # remove baked objects from simulation
+ bpy.ops.rigidbody.objects_remove()
+
+ # clean up keyframes
+ for obj in objs:
+ action = obj.animation_data.action
+ for fcu in action.fcurves:
+ keyframe_points = fcu.keyframe_points
+ i = 1
+ # remove unneeded keyframes
+ while i < len(keyframe_points) - 1:
+ val_prev = keyframe_points[i - 1].co[1]
+ val_next = keyframe_points[i + 1].co[1]
+ val = keyframe_points[i].co[1]
+
+ if abs(val - val_prev) + abs(val - val_next) < 0.0001:
+ keyframe_points.remove(keyframe_points[i])
+ else:
+ i += 1
+ # use linear interpolation for better visual results
+ for keyframe in keyframe_points:
+ keyframe.interpolation = 'LINEAR'
+
+ # return to the frame we started on
+ scene.frame_set(frame_orig)
+
+ return {'FINISHED'}
+
+ def invoke(self, context, event):
+ scene = context.scene
+ self.frame_start = scene.frame_start
+ self.frame_end = scene.frame_end
+
+ wm = context.window_manager
+ return wm.invoke_props_dialog(self)
+
+
+class ConnectRigidBodies(Operator):
+
+
+ '''Connect selected rigid bodies to active'''
+ bl_idname = "rigidbody.connect"
+ bl_label = "ConnectRigidBodies"
+ bl_options = {'REGISTER', 'UNDO'}
+
+ con_type = EnumProperty(
+ name="Type",
+ description="Type of generated contraint",
+ items=(('FIXED', "Fixed", "Glues ridig bodies together"),
+ ('POINT', "Point", "Constrains rigid bodies to move aound common pivot point"),
+ ('HINGE', "Hinge", "Restricts rigid body rotation to one axis"),
+ ('SLIDER', "Slider", "Restricts rigid boddy translation to one axis"),
+ ('PISTON', "Piston", "Restricts rigid boddy translation and rotation to one axis"),
+ ('GENERIC', "Generic", "Restricts translation and rotation to specified axes"),
+ ('GENERIC_SPRING', "Generic Spring", "Restricts translation and rotation to specified axes with springs")),
+ default='FIXED',)
+
+ pivot_type = EnumProperty(
+ name="Location",
+ description="Constraint pivot location",
+ items=(('CENTER', "Center", "Pivot location is between the constrained rigid bodies"),
+ ('ACTIVE', "Active", "Pivot location is at the active object position"),
+ ('SELECTED', "Selected", "Pivot location is at the slected object position")),
+ default='CENTER',)
+
+ @classmethod
+ def poll(cls, context):
+ obj = context.object
+ objs = context.selected_objects
+ return (obj and obj.rigid_body and (len(objs) > 1))
+
+ def execute(self, context):
+
+ objs = context.selected_objects
+ obj_act = context.active_object
+
+ for obj in objs:
+ if obj == obj_act:
+ continue
+ if self.pivot_type == 'ACTIVE':
+ loc = obj_act.location
+ elif self.pivot_type == 'SELECTED':
+ loc = obj.location
+ else:
+ loc = (obj_act.location + obj.location) / 2.0
+ bpy.ops.object.add(type='EMPTY', view_align=False, enter_editmode=False, location=loc)
+ bpy.ops.rigidbody.constraint_add()
+ con = context.active_object.rigid_body_constraint
+ con.type = self.con_type
+ con.object1 = obj_act
+ con.object2 = obj
+
+ return {'FINISHED'}
+
+ def invoke(self, context, event):
+ wm = context.window_manager
+ return wm.invoke_props_dialog(self)
diff --git a/release/scripts/startup/bl_operators/uvcalc_follow_active.py b/release/scripts/startup/bl_operators/uvcalc_follow_active.py
index 7b6013f3044..ee3ae2878dc 100644
--- a/release/scripts/startup/bl_operators/uvcalc_follow_active.py
+++ b/release/scripts/startup/bl_operators/uvcalc_follow_active.py
@@ -26,18 +26,18 @@ from bpy.types import Operator
def extend(obj, operator, EXTEND_MODE):
-
+
import bmesh
me = obj.data
# script will fail without UVs
if not me.uv_textures:
me.uv_textures.new()
-
+
bm = bmesh.from_edit_mesh(me)
-
+
f_act = bm.faces.active
uv_act = bm.loops.layers.uv.active
-
+
if f_act is None:
operator.report({'ERROR'}, "No active face")
return
@@ -57,7 +57,7 @@ def extend(obj, operator, EXTEND_MODE):
f.tag = False
# tag the active face True since we begin there
f_act.tag = True
-
+
def walk_face(f):
# all faces in this list must be tagged
f.tag = True
@@ -102,7 +102,6 @@ def extend(obj, operator, EXTEND_MODE):
else:
break
-
def extrapolate_uv(fac,
l_a_outer, l_a_inner,
l_b_outer, l_b_inner):
@@ -112,7 +111,7 @@ def extend(obj, operator, EXTEND_MODE):
def apply_uv(f_prev, l_prev, f_next):
l_a = [None, None, None, None]
l_b = [None, None, None, None]
-
+
l_a[0] = l_prev
l_a[1] = l_a[0].link_loop_next
l_a[2] = l_a[1].link_loop_next
@@ -133,7 +132,7 @@ def extend(obj, operator, EXTEND_MODE):
# +-----------+
# copy from this face to the one above.
- # get the other loops
+ # get the other loops
l_next = l_prev.link_loop_radial_next
if l_next.vert != l_prev.vert:
l_b[1] = l_next
diff --git a/release/scripts/startup/bl_operators/uvcalc_lightmap.py b/release/scripts/startup/bl_operators/uvcalc_lightmap.py
index 198b3660ff8..b24a71365b4 100644
--- a/release/scripts/startup/bl_operators/uvcalc_lightmap.py
+++ b/release/scripts/startup/bl_operators/uvcalc_lightmap.py
@@ -189,14 +189,14 @@ class prettyface(object):
def lightmap_uvpack(meshes,
- PREF_SEL_ONLY=True,
- PREF_NEW_UVLAYER=False,
- PREF_PACK_IN_ONE=False,
- PREF_APPLY_IMAGE=False,
- PREF_IMG_PX_SIZE=512,
- PREF_BOX_DIV=8,
- PREF_MARGIN_DIV=512
- ):
+ PREF_SEL_ONLY=True,
+ PREF_NEW_UVLAYER=False,
+ PREF_PACK_IN_ONE=False,
+ PREF_APPLY_IMAGE=False,
+ PREF_IMG_PX_SIZE=512,
+ PREF_BOX_DIV=8,
+ PREF_MARGIN_DIV=512
+ ):
"""
BOX_DIV if the maximum division of the UV map that
a box may be consolidated into.
@@ -516,7 +516,7 @@ def lightmap_uvpack(meshes,
def unwrap(operator, context, **kwargs):
- is_editmode = (bpy.context.object.mode == 'EDIT')
+ is_editmode = (context.object.mode == 'EDIT')
if is_editmode:
bpy.ops.object.mode_set(mode='OBJECT', toggle=False)
diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py
index 00cc763c4e1..fa2cb5d5356 100644
--- a/release/scripts/startup/bl_operators/wm.py
+++ b/release/scripts/startup/bl_operators/wm.py
@@ -500,18 +500,16 @@ class WM_MT_context_menu_enum(Menu):
def draw(self, context):
data_path = self.data_path
- value = context_path_validate(bpy.context, data_path)
+ value = context_path_validate(context, data_path)
if value is Ellipsis:
return {'PASS_THROUGH'}
base_path, prop_string = data_path.rsplit(".", 1)
value_base = context_path_validate(context, base_path)
+ prop = value_base.bl_rna.properties[prop_string]
- values = [(i.name, i.identifier) for i in value_base.bl_rna.properties[prop_string].enum_items]
-
- for name, identifier in values:
- props = self.layout.operator("wm.context_set_enum", text=name)
- props.data_path = data_path
- props.value = identifier
+ layout = self.layout
+ layout.label(prop.name, icon=prop.icon)
+ layout.prop(value_base, prop_string, expand=True)
class WM_OT_context_menu_enum(Operator):
@@ -1255,13 +1253,6 @@ class WM_OT_copy_prev_settings(Operator):
else:
shutil.copytree(path_src, path_dst, symlinks=True)
- # in 2.57 and earlier windows installers, system scripts were copied
- # into the configuration directory, don't want to copy those
- system_script = os.path.join(path_dst, "scripts/modules/bpy_types.py")
- if os.path.isfile(system_script):
- shutil.rmtree(os.path.join(path_dst, "scripts"))
- shutil.rmtree(os.path.join(path_dst, "plugins"))
-
# don't loose users work if they open the splash later.
if bpy.data.is_saved is bpy.data.is_dirty is False:
bpy.ops.wm.read_homefile()
@@ -1596,7 +1587,7 @@ class WM_OT_addon_enable(Operator):
"version %d.%d.%d and might not "
"function (correctly), "
"though it is enabled") %
- info_ver)
+ info_ver)
return {'FINISHED'}
else:
return {'CANCELLED'}
@@ -1739,7 +1730,7 @@ class WM_OT_addon_install(Operator):
# don't use bpy.utils.script_paths("addons") because we may not be able to write to it.
path_addons = bpy.utils.user_resource('SCRIPTS', "addons", create=True)
else:
- path_addons = bpy.context.user_preferences.filepaths.script_directory
+ path_addons = context.user_preferences.filepaths.script_directory
if path_addons:
path_addons = os.path.join(path_addons, "addons")
diff --git a/release/scripts/startup/bl_ui/__init__.py b/release/scripts/startup/bl_ui/__init__.py
index 3a47b9d2d77..94f324d62d0 100644
--- a/release/scripts/startup/bl_ui/__init__.py
+++ b/release/scripts/startup/bl_ui/__init__.py
@@ -48,6 +48,8 @@ _modules = (
"properties_physics_dynamicpaint",
"properties_physics_field",
"properties_physics_fluid",
+ "properties_physics_rigidbody",
+ "properties_physics_rigidbody_constraint",
"properties_physics_smoke",
"properties_physics_softbody",
"properties_render",
@@ -134,6 +136,7 @@ def register():
def unregister():
bpy.utils.unregister_module(__name__)
+
# Define a default UIList, when a list does not need any custom drawing...
class UI_UL_list(bpy.types.UIList):
pass
diff --git a/release/scripts/startup/bl_ui/properties_data_mesh.py b/release/scripts/startup/bl_ui/properties_data_mesh.py
index 5fdb71b855f..dcef5aaa096 100644
--- a/release/scripts/startup/bl_ui/properties_data_mesh.py
+++ b/release/scripts/startup/bl_ui/properties_data_mesh.py
@@ -34,7 +34,8 @@ class MESH_MT_vertex_group_specials(Menu):
layout.operator("object.vertex_group_copy_to_linked", icon='LINK_AREA')
layout.operator("object.vertex_group_copy_to_selected", icon='LINK_AREA')
layout.operator("object.vertex_group_mirror", icon='ARROW_LEFTRIGHT')
- layout.operator("object.vertex_group_remove", icon='X', text="Delete All").all = True
+ layout.operator("object.vertex_group_remove", icon='X', text="Delete All Vertex Groups").all = True
+ layout.operator("object.vertex_group_remove_from", icon='X', text="Remove Selected from All Vertex Groups").all = True
layout.separator()
layout.operator("object.vertex_group_lock", icon='LOCKED', text="Lock All").action = 'LOCK'
layout.operator("object.vertex_group_lock", icon='UNLOCKED', text="UnLock All").action = 'UNLOCK'
@@ -193,7 +194,6 @@ class DATA_PT_vertex_groups(MeshButtonsPanel, Panel):
row = layout.row()
row.template_list("MESH_UL_vgroups", "", ob, "vertex_groups", ob.vertex_groups, "active_index", rows=rows)
-
col = row.column(align=True)
col.operator("object.vertex_group_add", icon='ZOOMIN', text="")
col.operator("object.vertex_group_remove", icon='ZOOMOUT', text="").all = False
diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py
index df29f18853b..99f82b1e8a3 100644
--- a/release/scripts/startup/bl_ui/properties_data_modifier.py
+++ b/release/scripts/startup/bl_ui/properties_data_modifier.py
@@ -162,6 +162,44 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
sub.active = md.use_random_order
sub.prop(md, "seed")
+ def MESH_CACHE(self, layout, ob, md):
+ layout.prop(md, "cache_format")
+ layout.prop(md, "filepath")
+
+ layout.label(text="Evaluation:")
+ layout.prop(md, "factor", slider=True)
+ layout.prop(md, "deform_mode")
+ layout.prop(md, "interpolation")
+
+ layout.label(text="Time Mapping:")
+
+ row = layout.row()
+ row.prop(md, "time_mode", expand=True)
+ row = layout.row()
+ row.prop(md, "play_mode", expand=True)
+ if md.play_mode == 'SCENE':
+ layout.prop(md, "frame_start")
+ layout.prop(md, "frame_scale")
+ else:
+ time_mode = md.time_mode
+ if time_mode == 'FRAME':
+ layout.prop(md, "eval_frame")
+ elif time_mode == 'TIME':
+ layout.prop(md, "eval_time")
+ elif time_mode == 'FACTOR':
+ layout.prop(md, "eval_factor")
+
+ layout.label(text="Axis Mapping:")
+ split = layout.split(percentage=0.5, align=True)
+ split.alert = (md.forward_axis[-1] == md.up_axis[-1])
+ split.label("Forward/Up Axis:")
+ split.prop(md, "forward_axis", text="")
+ split.prop(md, "up_axis", text="")
+ split = layout.split(percentage=0.5)
+ split.label(text="Flip Axis:")
+ row = split.row()
+ row.prop(md, "flip_axis")
+
def CAST(self, layout, ob, md):
split = layout.split(percentage=0.25)
@@ -333,23 +371,24 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
def LAPLACIANSMOOTH(self, layout, ob, md):
layout.prop(md, "iterations")
-
+
split = layout.split(percentage=0.25)
-
+
col = split.column()
col.label(text="Axis:")
col.prop(md, "use_x")
col.prop(md, "use_y")
col.prop(md, "use_z")
-
+
col = split.column()
col.label(text="Lambda:")
col.prop(md, "lambda_factor", text="Factor")
col.prop(md, "lambda_border", text="Border")
-
+
col.separator()
col.prop(md, "use_volume_preserve")
-
+ col.prop(md, "use_normalized")
+
layout.label(text="Vertex Group:")
layout.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
@@ -558,7 +597,6 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
col = split.column()
-
def PARTICLE_INSTANCE(self, layout, ob, md):
layout.prop(md, "object")
layout.prop(md, "particle_system_index", text="Particle System")
@@ -1045,12 +1083,12 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
def UV_WARP(self, layout, ob, md):
split = layout.split()
col = split.column()
- col.prop(md, "center");
+ col.prop(md, "center")
col = split.column()
col.label(text="UV Axis:")
- col.prop(md, "axis_u", text="");
- col.prop(md, "axis_v", text="");
+ col.prop(md, "axis_u", text="")
+ col.prop(md, "axis_v", text="")
split = layout.split()
col = split.column()
diff --git a/release/scripts/startup/bl_ui/properties_game.py b/release/scripts/startup/bl_ui/properties_game.py
index 58b6aa6916c..a896855b217 100644
--- a/release/scripts/startup/bl_ui/properties_game.py
+++ b/release/scripts/startup/bl_ui/properties_game.py
@@ -199,6 +199,7 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel, Panel):
col = split.column()
col.prop(game, "collision_mask")
+
class PHYSICS_PT_game_collision_bounds(PhysicsButtonsPanel, Panel):
bl_label = "Collision Bounds"
COMPAT_ENGINES = {'BLENDER_GAME'}
@@ -411,10 +412,10 @@ class RENDER_PT_game_system(RenderButtonsPanel, Panel):
col = row.column()
col.prop(gs, "use_display_lists")
col.active = gs.raster_storage != 'VERTEX_BUFFER_OBJECT'
-
+
row = layout.row()
row.prop(gs, "raster_storage")
-
+
row = layout.row()
row.label("Exit Key")
row.prop(gs, "exit_key", text="", event=True)
diff --git a/release/scripts/startup/bl_ui/properties_mask_common.py b/release/scripts/startup/bl_ui/properties_mask_common.py
index 9861db39f30..3bdb6f32076 100644
--- a/release/scripts/startup/bl_ui/properties_mask_common.py
+++ b/release/scripts/startup/bl_ui/properties_mask_common.py
@@ -26,7 +26,8 @@ from bpy.types import Menu, UIList
class MASK_UL_layers(UIList):
- def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
+ def draw_item(self, context, layout, data, item, icon,
+ active_data, active_propname, index):
# assert(isinstance(item, bpy.types.MaskLayer)
mask = item
if self.layout_type in {'DEFAULT', 'COMPACT'}:
@@ -86,7 +87,8 @@ class MASK_PT_layers:
rows = 5 if active_layer else 2
row = layout.row()
- row.template_list("MASK_UL_layers", "", mask, "layers", mask, "active_layer_index", rows=rows)
+ row.template_list("MASK_UL_layers", "", mask, "layers",
+ mask, "active_layer_index", rows=rows)
sub = row.column(align=True)
diff --git a/release/scripts/startup/bl_ui/properties_object.py b/release/scripts/startup/bl_ui/properties_object.py
index 951807488e7..b9dcdc19162 100644
--- a/release/scripts/startup/bl_ui/properties_object.py
+++ b/release/scripts/startup/bl_ui/properties_object.py
@@ -230,6 +230,7 @@ class OBJECT_PT_display(ObjectButtonsPanel, Panel):
col.prop(ob, "show_x_ray", text="X-Ray")
if ob.type == 'MESH':
col.prop(ob, "show_transparent", text="Transparency")
+ col.prop(ob, "show_all_edges")
class OBJECT_PT_duplication(ObjectButtonsPanel, Panel):
diff --git a/release/scripts/startup/bl_ui/properties_object_constraint.py b/release/scripts/startup/bl_ui/properties_object_constraint.py
index eb0929895f8..6478e49f464 100644
--- a/release/scripts/startup/bl_ui/properties_object_constraint.py
+++ b/release/scripts/startup/bl_ui/properties_object_constraint.py
@@ -172,7 +172,6 @@ class ConstraintButtonsPanel():
sub.active = con.use_rotation
sub.prop(con, "orient_weight", text="Rotation", slider=True)
-
def IK_COPY_POSE(self, context, layout, con):
self.target_template(layout, con)
self.ik_template(layout, con)
diff --git a/release/scripts/startup/bl_ui/properties_paint_common.py b/release/scripts/startup/bl_ui/properties_paint_common.py
index 53cf640beb9..022f2500940 100644
--- a/release/scripts/startup/bl_ui/properties_paint_common.py
+++ b/release/scripts/startup/bl_ui/properties_paint_common.py
@@ -70,34 +70,40 @@ class UnifiedPaintPanel():
# Used in both the View3D toolbar and texture properties
-def sculpt_brush_texture_settings(layout, brush):
+def brush_texture_settings(layout, brush, sculpt):
tex_slot = brush.texture_slot
layout.label(text="Brush Mapping:")
# map_mode
- layout.row().prop(tex_slot, "map_mode", text="")
- layout.separator()
-
- # angle and texture_angle_source
- col = layout.column()
- col.active = brush.sculpt_capabilities.has_texture_angle_source
- col.label(text="Angle:")
- if brush.sculpt_capabilities.has_random_texture_angle:
- col.prop(brush, "texture_angle_source_random", text="")
+ if sculpt:
+ layout.row().prop(tex_slot, "map_mode", text="")
+ layout.separator()
else:
- col.prop(brush, "texture_angle_source_no_random", text="")
-
+ layout.row().prop(tex_slot, "tex_paint_map_mode", text="")
+ layout.separator()
+
+ # angle and texture_angle_source
col = layout.column()
- col.active = brush.sculpt_capabilities.has_texture_angle
- col.prop(tex_slot, "angle", text="")
+ if sculpt:
+ col.active = brush.sculpt_capabilities.has_texture_angle_source
+ col.label(text="Angle:")
+ if brush.sculpt_capabilities.has_random_texture_angle:
+ col.prop(brush, "texture_angle_source_random", text="")
+ else:
+ col.prop(brush, "texture_angle_source_no_random", text="")
+
+ col = layout.column()
+ col.active = brush.sculpt_capabilities.has_texture_angle
+ col.prop(tex_slot, "angle", text="")
# scale and offset
split = layout.split()
split.prop(tex_slot, "offset")
split.prop(tex_slot, "scale")
-
- # texture_sample_bias
- col = layout.column(align=True)
- col.label(text="Sample Bias:")
- col.prop(brush, "texture_sample_bias", slider=True, text="")
+
+ if sculpt:
+ # texture_sample_bias
+ col = layout.column(align=True)
+ col.label(text="Sample Bias:")
+ col.prop(brush, "texture_sample_bias", slider=True, text="")
diff --git a/release/scripts/startup/bl_ui/properties_physics_common.py b/release/scripts/startup/bl_ui/properties_physics_common.py
index b70ff322765..17a44a523dc 100644
--- a/release/scripts/startup/bl_ui/properties_physics_common.py
+++ b/release/scripts/startup/bl_ui/properties_physics_common.py
@@ -44,6 +44,12 @@ def physics_add(self, layout, md, name, type, typeicon, toggles):
else:
sub.operator("object.modifier_add", text=name, icon=typeicon).type = type
+def physics_add_special(self, layout, data, name, addop, removeop, typeicon):
+ sub = layout.row(align=True)
+ if data:
+ sub.operator(removeop, text=name, icon='X')
+ else:
+ sub.operator(addop, text=name, icon=typeicon)
class PHYSICS_PT_add(PhysicButtonsPanel, Panel):
bl_label = ""
@@ -76,6 +82,18 @@ class PHYSICS_PT_add(PhysicButtonsPanel, Panel):
physics_add(self, col, context.fluid, "Fluid", 'FLUID_SIMULATION', 'MOD_FLUIDSIM', True)
physics_add(self, col, context.smoke, "Smoke", 'SMOKE', 'MOD_SMOKE', True)
+ if(ob.type == 'MESH'):
+ physics_add_special(self, col, ob.rigid_body, "Rigid Body",
+ "rigidbody.object_add",
+ "rigidbody.object_remove",
+ 'MESH_ICOSPHERE') # XXX: need dedicated icon
+
+ # all types of objects can have rigid body constraint
+ physics_add_special(self, col, ob.rigid_body_constraint, "Rigid Body Constraint",
+ "rigidbody.constraint_add",
+ "rigidbody.constraint_remove",
+ 'CONSTRAINT') # RB_TODO needs better icon
+
# cache-type can be 'PSYS' 'HAIR' 'SMOKE' etc
@@ -84,11 +102,12 @@ def point_cache_ui(self, context, cache, enabled, cachetype):
layout.context_pointer_set("point_cache", cache)
- row = layout.row()
- row.template_list("UI_UL_list", "", cache, "point_caches", cache.point_caches, "active_index", rows=2)
- col = row.column(align=True)
- col.operator("ptcache.add", icon='ZOOMIN', text="")
- col.operator("ptcache.remove", icon='ZOOMOUT', text="")
+ if not cachetype == 'RIGID_BODY':
+ row = layout.row()
+ row.template_list("UI_UL_list", "", cache, "point_caches", cache.point_caches, "active_index", rows=2)
+ col = row.column(align=True)
+ col.operator("ptcache.add", icon='ZOOMIN', text="")
+ col.operator("ptcache.remove", icon='ZOOMOUT', text="")
row = layout.row()
if cachetype in {'PSYS', 'HAIR', 'SMOKE'}:
@@ -131,13 +150,13 @@ def point_cache_ui(self, context, cache, enabled, cachetype):
row.enabled = enabled
row.prop(cache, "frame_start")
row.prop(cache, "frame_end")
- if cachetype not in {'SMOKE', 'CLOTH', 'DYNAMIC_PAINT'}:
+ if cachetype not in {'SMOKE', 'CLOTH', 'DYNAMIC_PAINT', 'RIGID_BODY'}:
row.prop(cache, "frame_step")
-
+
if cachetype != 'SMOKE':
layout.label(text=cache.info)
- if cachetype not in {'SMOKE', 'DYNAMIC_PAINT'}:
+ if cachetype not in {'SMOKE', 'DYNAMIC_PAINT', 'RIGID_BODY'}:
split = layout.split()
split.enabled = enabled and bpy.data.is_saved
diff --git a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py
index 9393852b8a5..efc675ffe83 100644
--- a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py
+++ b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py
@@ -80,7 +80,7 @@ class PHYSICS_PT_dynamic_paint(PhysicButtonsPanel, Panel):
row = layout.row()
row.template_list("PHYSICS_UL_dynapaint_surfaces", "", canvas, "canvas_surfaces",
- canvas.canvas_surfaces, "active_index", rows=2)
+ canvas.canvas_surfaces, "active_index", rows=2)
col = row.column(align=True)
col.operator("dpaint.surface_slot_add", icon='ZOOMIN', text="")
diff --git a/release/scripts/startup/bl_ui/properties_physics_rigidbody.py b/release/scripts/startup/bl_ui/properties_physics_rigidbody.py
new file mode 100644
index 00000000000..f335c560f7b
--- /dev/null
+++ b/release/scripts/startup/bl_ui/properties_physics_rigidbody.py
@@ -0,0 +1,133 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+# <pep8 compliant>
+import bpy
+from bpy.types import Panel
+
+
+class PHYSICS_PT_rigidbody_panel():
+ bl_space_type = 'PROPERTIES'
+ bl_region_type = 'WINDOW'
+ bl_context = "physics"
+
+
+class PHYSICS_PT_rigid_body(PHYSICS_PT_rigidbody_panel, Panel):
+ bl_label = "Rigid Body"
+
+ @classmethod
+ def poll(cls, context):
+ ob = context.object
+ rd = context.scene.render
+ return (ob and ob.rigid_body and (not rd.use_game_engine))
+
+ def draw_header(self, context):
+ obj = context.object
+ rbo = obj.rigid_body
+ if rbo is not None:
+ self.layout.prop(rbo, "enabled", text="");
+
+ def draw(self, context):
+ layout = self.layout
+
+ ob = context.object
+ rbo = ob.rigid_body
+
+ if rbo is not None:
+ layout.prop(rbo, "type", text="Type")
+ layout.prop(rbo, "kinematic", text="Animated")
+
+ if rbo.type == 'ACTIVE':
+ layout.prop(rbo, "mass")
+
+
+class PHYSICS_PT_rigid_body_collisions(PHYSICS_PT_rigidbody_panel, Panel):
+ bl_label = "Rigid Body Collisions"
+
+ @classmethod
+ def poll(cls, context):
+ return (context.object and context.object.rigid_body and
+ (not context.scene.render.use_game_engine))
+
+ def draw(self, context):
+ layout = self.layout
+
+ ob = context.object
+ rbo = ob.rigid_body
+
+ layout.prop(rbo, "collision_shape", text="Shape")
+
+ split = layout.split()
+
+ col = split.column()
+ col.label(text="Surface Response:")
+ col.prop(rbo, "friction")
+ col.prop(rbo, "restitution", text="Bounciness")
+
+ col = split.column()
+ col.label(text="Sensitivity:")
+ if rbo.collision_shape in {'MESH', 'CONE'}:
+ col.prop(rbo, "collision_margin", text="Margin")
+ else:
+ col.prop(rbo, "use_margin");
+ sub = col.column()
+ sub.active = rbo.use_margin
+ sub.prop(rbo, "collision_margin", text="Margin")
+
+ layout.prop(rbo, "collision_groups")
+
+
+class PHYSICS_PT_rigid_body_dynamics(PHYSICS_PT_rigidbody_panel, Panel):
+ bl_label = "Rigid Body Dynamics"
+ bl_default_closed = True
+
+ @classmethod
+ def poll(cls, context):
+ return (context.object and context.object.rigid_body and
+ context.object.rigid_body.type == 'ACTIVE' and
+ (not context.scene.render.use_game_engine))
+
+ def draw(self, context):
+ layout = self.layout
+
+ ob = context.object
+ rbo = ob.rigid_body
+
+ #col = layout.column(align=1)
+ #col.label(text="Activation:")
+ # XXX: settings such as activate on collison/etc.
+
+ split = layout.split();
+
+ col = split.column()
+ col.label(text="Deactivation:")
+ col.prop(rbo, "use_deactivation")
+ sub = col.column()
+ sub.active = rbo.use_deactivation
+ sub.prop(rbo, "start_deactivated")
+ sub.prop(rbo, "deactivate_linear_velocity", text="Linear Vel")
+ sub.prop(rbo, "deactivate_angular_velocity", text="Angular Vel")
+ # TODO: other params such as time?
+
+ col = split.column()
+ col.label(text="Damping:")
+ col.prop(rbo, "linear_damping", text="Translation")
+ col.prop(rbo, "angular_damping", text="Rotation")
+
+if __name__ == "__main__": # only for live edit.
+ bpy.utils.register_module(__name__)
diff --git a/release/scripts/startup/bl_ui/properties_physics_rigidbody_constraint.py b/release/scripts/startup/bl_ui/properties_physics_rigidbody_constraint.py
new file mode 100644
index 00000000000..49b760ef546
--- /dev/null
+++ b/release/scripts/startup/bl_ui/properties_physics_rigidbody_constraint.py
@@ -0,0 +1,208 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+# <pep8 compliant>
+import bpy
+from bpy.types import Panel
+
+
+class PHYSICS_PT_rigidbody_constraint_panel():
+ bl_space_type = 'PROPERTIES'
+ bl_region_type = 'WINDOW'
+ bl_context = "physics"
+
+
+class PHYSICS_PT_rigid_body_constraint(PHYSICS_PT_rigidbody_constraint_panel, Panel):
+ bl_label = "Rigid Body Constraint"
+
+ @classmethod
+ def poll(cls, context):
+ ob = context.object
+ rd = context.scene.render
+ return (ob and ob.rigid_body_constraint and (not rd.use_game_engine))
+
+ def draw(self, context):
+ layout = self.layout
+
+ ob = context.object
+ rbc = ob.rigid_body_constraint
+
+ layout.prop(rbc, "type")
+
+ row = layout.row()
+ row.prop(rbc, "enabled")
+ row.prop(rbc, "disable_collisions")
+
+ layout.prop(rbc, "object1")
+ layout.prop(rbc, "object2")
+
+ row = layout.row()
+ row.prop(rbc, "use_breaking")
+ sub = row.row()
+ sub.active = rbc.use_breaking
+ sub.prop(rbc, "breaking_threshold", text="Threshold")
+
+ row = layout.row()
+ row.prop(rbc, "override_solver_iterations", text="Override Iterations")
+ sub = row.row()
+ sub.active = rbc.override_solver_iterations
+ sub.prop(rbc, "num_solver_iterations", text="Iterations")
+
+ if rbc.type == 'HINGE':
+ col = layout.column(align=True)
+ col.label("Limits:")
+
+ row = col.row()
+ sub = row.row()
+ sub.scale_x = 0.5
+ sub.prop(rbc, "use_limit_ang_z", toggle=True)
+ sub = row.row()
+ sub.active = rbc.use_limit_ang_z
+ sub.prop(rbc, "limit_ang_z_lower", text="Lower")
+ sub.prop(rbc, "limit_ang_z_upper", text="Upper")
+
+ elif rbc.type == 'SLIDER':
+ col = layout.column(align=True)
+ col.label("Limits:")
+
+ row = col.row()
+ sub = row.row()
+ sub.scale_x = 0.5
+ sub.prop(rbc, "use_limit_lin_x", toggle=True)
+ sub = row.row()
+ sub.active = rbc.use_limit_lin_x
+ sub.prop(rbc, "limit_lin_x_lower", text="Lower")
+ sub.prop(rbc, "limit_lin_x_upper", text="Upper")
+
+ elif rbc.type == 'PISTON':
+ col = layout.column(align=True)
+ col.label("Limits:")
+
+ row = col.row()
+ sub = row.row()
+ sub.scale_x = 0.5
+ sub.prop(rbc, "use_limit_lin_x", toggle=True)
+ sub = row.row()
+ sub.active = rbc.use_limit_lin_x
+ sub.prop(rbc, "limit_lin_x_lower", text="Lower")
+ sub.prop(rbc, "limit_lin_x_upper", text="Upper")
+
+ col = layout.column(align=True)
+
+ row = col.row()
+ sub = row.row()
+ sub.scale_x = 0.5
+ sub.prop(rbc, "use_limit_ang_x", toggle=True)
+ sub = row.row()
+ sub.active = rbc.use_limit_ang_x
+ sub.prop(rbc, "limit_ang_x_lower", text="Lower")
+ sub.prop(rbc, "limit_ang_x_upper", text="Upper")
+
+ elif rbc.type in {'GENERIC', 'GENERIC_SPRING'}:
+ col = layout.column(align=True)
+ col.label("Limits:")
+
+ row = col.row()
+ sub = row.row()
+ sub.scale_x = 0.5
+ sub.prop(rbc, "use_limit_lin_x", toggle=True)
+ sub = row.row()
+ sub.active = rbc.use_limit_lin_x
+ sub.prop(rbc, "limit_lin_x_lower", text="Lower")
+ sub.prop(rbc, "limit_lin_x_upper", text="Upper")
+
+ row = col.row()
+ sub = row.row()
+ sub.scale_x = 0.5
+ sub.prop(rbc, "use_limit_lin_y", toggle=True)
+ sub = row.row()
+ sub.active = rbc.use_limit_lin_y
+ sub.prop(rbc, "limit_lin_y_lower", text="Lower")
+ sub.prop(rbc, "limit_lin_y_upper", text="Upper")
+
+ row = col.row()
+ sub = row.row()
+ sub.scale_x = 0.5
+ sub.prop(rbc, "use_limit_lin_z", toggle=True)
+ sub = row.row()
+ sub.active = rbc.use_limit_lin_z
+ sub.prop(rbc, "limit_lin_z_lower", text="Lower")
+ sub.prop(rbc, "limit_lin_z_upper", text="Upper")
+
+ col = layout.column(align=True)
+
+ row = col.row()
+ sub = row.row()
+ sub.scale_x = 0.5
+ sub.prop(rbc, "use_limit_ang_x", toggle=True)
+ sub = row.row()
+ sub.active = rbc.use_limit_ang_x
+ sub.prop(rbc, "limit_ang_x_lower", text="Lower")
+ sub.prop(rbc, "limit_ang_x_upper", text="Upper")
+
+ row = col.row()
+ sub = row.row()
+ sub.scale_x = 0.5
+ sub.prop(rbc, "use_limit_ang_y", toggle=True)
+ sub = row.row()
+ sub.active = rbc.use_limit_ang_y
+ sub.prop(rbc, "limit_ang_y_lower", text="Lower")
+ sub.prop(rbc, "limit_ang_y_upper", text="Upper")
+
+ row = col.row()
+ sub = row.row()
+ sub.scale_x = 0.5
+ sub.prop(rbc, "use_limit_ang_z", toggle=True)
+ sub = row.row()
+ sub.active = rbc.use_limit_ang_z
+ sub.prop(rbc, "limit_ang_z_lower", text="Lower")
+ sub.prop(rbc, "limit_ang_z_upper", text="Upper")
+
+ if rbc.type == 'GENERIC_SPRING':
+ col = layout.column(align=True)
+ col.label("Springs:")
+
+ row = col.row()
+ sub = row.row()
+ sub.scale_x = 0.1
+ sub.prop(rbc, "use_spring_x", toggle=True, text="X")
+ sub = row.row()
+ sub.active = rbc.use_spring_x
+ sub.prop(rbc, "spring_stiffness_x", text="Stiffness")
+ sub.prop(rbc, "spring_damping_x")
+
+ row = col.row()
+ sub = row.row()
+ sub.scale_x = 0.1
+ sub.prop(rbc, "use_spring_y", toggle=True, text="Y")
+ sub = row.row()
+ sub.active = rbc.use_spring_y
+ sub.prop(rbc, "spring_stiffness_y", text="Stiffness")
+ sub.prop(rbc, "spring_damping_y")
+
+ row = col.row()
+ sub = row.row()
+ sub.scale_x = 0.1
+ sub.prop(rbc, "use_spring_z", toggle=True, text="Z")
+ sub = row.row()
+ sub.active = rbc.use_spring_z
+ sub.prop(rbc, "spring_stiffness_z", text="Stiffness")
+ sub.prop(rbc, "spring_damping_z")
+
+if __name__ == "__main__": # only for live edit.
+ bpy.utils.register_module(__name__)
diff --git a/release/scripts/startup/bl_ui/properties_physics_smoke.py b/release/scripts/startup/bl_ui/properties_physics_smoke.py
index ce5053f0ecf..487f43aa973 100644
--- a/release/scripts/startup/bl_ui/properties_physics_smoke.py
+++ b/release/scripts/startup/bl_ui/properties_physics_smoke.py
@@ -76,7 +76,7 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel, Panel):
elif md.smoke_type == 'FLOW':
flow = md.flow_settings
-
+
layout.prop(flow, "smoke_flow_type", expand=False)
if flow.smoke_flow_type != "OUTFLOW":
@@ -118,7 +118,8 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel, Panel):
col = split.column()
col.prop(coll, "collision_type")
-
+
+
class PHYSICS_PT_smoke_flow_advanced(PhysicButtonsPanel, Panel):
bl_label = "Smoke Flow Advanced"
bl_options = {'DEFAULT_CLOSED'}
@@ -132,7 +133,7 @@ class PHYSICS_PT_smoke_flow_advanced(PhysicButtonsPanel, Panel):
layout = self.layout
ob = context.object
flow = context.smoke.flow_settings
-
+
split = layout.split()
col = split.column()
@@ -147,11 +148,12 @@ class PHYSICS_PT_smoke_flow_advanced(PhysicButtonsPanel, Panel):
if flow.texture_map_type == "AUTO":
sub.prop(flow, "texture_size")
sub.prop(flow, "texture_offset")
-
+
col = split.column()
col.label(text="Vertex Group:")
col.prop_search(flow, "density_vertex_group", ob, "vertex_groups", text="")
+
class PHYSICS_PT_smoke_fire(PhysicButtonsPanel, Panel):
bl_label = "Smoke Flames"
bl_options = {'DEFAULT_CLOSED'}
@@ -179,7 +181,8 @@ class PHYSICS_PT_smoke_fire(PhysicButtonsPanel, Panel):
col.prop(domain, "flame_ignition")
col.prop(domain, "flame_max_temp")
col.prop(domain, "flame_smoke_color")
-
+
+
class PHYSICS_PT_smoke_adaptive_domain(PhysicButtonsPanel, Panel):
bl_label = "Smoke Adaptive Domain"
bl_options = {'DEFAULT_CLOSED'}
@@ -199,10 +202,10 @@ class PHYSICS_PT_smoke_adaptive_domain(PhysicButtonsPanel, Panel):
domain = context.smoke.domain_settings
layout.active = domain.use_adaptive_domain
-
+
split = layout.split()
- split.enabled = not domain.point_cache.is_baked
-
+ split.enabled = (not domain.point_cache.is_baked)
+
col = split.column(align=True)
col.label(text="Resolution:")
col.prop(domain, "additional_res")
@@ -212,6 +215,7 @@ class PHYSICS_PT_smoke_adaptive_domain(PhysicButtonsPanel, Panel):
col.label(text="Advanced:")
col.prop(domain, "adapt_threshold")
+
class PHYSICS_PT_smoke_highres(PhysicButtonsPanel, Panel):
bl_label = "Smoke High Resolution"
bl_options = {'DEFAULT_CLOSED'}
@@ -249,6 +253,7 @@ class PHYSICS_PT_smoke_highres(PhysicButtonsPanel, Panel):
layout.prop(md, "show_high_resolution")
+
class PHYSICS_PT_smoke_groups(PhysicButtonsPanel, Panel):
bl_label = "Smoke Groups"
bl_options = {'DEFAULT_CLOSED'}
@@ -262,7 +267,7 @@ class PHYSICS_PT_smoke_groups(PhysicButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
domain = context.smoke.domain_settings
-
+
split = layout.split()
col = split.column()
@@ -276,6 +281,7 @@ class PHYSICS_PT_smoke_groups(PhysicButtonsPanel, Panel):
col.label(text="Collision Group:")
col.prop(domain, "collision_group", text="")
+
class PHYSICS_PT_smoke_cache(PhysicButtonsPanel, Panel):
bl_label = "Smoke Cache"
bl_options = {'DEFAULT_CLOSED'}
diff --git a/release/scripts/startup/bl_ui/properties_render.py b/release/scripts/startup/bl_ui/properties_render.py
index 77bb2d3d50e..cb5a473dba1 100644
--- a/release/scripts/startup/bl_ui/properties_render.py
+++ b/release/scripts/startup/bl_ui/properties_render.py
@@ -43,6 +43,7 @@ class RENDER_MT_framerate_presets(Menu):
draw = Menu.draw_preset
+
class RenderButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
@@ -245,7 +246,7 @@ class RENDER_PT_performance(RenderButtonsPanel, Panel):
subsub = sub.column()
subsub.enabled = rd.threads_mode == 'FIXED'
subsub.prop(rd, "threads")
-
+
sub = col.column(align=True)
sub.label(text="Tile Size:")
sub.prop(rd, "tile_x", text="X")
diff --git a/release/scripts/startup/bl_ui/properties_scene.py b/release/scripts/startup/bl_ui/properties_scene.py
index 66a16daa22f..e0f4fd1f75b 100644
--- a/release/scripts/startup/bl_ui/properties_scene.py
+++ b/release/scripts/startup/bl_ui/properties_scene.py
@@ -21,6 +21,10 @@ import bpy
from bpy.types import Panel, UIList
from rna_prop_ui import PropertyPanel
+from bl_ui.properties_physics_common import (
+ point_cache_ui,
+ effector_weights_ui,
+ )
class SCENE_UL_keying_set_paths(UIList):
def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
@@ -59,36 +63,6 @@ class SCENE_PT_scene(SceneButtonsPanel, Panel):
layout.prop(scene, "active_clip", text="Active Clip")
-class SCENE_PT_audio(SceneButtonsPanel, Panel):
- bl_label = "Audio"
- COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
-
- def draw(self, context):
- layout = self.layout
-
- scene = context.scene
- rd = context.scene.render
- ffmpeg = rd.ffmpeg
-
- layout.prop(scene, "audio_volume")
- layout.operator("sound.bake_animation")
-
- split = layout.split()
-
- col = split.column()
- col.label("Listener:")
- col.prop(scene, "audio_distance_model", text="")
- col.prop(scene, "audio_doppler_speed", text="Speed")
- col.prop(scene, "audio_doppler_factor", text="Doppler")
-
- col = split.column()
- col.label("Format:")
- col.prop(ffmpeg, "audio_channels", text="")
- col.prop(ffmpeg, "audio_mixrate", text="Rate")
-
- layout.operator("sound.mixdown")
-
-
class SCENE_PT_unit(SceneButtonsPanel, Panel):
bl_label = "Units"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@@ -198,6 +172,63 @@ class SCENE_PT_keying_set_paths(SceneButtonsPanel, Panel):
col.prop(ksp, "bl_options")
+class SCENE_PT_color_management(SceneButtonsPanel, Panel):
+ bl_label = "Color Management"
+ bl_options = {'DEFAULT_CLOSED'}
+ COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
+
+ def draw(self, context):
+ layout = self.layout
+
+ scene = context.scene
+ rd = scene.render
+
+ col = layout.column()
+ col.label(text="Display:")
+ col.prop(scene.display_settings, "display_device")
+
+ col = layout.column()
+ col.separator()
+ col.label(text="Render:")
+ col.template_colormanaged_view_settings(scene, "view_settings")
+
+ col = layout.column()
+ col.separator()
+ col.label(text="Sequencer:")
+ col.prop(scene.sequencer_colorspace_settings, "name")
+
+
+class SCENE_PT_audio(SceneButtonsPanel, Panel):
+ bl_label = "Audio"
+ bl_options = {'DEFAULT_CLOSED'}
+ COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
+
+ def draw(self, context):
+ layout = self.layout
+
+ scene = context.scene
+ rd = context.scene.render
+ ffmpeg = rd.ffmpeg
+
+ layout.prop(scene, "audio_volume")
+ layout.operator("sound.bake_animation")
+
+ split = layout.split()
+
+ col = split.column()
+ col.label("Listener:")
+ col.prop(scene, "audio_distance_model", text="")
+ col.prop(scene, "audio_doppler_speed", text="Speed")
+ col.prop(scene, "audio_doppler_factor", text="Doppler")
+
+ col = split.column()
+ col.label("Format:")
+ col.prop(ffmpeg, "audio_channels", text="")
+ col.prop(ffmpeg, "audio_mixrate", text="Rate")
+
+ layout.operator("sound.mixdown")
+
+
class SCENE_PT_physics(SceneButtonsPanel, Panel):
bl_label = "Gravity"
COMPAT_ENGINES = {'BLENDER_RENDER'}
@@ -215,6 +246,88 @@ class SCENE_PT_physics(SceneButtonsPanel, Panel):
layout.prop(scene, "gravity", text="")
+class SCENE_PT_rigid_body_world(SceneButtonsPanel, Panel):
+ bl_label = "Rigid Body World"
+ COMPAT_ENGINES = {'BLENDER_RENDER'}
+
+ @classmethod
+ def poll(cls, context):
+ scene = context.scene
+ rd = scene.render
+ return scene and (rd.engine in cls.COMPAT_ENGINES)
+
+ def draw_header(self, context):
+ scene = context.scene
+ rbw = scene.rigidbody_world
+ if rbw is not None:
+ self.layout.prop(rbw, "enabled", text="")
+
+ def draw(self, context):
+ layout = self.layout
+
+ scene = context.scene
+
+ rbw = scene.rigidbody_world
+
+ if rbw is None:
+ layout.operator("rigidbody.world_add")
+ else:
+ layout.operator("rigidbody.world_remove")
+
+ col = layout.column()
+ col.active = rbw.enabled
+
+ col = col.column()
+ col.prop(rbw, "group")
+ col.prop(rbw, "constraints")
+
+ split = col.split()
+
+ col = split.column()
+ col.prop(rbw, "time_scale", text="Speed")
+ col.prop(rbw, "use_split_impulse")
+
+ col = split.column()
+ col.prop(rbw, "steps_per_second", text="Steps Per Second")
+ col.prop(rbw, "num_solver_iterations", text="Solver Iterations")
+
+
+class SCENE_PT_rigid_body_cache(SceneButtonsPanel, Panel):
+ bl_label = "Rigid Body Cache"
+ bl_options = {'DEFAULT_CLOSED'}
+ COMPAT_ENGINES = {'BLENDER_RENDER'}
+
+ @classmethod
+ def poll(cls, context):
+ rd = context.scene.render
+ scene = context.scene
+ return scene and scene.rigidbody_world and (rd.engine in cls.COMPAT_ENGINES)
+
+ def draw(self, context):
+ scene = context.scene
+ rbw = scene.rigidbody_world
+
+ point_cache_ui(self, context, rbw.point_cache, rbw.point_cache.is_baked is False and rbw.enabled, 'RIGID_BODY')
+
+
+class SCENE_PT_rigid_body_field_weights(SceneButtonsPanel, Panel):
+ bl_label = "Rigid Body Field Weights"
+ bl_options = {'DEFAULT_CLOSED'}
+ COMPAT_ENGINES = {'BLENDER_RENDER'}
+
+ @classmethod
+ def poll(cls, context):
+ rd = context.scene.render
+ scene = context.scene
+ return scene and scene.rigidbody_world and (rd.engine in cls.COMPAT_ENGINES)
+
+ def draw(self, context):
+ scene = context.scene
+ rbw = scene.rigidbody_world
+
+ effector_weights_ui(self, context, rbw.effector_weights, 'RIGID_BODY')
+
+
class SCENE_PT_simplify(SceneButtonsPanel, Panel):
bl_label = "Simplify"
COMPAT_ENGINES = {'BLENDER_RENDER'}
@@ -243,33 +356,6 @@ class SCENE_PT_simplify(SceneButtonsPanel, Panel):
col.prop(rd, "simplify_ao_sss", text="AO and SSS")
-class SCENE_PT_color_management(Panel):
- bl_label = "Color Management"
- bl_space_type = 'PROPERTIES'
- bl_region_type = 'WINDOW'
- bl_context = "scene"
-
- def draw(self, context):
- layout = self.layout
-
- scene = context.scene
- rd = scene.render
-
- col = layout.column()
- col.label(text="Display:")
- col.prop(scene.display_settings, "display_device")
-
- col = layout.column()
- col.separator()
- col.label(text="Render:")
- col.template_colormanaged_view_settings(scene, "view_settings")
-
- col = layout.column()
- col.separator()
- col.label(text="Sequencer:")
- col.prop(scene.sequencer_colorspace_settings, "name")
-
-
class SCENE_PT_custom_props(SceneButtonsPanel, PropertyPanel, Panel):
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
_context_path = "scene"
diff --git a/release/scripts/startup/bl_ui/properties_texture.py b/release/scripts/startup/bl_ui/properties_texture.py
index 6842b324b0e..9e8fd0470cf 100644
--- a/release/scripts/startup/bl_ui/properties_texture.py
+++ b/release/scripts/startup/bl_ui/properties_texture.py
@@ -30,7 +30,7 @@ from bpy.types import (Brush,
from rna_prop_ui import PropertyPanel
-from bl_ui.properties_paint_common import sculpt_brush_texture_settings
+from bl_ui.properties_paint_common import brush_texture_settings
class TEXTURE_MT_specials(Menu):
@@ -432,6 +432,12 @@ class TEXTURE_PT_image_sampling(TextureTypePanel, Panel):
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
def draw(self, context):
+ if context.scene.render.engine == 'BLENDER_GAME':
+ self.draw_bge(context)
+ else:
+ self.draw_bi(context)
+
+ def draw_bi(self, context):
layout = self.layout
idblock = context_tex_datablock(context)
@@ -468,6 +474,33 @@ class TEXTURE_PT_image_sampling(TextureTypePanel, Panel):
texture_filter_common(tex, col)
+ def draw_bge(self, context):
+ layout = self.layout
+
+ idblock = context_tex_datablock(context)
+ tex = context.texture
+ slot = getattr(context, "texture_slot", None)
+
+ split = layout.split()
+
+ col = split.column()
+ col.label(text="Alpha:")
+ col.prop(tex, "use_calculate_alpha", text="Calculate")
+ col.prop(tex, "invert_alpha", text="Invert")
+
+ col = split.column()
+
+ #Only for Material based textures, not for Lamp/World...
+ if slot and isinstance(idblock, Material):
+ col.prop(tex, "use_normal_map")
+ row = col.row()
+ row.active = tex.use_normal_map
+ row.prop(slot, "normal_map_space", text="")
+
+ row = col.row()
+ row.active = not tex.use_normal_map
+ row.prop(tex, "use_derivative_map")
+
class TEXTURE_PT_image_mapping(TextureTypePanel, Panel):
bl_label = "Image Mapping"
@@ -884,8 +917,8 @@ class TEXTURE_PT_mapping(TextureSlotPanel, Panel):
split.prop(tex, "object", text="")
if isinstance(idblock, Brush):
- if context.sculpt_object:
- sculpt_brush_texture_settings(layout, idblock)
+ if context.sculpt_object or context.image_paint_object:
+ brush_texture_settings(layout, idblock, context.sculpt_object)
else:
if isinstance(idblock, Material):
split = layout.split(percentage=0.3)
diff --git a/release/scripts/startup/bl_ui/space_clip.py b/release/scripts/startup/bl_ui/space_clip.py
index 5fc57133767..db71bbe2390 100644
--- a/release/scripts/startup/bl_ui/space_clip.py
+++ b/release/scripts/startup/bl_ui/space_clip.py
@@ -23,14 +23,17 @@ from bpy.types import Panel, Header, Menu, UIList
class CLIP_UL_tracking_objects(UIList):
- def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
+ def draw_item(self, context, layout, data, item, icon,
+ active_data, active_propname, index):
# assert(isinstance(item, bpy.types.MovieTrackingObject)
tobj = item
if self.layout_type in {'DEFAULT', 'COMPACT'}:
- layout.label(tobj.name, icon='CAMERA_DATA' if tobj.is_camera else 'OBJECT_DATA')
+ layout.label(tobj.name, icon='CAMERA_DATA'
+ if tobj.is_camera else 'OBJECT_DATA')
elif self.layout_type in {'GRID'}:
layout.alignment = 'CENTER'
- layout.label("", icon='CAMERA_DATA' if tobj.is_camera else 'OBJECT_DATA')
+ layout.label("", icon='CAMERA_DATA'
+ if tobj.is_camera else 'OBJECT_DATA')
class CLIP_HT_header(Header):
@@ -333,7 +336,8 @@ class CLIP_PT_tools_solve(CLIP_PT_tracking_panel, Panel):
col = layout.column(align=True)
col.active = not settings.use_tripod_solver
- col.prop(settings, "use_fallback_reconstruction", text="Allow Fallback")
+ col.prop(settings, "use_fallback_reconstruction",
+ text="Allow Fallback")
sub = col.column()
sub.active = settings.use_fallback_reconstruction
sub.prop(settings, "reconstruction_success_threshold")
@@ -482,7 +486,8 @@ class CLIP_PT_objects(CLIP_PT_clip_view_panel, Panel):
tracking = sc.clip.tracking
row = layout.row()
- row.template_list("CLIP_UL_tracking_objects", "", tracking, "objects", tracking, "active_object_index", rows=3)
+ row.template_list("CLIP_UL_tracking_objects", "", tracking, "objects",
+ tracking, "active_object_index", rows=3)
sub = row.column(align=True)
@@ -738,7 +743,8 @@ class CLIP_PT_stabilization(CLIP_PT_reconstruction_panel, Panel):
layout.active = stab.use_2d_stabilization
row = layout.row()
- row.template_list("UI_UL_list", "", stab, "tracks", stab, "active_track_index", rows=3)
+ row.template_list("UI_UL_list", "", stab, "tracks",
+ stab, "active_track_index", rows=3)
sub = row.column(align=True)
diff --git a/release/scripts/startup/bl_ui/space_dopesheet.py b/release/scripts/startup/bl_ui/space_dopesheet.py
index 5535070c1c4..094fa4a7c6d 100644
--- a/release/scripts/startup/bl_ui/space_dopesheet.py
+++ b/release/scripts/startup/bl_ui/space_dopesheet.py
@@ -275,8 +275,8 @@ class DOPESHEET_MT_key(Menu):
layout.operator("action.keyframe_insert")
layout.separator()
- layout.operator("action.frame_jump")
-
+ layout.operator("action.frame_jump")
+
layout.separator()
layout.operator("action.duplicate_move")
layout.operator("action.delete")
diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py
index 1ea20d96386..cfedc5e1e00 100644
--- a/release/scripts/startup/bl_ui/space_image.py
+++ b/release/scripts/startup/bl_ui/space_image.py
@@ -20,7 +20,7 @@
import bpy
from bpy.types import Header, Menu, Panel
from bl_ui.properties_paint_common import UnifiedPaintPanel
-
+from bl_ui.properties_paint_common import brush_texture_settings
class ImagePaintPanel(UnifiedPaintPanel):
bl_space_type = 'IMAGE_EDITOR'
@@ -722,7 +722,8 @@ class IMAGE_PT_tools_brush_texture(BrushButtonsPanel, Panel):
col = layout.column()
col.template_ID_preview(brush, "texture", new="texture.new", rows=3, cols=8)
- col.prop(brush, "use_fixed_texture")
+
+ brush_texture_settings(col, brush, 0)
class IMAGE_PT_tools_brush_tool(BrushButtonsPanel, Panel):
diff --git a/release/scripts/startup/bl_ui/space_info.py b/release/scripts/startup/bl_ui/space_info.py
index 8df117e27a0..c0d1f725ab6 100644
--- a/release/scripts/startup/bl_ui/space_info.py
+++ b/release/scripts/startup/bl_ui/space_info.py
@@ -112,7 +112,7 @@ class INFO_MT_file(Menu):
layout.separator()
- layout.operator_context = 'EXEC_AREA' if context.blend_data.is_saved else 'INVOKE_AREA'
+ layout.operator_context = 'EXEC_AREA' if context.blend_data.is_saved else 'INVOKE_AREA'
layout.operator("wm.save_mainfile", text="Save", icon='FILE_TICK')
layout.operator_context = 'INVOKE_AREA'
@@ -124,8 +124,9 @@ class INFO_MT_file(Menu):
layout.operator("screen.userpref_show", text="User Preferences...", icon='PREFERENCES')
- layout.operator_context = 'EXEC_AREA'
+ layout.operator_context = 'INVOKE_AREA'
layout.operator("wm.save_homefile", icon='SAVE_PREFS')
+ layout.operator_context = 'EXEC_AREA'
layout.operator("wm.read_factory_settings", icon='LOAD_FACTORY')
layout.separator()
@@ -373,7 +374,7 @@ class INFO_MT_help(Menu):
layout = self.layout
layout.operator("wm.url_open", text="Manual", icon='HELP').url = "http://wiki.blender.org/index.php/Doc:2.6/Manual"
- layout.operator("wm.url_open", text="Release Log", icon='URL').url = "http://www.blender.org/development/release-logs/blender-265"
+ layout.operator("wm.url_open", text="Release Log", icon='URL').url = "http://www.blender.org/development/release-logs/blender-266"
layout.separator()
layout.operator("wm.url_open", text="Blender Website", icon='URL').url = "http://www.blender.org"
diff --git a/release/scripts/startup/bl_ui/space_text.py b/release/scripts/startup/bl_ui/space_text.py
index 960a945f1c6..65ec945c7da 100644
--- a/release/scripts/startup/bl_ui/space_text.py
+++ b/release/scripts/startup/bl_ui/space_text.py
@@ -152,7 +152,7 @@ class TEXT_MT_view(Menu):
layout = self.layout
layout.operator("text.properties", icon='MENU_PANEL')
-
+
layout.separator()
layout.operator("text.move",
diff --git a/release/scripts/startup/bl_ui/space_time.py b/release/scripts/startup/bl_ui/space_time.py
index cb9e2444793..6af9f377237 100644
--- a/release/scripts/startup/bl_ui/space_time.py
+++ b/release/scripts/startup/bl_ui/space_time.py
@@ -152,6 +152,7 @@ class TIME_MT_cache(Menu):
col.prop(st, "cache_cloth")
col.prop(st, "cache_smoke")
col.prop(st, "cache_dynamicpaint")
+ col.prop(st, "cache_rigidbody")
class TIME_MT_frame(Menu):
diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py
index a9712b1557e..dad729077e0 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -24,25 +24,25 @@ import os
def ui_style_items(col, context):
""" UI Style settings """
-
+
split = col.split()
-
+
col = split.column()
col.label(text="Kerning Style:")
col.row().prop(context, "font_kerning_style", expand=True)
col.prop(context, "points")
-
+
col = split.column()
col.label(text="Shadow Offset:")
col.prop(context, "shadow_offset_x", text="X")
col.prop(context, "shadow_offset_y", text="Y")
-
+
col = split.column()
col.prop(context, "shadow")
col.prop(context, "shadowalpha")
col.prop(context, "shadowcolor")
-
+
def ui_items_general(col, context):
""" General UI Theme Settings (User Interface)
"""
@@ -200,7 +200,7 @@ class USERPREF_PT_interface(Panel):
col.prop(view, "show_playback_fps", text="Playback FPS")
col.prop(view, "use_global_scene")
col.prop(view, "object_origin_size")
-
+
col.separator()
col.separator()
col.separator()
@@ -763,13 +763,13 @@ class USERPREF_PT_theme(Panel):
colsub.row().prop(ui, "axis_x")
colsub.row().prop(ui, "axis_y")
colsub.row().prop(ui, "axis_z")
-
+
subsplit = row.split(percentage=0.85)
padding = subsplit.split(percentage=0.15)
colsub = padding.column()
colsub = padding.column()
-
+
layout.separator()
layout.separator()
elif theme.theme_area == 'BONE_COLOR_SETS':
@@ -797,16 +797,23 @@ class USERPREF_PT_theme(Panel):
colsub.row().prop(ui, "show_colored_constraints")
elif theme.theme_area == 'STYLE':
col = split.column()
-
+
style = context.user_preferences.ui_styles[0]
-
+
+ ui = style.panel_title
+ col.label(text="Panel Title:")
+ ui_style_items(col, ui)
+
+ col.separator()
+ col.separator()
+
ui = style.widget
col.label(text="Widget:")
ui_style_items(col, ui)
-
+
col.separator()
col.separator()
-
+
ui = style.widget_label
col.label(text="Widget Label:")
ui_style_items(col, ui)
@@ -1100,8 +1107,8 @@ class USERPREF_PT_addons(Panel):
used_ext = {ext.module for ext in userpref.addons}
userpref_addons_folder = os.path.join(userpref.filepaths.script_directory, "addons")
- scripts_addons_folder = bpy.utils.user_resource('SCRIPTS', "addons")
-
+ scripts_addons_folder = bpy.utils.user_resource('SCRIPTS', "addons")
+
# collect the categories that can be filtered on
addons = [(mod, addon_utils.module_bl_info(mod)) for mod in addon_utils.modules(addon_utils.addons_fake_modules)]
@@ -1152,7 +1159,7 @@ class USERPREF_PT_addons(Panel):
(filter == "Enabled" and is_enabled) or
(filter == "Disabled" and not is_enabled) or
(filter == "User" and (mod.__file__.startswith((scripts_addons_folder, userpref_addons_folder))))
- ):
+ ):
if search and search not in info["name"].lower():
if info["author"]:
@@ -1244,7 +1251,6 @@ class USERPREF_PT_addons(Panel):
box_prefs.label(text="Error (see console)", icon='ERROR')
del addon_preferences_class.layout
-
# Append missing scripts
# First collect scripts that are used but have no script file.
module_names = {mod.__name__ for mod, info in addons}
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index a35fb149aae..6c5cc93947b 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -1066,12 +1066,14 @@ class VIEW3D_MT_make_links(Menu):
def draw(self, context):
layout = self.layout
-
+ operator_context_default = layout.operator_context
if(len(bpy.data.scenes) > 10):
- layout.operator_context = 'INVOKE_DEFAULT'
+ layout.operator_context = 'INVOKE_REGION_WIN'
layout.operator("object.make_links_scene", text="Objects to Scene...", icon='OUTLINER_OB_EMPTY')
else:
+ layout.operator_context = 'EXEC_REGION_WIN'
layout.operator_menu_enum("object.make_links_scene", "scene", text="Objects to Scene...")
+ layout.operator_context = operator_context_default
layout.operator_enum("object.make_links_data", "type") # inline
@@ -1537,7 +1539,7 @@ class VIEW3D_MT_pose_group(Menu):
def draw(self, context):
layout = self.layout
-
+
pose = context.active_object.pose
layout.operator_context = 'EXEC_AREA'
@@ -1710,19 +1712,37 @@ class VIEW3D_MT_edit_mesh_specials(Menu):
layout.operator("mesh.subdivide", text="Subdivide").smoothness = 0.0
layout.operator("mesh.subdivide", text="Subdivide Smooth").smoothness = 1.0
+
+ layout.separator()
+
layout.operator("mesh.merge", text="Merge...")
layout.operator("mesh.remove_doubles")
+
+ layout.separator()
+
layout.operator("mesh.hide", text="Hide").unselected = False
layout.operator("mesh.reveal", text="Reveal")
layout.operator("mesh.select_all", text="Select Inverse").action = 'INVERT'
+
+ layout.separator()
+
layout.operator("mesh.flip_normals")
layout.operator("mesh.vertices_smooth", text="Smooth")
layout.operator("mesh.vertices_smooth_laplacian", text="Laplacian Smooth")
+
+ layout.separator()
+
layout.operator("mesh.inset")
layout.operator("mesh.bevel", text="Bevel")
layout.operator("mesh.bridge_edge_loops")
+
+ layout.separator()
+
layout.operator("mesh.faces_shade_smooth")
layout.operator("mesh.faces_shade_flat")
+
+ layout.separator()
+
layout.operator("mesh.blend_from_shape")
layout.operator("mesh.shape_propagate_to_all")
layout.operator("mesh.select_vertex_path")
@@ -1789,10 +1809,11 @@ class VIEW3D_MT_edit_mesh_vertices(Menu):
layout.operator("mesh.split")
layout.operator_menu_enum("mesh.separate", "type")
layout.operator("mesh.vert_connect")
- layout.operator("mesh.vert_slide")
+ layout.operator("transform.vert_slide")
layout.separator()
+ layout.operator("mesh.bevel").vertex_only = True
layout.operator("mesh.vertices_smooth")
layout.operator("mesh.remove_doubles")
layout.operator("mesh.sort_elements", text="Sort Vertices").elements = {'VERT'}
@@ -2394,9 +2415,6 @@ class VIEW3D_PT_view3d_display(Panel):
col.prop(view, "show_outline_selected")
col.prop(view, "show_all_objects_origin")
col.prop(view, "show_relationship_lines")
- if ob and ob.type == 'MESH':
- mesh = ob.data
- col.prop(mesh, "show_all_edges")
col = layout.column()
col.active = display_all
@@ -2421,7 +2439,10 @@ class VIEW3D_PT_view3d_display(Panel):
col.label(text="Shading:")
col.prop(gs, "material_mode", text="")
col.prop(view, "show_textured_solid")
-
+ if view.viewport_shade == 'SOLID':
+ col.prop(view, "use_matcap")
+ if view.use_matcap:
+ col.template_icon_view(view, "matcap_icon")
col.prop(view, "show_backface_culling")
layout.separator()
diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index 3c56ff82a77..ca79c6cb7fa 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -20,7 +20,7 @@
import bpy
from bpy.types import Menu, Panel
from bl_ui.properties_paint_common import UnifiedPaintPanel
-from bl_ui.properties_paint_common import sculpt_brush_texture_settings
+from bl_ui.properties_paint_common import brush_texture_settings
class View3DPanel():
@@ -108,6 +108,33 @@ class VIEW3D_PT_tools_objectmode(View3DPanel, Panel):
draw_repeat_tools(context, layout)
draw_gpencil_tools(context, layout)
+ col = layout.column(align=True)
+
+
+class VIEW3D_PT_tools_rigidbody(View3DPanel, Panel):
+ bl_context = "objectmode"
+ bl_label = "Rigidbody Tools"
+ bl_options = {'DEFAULT_CLOSED'}
+
+ def draw(self, context):
+ layout = self.layout
+
+ col = layout.column(align=True)
+ col.label(text="Add/Remove:")
+ row = col.row()
+ row.operator("rigidbody.objects_add", text="Add Active").type = 'ACTIVE'
+ row.operator("rigidbody.objects_add", text="Add Passive").type = 'PASSIVE'
+ row = col.row()
+ row.operator("rigidbody.objects_remove", text="Remove")
+
+ col = layout.column(align=True)
+ col.label(text="Object Tools:")
+ col.operator("rigidbody.shape_change", text="Change Shape")
+ col.operator("rigidbody.mass_calculate", text="Calculate Mass")
+ col.operator("rigidbody.object_settings_copy", text="Copy from Active")
+ col.operator("rigidbody.bake_to_keyframes", text="Bake To Keyframes")
+ col.label(text="Constraints:")
+ col.operator("rigidbody.connect", text="Connect")
# ********** default tools for editmode_mesh ****************
@@ -720,12 +747,10 @@ class VIEW3D_PT_tools_brush_texture(Panel, View3DPaintPanel):
col = layout.column()
col.template_ID_preview(brush, "texture", new="texture.new", rows=3, cols=8)
- if brush.use_paint_image:
- col.prop(brush, "use_fixed_texture")
- if context.sculpt_object:
- sculpt_brush_texture_settings(col, brush)
+ brush_texture_settings(col, brush, context.sculpt_object)
+ if context.sculpt_object:
# use_texture_overlay and texture_overlay_alpha
col = layout.column(align=True)
col.active = brush.sculpt_capabilities.has_overlay