diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-07-20 20:39:16 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-07-20 20:39:16 +0400 |
commit | 587d408f611757684015270448e87e16e1d8a140 (patch) | |
tree | d1f09b1ff82091df3807e57423d0624aeaf80c91 | |
parent | 33bfd7397b8b0031bd2cf46d2037a8da4ef40888 (diff) |
patch from William
Cleaned up force fields panel, as well as the other fixes (sculpt, lamps)
-rw-r--r-- | release/ui/buttons_data_lamp.py | 93 | ||||
-rw-r--r-- | release/ui/buttons_physics_field.py | 173 | ||||
-rw-r--r-- | release/ui/space_view3d.py | 74 | ||||
-rw-r--r-- | release/ui/space_view3d_toolbar.py | 91 | ||||
-rw-r--r-- | source/blender/editors/screen/screen_ops.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_lamp.c | 2 |
6 files changed, 243 insertions, 192 deletions
diff --git a/release/ui/buttons_data_lamp.py b/release/ui/buttons_data_lamp.py index cf0ede8ec3b..0232c18a258 100644 --- a/release/ui/buttons_data_lamp.py +++ b/release/ui/buttons_data_lamp.py @@ -47,8 +47,10 @@ class DATA_PT_lamp(DataButtonsPanel): layout = self.layout lamp = context.lamp - - layout.itemR(lamp, "type") + + split = layout.split(percentage=0.2) + split.itemL(text="Type:") + split.itemR(lamp, "type", text="") split = layout.split() @@ -64,7 +66,9 @@ class DATA_PT_lamp(DataButtonsPanel): sub.itemR(lamp, "diffuse") if lamp.type in ('POINT', 'SPOT'): - sub.itemR(lamp, "falloff_type") + split = sub.split(percentage=0.3) + split.itemL(text="Falloff:") + split.itemR(lamp, "falloff_type", text="") sub.itemR(lamp, "sphere") if (lamp.falloff_type == 'LINEAR_QUADRATIC_WEIGHTED'): @@ -81,47 +85,75 @@ class DATA_PT_lamp(DataButtonsPanel): sub.itemR(lamp, "size", text="Size X") sub.itemR(lamp, "size_y") -class DATA_PT_sunsky(DataButtonsPanel): - __idname__ = "DATA_PT_sunsky" - __label__ = "Sun/Sky" +class DATA_PT_sky(DataButtonsPanel): + __idname__ = "DATA_PT_sky" + __label__ = "Sky" def poll(self, context): lamp = context.lamp return (lamp and lamp.type == 'SUN') + + def draw_header(self, context): + layout = self.layout + lamp = context.lamp.sky + + layout.itemR(lamp, "sky", text="") def draw(self, context): layout = self.layout lamp = context.lamp.sky - row = layout.row() - row.itemR(lamp, "sky") - row.itemR(lamp, "atmosphere") + layout.active = lamp.sky - row = layout.row() - row.active = lamp.sky or lamp.atmosphere - row.itemR(lamp, "atmosphere_turbidity", text="Turbidity") - split = layout.split() + col = split.column() + col.itemL(text="Colors:") + col.itemR(lamp, "sky_blend_type", text="Blend Type") + col.itemR(lamp, "sky_blend") + col.itemR(lamp, "sky_color_space", text="Color Space") + col.itemR(lamp, "sky_exposure", text="Exposure") + col = split.column() - sub = col.column() - sub.active = lamp.sky - 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.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") + col.itemL(text="Horizon:") + col.itemR(lamp, "horizon_brightness", text="Brightness") + col.itemR(lamp, "spread", text="Spread") + col.itemL(text="Sun:") + col.itemR(lamp, "sun_brightness", text="Brightness") + col.itemR(lamp, "sun_size", text="Size") + col.itemR(lamp, "backscattered_light", text="Back Light") + + + +class DATA_PT_atmosphere(DataButtonsPanel): + __idname__ = "DATA_PT_atmosphere" + __label__ = "Atmosphere" + + def poll(self, context): + lamp = context.lamp + return (lamp and lamp.type == 'SUN') + + def draw_header(self, context): + layout = self.layout + lamp = context.lamp.sky + + layout.itemR(lamp, "atmosphere", text="") + + def draw(self, context): + layout = self.layout + lamp = context.lamp.sky + + layout.active = lamp.atmosphere + + split = layout.split() + sub = split.column() + sub.itemR(lamp, "atmosphere_turbidity", text="Turbidity") + sub.itemR(lamp, "sun_intensity", text="Sun Intensity") sub = split.column() - sub.active = lamp.atmosphere - sub.itemR(lamp, "sun_intensity", text="Sun Intens") - sub.itemR(lamp, "atmosphere_inscattering", text="Inscattering") - sub.itemR(lamp, "atmosphere_extinction", text="Extinction") - sub.itemR(lamp, "atmosphere_distance_factor", text="Distance") + sub.itemR(lamp, "atmosphere_inscattering", text="Inscattering", slider=True) + sub.itemR(lamp, "atmosphere_extinction", text="Extinction", slider=True) + sub.itemR(lamp, "atmosphere_distance_factor", text="Distance") class DATA_PT_shadow(DataButtonsPanel): __idname__ = "DATA_PT_shadow" @@ -252,7 +284,8 @@ bpy.types.register(DATA_PT_context_lamp) bpy.types.register(DATA_PT_preview) bpy.types.register(DATA_PT_lamp) bpy.types.register(DATA_PT_shadow) -bpy.types.register(DATA_PT_sunsky) +bpy.types.register(DATA_PT_sky) +bpy.types.register(DATA_PT_atmosphere) bpy.types.register(DATA_PT_spot) bpy.types.register(DATA_PT_falloff_curve) diff --git a/release/ui/buttons_physics_field.py b/release/ui/buttons_physics_field.py index 88636108475..c2ee744c08b 100644 --- a/release/ui/buttons_physics_field.py +++ b/release/ui/buttons_physics_field.py @@ -21,118 +21,129 @@ class PHYSICS_PT_field(PhysicButtonsPanel): #layout.active = field.enabled + split = layout.split(percentage=0.3) + + split.itemL(text="Type:") + split.itemR(field, "type", text="" + ) + split = layout.split() - col = split.column(align=True) - col.itemL(text="Type:") - col.itemR(field, "type", text="") - colsub = split.column(align=True) + + sub = split.column() if field.type == "GUIDE": - colsub = col.column() - colsub.itemL(text="blabla") - colsub.itemR(field, "guide_path_add") + sub = col.column() + sub.itemR(field, "guide_path_add") if field.type == "WIND": - col.itemR(field, "strength") - col.itemR(field, "noise") - col.itemR(field, "seed") - colsub.itemL(text="") - colsub.itemL(text="") - colsub.itemL(text="") - colsub.itemL(text="") - colsub.itemL(text="") - colsub.itemL(text="") - colsub.itemL(text="") + sub.itemR(field, "strength") + sub = split.column() + sub.itemR(field, "noise") + sub.itemR(field, "seed") + if field.type == "VORTEX": - col.itemR(field, "strength") - colsub.itemL(text="") - colsub.itemL(text="") - colsub.itemL(text="") - colsub.itemL(text="") - colsub.itemL(text="") + sub.itemR(field, "strength") + sub = split.column() + sub.itemL(text="") if field.type in ("SPHERICAL", "CHARGE", "LENNARDJ"): - col.itemR(field, "strength") - colsub.itemL(text="") - colsub.itemR(field, "surface") - colsub.itemR(field, "planar") - colsub.itemL(text="") - colsub.itemL(text="") + sub.itemR(field, "strength") + sub = split.column() + sub.itemR(field, "planar") + sub.itemR(field, "surface") if field.type == "MAGNET": - col.itemR(field, "strength") - colsub.itemL(text="") - colsub.itemR(field, "planar") - colsub.itemL(text="") - colsub.itemL(text="") - colsub.itemL(text="") + sub.itemR(field, "strength") + sub = split.column() + sub.itemR(field, "planar") if field.type == "HARMONIC": - col.itemR(field, "strength") - col.itemR(field, "harmonic_damping", text="Damping") - colsub.itemL(text="") - colsub.itemR(field, "surface") - colsub.itemR(field, "planar") - colsub.itemL(text="") - colsub.itemL(text="") - colsub.itemL(text="") + sub.itemR(field, "strength") + sub.itemR(field, "harmonic_damping", text="Damping") + sub = split.column() + sub.itemR(field, "surface") + sub.itemR(field, "planar") if field.type == "TEXTURE": - col.itemR(field, "strength") - col.itemR(field, "texture", text="") - col.itemL(text="Texture Mode:") - col.itemR(field, "texture_mode", text="") - col.itemR(field, "texture_nabla") - colsub.itemL(text="") - colsub.itemR(field, "use_coordinates") - colsub.itemR(field, "root_coordinates") - colsub.itemR(field, "force_2d") - colsub.itemL(text="") - colsub.itemL(text="") - colsub.itemL(text="") - colsub.itemL(text="") - colsub.itemL(text="") + sub.itemR(field, "strength") + sub.itemR(field, "texture", text="") + sub.itemR(field, "texture_mode") + sub.itemR(field, "texture_nabla") + sub = split.column() + sub.itemR(field, "use_coordinates") + sub.itemR(field, "root_coordinates") + sub.itemR(field, "force_2d") if field.type in ("HARMONIC", "SPHERICAL", "CHARGE", "WIND", "VORTEX", "TEXTURE", "MAGNET"): - col.itemL(text="Fall-Off:") - col.itemR(field, "falloff_type", text="") - col.itemR(field, "positive_z", text="Positive Z") - col.itemR(field, "use_min_distance", text="Use Minimum") - col.itemR(field, "use_max_distance", text="Use Maximum") - colsub.itemR(field, "falloff_power", text="Power") - colsub1 = colsub.column() + + + layout.itemS() + layout.itemL(text="Falloff:") + layout.itemR(field, "falloff_type", expand=True) + + row = layout.row() + row.itemR(field, "falloff_power", text="Power") + row.itemR(field, "positive_z", text="Positive Z") + + split = layout.split() + sub = split.column() + + sub.itemR(field, "use_min_distance", text="Minimum") + colsub1 = sub.column() colsub1.active = field.use_min_distance colsub1.itemR(field, "minimum_distance", text="Distance") - colsub2 = colsub.column() + + sub = split.column() + + sub.itemR(field, "use_max_distance", text="Maximum") + colsub2 = sub.column() colsub2.active = field.use_max_distance colsub2.itemR(field, "maximum_distance", text="Distance") if field.falloff_type == "CONE": - col.itemL(text="") - col.itemL(text="Angular:") - col.itemR(field, "use_radial_min", text="Use Minimum") - col.itemR(field, "use_radial_max", text="Use Maximum") - colsub.itemL(text="") - colsub.itemR(field, "radial_falloff", text="Power") - colsub1 = colsub.column() + layout.itemS() + layout.itemL(text="Angular:") + + row = layout.row() + row.itemR(field, "radial_falloff", text="Power") + row.itemL(text="") + + split = layout.split() + sub = split.column() + + sub.itemR(field, "use_radial_min", text="Minimum") + colsub1 = sub.column() colsub1.active = field.use_radial_min colsub1.itemR(field, "radial_minimum", text="Angle") - colsub2 = colsub.column() + + sub = split.column() + + sub.itemR(field, "use_radial_max", text="Maximum") + colsub2 = sub.column() colsub2.active = field.use_radial_max colsub2.itemR(field, "radial_maximum", text="Angle") if field.falloff_type == "TUBE": - col.itemL(text="") - col.itemL(text="Radial:") - col.itemR(field, "use_radial_min", text="Use Minimum") - col.itemR(field, "use_radial_max", text="Use Maximum") - colsub.itemL(text="") - colsub.itemR(field, "radial_falloff", text="Power") - colsub1 = colsub.column() + + layout.itemS() + layout.itemL(text="Radial:") + row = layout.row() + row.itemR(field, "radial_falloff", text="Power") + row.itemL(text="") + + split = layout.split() + sub = split.column() + + sub.itemR(field, "use_radial_min", text="Minimum") + colsub1 = sub.column() colsub1.active = field.use_radial_min colsub1.itemR(field, "radial_minimum", text="Distance") - colsub2 = colsub.column() + + sub = split.column() + + sub.itemR(field, "use_radial_max", text="Maximum") + colsub2 = sub.column() colsub2.active = field.use_radial_max colsub2.itemR(field, "radial_maximum", text="Distance") diff --git a/release/ui/space_view3d.py b/release/ui/space_view3d.py index 9d4994b9793..e28fdd6641f 100644 --- a/release/ui/space_view3d.py +++ b/release/ui/space_view3d.py @@ -170,85 +170,11 @@ class VIEW3D_PT_background_image(bpy.types.Panel): col.itemR(bg, "x_offset", text="X") col.itemR(bg, "y_offset", text="Y") -class VIEW3D_PT_sculpt(bpy.types.Panel): - __space_type__ = "VIEW_3D" - __region_type__ = "UI" - __label__ = "Sculpt" - - def poll(self, context): - return context.sculpt_object - - def draw(self, context): - sculpt = context.scene.tool_settings.sculpt - - split = self.layout.split() - - col = split.column() - col.itemL(text="Symmetry") - row = col.row(align=True) - row.itemR(sculpt, "symmetry_x", text="X", toggle=True) - row.itemR(sculpt, "symmetry_y", text="Y", toggle=True) - row.itemR(sculpt, "symmetry_z", text="Z", toggle=True) - - col = split.column() - col.itemL(text="Lock Axis") - row = col.row(align=True) - row.itemR(sculpt, "lock_x", text="X", toggle=True) - row.itemR(sculpt, "lock_y", text="Y", toggle=True) - row.itemR(sculpt, "lock_z", text="Z", toggle=True) - -class VIEW3D_PT_brush(bpy.types.Panel): - __space_type__ = "VIEW_3D" - __region_type__ = "UI" - __label__ = "Brush" - - def brush_src(self, context): - ts = context.scene.tool_settings - if context.sculpt_object: - return ts.sculpt - elif context.vpaint_object: - return ts.vpaint - elif context.wpaint_object: - return ts.wpaint - return False - def poll(self, context): - return self.brush_src(context) - - def draw(self, context): - src = self.brush_src(context) - brush = src.brush - layout = self.layout - - layout.split().row().template_ID(src, "brush") - - split = layout.split() - col = split.column(align=True) - col.itemR(brush, "size", slider=True) - if context.wpaint_object: - col.itemR(context.scene.tool_settings, "vertex_group_weight", text="Weight", slider=True) - col.itemR(brush, "strength", slider=True) - - if context.sculpt_object: - layout.split().row().itemR(brush, "sculpt_tool") - - split = layout.split() - col = split.column() - col.itemR(brush, "airbrush") - col.itemR(brush, "anchored") - col.itemR(brush, "rake") - col = split.column() - col.itemR(brush, "space") - col.itemR(brush, "spacing") - - split = layout.split() - split.template_curve_mapping(brush.curve) bpy.types.register(VIEW3D_MT_view_navigation) bpy.types.register(VIEW3D_MT_view) bpy.types.register(VIEW3D_HT_header) -bpy.types.register(VIEW3D_PT_sculpt) -bpy.types.register(VIEW3D_PT_brush) bpy.types.register(VIEW3D_PT_3dview_properties) bpy.types.register(VIEW3D_PT_3dview_display) bpy.types.register(VIEW3D_PT_background_image) diff --git a/release/ui/space_view3d_toolbar.py b/release/ui/space_view3d_toolbar.py index 1580052f697..f4a2682f111 100644 --- a/release/ui/space_view3d_toolbar.py +++ b/release/ui/space_view3d_toolbar.py @@ -179,14 +179,94 @@ class View3DPanel(bpy.types.Panel): __region_type__ = "TOOLS" __context__ = "sculptmode" -class VIEW3D_PT_tools_sculptmode(View3DPanel): - __idname__ = "VIEW3D_PT_tools_sculptmode" - __label__ = "Sculpt Tools" +#class VIEW3D_PT_tools_sculptmode(View3DPanel): +# __idname__ = "VIEW3D_PT_tools_sculptmode" +# __label__ = "Sculpt Tools" +# +# def draw(self, context): +# layout = self.layout +# +# layout.row().itemO("sculpt.radial_control") + +class VIEW3D_PT_tools_brush(bpy.types.Panel): + __space_type__ = "VIEW_3D" + __region_type__ = "TOOLS" + __label__ = "Brush" + + def brush_src(self, context): + ts = context.scene.tool_settings + if context.sculpt_object: + return ts.sculpt + elif context.vpaint_object: + return ts.vpaint + elif context.wpaint_object: + return ts.wpaint + return False + + def poll(self, context): + return self.brush_src(context) def draw(self, context): + src = self.brush_src(context) + brush = src.brush layout = self.layout - layout.row().itemO("sculpt.radial_control") + layout.split().row().template_ID(src, "brush") + + if context.sculpt_object: + layout.column().itemR(brush, "sculpt_tool", expand=True) + + split = layout.split() + col = split.column() + col.itemR(brush, "size", slider=True) + if context.wpaint_object: + col.itemR(context.scene.tool_settings, "vertex_group_weight", text="Weight", slider=True) + col.itemR(brush, "strength", slider=True) + + + + split = layout.split() + col = split.column() + col.itemR(brush, "airbrush") + col.itemR(brush, "anchored") + col.itemR(brush, "rake") + col.itemR(brush, "space", text="Spacing") + colsub = col.column() + colsub.active = brush.space + colsub.itemR(brush, "spacing", text="") + + split = layout.split() + split.template_curve_mapping(brush.curve) + +class VIEW3D_PT_sculptoptions(bpy.types.Panel): + __space_type__ = "VIEW_3D" + __region_type__ = "TOOLS" + __label__ = "Options" + + def poll(self, context): + return context.sculpt_object + + def draw(self, context): + sculpt = context.scene.tool_settings.sculpt + + split = self.layout.split() + + col = split.column() + col.itemL(text="Symmetry:") + row = col.row(align=True) + row.itemR(sculpt, "symmetry_x", text="X", toggle=True) + row.itemR(sculpt, "symmetry_y", text="Y", toggle=True) + row.itemR(sculpt, "symmetry_z", text="Z", toggle=True) + + split = self.layout.split() + + col = split.column() + col.itemL(text="Lock Axis:") + row = col.row(align=True) + row.itemR(sculpt, "lock_x", text="X", toggle=True) + row.itemR(sculpt, "lock_y", text="Y", toggle=True) + row.itemR(sculpt, "lock_z", text="Z", toggle=True) + # ********** default tools for weightpaint **************** @@ -246,7 +326,8 @@ bpy.types.register(VIEW3D_PT_tools_editmode_armature) bpy.types.register(VIEW3D_PT_tools_editmode_mball) bpy.types.register(VIEW3D_PT_tools_editmode_lattice) bpy.types.register(VIEW3D_PT_tools_posemode) -bpy.types.register(VIEW3D_PT_tools_sculptmode) +bpy.types.register(VIEW3D_PT_tools_brush) +bpy.types.register(VIEW3D_PT_sculptoptions) bpy.types.register(VIEW3D_PT_tools_weightpaint) bpy.types.register(VIEW3D_PT_tools_vertexpaint) bpy.types.register(VIEW3D_PT_tools_texturepaint) diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 05f5d847159..5cf1ffb9915 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -1980,7 +1980,7 @@ void SCREEN_OT_region_foursplit(wmOperatorType *ot) ot->idname= "SCREEN_OT_region_foursplit"; /* api callbacks */ - ot->invoke= WM_operator_confirm; +// ot->invoke= WM_operator_confirm; ot->exec= region_foursplit_exec; ot->poll= ED_operator_areaactive; ot->flag= OPTYPE_REGISTER; diff --git a/source/blender/makesrna/intern/rna_lamp.c b/source/blender/makesrna/intern/rna_lamp.c index 61d4a3a8ac6..b83036be8fb 100644 --- a/source/blender/makesrna/intern/rna_lamp.c +++ b/source/blender/makesrna/intern/rna_lamp.c @@ -283,7 +283,7 @@ static void rna_def_lamp(BlenderRNA *brna) {LA_LOCAL, "POINT", ICON_LAMP_POINT, "Point", "Omnidirectional point light source."}, {LA_SUN, "SUN", ICON_LAMP_SUN, "Sun", "Constant direction parallel ray light source."}, {LA_SPOT, "SPOT", ICON_LAMP_SPOT, "Spot", "Directional cone light source."}, - {LA_HEMI, "HEMI", ICON_LAMP_HEMI, "Hemi", "180 degree constant light source."}, + {LA_HEMI, "HEMI", ICON_LAMP_HEMI, "Hemisphere", "180 degree constant light source."}, {LA_AREA, "AREA", ICON_LAMP_AREA, "Area", "Directional area light source."}, {0, NULL, 0, NULL, NULL}}; |