forked from bartvdbraak/blender
*More single column stuff.
*Fixed and changed minor layout issues in curve and game properties *Merged Curve and Text properties py file as they share a lot of options.
This commit is contained in:
parent
d04f94d0c6
commit
888565e248
@ -45,7 +45,6 @@ class DATA_PT_context_camera(DataButtonsPanel):
|
||||
|
||||
if col2:
|
||||
split = layout.split(percentage=0.65)
|
||||
|
||||
if ob:
|
||||
split.template_ID(ob, "data")
|
||||
split.itemS()
|
||||
@ -53,7 +52,10 @@ class DATA_PT_context_camera(DataButtonsPanel):
|
||||
split.template_ID(space, "pin_id")
|
||||
split.itemS()
|
||||
else:
|
||||
layout.template_ID(ob, "data")
|
||||
if ob:
|
||||
layout.template_ID(ob, "data")
|
||||
elif cam:
|
||||
layout.template_ID(space, "pin_id")
|
||||
|
||||
|
||||
class DATA_PT_camera(DataButtonsPanel):
|
||||
|
@ -28,7 +28,7 @@ class DataButtonsPanel(bpy.types.Panel):
|
||||
bl_context = "data"
|
||||
|
||||
def poll(self, context):
|
||||
return (context.object and context.object.type in ('CURVE', 'SURFACE') and context.curve)
|
||||
return (context.object and context.object.type in ('CURVE', 'SURFACE', 'TEXT') and context.curve)
|
||||
|
||||
|
||||
class DataButtonsPanelCurve(DataButtonsPanel):
|
||||
@ -82,48 +82,47 @@ class DATA_PT_shape_curve(DataButtonsPanel):
|
||||
curve = context.curve
|
||||
col2 = context.region.width > narrowui
|
||||
is_surf = (ob.type == 'SURFACE')
|
||||
is_curve = (ob.type == 'CURVE')
|
||||
is_text = (ob.type == 'TEXT')
|
||||
|
||||
if not is_surf:
|
||||
if is_curve:
|
||||
row = layout.row()
|
||||
row.itemR(curve, "dimensions", expand=True)
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
|
||||
if not is_surf:
|
||||
sub = col.column()
|
||||
sub.active = (curve.dimensions == '2D')
|
||||
sub.itemL(text="Caps:")
|
||||
row = sub.row()
|
||||
row.itemR(curve, "front")
|
||||
row.itemR(curve, "back")
|
||||
|
||||
col.itemL(text="Textures:")
|
||||
# col.itemR(curve, "uv_orco")
|
||||
col.itemR(curve, "auto_texspace")
|
||||
|
||||
if col2:
|
||||
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.itemR(curve, "resolution_v", text="Preview V")
|
||||
sub.itemR(curve, "render_resolution_v", text="Render V")
|
||||
|
||||
# XXX - put somewhere nicer.
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemR(curve, "twist_mode", text="Twist")
|
||||
|
||||
if is_curve:
|
||||
col.itemL(text="Twisting:")
|
||||
col.itemR(curve, "twist_mode", text="")
|
||||
col.itemR(curve, "twist_smooth", text="Smooth")
|
||||
if is_text:
|
||||
col.itemL(text="Display:")
|
||||
col.itemR(curve, "fast", text="Fast Editing")
|
||||
|
||||
if col2:
|
||||
col = split.column()
|
||||
col.itemR(curve, "twist_smooth") # XXX - may not be kept
|
||||
|
||||
if is_surf:
|
||||
sub = col.column(align=True)
|
||||
sub.itemL(text="")
|
||||
sub.itemR(curve, "resolution_v", text="Preview V")
|
||||
sub.itemR(curve, "render_resolution_v", text="Render V")
|
||||
|
||||
if is_curve or is_text:
|
||||
sub = col.column()
|
||||
sub.active = (curve.dimensions == '2D')
|
||||
sub.itemL(text="Caps:")
|
||||
sub.itemR(curve, "front")
|
||||
sub.itemR(curve, "back")
|
||||
|
||||
col.itemL(text="Textures:")
|
||||
# col.itemR(curve, "uv_orco")
|
||||
col.itemR(curve, "auto_texspace")
|
||||
|
||||
|
||||
class DATA_PT_geometry_curve(DataButtonsPanel):
|
||||
@ -173,11 +172,18 @@ class DATA_PT_pathanim(DataButtonsPanelCurve):
|
||||
|
||||
col = split.column()
|
||||
col.itemR(curve, "path_length", text="Frames")
|
||||
if col2:
|
||||
col = split.column()
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemR(curve, "use_path_follow")
|
||||
col.itemR(curve, "use_stretch")
|
||||
|
||||
if col2:
|
||||
col = split.column()
|
||||
col.itemR(curve, "use_stretch")
|
||||
|
||||
col.itemR(curve, "use_radius")
|
||||
col.itemR(curve, "use_time_offset", text="Offset Children")
|
||||
|
||||
@ -255,8 +261,122 @@ class DATA_PT_active_spline(DataButtonsPanelActive):
|
||||
col = split.column()
|
||||
col.itemR(act_spline, "smooth")
|
||||
|
||||
class DATA_PT_font(DataButtonsPanel):
|
||||
bl_label = "Font"
|
||||
|
||||
def poll(self, context):
|
||||
return (context.object and context.object.type == 'TEXT' and context.curve)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
text = context.curve
|
||||
char = context.curve.edit_format
|
||||
col2 = context.region.width > narrowui
|
||||
|
||||
if col2:
|
||||
layout.itemR(text, "font")
|
||||
else:
|
||||
layout.itemR(text, "font", text="")
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemR(text, "text_size", text="Size")
|
||||
if col2:
|
||||
col = split.column()
|
||||
col.itemR(text, "shear")
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Object Font:")
|
||||
col.itemR(text, "family", text="")
|
||||
|
||||
if col2:
|
||||
col = split.column()
|
||||
col.itemL(text="Text on Curve:")
|
||||
col.itemR(text, "text_on_curve", text="")
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column(align=True)
|
||||
col.itemL(text="Underline:")
|
||||
col.itemR(text, "ul_position", text="Position")
|
||||
col.itemR(text, "ul_height", text="Thickness")
|
||||
|
||||
if col2:
|
||||
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")
|
||||
|
||||
|
||||
class DATA_PT_paragraph(DataButtonsPanel):
|
||||
bl_label = "Paragraph"
|
||||
def poll(self, context):
|
||||
return (context.object and context.object.type == 'TEXT' and context.curve)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
text = context.curve
|
||||
col2 = context.region.width > narrowui
|
||||
|
||||
layout.itemL(text="Align:")
|
||||
if col2:
|
||||
layout.itemR(text, "spacemode", expand=True)
|
||||
else:
|
||||
layout.itemR(text, "spacemode", text="")
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column(align=True)
|
||||
col.itemL(text="Spacing:")
|
||||
col.itemR(text, "spacing", text="Character")
|
||||
col.itemR(text, "word_spacing", text="Word")
|
||||
col.itemR(text, "line_dist", text="Line")
|
||||
|
||||
if col2:
|
||||
col = split.column(align=True)
|
||||
col.itemL(text="Offset:")
|
||||
col.itemR(text, "offset_x", text="X")
|
||||
col.itemR(text, "offset_y", text="Y")
|
||||
|
||||
|
||||
class DATA_PT_textboxes(DataButtonsPanel):
|
||||
bl_label = "Text Boxes"
|
||||
def poll(self, context):
|
||||
return (context.object and context.object.type == 'TEXT' and context.curve)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
text = context.curve
|
||||
col2 = context.region.width > narrowui
|
||||
|
||||
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")
|
||||
|
||||
if col2:
|
||||
col = split.column(align=True)
|
||||
col.itemL(text="Offset:")
|
||||
col.itemR(box, "x", text="X")
|
||||
col.itemR(box, "y", text="Y")
|
||||
|
||||
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_font)
|
||||
bpy.types.register(DATA_PT_paragraph)
|
||||
bpy.types.register(DATA_PT_textboxes)
|
||||
|
@ -60,7 +60,10 @@ class DATA_PT_context_lamp(DataButtonsPanel):
|
||||
split.template_ID(space, "pin_id")
|
||||
split.itemS()
|
||||
else:
|
||||
layout.template_ID(ob, "data")
|
||||
if ob:
|
||||
layout.template_ID(ob, "data")
|
||||
elif lamp:
|
||||
layout.template_ID(space, "pin_id")
|
||||
|
||||
|
||||
class DATA_PT_lamp(DataButtonsPanel):
|
||||
|
@ -19,6 +19,7 @@
|
||||
# <pep8 compliant>
|
||||
import bpy
|
||||
|
||||
narrowui = 180
|
||||
|
||||
class DataButtonsPanel(bpy.types.Panel):
|
||||
bl_space_type = 'PROPERTIES'
|
||||
@ -39,15 +40,21 @@ class DATA_PT_context_lattice(DataButtonsPanel):
|
||||
ob = context.object
|
||||
lat = context.lattice
|
||||
space = context.space_data
|
||||
col2 = context.region.width > narrowui
|
||||
|
||||
split = layout.split(percentage=0.65)
|
||||
|
||||
if ob:
|
||||
split.template_ID(ob, "data")
|
||||
split.itemS()
|
||||
elif lat:
|
||||
split.template_ID(space, "pin_id")
|
||||
split.itemS()
|
||||
if col2:
|
||||
split = layout.split(percentage=0.65)
|
||||
if ob:
|
||||
split.template_ID(ob, "data")
|
||||
split.itemS()
|
||||
elif lat:
|
||||
split.template_ID(space, "pin_id")
|
||||
split.itemS()
|
||||
else:
|
||||
if ob:
|
||||
layout.template_ID(ob, "data")
|
||||
elif lat:
|
||||
layout.template_ID(space, "pin_id")
|
||||
|
||||
|
||||
class DATA_PT_lattice(DataButtonsPanel):
|
||||
@ -57,21 +64,30 @@ class DATA_PT_lattice(DataButtonsPanel):
|
||||
layout = self.layout
|
||||
|
||||
lat = context.lattice
|
||||
col2 = context.region.width > narrowui
|
||||
|
||||
split = layout.split()
|
||||
col = split.column()
|
||||
col.itemR(lat, "points_u")
|
||||
if col2:
|
||||
col = split.column()
|
||||
col.itemR(lat, "interpolation_type_u", text="")
|
||||
|
||||
split = layout.split()
|
||||
col = split.column()
|
||||
col.itemR(lat, "points_v")
|
||||
if col2:
|
||||
col = split.column()
|
||||
col.itemR(lat, "interpolation_type_v", text="")
|
||||
|
||||
split = layout.split()
|
||||
col = split.column()
|
||||
col.itemR(lat, "points_w")
|
||||
if col2:
|
||||
col = split.column()
|
||||
col.itemR(lat, "interpolation_type_w", text="")
|
||||
|
||||
row = layout.row()
|
||||
row.itemR(lat, "points_u")
|
||||
row.itemR(lat, "interpolation_type_u", expand=True)
|
||||
|
||||
row = layout.row()
|
||||
row.itemR(lat, "points_v")
|
||||
row.itemR(lat, "interpolation_type_v", expand=True)
|
||||
|
||||
row = layout.row()
|
||||
row.itemR(lat, "points_w")
|
||||
row.itemR(lat, "interpolation_type_w", expand=True)
|
||||
|
||||
row = layout.row()
|
||||
row.itemO("lattice.make_regular")
|
||||
row.itemR(lat, "outside")
|
||||
|
||||
bpy.types.register(DATA_PT_context_lattice)
|
||||
|
@ -41,15 +41,21 @@ class DATA_PT_context_mesh(DataButtonsPanel):
|
||||
ob = context.object
|
||||
mesh = context.mesh
|
||||
space = context.space_data
|
||||
col2 = context.region.width > narrowui
|
||||
|
||||
split = layout.split(percentage=0.65)
|
||||
|
||||
if ob:
|
||||
split.template_ID(ob, "data")
|
||||
split.itemS()
|
||||
elif mesh:
|
||||
split.template_ID(space, "pin_id")
|
||||
split.itemS()
|
||||
if col2:
|
||||
split = layout.split(percentage=0.65)
|
||||
if ob:
|
||||
split.template_ID(ob, "data")
|
||||
split.itemS()
|
||||
elif mesh:
|
||||
split.template_ID(space, "pin_id")
|
||||
split.itemS()
|
||||
else:
|
||||
if ob:
|
||||
layout.template_ID(ob, "data")
|
||||
elif mesh:
|
||||
layout.template_ID(space, "pin_id")
|
||||
|
||||
|
||||
class DATA_PT_normals(DataButtonsPanel):
|
||||
|
@ -19,6 +19,7 @@
|
||||
# <pep8 compliant>
|
||||
import bpy
|
||||
|
||||
narrowui = 180
|
||||
|
||||
class DataButtonsPanel(bpy.types.Panel):
|
||||
bl_space_type = 'PROPERTIES'
|
||||
@ -39,15 +40,21 @@ class DATA_PT_context_metaball(DataButtonsPanel):
|
||||
ob = context.object
|
||||
mball = context.meta_ball
|
||||
space = context.space_data
|
||||
col2 = context.region.width > narrowui
|
||||
|
||||
split = layout.split(percentage=0.65)
|
||||
|
||||
if ob:
|
||||
split.template_ID(ob, "data")
|
||||
split.itemS()
|
||||
elif mball:
|
||||
split.template_ID(space, "pin_id")
|
||||
split.itemS()
|
||||
if col2:
|
||||
split = layout.split(percentage=0.65)
|
||||
if ob:
|
||||
split.template_ID(ob, "data")
|
||||
split.itemS()
|
||||
elif mball:
|
||||
split.template_ID(space, "pin_id")
|
||||
split.itemS()
|
||||
else:
|
||||
if ob:
|
||||
layout.template_ID(ob, "data")
|
||||
elif mball:
|
||||
layout.template_ID(space, "pin_id")
|
||||
|
||||
|
||||
class DATA_PT_metaball(DataButtonsPanel):
|
||||
@ -57,6 +64,7 @@ class DATA_PT_metaball(DataButtonsPanel):
|
||||
layout = self.layout
|
||||
|
||||
mball = context.meta_ball
|
||||
col2 = context.region.width > narrowui
|
||||
|
||||
split = layout.split()
|
||||
|
||||
@ -66,12 +74,16 @@ class DATA_PT_metaball(DataButtonsPanel):
|
||||
sub.itemR(mball, "wire_size", text="View")
|
||||
sub.itemR(mball, "render_size", text="Render")
|
||||
|
||||
col = split.column()
|
||||
if col2:
|
||||
col = split.column()
|
||||
col.itemL(text="Settings:")
|
||||
col.itemR(mball, "threshold", text="Threshold")
|
||||
|
||||
layout.itemL(text="Update:")
|
||||
layout.itemR(mball, "flag", expand=True)
|
||||
if col2:
|
||||
layout.itemR(mball, "flag", expand=True)
|
||||
else:
|
||||
layout.itemR(mball, "flag", text="")
|
||||
|
||||
|
||||
class DATA_PT_metaball_element(DataButtonsPanel):
|
||||
@ -84,42 +96,40 @@ class DATA_PT_metaball_element(DataButtonsPanel):
|
||||
layout = self.layout
|
||||
|
||||
metaelem = context.meta_ball.active_element
|
||||
col2 = context.region.width > narrowui
|
||||
|
||||
split = layout.split(percentage=0.3)
|
||||
split.itemL(text="Type:")
|
||||
split.itemR(metaelem, "type", text="")
|
||||
if col2:
|
||||
layout.itemR(metaelem, "type")
|
||||
else:
|
||||
layout.itemR(metaelem, "type", text="")
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col = split.column(align=True)
|
||||
col.itemL(text="Settings:")
|
||||
col.itemR(metaelem, "stiffness", text="Stiffness")
|
||||
col.itemR(metaelem, "negative", text="Negative")
|
||||
col.itemR(metaelem, "hide", text="Hide")
|
||||
|
||||
if metaelem.type == 'BALL':
|
||||
|
||||
if col2:
|
||||
col = split.column(align=True)
|
||||
|
||||
elif metaelem.type == 'CUBE':
|
||||
col = split.column(align=True)
|
||||
if metaelem.type == 'CUBE':
|
||||
col.itemL(text="Size:")
|
||||
col.itemR(metaelem, "size_x", text="X")
|
||||
col.itemR(metaelem, "size_y", text="Y")
|
||||
col.itemR(metaelem, "size_z", text="Z")
|
||||
|
||||
elif metaelem.type == 'TUBE':
|
||||
col = split.column(align=True)
|
||||
col.itemL(text="Size:")
|
||||
col.itemR(metaelem, "size_x", text="X")
|
||||
|
||||
elif metaelem.type == 'PLANE':
|
||||
col = split.column(align=True)
|
||||
col.itemL(text="Size:")
|
||||
col.itemR(metaelem, "size_x", text="X")
|
||||
col.itemR(metaelem, "size_y", text="Y")
|
||||
|
||||
elif metaelem.type == 'ELLIPSOID':
|
||||
col = split.column(align=True)
|
||||
col.itemL(text="Size:")
|
||||
col.itemR(metaelem, "size_x", text="X")
|
||||
col.itemR(metaelem, "size_y", text="Y")
|
||||
|
@ -1,203 +0,0 @@
|
||||
# ##### BEGIN GPL LICENSE BLOCK #####
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
# ##### END GPL LICENSE BLOCK #####
|
||||
|
||||
# <pep8 compliant>
|
||||
import bpy
|
||||
|
||||
|
||||
class DataButtonsPanel(bpy.types.Panel):
|
||||
bl_space_type = 'PROPERTIES'
|
||||
bl_region_type = 'WINDOW'
|
||||
bl_context = "data"
|
||||
|
||||
def poll(self, context):
|
||||
return (context.object and context.object.type == 'TEXT' and context.curve)
|
||||
|
||||
|
||||
class DATA_PT_context_text(DataButtonsPanel):
|
||||
bl_label = ""
|
||||
bl_show_header = False
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
ob = context.object
|
||||
curve = context.curve
|
||||
space = context.space_data
|
||||
|
||||
split = layout.split(percentage=0.65)
|
||||
|
||||
if ob:
|
||||
split.template_ID(ob, "data")
|
||||
split.itemS()
|
||||
elif curve:
|
||||
split.template_ID(space, "pin_id")
|
||||
split.itemS()
|
||||
|
||||
|
||||
class DATA_PT_shape_text(DataButtonsPanel):
|
||||
bl_label = "Shape Text"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
curve = context.curve
|
||||
|
||||
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")
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Resolution:")
|
||||
sub = col.column(align=True)
|
||||
sub.itemR(curve, "resolution_u", text="Preview")
|
||||
sub.itemR(curve, "render_resolution_u", text="Render")
|
||||
|
||||
# resolution_v is not used for text
|
||||
|
||||
sub = col.column(align=True)
|
||||
col.itemL(text="Display:")
|
||||
col.itemR(curve, "fast", text="Fast Editing")
|
||||
|
||||
|
||||
class DATA_PT_geometry_text(DataButtonsPanel):
|
||||
bl_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.itemL(text="Taper Object:")
|
||||
col.itemR(curve, "taper_object", text="")
|
||||
|
||||
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="")
|
||||
|
||||
|
||||
class DATA_PT_font(DataButtonsPanel):
|
||||
bl_label = "Font"
|
||||
|
||||
def draw(self, context):
|
||||
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 = 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.itemL(text="Underline:")
|
||||
col.itemR(text, "ul_position", text="Position")
|
||||
col.itemR(text, "ul_height", text="Thickness")
|
||||
|
||||
|
||||
class DATA_PT_paragraph(DataButtonsPanel):
|
||||
bl_label = "Paragraph"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
text = context.curve
|
||||
|
||||
layout.itemL(text="Align:")
|
||||
layout.itemR(text, "spacemode", expand=True)
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column(align=True)
|
||||
col.itemL(text="Spacing:")
|
||||
col.itemR(text, "spacing", text="Character")
|
||||
col.itemR(text, "word_spacing", text="Word")
|
||||
col.itemR(text, "line_dist", text="Line")
|
||||
|
||||
col = split.column(align=True)
|
||||
col.itemL(text="Offset:")
|
||||
col.itemR(text, "offset_x", text="X")
|
||||
col.itemR(text, "offset_y", text="Y")
|
||||
|
||||
|
||||
class DATA_PT_textboxes(DataButtonsPanel):
|
||||
bl_label = "Text Boxes"
|
||||
|
||||
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")
|
||||
|
||||
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)
|
@ -19,6 +19,7 @@
|
||||
# <pep8 compliant>
|
||||
import bpy
|
||||
|
||||
narrowui = 180
|
||||
|
||||
class PhysicsButtonsPanel(bpy.types.Panel):
|
||||
bl_space_type = 'PROPERTIES'
|
||||
@ -40,8 +41,12 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel):
|
||||
ob = context.active_object
|
||||
game = ob.game
|
||||
soft = ob.game.soft_body
|
||||
col2 = context.region.width > narrowui
|
||||
|
||||
layout.itemR(game, "physics_type")
|
||||
if col2:
|
||||
layout.itemR(game, "physics_type")
|
||||
else:
|
||||
layout.itemR(game, "physics_type", text="")
|
||||
layout.itemS()
|
||||
|
||||
#if game.physics_type == 'DYNAMIC':
|
||||
@ -53,7 +58,8 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel):
|
||||
col.itemR(game, "ghost")
|
||||
col.itemR(ob, "restrict_render", text="Invisible") # out of place but useful
|
||||
|
||||
col = split.column()
|
||||
if col2:
|
||||
col = split.column()
|
||||
col.itemR(game, "material_physics")
|
||||
col.itemR(game, "rotate_from_normal")
|
||||
col.itemR(game, "no_sleeping")
|
||||
@ -68,7 +74,8 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel):
|
||||
col.itemR(game, "radius")
|
||||
col.itemR(game, "form_factor")
|
||||
|
||||
col = split.column()
|
||||
if col2:
|
||||
col = split.column()
|
||||
sub = col.column()
|
||||
sub.active = (game.physics_type == 'RIGID_BODY')
|
||||
sub.itemR(game, "anisotropic_friction")
|
||||
@ -84,7 +91,8 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel):
|
||||
sub.itemR(game, "minimum_velocity", text="Minimum")
|
||||
sub.itemR(game, "maximum_velocity", text="Maximum")
|
||||
|
||||
col = split.column()
|
||||
if col2:
|
||||
col = split.column()
|
||||
col.itemL(text="Damping:")
|
||||
sub = col.column(align=True)
|
||||
sub.itemR(game, "damping", text="Translation", slider=True)
|
||||
@ -126,7 +134,8 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel):
|
||||
col.itemR(soft, "margin", slider=True)
|
||||
col.itemR(soft, "bending_const", text="Bending Constraints")
|
||||
|
||||
col = split.column()
|
||||
if col2:
|
||||
col = split.column()
|
||||
col.itemR(soft, "shape_match")
|
||||
sub = col.column()
|
||||
sub.active = soft.shape_match
|
||||
@ -168,13 +177,23 @@ class PHYSICS_PT_game_collision_bounds(PhysicsButtonsPanel):
|
||||
layout = self.layout
|
||||
|
||||
game = context.active_object.game
|
||||
col2 = context.region.width > narrowui
|
||||
|
||||
layout.active = game.use_collision_bounds
|
||||
layout.itemR(game, "collision_bounds", text="Bounds")
|
||||
if col2:
|
||||
layout.itemR(game, "collision_bounds", text="Bounds")
|
||||
else:
|
||||
layout.itemR(game, "collision_bounds", text="")
|
||||
|
||||
row = layout.row()
|
||||
row.itemR(game, "collision_compound", text="Compound")
|
||||
row.itemR(game, "collision_margin", text="Margin", slider=True)
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemR(game, "collision_margin", text="Margin", slider=True)
|
||||
|
||||
if col2:
|
||||
col = split.column()
|
||||
col.itemR(game, "collision_compound", text="Compound")
|
||||
|
||||
|
||||
bpy.types.register(PHYSICS_PT_game_physics)
|
||||
bpy.types.register(PHYSICS_PT_game_collision_bounds)
|
||||
@ -208,6 +227,7 @@ class RENDER_PT_game_player(RenderButtonsPanel):
|
||||
layout = self.layout
|
||||
|
||||
gs = context.scene.game_data
|
||||
col2 = context.region.width > narrowui
|
||||
|
||||
layout.itemR(gs, "fullscreen")
|
||||
|
||||
@ -219,7 +239,8 @@ class RENDER_PT_game_player(RenderButtonsPanel):
|
||||
sub.itemR(gs, "resolution_x", slider=False, text="X")
|
||||
sub.itemR(gs, "resolution_y", slider=False, text="Y")
|
||||
|
||||
col = split.column()
|
||||
if col2:
|
||||
col = split.column()
|
||||
col.itemL(text="Quality:")
|
||||
sub = col.column(align=True)
|
||||
sub.itemR(gs, "depth", text="Bit Depth", slider=False)
|
||||
@ -228,7 +249,10 @@ class RENDER_PT_game_player(RenderButtonsPanel):
|
||||
# framing:
|
||||
col = layout.column()
|
||||
col.itemL(text="Framing:")
|
||||
col.row().itemR(gs, "framing_type", expand=True)
|
||||
if col2:
|
||||
col.row().itemR(gs, "framing_type", expand=True)
|
||||
else:
|
||||
col.itemR(gs, "framing_type", text="")
|
||||
if gs.framing_type == 'LETTERBOX':
|
||||
col.itemR(gs, "framing_color", text="")
|
||||
|
||||
@ -241,6 +265,7 @@ class RENDER_PT_game_stereo(RenderButtonsPanel):
|
||||
|
||||
gs = context.scene.game_data
|
||||
stereo_mode = gs.stereo
|
||||
col2 = context.region.width > narrowui
|
||||
|
||||
# stereo options:
|
||||
layout.itemR(gs, "stereo", expand=True)
|
||||
@ -253,7 +278,10 @@ class RENDER_PT_game_stereo(RenderButtonsPanel):
|
||||
|
||||
# dome:
|
||||
elif stereo_mode == 'DOME':
|
||||
layout.itemR(gs, "dome_mode", text="Dome Type")
|
||||
if col2:
|
||||
layout.itemR(gs, "dome_mode", text="Dome Type")
|
||||
else:
|
||||
layout.itemR(gs, "dome_mode", text="")
|
||||
|
||||
dome_type = gs.dome_mode
|
||||
|
||||
@ -264,21 +292,27 @@ class RENDER_PT_game_stereo(RenderButtonsPanel):
|
||||
dome_type == 'TRUNCATED_FRONT':
|
||||
|
||||
col = split.column()
|
||||
col.itemR(gs, "dome_angle", slider=True)
|
||||
col.itemR(gs, "dome_tilt")
|
||||
|
||||
col = split.column()
|
||||
col.itemR(gs, "dome_tesselation", text="Tesselation")
|
||||
col.itemR(gs, "dome_buffer_resolution", text="Resolution", slider=True)
|
||||
col.itemR(gs, "dome_angle", slider=True)
|
||||
|
||||
if col2:
|
||||
col = split.column()
|
||||
col.itemR(gs, "dome_tesselation", text="Tesselation")
|
||||
col.itemR(gs, "dome_tilt")
|
||||
|
||||
elif dome_type == 'PANORAM_SPH':
|
||||
col = split.column()
|
||||
col.itemR(gs, "dome_tesselation", text="Tesselation")
|
||||
|
||||
col.itemR(gs, "dome_buffer_resolution", text="Resolution", slider=True)
|
||||
if col2:
|
||||
col = split.column()
|
||||
col.itemR(gs, "dome_tesselation", text="Tesselation")
|
||||
|
||||
else: # cube map
|
||||
col = split.column()
|
||||
col.itemR(gs, "dome_buffer_resolution", text="Resolution", slider=True)
|
||||
if col2:
|
||||
col = split.column()
|
||||
|
||||
layout.itemR(gs, "dome_text")
|
||||
|
||||
@ -290,7 +324,12 @@ class RENDER_PT_game_shading(RenderButtonsPanel):
|
||||
layout = self.layout
|
||||
|
||||
gs = context.scene.game_data
|
||||
layout.itemR(gs, "material_mode", expand=True)
|
||||
col2 = context.region.width > narrowui
|
||||
|
||||
if col2:
|
||||
layout.itemR(gs, "material_mode", expand=True)
|
||||
else:
|
||||
layout.itemR(gs, "material_mode", text="")
|
||||
|
||||
if gs.material_mode == 'GLSL':
|
||||
split = layout.split()
|
||||
@ -313,7 +352,8 @@ class RENDER_PT_game_performance(RenderButtonsPanel):
|
||||
layout = self.layout
|
||||
|
||||
gs = context.scene.game_data
|
||||
|
||||
col2 = context.region.width > narrowui
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
@ -323,7 +363,8 @@ class RENDER_PT_game_performance(RenderButtonsPanel):
|
||||
col.itemR(gs, "show_physics_visualization", text="Physics Visualization")
|
||||
col.itemR(gs, "deprecation_warnings")
|
||||
|
||||
col = split.column()
|
||||
if col2:
|
||||
col = split.column()
|
||||
col.itemL(text="Render:")
|
||||
col.itemR(gs, "all_frames")
|
||||
col.itemR(gs, "display_lists")
|
||||
@ -336,8 +377,12 @@ class RENDER_PT_game_sound(RenderButtonsPanel):
|
||||
layout = self.layout
|
||||
|
||||
scene = context.scene
|
||||
col2 = context.region.width > narrowui
|
||||
|
||||
layout.itemR(scene, "distance_model")
|
||||
if col2:
|
||||
layout.itemR(scene, "distance_model")
|
||||
else:
|
||||
layout.itemR(scene, "distance_model", text="")
|
||||
layout.itemR(scene, "speed_of_sound", text="Speed")
|
||||
layout.itemR(scene, "doppler_factor")
|
||||
|
||||
@ -373,14 +418,19 @@ class WORLD_PT_game_context_world(WorldButtonsPanel):
|
||||
scene = context.scene
|
||||
world = context.world
|
||||
space = context.space_data
|
||||
col2 = context.region.width > narrowui
|
||||
|
||||
split = layout.split(percentage=0.65)
|
||||
|
||||
if scene:
|
||||
split.template_ID(scene, "world", new="world.new")
|
||||
elif world:
|
||||
split.template_ID(space, "pin_id")
|
||||
|
||||
if col2:
|
||||
split = layout.split(percentage=0.65)
|
||||
if scene:
|
||||
split.template_ID(scene, "world", new="world.new")
|
||||
elif world:
|
||||
split.template_ID(space, "pin_id")
|
||||
else:
|
||||
if scene:
|
||||
layout.template_ID(scene, "world", new="world.new")
|
||||
elif world:
|
||||
layout.template_ID(space, "pin_id")
|
||||
|
||||
class WORLD_PT_game_world(WorldButtonsPanel):
|
||||
bl_label = "World"
|
||||
@ -389,18 +439,40 @@ class WORLD_PT_game_world(WorldButtonsPanel):
|
||||
layout = self.layout
|
||||
|
||||
world = context.world
|
||||
col2 = context.region.width > narrowui
|
||||
|
||||
row = layout.row()
|
||||
row.column().itemR(world, "horizon_color")
|
||||
row.column().itemR(world, "ambient_color")
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemR(world, "horizon_color")
|
||||
|
||||
if col2:
|
||||
col = split.column()
|
||||
col.itemR(world, "ambient_color")
|
||||
|
||||
layout.itemR(world.mist, "enabled", text="Mist")
|
||||
|
||||
row = layout.column_flow()
|
||||
row.active = world.mist.enabled
|
||||
row.itemR(world.mist, "start")
|
||||
row.itemR(world.mist, "depth")
|
||||
class WORLD_PT_game_mist(WorldButtonsPanel):
|
||||
bl_label = "Mist"
|
||||
|
||||
def draw_header(self, context):
|
||||
world = context.world
|
||||
|
||||
self.layout.itemR(world.mist, "enabled", text="")
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
world = context.world
|
||||
col2 = context.region.width > narrowui
|
||||
|
||||
layout.active = world.mist.enabled
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemR(world.mist, "start")
|
||||
|
||||
if col2:
|
||||
col = split.column()
|
||||
col.itemR(world.mist, "depth")
|
||||
|
||||
class WORLD_PT_game_physics(WorldButtonsPanel):
|
||||
bl_label = "Physics"
|
||||
@ -409,6 +481,7 @@ class WORLD_PT_game_physics(WorldButtonsPanel):
|
||||
layout = self.layout
|
||||
|
||||
gs = context.scene.game_data
|
||||
col2 = context.region.width > narrowui
|
||||
|
||||
layout.itemR(gs, "physics_engine")
|
||||
if gs.physics_engine != 'NONE':
|
||||
@ -423,7 +496,8 @@ class WORLD_PT_game_physics(WorldButtonsPanel):
|
||||
sub.itemR(gs, "physics_step_sub", text="Substeps")
|
||||
col.itemR(gs, "fps", text="FPS")
|
||||
|
||||
col = split.column()
|
||||
if col2:
|
||||
col = split.column()
|
||||
col.itemL(text="Logic Steps:")
|
||||
col.itemR(gs, "logic_step_max", text="Max")
|
||||
|
||||
@ -446,4 +520,5 @@ class WORLD_PT_game_physics(WorldButtonsPanel):
|
||||
|
||||
bpy.types.register(WORLD_PT_game_context_world)
|
||||
bpy.types.register(WORLD_PT_game_world)
|
||||
bpy.types.register(WORLD_PT_game_physics)
|
||||
bpy.types.register(WORLD_PT_game_mist)
|
||||
bpy.types.register(WORLD_PT_game_physics)
|
@ -106,7 +106,10 @@ class MATERIAL_PT_context_material(MaterialButtonsPanel):
|
||||
split.template_ID(space, "pin_id")
|
||||
split.itemS()
|
||||
else:
|
||||
layout.template_ID(ob, "active_material", new="material.new")
|
||||
if ob:
|
||||
layout.template_ID(ob, "active_material", new="material.new")
|
||||
elif mat:
|
||||
layout.template_ID(space, "pin_id")
|
||||
|
||||
if mat:
|
||||
if col2:
|
||||
|
Loading…
Reference in New Issue
Block a user