diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-05-15 15:19:59 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-05-15 15:19:59 +0400 |
commit | b4d46e5dedfa88951558a4f941d987a171594a0a (patch) | |
tree | 4de559356ab0ac6135f5a1abbbdb60eb1134ffca /release | |
parent | 2df94626c483c9b522e347ecc792c634fdec420a (diff) |
UI: Layout Engine
* Buttons are now created first, and after that the layout is computed.
This means the layout engine now works at button level, and makes it
easier to write templates. Otherwise you had to store all info and
create the buttons later.
* Added interface_templates.c as a separate file to put templates in.
These can contain regular buttons, and can be put in a Free layout,
which means you can specify manual coordinates, but still get nested
correct inside other layouts.
* API was changed to allow better nesting. Previously items were added
in the last added layout specifier, i.e. one level up in the layout
hierarchy. This doesn't work well in always, so now when creating things
like rows or columns it always returns a layout which you have to add
the items in. All py scripts were updated to follow this.
* Computing the layout now goes in two passes, first estimating the
required width/height of all nested layouts, and then in the second
pass using the results of that to decide on the actual locations.
* Enum and array buttons now follow the direction of the layout, i.e.
they are vertical or horizontal depending if they are in a column or row.
* Color properties now get a color picker, and only get the additional
RGB sliders with Expand=True.
* File/directory string properties now get a button next to them for
opening the file browse, though this is not implemented yet.
* Layout items can now be aligned, set align=True when creating a column,
row, etc.
* Buttons now get a minimum width of one icon (avoids squashing icon
buttons).
* Moved some more space variables into Style.
Diffstat (limited to 'release')
-rw-r--r-- | release/ui/buttons_data_camera.py | 52 | ||||
-rw-r--r-- | release/ui/buttons_data_empty.py | 3 | ||||
-rw-r--r-- | release/ui/buttons_data_lamp.py | 151 | ||||
-rw-r--r-- | release/ui/buttons_data_lattice.py | 26 | ||||
-rw-r--r-- | release/ui/buttons_data_modifier.py | 36 | ||||
-rw-r--r-- | release/ui/buttons_material.py | 183 | ||||
-rw-r--r-- | release/ui/buttons_objects.py | 72 | ||||
-rw-r--r-- | release/ui/buttons_scene.py | 130 | ||||
-rw-r--r-- | release/ui/buttons_world.py | 114 | ||||
-rw-r--r-- | release/ui/space_text.py | 83 |
10 files changed, 405 insertions, 445 deletions
diff --git a/release/ui/buttons_data_camera.py b/release/ui/buttons_data_camera.py index 0f852216a87..27f63669cf7 100644 --- a/release/ui/buttons_data_camera.py +++ b/release/ui/buttons_data_camera.py @@ -21,30 +21,30 @@ class DATA_PT_cameralens(DataButtonsPanel): if not cam: return - layout.row() layout.itemR(cam, "type", expand=True) - layout.row() - if (cam.type == 'PERSP'): - layout.itemR(cam, "lens_unit") - if (cam.lens_unit == 'MILLIMETERS'): - layout.itemR(cam, "lens", text="Angle") - if (cam.lens_unit == 'DEGREES'): - layout.itemR(cam, "angle") - if (cam.type == 'ORTHO'): - layout.itemR(cam, "ortho_scale") + row = layout.row(align=True) + if cam.type == 'PERSP': + if cam.lens_unit == 'MILLIMETERS': + row.itemR(cam, "lens", text="Angle") + elif cam.lens_unit == 'DEGREES': + row.itemR(cam, "angle") + + row.itemR(cam, "lens_unit", text="") + elif cam.type == 'ORTHO': + row.itemR(cam, "ortho_scale") - layout.column_flow() - layout.itemL(text="Shift:") - layout.itemR(cam, "shift_x", text="X") - layout.itemR(cam, "shift_y", text="Y") - layout.itemL(text="Clipping:") - layout.itemR(cam, "clip_start", text="Start") - layout.itemR(cam, "clip_end", text="End") + flow = layout.column_flow() + flow.itemL(text="Shift:") + flow.itemR(cam, "shift_x", text="X") + flow.itemR(cam, "shift_y", text="Y") + flow.itemL(text="Clipping:") + flow.itemR(cam, "clip_start", text="Start") + flow.itemR(cam, "clip_end", text="End") - layout.row() - layout.itemR(cam, "dof_object") - layout.itemR(cam, "dof_distance") + row = layout.row() + row.itemR(cam, "dof_object") + row.itemR(cam, "dof_distance") class DATA_PT_cameradisplay(DataButtonsPanel): __idname__ = "DATA_PT_cameradisplay" @@ -57,23 +57,21 @@ class DATA_PT_cameradisplay(DataButtonsPanel): if not cam: return - layout.split(number=2) + split = layout.split() - sub = layout.sub(0) - sub.column() + sub = split.column() sub.itemR(cam, "show_limits", text="Limits") sub.itemR(cam, "show_mist", text="Mist") sub.itemR(cam, "show_title_safe", text="Title Safe") sub.itemR(cam, "show_name", text="Name") - sub = layout.sub(1) + sub = split.column() subsub = sub.box() - subsub.column() subsub.itemR(cam, "show_passepartout", text="Passepartout") if (cam.show_passepartout): subsub.itemR(cam, "passepartout_alpha", text="Alpha") - sub.row() - sub.itemR(cam, "draw_size", text="Size") + row = sub.row() + row.itemR(cam, "draw_size", text="Size") bpy.types.register(DATA_PT_cameralens) bpy.types.register(DATA_PT_cameradisplay) diff --git a/release/ui/buttons_data_empty.py b/release/ui/buttons_data_empty.py index 2360178fdc7..5fe1e943f1f 100644 --- a/release/ui/buttons_data_empty.py +++ b/release/ui/buttons_data_empty.py @@ -21,8 +21,7 @@ class DATA_PT_empty(DataButtonsPanel): if not ob: return - layout.column() layout.itemR(ob, "empty_draw_type") layout.itemR(ob, "empty_draw_size") -bpy.types.register(DATA_PT_empty)
\ No newline at end of file +bpy.types.register(DATA_PT_empty) diff --git a/release/ui/buttons_data_lamp.py b/release/ui/buttons_data_lamp.py index d7ade3ecccf..da2701a43f2 100644 --- a/release/ui/buttons_data_lamp.py +++ b/release/ui/buttons_data_lamp.py @@ -21,26 +21,23 @@ class DATA_PT_lamp(DataButtonsPanel): if not lamp: return - layout.row() - layout.itemR(lamp, "type", expand=True) + row = layout.row() + row.itemR(lamp, "type", expand=True) - layout.split(number=2) + split = layout.split() - sub = layout.sub(0) - sub.column() + sub = split.column() sub.itemR(lamp, "energy") sub.itemR(lamp, "distance") sub.itemR(lamp, "negative") sub.itemR(lamp, "color") - sub = layout.sub(1) - sub.column() + sub = split.column() sub.itemR(lamp, "layer", text="This Layer Only") sub.itemR(lamp, "specular") sub.itemR(lamp, "diffuse") - if (lamp.type in ('POINT', 'SPOT')): - sub.column() + if lamp.type in ('POINT', 'SPOT'): sub.itemR(lamp, "falloff_type") sub.itemR(lamp, "sphere") @@ -48,7 +45,7 @@ class DATA_PT_lamp(DataButtonsPanel): sub.itemR(lamp, "linear_attenuation") sub.itemR(lamp, "quadratic_attenuation") - if (lamp.type == 'AREA'): + if lamp.type == 'AREA': sub.column() sub.itemR(lamp, "gamma") sub.itemR(lamp, "shape") @@ -74,33 +71,31 @@ class DATA_PT_sunsky(DataButtonsPanel): if not lamp: return - layout.row() - layout.itemR(lamp, "sky") - layout.itemR(lamp, "atmosphere") + row = layout.row() + row.itemR(lamp, "sky") + row.itemR(lamp, "atmosphere") - if (lamp.sky or lamp.atmosphere): - layout.row() + if lamp.sky or lamp.atmosphere: layout.itemR(lamp, "atmosphere_turbidity", text="Turbidity") - layout.split(number=2) + split = layout.split() - if (lamp.sky): - sub = layout.sub(0) - sub.column() + col = split.column() + if lamp.sky: + sub = col.column() sub.itemR(lamp, "sky_blend_type", text="Blend Type") sub.itemR(lamp, "sky_blend") sub.itemR(lamp, "sky_color_space", text="Color Space") sub.itemR(lamp, "sky_exposure") - sub.column() + sub = col.column() sub.itemR(lamp, "horizon_brightness", text="Hor Bright") sub.itemR(lamp, "spread", text="Hor Spread") sub.itemR(lamp, "sun_brightness", text="Sun Bright") sub.itemR(lamp, "sun_size") sub.itemR(lamp, "backscattered_light", text="Back Light") - if (lamp.atmosphere): - sub = layout.sub(1) - sub.column() + sub = split.column() + if lamp.atmosphere: sub.itemR(lamp, "sun_intensity", text="Sun Intens") sub.itemR(lamp, "atmosphere_inscattering", text="Inscattering") sub.itemR(lamp, "atmosphere_extinction", text="Extinction") @@ -122,75 +117,71 @@ class DATA_PT_shadow(DataButtonsPanel): if not lamp: return - layout.row() layout.itemR(lamp, "shadow_method", expand=True) - if (lamp.shadow_method in ('BUFFER_SHADOW', 'RAY_SHADOW')): + if lamp.shadow_method in ('BUFFER_SHADOW', 'RAY_SHADOW'): - layout.split(number=2) + split = layout.split() - sub = layout.sub(0) - sub.column() - sub.itemL(text="Options:") + sub = split.column() sub.itemR(lamp, "only_shadow") sub.itemR(lamp, "shadow_layer") - sub = layout.sub(1) - sub.column() + sub = split.column() sub.itemR(lamp, "shadow_color") - if (lamp.shadow_method == 'RAY_SHADOW'): + if lamp.shadow_method == 'RAY_SHADOW': - layout.column() - layout.itemL(text="Sampling:") - layout.itemR(lamp, "shadow_ray_sampling_method", expand=True) + col = layout.column() + col.itemL(text="Sampling:") + col.row().itemR(lamp, "shadow_ray_sampling_method", expand=True) - if (lamp.type in ('POINT', 'SUN', 'SPOT') and lamp.shadow_ray_sampling_method in ('CONSTANT_QMC', 'ADAPTIVE_QMC')): - layout.column_flow() - layout.itemR(lamp, "shadow_soft_size", text="Soft Size") - layout.itemR(lamp, "shadow_ray_samples", text="Samples") - if (lamp.shadow_ray_sampling_method == 'ADAPTIVE_QMC'): - layout.itemR(lamp, "shadow_adaptive_threshold", text="Threshold") + if lamp.type in ('POINT', 'SUN', 'SPOT') and lamp.shadow_ray_sampling_method in ('CONSTANT_QMC', 'ADAPTIVE_QMC'): + flow = layout.column_flow() + flow.itemR(lamp, "shadow_soft_size", text="Soft Size") + flow.itemR(lamp, "shadow_ray_samples", text="Samples") + if lamp.shadow_ray_sampling_method == 'ADAPTIVE_QMC': + flow.itemR(lamp, "shadow_adaptive_threshold", text="Threshold") - if (lamp.type == 'AREA'): - layout.column_flow() - layout.itemR(lamp, "shadow_ray_samples_x", text="Samples") - if (lamp.shadow_ray_sampling_method == 'ADAPTIVE_QMC'): - layout.itemR(lamp, "shadow_adaptive_threshold", text="Threshold") - if (lamp.shadow_ray_sampling_method == 'CONSTANT_JITTERED'): - layout.itemR(lamp, "umbra") - layout.itemR(lamp, "dither") - layout.itemR(lamp, "jitter") - - if (lamp.shadow_method == 'BUFFER_SHADOW'): - layout.column() - layout.itemL(text="Buffer Type:") - layout.itemR(lamp, "shadow_buffer_type", expand=True) + if lamp.type == 'AREA': + flow = layout.column_flow() + flow.itemR(lamp, "shadow_ray_samples_x", text="Samples") + if lamp.shadow_ray_sampling_method == 'ADAPTIVE_QMC': + flow.itemR(lamp, "shadow_adaptive_threshold", text="Threshold") + if lamp.shadow_ray_sampling_method == 'CONSTANT_JITTERED': + flow.itemR(lamp, "umbra") + flow.itemR(lamp, "dither") + flow.itemR(lamp, "jitter") + + if lamp.shadow_method == 'BUFFER_SHADOW': + col = layout.column() + col.itemL(text="Buffer Type:") + col.row().itemR(lamp, "shadow_buffer_type", expand=True) - if (lamp.shadow_buffer_type in ('REGULAR', 'HALFWAY')): - layout.column_flow() - layout.itemL(text="Sample Buffers:") - layout.itemR(lamp, "shadow_sample_buffers", expand=True) - layout.itemL(text="Filter Type:") - layout.itemR(lamp, "shadow_filter_type", expand=True) - layout.column_flow() - layout.itemR(lamp, "shadow_buffer_size", text="Size") - layout.itemR(lamp, "shadow_buffer_samples", text="Samples") - layout.itemR(lamp, "shadow_buffer_bias", text="Bias") - layout.itemR(lamp, "shadow_buffer_soft", text="Soft") + if lamp.shadow_buffer_type in ('REGULAR', 'HALFWAY'): + flow = layout.column_flow() + flow.itemL(text="Sample Buffers:") + flow.row().itemR(lamp, "shadow_sample_buffers", expand=True) + flow.itemL(text="Filter Type:") + flow.row().itemR(lamp, "shadow_filter_type", expand=True) + flow = layout.column_flow() + flow.itemR(lamp, "shadow_buffer_size", text="Size") + flow.itemR(lamp, "shadow_buffer_samples", text="Samples") + flow.itemR(lamp, "shadow_buffer_bias", text="Bias") + flow.itemR(lamp, "shadow_buffer_soft", text="Soft") if (lamp.shadow_buffer_type == 'IRREGULAR'): - layout.row() - layout.itemR(lamp, "shadow_buffer_bias", text="Bias") + row = layout.row() + row.itemR(lamp, "shadow_buffer_bias", text="Bias") - layout.row() - layout.itemR(lamp, "auto_clip_start", text="Autoclip Start") + row = layout.row() + row.itemR(lamp, "auto_clip_start", text="Autoclip Start") if not (lamp.auto_clip_start): - layout.itemR(lamp, "shadow_buffer_clip_start", text="Clip Start") - layout.row() - layout.itemR(lamp, "auto_clip_end", text="Autoclip End") + row.itemR(lamp, "shadow_buffer_clip_start", text="Clip Start") + row = layout.row() + row.itemR(lamp, "auto_clip_end", text="Autoclip End") if not (lamp.auto_clip_end): - layout.itemR(lamp, "shadow_buffer_clip_end", text=" Clip End") + row.itemR(lamp, "shadow_buffer_clip_end", text=" Clip End") class DATA_PT_spot(DataButtonsPanel): __idname__ = "DATA_PT_spot" @@ -208,20 +199,18 @@ class DATA_PT_spot(DataButtonsPanel): if not lamp: return - layout.split(number=2) + split = layout.split() - sub = layout.sub(0) - sub.column() + sub = split.column() sub.itemR(lamp, "square") sub.itemR(lamp, "spot_size") sub.itemR(lamp, "spot_blend") - sub = layout.sub(1) - sub.column() + sub = split.column() sub.itemR(lamp, "halo") - if (lamp.halo): + if lamp.halo: sub.itemR(lamp, "halo_intensity") - if (lamp.shadow_method == 'BUFFER_SHADOW'): + if lamp.shadow_method == 'BUFFER_SHADOW': sub.itemR(lamp, "halo_step") bpy.types.register(DATA_PT_lamp) diff --git a/release/ui/buttons_data_lattice.py b/release/ui/buttons_data_lattice.py index cf2053ae495..0446f3916a1 100644 --- a/release/ui/buttons_data_lattice.py +++ b/release/ui/buttons_data_lattice.py @@ -21,20 +21,20 @@ class DATA_PT_lattice(DataButtonsPanel): if not lat: return - layout.row() - layout.itemR(lat, "points_u") - layout.itemR(lat, "interpolation_type_u", expand=True) + row = layout.row() + row.itemR(lat, "points_u") + row.itemR(lat, "interpolation_type_u", expand=True) - layout.row() - layout.itemR(lat, "points_v") - layout.itemR(lat, "interpolation_type_v", expand=True) + row = layout.row() + row.itemR(lat, "points_v") + row.itemR(lat, "interpolation_type_v", expand=True) - layout.row() - layout.itemR(lat, "points_w") - layout.itemR(lat, "interpolation_type_w", expand=True) + row = layout.row() + row.itemR(lat, "points_w") + row.itemR(lat, "interpolation_type_w", expand=True) - layout.row() - layout.itemR(lat, "outside") - layout.itemR(lat, "shape_keys") + row = layout.row() + row.itemR(lat, "outside") + row.itemR(lat, "shape_keys") -bpy.types.register(DATA_PT_lattice)
\ No newline at end of file +bpy.types.register(DATA_PT_lattice) diff --git a/release/ui/buttons_data_modifier.py b/release/ui/buttons_data_modifier.py index f07a6cc4882..b93f0d6f218 100644 --- a/release/ui/buttons_data_modifier.py +++ b/release/ui/buttons_data_modifier.py @@ -27,34 +27,32 @@ class DATA_PT_modifiers(DataButtonsPanel): for md in ob.modifiers: sub = layout.box() - sub.row() - sub.itemR(md, "expanded", text="") - sub.itemR(md, "name", text="") + row = sub.row() + row.itemR(md, "expanded", text="") + row.itemR(md, "name", text="") - sub.itemR(md, "render", text="") - sub.itemR(md, "realtime", text="") - sub.itemR(md, "editmode", text="") - sub.itemR(md, "on_cage", text="") + row.itemR(md, "render", text="") + row.itemR(md, "realtime", text="") + row.itemR(md, "editmode", text="") + row.itemR(md, "on_cage", text="") - if (md.expanded): - sub.row() + if md.expanded: sub.itemS() if (md.type == 'ARMATURE'): self.armature(sub, md) def armature(self, layout, md): - layout.column() layout.itemR(md, "object") - layout.row() - layout.itemR(md, "vertex_group") - layout.itemR(md, "invert") - layout.column_flow() - layout.itemR(md, "use_vertex_groups") - layout.itemR(md, "use_bone_envelopes") - layout.itemR(md, "quaternion") - layout.itemR(md, "b_bone_rest") - layout.itemR(md, "multi_modifier") + row = layout.row() + row.itemR(md, "vertex_group") + row.itemR(md, "invert") + flow = layout.column_flow() + flow.itemR(md, "use_vertex_groups") + flow.itemR(md, "use_bone_envelopes") + flow.itemR(md, "quaternion") + flow.itemR(md, "b_bone_rest") + flow.itemR(md, "multi_modifier") bpy.types.register(DATA_PT_modifiers) diff --git a/release/ui/buttons_material.py b/release/ui/buttons_material.py index cf857469eb3..a80ae8d4624 100644 --- a/release/ui/buttons_material.py +++ b/release/ui/buttons_material.py @@ -20,20 +20,15 @@ class MATERIAL_PT_material(MaterialButtonsPanel): if not mat: return - layout.row() - layout.itemR(mat, "diffuse_color") - layout.itemR(mat, "specular_color") - layout.itemR(mat, "mirror_color") - - layout.row() - layout.itemR(mat, "color_model") - layout.itemR(mat, "alpha") - - halo = context.active_object.active_material.halo - - layout.row() - layout.itemR(halo, "enabled", text="Enable Halo") - + row = layout.row() + row.column().itemR(mat, "diffuse_color") + row.column().itemR(mat, "specular_color") + row.column().itemR(mat, "mirror_color") + + row = layout.row() + row.itemR(mat, "color_model") + row.itemR(mat, "alpha") + class MATERIAL_PT_sss(MaterialButtonsPanel): __idname__= "MATERIAL_PT_sss" __label__ = "Subsurface Scattering" @@ -48,23 +43,22 @@ class MATERIAL_PT_sss(MaterialButtonsPanel): if not sss: return - layout.row() layout.itemR(sss, "enabled", text="Enable") - layout.column_flow() - layout.itemR(sss, "error_tolerance") - layout.itemR(sss, "ior") - layout.itemR(sss, "scale") + flow = layout.column_flow() + flow.itemR(sss, "error_tolerance") + flow.itemR(sss, "ior") + flow.itemR(sss, "scale") - layout.row() - layout.itemR(sss, "color") - layout.itemR(sss, "radius") + row = layout.row() + row.column().itemR(sss, "color") + row.column().itemR(sss, "radius") - layout.column_flow() - layout.itemR(sss, "color_factor") - layout.itemR(sss, "texture_factor") - layout.itemR(sss, "front") - layout.itemR(sss, "back") + flow = layout.column_flow() + flow.itemR(sss, "color_factor") + flow.itemR(sss, "texture_factor") + flow.itemR(sss, "front") + flow.itemR(sss, "back") class MATERIAL_PT_raymir(MaterialButtonsPanel): __idname__= "MATERIAL_PT_raymir" @@ -80,28 +74,25 @@ class MATERIAL_PT_raymir(MaterialButtonsPanel): if not raym: return - layout.row() layout.itemR(raym, "enabled", text="Enable") - layout.split(number=2) + split = layout.split() - sub = layout.sub(0) - sub.column_flow() + sub = split.column() sub.itemR(raym, "reflect", text="RayMir") sub.itemR(raym, "fresnel") sub.itemR(raym, "fresnel_fac", text="Fac") - sub = layout.sub(1) - sub.column_flow() + sub = split.column() sub.itemR(raym, "gloss") sub.itemR(raym, "gloss_threshold") sub.itemR(raym, "gloss_samples") sub.itemR(raym, "gloss_anisotropic") - layout.column_flow() - layout.itemR(raym, "distance", text="Max Dist") - layout.itemR(raym, "depth") - layout.itemR(raym, "fade_to") + flow = layout.column_flow() + flow.itemR(raym, "distance", text="Max Dist") + flow.itemR(raym, "depth") + flow.itemR(raym, "fade_to") class MATERIAL_PT_raytransp(MaterialButtonsPanel): __idname__= "MATERIAL_PT_raytransp" @@ -117,39 +108,31 @@ class MATERIAL_PT_raytransp(MaterialButtonsPanel): if not rayt: return - layout.row() layout.itemR(rayt, "enabled", text="Enable") - layout.split(number=2) + split = layout.split() - sub = layout.sub(0) - sub.column() + sub = split.column() sub.itemR(rayt, "ior") sub.itemR(rayt, "fresnel") sub.itemR(rayt, "fresnel_fac", text="Fac") - sub = layout.sub(1) - sub.column() + sub = split.column() sub.itemR(rayt, "gloss") sub.itemR(rayt, "gloss_threshold") sub.itemR(rayt, "gloss_samples") - layout.column_flow() - layout.itemR(rayt, "filter") - layout.itemR(rayt, "limit") - layout.itemR(rayt, "falloff") - layout.itemR(rayt, "specular_opacity") - layout.itemR(rayt, "depth") + flow = layout.column_flow() + flow.itemR(rayt, "filter") + flow.itemR(rayt, "limit") + flow.itemR(rayt, "falloff") + flow.itemR(rayt, "specular_opacity") + flow.itemR(rayt, "depth") class MATERIAL_PT_halo(MaterialButtonsPanel): __idname__= "MATERIAL_PT_halo" __label__= "Halo" - def poll(self, context): - ob = context.active_object - halo = context.active_object.active_material.halo - return (ob and halo.enabled) - def draw(self, context): layout = self.layout try: @@ -159,55 +142,55 @@ class MATERIAL_PT_halo(MaterialButtonsPanel): if not halo: return - - layout.split(number=2) - - sub = layout.sub(0) - sub.column() - sub.itemL(text="General Settings:") - sub.itemR(halo, "size") - sub.itemR(halo, "hardness") - sub.itemR(halo, "add") - - sub = layout.sub(1) - sub.column() - sub.itemL(text="Elements:") - sub.itemR(halo, "ring") - sub.itemR(halo, "lines") - sub.itemR(halo, "star") - sub.itemR(halo, "flare_mode") - - layout.split(number=2) - - sub = layout.sub(0) - sub.column() - sub.itemL(text="Options:") - sub.itemR(halo, "use_texture", text="Texture") - sub.itemR(halo, "use_vertex_normal", text="Vertex Normal") - sub.itemR(halo, "xalpha") - sub.itemR(halo, "shaded") - sub.itemR(halo, "soft") - sub = layout.sub(1) - sub.column() - if (halo.ring): - sub.itemR(halo, "rings") - if (halo.lines): - sub.itemR(halo, "line_number") - if (halo.ring or halo.lines): - sub.itemR(halo, "seed") - if (halo.star): - sub.itemR(halo, "star_tips") - if (halo.flare_mode): - sub.itemL(text="Flare:") - 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.itemR(halo, "enabled", text="Enable Halo") + + if halo.enabled: + + split = layout.split() + + sub = split.column() + sub.itemL(text="General Settings:") + sub.itemR(halo, "size") + sub.itemR(halo, "hardness") + sub.itemR(halo, "add") + + sub = split.column() + sub.itemL(text="Elements:") + sub.itemR(halo, "ring") + sub.itemR(halo, "lines") + sub.itemR(halo, "star") + sub.itemR(halo, "flare_mode") + + row = layout.row() + sub = row.column() + sub.itemL(text="Options:") + sub.itemR(halo, "use_texture", text="Texture") + sub.itemR(halo, "use_vertex_normal", text="Vertex Normal") + sub.itemR(halo, "xalpha") + sub.itemR(halo, "shaded") + sub.itemR(halo, "soft") + + sub = row.column() + if (halo.ring): + sub.itemR(halo, "rings") + if (halo.lines): + sub.itemR(halo, "line_number") + if (halo.ring or halo.lines): + sub.itemR(halo, "seed") + if (halo.star): + sub.itemR(halo, "star_tips") + if (halo.flare_mode): + sub.itemL(text="Flare:") + 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") + bpy.types.register(MATERIAL_PT_material) bpy.types.register(MATERIAL_PT_raymir) bpy.types.register(MATERIAL_PT_raytransp) bpy.types.register(MATERIAL_PT_sss) -bpy.types.register(MATERIAL_PT_halo)
\ No newline at end of file +bpy.types.register(MATERIAL_PT_halo) diff --git a/release/ui/buttons_objects.py b/release/ui/buttons_objects.py index 8e76bf50837..816995be224 100644 --- a/release/ui/buttons_objects.py +++ b/release/ui/buttons_objects.py @@ -17,10 +17,10 @@ class OBJECT_PT_transform(ObjectButtonsPanel): ob = context.active_object layout = self.layout - layout.row() - layout.itemR(ob, "location") - layout.itemR(ob, "rotation") - layout.itemR(ob, "scale") + row = layout.row() + row.column().itemR(ob, "location") + row.column().itemR(ob, "rotation") + row.column().itemR(ob, "scale") class OBJECT_PT_groups(ObjectButtonsPanel): __idname__ = "OBJECT_PT_groups" @@ -30,24 +30,24 @@ class OBJECT_PT_groups(ObjectButtonsPanel): ob = context.active_object layout = self.layout - layout.row() - layout.itemR(ob, "pass_index") - layout.itemR(ob, "parent") + row = layout.row() + row.itemR(ob, "pass_index") + row.itemR(ob, "parent") # layout.left_right() # layout.itemO("OBJECT_OT_add_group"); for group in bpy.data.groups: if ob in group.objects: - sub = layout.box() + box = layout.box() - sub.split(number=2, lr=True) - sub.sub(0).itemR(group, "name") - # sub.sub(1).itemO("OBJECT_OT_remove_group") + row = box.row() + row.itemR(group, "name") + #row.itemO("OBJECT_OT_remove_group") - sub.row() - sub.itemR(group, "layer") - sub.itemR(group, "dupli_offset") + row = box.row() + row.column().itemR(group, "layer") + row.column().itemR(group, "dupli_offset") class OBJECT_PT_display(ObjectButtonsPanel): __idname__ = "OBJECT_PT_display" @@ -57,17 +57,17 @@ class OBJECT_PT_display(ObjectButtonsPanel): ob = context.active_object layout = self.layout - layout.row() - layout.itemR(ob, "max_draw_type", text="Type") - layout.itemR(ob, "draw_bounds_type", text="Bounds") - - layout.column_flow() - layout.itemR(ob, "draw_name", text="Name") - layout.itemR(ob, "draw_axis", text="Axis") - layout.itemR(ob, "draw_wire", text="Wire") - layout.itemR(ob, "draw_texture_space", text="Texture Space") - layout.itemR(ob, "x_ray", text="X-Ray") - layout.itemR(ob, "draw_transparent", text="Transparency") + row = layout.row() + row.itemR(ob, "max_draw_type", text="Type") + row.itemR(ob, "draw_bounds_type", text="Bounds") + + flow = layout.column_flow() + flow.itemR(ob, "draw_name", text="Name") + flow.itemR(ob, "draw_axis", text="Axis") + flow.itemR(ob, "draw_wire", text="Wire") + flow.itemR(ob, "draw_texture_space", text="Texture Space") + flow.itemR(ob, "x_ray", text="X-Ray") + flow.itemR(ob, "draw_transparent", text="Transparency") class OBJECT_PT_duplication(ObjectButtonsPanel): __idname__ = "OBJECT_PT_duplication" @@ -77,15 +77,15 @@ class OBJECT_PT_duplication(ObjectButtonsPanel): ob = context.active_object layout = self.layout - layout.column() - layout.itemR(ob, "dupli_type", text="", expand=True) + row = layout.row() + row.itemR(ob, "dupli_type", text="", expand=True) if ob.dupli_type == "FRAMES": - layout.column_flow() - layout.itemR(ob, "dupli_frames_start", text="Start") - layout.itemR(ob, "dupli_frames_end", text="End") - layout.itemR(ob, "dupli_frames_on", text="On") - layout.itemR(ob, "dupli_frames_off", text="Off") + col = layout.column_flow() + col.itemR(ob, "dupli_frames_start", text="Start") + col.itemR(ob, "dupli_frames_end", text="End") + col.itemR(ob, "dupli_frames_on", text="On") + col.itemR(ob, "dupli_frames_off", text="Off") class OBJECT_PT_animation(ObjectButtonsPanel): __idname__ = "OBJECT_PT_animation" @@ -95,10 +95,9 @@ class OBJECT_PT_animation(ObjectButtonsPanel): ob = context.active_object layout = self.layout - layout.split(number=2) + row = layout.row() - sub = layout.sub(0) - sub.column() + sub = row.column() sub.itemL(text="Time Offset:") sub.itemR(ob, "time_offset_edit", text="Edit") sub.itemR(ob, "time_offset_particle", text="Particle") @@ -106,8 +105,7 @@ class OBJECT_PT_animation(ObjectButtonsPanel): sub.itemR(ob, "slow_parent") sub.itemR(ob, "time_offset", text="Offset") - sub = layout.sub(1) - sub.column() + sub = row.column() sub.itemL(text="Tracking:") sub.itemR(ob, "track_axis", text="Axis") sub.itemR(ob, "up_axis", text="Up Axis") diff --git a/release/ui/buttons_scene.py b/release/ui/buttons_scene.py index 1f4fa1109a4..170c94cdef1 100644 --- a/release/ui/buttons_scene.py +++ b/release/ui/buttons_scene.py @@ -15,22 +15,19 @@ class RENDER_PT_shading(RenderButtonsPanel): rd = scene.render_data - layout.split(number=2) + split = layout.split() - sub = layout.sub(0) - sub.column() + sub = split.column() sub.itemR(rd, "render_shadows", text="Shadows") sub.itemR(rd, "render_sss", text="SSS") sub.itemR(rd, "render_envmaps", text="EnvMap") sub.itemR(rd, "render_radiosity", text="Radio") - sub = layout.sub(1) + sub = split.column() subsub = sub.box() - subsub.column() subsub.itemR(rd, "render_raytracing", text="Ray Tracing") if (rd.render_raytracing): subsub.itemR(rd, "octree_resolution", text="Octree") - sub.row() sub.itemR(rd, "alpha_mode") class RENDER_PT_image(RenderButtonsPanel): @@ -42,21 +39,21 @@ class RENDER_PT_image(RenderButtonsPanel): rd = scene.render_data - layout.column_flow() - layout.itemR(rd, "resolution_x", text="SizeX") - layout.itemR(rd, "resolution_y", text="SizeY") - layout.itemR(rd, "pixel_aspect_x", text="AspX") - layout.itemR(rd, "pixel_aspect_y", text="AspY") - - sub = layout.box() - sub.row() - sub.itemR(rd, "image_type") - sub.row() - sub.itemR(rd, "file_extensions") - sub.itemR(rd, "color_mode") + flow = layout.column_flow() + flow.itemR(rd, "resolution_x", text="SizeX") + flow.itemR(rd, "resolution_y", text="SizeY") + flow.itemR(rd, "pixel_aspect_x", text="AspX") + flow.itemR(rd, "pixel_aspect_y", text="AspY") + + box = layout.box() + box.itemR(rd, "output_path") + box.itemR(rd, "image_type") + row = box.row() + row.itemR(rd, "file_extensions") + row.itemR(rd, "color_mode") if rd.image_type in ("AVIJPEG", "JPEG"): - sub.row() - sub.itemR(rd, "quality") + row = box.row() + row.itemR(rd, "quality") class RENDER_PT_antialiasing(RenderButtonsPanel): __label__ = "Anti-Aliasing" @@ -67,20 +64,21 @@ class RENDER_PT_antialiasing(RenderButtonsPanel): rd = scene.render_data - layout.row() - layout.itemR(rd, "antialiasing", text="Enable") - if (rd.antialiasing): - layout.row() - layout.itemL(text="Samples:") - layout.itemR(rd, "antialiasing_samples", expand=True) - layout.row() - layout.itemR(rd, "pixel_filter") - layout.itemR(rd, "filter_size") - - layout.row() - layout.itemR(rd, "save_buffers") - if (rd.save_buffers): - layout.itemR(rd, "full_sample") + row = layout.row() + row.itemR(rd, "antialiasing", text="Enable") + + if rd.antialiasing: + row = layout.row() + row.itemL(text="Samples:") + row.itemR(rd, "antialiasing_samples", expand=True) + row = layout.row() + row.itemR(rd, "pixel_filter") + row.itemR(rd, "filter_size") + + row = layout.row() + row.itemR(rd, "save_buffers") + if rd.save_buffers: + row.itemR(rd, "full_sample") class RENDER_PT_render(RenderButtonsPanel): __label__ = "Render" @@ -91,71 +89,67 @@ class RENDER_PT_render(RenderButtonsPanel): rd = scene.render_data - layout.row() - layout.itemO("SCREEN_OT_render", text="RENDER", icon=0) # ICON_SCENE - layout.item_booleanO("SCREEN_OT_render", 'anim', True, text="ANIM", icon=0) + row = layout.row() + row.itemO("SCREEN_OT_render", text="RENDER", icon=0) # ICON_SCENE + row.item_booleanO("SCREEN_OT_render", "anim", True, text="ANIM", icon=0) - layout.row() - layout.itemR(scene, "start_frame", text="Start") - layout.itemR(rd, "fps") - layout.itemR(scene, "current_frame", text="Frame") + row = layout.row() + row.itemR(scene, "start_frame", text="Start") + row.itemR(rd, "fps") + row.itemR(scene, "current_frame", text="Frame") - layout.row() - layout.itemR(scene, "end_frame", text="End") - layout.itemR(rd, "fps_base",text="/") - layout.itemR(scene, "frame_step", text="Step") - - layout.row() - layout.itemR(rd, "do_composite") - layout.itemR(rd, "do_sequence") - - layout.row() - layout.itemL(text="General:") - - layout.column_flow() - layout.itemR(rd, "resolution_percentage", text="Size ") - layout.itemR(rd, "dither_intensity") - layout.itemR(rd, "parts_x") - layout.itemR(rd, "parts_y") + row = layout.row() + row.itemR(scene, "end_frame", text="End") + row.itemR(rd, "fps_base",text="/") + row.itemR(scene, "frame_step", text="Step") + + row = layout.row() + row.itemR(rd, "do_composite") + row.itemR(rd, "do_sequence") + + row = layout.row() + row.itemL(text="General:") + + flow = layout.column_flow() + flow.itemR(rd, "resolution_percentage", text="Size ") + flow.itemR(rd, "dither_intensity") + flow.itemR(rd, "parts_x") + flow.itemR(rd, "parts_y") - layout.split(number=2) + split = layout.split() - sub = layout.sub(0) + sub = split.column() subsub = sub.box() - subsub.column() subsub.itemL(text="Threads Mode:") subsub.itemR(rd, "threads_mode", expand=True) if rd.threads_mode == 'THREADS_FIXED': subsub.itemR(rd, "threads") subsub = sub.box() - subsub.column() subsub.itemL(text="Distributed Rendering:") subsub.itemR(rd, "placeholders") subsub.itemR(rd, "no_overwrite") subsub = sub.box() - subsub.column() subsub.itemR(rd, "fields", text="Fields") - if (rd.fields): + if rd.fields: subsub.itemR(rd, "fields_still", text="Still") subsub.itemR(rd, "field_order", text="Order") - sub = layout.sub(1) + sub = split.column() subsub = sub.box() - subsub.column() subsub.itemL(text="Extra:") subsub.itemR(rd, "panorama") subsub.itemR(rd, "backbuf") subsub.itemR(rd, "free_image_textures") subsub = sub.box() - subsub.column() subsub.itemL(text="Border:") subsub.itemR(rd, "border", text="Border Render") - if (rd.border): + if rd.border: subsub.itemR(rd, "crop_to_border") bpy.types.register(RENDER_PT_render) bpy.types.register(RENDER_PT_antialiasing) bpy.types.register(RENDER_PT_shading) bpy.types.register(RENDER_PT_image) + diff --git a/release/ui/buttons_world.py b/release/ui/buttons_world.py index 44ce472bf5d..124c9d3d766 100644 --- a/release/ui/buttons_world.py +++ b/release/ui/buttons_world.py @@ -16,15 +16,15 @@ class WORLD_PT_world(WorldButtonsPanel): world = context.scene.world layout = self.layout - layout.row() - layout.itemR(world, "blend_sky") - layout.itemR(world, "paper_sky") - layout.itemR(world, "real_sky") + row = layout.row() + row.itemR(world, "blend_sky") + row.itemR(world, "paper_sky") + row.itemR(world, "real_sky") - layout.row() - layout.itemR(world, "horizon_color") - layout.itemR(world, "zenith_color") - layout.itemR(world, "ambient_color") + row = layout.row() + row.column().itemR(world, "horizon_color") + row.column().itemR(world, "zenith_color") + row.column().itemR(world, "ambient_color") class WORLD_PT_color_correction(WorldButtonsPanel): __label__ = "Color Correction" @@ -33,9 +33,9 @@ class WORLD_PT_color_correction(WorldButtonsPanel): world = context.scene.world layout = self.layout - layout.row() - layout.itemR(world, "exposure") - layout.itemR(world, "range") + row = layout.row() + row.itemR(world, "exposure") + row.itemR(world, "range") class WORLD_PT_mist(WorldButtonsPanel): __label__ = "Mist" @@ -44,18 +44,18 @@ class WORLD_PT_mist(WorldButtonsPanel): world = context.scene.world layout = self.layout - layout.row() - layout.itemR(world.mist, "enabled", text="Enable") + row = layout.row() + row.itemR(world.mist, "enabled", text="Enable") if (world.mist.enabled): - layout.column_flow() - layout.itemR(world.mist, "start") - layout.itemR(world.mist, "depth") - layout.itemR(world.mist, "height") - layout.itemR(world.mist, "intensity") - layout.column() - layout.itemL(text="Fallof:") - layout.itemR(world.mist, "falloff", expand=True) + flow = layout.column_flow() + flow.itemR(world.mist, "start") + flow.itemR(world.mist, "depth") + flow.itemR(world.mist, "height") + flow.itemR(world.mist, "intensity") + col = layout.column() + col.itemL(text="Fallof:") + col.row().itemR(world.mist, "falloff", expand=True) class WORLD_PT_stars(WorldButtonsPanel): __label__ = "Stars" @@ -64,15 +64,15 @@ class WORLD_PT_stars(WorldButtonsPanel): world = context.scene.world layout = self.layout - layout.row() - layout.itemR(world.stars, "enabled", text="Enable") + row = layout.row() + row.itemR(world.stars, "enabled", text="Enable") if (world.stars.enabled): - layout.column_flow() - layout.itemR(world.stars, "size") - layout.itemR(world.stars, "min_distance", text="MinDist") - layout.itemR(world.stars, "average_separation", text="StarDist") - layout.itemR(world.stars, "color_randomization", text="Colnoise") + flow = layout.column_flow() + flow.itemR(world.stars, "size") + flow.itemR(world.stars, "min_distance", text="MinDist") + flow.itemR(world.stars, "average_separation", text="StarDist") + flow.itemR(world.stars, "color_randomization", text="Colnoise") class WORLD_PT_ambient_occlusion(WorldButtonsPanel): __label__ = "Ambient Occlusion" @@ -83,49 +83,49 @@ class WORLD_PT_ambient_occlusion(WorldButtonsPanel): ao = world.ambient_occlusion - layout.row() - layout.itemR(ao, "enabled", text="Enable") + row = layout.row() + row.itemR(ao, "enabled", text="Enable") if (ao.enabled): - layout.row() - layout.itemR(ao, "gather_method", expand=True) + row = layout.row() + row.itemR(ao, "gather_method", expand=True) if ao.gather_method == 'RAYTRACE': - layout.row() - layout.itemR(ao, "samples") - layout.itemR(ao, "distance") + row = layout.row() + row.itemR(ao, "samples") + row.itemR(ao, "distance") - layout.row() - layout.itemR(ao, "sample_method") + row = layout.row() + row.itemR(ao, "sample_method") if ao.sample_method == 'ADAPTIVE_QMC': - layout.row() - layout.itemR(ao, "threshold") - layout.itemR(ao, "adapt_to_speed") + row = layout.row() + row.itemR(ao, "threshold") + row.itemR(ao, "adapt_to_speed") if ao.sample_method == 'CONSTANT_JITTERED': - layout.row() - layout.itemR(ao, "bias") + row = layout.row() + row.itemR(ao, "bias") if ao.gather_method == 'APPROXIMATE': - layout.row() - layout.itemR(ao, "passes") - layout.itemR(ao, "error_tolerance") + row = layout.row() + row.itemR(ao, "passes") + row.itemR(ao, "error_tolerance") - layout.row() - layout.itemR(ao, "correction") - layout.itemR(ao, "pixel_cache") + row = layout.row() + row.itemR(ao, "correction") + row.itemR(ao, "pixel_cache") - layout.row() - layout.itemS() + row = layout.row() + row.itemS() - layout.row() - layout.itemR(ao, "falloff") - layout.itemR(ao, "strength") + row = layout.row() + row.itemR(ao, "falloff") + row.itemR(ao, "strength") - layout.column() - layout.itemR(ao, "blend_mode", expand=True) - layout.itemR(ao, "color", expand=True) - layout.itemR(ao, "energy") + col = layout.column() + col.row().itemR(ao, "blend_mode", expand=True) + col.row().itemR(ao, "color", expand=True) + col.itemR(ao, "energy") bpy.types.register(WORLD_PT_world) bpy.types.register(WORLD_PT_mist) diff --git a/release/ui/space_text.py b/release/ui/space_text.py index a3d27370ffa..d4187c10b69 100644 --- a/release/ui/space_text.py +++ b/release/ui/space_text.py @@ -18,38 +18,40 @@ class TEXT_HT_header(bpy.types.Header): text = st.text layout = self.layout - layout.template_header() - layout.itemM("TEXT_MT_text") - if text: - layout.itemM("TEXT_MT_edit") - layout.itemM("TEXT_MT_format") + layout.template_header(context) + + if context.area.show_menus: + row = layout.row(align=True) + row.itemM(context, "TEXT_MT_text") + if text: + row.itemM(context, "TEXT_MT_edit") + row.itemM(context, "TEXT_MT_format") if text and text.modified: - layout.row() - # layout.color(redalert) - layout.itemO("TEXT_OT_resolve_conflict", text="", icon=ICON_HELP) + row = layout.row() + # row.color(redalert) + row.itemO("TEXT_OT_resolve_conflict", text="", icon=ICON_HELP) - layout.row() - layout.itemR(st, "line_numbers", text="", icon=ICON_LINENUMBERS_OFF) - layout.itemR(st, "word_wrap", text="", icon=ICON_WORDWRAP_OFF) - layout.itemR(st, "syntax_highlight", text="", icon=ICON_SYNTAX_OFF) - # layout.itemR(st, "do_python_plugins", text="", icon=ICON_SCRIPTPLUGINS) + row = layout.row(align=True) + row.itemR(st, "line_numbers", text="", icon=ICON_LINENUMBERS_OFF) + row.itemR(st, "word_wrap", text="", icon=ICON_WORDWRAP_OFF) + row.itemR(st, "syntax_highlight", text="", icon=ICON_SYNTAX_OFF) + # row.itemR(st, "do_python_plugins", text="", icon=ICON_SCRIPTPLUGINS) - layout.row() - layout.template_header_ID(st, "text", new="TEXT_OT_new", open="TEXT_OT_open", unlink="TEXT_OT_unlink") + layout.template_header_ID(context, st, "text", new="TEXT_OT_new", open="TEXT_OT_open", unlink="TEXT_OT_unlink") if text: - layout.row() + row = layout.row() if text.filename != "": if text.dirty: - layout.itemL(text="File: *" + text.filename + " (unsaved)") + row.itemL(text="File: *" + text.filename + " (unsaved)") else: - layout.itemL(text="File: " + text.filename) + row.itemL(text="File: " + text.filename) else: if text.library: - layout.itemL(text="Text: External") + row.itemL(text="Text: External") else: - layout.itemL(text="Text: Internal") + row.itemL(text="Text: Internal") class TEXT_PT_properties(bpy.types.Panel): __space_type__ = "TEXT_EDITOR" @@ -60,14 +62,14 @@ class TEXT_PT_properties(bpy.types.Panel): st = context.space_data layout = self.layout - layout.column_flow() - layout.itemR(st, "line_numbers", icon=ICON_LINENUMBERS_OFF) - layout.itemR(st, "word_wrap", icon=ICON_WORDWRAP_OFF) - layout.itemR(st, "syntax_highlight", icon=ICON_SYNTAX_OFF) + flow = layout.column_flow() + flow.itemR(st, "line_numbers", icon=ICON_LINENUMBERS_OFF) + flow.itemR(st, "word_wrap", icon=ICON_WORDWRAP_OFF) + flow.itemR(st, "syntax_highlight", icon=ICON_SYNTAX_OFF) - layout.column_flow() - layout.itemR(st, "font_size") - layout.itemR(st, "tab_width") + flow = layout.column_flow() + flow.itemR(st, "font_size") + flow.itemR(st, "tab_width") class TEXT_PT_find(bpy.types.Panel): __space_type__ = "TEXT_EDITOR" @@ -79,27 +81,26 @@ class TEXT_PT_find(bpy.types.Panel): layout = self.layout # find - layout.row() - layout.itemR(st, "find_text", text="") - layout.itemO("TEXT_OT_find_set_selected", text="", icon=ICON_TEXT) - layout.column() - layout.itemO("TEXT_OT_find") + col = layout.column(align=True) + row = col.row() + row.itemR(st, "find_text", text="") + row.itemO("TEXT_OT_find_set_selected", text="", icon=ICON_TEXT) + col.itemO("TEXT_OT_find") # replace - layout.row() - layout.itemR(st, "replace_text", text="") - layout.itemO("TEXT_OT_replace_set_selected", text="", icon=ICON_TEXT) - layout.column() - layout.itemO("TEXT_OT_replace") + col = layout.column(align=True) + row = col.row() + row.itemR(st, "replace_text", text="") + row.itemO("TEXT_OT_replace_set_selected", text="", icon=ICON_TEXT) + col.itemO("TEXT_OT_replace") # mark - layout.column() layout.itemO("TEXT_OT_mark_all") # settings - layout.row() - layout.itemR(st, "find_wrap", text="Wrap") - layout.itemR(st, "find_all", text="All") + row = layout.row() + row.itemR(st, "find_wrap", text="Wrap") + row.itemR(st, "find_all", text="All") class TEXT_MT_text(bpy.types.Menu): __space_type__ = "TEXT_EDITOR" |