diff options
Diffstat (limited to 'release/ui')
38 files changed, 1218 insertions, 1961 deletions
diff --git a/release/ui/bpy_ops.py b/release/ui/bpy_ops.py index dff8125fca1..aa9bfb460f0 100644 --- a/release/ui/bpy_ops.py +++ b/release/ui/bpy_ops.py @@ -5,18 +5,6 @@ from bpy.__ops__ import dir as op_dir from bpy.__ops__ import call as op_call from bpy.__ops__ import get_rna as op_get_rna -# Keep in sync with WM_types.h -context_dict = { - 'INVOKE_DEFAULT':0, - 'INVOKE_REGION_WIN':1, - 'INVOKE_AREA':2, - 'INVOKE_SCREEN':3, - 'EXEC_DEFAULT':4, - 'EXEC_REGION_WIN':5, - 'EXEC_AREA':6, - 'EXEC_SCREEN':7, -} - class bpy_ops(object): ''' Fake module like class. @@ -106,22 +94,10 @@ class bpy_ops_submodule_op(object): # submod.foo -> SUBMOD_OT_foo return self.module.upper() + '_OT_' + self.func - def __call__(self, *args, **kw): + def __call__(self, **kw): # Get the operator from blender - if len(args) > 1: - raise ValueError("only one argument for the execution context is supported ") - - if args: - try: - context = context_dict[args[0]] - except: - raise ValueError("Expected a single context argument in: " + str(list(context_dict.keys()))) - - return op_call(self.idname(), kw, context) - - else: - return op_call(self.idname(), kw) + return op_call(self.idname(), kw) def get_rna(self): ''' diff --git a/release/ui/buttons_data_armature.py b/release/ui/buttons_data_armature.py index 5924a2eb4ea..9b640776a9e 100644 --- a/release/ui/buttons_data_armature.py +++ b/release/ui/buttons_data_armature.py @@ -2,8 +2,8 @@ import bpy class DataButtonsPanel(bpy.types.Panel): - __space_type__ = 'PROPERTIES' - __region_type__ = 'WINDOW' + __space_type__ = "PROPERTIES" + __region_type__ = "WINDOW" __context__ = "data" def poll(self, context): @@ -41,22 +41,21 @@ class DATA_PT_skeleton(DataButtonsPanel): split = layout.split() col = split.column() - col.itemL(text="Layers:") - col.itemR(arm, "layer", text="") - col.itemL(text="Protected Layers:") - col.itemR(arm, "layer_protection", text="") - col.itemL(text="Edit Options:") - col.itemR(arm, "x_axis_mirror") - col.itemR(arm, "auto_ik") - - col = split.column() col.itemR(arm, "rest_position") col.itemL(text="Deform:") col.itemR(arm, "deform_vertexgroups", text="Vertex Groups") col.itemR(arm, "deform_envelope", text="Envelopes") col.itemR(arm, "deform_quaternion", text="Quaternion") col.itemR(arm, "deform_bbone_rest", text="B-Bones Rest") - + #col.itemR(arm, "x_axis_mirror") + #col.itemR(arm, "auto_ik") + + col = split.column() + col.itemL(text="Layers:") + col.template_layers(arm, "layer") + col.itemL(text="Protected Layers:") + col.template_layers(arm, "layer_protection") + class DATA_PT_display(DataButtonsPanel): __label__ = "Display" @@ -84,15 +83,15 @@ class DATA_PT_bone_groups(DataButtonsPanel): layout = self.layout ob = context.object - pose = ob.pose + pose= ob.pose row = layout.row() row.template_list(pose, "bone_groups", pose, "active_bone_group_index") col = row.column(align=True) col.active = (ob.proxy == None) - col.itemO("pose.group_add", icon='ICON_ZOOMIN', text="") - col.itemO("pose.group_remove", icon='ICON_ZOOMOUT', text="") + col.itemO("pose.group_add", icon="ICON_ZOOMIN", text="") + col.itemO("pose.group_remove", icon="ICON_ZOOMOUT", text="") group = pose.active_bone_group if group: @@ -155,7 +154,7 @@ class DATA_PT_ghost(DataButtonsPanel): split = layout.split() col = split.column() - col.itemR(arm, "ghost_type", text="") + col.itemR(arm, "ghost_type", text="Scope") sub = col.column(align=True) if arm.ghost_type == 'RANGE': diff --git a/release/ui/buttons_data_bone.py b/release/ui/buttons_data_bone.py index 0d379a4788f..1eb09377892 100644 --- a/release/ui/buttons_data_bone.py +++ b/release/ui/buttons_data_bone.py @@ -2,8 +2,8 @@ import bpy class BoneButtonsPanel(bpy.types.Panel): - __space_type__ = 'PROPERTIES' - __region_type__ = 'WINDOW' + __space_type__ = "PROPERTIES" + __region_type__ = "WINDOW" __context__ = "bone" def poll(self, context): @@ -20,7 +20,7 @@ class BONE_PT_context_bone(BoneButtonsPanel): bone = context.edit_bone row = layout.row() - row.itemL(text="", icon='ICON_BONE_DATA') + row.itemL(text="", icon="ICON_BONE_DATA") row.itemR(bone, "name", text="") class BONE_PT_transform(BoneButtonsPanel): @@ -74,15 +74,10 @@ 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 - pchan = None - else: - pchan = ob.pose.pose_channels[context.bone.name] split = layout.split() @@ -92,14 +87,14 @@ class BONE_PT_bone(BoneButtonsPanel): col.itemR(bone, "parent", text="") else: col.item_pointerR(bone, "parent", arm, "edit_bones", text="") - + row = col.row() row.active = bone.parent != None row.itemR(bone, "connected") - + col.itemL(text="Layers:") - col.itemR(bone, "layer", text="") - + col.template_layers(bone, "layer") + col = split.column() col.itemL(text="Inherit:") col.itemR(bone, "hinge", text="Rotation") @@ -107,17 +102,6 @@ class BONE_PT_bone(BoneButtonsPanel): col.itemL(text="Display:") 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" @@ -194,18 +178,18 @@ class BONE_PT_deform(BoneButtonsPanel): __default_closed__ = True def draw_header(self, context): - bone = context.bone + layout = self.layout + bone = context.bone if not bone: bone = context.edit_bone - self.layout.itemR(bone, "deform", text="") + layout.itemR(bone, "deform", text="") def draw(self, context): layout = self.layout bone = context.bone - if not bone: bone = context.edit_bone diff --git a/release/ui/buttons_data_camera.py b/release/ui/buttons_data_camera.py index aa107d8dbdd..f2fa4207ec8 100644 --- a/release/ui/buttons_data_camera.py +++ b/release/ui/buttons_data_camera.py @@ -2,12 +2,12 @@ import bpy class DataButtonsPanel(bpy.types.Panel): - __space_type__ = 'PROPERTIES' - __region_type__ = 'WINDOW' + __space_type__ = "PROPERTIES" + __region_type__ = "WINDOW" __context__ = "data" def poll(self, context): - return (context.camera) + return (context.camera != None) class DATA_PT_context_camera(DataButtonsPanel): __show_header__ = False @@ -49,7 +49,7 @@ class DATA_PT_camera(DataButtonsPanel): elif cam.type == 'ORTHO': row.itemR(cam, "ortho_scale") - layout.itemR(cam, "panorama") + layout.itemR(cam, "panorama"); split = layout.split() diff --git a/release/ui/buttons_data_curve.py b/release/ui/buttons_data_curve.py index 1124dfd1ae8..35d557afe32 100644 --- a/release/ui/buttons_data_curve.py +++ b/release/ui/buttons_data_curve.py @@ -2,28 +2,13 @@ import bpy class DataButtonsPanel(bpy.types.Panel): - __space_type__ = 'PROPERTIES' - __region_type__ = 'WINDOW' + __space_type__ = "PROPERTIES" + __region_type__ = "WINDOW" __context__ = "data" def poll(self, context): - return (context.object and context.object.type in ('CURVE', 'SURFACE') and context.curve) - -class DataButtonsPanelCurve(DataButtonsPanel): - ''' - Same as above but for curves only - ''' - def poll(self, context): return (context.object and context.object.type == 'CURVE' and context.curve) -class DataButtonsPanelActive(DataButtonsPanel): - ''' - Same as above but for curves only - ''' - def poll(self, context): - curve = context.curve - return (curve and curve.active_spline) - class DATA_PT_context_curve(DataButtonsPanel): __show_header__ = False @@ -52,170 +37,119 @@ class DATA_PT_shape_curve(DataButtonsPanel): ob = context.object curve = context.curve space = context.space_data - is_surf = (ob.type == 'SURFACE') - if not is_surf: - row = layout.row() - row.itemR(curve, "curve_2d") - row.itemR(curve, "use_twist_correction") - - split = layout.split() - - col = split.column() + if curve: + layout.itemR(curve, "curve_2d") + + split = layout.split() - if not is_surf: - sub = col.column() - sub.active = curve.curve_2d - sub.itemL(text="Caps:") - row = sub.row() - row.itemR(curve, "front") - row.itemR(curve, "back") + col = split.column() + colsub = col.column() + colsub.active = curve.curve_2d + colsub.itemL(text="Caps:") + colsub.itemR(curve, "front") + colsub.itemR(curve, "back") - col.itemL(text="Textures:") -# col.itemR(curve, "uv_orco") - col.itemR(curve, "auto_texspace") + col.itemL(text="Textures:") +# col.itemR(curve, "uv_orco") + col.itemR(curve, "auto_texspace") - col = split.column() - col.itemL(text="Resolution:") - sub = col.column(align=True) - sub.itemR(curve, "resolution_u", text="Preview U") - sub.itemR(curve, "render_resolution_u", text="Render U") - - if is_surf: - sub = col.column(align=True) + sub = split.column() + sub.itemL(text="Resolution:") + sub.itemR(curve, "resolution_u", text="Preview U") sub.itemR(curve, "resolution_v", text="Preview V") + sub.itemR(curve, "render_resolution_u", text="Render U") sub.itemR(curve, "render_resolution_v", text="Render V") - -# col.itemL(text="Display:") -# col.itemL(text="HANDLES") -# col.itemL(text="NORMALS") -# col.itemR(curve, "vertex_normal_flip") +# sub.itemL(text="Display:") +# sub.itemL(text="HANDLES") +# sub.itemL(text="NORMALS") +# sub.itemR(curve, "vertex_normal_flip") -class DATA_PT_geometry_curve(DataButtonsPanelCurve): +class DATA_PT_geometry_curve(DataButtonsPanel): __label__ = "Geometry " def draw(self, context): layout = self.layout curve = context.curve - + split = layout.split() - col = split.column() - col.itemL(text="Modification:") - col.itemR(curve, "width") - col.itemR(curve, "extrude") - col.itemR(curve, "taper_object", icon='ICON_OUTLINER_OB_CURVE') - - col = split.column() - col.itemL(text="Bevel:") - col.itemR(curve, "bevel_depth", text="Depth") - col.itemR(curve, "bevel_resolution", text="Resolution") - col.itemR(curve, "bevel_object", icon='ICON_OUTLINER_OB_CURVE') - + sub = split.column() + sub.itemL(text="Modification:") + sub.itemR(curve, "width") + sub.itemR(curve, "extrude") + sub.itemR(curve, "taper_object", icon="ICON_OUTLINER_OB_CURVE") + + sub = split.column() + sub.itemL(text="Bevel:") + sub.itemR(curve, "bevel_depth", text="Depth") + sub.itemR(curve, "bevel_resolution", text="Resolution") + sub.itemR(curve, "bevel_object", icon="ICON_OUTLINER_OB_CURVE") -class DATA_PT_pathanim(DataButtonsPanelCurve): +class DATA_PT_pathanim(DataButtonsPanel): __label__ = "Path Animation" def draw_header(self, context): + layout = self.layout + curve = context.curve - self.layout.itemR(curve, "use_path", text="") + layout.itemR(curve, "path", text="") def draw(self, context): layout = self.layout curve = context.curve - layout.active = curve.use_path + layout.active = curve.path split = layout.split() col = split.column() col.itemR(curve, "path_length", text="Frames") - col.itemR(curve, "use_path_follow") + col.itemR(curve, "follow") col = split.column() - col.itemR(curve, "use_stretch") - col.itemR(curve, "use_time_offset", text="Offset Children") + col.itemR(curve, "stretch") + col.itemR(curve, "offset_path_distance", text="Offset Children") -class DATA_PT_active_spline(DataButtonsPanelActive): - __label__ = "Active Spline" +class DATA_PT_current_curve(DataButtonsPanel): + __label__ = "Current Curve" def draw(self, context): layout = self.layout - ob = context.object - curve = context.curve - act_spline = curve.active_spline - is_surf = (ob.type == 'SURFACE') - is_poly = (act_spline.type == 'POLY') - + currentcurve = context.curve.curves[0] # XXX + split = layout.split() + + col = split.column() + col.itemL(text="Cyclic:") + col.itemR(currentcurve, "cyclic_u", text="U") + col.itemR(currentcurve, "cyclic_v", text="V") + col.itemL(text="Order:") + col.itemR(currentcurve, "order_u", text="U") + col.itemR(currentcurve, "order_v", text="V") + col.itemL(text="Endpoints:") + col.itemR(currentcurve, "endpoint_u", text="U") + col.itemR(currentcurve, "endpoint_v", text="V") - if is_poly: - # These settings are below but its easier to have - # poly's set aside since they use so few settings - col = split.column() - col.itemL(text="Cyclic:") - col.itemR(act_spline, "smooth") - col = split.column() - col.itemR(act_spline, "cyclic_u", text="U") + col = split.column() + col.itemL(text="Bezier:") + col.itemR(currentcurve, "bezier_u", text="U") + col.itemR(currentcurve, "bezier_v", text="V") + col.itemL(text="Resolution:") + col.itemR(currentcurve, "resolution_u", text="U") + col.itemR(currentcurve, "resolution_v", text="V") + col.itemL(text="Interpolation:") + col.itemR(currentcurve, "tilt_interpolation", text="Tilt") + col.itemR(currentcurve, "radius_interpolation", text="Tilt") + col.itemR(currentcurve, "smooth") - else: - col = split.column() - col.itemL(text="Cyclic:") - if act_spline.type == 'NURBS': - col.itemL(text="Bezier:") - col.itemL(text="Endpoint:") - col.itemL(text="Order:") - - col.itemL(text="Resolution:") - - col = split.column() - col.itemR(act_spline, "cyclic_u", text="U") - - if act_spline.type == 'NURBS': - sub = col.column() - # sub.active = (not act_spline.cyclic_u) - sub.itemR(act_spline, "bezier_u", text="U") - sub.itemR(act_spline, "endpoint_u", text="U") - - sub = col.column() - sub.itemR(act_spline, "order_u", text="U") - col.itemR(act_spline, "resolution_u", text="U") - - if is_surf: - col = split.column() - col.itemR(act_spline, "cyclic_v", text="V") - - # its a surface, assume its a nurb. - sub = col.column() - sub.active = (not act_spline.cyclic_v) - sub.itemR(act_spline, "bezier_v", text="V") - sub.itemR(act_spline, "endpoint_v", text="V") - sub = col.column() - sub.itemR(act_spline, "order_v", text="V") - sub.itemR(act_spline, "resolution_v", text="V") - - - if not is_surf: - split = layout.split() - col = split.column() - col.active = (not curve.curve_2d) - - col.itemL(text="Interpolation:") - col.itemR(act_spline, "tilt_interpolation", text="Tilt") - col.itemR(act_spline, "radius_interpolation", text="Radius") - - split = layout.split() - col = split.column() - col.itemR(act_spline, "smooth") - - bpy.types.register(DATA_PT_context_curve) bpy.types.register(DATA_PT_shape_curve) bpy.types.register(DATA_PT_geometry_curve) bpy.types.register(DATA_PT_pathanim) -bpy.types.register(DATA_PT_active_spline) +bpy.types.register(DATA_PT_current_curve) diff --git a/release/ui/buttons_data_empty.py b/release/ui/buttons_data_empty.py index 402699f82a4..02fea15dc2a 100644 --- a/release/ui/buttons_data_empty.py +++ b/release/ui/buttons_data_empty.py @@ -2,8 +2,8 @@ import bpy class DataButtonsPanel(bpy.types.Panel): - __space_type__ = 'PROPERTIES' - __region_type__ = 'WINDOW' + __space_type__ = "PROPERTIES" + __region_type__ = "WINDOW" __context__ = "data" def poll(self, context): @@ -17,7 +17,7 @@ class DATA_PT_empty(DataButtonsPanel): ob = context.object - layout.itemR(ob, "empty_draw_type", text="Draw Type") - layout.itemR(ob, "empty_draw_size", text="Draw Size") + layout.itemR(ob, "empty_draw_type") + layout.itemR(ob, "empty_draw_size") bpy.types.register(DATA_PT_empty)
\ No newline at end of file diff --git a/release/ui/buttons_data_lamp.py b/release/ui/buttons_data_lamp.py index 808a205b1b8..a00bb23d5b5 100644 --- a/release/ui/buttons_data_lamp.py +++ b/release/ui/buttons_data_lamp.py @@ -2,8 +2,8 @@ import bpy class DataButtonsPanel(bpy.types.Panel): - __space_type__ = 'PROPERTIES' - __region_type__ = 'WINDOW' + __space_type__ = "PROPERTIES" + __region_type__ = "WINDOW" __context__ = "data" def poll(self, context): @@ -13,7 +13,9 @@ class DATA_PT_preview(DataButtonsPanel): __label__ = "Preview" def draw(self, context): - self.layout.template_preview(context.lamp) + layout = self.layout + + layout.template_preview(context.lamp) class DATA_PT_context_lamp(DataButtonsPanel): __show_header__ = False @@ -67,7 +69,8 @@ class DATA_PT_lamp(DataButtonsPanel): if lamp.type == 'AREA': col.itemR(lamp, "distance") col.itemR(lamp, "gamma") - + + col = split.column() col.itemR(lamp, "negative") col.itemR(lamp, "layer", text="This Layer Only") @@ -296,12 +299,18 @@ class DATA_PT_falloff_curve(DataButtonsPanel): def poll(self, context): lamp = context.lamp - return (lamp and lamp.type in ('POINT', 'SPOT') and lamp.falloff_type == 'CUSTOM_CURVE') + if lamp and lamp.type in ('POINT', 'SPOT'): + if lamp.falloff_type == 'CUSTOM_CURVE': + return True + + return False def draw(self, context): + layout = self.layout + lamp = context.lamp - self.layout.template_curve_mapping(lamp.falloff_curve) + layout.template_curve_mapping(lamp.falloff_curve) bpy.types.register(DATA_PT_context_lamp) bpy.types.register(DATA_PT_preview) diff --git a/release/ui/buttons_data_lattice.py b/release/ui/buttons_data_lattice.py index 895c1a65bea..5d8a07c7d44 100644 --- a/release/ui/buttons_data_lattice.py +++ b/release/ui/buttons_data_lattice.py @@ -2,12 +2,12 @@ import bpy class DataButtonsPanel(bpy.types.Panel): - __space_type__ = 'PROPERTIES' - __region_type__ = 'WINDOW' + __space_type__ = "PROPERTIES" + __region_type__ = "WINDOW" __context__ = "data" def poll(self, context): - return (context.lattice) + return (context.lattice != None) class DATA_PT_context_lattice(DataButtonsPanel): __show_header__ = False diff --git a/release/ui/buttons_data_mesh.py b/release/ui/buttons_data_mesh.py index 33b3960b381..b681218a8fe 100644 --- a/release/ui/buttons_data_mesh.py +++ b/release/ui/buttons_data_mesh.py @@ -2,12 +2,12 @@ import bpy class DataButtonsPanel(bpy.types.Panel): - __space_type__ = 'PROPERTIES' - __region_type__ = 'WINDOW' + __space_type__ = "PROPERTIES" + __region_type__ = "WINDOW" __context__ = "data" def poll(self, context): - return (context.mesh) + return (context.mesh != None) class DATA_PT_context_mesh(DataButtonsPanel): __show_header__ = False @@ -48,6 +48,36 @@ class DATA_PT_normals(DataButtonsPanel): col.itemR(mesh, "vertex_normal_flip") col.itemR(mesh, "double_sided") +class DATA_PT_meshdraw(DataButtonsPanel): + __label__ = "Draw" + + def draw(self, context): + layout = self.layout + + mesh = context.mesh + + layout.itemL(text="Edit Mode only, WIP") + + split = layout.split() + + col = split.column() + col.itemR(mesh, "draw_edges", text="Edges") + col.itemR(mesh, "draw_faces", text="Faces") + col.itemR(mesh, "draw_creases", text="Creases") + col.itemR(mesh, "draw_bevel_weights", text="Bevel Weights") + col.itemR(mesh, "draw_seams", text="Seams") + col.itemR(mesh, "draw_sharp", text="Sharp") + + col = split.column() + col.itemR(mesh, "draw_normals", text="Face Normals") + col.itemR(mesh, "draw_vertex_normals", text="Vertex Normals") + + col.itemS() + + col.itemR(mesh, "draw_edge_lenght") + col.itemR(mesh, "draw_edge_angle") + col.itemR(mesh, "draw_face_area") + class DATA_PT_vertex_groups(DataButtonsPanel): __label__ = "Vertex Groups" @@ -63,19 +93,19 @@ class DATA_PT_vertex_groups(DataButtonsPanel): row.template_list(ob, "vertex_groups", ob, "active_vertex_group_index") col = row.column(align=True) - col.itemO("object.vertex_group_add", icon='ICON_ZOOMIN', text="") - col.itemO("object.vertex_group_remove", icon='ICON_ZOOMOUT', text="") + col.itemO("object.vertex_group_add", icon="ICON_ZOOMIN", text="") + col.itemO("object.vertex_group_remove", icon="ICON_ZOOMOUT", text="") - col.itemO("object.vertex_group_copy", icon='ICON_BLANK1', text="") + col.itemO("object.vertex_group_copy", icon="ICON_BLANK1", text="") if ob.data.users > 1: - col.itemO("object.vertex_group_copy_to_linked", icon='ICON_BLANK1', text="") + col.itemO("object.vertex_group_copy_to_linked", icon="ICON_BLANK1", text="") group = ob.active_vertex_group if group: row = layout.row() row.itemR(group, "name") - if ob.mode == 'EDIT': + if context.edit_object: row = layout.row() sub = row.row(align=True) @@ -102,20 +132,20 @@ class DATA_PT_shape_keys(DataButtonsPanel): kb = ob.active_shape_key row = layout.row() - row.template_list(key, "keys", ob, "active_shape_key_index", rows=2) + row.template_list(key, "keys", ob, "active_shape_key_index") col = row.column() subcol = col.column(align=True) - subcol.itemO("object.shape_key_add", icon='ICON_ZOOMIN', text="") - subcol.itemO("object.shape_key_remove", icon='ICON_ZOOMOUT', text="") + subcol.itemO("object.shape_key_add", icon="ICON_ZOOMIN", text="") + subcol.itemO("object.shape_key_remove", icon="ICON_ZOOMOUT", text="") if kb: col.itemS() subcol = col.column(align=True) - subcol.itemR(ob, "shape_key_lock", icon='ICON_UNPINNED', text="") - subcol.itemR(kb, "mute", icon='ICON_MUTE_IPO_ON', text="") + subcol.itemR(ob, "shape_key_lock", icon="ICON_UNPINNED", text="") + subcol.itemR(kb, "mute", icon="ICON_MUTE_IPO_ON", text="") if key.relative: row = layout.row() @@ -150,7 +180,7 @@ class DATA_PT_shape_keys(DataButtonsPanel): layout.itemR(kb, "name") - if ob.mode == 'EDIT': + if context.edit_object: layout.enabled = False class DATA_PT_uv_texture(DataButtonsPanel): @@ -167,8 +197,8 @@ class DATA_PT_uv_texture(DataButtonsPanel): col.template_list(me, "uv_textures", me, "active_uv_texture_index", rows=2) col = row.column(align=True) - col.itemO("mesh.uv_texture_add", icon='ICON_ZOOMIN', text="") - col.itemO("mesh.uv_texture_remove", icon='ICON_ZOOMOUT', text="") + col.itemO("mesh.uv_texture_add", icon="ICON_ZOOMIN", text="") + col.itemO("mesh.uv_texture_remove", icon="ICON_ZOOMOUT", text="") lay = me.active_uv_texture if lay: @@ -188,8 +218,8 @@ class DATA_PT_vertex_colors(DataButtonsPanel): col.template_list(me, "vertex_colors", me, "active_vertex_color_index", rows=2) col = row.column(align=True) - col.itemO("mesh.vertex_color_add", icon='ICON_ZOOMIN', text="") - col.itemO("mesh.vertex_color_remove", icon='ICON_ZOOMOUT', text="") + col.itemO("mesh.vertex_color_add", icon="ICON_ZOOMIN", text="") + col.itemO("mesh.vertex_color_remove", icon="ICON_ZOOMOUT", text="") lay = me.active_vertex_color if lay: @@ -197,6 +227,7 @@ class DATA_PT_vertex_colors(DataButtonsPanel): bpy.types.register(DATA_PT_context_mesh) bpy.types.register(DATA_PT_normals) +bpy.types.register(DATA_PT_meshdraw) bpy.types.register(DATA_PT_vertex_groups) bpy.types.register(DATA_PT_shape_keys) bpy.types.register(DATA_PT_uv_texture) diff --git a/release/ui/buttons_data_metaball.py b/release/ui/buttons_data_metaball.py index 88c0066c67f..e31c3d7fcd0 100644 --- a/release/ui/buttons_data_metaball.py +++ b/release/ui/buttons_data_metaball.py @@ -1,8 +1,8 @@ import bpy class DataButtonsPanel(bpy.types.Panel): - __space_type__ = 'PROPERTIES' - __region_type__ = 'WINDOW' + __space_type__ = "PROPERTIES" + __region_type__ = "WINDOW" __context__ = "data" def poll(self, context): diff --git a/release/ui/buttons_data_modifier.py b/release/ui/buttons_data_modifier.py index 2835f55f71a..436baa540d4 100644 --- a/release/ui/buttons_data_modifier.py +++ b/release/ui/buttons_data_modifier.py @@ -2,8 +2,8 @@ import bpy class DataButtonsPanel(bpy.types.Panel): - __space_type__ = 'PROPERTIES' - __region_type__ = 'WINDOW' + __space_type__ = "PROPERTIES" + __region_type__ = "WINDOW" __context__ = "modifier" class DATA_PT_modifiers(DataButtonsPanel): @@ -27,7 +27,6 @@ class DATA_PT_modifiers(DataButtonsPanel): # the mt.type enum is (ab)used for a lookup on function names # ...to avoid lengthy if statements # so each type must have a function here. - def ARMATURE(self, layout, ob, md): layout.itemR(md, "object") @@ -171,7 +170,7 @@ class DATA_PT_modifiers(DataButtonsPanel): if md.texture_coordinates == 'OBJECT': layout.itemR(md, "texture_coordinate_object", text="Object") elif md.texture_coordinates == 'UV' and ob.type == 'MESH': - layout.item_pointerR(md, "uv_layer", ob.data, "uv_textures") + layout.item_pointerR(md, "uv_layer", ob.data, "uv_layers") def EDGE_SPLIT(self, layout, ob, md): split = layout.split() @@ -188,40 +187,21 @@ class DATA_PT_modifiers(DataButtonsPanel): def EXPLODE(self, layout, ob, md): layout.item_pointerR(md, "vertex_group", ob, "vertex_groups") layout.itemR(md, "protect") - - flow = layout.column_flow(2) - flow.itemR(md, "split_edges") - flow.itemR(md, "unborn") - flow.itemR(md, "alive") - flow.itemR(md, "dead") - - layout.itemO("object.explode_refresh", text="Refresh"); + layout.itemR(md, "split_edges") + layout.itemR(md, "unborn") + layout.itemR(md, "alive") + layout.itemR(md, "dead") + # Missing: "Refresh" and "Clear Vertex Group" Operator def FLUID_SIMULATION(self, layout, ob, md): layout.itemL(text="See Fluid panel.") def HOOK(self, layout, ob, md): - col = layout.column() - col.itemR(md, "object") - if md.object and md.object.type == 'ARMATURE': - layout.item_pointerR(md, "subtarget", md.object.data, "bones", text="Bone") - + layout.itemR(md, "falloff") + layout.itemR(md, "force", slider=True) + layout.itemR(md, "object") layout.item_pointerR(md, "vertex_group", ob, "vertex_groups") - - split = layout.split() - split.itemR(md, "falloff") - split.itemR(md, "force", slider=True) - - layout.itemS() - - row = layout.row() - row.itemO("object.hook_reset", text="Reset") - row.itemO("object.hook_recenter", text="Recenter") - - if ob.mode == 'EDIT': - row = layout.row() - row.itemO("object.hook_select", text="Select") - row.itemO("object.hook_assign", text="Assign") + # Missing: "Reset" and "Recenter" Operator def LATTICE(self, layout, ob, md): layout.itemR(md, "object") @@ -242,7 +222,7 @@ class DATA_PT_modifiers(DataButtonsPanel): layout.itemS() - layout.itemO("object.meshdeform_bind", text="Bind") + layout.itemO("object.modifier_mdef_bind", text="Bind") row = layout.row() row.itemR(md, "precision") row.itemR(md, "dynamic") @@ -269,11 +249,7 @@ class DATA_PT_modifiers(DataButtonsPanel): def MULTIRES(self, layout, ob, md): layout.itemR(md, "subdivision_type") - - row = layout.row() - row.itemO("object.multires_subdivide", text="Subdivide") - row.itemO("object.multires_higher_levels_delete", text="Delete Higher") - + layout.itemO("object.multires_subdivide", text="Subdivide") layout.itemR(md, "level") def PARTICLE_INSTANCE(self, layout, ob, md): @@ -370,26 +346,16 @@ class DATA_PT_modifiers(DataButtonsPanel): def UV_PROJECT(self, layout, ob, md): if ob.type == 'MESH': - layout.item_pointerR(md, "uv_layer", ob.data, "uv_textures") + layout.item_pointerR(md, "uv_layer", ob.data, "uv_layers") + #layout.itemR(md, "projectors") layout.itemR(md, "image") layout.itemR(md, "override_image") - - split = layout.split() - - col = split.column() - col.itemL(text="Aspect Ratio:") - - sub = col.column(align=True) - sub.itemR(md, "horizontal_aspect_ratio", text="Horizontal") - sub.itemR(md, "vertical_aspect_ratio", text="Vertical") - - col = split.column() - col.itemL(text="Projectors:") - - sub = col.column(align=True) - sub.itemR(md, "num_projectors", text="Number") - for proj in md.projectors: - sub.itemR(proj, "object", text="") + layout.itemL(text="Aspect Ratio:") + col = layout.column(align=True) + col.itemR(md, "horizontal_aspect_ratio", text="Horizontal") + col.itemR(md, "vertical_aspect_ratio", text="Vertical") + + #"Projectors" don't work. def WAVE(self, layout, ob, md): split = layout.split() @@ -402,41 +368,29 @@ class DATA_PT_modifiers(DataButtonsPanel): col = split.column() col.itemR(md, "normals") - sub = col.column() + sub = col.row(align=True) sub.active = md.normals - sub.itemR(md, "x_normal", text="X") - sub.itemR(md, "y_normal", text="Y") - sub.itemR(md, "z_normal", text="Z") - - 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") + 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) - layout.itemS() + 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") layout.itemR(md, "start_position_object") layout.item_pointerR(md, "vertex_group", ob, "vertex_groups") layout.itemR(md, "texture") layout.itemR(md, "texture_coordinates") if md.texture_coordinates == 'MAP_UV' and ob.type == 'MESH': - layout.item_pointerR(md, "uv_layer", ob.data, "uv_textures") + layout.item_pointerR(md, "uv_layer", ob.data, "uv_layers") 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) diff --git a/release/ui/buttons_data_text.py b/release/ui/buttons_data_text.py index d0e7ea09a92..754d6fcda39 100644 --- a/release/ui/buttons_data_text.py +++ b/release/ui/buttons_data_text.py @@ -2,8 +2,8 @@ import bpy class DataButtonsPanel(bpy.types.Panel): - __space_type__ = 'PROPERTIES' - __region_type__ = 'WINDOW' + __space_type__ = "PROPERTIES" + __region_type__ = "WINDOW" __context__ = "data" def poll(self, context): @@ -38,31 +38,29 @@ class DATA_PT_shape_text(DataButtonsPanel): curve = context.curve space = context.space_data - layout.itemR(curve, "curve_2d") + if curve: + layout.itemR(curve, "curve_2d") - split = layout.split() - - col = split.column() - col.itemL(text="Caps:") - row = col.row() - row .itemR(curve, "front") - row .itemR(curve, "back") - # col = split.column() - col.itemL(text="Textures:") - col.itemR(curve, "uv_orco") - col.itemR(curve, "auto_texspace") + split = layout.split() + + col = split.column() + col.itemL(text="Caps:") + col.itemR(curve, "front") + col.itemR(curve, "back") + col.itemL(text="Textures:") + col.itemR(curve, "uv_orco") + col.itemR(curve, "auto_texspace") - col = split.column() - col.itemL(text="Resolution:") - sub = col.column(align=True) - sub.itemR(curve, "resolution_u", text="Preview U") - sub.itemR(curve, "render_resolution_u", text="Render U") - - # resolution_v is not used for text - - sub = col.column(align=True) - col.itemL(text="Display:") - col.itemR(curve, "fast", text="Fast Editing") + col = split.column() + col.itemL(text="Resolution:") + sub = col.column(align=True) + sub.itemR(curve, "resolution_u", text="Preview U") + sub.itemR(curve, "render_resolution_u", text="Render U") + sub = col.column(align=True) + sub.itemR(curve, "resolution_v", text="Preview V") + sub.itemR(curve, "render_resolution_v", text="Render V") + col.itemL(text="Display:") + col.itemR(curve, "fast") class DATA_PT_geometry_text(DataButtonsPanel): __label__ = "Geometry" @@ -78,15 +76,13 @@ class DATA_PT_geometry_text(DataButtonsPanel): col.itemL(text="Modification:") col.itemR(curve, "width") col.itemR(curve, "extrude") - col.itemL(text="Taper Object:") - col.itemR(curve, "taper_object", text="") + col.itemR(curve, "taper_object") col = split.column() col.itemL(text="Bevel:") col.itemR(curve, "bevel_depth", text="Depth") col.itemR(curve, "bevel_resolution", text="Resolution") - col.itemL(text="Bevel Object:") - col.itemR(curve, "bevel_object", text="") + col.itemR(curve, "bevel_object") class DATA_PT_font(DataButtonsPanel): __label__ = "Font" @@ -95,39 +91,27 @@ class DATA_PT_font(DataButtonsPanel): layout = self.layout text = context.curve - char = context.curve.edit_format layout.itemR(text, "font") - row = layout.row() - row.itemR(text, "text_size", text="Size") - row.itemR(text, "shear") - split = layout.split() col = split.column() - col.itemL(text="Object Font:") - col.itemR(text, "family", text="") + # col.itemR(text, "style") + # col.itemR(text, "bold") + # col.itemR(text, "italic") + # col.itemR(text, "underline") + # ToDo: These settings are in a sub struct (Edit Format). + col.itemR(text, "text_size") + col.itemR(text, "shear") col = split.column() - col.itemL(text="Text on Curve:") - col.itemR(text, "text_on_curve", text="") - - split = layout.split() - - col = split.column() - col.itemL(text="Character:") - col.itemR(char, "bold") - col.itemR(char, "italic") - col.itemR(char, "underline") -# col.itemR(char, "style") -# col.itemR(char, "wrap") - - col = split.column(align=True) + col.itemR(text, "text_on_curve") + col.itemR(text, "family") col.itemL(text="Underline:") col.itemR(text, "ul_position", text="Position") - col.itemR(text, "ul_height", text="Thickness") - + col.itemR(text, "ul_height", text="Height") + # col.itemR(text, "edit_format") class DATA_PT_paragraph(DataButtonsPanel): __label__ = "Paragraph" @@ -150,34 +134,23 @@ class DATA_PT_paragraph(DataButtonsPanel): col = split.column(align=True) col.itemL(text="Offset:") - col.itemR(text, "offset_x", text="X") - col.itemR(text, "offset_y", text="Y") - + col.itemR(text, "x_offset", text="X") + col.itemR(text, "y_offset", text="Y") + #col.itemR(text, "wrap") +""" class DATA_PT_textboxes(DataButtonsPanel): - __label__ = "Text Boxes" + __label__ = "Text Boxes" - def draw(self, context): - layout = self.layout + def draw(self, context): + layout = self.layout - text = context.curve - - for box in text.textboxes: - split = layout.box().split() - - col = split.column(align=True) - col.itemL(text="Dimensions:") - col.itemR(box, "width", text="Width") - col.itemR(box, "height", text="Height") - - col = split.column(align=True) - col.itemL(text="Offset:") - col.itemR(box, "x", text="X") - col.itemR(box, "y", text="Y") + text = context.curve +""" bpy.types.register(DATA_PT_context_text) bpy.types.register(DATA_PT_shape_text) bpy.types.register(DATA_PT_geometry_text) bpy.types.register(DATA_PT_font) bpy.types.register(DATA_PT_paragraph) -bpy.types.register(DATA_PT_textboxes) +#bpy.types.register(DATA_PT_textboxes) diff --git a/release/ui/buttons_game.py b/release/ui/buttons_game.py index 73ba566e23f..7334b453e91 100644 --- a/release/ui/buttons_game.py +++ b/release/ui/buttons_game.py @@ -2,8 +2,8 @@ import bpy class PhysicsButtonsPanel(bpy.types.Panel): - __space_type__ = 'PROPERTIES' - __region_type__ = 'WINDOW' + __space_type__ = "PROPERTIES" + __region_type__ = "WINDOW" __context__ = "physics" def poll(self, context): @@ -45,9 +45,10 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel): col = split.column() col.itemL(text="Attributes:") - col.itemR(game, "mass") - col.itemR(game, "radius") - col.itemR(game, "form_factor") + sub = col.column() + sub.itemR(game, "mass") + sub.itemR(game, "radius") + sub.itemR(game, "form_factor") col = split.column() sub = col.column() @@ -107,7 +108,8 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel): col.itemR(soft, "dynamic_friction", slider=True) col.itemR(soft, "margin", slider=True) col.itemR(soft, "bending_const", text="Bending Constraints") - + + col = split.column() col.itemR(soft, "shape_match") sub = col.column() @@ -132,26 +134,32 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel): elif game.physics_type in ('SENSOR', 'INVISIBLE', 'NO_COLLISION', 'OCCLUDE'): - layout.itemR(ob, "restrict_render", text="Invisible") + col = layout.column() + col.itemR(ob, "restrict_render", text="Invisible") class PHYSICS_PT_game_collision_bounds(PhysicsButtonsPanel): __label__ = "Collision Bounds" def poll(self, context): - game = context.object.game + ob = context.active_object + game = ob.game rd = context.scene.render_data return (game.physics_type in ('DYNAMIC', 'RIGID_BODY', 'SENSOR', 'SOFT_BODY', 'STATIC')) and (rd.engine == 'BLENDER_GAME') def draw_header(self, context): - game = context.active_object.game + layout = self.layout + + ob = context.active_object + game = ob.game - self.layout.itemR(game, "use_collision_bounds", text="") + layout.itemR(game, "use_collision_bounds", text="") def draw(self, context): layout = self.layout - game = context.active_object.game - + ob = context.scene.objects[0] + game = ob.game + layout.active = game.use_collision_bounds layout.itemR(game, "collision_bounds", text="Bounds") @@ -163,8 +171,8 @@ bpy.types.register(PHYSICS_PT_game_physics) bpy.types.register(PHYSICS_PT_game_collision_bounds) class SceneButtonsPanel(bpy.types.Panel): - __space_type__ = 'PROPERTIES' - __region_type__ = 'WINDOW' + __space_type__ = "PROPERTIES" + __region_type__ = "WINDOW" __context__ = "scene" def poll(self, context): @@ -176,6 +184,8 @@ class SCENE_PT_game(SceneButtonsPanel): def draw(self, context): layout = self.layout + + rd = context.scene.render_data row = layout.row() row.itemO("view3d.game_start", text="Start") @@ -312,8 +322,8 @@ bpy.types.register(SCENE_PT_game_shading) bpy.types.register(SCENE_PT_game_performance) class WorldButtonsPanel(bpy.types.Panel): - __space_type__ = 'PROPERTIES' - __region_type__ = 'WINDOW' + __space_type__ = "PROPERTIES" + __region_type__ = "WINDOW" __context__ = "world" def poll(self, context): diff --git a/release/ui/buttons_material.py b/release/ui/buttons_material.py index dc11731d7a9..b971a678926 100644 --- a/release/ui/buttons_material.py +++ b/release/ui/buttons_material.py @@ -2,22 +2,24 @@ import bpy class MaterialButtonsPanel(bpy.types.Panel): - __space_type__ = 'PROPERTIES' - __region_type__ = 'WINDOW' + __space_type__ = "PROPERTIES" + __region_type__ = "WINDOW" __context__ = "material" # COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here def poll(self, context): - mat = context.material - engine = context.scene.render_data.engine - return mat and (engine in self.COMPAT_ENGINES) + return (context.material) and (context.scene.render_data.engine in self.COMPAT_ENGINES) class MATERIAL_PT_preview(MaterialButtonsPanel): __label__ = "Preview" COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME']) def draw(self, context): - self.layout.template_preview(context.material) + layout = self.layout + + mat = context.material + + layout.template_preview(mat) class MATERIAL_PT_context_material(MaterialButtonsPanel): __show_header__ = False @@ -27,8 +29,7 @@ class MATERIAL_PT_context_material(MaterialButtonsPanel): # An exception, dont call the parent poll func because # this manages materials for all engine types - engine = context.scene.render_data.engine - return (context.object) and (engine in self.COMPAT_ENGINES) + return (context.object) and (context.scene.render_data.engine in self.COMPAT_ENGINES) def draw(self, context): layout = self.layout @@ -44,10 +45,10 @@ class MATERIAL_PT_context_material(MaterialButtonsPanel): row.template_list(ob, "materials", ob, "active_material_index", rows=2) col = row.column(align=True) - col.itemO("object.material_slot_add", icon='ICON_ZOOMIN', text="") - col.itemO("object.material_slot_remove", icon='ICON_ZOOMOUT', text="") + col.itemO("object.material_slot_add", icon="ICON_ZOOMIN", text="") + col.itemO("object.material_slot_remove", icon="ICON_ZOOMOUT", text="") - if ob.mode == 'EDIT': + if context.edit_object: row = layout.row(align=True) row.itemO("object.material_slot_assign", text="Assign") row.itemO("object.material_slot_select", text="Select") @@ -72,36 +73,34 @@ class MATERIAL_PT_shading(MaterialButtonsPanel): __label__ = "Shading" COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME']) - def poll(self, context): - mat = context.material - engine = context.scene.render_data.engine - return mat and (mat.type in ('SURFACE', 'WIRE', 'HALO')) and (engine in self.COMPAT_ENGINES) - def draw(self, context): layout = self.layout mat = context.material + ob = context.object + slot = context.material_slot + space = context.space_data - if mat.type in ('SURFACE', 'WIRE'): - split = layout.split() + if mat: + + if mat.type in ('SURFACE', 'WIRE', 'VOLUME'): + split = layout.split() - col = split.column() - sub = col.column() - sub.active = not mat.shadeless - sub.itemR(mat, "emit") - sub.itemR(mat, "ambient") - sub = col.column() - sub.itemR(mat, "translucency") + col = split.column() + col.active = not mat.shadeless + col.itemR(mat, "ambient") + col.itemR(mat, "emit") + col.itemR(mat, "translucency") - col = split.column() - col.itemR(mat, "shadeless") - sub = col.column() - sub.active = not mat.shadeless - sub.itemR(mat, "tangent_shading") - sub.itemR(mat, "cubic") + col = split.column() + col.itemR(mat, "shadeless") + sub = col.column() + sub.active = not mat.shadeless + sub.itemR(mat, "tangent_shading") + sub.itemR(mat, "cubic") - elif mat.type == 'HALO': - layout.itemR(mat, "alpha") + elif mat.type == 'HALO': + layout.itemR(mat, "alpha") class MATERIAL_PT_strand(MaterialButtonsPanel): __label__ = "Strand" @@ -110,8 +109,7 @@ class MATERIAL_PT_strand(MaterialButtonsPanel): def poll(self, context): mat = context.material - engine = context.scene.render_data.engine - return mat and (mat.type in ('SURFACE', 'WIRE', 'HALO')) and (engine in self.COMPAT_ENGINES) + return mat and (mat.type in ('SURFACE', 'WIRE')) and (context.scene.render_data.engine in self.COMPAT_ENGINES) def draw(self, context): layout = self.layout @@ -121,22 +119,20 @@ class MATERIAL_PT_strand(MaterialButtonsPanel): split = layout.split() - col = split.column(align=True) + col = split.column() col.itemL(text="Size:") - col.itemR(tan, "root_size", text="Root") - col.itemR(tan, "tip_size", text="Tip") + col.itemR(tan, "start_size", text="Root") + col.itemR(tan, "end_size", text="Tip") col.itemR(tan, "min_size", text="Minimum") col.itemR(tan, "blender_units") sub = col.column() sub.active = (not mat.shadeless) sub.itemR(tan, "tangent_shading") - col.itemR(tan, "shape") col = split.column() - col.itemL(text="Shading:") + col.itemR(tan, "shape") col.itemR(tan, "width_fade") col.itemR(tan, "uv_layer") - col.itemS() sub = col.column() sub.active = (not mat.shadeless) sub.itemR(tan, "surface_diffuse") @@ -151,7 +147,8 @@ class MATERIAL_PT_physics(MaterialButtonsPanel): def draw(self, context): layout = self.layout - phys = context.material.physics + mat = context.material + phys = mat.physics split = layout.split() @@ -169,11 +166,6 @@ class MATERIAL_PT_options(MaterialButtonsPanel): __label__ = "Options" COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME']) - def poll(self, context): - mat = context.material - engine = context.scene.render_data.engine - return mat and (mat.type in ('SURFACE', 'WIRE', 'HALO')) and (engine in self.COMPAT_ENGINES) - def draw(self, context): layout = self.layout @@ -208,11 +200,6 @@ class MATERIAL_PT_shadow(MaterialButtonsPanel): __label__ = "Shadow" __default_closed__ = True COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME']) - - def poll(self, context): - mat = context.material - engine = context.scene.render_data.engine - return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES) def draw(self, context): layout = self.layout @@ -223,7 +210,7 @@ class MATERIAL_PT_shadow(MaterialButtonsPanel): col = split.column() col.itemR(mat, "shadows", text="Receive") - col.itemR(mat, "receive_transparent_shadows", text="Receive Transparent") + col.itemR(mat, "transparent_shadows", text="Receive Transparent") col.itemR(mat, "only_shadow", text="Shadows Only") col.itemR(mat, "cast_shadows_only", text="Cast Only") col.itemR(mat, "shadow_casting_alpha", text="Casting Alpha") @@ -237,6 +224,7 @@ class MATERIAL_PT_shadow(MaterialButtonsPanel): sub = col.column() sub.active = (not mat.ray_shadow_bias) sub.itemR(mat, "shadow_ray_bias", text="Ray Bias") + class MATERIAL_PT_diffuse(MaterialButtonsPanel): __label__ = "Diffuse" @@ -244,8 +232,7 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel): def poll(self, context): mat = context.material - engine = context.scene.render_data.engine - return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES) + return mat and (mat.type != 'HALO') and (context.scene.render_data.engine in self.COMPAT_ENGINES) def draw(self, context): layout = self.layout @@ -258,7 +245,7 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel): col.itemR(mat, "diffuse_color", text="") sub = col.column() sub.active = (not mat.shadeless) - sub.itemR(mat, "diffuse_intensity", text="Intensity") + sub.itemR(mat, "diffuse_reflection", text="Intensity") col = split.column() col.active = (not mat.shadeless) @@ -291,15 +278,15 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel): split = row.split(percentage=0.3) split.itemL(text="Blend:") split.itemR(mat, "diffuse_ramp_blend", text="") - + + class MATERIAL_PT_specular(MaterialButtonsPanel): __label__ = "Specular" COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME']) def poll(self, context): mat = context.material - engine = context.scene.render_data.engine - return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES) + return mat and (mat.type != 'HALO') and (context.scene.render_data.engine in self.COMPAT_ENGINES) def draw(self, context): layout = self.layout @@ -312,7 +299,7 @@ class MATERIAL_PT_specular(MaterialButtonsPanel): col = split.column() col.itemR(mat, "specular_color", text="") - col.itemR(mat, "specular_intensity", text="Intensity") + col.itemR(mat, "specular_reflection", text="Intensity") col = split.column() col.itemR(mat, "specular_shader", text="") @@ -351,15 +338,13 @@ class MATERIAL_PT_sss(MaterialButtonsPanel): def poll(self, context): mat = context.material - engine = context.scene.render_data.engine - return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES) + return mat and (mat.type in ('SURFACE', 'WIRE')) and (context.scene.render_data.engine in self.COMPAT_ENGINES) def draw_header(self, context): + layout = self.layout sss = context.material.subsurface_scattering - mat = context.material - - self.layout.active = (not mat.shadeless) - self.layout.itemR(sss, "enabled", text="") + + layout.itemR(sss, "enabled", text="") def draw(self, context): layout = self.layout @@ -372,22 +357,21 @@ class MATERIAL_PT_sss(MaterialButtonsPanel): split = layout.split() split.active = (not mat.shadeless) - col = split.column() - col.itemR(sss, "ior") - col.itemR(sss, "scale") + col = split.column(align=True) col.itemR(sss, "color", text="") - col.itemR(sss, "radius", text="RGB Radius") + col.itemL(text="Blend:") + col.itemR(sss, "color_factor", text="Color") + col.itemR(sss, "texture_factor", text="Texture") + col.itemL(text="Scattering Weight:") + col.itemR(sss, "front") + col.itemR(sss, "back") col = split.column() sub = col.column(align=True) - sub.itemL(text="Blend:") - sub.itemR(sss, "color_factor", text="Color") - sub.itemR(sss, "texture_factor", text="Texture") - sub.itemL(text="Scattering Weight:") - sub.itemR(sss, "front") - sub.itemR(sss, "back") - col.itemS() - col.itemR(sss, "error_tolerance", text="Error") + sub.itemR(sss, "ior") + sub.itemR(sss, "scale") + col.itemR(sss, "radius", text="RGB Radius") + col.itemR(sss, "error_tolerance") class MATERIAL_PT_mirror(MaterialButtonsPanel): __label__ = "Mirror" @@ -396,13 +380,14 @@ class MATERIAL_PT_mirror(MaterialButtonsPanel): def poll(self, context): mat = context.material - engine = context.scene.render_data.engine - return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES) + return mat and (mat.type in ('SURFACE', 'WIRE')) and (context.scene.render_data.engine in self.COMPAT_ENGINES) - def draw_header(self, context): + def draw_header(self, context): + layout = self.layout + raym = context.material.raytrace_mirror - self.layout.itemR(raym, "enabled", text="") + layout.itemR(raym, "enabled", text="") def draw(self, context): layout = self.layout @@ -415,35 +400,31 @@ class MATERIAL_PT_mirror(MaterialButtonsPanel): split = layout.split() col = split.column() - col.itemR(raym, "reflect_factor") + col.itemR(raym, "reflect", text="Reflectivity") col.itemR(mat, "mirror_color", text="") - - col = split.column() - col.itemR(raym, "fresnel") + col.itemL(text="Fresnel:") + col.itemR(raym, "fresnel", text="Amount") sub = col.column() sub.active = raym.fresnel > 0 sub.itemR(raym, "fresnel_factor", text="Blend") - - split = layout.split() - - col = split.column() col.itemS() - col.itemR(raym, "distance", text="Max Dist") - col.itemR(raym, "depth") col.itemS() sub = col.split(percentage=0.4) sub.itemL(text="Fade To:") sub.itemR(raym, "fade_to", text="") col = split.column() + col.itemR(raym, "depth") + col.itemR(raym, "distance", text="Max Dist") col.itemL(text="Gloss:") - col.itemR(raym, "gloss_factor", text="Amount") + col.itemR(raym, "gloss", text="Amount") sub = col.column() - sub.active = raym.gloss_factor < 1.0 + sub.active = raym.gloss < 1 sub.itemR(raym, "gloss_threshold", text="Threshold") sub.itemR(raym, "gloss_samples", text="Samples") sub.itemR(raym, "gloss_anisotropic", text="Anisotropic") - + + class MATERIAL_PT_transp(MaterialButtonsPanel): __label__= "Transparency" __default_closed__ = True @@ -451,12 +432,13 @@ class MATERIAL_PT_transp(MaterialButtonsPanel): def poll(self, context): mat = context.material - engine = context.scene.render_data.engine - return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES) + return mat and (mat.type in ('SURFACE', 'WIRE')) and (context.scene.render_data.engine in self.COMPAT_ENGINES) - def draw_header(self, context): + def draw_header(self, context): + layout = self.layout + mat = context.material - self.layout.itemR(mat, "transparency", text="") + layout.itemR(mat, "transparency", text="") def draw(self, context): layout = self.layout @@ -464,29 +446,32 @@ class MATERIAL_PT_transp(MaterialButtonsPanel): mat = context.material rayt = context.material.raytrace_transparency - row = layout.row() - row.active = mat.transparency and (not mat.shadeless) + row= layout.row() row.itemR(mat, "transparency_method", expand=True) + row.active = mat.transparency and (not mat.shadeless) split = layout.split() col = split.column() - col.itemR(mat, "alpha") + col.itemL(text="Transparency:") + row = col.row() + row.itemR(mat, "alpha") + row.active = mat.transparency row = col.row() - row.active = mat.transparency and (not mat.shadeless) row.itemR(mat, "specular_alpha", text="Specular") - + row.active = mat.transparency and (not mat.shadeless) + col = split.column() - col.active = (not mat.shadeless) - col.itemR(rayt, "fresnel") + col.active = mat.transparency and (not mat.shadeless) + col.itemL(text="Fresnel:") + col.itemR(rayt, "fresnel", text="Amount") sub = col.column() sub.active = rayt.fresnel > 0 sub.itemR(rayt, "fresnel_factor", text="Blend") if mat.transparency_method == 'RAYTRACE': - layout.itemS() split = layout.split() - split.active = mat.transparency + split.active = mat.transparency and (not mat.shadeless) col = split.column() col.itemR(rayt, "ior") @@ -497,20 +482,19 @@ class MATERIAL_PT_transp(MaterialButtonsPanel): col = split.column() col.itemL(text="Gloss:") - col.itemR(rayt, "gloss_factor", text="Amount") + col.itemR(rayt, "gloss", text="Amount") sub = col.column() - sub.active = rayt.gloss_factor < 1.0 + sub.active = rayt.gloss < 1 sub.itemR(rayt, "gloss_threshold", text="Threshold") sub.itemR(rayt, "gloss_samples", text="Samples") - + class MATERIAL_PT_halo(MaterialButtonsPanel): __label__= "Halo" COMPAT_ENGINES = set(['BLENDER_RENDER']) def poll(self, context): mat = context.material - engine = context.scene.render_data.engine - return mat and (mat.type == 'HALO') and (engine in self.COMPAT_ENGINES) + return mat and (mat.type == 'HALO') and (context.scene.render_data.engine in self.COMPAT_ENGINES) def draw(self, context): layout = self.layout @@ -526,8 +510,8 @@ class MATERIAL_PT_halo(MaterialButtonsPanel): col.itemR(halo, "hardness") col.itemR(halo, "add") col.itemL(text="Options:") - col.itemR(halo, "texture") - col.itemR(halo, "vertex_normal") + col.itemR(halo, "use_texture", text="Texture") + col.itemR(halo, "use_vertex_normal", text="Vertex Normal") col.itemR(halo, "xalpha") col.itemR(halo, "shaded") col.itemR(halo, "soft") @@ -538,52 +522,24 @@ class MATERIAL_PT_halo(MaterialButtonsPanel): sub.active = halo.ring sub.itemR(halo, "rings") sub.itemR(mat, "mirror_color", text="") - col.itemS() col.itemR(halo, "lines") sub = col.column() sub.active = halo.lines sub.itemR(halo, "line_number", text="Lines") sub.itemR(mat, "specular_color", text="") - col.itemS() col.itemR(halo, "star") sub = col.column() sub.active = halo.star sub.itemR(halo, "star_tips") - -class MATERIAL_PT_flare(MaterialButtonsPanel): - __label__= "Flare" - COMPAT_ENGINES = set(['BLENDER_RENDER']) - - def poll(self, context): - mat = context.material - engine = context.scene.render_data.engine - return mat and (mat.type == 'HALO') and (engine in self.COMPAT_ENGINES) - - def draw_header(self, context): - layout = self.layout - - mat = context.material - halo = mat.halo - layout.itemR(halo, "flare_mode", text="") - - def draw(self, context): - layout = self.layout - - mat = context.material - halo = mat.halo + col.itemR(halo, "flare_mode") + sub = col.column() + sub.active = halo.flare_mode + sub.itemR(halo, "flare_size", text="Size") + sub.itemR(halo, "flare_subsize", text="Subsize") + sub.itemR(halo, "flare_boost", text="Boost") + sub.itemR(halo, "flare_seed", text="Seed") + sub.itemR(halo, "flares_sub", text="Sub") - layout.active = halo.flare_mode - - split = layout.split() - - col = split.column() - col.itemR(halo, "flare_size", text="Size") - col.itemR(halo, "flare_boost", text="Boost") - col.itemR(halo, "flare_seed", text="Seed") - col = split.column() - col.itemR(halo, "flares_sub", text="Subflares") - col.itemR(halo, "flare_subsize", text="Subsize") - bpy.types.register(MATERIAL_PT_context_material) bpy.types.register(MATERIAL_PT_preview) bpy.types.register(MATERIAL_PT_diffuse) @@ -593,121 +549,8 @@ bpy.types.register(MATERIAL_PT_transp) bpy.types.register(MATERIAL_PT_mirror) bpy.types.register(MATERIAL_PT_sss) bpy.types.register(MATERIAL_PT_halo) -bpy.types.register(MATERIAL_PT_flare) bpy.types.register(MATERIAL_PT_physics) bpy.types.register(MATERIAL_PT_strand) bpy.types.register(MATERIAL_PT_options) bpy.types.register(MATERIAL_PT_shadow) -# Volumetrics -class VolumeButtonsPanel(bpy.types.Panel): - __space_type__ = 'PROPERTIES' - __region_type__ = 'WINDOW' - __context__ = "material" - - def poll(self, context): - mat = context.material - engine = context.scene.render_data.engine - return mat and (mat.type == 'VOLUME') and (engine in self.COMPAT_ENGINES) - -class MATERIAL_PT_volume_shading(VolumeButtonsPanel): - __label__ = "Shading" - __default_closed__ = False - COMPAT_ENGINES = set(['BLENDER_RENDER']) - - def draw(self, context): - layout = self.layout - - mat = context.material - vol = context.material.volume - - row = layout.row() - row.itemR(vol, "density") - row.itemR(vol, "scattering") - - split = layout.split() - - col = split.column() - col.itemR(vol, "absorption") - col.itemR(vol, "absorption_color", text="") - - col = split.column() - col.itemR(vol, "emission") - col.itemR(vol, "emission_color", text="") - -class MATERIAL_PT_volume_scattering(VolumeButtonsPanel): - __label__ = "Scattering" - __default_closed__ = False - COMPAT_ENGINES = set(['BLENDER_RENDER']) - - def draw(self, context): - layout = self.layout - - vol = context.material.volume - - split = layout.split() - - col = split.column() - col.itemR(vol, "scattering_mode", text="") - if vol.scattering_mode == 'SINGLE_SCATTERING': - col.itemR(vol, "light_cache") - sub = col.column() - sub.active = vol.light_cache - sub.itemR(vol, "cache_resolution") - elif vol.scattering_mode in ('MULTIPLE_SCATTERING', 'SINGLE_PLUS_MULTIPLE_SCATTERING'): - col.itemR(vol, "cache_resolution") - - col = col.column(align=True) - col.itemR(vol, "ms_diffusion") - col.itemR(vol, "ms_spread") - col.itemR(vol, "ms_intensity") - - col = split.column() - # col.itemL(text="Anisotropic Scattering:") - col.itemR(vol, "phase_function", text="") - if vol.phase_function in ('SCHLICK', 'HENYEY-GREENSTEIN'): - col.itemR(vol, "asymmetry") - -class MATERIAL_PT_volume_transp(VolumeButtonsPanel): - __label__= "Transparency" - COMPAT_ENGINES = set(['BLENDER_RENDER']) - - def draw(self, context): - layout = self.layout - - mat = context.material - rayt = context.material.raytrace_transparency - - row= layout.row() - row.itemR(mat, "transparency_method", expand=True) - row.active = mat.transparency and (not mat.shadeless) - -class MATERIAL_PT_volume_integration(VolumeButtonsPanel): - __label__ = "Integration" - __default_closed__ = False - COMPAT_ENGINES = set(['BLENDER_RENDER']) - - def draw(self, context): - layout = self.layout - - mat = context.material - vol = context.material.volume - - split = layout.split() - - col = split.column() - col.itemL(text="Step Calculation:") - col.itemR(vol, "step_calculation", text="") - col = col.column(align=True) - col.itemR(vol, "step_size") - col.itemR(vol, "shading_step_size") - - col = split.column() - col.itemL() - col.itemR(vol, "depth_cutoff") - col.itemR(vol, "density_scale") - -bpy.types.register(MATERIAL_PT_volume_shading) -bpy.types.register(MATERIAL_PT_volume_scattering) -bpy.types.register(MATERIAL_PT_volume_transp) -bpy.types.register(MATERIAL_PT_volume_integration) diff --git a/release/ui/buttons_object.py b/release/ui/buttons_object.py index af2c7cfb58a..6b6d583e2ca 100644 --- a/release/ui/buttons_object.py +++ b/release/ui/buttons_object.py @@ -2,8 +2,8 @@ import bpy class ObjectButtonsPanel(bpy.types.Panel): - __space_type__ = 'PROPERTIES' - __region_type__ = 'WINDOW' + __space_type__ = "PROPERTIES" + __region_type__ = "WINDOW" __context__ = "object" class OBJECT_PT_context_object(ObjectButtonsPanel): @@ -15,7 +15,7 @@ class OBJECT_PT_context_object(ObjectButtonsPanel): ob = context.object row = layout.row() - row.itemL(text="", icon='ICON_OBJECT_DATA') + row.itemL(text="", icon="ICON_OBJECT_DATA") row.itemR(ob, "name", text="") class OBJECT_PT_transform(ObjectButtonsPanel): @@ -79,7 +79,7 @@ class OBJECT_PT_groups(ObjectButtonsPanel): row = col.box().row() row.itemR(group, "name", text="") - row.itemO("object.group_remove", text="", icon='VICON_X') + row.itemO("object.group_remove", text="", icon="VICON_X") split = col.box().split() split.column().itemR(group, "layer", text="Dupli") diff --git a/release/ui/buttons_object_constraint.py b/release/ui/buttons_object_constraint.py index ff3231a9d61..c67d6e40cfb 100644 --- a/release/ui/buttons_object_constraint.py +++ b/release/ui/buttons_object_constraint.py @@ -2,8 +2,8 @@ import bpy class ConstraintButtonsPanel(bpy.types.Panel): - __space_type__ = 'PROPERTIES' - __region_type__ = 'WINDOW' + __space_type__ = "PROPERTIES" + __region_type__ = "WINDOW" __context__ = "constraint" def draw_constraint(self, con): @@ -39,7 +39,7 @@ class ConstraintButtonsPanel(bpy.types.Panel): layout.itemR(con, "target") # XXX limiting settings for only 'curves' or some type of object if con.target and subtargets: - if con.target.type == 'ARMATURE': + if con.target.type == "ARMATURE": layout.item_pointerR(con, "subtarget", con.target.data, "bones", text="Bone") if con.type == 'COPY_LOCATION': @@ -121,17 +121,9 @@ class ConstraintButtonsPanel(bpy.types.Panel): def FOLLOW_PATH(self, layout, con): self.target_template(layout, con) - split = layout.split() - - col = split.column() - col.itemR(con, "curve_follow") - - col = split.column() - col.itemR(con, "fixed_position") - if con.fixed_position: - col.itemR(con, "offset_percentage", text="Offset") - else: - col.itemR(con, "offset") + row = layout.row() + row.itemR(con, "curve_follow") + row.itemR(con, "offset") row = layout.row() row.itemL(text="Forward:") @@ -486,7 +478,7 @@ class ConstraintButtonsPanel(bpy.types.Panel): layout.itemR(con, "distance") layout.itemR(con, "shrinkwrap_type") - if con.shrinkwrap_type == 'PROJECT': + if con.shrinkwrap_type == "PROJECT": row = layout.row(align=True) row.itemR(con, "axis_x") row.itemR(con, "axis_y") diff --git a/release/ui/buttons_physics_cloth.py b/release/ui/buttons_physics_cloth.py index 5cdca3c2c74..f34077c758a 100644 --- a/release/ui/buttons_physics_cloth.py +++ b/release/ui/buttons_physics_cloth.py @@ -1,14 +1,9 @@ import bpy -from buttons_particle import point_cache_ui - -def cloth_panel_enabled(md): - return md.point_cache.baked==False - class PhysicButtonsPanel(bpy.types.Panel): - __space_type__ = 'PROPERTIES' - __region_type__ = 'WINDOW' + __space_type__ = "PROPERTIES" + __region_type__ = "WINDOW" __context__ = "physics" def poll(self, context): @@ -43,8 +38,6 @@ class PHYSICS_PT_cloth(PhysicButtonsPanel): if md: cloth = md.settings - - layout.active = cloth_panel_enabled(md) split = layout.split() @@ -89,35 +82,77 @@ class PHYSICS_PT_cloth_cache(PhysicButtonsPanel): __default_closed__ = True def poll(self, context): - return (context.cloth) + return (context.cloth != None) def draw(self, context): - md = context.cloth - point_cache_ui(self, md.point_cache, cloth_panel_enabled(md), 0, 0) + layout = self.layout + + cache = context.cloth.point_cache + layout.set_context_pointer("PointCache", cache) + + row = layout.row() + row.template_list(cache, "point_cache_list", cache, "active_point_cache_index") + col = row.column(align=True) + col.itemO("ptcache.add_new", icon="ICON_ZOOMIN", text="") + col.itemO("ptcache.remove", icon="ICON_ZOOMOUT", text="") + + row = layout.row() + row.itemR(cache, "name") + + row = layout.row() + row.itemR(cache, "start_frame") + row.itemR(cache, "end_frame") + + row = layout.row() + + if cache.baked == True: + row.itemO("ptcache.free_bake", text="Free Bake") + else: + row.item_booleanO("ptcache.bake", "bake", True, text="Bake") + + subrow = row.row() + subrow.enabled = cache.frames_skipped or cache.outdated + subrow.itemO("ptcache.bake", "bake", False, text="Calculate to Current Frame") + + row = layout.row() + #row.enabled = particle_panel_enabled(psys) + row.itemO("ptcache.bake_from_cache", text="Current Cache to Bake") + row.itemR(cache, "step"); + + row = layout.row() + #row.enabled = particle_panel_enabled(psys) + row.itemR(cache, "quick_cache") + row.itemR(cache, "disk_cache") + + layout.itemL(text=cache.info) + + layout.itemS() + + row = layout.row() + row.itemO("ptcache.bake_all", "bake", True, text="Bake All Dynamics") + row.itemO("ptcache.free_bake_all", text="Free All Bakes") + layout.itemO("ptcache.bake_all", "bake", False, text="Update All Dynamics to current frame") class PHYSICS_PT_cloth_collision(PhysicButtonsPanel): __label__ = "Cloth Collision" __default_closed__ = True def poll(self, context): - return (context.cloth) + return (context.cloth != None) def draw_header(self, context): + layout = self.layout cloth = context.cloth.collision_settings - - self.layout.active = cloth_panel_enabled(context.cloth) - self.layout.itemR(cloth, "enable_collision", text="") + + layout.itemR(cloth, "enable_collision", text="") def draw(self, context): layout = self.layout - cloth = context.cloth.collision_settings - md = context.cloth - - layout.active = cloth.enable_collision and cloth_panel_enabled(md) - split = layout.split() + layout.active = cloth.enable_collision + col = split.column() col.itemR(cloth, "collision_quality", slider=True, text="Quality") col.itemR(cloth, "min_distance", slider=True, text="Distance") @@ -125,10 +160,10 @@ class PHYSICS_PT_cloth_collision(PhysicButtonsPanel): col = split.column() col.itemR(cloth, "enable_self_collision", text="Self Collision") - sub = col.column() - sub.active = cloth.enable_self_collision - sub.itemR(cloth, "self_collision_quality", slider=True, text="Quality") - sub.itemR(cloth, "self_min_distance", slider=True, text="Distance") + col = col.column() + col.active = cloth.enable_self_collision + col.itemR(cloth, "self_collision_quality", slider=True, text="Quality") + col.itemR(cloth, "self_min_distance", slider=True, text="Distance") class PHYSICS_PT_cloth_stiffness(PhysicButtonsPanel): __label__ = "Cloth Stiffness Scaling" @@ -138,19 +173,17 @@ class PHYSICS_PT_cloth_stiffness(PhysicButtonsPanel): return (context.cloth != None) def draw_header(self, context): + layout = self.layout cloth = context.cloth.settings - self.layout.active = cloth_panel_enabled(context.cloth) - self.layout.itemR(cloth, "stiffness_scaling", text="") + layout.itemR(cloth, "stiffness_scaling", text="") def draw(self, context): layout = self.layout - - md = context.cloth ob = context.object cloth = context.cloth.settings - layout.active = cloth.stiffness_scaling and cloth_panel_enabled(md) + layout.active = cloth.stiffness_scaling split = layout.split() diff --git a/release/ui/buttons_physics_field.py b/release/ui/buttons_physics_field.py index 58033d2c431..fb29dd92833 100644 --- a/release/ui/buttons_physics_field.py +++ b/release/ui/buttons_physics_field.py @@ -2,13 +2,13 @@ import bpy class PhysicButtonsPanel(bpy.types.Panel): - __space_type__ = 'PROPERTIES' - __region_type__ = 'WINDOW' + __space_type__ = "PROPERTIES" + __region_type__ = "WINDOW" __context__ = "physics" def poll(self, context): rd = context.scene.render_data - return (context.object) and (not rd.use_game_engine) + return (context.object != None) and (not rd.use_game_engine) class PHYSICS_PT_field(PhysicButtonsPanel): __label__ = "Force Fields" @@ -146,15 +146,15 @@ class PHYSICS_PT_field(PhysicButtonsPanel): sub.active = field.use_radial_max sub.itemR(field, "radial_maximum", text="Distance") - #if ob.type in 'CURVE': - #if field.type == 'GUIDE': + #if ob.type in "CURVE": + #if field.type == "GUIDE": #colsub = col.column(align=True) - #if field.type != 'NONE': + #if field.type != "NONE": #layout.itemR(field, "strength") - #if field.type in ('HARMONIC', 'SPHERICAL', 'CHARGE', "LENNARDj"): - #if ob.type in ('MESH', 'SURFACE', 'FONT', 'CURVE'): + #if field.type in ("HARMONIC", "SPHERICAL", "CHARGE", "LENNARDj"): + #if ob.type in ("MESH", "SURFACE", "FONT", "CURVE"): #layout.itemR(field, "surface") class PHYSICS_PT_collision(PhysicButtonsPanel): diff --git a/release/ui/buttons_physics_fluid.py b/release/ui/buttons_physics_fluid.py index 6f7a97ff793..304d419b388 100644 --- a/release/ui/buttons_physics_fluid.py +++ b/release/ui/buttons_physics_fluid.py @@ -2,8 +2,8 @@ import bpy class PhysicButtonsPanel(bpy.types.Panel): - __space_type__ = 'PROPERTIES' - __region_type__ = 'WINDOW' + __space_type__ = "PROPERTIES" + __region_type__ = "WINDOW" __context__ = "physics" def poll(self, context): @@ -46,7 +46,7 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel): layout.itemR(fluid, "type") if fluid.type == 'DOMAIN': - layout.itemO("fluid.bake", text="Bake Fluid Simulation", icon='ICON_MOD_FLUIDSIM') + layout.itemO("fluid.bake", text="BAKE") split = layout.split() col = split.column() @@ -94,7 +94,7 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel): col.itemL(text="Slip Type:") col.itemR(fluid, "slip_type", text="") if fluid.slip_type == 'PARTIALSLIP': - col.itemR(fluid, "partial_slip_factor", slider=True, text="Amount") + col.itemR(fluid, "partial_slip_amount", slider=True, text="Amount") col.itemL(text="Impact:") col.itemR(fluid, "impact_factor", text="Factor") @@ -175,7 +175,11 @@ class PHYSICS_PT_domain_gravity(PhysicButtonsPanel): def poll(self, context): md = context.fluid if md: - return (md.settings.type == 'DOMAIN') + settings = md.settings + if settings: + return (settings.type == 'DOMAIN') + + return False def draw(self, context): layout = self.layout @@ -214,7 +218,11 @@ class PHYSICS_PT_domain_boundary(PhysicButtonsPanel): def poll(self, context): md = context.fluid if md: - return (md.settings.type == 'DOMAIN') + settings = md.settings + if settings: + return (settings.type == 'DOMAIN') + + return False def draw(self, context): layout = self.layout @@ -228,7 +236,7 @@ class PHYSICS_PT_domain_boundary(PhysicButtonsPanel): sub = col.column(align=True) sub.itemR(fluid, "slip_type", text="") if fluid.slip_type == 'PARTIALSLIP': - sub.itemR(fluid, "partial_slip_factor", slider=True, text="Amount") + sub.itemR(fluid, "partial_slip_amount", slider=True, text="Amount") col = split.column() col.itemL(text="Surface:") @@ -243,8 +251,12 @@ class PHYSICS_PT_domain_particles(PhysicButtonsPanel): def poll(self, context): md = context.fluid if md: - return (md.settings.type == 'DOMAIN') - + settings = md.settings + if settings: + return (settings.type == 'DOMAIN') + + return False + def draw(self, context): layout = self.layout diff --git a/release/ui/buttons_physics_smoke.py b/release/ui/buttons_physics_smoke.py index 6aee152e92a..7e2395216c0 100644 --- a/release/ui/buttons_physics_smoke.py +++ b/release/ui/buttons_physics_smoke.py @@ -1,11 +1,9 @@ import bpy -from buttons_particle import point_cache_ui - class PhysicButtonsPanel(bpy.types.Panel): - __space_type__ = 'PROPERTIES' - __region_type__ = 'WINDOW' + __space_type__ = "PROPERTIES" + __region_type__ = "WINDOW" __context__ = "physics" def poll(self, context): @@ -51,6 +49,13 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel): col = split.column() col.itemL(text="Resolution:") col.itemR(domain, "maxres", text="Divisions") + + col.itemL(text="Display:") + col.itemR(domain, "visibility", text="Resolution") + col.itemR(domain, "color", slider=True) + sub = col.column() + sub.active = domain.highres + sub.itemR(domain, "viewhighres") col = split.column() col.itemL(text="Behavior:") @@ -59,7 +64,7 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel): col.itemR(domain, "dissolve_smoke", text="Dissolve") sub = col.column() sub.active = domain.dissolve_smoke - sub.itemR(domain, "dissolve_speed", text="Time") + sub.itemR(domain, "dissolve_speed", text="Speed") sub.itemR(domain, "dissolve_smoke_log", text="Slow") elif md.smoke_type == 'TYPE_FLOW': @@ -83,7 +88,43 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel): #elif md.smoke_type == 'TYPE_COLL': # layout.itemS() + +class PHYSICS_PT_smoke_highres(PhysicButtonsPanel): + __label__ = "Smoke High Resolution" + __default_closed__ = True + + def poll(self, context): + md = context.smoke + if md: + return (md.smoke_type == 'TYPE_DOMAIN') + + return False + def draw_header(self, context): + layout = self.layout + + high = context.smoke.domain_settings + + layout.itemR(high, "highres", text="") + + def draw(self, context): + layout = self.layout + + high = context.smoke.domain_settings + + layout.active = high.highres + + split = layout.split() + + col = split.column() + col.itemL(text="Resolution:") + col.itemR(high, "amplify", text="Divisions") + + sub = split.column() + sub.itemL(text="Noise Method:") + sub.row().itemR(high, "noise_type", text="") + sub.itemR(high, "strength") + class PHYSICS_PT_smoke_groups(PhysicButtonsPanel): __label__ = "Smoke Groups" __default_closed__ = True @@ -113,70 +154,6 @@ class PHYSICS_PT_smoke_groups(PhysicButtonsPanel): col.itemL(text="Collision Group:") col.itemR(group, "coll_group", text="") -class PHYSICS_PT_smoke_cache(PhysicButtonsPanel): - __label__ = "Smoke Cache" - __default_closed__ = True - - def poll(self, context): - md = context.smoke - return md and (md.smoke_type == 'TYPE_DOMAIN') - - def draw(self, context): - layout = self.layout - - md = context.smoke.domain_settings - cache = md.point_cache_low - - point_cache_ui(self, cache, cache.baked==False, 0, 1) - -class PHYSICS_PT_smoke_highres(PhysicButtonsPanel): - __label__ = "Smoke High Resolution" - __default_closed__ = True - - def poll(self, context): - md = context.smoke - return md and (md.smoke_type == 'TYPE_DOMAIN') - - def draw_header(self, context): - high = context.smoke.domain_settings - - self.layout.itemR(high, "highres", text="") - - def draw(self, context): - layout = self.layout - - md = context.smoke.domain_settings - - split = layout.split() - - col = split.column() - col.itemL(text="Resolution:") - col.itemR(md, "amplify", text="Divisions") - - col = split.column() - col.itemL(text="Noise Method:") - col.row().itemR(md, "noise_type", text="") - col.itemR(md, "strength") - col.itemR(md, "viewhighres") - -class PHYSICS_PT_smoke_cache_highres(PhysicButtonsPanel): - __label__ = "Smoke High Resolution Cache" - __default_closed__ = True - - def poll(self, context): - md = context.smoke - return md and (md.smoke_type == 'TYPE_DOMAIN') and md.domain_settings.highres - - def draw(self, context): - layout = self.layout - - md = context.smoke.domain_settings - cache = md.point_cache_high - - point_cache_ui(self, cache, cache.baked==False, 0, 1) - bpy.types.register(PHYSICS_PT_smoke) -bpy.types.register(PHYSICS_PT_smoke_cache) bpy.types.register(PHYSICS_PT_smoke_highres) bpy.types.register(PHYSICS_PT_smoke_groups) -bpy.types.register(PHYSICS_PT_smoke_cache_highres) diff --git a/release/ui/buttons_physics_softbody.py b/release/ui/buttons_physics_softbody.py index 703977a056f..2613f9e8032 100644 --- a/release/ui/buttons_physics_softbody.py +++ b/release/ui/buttons_physics_softbody.py @@ -1,14 +1,9 @@ import bpy -from buttons_particle import point_cache_ui - -def softbody_panel_enabled(md): - return md.point_cache.baked==False - class PhysicButtonsPanel(bpy.types.Panel): - __space_type__ = 'PROPERTIES' - __region_type__ = 'WINDOW' + __space_type__ = "PROPERTIES" + __region_type__ = "WINDOW" __context__ = "physics" def poll(self, context): @@ -46,7 +41,6 @@ class PHYSICS_PT_softbody(PhysicButtonsPanel): # General split = layout.split() - split.enabled = softbody_panel_enabled(md) col = split.column() col.itemL(text="Object:") @@ -66,132 +60,179 @@ class PHYSICS_PT_softbody_cache(PhysicButtonsPanel): return (context.soft_body) def draw(self, context): - md = context.soft_body - point_cache_ui(self, md.point_cache, softbody_panel_enabled(md), 0, 0) + layout = self.layout + + cache = context.soft_body.point_cache + layout.set_context_pointer("PointCache", cache) + + row = layout.row() + row.template_list(cache, "point_cache_list", cache, "active_point_cache_index") + col = row.column(align=True) + col.itemO("ptcache.add_new", icon="ICON_ZOOMIN", text="") + col.itemO("ptcache.remove", icon="ICON_ZOOMOUT", text="") + + row = layout.row() + row.itemR(cache, "name") + + row = layout.row() + row.itemR(cache, "start_frame") + row.itemR(cache, "end_frame") + + row = layout.row() + + if cache.baked == True: + row.itemO("ptcache.free_bake", text="Free Bake") + else: + row.item_booleanO("ptcache.bake", "bake", True, text="Bake") + + sub = row.row() + sub.enabled = cache.frames_skipped or cache.outdated + sub.itemO("ptcache.bake", "bake", False, text="Calculate to Current Frame") + row = layout.row() + row.itemO("ptcache.bake_from_cache", text="Current Cache to Bake") + row.itemR(cache, "step"); + + row = layout.row() + row.itemR(cache, "quick_cache") + row.itemR(cache, "disk_cache") + + layout.itemL(text=cache.info) + + layout.itemS() + + row = layout.row() + row.itemO("ptcache.bake_all", "bake", True, text="Bake All Dynamics") + row.itemO("ptcache.free_bake_all", text="Free All Bakes") + layout.itemO("ptcache.bake_all", "bake", False, text="Update All Dynamics to current frame") + class PHYSICS_PT_softbody_goal(PhysicButtonsPanel): __label__ = "Soft Body Goal" - __default_closed__ = True def poll(self, context): return (context.soft_body) def draw_header(self, context): + layout = self.layout + softbody = context.soft_body.settings - self.layout.active = softbody_panel_enabled(context.soft_body) - self.layout.itemR(softbody, "use_goal", text="") + layout.itemR(softbody, "use_goal", text="") def draw(self, context): layout = self.layout md = context.soft_body - softbody = md.settings ob = context.object - - layout.active = softbody.use_goal and softbody_panel_enabled(md) split = layout.split() + + if md: + softbody = md.settings + layout.active = softbody.use_goal - # Goal - split = layout.split() + # Goal + split = layout.split() - col = split.column() - col.itemL(text="Goal Strengths:") - col.itemR(softbody, "goal_default", text="Default") - sub = col.column(align=True) - sub.itemR(softbody, "goal_min", text="Minimum") - sub.itemR(softbody, "goal_max", text="Maximum") + col = split.column() + col.itemL(text="Goal Strengths:") + col.itemR(softbody, "goal_default", text="Default") + sub = col.column(align=True) + sub.itemR(softbody, "goal_min", text="Minimum") + sub.itemR(softbody, "goal_max", text="Maximum") - col = split.column() - col.itemL(text="Goal Settings:") - col.itemR(softbody, "goal_spring", text="Stiffness") - col.itemR(softbody, "goal_friction", text="Damping") + col = split.column() + col.itemL(text="Goal Settings:") + col.itemR(softbody, "goal_spring", text="Stiffness") + col.itemR(softbody, "goal_friction", text="Damping") - layout.item_pointerR(softbody, "goal_vertex_group", ob, "vertex_groups", text="Vertex Group") + layout.item_pointerR(softbody, "goal_vertex_group", ob, "vertex_groups", text="Vertex Group") class PHYSICS_PT_softbody_edge(PhysicButtonsPanel): __label__ = "Soft Body Edges" - __default_closed__ = True def poll(self, context): return (context.soft_body) def draw_header(self, context): + layout = self.layout + softbody = context.soft_body.settings - self.layout.active = softbody_panel_enabled(context.soft_body) - self.layout.itemR(softbody, "use_edges", text="") + layout.itemR(softbody, "use_edges", text="") def draw(self, context): layout = self.layout md = context.soft_body - softbody = md.settings ob = context.object - - layout.active = softbody.use_edges and softbody_panel_enabled(md) - split = layout.split() + if md: + softbody = md.settings + + layout.active = softbody.use_edges - col = split.column() - col.itemL(text="Springs:") - col.itemR(softbody, "pull") - col.itemR(softbody, "push") - col.itemR(softbody, "damp") - col.itemR(softbody, "plastic") - col.itemR(softbody, "bending") - col.itemR(softbody, "spring_length", text="Length") - - col = split.column() - col.itemR(softbody, "stiff_quads") - sub = col.column() - sub.active = softbody.stiff_quads - sub.itemR(softbody, "shear") - - col.itemR(softbody, "new_aero", text="Aero") - sub = col.column() - sub.enabled = softbody.new_aero - sub.itemR(softbody, "aero", text="Factor") - - col.itemL(text="Collision:") - col.itemR(softbody, "edge_collision", text="Edge") - col.itemR(softbody, "face_collision", text="Face") + split = layout.split() + + col = split.column() + col.itemL(text="Springs:") + col.itemR(softbody, "pull") + col.itemR(softbody, "push") + col.itemR(softbody, "damp") + col.itemR(softbody, "plastic") + col.itemR(softbody, "bending") + col.itemR(softbody, "spring_length", text="Length") + + col = split.column() + col.itemR(softbody, "stiff_quads") + sub = col.column() + sub.active = softbody.stiff_quads + sub.itemR(softbody, "shear") + + col.itemR(softbody, "new_aero", text="Aero") + sub = col.column() + sub.enabled = softbody.new_aero + sub.itemR(softbody, "aero", text="Factor") + + col.itemL(text="Collision:") + col.itemR(softbody, "edge_collision", text="Edge") + col.itemR(softbody, "face_collision", text="Face") class PHYSICS_PT_softbody_collision(PhysicButtonsPanel): __label__ = "Soft Body Collision" - __default_closed__ = True def poll(self, context): return (context.soft_body) def draw_header(self, context): + layout = self.layout + softbody = context.soft_body.settings - self.layout.active = softbody_panel_enabled(context.soft_body) - self.layout.itemR(softbody, "self_collision", text="") + layout.itemR(softbody, "self_collision", text="") def draw(self, context): layout = self.layout md = context.soft_body - softbody = md.settings ob = context.object + + if md: + softbody = md.settings - layout.active = softbody.self_collision and softbody_panel_enabled(md) + layout.active = softbody.self_collision - layout.itemL(text="Collision Type:") - layout.itemR(softbody, "collision_type", expand=True) + layout.itemL(text="Collision Type:") + layout.itemR(softbody, "collision_type", expand=True) - col = layout.column(align=True) - col.itemL(text="Ball:") - col.itemR(softbody, "ball_size", text="Size") - col.itemR(softbody, "ball_stiff", text="Stiffness") - col.itemR(softbody, "ball_damp", text="Dampening") + col = layout.column(align=True) + col.itemL(text="Ball:") + col.itemR(softbody, "ball_size", text="Size") + col.itemR(softbody, "ball_stiff", text="Stiffness") + col.itemR(softbody, "ball_damp", text="Dampening") class PHYSICS_PT_softbody_solver(PhysicButtonsPanel): __label__ = "Soft Body Solver" - __default_closed__ = True def poll(self, context): return (context.soft_body) @@ -200,28 +241,28 @@ class PHYSICS_PT_softbody_solver(PhysicButtonsPanel): layout = self.layout md = context.soft_body - softbody = md.settings ob = context.object + + if md: + softbody = md.settings - layout.active = softbody_panel_enabled(md) - - # Solver - split = layout.split() + # Solver + split = layout.split() - col = split.column(align=True) - col.itemL(text="Step Size:") - col.itemR(softbody, "minstep") - col.itemR(softbody, "maxstep") - col.itemR(softbody, "auto_step", text="Auto-Step") + col = split.column(align=True) + col.itemL(text="Step Size:") + col.itemR(softbody, "minstep") + col.itemR(softbody, "maxstep") + col.itemR(softbody, "auto_step", text="Auto-Step") - col = split.column() - col.itemR(softbody, "error_limit") - col.itemL(text="Helpers:") - col.itemR(softbody, "choke") - col.itemR(softbody, "fuzzy") + col = split.column() + col.itemR(softbody, "error_limit") + col.itemL(text="Helpers:") + col.itemR(softbody, "choke") + col.itemR(softbody, "fuzzy") - layout.itemL(text="Diagnostics:") - layout.itemR(softbody, "diagnose") + layout.itemL(text="Diagnostics:") + layout.itemR(softbody, "diagnose") bpy.types.register(PHYSICS_PT_softbody) bpy.types.register(PHYSICS_PT_softbody_cache) diff --git a/release/ui/buttons_scene.py b/release/ui/buttons_scene.py index 3c321f11f6e..e9ee97468e8 100644 --- a/release/ui/buttons_scene.py +++ b/release/ui/buttons_scene.py @@ -2,8 +2,8 @@ import bpy class RenderButtonsPanel(bpy.types.Panel): - __space_type__ = 'PROPERTIES' - __region_type__ = 'WINDOW' + __space_type__ = "PROPERTIES" + __region_type__ = "WINDOW" __context__ = "scene" # COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here @@ -41,8 +41,8 @@ class SCENE_PT_layers(RenderButtonsPanel): row.template_list(rd, "layers", rd, "active_layer_index", rows=2) col = row.column(align=True) - col.itemO("scene.render_layer_add", icon='ICON_ZOOMIN', text="") - col.itemO("scene.render_layer_remove", icon='ICON_ZOOMOUT', text="") + col.itemO("scene.render_layer_add", icon="ICON_ZOOMIN", text="") + col.itemO("scene.render_layer_remove", icon="ICON_ZOOMOUT", text="") rl = rd.layers[rd.active_layer_index] @@ -103,19 +103,19 @@ class SCENE_PT_layers(RenderButtonsPanel): col.itemR(rl, "pass_diffuse") row = col.row() row.itemR(rl, "pass_specular") - row.itemR(rl, "pass_specular_exclude", text="", icon='ICON_X') + row.itemR(rl, "pass_specular_exclude", text="", icon="ICON_X") row = col.row() row.itemR(rl, "pass_shadow") - row.itemR(rl, "pass_shadow_exclude", text="", icon='ICON_X') + row.itemR(rl, "pass_shadow_exclude", text="", icon="ICON_X") row = col.row() row.itemR(rl, "pass_ao") - row.itemR(rl, "pass_ao_exclude", text="", icon='ICON_X') + row.itemR(rl, "pass_ao_exclude", text="", icon="ICON_X") row = col.row() row.itemR(rl, "pass_reflection") - row.itemR(rl, "pass_reflection_exclude", text="", icon='ICON_X') + row.itemR(rl, "pass_reflection_exclude", text="", icon="ICON_X") row = col.row() row.itemR(rl, "pass_refraction") - row.itemR(rl, "pass_refraction_exclude", text="", icon='ICON_X') + row.itemR(rl, "pass_refraction_exclude", text="", icon="ICON_X") class SCENE_PT_shading(RenderButtonsPanel): __label__ = "Shading" @@ -189,27 +189,20 @@ class SCENE_PT_post_processing(RenderButtonsPanel): col = split.column() col.itemR(rd, "use_compositing") col.itemR(rd, "use_sequencer") - - col = split.column() - col.itemR(rd, "dither_intensity", text="Dither", slider=True) - - layout.itemS() - - split = layout.split() - + col = split.column() - col.itemR(rd, "fields", text="Fields") - sub = col.column() + row = col.row() + row.itemR(rd, "fields", text="Fields") + sub = row.row() sub.active = rd.fields - sub.row().itemR(rd, "field_order", expand=True) sub.itemR(rd, "fields_still", text="Still") - - col = split.column() - col.itemR(rd, "edge") - sub = col.column() - sub.active = rd.edge - sub.itemR(rd, "edge_threshold", text="Threshold", slider=True) - sub.itemR(rd, "edge_color", text="") + sub = col.row() + sub.active = rd.fields + sub.itemR(rd, "field_order", expand=True) + + split = layout.split() + split.itemL() + split.itemR(rd, "dither_intensity", text="Dither", slider=True) class SCENE_PT_output(RenderButtonsPanel): __label__ = "Output" @@ -229,8 +222,8 @@ class SCENE_PT_output(RenderButtonsPanel): col = split.column() col.itemR(rd, "file_extensions") - col.itemR(rd, "use_overwrite") - col.itemR(rd, "use_placeholder") + col.itemR(rd, "placeholders") + col.itemR(rd, "no_overwrite") if rd.file_format in ('AVIJPEG', 'JPEG'): split = layout.split() @@ -330,9 +323,11 @@ class SCENE_PT_antialiasing(RenderButtonsPanel): COMPAT_ENGINES = set(['BLENDER_RENDER']) def draw_header(self, context): + layout = self.layout + rd = context.scene.render_data - self.layout.itemR(rd, "antialiasing", text="") + layout.itemR(rd, "antialiasing", text="") def draw(self, context): layout = self.layout @@ -375,9 +370,9 @@ class SCENE_PT_dimensions(RenderButtonsPanel): sub.itemR(rd, "pixel_aspect_y", text="Y") row = col.row() - row.itemR(rd, "use_border", text="Border") + row.itemR(rd, "border", text="Border") rowsub = row.row() - rowsub.active = rd.use_border + rowsub.active = rd.border rowsub.itemR(rd, "crop_to_border", text="Crop") col = split.column(align=True) @@ -396,9 +391,11 @@ class SCENE_PT_stamp(RenderButtonsPanel): COMPAT_ENGINES = set(['BLENDER_RENDER']) def draw_header(self, context): + layout = self.layout + rd = context.scene.render_data - self.layout.itemR(rd, "render_stamp", text="") + layout.itemR(rd, "render_stamp", text="") def draw(self, context): layout = self.layout diff --git a/release/ui/buttons_texture.py b/release/ui/buttons_texture.py index 90ce40b4832..29e43981fd2 100644 --- a/release/ui/buttons_texture.py +++ b/release/ui/buttons_texture.py @@ -2,8 +2,8 @@ import bpy class TextureButtonsPanel(bpy.types.Panel): - __space_type__ = 'PROPERTIES' - __region_type__ = 'WINDOW' + __space_type__ = "PROPERTIES" + __region_type__ = "WINDOW" __context__ = "texture" def poll(self, context): @@ -210,51 +210,35 @@ class TEXTURE_PT_influence(TextureSlotPanel): sub.itemR(tex, factor, text=name, slider=True) if ma: - if ma.type in ['SURFACE', 'HALO', 'WIRE']: - split = layout.split() - - col = split.column() - col.itemL(text="Diffuse:") - factor_but(col, tex.map_diffuse, "map_diffuse", "diffuse_factor", "Intensity") - factor_but(col, tex.map_colordiff, "map_colordiff", "colordiff_factor", "Color") - factor_but(col, tex.map_alpha, "map_alpha", "alpha_factor", "Alpha") - factor_but(col, tex.map_translucency, "map_translucency", "translucency_factor", "Translucency") - - col.itemL(text="Specular:") - factor_but(col, tex.map_specular, "map_specular", "specular_factor", "Intensity") - factor_but(col, tex.map_colorspec, "map_colorspec", "colorspec_factor", "Color") - factor_but(col, tex.map_hardness, "map_hardness", "hardness_factor", "Hardness") - - col = split.column() - col.itemL(text="Shading:") - factor_but(col, tex.map_ambient, "map_ambient", "ambient_factor", "Ambient") - factor_but(col, tex.map_emit, "map_emit", "emit_factor", "Emit") - factor_but(col, tex.map_mirror, "map_mirror", "mirror_factor", "Mirror") - factor_but(col, tex.map_raymir, "map_raymir", "raymir_factor", "Ray Mirror") - - col.itemL(text="Geometry:") - factor_but(col, tex.map_normal, "map_normal", "normal_factor", "Normal") - factor_but(col, tex.map_warp, "map_warp", "warp_factor", "Warp") - factor_but(col, tex.map_displacement, "map_displacement", "displacement_factor", "Displace") - - #sub = col.column() - #sub.active = tex.map_translucency or tex.map_emit or tex.map_alpha or tex.map_raymir or tex.map_hardness or tex.map_ambient or tex.map_specularity or tex.map_reflection or tex.map_mirror - #sub.itemR(tex, "default_value", text="Amount", slider=True) - elif ma.type == 'VOLUME': - split = layout.split() - - col = split.column() - factor_but(col, tex.map_density, "map_density", "density_factor", "Density") - factor_but(col, tex.map_emission, "map_emission", "emission_factor", "Emission") - factor_but(col, tex.map_absorption, "map_absorption", "absorption_factor", "Absorption") - factor_but(col, tex.map_scattering, "map_scattering", "scattering_factor", "Scattering") - - col = split.column() - col.itemL(text=" ") - factor_but(col, tex.map_alpha, "map_coloremission", "coloremission_factor", "Emission Color") - factor_but(col, tex.map_colorabsorption, "map_colorabsorption", "colorabsorption_factor", "Absorption Color") - + split = layout.split() + + col = split.column() + col.itemL(text="Diffuse:") + factor_but(col, tex.map_diffuse, "map_diffuse", "diffuse_factor", "Intensity") + factor_but(col, tex.map_colordiff, "map_colordiff", "colordiff_factor", "Color") + factor_but(col, tex.map_alpha, "map_alpha", "alpha_factor", "Alpha") + factor_but(col, tex.map_translucency, "map_translucency", "translucency_factor", "Translucency") + + col.itemL(text="Specular:") + factor_but(col, tex.map_specular, "map_specular", "specular_factor", "Intensity") + factor_but(col, tex.map_colorspec, "map_colorspec", "colorspec_factor", "Color") + factor_but(col, tex.map_hardness, "map_hardness", "hardness_factor", "Hardness") + col = split.column() + col.itemL(text="Shading:") + factor_but(col, tex.map_ambient, "map_ambient", "ambient_factor", "Ambient") + factor_but(col, tex.map_emit, "map_emit", "emit_factor", "Emit") + factor_but(col, tex.map_mirror, "map_mirror", "mirror_factor", "Mirror") + factor_but(col, tex.map_raymir, "map_raymir", "raymir_factor", "Ray Mirror") + + col.itemL(text="Geometry:") + factor_but(col, tex.map_normal, "map_normal", "normal_factor", "Normal") + factor_but(col, tex.map_warp, "map_warp", "warp_factor", "Warp") + factor_but(col, tex.map_displacement, "map_displacement", "displacement_factor", "Displace") + + #sub = col.column() + #sub.active = tex.map_translucency or tex.map_emit or tex.map_alpha or tex.map_raymir or tex.map_hardness or tex.map_ambient or tex.map_specularity or tex.map_reflection or tex.map_mirror + #sub.itemR(tex, "default_value", text="Amount", slider=True) elif la: row = layout.row() factor_but(row, tex.map_color, "map_color", "color_factor", "Color") @@ -609,133 +593,13 @@ class TEXTURE_PT_distortednoise(TextureTypePanel): layout.itemR(tex, "noise_basis", text="Basis") flow = layout.column_flow() - flow.itemR(tex, "distortion", text="Distortion") + flow.itemR(tex, "distortion_amount", text="Distortion") flow.itemR(tex, "noise_size", text="Size") flow.itemR(tex, "nabla") - -class TEXTURE_PT_voxeldata(TextureButtonsPanel): - __idname__= "TEXTURE_PT_voxeldata" - __label__ = "Voxel Data" - - def poll(self, context): - tex = context.texture - return (tex and tex.type == 'VOXEL_DATA') - - def draw(self, context): - layout = self.layout - - tex = context.texture - vd = tex.voxeldata - - layout.itemR(vd, "file_format") - if vd.file_format in ['BLENDER_VOXEL', 'RAW_8BIT']: - layout.itemR(vd, "source_path") - if vd.file_format == 'RAW_8BIT': - layout.itemR(vd, "resolution") - elif vd.file_format == 'SMOKE': - layout.itemR(vd, "domain_object") - - layout.itemR(vd, "still") - row = layout.row() - row.active = vd.still - row.itemR(vd, "still_frame_number") - - layout.itemR(vd, "interpolation") - layout.itemR(vd, "intensity") - -class TEXTURE_PT_pointdensity(TextureButtonsPanel): - __idname__= "TEXTURE_PT_pointdensity" - __label__ = "Point Density" - - def poll(self, context): - tex = context.texture - return (tex and tex.type == 'POINT_DENSITY') - - def draw(self, context): - layout = self.layout - - tex = context.texture - pd = tex.pointdensity - - layout.itemR(pd, "point_source", expand=True) - - split = layout.split() - - col = split.column() - if pd.point_source == 'PARTICLE_SYSTEM': - col.itemL(text="Object:") - col.itemR(pd, "object", text="") - - sub = col.column() - sub.enabled = pd.object - if pd.object: - sub.itemL(text="System:") - sub.item_pointerR(pd, "particle_system", pd.object, "particle_systems", text="") - sub.itemL(text="Cache:") - sub.itemR(pd, "particle_cache", text="") - else: - col.itemL(text="Object:") - col.itemR(pd, "object", text="") - col.itemL(text="Cache:") - col.itemR(pd, "vertices_cache", text="") - - col.itemS() - - col.itemL(text="Color Source:") - col.itemR(pd, "color_source", text="") - if pd.color_source in ('PARTICLE_SPEED', 'PARTICLE_VELOCITY'): - col.itemR(pd, "speed_scale") - if pd.color_source in ('PARTICLE_SPEED', 'PARTICLE_AGE'): - layout.template_color_ramp(pd.color_ramp, expand=True) - - col = split.column() - col.itemL() - col.itemR(pd, "radius") - col.itemL(text="Falloff:") - col.itemR(pd, "falloff", text="") - if pd.falloff == 'SOFT': - col.itemR(pd, "falloff_softness") - -class TEXTURE_PT_pointdensity_turbulence(TextureButtonsPanel): - __label__ = "Turbulence" - - def poll(self, context): - tex = context.texture - return (tex and tex.type == 'POINT_DENSITY') - - def draw_header(self, context): - layout = self.layout - - tex = context.texture - pd = tex.pointdensity - - layout.itemR(pd, "turbulence", text="") - - def draw(self, context): - layout = self.layout - - tex = context.texture - pd = tex.pointdensity - layout.active = pd.turbulence - - split = layout.split() - - col = split.column() - col.itemL(text="Influence:") - col.itemR(pd, "turbulence_influence", text="") - col.itemL(text="Noise Basis:") - col.itemR(pd, "noise_basis", text="") - - col = split.column() - col.itemL() - col.itemR(pd, "turbulence_size") - col.itemR(pd, "turbulence_depth") - col.itemR(pd, "turbulence_strength") bpy.types.register(TEXTURE_PT_context_texture) bpy.types.register(TEXTURE_PT_preview) - -bpy.types.register(TEXTURE_PT_clouds) # Texture Type Panels +bpy.types.register(TEXTURE_PT_clouds) bpy.types.register(TEXTURE_PT_wood) bpy.types.register(TEXTURE_PT_marble) bpy.types.register(TEXTURE_PT_magic) @@ -749,10 +613,6 @@ bpy.types.register(TEXTURE_PT_envmap) bpy.types.register(TEXTURE_PT_musgrave) bpy.types.register(TEXTURE_PT_voronoi) bpy.types.register(TEXTURE_PT_distortednoise) -bpy.types.register(TEXTURE_PT_voxeldata) -bpy.types.register(TEXTURE_PT_pointdensity) -bpy.types.register(TEXTURE_PT_pointdensity_turbulence) - bpy.types.register(TEXTURE_PT_colors) bpy.types.register(TEXTURE_PT_mapping) bpy.types.register(TEXTURE_PT_influence) diff --git a/release/ui/buttons_world.py b/release/ui/buttons_world.py index b02673d126f..599f45d160b 100644 --- a/release/ui/buttons_world.py +++ b/release/ui/buttons_world.py @@ -2,21 +2,24 @@ import bpy class WorldButtonsPanel(bpy.types.Panel): - __space_type__ = 'PROPERTIES' - __region_type__ = 'WINDOW' + __space_type__ = "PROPERTIES" + __region_type__ = "WINDOW" __context__ = "world" # COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here def poll(self, context): rd = context.scene.render_data - return (context.world) and (not rd.use_game_engine) and (rd.engine in self.COMPAT_ENGINES) + return (context.world != None) and (not rd.use_game_engine) and (rd.engine in self.COMPAT_ENGINES) class WORLD_PT_preview(WorldButtonsPanel): __label__ = "Preview" COMPAT_ENGINES = set(['BLENDER_RENDER']) def draw(self, context): - self.layout.template_preview(context.world) + layout = self.layout + world = context.world + + layout.template_preview(world) class WORLD_PT_context_world(WorldButtonsPanel): __show_header__ = False @@ -49,30 +52,32 @@ class WORLD_PT_world(WorldButtonsPanel): world = context.world - row = layout.row() - row.itemR(world, "paper_sky") - row.itemR(world, "blend_sky") - row.itemR(world, "real_sky") + if world: + + row = layout.row() + row.itemR(world, "paper_sky") + row.itemR(world, "blend_sky") + row.itemR(world, "real_sky") - row = layout.row() - row.column().itemR(world, "horizon_color") - col = row.column() - col.itemR(world, "zenith_color") - col.active = world.blend_sky - row.column().itemR(world, "ambient_color") + row = layout.row() + row.column().itemR(world, "horizon_color") + col = row.column() + col.itemR(world, "zenith_color") + col.active = world.blend_sky + row.column().itemR(world, "ambient_color") class WORLD_PT_mist(WorldButtonsPanel): __label__ = "Mist" COMPAT_ENGINES = set(['BLENDER_RENDER']) def draw_header(self, context): + layout = self.layout world = context.world - self.layout.itemR(world.mist, "enabled", text="") + layout.itemR(world.mist, "enabled", text="") def draw(self, context): layout = self.layout - world = context.world layout.active = world.mist.enabled @@ -82,6 +87,7 @@ class WORLD_PT_mist(WorldButtonsPanel): flow.itemR(world.mist, "start") flow.itemR(world.mist, "depth") flow.itemR(world.mist, "height") + layout.itemR(world.mist, "falloff") @@ -90,13 +96,13 @@ class WORLD_PT_stars(WorldButtonsPanel): COMPAT_ENGINES = set(['BLENDER_RENDER']) def draw_header(self, context): + layout = self.layout world = context.world - self.layout.itemR(world.stars, "enabled", text="") + layout.itemR(world.stars, "enabled", text="") def draw(self, context): layout = self.layout - world = context.world layout.active = world.stars.enabled @@ -112,13 +118,13 @@ class WORLD_PT_ambient_occlusion(WorldButtonsPanel): COMPAT_ENGINES = set(['BLENDER_RENDER']) def draw_header(self, context): + layout = self.layout world = context.world - self.layout.itemR(world.ambient_occlusion, "enabled", text="") + layout.itemR(world.ambient_occlusion, "enabled", text="") def draw(self, context): layout = self.layout - ao = context.world.ambient_occlusion layout.active = ao.enabled @@ -180,3 +186,4 @@ bpy.types.register(WORLD_PT_world) bpy.types.register(WORLD_PT_ambient_occlusion) bpy.types.register(WORLD_PT_mist) bpy.types.register(WORLD_PT_stars) + diff --git a/release/ui/space_buttons.py b/release/ui/space_buttons.py index aa89c06ea08..3cf782e615f 100644 --- a/release/ui/space_buttons.py +++ b/release/ui/space_buttons.py @@ -2,7 +2,7 @@ import bpy class Buttons_HT_header(bpy.types.Header): - __space_type__ = 'PROPERTIES' + __space_type__ = "PROPERTIES" def draw(self, context): layout = self.layout @@ -22,7 +22,7 @@ class Buttons_HT_header(bpy.types.Header): row.itemR(scene, "current_frame") class Buttons_MT_view(bpy.types.Menu): - __space_type__ = 'PROPERTIES' + __space_type__ = "PROPERTIES" __label__ = "View" def draw(self, context): diff --git a/release/ui/space_console.py b/release/ui/space_console.py index 136082a285a..45cb2a856e1 100644 --- a/release/ui/space_console.py +++ b/release/ui/space_console.py @@ -5,7 +5,7 @@ import bpy_ops # XXX - should not need to do this del bpy_ops class CONSOLE_HT_header(bpy.types.Header): - __space_type__ = 'CONSOLE' + __space_type__ = "CONSOLE" def draw(self, context): sc = context.space_data @@ -39,7 +39,7 @@ class CONSOLE_HT_header(bpy.types.Header): row.itemO("console.report_replay") class CONSOLE_MT_console(bpy.types.Menu): - __space_type__ = 'CONSOLE' + __space_type__ = "CONSOLE" __label__ = "Console" def draw(self, context): @@ -52,7 +52,7 @@ class CONSOLE_MT_console(bpy.types.Menu): layout.itemO("console.paste") class CONSOLE_MT_report(bpy.types.Menu): - __space_type__ = 'CONSOLE' + __space_type__ = "CONSOLE" __label__ = "Report" def draw(self, context): @@ -108,9 +108,9 @@ def get_console(console_id): class CONSOLE_OT_exec(bpy.types.Operator): ''' - Execute the current console line as a python expression. + Operator documentatuon text, will be used for the operator tooltip and python docs. ''' - __idname__ = "console.execute" + __idname__ = "console.exec" __label__ = "Console Execute" __register__ = False @@ -385,7 +385,7 @@ def autocomp(bcon): class CONSOLE_OT_autocomplete(bpy.types.Operator): ''' - Evaluate the namespace up until the cursor and give a list of options or complete the name if there is only one. + Operator documentatuon text, will be used for the operator tooltip and python docs. ''' __idname__ = "console.autocomplete" __label__ = "Console Autocomplete" diff --git a/release/ui/space_filebrowser.py b/release/ui/space_filebrowser.py index f1ea5555787..51a8f3f78e8 100644 --- a/release/ui/space_filebrowser.py +++ b/release/ui/space_filebrowser.py @@ -1,15 +1,15 @@ import bpy + class FILEBROWSER_HT_header(bpy.types.Header): - __space_type__ = 'FILE_BROWSER' + __space_type__ = "FILE_BROWSER" def draw(self, context): + st = context.space_data layout = self.layout - st = context.space_data params = st.params - layout.template_header(menus=False) row = layout.row(align=True) @@ -39,4 +39,5 @@ class FILEBROWSER_HT_header(bpy.types.Header): row.active = params.do_filter + bpy.types.register(FILEBROWSER_HT_header) diff --git a/release/ui/space_image.py b/release/ui/space_image.py index 3f82727da47..090067120b1 100644 --- a/release/ui/space_image.py +++ b/release/ui/space_image.py @@ -2,19 +2,18 @@ import bpy class IMAGE_MT_view(bpy.types.Menu): - __space_type__ = 'IMAGE_EDITOR' + __space_type__ = "IMAGE_EDITOR" __label__ = "View" def draw(self, context): layout = self.layout - sima = context.space_data uv = sima.uv_editor settings = context.tool_settings show_uvedit = sima.show_uvedit - layout.itemO("image.properties", icon='ICON_MENU_PANEL') + layout.itemO("image.properties", icon="ICON_MENU_PANEL") layout.itemS() @@ -44,7 +43,7 @@ class IMAGE_MT_view(bpy.types.Menu): layout.itemO("screen.screen_full_area") class IMAGE_MT_select(bpy.types.Menu): - __space_type__ = 'IMAGE_EDITOR' + __space_type__ = "IMAGE_EDITOR" __label__ = "Select" def draw(self, context): @@ -65,12 +64,11 @@ class IMAGE_MT_select(bpy.types.Menu): layout.itemO("uv.select_linked") class IMAGE_MT_image(bpy.types.Menu): - __space_type__ = 'IMAGE_EDITOR' + __space_type__ = "IMAGE_EDITOR" __label__ = "Image" def draw(self, context): layout = self.layout - sima = context.space_data ima = sima.image @@ -87,7 +85,7 @@ class IMAGE_MT_image(bpy.types.Menu): layout.itemO("image.save") layout.itemO("image.save_as") - if ima.source == 'SEQUENCE': + if ima.source == "SEQUENCE": layout.itemO("image.save_sequence") if not show_render: @@ -101,7 +99,7 @@ class IMAGE_MT_image(bpy.types.Menu): # only for dirty && specific image types, perhaps # this could be done in operator poll too if ima.dirty: - if ima.source in ('FILE', 'GENERATED') and ima.type != 'MULTILAYER': + if ima.source in ("FILE", "GENERATED") and ima.type != "MULTILAYER": layout.item_booleanO("image.pack", "as_png", True, text="Pack As PNG") layout.itemS() @@ -109,7 +107,7 @@ class IMAGE_MT_image(bpy.types.Menu): layout.itemR(sima, "image_painting") class IMAGE_MT_uvs_showhide(bpy.types.Menu): - __space_type__ = 'IMAGE_EDITOR' + __space_type__ = "IMAGE_EDITOR" __label__ = "Show/Hide Faces" def draw(self, context): @@ -120,7 +118,7 @@ class IMAGE_MT_uvs_showhide(bpy.types.Menu): layout.item_booleanO("uv.hide", "unselected", True) class IMAGE_MT_uvs_transform(bpy.types.Menu): - __space_type__ = 'IMAGE_EDITOR' + __space_type__ = "IMAGE_EDITOR" __label__ = "Transform" def draw(self, context): @@ -131,7 +129,7 @@ class IMAGE_MT_uvs_transform(bpy.types.Menu): layout.item_enumO("tfm.transform", "mode", 'RESIZE') class IMAGE_MT_uvs_mirror(bpy.types.Menu): - __space_type__ = 'IMAGE_EDITOR' + __space_type__ = "IMAGE_EDITOR" __label__ = "Mirror" def draw(self, context): @@ -141,7 +139,7 @@ class IMAGE_MT_uvs_mirror(bpy.types.Menu): layout.item_enumO("uv.mirror", "axis", 'MIRROR_Y') # "Y Axis", M, class IMAGE_MT_uvs_weldalign(bpy.types.Menu): - __space_type__ = 'IMAGE_EDITOR' + __space_type__ = "IMAGE_EDITOR" __label__ = "Weld/Align" def draw(self, context): @@ -150,13 +148,13 @@ class IMAGE_MT_uvs_weldalign(bpy.types.Menu): layout.itemO("uv.weld") # W, 1 layout.items_enumO("uv.align", "axis") # W, 2/3/4 + class IMAGE_MT_uvs(bpy.types.Menu): - __space_type__ = 'IMAGE_EDITOR' + __space_type__ = "IMAGE_EDITOR" __label__ = "UVs" def draw(self, context): layout = self.layout - sima = context.space_data uv = sima.uv_editor settings = context.tool_settings @@ -194,14 +192,13 @@ class IMAGE_MT_uvs(bpy.types.Menu): layout.itemM("IMAGE_MT_uvs_showhide") class IMAGE_HT_header(bpy.types.Header): - __space_type__ = 'IMAGE_EDITOR' + __space_type__ = "IMAGE_EDITOR" def draw(self, context): - layout = self.layout - sima = context.space_data ima = sima.image iuser = sima.image_user + layout = self.layout settings = context.tool_settings show_render = sima.show_render @@ -250,7 +247,7 @@ class IMAGE_HT_header(bpy.types.Header): """ mesh = context.edit_object.data - row.item_pointerR(mesh, "active_uv_layer", mesh, "uv_textures") + row.item_pointerR(mesh, "active_uv_layer", mesh, "uv_layers") """ if ima: @@ -265,17 +262,17 @@ class IMAGE_HT_header(bpy.types.Header): row.itemR(sima, "draw_channels", text="", expand=True) row = layout.row(align=True) - if ima.type == 'COMPOSITE': - row.itemO("image.record_composite", icon='ICON_REC') - if ima.type == 'COMPOSITE' and ima.source in ('MOVIE', 'SEQUENCE'): - row.itemO("image.play_composite", icon='ICON_PLAY') + if ima.type == "COMPOSITE": + row.itemO("image.record_composite", icon="ICON_REC") + if ima.type == "COMPOSITE" and ima.source in ("MOVIE", "SEQUENCE"): + row.itemO("image.play_composite", icon="ICON_PLAY") if show_uvedit or sima.image_painting: layout.itemR(sima, "update_automatically", text="") class IMAGE_PT_game_properties(bpy.types.Panel): - __space_type__ = 'IMAGE_EDITOR' - __region_type__ = 'UI' + __space_type__ = "IMAGE_EDITOR" + __region_type__ = "UI" __label__ = "Game Properties" def poll(self, context): @@ -284,48 +281,52 @@ class IMAGE_PT_game_properties(bpy.types.Panel): return (sima and sima.image) and (rd.engine == 'BLENDER_GAME') def draw(self, context): - layout = self.layout - sima = context.space_data + layout = self.layout + ima = sima.image - split = layout.split() + if ima: + split = layout.split() - col = split.column() - col.itemR(ima, "clamp_x") - col.itemR(ima, "clamp_y") - col.itemR(ima, "mapping", expand=True) - col.itemR(ima, "tiles") + col = split.column() - col = split.column() + subcol = col.column(align=True) + subcol.itemR(ima, "clamp_x") + subcol.itemR(ima, "clamp_y") + + col.itemR(ima, "mapping", expand=True) + col.itemR(ima, "tiles") + + col = split.column() - sub = col.column(align=True) - sub.itemR(ima, "animated") + subcol = col.column(align=True) + subcol.itemR(ima, "animated") - subsub = sub.column() - subsub.active = ima.animated - subsub.itemR(ima, "animation_start", text="Start") - subsub.itemR(ima, "animation_end", text="End") - subsub.itemR(ima, "animation_speed", text="Speed") + subcol = subcol.column() + subcol.itemR(ima, "animation_start", text="Start") + subcol.itemR(ima, "animation_end", text="End") + subcol.itemR(ima, "animation_speed", text="Speed") + subcol.active = ima.animated - sub = col.row(align=True) - sub.active = ima.tiles or ima.animated - sub.itemR(ima, "tiles_x", text="X") - sub.itemR(ima, "tiles_y", text="Y") + subrow = col.row(align=True) + subrow.itemR(ima, "tiles_x", text="X") + subrow.itemR(ima, "tiles_y", text="Y") + subrow.active = ima.tiles or ima.animated class IMAGE_PT_view_properties(bpy.types.Panel): - __space_type__ = 'IMAGE_EDITOR' - __region_type__ = 'UI' - __label__ = "Display" + __space_type__ = "IMAGE_EDITOR" + __region_type__ = "UI" + __label__ = "View Properties" def poll(self, context): sima = context.space_data return (sima and (sima.image or sima.show_uvedit)) def draw(self, context): - layout = self.layout - sima = context.space_data + layout = self.layout + ima = sima.image show_uvedit = sima.show_uvedit uvedit = sima.uv_editor @@ -334,33 +335,26 @@ class IMAGE_PT_view_properties(bpy.types.Panel): col = split.column() if ima: - col.itemR(ima, "display_aspect", text="Aspect Ratio") + col.itemR(ima, "display_aspect") 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) - - split = layout.split() + row = col.row() + row.itemR(uvedit, "draw_smooth_edges", text="Smooth") + row.itemR(uvedit, "draw_modified_edges", text="Modified") - 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") + row = col.row() + row.itemR(uvedit, "draw_stretch", text="Stretch") + row.itemR(uvedit, "draw_stretch_type", text="") #col.itemR(uvedit, "draw_edges") #col.itemR(uvedit, "draw_faces") @@ -375,3 +369,4 @@ bpy.types.register(IMAGE_MT_uvs) bpy.types.register(IMAGE_HT_header) bpy.types.register(IMAGE_PT_game_properties) bpy.types.register(IMAGE_PT_view_properties) + diff --git a/release/ui/space_info.py b/release/ui/space_info.py index e6cc4af2a06..bfe051b8df2 100644 --- a/release/ui/space_info.py +++ b/release/ui/space_info.py @@ -2,14 +2,13 @@ import bpy class INFO_HT_header(bpy.types.Header): - __space_type__ = 'INFO' + __space_type__ = "INFO" def draw(self, context): layout = self.layout st = context.space_data - scene = context.scene - rd = scene.render_data + rd = context.scene.render_data row = layout.row(align=True) row.template_header() @@ -34,11 +33,9 @@ class INFO_HT_header(bpy.types.Header): layout.template_operator_search() layout.template_running_jobs() - - layout.itemL(text=scene.statistics()) class INFO_MT_file(bpy.types.Menu): - __space_type__ = 'INFO' + __space_type__ = "INFO" __label__ = "File" def draw(self, context): @@ -74,7 +71,7 @@ class INFO_MT_file(bpy.types.Menu): layout.itemO("wm.exit_blender", text="Quit") class INFO_MT_file_import(bpy.types.Menu): - __space_type__ = 'INFO' + __space_type__ = "INFO" __label__ = "Import" def draw(self, context): @@ -83,7 +80,7 @@ class INFO_MT_file_import(bpy.types.Menu): layout.itemO("import.obj", text="OBJ") class INFO_MT_file_export(bpy.types.Menu): - __space_type__ = 'INFO' + __space_type__ = "INFO" __label__ = "Export" def draw(self, context): @@ -96,7 +93,7 @@ class INFO_MT_file_export(bpy.types.Menu): layout.itemO("export.x3d", text="X3D") class INFO_MT_file_external_data(bpy.types.Menu): - __space_type__ = 'INFO' + __space_type__ = "INFO" __label__ = "External Data" def draw(self, context): @@ -113,7 +110,7 @@ class INFO_MT_file_external_data(bpy.types.Menu): layout.itemO("file.find_missing_files") class INFO_MT_add(bpy.types.Menu): - __space_type__ = 'INFO' + __space_type__ = "INFO" __label__ = "Add" def draw(self, context): @@ -121,25 +118,25 @@ class INFO_MT_add(bpy.types.Menu): layout.operator_context = "EXEC_SCREEN" - layout.item_menu_enumO("object.mesh_add", "type", text="Mesh", icon='ICON_OUTLINER_OB_MESH') - layout.item_menu_enumO("object.curve_add", "type", text="Curve", icon='ICON_OUTLINER_OB_CURVE') - layout.item_menu_enumO("object.surface_add", "type", text="Surface", icon='ICON_OUTLINER_OB_SURFACE') - layout.item_menu_enumO("object.metaball_add", "type", 'META', icon='ICON_OUTLINER_OB_META') - layout.itemO("object.text_add", text="Text", icon='ICON_OUTLINER_OB_FONT') + layout.item_menu_enumO( "OBJECT_OT_mesh_add", "type", text="Mesh", icon='ICON_OUTLINER_OB_MESH') + layout.item_menu_enumO( "OBJECT_OT_curve_add", "type", text="Curve", icon='ICON_OUTLINER_OB_CURVE') + layout.item_menu_enumO( "OBJECT_OT_surface_add", "type", text="Surface", icon='ICON_OUTLINER_OB_SURFACE') + layout.item_menu_enumO( "OBJECT_OT_metaball_add", "type", 'META', icon='ICON_OUTLINER_OB_META') + layout.itemO("OBJECT_OT_text_add", text="Text", icon='ICON_OUTLINER_OB_FONT') layout.itemS() - layout.itemO("object.armature_add", text="Armature", icon='ICON_OUTLINER_OB_ARMATURE') - layout.item_enumO("object.add", "type", 'LATTICE', icon='ICON_OUTLINER_OB_LATTICE') - layout.item_enumO("object.add", "type", 'EMPTY', icon='ICON_OUTLINER_OB_EMPTY') + layout.itemO("OBJECT_OT_armature_add", text="Armature", icon='ICON_OUTLINER_OB_ARMATURE') + layout.item_enumO("OBJECT_OT_object_add", "type", 'LATTICE', icon='ICON_OUTLINER_OB_LATTICE') + layout.item_enumO("OBJECT_OT_object_add", "type", 'EMPTY', icon='ICON_OUTLINER_OB_EMPTY') layout.itemS() - layout.item_enumO("object.add", "type", 'CAMERA', icon='ICON_OUTLINER_OB_CAMERA') - layout.item_enumO("object.add", "type", 'LAMP', icon='ICON_OUTLINER_OB_LAMP') + layout.item_enumO("OBJECT_OT_object_add", "type", 'CAMERA', icon='ICON_OUTLINER_OB_CAMERA') + layout.item_enumO("OBJECT_OT_object_add", "type", 'LAMP', icon='ICON_OUTLINER_OB_LAMP') class INFO_MT_game(bpy.types.Menu): - __space_type__ = 'INFO' + __space_type__ = "INFO" __label__ = "Game" def draw(self, context): @@ -157,7 +154,7 @@ class INFO_MT_game(bpy.types.Menu): layout.itemR(gs, "deprecation_warnings") class INFO_MT_render(bpy.types.Menu): - __space_type__ = 'INFO' + __space_type__ = "INFO" __label__ = "Render" def draw(self, context): @@ -173,7 +170,7 @@ class INFO_MT_render(bpy.types.Menu): layout.itemO("screen.render_view_show") class INFO_MT_help(bpy.types.Menu): - __space_type__ = 'INFO' + __space_type__ = "INFO" __label__ = "Help" def draw(self, context): diff --git a/release/ui/space_logic.py b/release/ui/space_logic.py index 5748d15a53a..728e5e6307b 100644 --- a/release/ui/space_logic.py +++ b/release/ui/space_logic.py @@ -1,8 +1,8 @@ import bpy class LOGIC_PT_properties(bpy.types.Panel): - __space_type__ = 'LOGIC_EDITOR' - __region_type__ = 'UI' + __space_type__ = "LOGIC_EDITOR" + __region_type__ = "UI" __label__ = "Properties" def poll(self, context): @@ -11,19 +11,15 @@ class LOGIC_PT_properties(bpy.types.Panel): def draw(self, context): layout = self.layout - ob = context.active_object game = ob.game - layout.itemO("object.game_property_new", text="Add Game Property") - - for i, prop in enumerate(game.properties): - - row = layout.row(align=True) - row.itemR(prop, "name", text="") - row.itemR(prop, "type", text="") - row.itemR(prop, "value", text="", toggle=True) # we dont care about the type. rna will display correctly - row.itemR(prop, "debug", text="", toggle=True, icon='ICON_INFO') - row.item_intO("object.game_property_remove", "index", i, text="", icon='ICON_X') - + for prop in game.properties: + flow = layout.row() + flow.itemR(prop, "name", text="") + flow.itemR(prop, "type", text="") + flow.itemR(prop, "value", text="") # we dont care about the type. rna will display correctly + flow.itemR(prop, "debug") + bpy.types.register(LOGIC_PT_properties) + diff --git a/release/ui/space_node.py b/release/ui/space_node.py index 6ac1ac84f35..2e28cfc2eed 100644 --- a/release/ui/space_node.py +++ b/release/ui/space_node.py @@ -2,11 +2,10 @@ import bpy class NODE_HT_header(bpy.types.Header): - __space_type__ = 'NODE_EDITOR' + __space_type__ = "NODE_EDITOR" def draw(self, context): layout = self.layout - snode = context.space_data row = layout.row(align=True) @@ -28,7 +27,7 @@ class NODE_HT_header(bpy.types.Header): if ob: layout.template_ID(ob, "active_material", new="material.new") if id: - layout.itemR(id, "use_nodes") + layout.itemR(id, "use_nodes", toggle=True) elif snode.tree_type == 'TEXTURE': row.itemR(snode, "texture_type", text="", expand=True) @@ -38,17 +37,17 @@ class NODE_HT_header(bpy.types.Header): if id_from: layout.template_ID(id_from, "active_texture", new="texture.new") if id: - layout.itemR(id, "use_nodes") + layout.itemR(id, "use_nodes", toggle=True) elif snode.tree_type == 'COMPOSITING': id = snode.id - layout.itemR(id, "use_nodes") - layout.itemR(id.render_data, "free_unused_nodes", text="Free Unused") - layout.itemR(snode, "backdrop") + layout.itemR(id, "use_nodes", toggle=True) + layout.itemR(id.render_data, "free_unused_nodes", text="Free Unused", toggle=True) + layout.itemR(snode, "backdrop", toggle=True) class NODE_MT_view(bpy.types.Menu): - __space_type__ = 'NODE_EDITOR' + __space_type__ = "NODE_EDITOR" __label__ = "View" def draw(self, context): @@ -66,7 +65,7 @@ class NODE_MT_view(bpy.types.Menu): layout.itemO("screen.screen_full_area") class NODE_MT_select(bpy.types.Menu): - __space_type__ = 'NODE_EDITOR' + __space_type__ = "NODE_EDITOR" __label__ = "Select" def draw(self, context): @@ -81,7 +80,7 @@ class NODE_MT_select(bpy.types.Menu): # layout.itemO("node.select_linked_to") class NODE_MT_node(bpy.types.Menu): - __space_type__ = 'NODE_EDITOR' + __space_type__ = "NODE_EDITOR" __label__ = "Node" def draw(self, context): @@ -114,7 +113,9 @@ class NODE_MT_node(bpy.types.Menu): # layout.itemS() # layout.itemO("node.show_cyclic_dependencies") + bpy.types.register(NODE_HT_header) bpy.types.register(NODE_MT_view) bpy.types.register(NODE_MT_select) bpy.types.register(NODE_MT_node) + diff --git a/release/ui/space_outliner.py b/release/ui/space_outliner.py index 522b620e29d..f55f4633a7b 100644 --- a/release/ui/space_outliner.py +++ b/release/ui/space_outliner.py @@ -2,7 +2,7 @@ import bpy class OUTLINER_HT_header(bpy.types.Header): - __space_type__ = 'OUTLINER' + __space_type__ = "OUTLINER" def draw(self, context): so = context.space_data @@ -36,7 +36,7 @@ class OUTLINER_HT_header(bpy.types.Header): class OUTLINER_MT_view(bpy.types.Menu): - __space_type__ = 'OUTLINER' + __space_type__ = "OUTLINER" __label__ = "View" def draw(self, context): diff --git a/release/ui/space_sequencer.py b/release/ui/space_sequencer.py index daae4a83ec4..1edcf32d3b5 100644 --- a/release/ui/space_sequencer.py +++ b/release/ui/space_sequencer.py @@ -7,7 +7,7 @@ def act_strip(context): # Header class SEQUENCER_HT_header(bpy.types.Header): - __space_type__ = 'SEQUENCE_EDITOR' + __space_type__ = "SEQUENCE_EDITOR" def draw(self, context): layout = self.layout @@ -38,7 +38,7 @@ class SEQUENCER_HT_header(bpy.types.Header): layout.itemR(st, "display_channel", text="Channel") class SEQUENCER_MT_view(bpy.types.Menu): - __space_type__ = 'SEQUENCE_EDITOR' + __space_type__ = "SEQUENCE_EDITOR" __label__ = "View" def draw(self, context): @@ -106,7 +106,7 @@ class SEQUENCER_MT_view(bpy.types.Menu): """ class SEQUENCER_MT_select(bpy.types.Menu): - __space_type__ = 'SEQUENCE_EDITOR' + __space_type__ = "SEQUENCE_EDITOR" __label__ = "Select" def draw(self, context): @@ -127,7 +127,7 @@ class SEQUENCER_MT_select(bpy.types.Menu): layout.itemO("sequencer.select_inverse") class SEQUENCER_MT_marker(bpy.types.Menu): - __space_type__ = 'SEQUENCE_EDITOR' + __space_type__ = "SEQUENCE_EDITOR" __label__ = "Marker (TODO)" def draw(self, context): @@ -146,7 +146,7 @@ class SEQUENCER_MT_marker(bpy.types.Menu): #layout.itemO("sequencer.sound_strip_add", text="Transform Markers") # toggle, will be rna - (sseq->flag & SEQ_MARKER_TRANS) class SEQUENCER_MT_add(bpy.types.Menu): - __space_type__ = 'SEQUENCE_EDITOR' + __space_type__ = "SEQUENCE_EDITOR" __label__ = "Add" def draw(self, context): @@ -163,7 +163,7 @@ class SEQUENCER_MT_add(bpy.types.Menu): layout.itemM("SEQUENCER_MT_add_effect") class SEQUENCER_MT_add_effect(bpy.types.Menu): - __space_type__ = 'SEQUENCE_EDITOR' + __space_type__ = "SEQUENCE_EDITOR" __label__ = "Effect Strip..." def draw(self, context): @@ -187,7 +187,7 @@ class SEQUENCER_MT_add_effect(bpy.types.Menu): layout.item_enumO("sequencer.effect_strip_add", 'type', 'SPEED') class SEQUENCER_MT_strip(bpy.types.Menu): - __space_type__ = 'SEQUENCE_EDITOR' + __space_type__ = "SEQUENCE_EDITOR" __label__ = "Strip" def draw(self, context): @@ -254,15 +254,15 @@ class SEQUENCER_MT_strip(bpy.types.Menu): # Panels class SequencerButtonsPanel(bpy.types.Panel): - __space_type__ = 'SEQUENCE_EDITOR' - __region_type__ = 'UI' + __space_type__ = "SEQUENCE_EDITOR" + __region_type__ = "UI" def poll(self, context): return context.space_data.display_mode == 'SEQUENCER' and act_strip(context) != None class SequencerButtonsPanel_Output(bpy.types.Panel): - __space_type__ = 'SEQUENCE_EDITOR' - __region_type__ = 'UI' + __space_type__ = "SEQUENCE_EDITOR" + __region_type__ = "UI" def poll(self, context): return context.space_data.display_mode != 'SEQUENCER' @@ -303,7 +303,6 @@ class SEQUENCER_PT_edit(SequencerButtonsPanel): row.itemR(strip, "frame_locked", text="Frame Lock") col = layout.column() - col.enabled = not strip.lock col.itemR(strip, "channel") col.itemR(strip, "start_frame") col.itemR(strip, "length") @@ -416,28 +415,23 @@ class SEQUENCER_PT_input(SequencerButtonsPanel): if not strip: return False - return strip.type in ('MOVIE', 'IMAGE') + return strip.type in ('MOVIE', 'IMAGE', 'SOUND') def draw(self, context): layout = self.layout strip = act_strip(context) - split = layout.split(percentage=0.2) - col = split.column() - col.itemL(text="Path:") - col = split.column() - col.itemR(strip, "directory", text="") + layout.itemR(strip, "directory", text="") # Current element for the filename - + split = layout.split(percentage=0.3) + col = split.column() + col.itemL(text="File Name:") + col = split.column() elem = strip.getStripElem(context.scene.current_frame) if elem: - split = layout.split(percentage=0.2) - col = split.column() - col.itemL(text="File:") - col = split.column() col.itemR(elem, "filename", text="") # strip.elements[0] could be a fallback layout.itemR(strip, "use_translation", text="Image Offset:") @@ -461,37 +455,6 @@ class SEQUENCER_PT_input(SequencerButtonsPanel): col.itemR(strip, "animation_start_offset", text="Start") col.itemR(strip, "animation_end_offset", text="End") -class SEQUENCER_PT_sound(SequencerButtonsPanel): - __label__ = "Sound" - - def poll(self, context): - if context.space_data.display_mode != 'SEQUENCER': - return False - - strip = act_strip(context) - if not strip: - return False - - return strip.type in ('SOUND', ) - - def draw(self, context): - layout = self.layout - - strip = act_strip(context) - - layout.template_ID(strip, "sound", new="sound.open") - - layout.itemS() - layout.itemR(strip.sound, "filename", text="") - - row = layout.row() - if strip.sound.packed_file: - row.itemO("sound.unpack", icon='ICON_PACKAGE', text="Unpack") - else: - row.itemO("sound.pack", icon='ICON_UGLYPACKAGE', text="Pack") - - row.itemR(strip.sound, "caching") - class SEQUENCER_PT_filter(SequencerButtonsPanel): __label__ = "Filter" @@ -595,7 +558,6 @@ bpy.types.register(SEQUENCER_MT_strip) bpy.types.register(SEQUENCER_PT_edit) # sequencer panels bpy.types.register(SEQUENCER_PT_effect) bpy.types.register(SEQUENCER_PT_input) -bpy.types.register(SEQUENCER_PT_sound) bpy.types.register(SEQUENCER_PT_filter) bpy.types.register(SEQUENCER_PT_proxy) diff --git a/release/ui/space_text.py b/release/ui/space_text.py index 117033c50a1..61e8d3489a5 100644 --- a/release/ui/space_text.py +++ b/release/ui/space_text.py @@ -2,13 +2,12 @@ import bpy class TEXT_HT_header(bpy.types.Header): - __space_type__ = 'TEXT_EDITOR' + __space_type__ = "TEXT_EDITOR" def draw(self, context): - layout = self.layout - st = context.space_data text = st.text + layout = self.layout row = layout.row(align=True) row.template_header() @@ -46,14 +45,13 @@ class TEXT_HT_header(bpy.types.Header): row.itemL(text="Text: Internal") class TEXT_PT_properties(bpy.types.Panel): - __space_type__ = 'TEXT_EDITOR' - __region_type__ = 'UI' + __space_type__ = "TEXT_EDITOR" + __region_type__ = "UI" __label__ = "Properties" def draw(self, context): - layout = self.layout - st = context.space_data + layout = self.layout flow = layout.column_flow() flow.itemR(st, "line_numbers") @@ -66,14 +64,13 @@ class TEXT_PT_properties(bpy.types.Panel): flow.itemR(st, "tab_width") class TEXT_PT_find(bpy.types.Panel): - __space_type__ = 'TEXT_EDITOR' - __region_type__ = 'UI' + __space_type__ = "TEXT_EDITOR" + __region_type__ = "UI" __label__ = "Find" def draw(self, context): - layout = self.layout - st = context.space_data + layout = self.layout # find col = layout.column(align=True) @@ -98,12 +95,11 @@ class TEXT_PT_find(bpy.types.Panel): row.itemR(st, "find_all", text="All") class TEXT_MT_text(bpy.types.Menu): - __space_type__ = 'TEXT_EDITOR' + __space_type__ = "TEXT_EDITOR" __label__ = "Text" def draw(self, context): layout = self.layout - st = context.space_data text = st.text @@ -131,7 +127,7 @@ class TEXT_MT_text(bpy.types.Menu): layout.itemS() - layout.itemO("text.properties", icon='ICON_MENU_PANEL') + layout.itemO("text.properties", icon="ICON_MENU_PANEL") #ifndef DISABLE_PYTHON # XXX layout.column() @@ -140,7 +136,7 @@ class TEXT_MT_text(bpy.types.Menu): #endif class TEXT_MT_edit_view(bpy.types.Menu): - __space_type__ = 'TEXT_EDITOR' + __space_type__ = "TEXT_EDITOR" __label__ = "View" def draw(self, context): @@ -150,7 +146,7 @@ class TEXT_MT_edit_view(bpy.types.Menu): layout.item_enumO("text.move", "type", 'FILE_BOTTOM', text="Bottom of File") class TEXT_MT_edit_select(bpy.types.Menu): - __space_type__ = 'TEXT_EDITOR' + __space_type__ = "TEXT_EDITOR" __label__ = "Select" def draw(self, context): @@ -160,7 +156,7 @@ class TEXT_MT_edit_select(bpy.types.Menu): layout.itemO("text.select_line") class TEXT_MT_edit_markers(bpy.types.Menu): - __space_type__ = 'TEXT_EDITOR' + __space_type__ = "TEXT_EDITOR" __label__ = "Markers" def draw(self, context): @@ -171,7 +167,7 @@ class TEXT_MT_edit_markers(bpy.types.Menu): layout.itemO("text.previous_marker") class TEXT_MT_format(bpy.types.Menu): - __space_type__ = 'TEXT_EDITOR' + __space_type__ = "TEXT_EDITOR" __label__ = "Format" def draw(self, context): @@ -190,7 +186,7 @@ class TEXT_MT_format(bpy.types.Menu): layout.item_menu_enumO("text.convert_whitespace", "type") class TEXT_MT_edit_to3d(bpy.types.Menu): - __space_type__ = 'TEXT_EDITOR' + __space_type__ = "TEXT_EDITOR" __label__ = "Text To 3D Object" def draw(self, context): @@ -200,11 +196,12 @@ class TEXT_MT_edit_to3d(bpy.types.Menu): layout.item_booleanO("text.to_3d_object", "split_lines", True, text="One Object Per Line"); class TEXT_MT_edit(bpy.types.Menu): - __space_type__ = 'TEXT_EDITOR' + __space_type__ = "TEXT_EDITOR" __label__ = "Edit" def poll(self, context): - return (context.space_data.text) + st = context.space_data + return st.text != None def draw(self, context): layout = self.layout @@ -243,3 +240,4 @@ bpy.types.register(TEXT_MT_edit_view) bpy.types.register(TEXT_MT_edit_select) bpy.types.register(TEXT_MT_edit_markers) bpy.types.register(TEXT_MT_edit_to3d) + diff --git a/release/ui/space_time.py b/release/ui/space_time.py index bb82eea3272..d1c9f9806f3 100644 --- a/release/ui/space_time.py +++ b/release/ui/space_time.py @@ -2,7 +2,7 @@ import bpy class TIME_HT_header(bpy.types.Header): - __space_type__ = 'TIMELINE' + __space_type__ = "TIMELINE" def draw(self, context): layout = self.layout @@ -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") + layout.itemR(scene, "use_preview_range", text="PR", toggle=True) row = layout.row(align=True) if not scene.use_preview_range: @@ -33,8 +33,6 @@ class TIME_HT_header(bpy.types.Header): row.itemR(scene, "preview_range_end_frame", text="End") layout.itemR(scene, "current_frame", text="") - - layout.itemS() row = layout.row(align=True) row.item_booleanO("screen.frame_jump", "end", False, text="", icon='ICON_REW') @@ -49,23 +47,28 @@ class TIME_HT_header(bpy.types.Header): row.item_booleanO("screen.keyframe_jump", "next", True, text="", icon='ICON_NEXT_KEYFRAME') row.item_booleanO("screen.frame_jump", "end", True, text="", icon='ICON_FF') + layout.itemR(rd, "sync_audio", text="", toggle=True, icon='ICON_SPEAKER') + + layout.itemS() + row = layout.row(align=True) row.itemR(tools, "enable_auto_key", text="", toggle=True, icon='ICON_REC') + sub = row.row() + sub.active = tools.enable_auto_key + sub.itemR(tools, "autokey_mode", text="") if screen.animation_playing and tools.enable_auto_key: subsub = row.row() subsub.itemR(tools, "record_with_nla", toggle=True) - - layout.itemR(rd, "sync_audio", text="", toggle=True, icon='ICON_SPEAKER') layout.itemS() row = layout.row(align=True) - row.item_pointerR(scene, "active_keying_set", scene, "keying_sets", text="") - row.itemO("anim.insert_keyframe", text="", icon='ICON_KEY_HLT') - row.itemO("anim.delete_keyframe", text="", icon='ICON_KEY_DEHLT') + row.itemR(scene, "active_keying_set", text="") + row.itemO("anim.insert_keyframe", text="", icon="ICON_KEY_HLT") + row.itemO("anim.delete_keyframe", text="", icon="ICON_KEY_DEHLT") class TIME_MT_view(bpy.types.Menu): - __space_type__ = 'TIMELINE' + __space_type__ = "TIMELINE" __label__ = "View" def draw(self, context): @@ -80,12 +83,11 @@ class TIME_MT_view(bpy.types.Menu): layout.itemR(st, "only_selected") class TIME_MT_frame(bpy.types.Menu): - __space_type__ = 'TIMELINE' + __space_type__ = "TIMELINE" __label__ = "Frame" def draw(self, context): layout = self.layout - tools = context.tool_settings layout.itemO("marker.add", text="Add Marker") layout.itemO("marker.duplicate", text="Duplicate Marker") @@ -97,22 +99,15 @@ class TIME_MT_frame(bpy.types.Menu): layout.itemO("time.start_frame_set") layout.itemO("time.end_frame_set") - - layout.itemS() - - sub = layout.row() - sub.active = tools.enable_auto_key - sub.itemM("TIME_MT_autokey") class TIME_MT_playback(bpy.types.Menu): - __space_type__ = 'TIMELINE' + __space_type__ = "TIMELINE" __label__ = "Playback" def draw(self, context): layout = self.layout st = context.space_data - rd = context.scene.render_data layout.itemR(st, "play_top_left") layout.itemR(st, "play_all_3d") @@ -120,32 +115,10 @@ class TIME_MT_playback(bpy.types.Menu): layout.itemR(st, "play_buttons") layout.itemR(st, "play_image") layout.itemR(st, "play_sequencer") - layout.itemS() - layout.itemR(st, "continue_physics") - - layout.itemS() - - layout.itemR(rd, "sync_audio", icon='ICON_SPEAKER') - - - -class TIME_MT_autokey(bpy.types.Menu): - __space_type__ = 'TIMELINE' - __label__ = "Auto-Keyframing Mode" - - def draw(self, context): - layout = self.layout - tools = context.tool_settings - - layout.active = tools.enable_auto_key - - layout.item_enumR(tools, "autokey_mode", 'ADD_REPLACE_KEYS') - layout.item_enumR(tools, "autokey_mode", 'REPLACE_KEYS') bpy.types.register(TIME_HT_header) bpy.types.register(TIME_MT_view) bpy.types.register(TIME_MT_frame) -bpy.types.register(TIME_MT_autokey) bpy.types.register(TIME_MT_playback) diff --git a/release/ui/space_userpref.py b/release/ui/space_userpref.py index 1e7a9b581d4..95054efcb25 100644 --- a/release/ui/space_userpref.py +++ b/release/ui/space_userpref.py @@ -2,26 +2,21 @@ import bpy class USERPREF_HT_header(bpy.types.Header): - __space_type__ = 'USER_PREFERENCES' + __space_type__ = "USER_PREFERENCES" def draw(self, context): layout = self.layout layout.template_header(menus=False) - - userpref = context.user_preferences - - layout.operator_context = "EXEC_AREA" - layout.itemO("wm.save_homefile", text="Save As Default") class USERPREF_MT_view(bpy.types.Menu): - __space_type__ = 'USER_PREFERENCES' + __space_type__ = "USER_PREFERENCES" __label__ = "View" def draw(self, context): layout = self.layout class USERPREF_PT_tabs(bpy.types.Panel): - __space_type__ = 'USER_PREFERENCES' + __space_type__ = "USER_PREFERENCES" __show_header__ = False def draw(self, context): @@ -32,7 +27,7 @@ class USERPREF_PT_tabs(bpy.types.Panel): layout.itemR(userpref, "active_section", expand=True) class USERPREF_PT_view(bpy.types.Panel): - __space_type__ = 'USER_PREFERENCES' + __space_type__ = "USER_PREFERENCES" __label__ = "View" __show_header__ = False @@ -64,11 +59,11 @@ class USERPREF_PT_view(bpy.types.Panel): sub1.itemS() sub1.itemS() sub1.itemS() - sub1.itemR(view, "show_mini_axis", text="Display Mini Axis") + sub1.itemR(view, "show_mini_axis") sub2 = sub1.column() sub2.enabled = view.show_mini_axis - sub2.itemR(view, "mini_axis_size", text="Size") - sub2.itemR(view, "mini_axis_brightness", text="Brightness") + sub2.itemR(view, "mini_axis_size") + sub2.itemR(view, "mini_axis_brightness") col = split.column() sub = col.split(percentage=0.85) @@ -135,7 +130,7 @@ class USERPREF_PT_view(bpy.types.Panel): sub1.itemR(view, "open_right_mouse_delay", text="Hold RMB") class USERPREF_PT_edit(bpy.types.Panel): - __space_type__ = 'USER_PREFERENCES' + __space_type__ = "USER_PREFERENCES" __label__ = "Edit" __show_header__ = False @@ -230,10 +225,9 @@ class USERPREF_PT_edit(bpy.types.Panel): sub1.itemR(edit, "duplicate_texture", text="Texture") sub1.itemR(edit, "duplicate_ipo", text="F-Curve") sub1.itemR(edit, "duplicate_action", text="Action") - sub1.itemR(edit, "duplicate_particle", text="Particle") class USERPREF_PT_system(bpy.types.Panel): - __space_type__ = 'USER_PREFERENCES' + __space_type__ = "USER_PREFERENCES" __label__ = "System" __show_header__ = False @@ -314,7 +308,7 @@ class USERPREF_PT_system(bpy.types.Panel): sub1.itemR(system, "texture_collection_rate", text="Collection Rate") class USERPREF_PT_filepaths(bpy.types.Panel): - __space_type__ = 'USER_PREFERENCES' + __space_type__ = "USER_PREFERENCES" __label__ = "File Paths" __show_header__ = False @@ -365,9 +359,6 @@ class USERPREF_PT_filepaths(bpy.types.Panel): sub2.itemL(text="Save & Load:") sub2.itemR(paths, "use_relative_paths") sub2.itemR(paths, "compress_file") - sub2.itemR(paths, "load_ui") - sub2.itemS() - sub2.itemS() sub2.itemL(text="Auto Save:") sub2.itemR(paths, "save_version") sub2.itemR(paths, "recent_files") @@ -375,10 +366,10 @@ class USERPREF_PT_filepaths(bpy.types.Panel): sub2.itemR(paths, "auto_save_temporary_files") sub3 = sub2.column() sub3.enabled = paths.auto_save_temporary_files - sub3.itemR(paths, "auto_save_time", text="Timer (mins)") + sub3.itemR(paths, "auto_save_time") class USERPREF_PT_language(bpy.types.Panel): - __space_type__ = 'USER_PREFERENCES' + __space_type__ = "USER_PREFERENCES" __label__ = "Language" __show_header__ = False @@ -396,16 +387,24 @@ class USERPREF_PT_language(bpy.types.Panel): col = split.column() col.itemR(lan, "language") - col.itemL(text="Translate:") - col.itemR(lan, "translate_tooltips", text="Tooltips") - col.itemR(lan, "translate_buttons", text="Labels") - col.itemR(lan, "translate_toolbox", text="Toolbox") - col.itemS() - col.itemS() + col.itemR(lan, "translate_tooltips") + col.itemR(lan, "translate_buttons") + col.itemR(lan, "translate_toolbox") col.itemR(lan, "use_textured_fonts") - col = split.column() - +class USERPREF_PT_bottombar(bpy.types.Panel): + __space_type__ = "USER_PREFERENCES" + __label__ = " " + __show_header__ = False + + def draw(self, context): + layout = self.layout + userpref = context.user_preferences + + split = layout.split(percentage=0.8) + split.itemL(text="") + layout.operator_context = "EXEC_AREA" + split.itemO("wm.save_homefile", text="Save As Default") bpy.types.register(USERPREF_HT_header) bpy.types.register(USERPREF_MT_view) @@ -415,4 +414,5 @@ bpy.types.register(USERPREF_PT_edit) bpy.types.register(USERPREF_PT_system) bpy.types.register(USERPREF_PT_filepaths) bpy.types.register(USERPREF_PT_language) +bpy.types.register(USERPREF_PT_bottombar) diff --git a/release/ui/space_view3d.py b/release/ui/space_view3d.py index bc133cbff48..44b1c82ff46 100644 --- a/release/ui/space_view3d.py +++ b/release/ui/space_view3d.py @@ -4,7 +4,7 @@ import bpy # ********** Header ********** class VIEW3D_HT_header(bpy.types.Header): - __space_type__ = 'VIEW_3D' + __space_type__ = "VIEW_3D" def draw(self, context): layout = self.layout @@ -12,7 +12,6 @@ class VIEW3D_HT_header(bpy.types.Header): view = context.space_data mode_string = context.mode edit_object = context.edit_object - object = context.active_object row = layout.row(align=True) row.template_header() @@ -24,63 +23,32 @@ 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'): + if mode_string not in ('EDIT_TEXT', 'SCULPT', 'PAINT_WEIGHT', 'PAINT_VERTEX', 'PAINT_TEXTURE', 'PARTICLE'): + # XXX: Particle Mode has Select Menu. sub.itemM("VIEW3D_MT_select_%s" % mode_string) - if edit_object: + if mode_string == 'OBJECT': + sub.itemM("VIEW3D_MT_object") + elif mode_string == 'SCULPT': + sub.itemM("VIEW3D_MT_sculpt") + elif edit_object: sub.itemM("VIEW3D_MT_edit_%s" % edit_object.type) - elif object: - ob_mode_string = object.mode - - 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): - __space_type__ = 'VIEW_3D' + __space_type__ = "VIEW_3D" __label__ = "View" def draw(self, context): layout = self.layout - layout.itemO("view3d.properties", icon='ICON_MENU_PANEL') - layout.itemO("view3d.toolbar", icon='ICON_MENU_PANEL') + layout.itemO("view3d.properties", icon="ICON_MENU_PANEL") + layout.itemO("view3d.toolbar", icon="ICON_MENU_PANEL") layout.itemS() @@ -89,23 +57,32 @@ 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() - + layout.itemO("view3d.view_persportho") 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") + # layout.itemM("VIEW3D_MT_view_align", text="Align View") layout.itemS() layout.operator_context = "INVOKE_REGION_WIN" - - layout.itemO("view3d.clip_border", text="Clipping Border...") - layout.itemO("view3d.zoom_border", text="Zoom Border...") + + layout.itemO("view3d.clip_border") + layout.itemO("view3d.zoom_border") layout.itemS() @@ -116,14 +93,17 @@ class VIEW3D_MT_view(bpy.types.Menu): layout.itemO("screen.region_foursplit", text="Toggle Quad View") layout.itemO("screen.screen_full_area", text="Toggle Full Screen") - + class VIEW3D_MT_view_navigation(bpy.types.Menu): - __space_type__ = 'VIEW_3D' + __space_type__ = "VIEW_3D" __label__ = "Navigation" def draw(self, context): layout = self.layout + # layout.itemO("view3d.view_fly_mode") + # layout.itemS() + layout.items_enumO("view3d.view_orbit", "type") layout.itemS() @@ -135,26 +115,10 @@ 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): - __space_type__ = 'VIEW_3D' + __space_type__ = "VIEW_3D" __label__ = "Select" def draw(self, context): @@ -167,26 +131,24 @@ class VIEW3D_MT_select_OBJECT(bpy.types.Menu): layout.itemO("object.select_all_toggle", text="Select/Deselect All") layout.itemO("object.select_inverse", text="Inverse") layout.itemO("object.select_random", text="Random") - layout.itemO("object.select_mirror", text="Mirror") 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' + __space_type__ = "VIEW_3D" __label__ = "Select" def draw(self, context): layout = self.layout - layout.itemO("view3d.select_border", text="Border Select...") + layout.itemO("view3d.select_border") layout.itemS() layout.itemO("pose.select_all_toggle", text="Select/Deselect All") layout.itemO("pose.select_inverse", text="Inverse") layout.itemO("pose.select_constraint_target", text="Constraint Target") - layout.itemO("pose.select_linked", text="Linked") layout.itemS() @@ -195,16 +157,10 @@ class VIEW3D_MT_select_POSE(bpy.types.Menu): layout.itemS() - props = layout.itemO("pose.select_hierarchy", properties=True, text="Extend Parent") - props.extend = True - props.direction = 'PARENT' - - props = layout.itemO("pose.select_hierarchy", properties=True, text="Extend Child") - props.extend = True - props.direction = 'CHILD' + layout.view3d_select_posemenu() class VIEW3D_MT_select_PARTICLE(bpy.types.Menu): - __space_type__ = 'VIEW_3D' + __space_type__ = "VIEW_3D" __label__ = "Select" def draw(self, context): @@ -219,17 +175,20 @@ 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") class VIEW3D_MT_select_EDIT_MESH(bpy.types.Menu): - __space_type__ = 'VIEW_3D' + __space_type__ = "VIEW_3D" __label__ = "Select" def draw(self, context): layout = self.layout - layout.itemO("view3d.select_border", text="Border Select...") + layout.itemO("view3d.select_border") layout.itemS() @@ -267,14 +226,14 @@ class VIEW3D_MT_select_EDIT_MESH(bpy.types.Menu): layout.itemO("mesh.region_to_loop") class VIEW3D_MT_select_EDIT_CURVE(bpy.types.Menu): - __space_type__ = 'VIEW_3D' + __space_type__ = "VIEW_3D" __label__ = "Select" def draw(self, context): layout = self.layout - layout.itemO("view3d.select_border", text="Border Select...") - layout.itemO("view3d.select_circle", text="Circle Select...") + layout.itemO("view3d.select_border") + layout.itemO("view3d.select_circle") layout.itemS() @@ -296,14 +255,14 @@ class VIEW3D_MT_select_EDIT_CURVE(bpy.types.Menu): layout.itemO("curve.select_less") class VIEW3D_MT_select_EDIT_SURFACE(bpy.types.Menu): - __space_type__ = 'VIEW_3D' + __space_type__ = "VIEW_3D" __label__ = "Select" def draw(self, context): layout = self.layout - layout.itemO("view3d.select_border", text="Border Select...") - layout.itemO("view3d.select_circle", text="Circle Select...") + layout.itemO("view3d.select_border") + layout.itemO("view3d.select_circle") layout.itemS() @@ -322,7 +281,7 @@ class VIEW3D_MT_select_EDIT_SURFACE(bpy.types.Menu): layout.itemO("curve.select_less") class VIEW3D_MT_select_EDIT_METABALL(bpy.types.Menu): - __space_type__ = 'VIEW_3D' + __space_type__ = "VIEW_3D" __label__ = "Select" def draw(self, context): @@ -332,15 +291,15 @@ class VIEW3D_MT_select_EDIT_METABALL(bpy.types.Menu): layout.itemS() - layout.itemO("mball.select_deselect_all_metaelems") - layout.itemO("mball.select_inverse_metaelems") + layout.itemL(text="Select/Deselect All") + layout.itemL(text="Inverse") layout.itemS() - layout.itemO("mball.select_random_metaelems") + layout.itemL(text="Random") class VIEW3D_MT_select_EDIT_LATTICE(bpy.types.Menu): - __space_type__ = 'VIEW_3D' + __space_type__ = "VIEW_3D" __label__ = "Select" def draw(self, context): @@ -353,13 +312,13 @@ class VIEW3D_MT_select_EDIT_LATTICE(bpy.types.Menu): layout.itemO("lattice.select_all_toggle", text="Select/Deselect All") class VIEW3D_MT_select_EDIT_ARMATURE(bpy.types.Menu): - __space_type__ = 'VIEW_3D' + __space_type__ = "VIEW_3D" __label__ = "Select" def draw(self, context): layout = self.layout - layout.itemO("view3d.select_border", text="Border Select...") + layout.itemO("view3d.select_border") layout.itemS() @@ -368,21 +327,15 @@ class VIEW3D_MT_select_EDIT_ARMATURE(bpy.types.Menu): layout.itemS() - layout.item_enumO("armature.select_hierarchy", "direction", 'PARENT', text="Parent") - layout.item_enumO("armature.select_hierarchy", "direction", 'CHILD', text="Child") + layout.item_enumO("armature.select_hierarchy", "direction", 'PARENT') + layout.item_enumO("armature.select_hierarchy", "direction", 'CHILD') layout.itemS() - props = layout.itemO("armature.select_hierarchy", properties=True, text="Extend Parent") - props.extend = True - props.direction = 'PARENT' - - props = layout.itemO("armature.select_hierarchy", properties=True, text="Extend Child") - props.extend = True - props.direction = 'CHILD' + layout.view3d_select_armaturemenu() class VIEW3D_MT_select_FACE(bpy.types.Menu):# XXX no matching enum - __space_type__ = 'VIEW_3D' + __space_type__ = "VIEW_3D" __label__ = "Select" def draw(self, context): @@ -392,35 +345,35 @@ class VIEW3D_MT_select_FACE(bpy.types.Menu):# XXX no matching enum # ********** Object menu ********** -class VIEW3D_MT_OBJECT(bpy.types.Menu): - __space_type__ = 'VIEW_3D' +class VIEW3D_MT_object(bpy.types.Menu): + __space_type__ = "VIEW_3D" __context__ = "objectmode" __label__ = "Object" def draw(self, context): layout = self.layout - layout.itemM("VIEW3D_MT_OBJECT_clear") - layout.itemM("VIEW3D_MT_snap") + layout.itemM("VIEW3D_MT_object_clear") + layout.itemM("VIEW3D_MT_object_snap") layout.itemS() - layout.itemO("anim.insert_keyframe_menu", text="Insert Keyframe...") - layout.itemO("anim.delete_keyframe_v3d", text="Delete Keyframe...") + layout.itemO("anim.insert_keyframe_menu") + layout.itemO("anim.delete_keyframe_v3d") layout.itemS() layout.itemO("object.duplicate") layout.item_booleanO("object.duplicate", "linked", True, text="Duplicate Linked") - layout.itemO("object.delete", text="Delete...") - layout.itemO("object.proxy_make", text="Make Proxy...") + layout.itemO("object.delete") + layout.itemO("object.proxy_make") 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() @@ -428,42 +381,59 @@ class VIEW3D_MT_OBJECT(bpy.types.Menu): layout.itemS() - layout.itemM("VIEW3D_MT_OBJECT_showhide") + layout.itemM("VIEW3D_MT_object_show") -class VIEW3D_MT_OBJECT_clear(bpy.types.Menu): - __space_type__ = 'VIEW_3D' +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", text="Location") - layout.itemO("object.rotation_clear", text="Rotation") - layout.itemO("object.scale_clear", text="Scale") - layout.itemO("object.origin_clear", text="Origin") + layout.itemO("object.location_clear") + layout.itemO("object.rotation_clear") + layout.itemO("object.scale_clear") + layout.itemO("object.origin_clear") + +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): - __space_type__ = 'VIEW_3D' +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", text="Set") - layout.itemO("object.parent_clear", text="Clear") + layout.itemO("object.parent_set") + layout.itemO("object.parent_clear") -class VIEW3D_MT_OBJECT_track(bpy.types.Menu): - __space_type__ = 'VIEW_3D' +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", text="Set") - layout.itemO("object.track_clear", text="Clear") + layout.itemO("object.track_set") + layout.itemO("object.track_clear") -class VIEW3D_MT_OBJECT_group(bpy.types.Menu): - __space_type__ = 'VIEW_3D' +class VIEW3D_MT_object_group(bpy.types.Menu): + __space_type__ = "VIEW_3D" __label__ = "Group" def draw(self, context): @@ -477,8 +447,8 @@ 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): - __space_type__ = 'VIEW_3D' +class VIEW3D_MT_object_constraints(bpy.types.Menu): + __space_type__ = "VIEW_3D" __label__ = "Constraints" def draw(self, context): @@ -487,36 +457,21 @@ class VIEW3D_MT_OBJECT_constraints(bpy.types.Menu): layout.itemO("object.constraint_add_with_targets") layout.itemO("object.constraints_clear") -class VIEW3D_MT_OBJECT_showhide(bpy.types.Menu): - __space_type__ = 'VIEW_3D' +class VIEW3D_MT_object_show(bpy.types.Menu): + __space_type__ = "VIEW_3D" __label__ = "Show/Hide" def draw(self, context): layout = self.layout - layout.itemO("object.restrictview_clear", text="Show Hidden") - layout.itemO("object.restrictview_set", text="Hide Selected") + layout.itemO("object.restrictview_clear") + layout.itemO("object.restrictview_set") layout.item_booleanO("object.restrictview_set", "unselected", True, text="Hide Unselected") -# ********** Vertex paint menu ********** - -class VIEW3D_MT_PAINT_VERTEX(bpy.types.Menu): - __space_type__ = 'VIEW_3D' - __label__ = "Paint" - - def draw(self, context): - layout = self.layout - - sculpt = context.tool_settings.sculpt - - layout.itemO("paint.vertex_color_set") - props = layout.itemO("paint.vertex_color_set", text="Set Selected Vertex Colors", properties=True) - props.selected = True - # ********** Sculpt menu ********** -class VIEW3D_MT_SCULPT(bpy.types.Menu): - __space_type__ = 'VIEW_3D' +class VIEW3D_MT_sculpt(bpy.types.Menu): + __space_type__ = "VIEW_3D" __label__ = "Sculpt" def draw(self, context): @@ -549,181 +504,28 @@ class VIEW3D_MT_SCULPT(bpy.types.Menu): layout.itemR(brush, "persistent") layout.itemO("sculpt.set_persistent_base") -# ********** Particle menu ********** - -class VIEW3D_MT_PARTICLE(bpy.types.Menu): - __space_type__ = 'VIEW_3D' - __label__ = "Particle" - - def draw(self, context): - layout = self.layout - - particle_edit = context.tool_settings.particle_edit - - layout.itemO("particle.mirror") - - layout.itemS() - - 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.operator_context = "EXEC_AREA" - 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.operator_context = "INVOKE_AREA" - 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...") +# ********** Edit Menus, suffix from ob.type ********** -class VIEW3D_MT_POSE_motion(bpy.types.Menu): - __space_type__ = 'VIEW_3D' - __label__ = "Motion Paths" +class VIEW3D_MT_edit_snap(bpy.types.Menu): + __space_type__ = "VIEW_3D" + __label__ = "Snap" 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.itemO("view3d.snap_selected_to_grid") + layout.itemO("view3d.snap_selected_to_cursor") + layout.itemO("view3d.snap_selected_to_center") 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 ********** + layout.itemO("view3d.snap_cursor_to_selected") + layout.itemO("view3d.snap_cursor_to_grid") + layout.itemO("view3d.snap_cursor_to_active") # Edit MESH class VIEW3D_MT_edit_MESH(bpy.types.Menu): - __space_type__ = 'VIEW_3D' + __space_type__ = "VIEW_3D" __label__ = "Mesh" def draw(self, context): @@ -736,17 +538,17 @@ class VIEW3D_MT_edit_MESH(bpy.types.Menu): layout.itemS() - layout.itemM("VIEW3D_MT_snap") + layout.itemM("VIEW3D_MT_edit_snap") layout.itemS() - layout.itemO("uv.mapping_menu", text="UV Unwrap...") + layout.itemO("uv.mapping_menu") layout.itemS() layout.itemO("mesh.extrude") layout.itemO("mesh.duplicate") - layout.itemO("mesh.delete", text="Delete...") + layout.itemO("mesh.delete") layout.itemS() @@ -766,7 +568,7 @@ class VIEW3D_MT_edit_MESH(bpy.types.Menu): layout.itemM("VIEW3D_MT_edit_MESH_showhide") class VIEW3D_MT_edit_MESH_vertices(bpy.types.Menu): - __space_type__ = 'VIEW_3D' + __space_type__ = "VIEW_3D" __label__ = "Vertices" def draw(self, context): @@ -781,9 +583,9 @@ class VIEW3D_MT_edit_MESH_vertices(bpy.types.Menu): layout.itemO("mesh.vertices_smooth") layout.itemO("mesh.remove_doubles") - + class VIEW3D_MT_edit_MESH_edges(bpy.types.Menu): - __space_type__ = 'VIEW_3D' + __space_type__ = "VIEW_3D" __label__ = "Edges" def draw(self, context): @@ -791,6 +593,7 @@ 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() @@ -806,9 +609,9 @@ class VIEW3D_MT_edit_MESH_edges(bpy.types.Menu): layout.item_enumO("mesh.edge_rotate", "direction", 'CW', text="Rotate Edge CW") layout.item_enumO("mesh.edge_rotate", "direction", 'CCW', text="Rotate Edge CCW") - + class VIEW3D_MT_edit_MESH_faces(bpy.types.Menu): - __space_type__ = 'VIEW_3D' + __space_type__ = "VIEW_3D" __label__ = "Faces" def draw(self, context): @@ -830,7 +633,7 @@ class VIEW3D_MT_edit_MESH_faces(bpy.types.Menu): layout.itemO("mesh.faces_shade_flat") class VIEW3D_MT_edit_MESH_normals(bpy.types.Menu): - __space_type__ = 'VIEW_3D' + __space_type__ = "VIEW_3D" __label__ = "Normals" def draw(self, context): @@ -843,8 +646,16 @@ class VIEW3D_MT_edit_MESH_normals(bpy.types.Menu): layout.itemO("mesh.flip_normals") -class VIEW3D_MT_edit_MESH_showhide(VIEW3D_MT_showhide): - _operator_name = "mesh" +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") # Edit CURVE @@ -853,8 +664,8 @@ def draw_CURVE(self, context): layout = self.layout settings = context.tool_settings - - layout.itemM("VIEW3D_MT_snap") + + layout.itemM("VIEW3D_MT_edit_snap") layout.itemS() @@ -863,7 +674,7 @@ def draw_CURVE(self, context): layout.itemO("curve.separate") layout.itemO("curve.make_segment") layout.itemO("curve.cyclic_toggle") - layout.itemO("curve.delete", text="Delete...") + layout.itemO("curve.delete") layout.itemS() @@ -880,13 +691,13 @@ def draw_CURVE(self, context): layout.itemM("VIEW3D_MT_edit_CURVE_showhide") class VIEW3D_MT_edit_CURVE(bpy.types.Menu): - __space_type__ = 'VIEW_3D' + __space_type__ = "VIEW_3D" __label__ = "Curve" draw = draw_CURVE class VIEW3D_MT_edit_CURVE_ctrlpoints(bpy.types.Menu): - __space_type__ = 'VIEW_3D' + __space_type__ = "VIEW_3D" __label__ = "Control Points" def draw(self, context): @@ -904,7 +715,7 @@ class VIEW3D_MT_edit_CURVE_ctrlpoints(bpy.types.Menu): layout.item_menu_enumO("curve.handle_type_set", "type") class VIEW3D_MT_edit_CURVE_segments(bpy.types.Menu): - __space_type__ = 'VIEW_3D' + __space_type__ = "VIEW_3D" __label__ = "Segments" def draw(self, context): @@ -913,19 +724,27 @@ class VIEW3D_MT_edit_CURVE_segments(bpy.types.Menu): layout.itemO("curve.subdivide") layout.itemO("curve.switch_direction") -class VIEW3D_MT_edit_CURVE_showhide(VIEW3D_MT_showhide): - _operator_name = "curve" +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") # Edit SURFACE class VIEW3D_MT_edit_SURFACE(bpy.types.Menu): - __space_type__ = 'VIEW_3D' + __space_type__ = "VIEW_3D" __label__ = "Surface" draw = draw_CURVE # Edit TEXT class VIEW3D_MT_edit_TEXT(bpy.types.Menu): - __space_type__ = 'VIEW_3D' + __space_type__ = "VIEW_3D" __label__ = "Text" def draw(self, context): @@ -938,7 +757,7 @@ class VIEW3D_MT_edit_TEXT(bpy.types.Menu): layout.itemM("VIEW3D_MT_edit_TEXT_chars") class VIEW3D_MT_edit_TEXT_chars(bpy.types.Menu): - __space_type__ = 'VIEW_3D' + __space_type__ = "VIEW_3D" __label__ = "Special Characters" def draw(self, context): @@ -973,7 +792,7 @@ class VIEW3D_MT_edit_TEXT_chars(bpy.types.Menu): # Edit META class VIEW3D_MT_edit_META(bpy.types.Menu): - __space_type__ = 'VIEW_3D' + __space_type__ = "VIEW_3D" __label__ = "Metaball" def draw(self, context): @@ -986,11 +805,11 @@ class VIEW3D_MT_edit_META(bpy.types.Menu): layout.itemS() - layout.itemM("VIEW3D_MT_snap") + layout.itemM("VIEW3D_MT_edit_snap") layout.itemS() - layout.itemO("mball.delete_metaelems", text="Delete...") + layout.itemO("mball.delete_metaelems") layout.itemO("mball.duplicate_metaelems") layout.itemS() @@ -1003,19 +822,19 @@ class VIEW3D_MT_edit_META(bpy.types.Menu): layout.itemM("VIEW3D_MT_edit_META_showhide") class VIEW3D_MT_edit_META_showhide(bpy.types.Menu): - __space_type__ = 'VIEW_3D' + __space_type__ = "VIEW_3D" __label__ = "Show/Hide" def draw(self, context): layout = self.layout - layout.itemO("mball.reveal_metaelems", text="Show Hidden") - layout.itemO("mball.hide_metaelems", text="Hide Selected") + layout.itemO("mball.reveal_metaelems") + layout.itemO("mball.hide_metaelems") layout.item_booleanO("mball.hide_metaelems", "unselected", True, text="Hide Unselected") # Edit LATTICE class VIEW3D_MT_edit_LATTICE(bpy.types.Menu): - __space_type__ = 'VIEW_3D' + __space_type__ = "VIEW_3D" __label__ = "Lattice" def draw(self, context): @@ -1023,7 +842,7 @@ class VIEW3D_MT_edit_LATTICE(bpy.types.Menu): settings = context.tool_settings - layout.itemM("VIEW3D_MT_snap") + layout.itemM("VIEW3D_MT_edit_snap") layout.itemS() @@ -1036,7 +855,7 @@ class VIEW3D_MT_edit_LATTICE(bpy.types.Menu): # Edit ARMATURE class VIEW3D_MT_edit_ARMATURE(bpy.types.Menu): - __space_type__ = 'VIEW_3D' + __space_type__ = "VIEW_3D" __label__ = "Armature" def draw(self, context): @@ -1045,7 +864,7 @@ class VIEW3D_MT_edit_ARMATURE(bpy.types.Menu): edit_object = context.edit_object arm = edit_object.data - layout.itemM("VIEW3D_MT_snap") + layout.itemM("VIEW3D_MT_edit_snap") layout.itemM("VIEW3D_MT_edit_ARMATURE_roll") if arm.drawtype == 'ENVELOPE': @@ -1068,19 +887,18 @@ class VIEW3D_MT_edit_ARMATURE(bpy.types.Menu): layout.itemS() - layout.itemO("armature.subdivide_multi", text="Subdivide") + layout.itemO("armature.subdivide_simple") + layout.itemO("armature.subdivide_multi") layout.itemS() - - layout.operator_context = "EXEC_AREA" - layout.item_enumO("armature.autoside_names", "type", 'XAXIS', text="AutoName Left/Right") - layout.item_enumO("armature.autoside_names", "type", 'YAXIS', text="AutoName Front/Back") - layout.item_enumO("armature.autoside_names", "type", 'ZAXIS', text="AutoName Top/Bottom") + + layout.item_enumO("armature.autoside_names", "axis", 'XAXIS', text="AutoName Left/Right") + layout.item_enumO("armature.autoside_names", "axis", 'YAXIS', text="AutoName Front/Back") + layout.item_enumO("armature.autoside_names", "axis", 'ZAXIS', text="AutoName Top/Bottom") layout.itemO("armature.flip_names") layout.itemS() - - layout.operator_context = "INVOKE_DEFAULT" + layout.itemO("armature.armature_layers") layout.itemO("armature.bone_layers") @@ -1089,21 +907,21 @@ class VIEW3D_MT_edit_ARMATURE(bpy.types.Menu): layout.itemM("VIEW3D_MT_edit_ARMATURE_parent") layout.itemS() - + layout.item_menu_enumO("armature.flags_set", "mode", text="Bone Settings") class VIEW3D_MT_edit_ARMATURE_parent(bpy.types.Menu): - __space_type__ = 'VIEW_3D' + __space_type__ = "VIEW_3D" __label__ = "Parent" def draw(self, context): layout = self.layout - layout.itemO("armature.parent_set", text="Make") - layout.itemO("armature.parent_clear", text="Clear") + layout.itemO("armature.parent_set") + layout.itemO("armature.parent_clear") class VIEW3D_MT_edit_ARMATURE_roll(bpy.types.Menu): - __space_type__ = 'VIEW_3D' + __space_type__ = "VIEW_3D" __label__ = "Bone Roll" def draw(self, context): @@ -1119,8 +937,8 @@ class VIEW3D_MT_edit_ARMATURE_roll(bpy.types.Menu): # ********** Panel ********** class VIEW3D_PT_3dview_properties(bpy.types.Panel): - __space_type__ = 'VIEW_3D' - __region_type__ = 'UI' + __space_type__ = "VIEW_3D" + __region_type__ = "UI" __label__ = "View" def poll(self, context): @@ -1151,8 +969,8 @@ class VIEW3D_PT_3dview_properties(bpy.types.Panel): layout.column().itemR(scene, "cursor_location", text="3D Cursor:") class VIEW3D_PT_3dview_display(bpy.types.Panel): - __space_type__ = 'VIEW_3D' - __region_type__ = 'UI' + __space_type__ = "VIEW_3D" + __region_type__ = "UI" __label__ = "Display" def poll(self, context): @@ -1181,67 +999,10 @@ class VIEW3D_PT_3dview_display(bpy.types.Panel): col.itemR(view, "lock_rotation") col.itemR(view, "box_preview") col.itemR(view, "box_clip") - -class VIEW3D_PT_3dview_meshdisplay(bpy.types.Panel): - __space_type__ = 'VIEW_3D' - __region_type__ = 'UI' - __label__ = "Mesh Display" - - def poll(self, context): - editmesh = context.mode == 'EDIT_MESH' - return (editmesh) - - def draw(self, context): - layout = self.layout - - mesh = context.active_object.data - - col = layout.column() - col.itemL(text="Overlays:") - col.itemR(mesh, "draw_edges", text="Edges") - col.itemR(mesh, "draw_faces", text="Faces") - col.itemR(mesh, "draw_creases", text="Creases") - col.itemR(mesh, "draw_bevel_weights", text="Bevel Weights") - col.itemR(mesh, "draw_seams", text="Seams") - col.itemR(mesh, "draw_sharp", text="Sharp") - - col.itemS() - col.itemL(text="Normals:") - col.itemR(mesh, "draw_normals", text="Face") - col.itemR(mesh, "draw_vertex_normals", text="Vertex") - col.itemR(context.scene.tool_settings, "normal_size", text="Normal Size") - - col.itemS() - col.itemL(text="Numerics:") - col.itemR(mesh, "draw_edge_lenght") - col.itemR(mesh, "draw_edge_angle") - col.itemR(mesh, "draw_face_area") - - -class VIEW3D_PT_3dview_curvedisplay(bpy.types.Panel): - __space_type__ = 'VIEW_3D' - __region_type__ = 'UI' - __label__ = "Curve Display" - - def poll(self, context): - editmesh = context.mode == 'EDIT_CURVE' - return (editmesh) - - def draw(self, context): - layout = self.layout - - curve = context.active_object.data - - col = layout.column() - col.itemL(text="Overlays:") - col.itemR(curve, "draw_handles", text="Handles") - col.itemR(curve, "draw_normals", text="Normals") - col.itemR(context.scene.tool_settings, "normal_size", text="Normal Size") - class VIEW3D_PT_background_image(bpy.types.Panel): - __space_type__ = 'VIEW_3D' - __region_type__ = 'UI' + __space_type__ = "VIEW_3D" + __region_type__ = "UI" __label__ = "Background Image" __default_closed__ = True @@ -1273,15 +1034,13 @@ class VIEW3D_PT_background_image(bpy.types.Panel): col.itemL(text="Offset:") col = layout.column(align=True) - col.itemR(bg, "offset_x", text="X") - col.itemR(bg, "offset_y", text="Y") + col.itemR(bg, "x_offset", text="X") + col.itemR(bg, "y_offset", text="Y") 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) @@ -1294,31 +1053,18 @@ 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_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_PAINT_VERTEX) - -bpy.types.register(VIEW3D_MT_PARTICLE) # Particle Menu -bpy.types.register(VIEW3D_MT_PARTICLE_showhide) +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_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_sculpt) # Sculpt Menu -bpy.types.register(VIEW3D_MT_snap) # Edit Menus +bpy.types.register(VIEW3D_MT_edit_snap) # Edit Menus bpy.types.register(VIEW3D_MT_edit_MESH) bpy.types.register(VIEW3D_MT_edit_MESH_vertices) @@ -1348,6 +1094,4 @@ bpy.types.register(VIEW3D_MT_edit_ARMATURE_roll) bpy.types.register(VIEW3D_PT_3dview_properties) # Panels bpy.types.register(VIEW3D_PT_3dview_display) -bpy.types.register(VIEW3D_PT_3dview_meshdisplay) -bpy.types.register(VIEW3D_PT_3dview_curvedisplay) bpy.types.register(VIEW3D_PT_background_image) diff --git a/release/ui/space_view3d_toolbar.py b/release/ui/space_view3d_toolbar.py index 73f97dec750..1b4c1e25c34 100644 --- a/release/ui/space_view3d_toolbar.py +++ b/release/ui/space_view3d_toolbar.py @@ -2,8 +2,8 @@ import bpy class View3DPanel(bpy.types.Panel): - __space_type__ = 'VIEW_3D' - __region_type__ = 'TOOLS' + __space_type__ = "VIEW_3D" + __region_type__ = "TOOLS" # ********** default tools for objectmode **************** @@ -107,7 +107,6 @@ class VIEW3D_PT_tools_curveedit(View3DPanel): col.itemO("curve.delete") col.itemO("curve.cyclic_toggle") col.itemO("curve.switch_direction") - col.itemO("curve.spline_type_set") layout.itemL(text="Modeling:") @@ -263,8 +262,8 @@ class VIEW3D_PT_tools_posemode(View3DPanel): # ********** default tools for paint modes **************** class PaintPanel(bpy.types.Panel): - __space_type__ = 'VIEW_3D' - __region_type__ = 'TOOLS' + __space_type__ = "VIEW_3D" + __region_type__ = "TOOLS" def paint_settings(self, context): ts = context.tool_settings @@ -334,15 +333,18 @@ class VIEW3D_PT_tools_brush(PaintPanel): row = col.row(align=True) row.itemR(brush, "size", slider=True) - row.itemR(brush, "size_pressure", toggle=True, text="") + row.itemR(brush, "size_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="") if brush.sculpt_tool != 'GRAB': row = col.row(align=True) row.itemR(brush, "strength", slider=True) - row.itemR(brush, "strength_pressure", text="") + row.itemR(brush, "strength_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="") col = layout.column() + if brush.sculpt_tool != 'LAYER': + col.itemR(brush, "anchored") + if brush.sculpt_tool in ('DRAW', 'PINCH', 'INFLATE', 'LAYER', 'CLAY'): col.itemR(brush, "flip_direction") @@ -350,6 +352,8 @@ class VIEW3D_PT_tools_brush(PaintPanel): col.itemR(brush, "persistent") col.itemO("sculpt.set_persistent_base") + col.itemR(brush, "rake") + col.itemR(brush, "sculpt_tool") # Texture Paint Mode # @@ -358,21 +362,38 @@ class VIEW3D_PT_tools_brush(PaintPanel): col = layout.column(align=True) col.item_enumR(settings, "tool", 'DRAW') col.item_enumR(settings, "tool", 'SOFTEN') - col.item_enumR(settings, "tool", 'CLONE') - col.item_enumR(settings, "tool", 'SMEAR') + if settings.use_projection: + col.item_enumR(settings, "tool", 'CLONE') + else: + col.item_enumR(settings, "tool", 'SMEAR') col = layout.column() col.itemR(brush, "color", text="") - + row = col.row(align=True) row.itemR(brush, "size", slider=True) - row.itemR(brush, "size_pressure", toggle=True, text="") + row.itemR(brush, "size_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="") row = col.row(align=True) row.itemR(brush, "strength", slider=True) - row.itemR(brush, "strength_pressure", toggle=True, text="") + row.itemR(brush, "strength_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="") + + row = col.row(align=True) + row.itemR(brush, "falloff", slider=True) + row.itemR(brush, "falloff_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="") - col.itemR(brush, "blend") + row = col.row(align=True) + row.itemR(brush, "space", text="") + rowsub = row.row(align=True) + rowsub.active = brush.space + rowsub.itemR(brush, "spacing", text="Spacing", slider=True) + rowsub.itemR(brush, "spacing_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="") + + col = layout.column() + col.itemR(brush, "airbrush") + sub = col.column() + sub.active = brush.airbrush + sub.itemR(brush, "rate") # Weight Paint Mode # @@ -382,11 +403,11 @@ class VIEW3D_PT_tools_brush(PaintPanel): col = layout.column() row = col.row(align=True) row.itemR(brush, "size", slider=True) - row.itemR(brush, "size_pressure", toggle=True, text="") + row.itemR(brush, "size_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="") row = col.row(align=True) row.itemR(brush, "strength", slider=True) - row.itemR(brush, "strength_pressure", toggle=True, text="") + row.itemR(brush, "strength_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="") # Vertex Paint Mode # @@ -396,11 +417,11 @@ class VIEW3D_PT_tools_brush(PaintPanel): row = col.row(align=True) row.itemR(brush, "size", slider=True) - row.itemR(brush, "size_pressure", toggle=True, text="") + row.itemR(brush, "size_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="") row = col.row(align=True) row.itemR(brush, "strength", slider=True) - row.itemR(brush, "strength_pressure", toggle=True, text="") + row.itemR(brush, "strength_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="") class VIEW3D_PT_tools_brush_stroke(PaintPanel): __label__ = "Stroke" @@ -408,41 +429,24 @@ class VIEW3D_PT_tools_brush_stroke(PaintPanel): def poll(self, context): settings = self.paint_settings(context) - return (settings and settings.brush and (context.sculpt_object or - context.vertex_paint_object or - context.weight_paint_object or - context.texture_paint_object)) + return (settings and settings.brush and context.sculpt_object) def draw(self, context): - layout = self.layout - settings = self.paint_settings(context) brush = settings.brush - texture_paint = context.texture_paint_object - - if context.sculpt_object: - if brush.sculpt_tool != 'LAYER': - layout.itemR(brush, "anchored") - layout.itemR(brush, "rake") + layout = self.layout - layout.itemR(brush, "airbrush") + layout.itemR(brush, "smooth_stroke") col = layout.column() - col.active = brush.airbrush - col.itemR(brush, "rate", slider=True) - - if not texture_paint: - layout.itemR(brush, "smooth_stroke") - col = layout.column() - col.active = brush.smooth_stroke - col.itemR(brush, "smooth_stroke_radius", text="Radius", slider=True) - col.itemR(brush, "smooth_stroke_factor", text="Factor", slider=True) + col.active = brush.smooth_stroke + col.itemR(brush, "smooth_stroke_radius", text="Radius", slider=True) + col.itemR(brush, "smooth_stroke_factor", text="Factor", slider=True) layout.itemR(brush, "space") - row = layout.row(align=True) - row.active = brush.space - row.itemR(brush, "spacing", text="Distance", slider=True) - if texture_paint: - row.itemR(brush, "spacing_pressure", toggle=True, text="") + col = layout.column() + col.active = brush.space + col.itemR(brush, "spacing", text="Distance", slider=True) + class VIEW3D_PT_tools_brush_curve(PaintPanel): __label__ = "Curve" @@ -453,10 +457,9 @@ class VIEW3D_PT_tools_brush_curve(PaintPanel): return (settings and settings.brush and settings.brush.curve) def draw(self, context): - layout = self.layout - settings = self.paint_settings(context) brush = settings.brush + layout = self.layout layout.template_curve_mapping(brush.curve) layout.item_menu_enumO("brush.curve_preset", property="shape") @@ -469,7 +472,6 @@ class VIEW3D_PT_sculpt_options(PaintPanel): def draw(self, context): layout = self.layout - sculpt = context.tool_settings.sculpt col = layout.column() @@ -498,7 +500,6 @@ class VIEW3D_PT_tools_weightpaint(View3DPanel): def draw(self, context): layout = self.layout - wpaint = context.tool_settings.weight_paint col = layout.column() @@ -526,7 +527,6 @@ class VIEW3D_PT_tools_vertexpaint(View3DPanel): def draw(self, context): layout = self.layout - vpaint = context.tool_settings.vertex_paint col = layout.column() @@ -545,17 +545,9 @@ class VIEW3D_PT_tools_vertexpaint(View3DPanel): # ********** default tools for texturepaint **************** -class VIEW3D_PT_tools_projectpaint(View3DPanel): - __context__ = "projectpaint" - __label__ = "Project Paint" - - def poll(self, context): - return context.tool_settings.image_paint.tool != 'SMEAR' - - def draw_header(self, context): - layout = self.layout - ipaint = context.tool_settings.image_paint - layout.itemR(ipaint, "use_projection", text="") +class VIEW3D_PT_tools_texturepaint(View3DPanel): + __context__ = "texturepaint" + __label__ = "Options" def draw(self, context): layout = self.layout @@ -565,6 +557,7 @@ class VIEW3D_PT_tools_projectpaint(View3DPanel): use_projection= ipaint.use_projection col = layout.column() + col.itemR(ipaint, "use_projection") sub = col.column() sub.active = use_projection sub.itemR(ipaint, "use_occlude") @@ -579,7 +572,8 @@ class VIEW3D_PT_tools_projectpaint(View3DPanel): col = split.column() col.active = (ipaint.use_normal_falloff and use_projection) col.itemR(ipaint, "normal_angle", text="") - + + split = layout.split(percentage=0.7) col = split.column(align=False) @@ -589,7 +583,8 @@ class VIEW3D_PT_tools_projectpaint(View3DPanel): col = split.column(align=False) col.active = (use_projection and ipaint.use_stencil_layer) col.itemR(ipaint, "invert_stencil", text="Inv") - + + col = layout.column() sub = col.column() sub.active = (settings.tool == 'CLONE') @@ -606,60 +601,23 @@ class VIEW3D_PT_tools_particlemode(View3DPanel): def draw(self, context): layout = self.layout - pe = context.tool_settings.particle_edit - ob = pe.object - row = layout.row() - row.itemL(text="Edit:") - row.itemR(pe, "type", text="") - - if pe.type == 'PARTICLES': - if ob.particle_systems: - if len(ob.particle_systems) > 1: - layout.template_list(ob, "particle_systems", ob, "active_particle_system_index", type='ICONS') - - ptcache = ob.particle_systems[ob.active_particle_system_index].point_cache - else: - for md in ob.modifiers: - if md.type==pe.type: - ptcache = md.point_cache - - if ptcache and len(ptcache.point_cache_list) > 1: - layout.template_list(ptcache, "point_cache_list", ptcache, "active_point_cache_index", type='ICONS') - - - if not pe.editable: - layout.itemL(text="Point cache must be baked") - layout.itemL(text="to enable editing!") - col = layout.column(align=True) - if pe.hair: - col.active = pe.editable - col.itemR(pe, "emitter_deflect", text="Deflect emitter") - sub = col.row() - sub.active = pe.emitter_deflect - sub.itemR(pe, "emitter_distance", text="Distance") + col.itemR(pe, "emitter_deflect", text="Deflect") + sub = col.row() + sub.active = pe.emitter_deflect + sub.itemR(pe, "emitter_distance", text="Distance") col = layout.column(align=True) - col.active = pe.editable col.itemL(text="Keep:") col.itemR(pe, "keep_lengths", text="Lenghts") col.itemR(pe, "keep_root", text="Root") - if not pe.hair: - col.itemL(text="Correct:") - col.itemR(pe, "auto_velocity", text="Velocity") col = layout.column(align=True) - col.active = pe.editable - col.itemL(text="Draw:") - col.itemR(pe, "draw_step", text="Path Steps") - if pe.type == 'PARTICLES': - col.itemR(pe, "draw_particles", text="Particles") - col.itemR(pe, "fade_time") - sub = col.row() - sub.active = pe.fade_time - sub.itemR(pe, "fade_frames", slider=True) + col.itemL(text="Display:") + col.itemR(pe, "show_time", text="Time") + col.itemR(pe, "show_children", text="Children") bpy.types.register(VIEW3D_PT_tools_objectmode) bpy.types.register(VIEW3D_PT_tools_meshedit) @@ -676,5 +634,5 @@ bpy.types.register(VIEW3D_PT_tools_brush_curve) bpy.types.register(VIEW3D_PT_sculpt_options) bpy.types.register(VIEW3D_PT_tools_vertexpaint) bpy.types.register(VIEW3D_PT_tools_weightpaint) -bpy.types.register(VIEW3D_PT_tools_projectpaint) +bpy.types.register(VIEW3D_PT_tools_texturepaint) bpy.types.register(VIEW3D_PT_tools_particlemode) |