[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [52778] branches/soc-2008-mxcurioni: A patch set by Bastien Montagne (many thanks!)
Tamito Kajiyama
rd6t-kjym at asahi-net.or.jp
Tue Dec 4 23:33:46 CET 2012
Revision: 52778
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=52778
Author: kjym3
Date: 2012-12-04 22:33:45 +0000 (Tue, 04 Dec 2012)
Log Message:
-----------
A patch set by Bastien Montagne (many thanks!)
* Removed the ../include and ../src include directories from scons/cmake files.
These directories do not exist and are very noisy when building.
* Coding style clean-up in Python scripts: 'string' is used for enum values,
and "string" for usual stings.
* UILayout.active is used instead of UILayout.enabled to grey out "inactive"
settings. This still allows users to edit them, which can be handy sometimes.
* Improved UI layout of the Line Style panel by means of:
- The standard ?\226?\128?\156column?\226?\128?\157 paradigm is used in more places;
- More compact layout where possible; and
- Tweaks to the modifiers' header.
* Improved UI layout of the Line Set panel by rearranging the "Selection by"
options into a compact row of toggle buttons.
Modified Paths:
--------------
branches/soc-2008-mxcurioni/release/scripts/startup/bl_ui/properties_render.py
branches/soc-2008-mxcurioni/release/scripts/startup/bl_ui/properties_render_layer.py
branches/soc-2008-mxcurioni/source/blender/freestyle/CMakeLists.txt
branches/soc-2008-mxcurioni/source/blender/freestyle/SConscript
Modified: branches/soc-2008-mxcurioni/release/scripts/startup/bl_ui/properties_render.py
===================================================================
--- branches/soc-2008-mxcurioni/release/scripts/startup/bl_ui/properties_render.py 2012-12-04 22:03:39 UTC (rev 52777)
+++ branches/soc-2008-mxcurioni/release/scripts/startup/bl_ui/properties_render.py 2012-12-04 22:33:45 UTC (rev 52778)
@@ -304,20 +304,19 @@
def draw_header(self, context):
rd = context.scene.render
-
self.layout.prop(rd, "use_freestyle", text="")
def draw(self, context):
rd = context.scene.render
layout = self.layout
- layout.enabled = rd.use_freestyle
+ layout.active = rd.use_freestyle
row = layout.row()
row.label(text="Line Thickness:")
row.prop(rd, "line_thickness_mode", expand=True)
row = layout.row()
- row.enabled = (rd.line_thickness_mode == "ABSOLUTE")
+ row.active = (rd.line_thickness_mode == 'ABSOLUTE')
row.prop(rd, "unit_line_thickness")
Modified: branches/soc-2008-mxcurioni/release/scripts/startup/bl_ui/properties_render_layer.py
===================================================================
--- branches/soc-2008-mxcurioni/release/scripts/startup/bl_ui/properties_render_layer.py 2012-12-04 22:03:39 UTC (rev 52777)
+++ branches/soc-2008-mxcurioni/release/scripts/startup/bl_ui/properties_render_layer.py 2012-12-04 22:33:45 UTC (rev 52778)
@@ -183,7 +183,7 @@
freestyle = rl.freestyle_settings
layout = self.layout
- layout.enabled = rl.use_freestyle
+ layout.active = rl.use_freestyle
layout.prop(freestyle, "mode", text="Control mode")
col = layout.column()
@@ -200,17 +200,17 @@
if freestyle.use_advanced_options:
split = col.split()
sub = split.column()
- sub.enabled = freestyle.use_advanced_options
- if freestyle.mode == "SCRIPT":
+ sub.active = freestyle.use_advanced_options
+ if freestyle.mode == 'SCRIPT':
sub.prop(freestyle, "use_ridges_and_valleys")
sub.prop(freestyle, "sphere_radius")
sub = split.column()
- sub.enabled = freestyle.use_advanced_options
- if freestyle.mode == "SCRIPT":
+ sub.active = freestyle.use_advanced_options
+ if freestyle.mode == 'SCRIPT':
sub.prop(freestyle, "use_suggestive_contours")
sub.prop(freestyle, "kr_derivative_epsilon")
- if freestyle.mode == "SCRIPT":
+ if freestyle.mode == 'SCRIPT':
split = layout.split()
split.label("Style modules:")
split.operator("scene.freestyle_module_add", text="Add")
@@ -236,7 +236,7 @@
return False
rd = scene.render
rl = rd.layers.active
- return rd.use_freestyle and rl and rl.freestyle_settings.mode == "EDITOR"
+ return rd.use_freestyle and rl and rl.freestyle_settings.mode == 'EDITOR'
def draw_edge_type_buttons(self, box, lineset, edge_type):
# property names
@@ -247,7 +247,7 @@
row.prop(lineset, select_edge_type)
sub = row.column()
sub.prop(lineset, exclude_edge_type, text="")
- sub.enabled = getattr(lineset, select_edge_type)
+ sub.active = getattr(lineset, select_edge_type)
def draw(self, context):
rd = context.scene.render
@@ -256,15 +256,11 @@
lineset = freestyle.linesets.active
layout = self.layout
- layout.enabled = rl.use_freestyle
+ layout.active = rl.use_freestyle
- split = layout.split()
-
- col = split.column()
+ col = layout.column()
row = col.row()
- rows = 2
- if lineset:
- rows = 5
+ rows = 5 if lineset else 2
row.template_list(freestyle, "linesets", freestyle.linesets, "active_index", rows=rows)
sub = row.column()
@@ -278,58 +274,58 @@
subsub.operator("scene.freestyle_lineset_move", icon='TRIA_UP', text="").direction = 'UP'
subsub.operator("scene.freestyle_lineset_move", icon='TRIA_DOWN', text="").direction = 'DOWN'
- #col = split.column()
col.prop(lineset, "name")
- col.prop(lineset, "select_by_visibility")
+ col = layout.column()
+ col.label(text="Selection By:")
+ row = col.row(align=True)
+ row.prop(lineset, "select_by_visibility", text="Visibility", toggle=True)
+ row.prop(lineset, "select_by_edge_types", text="Edge Types", toggle=True)
+ row.prop(lineset, "select_by_face_marks", text="Face Marks", toggle=True)
+ row.prop(lineset, "select_by_group", text="Group", toggle=True)
+ row.prop(lineset, "select_by_image_border", text="Image Border", toggle=True)
+
if lineset.select_by_visibility:
- sub = col.row(align=True)
- sub.prop(lineset, "visibility", expand=True)
- if lineset.visibility == "RANGE":
- sub = col.row(align=True)
- sub.prop(lineset, "qi_start")
- sub.prop(lineset, "qi_end")
- col.separator() # XXX
+ col.label(text="Visibility:")
+ row = col.row(align=True)
+ row.prop(lineset, "visibility", expand=True)
+ if lineset.visibility == 'RANGE':
+ row = col.row(align=True)
+ row.prop(lineset, "qi_start")
+ row.prop(lineset, "qi_end")
- col.prop(lineset, "select_by_edge_types")
if lineset.select_by_edge_types:
+ col.label(text="Edge Types:")
row = col.row()
row.prop(lineset, "edge_type_negation", expand=True)
- row = col.row()
row.prop(lineset, "edge_type_combination", expand=True)
- row = col.row()
- sub = row.column()
+ split = col.split()
+ sub = split.column()
self.draw_edge_type_buttons(sub, lineset, "silhouette")
self.draw_edge_type_buttons(sub, lineset, "border")
self.draw_edge_type_buttons(sub, lineset, "contour")
self.draw_edge_type_buttons(sub, lineset, "suggestive_contour")
self.draw_edge_type_buttons(sub, lineset, "ridge_valley")
- sub = row.column()
+ sub = split.column()
self.draw_edge_type_buttons(sub, lineset, "crease")
self.draw_edge_type_buttons(sub, lineset, "edge_mark")
self.draw_edge_type_buttons(sub, lineset, "external_contour")
self.draw_edge_type_buttons(sub, lineset, "material_boundary")
- col.separator() # XXX
- col.prop(lineset, "select_by_face_marks")
if lineset.select_by_face_marks:
+ col.label(text="Face Marks:")
row = col.row()
row.prop(lineset, "face_mark_negation", expand=True)
- row = col.row()
row.prop(lineset, "face_mark_condition", expand=True)
- col.separator() # XXX
- col.prop(lineset, "select_by_group")
if lineset.select_by_group:
- col.prop(lineset, "group")
+ col.label(text="Group:")
row = col.row()
+ row.prop(lineset, "group", text="")
row.prop(lineset, "group_negation", expand=True)
- col.separator() # XXX
- col.prop(lineset, "select_by_image_border")
-
class RENDERLAYER_PT_freestyle_linestyle(RenderLayerButtonsPanel, Panel):
bl_label = "Freestyle Line Style"
bl_options = {'DEFAULT_CLOSED'}
@@ -342,24 +338,29 @@
return False
rd = scene.render
rl = rd.layers.active
- return rd.use_freestyle and rl and rl.freestyle_settings.mode == "EDITOR"
+ return rd.use_freestyle and rl and rl.freestyle_settings.mode == 'EDITOR'
def draw_modifier_box_header(self, box, modifier):
row = box.row()
row.context_pointer_set("modifier", modifier)
if modifier.expanded:
- icon = "TRIA_DOWN"
+ icon = 'TRIA_DOWN'
else:
- icon = "TRIA_RIGHT"
+ icon = 'TRIA_RIGHT'
row.prop(modifier, "expanded", text="", icon=icon, emboss=False)
+ # TODO: Use icons rather than text label, would save some room!
row.label(text=modifier.rna_type.name)
row.prop(modifier, "name", text="")
- row.prop(modifier, "use", text="")
- row.operator("scene.freestyle_modifier_copy", icon='NONE', text="Copy")
+ if modifier.use:
+ icon = 'RESTRICT_RENDER_OFF'
+ else:
+ icon = 'RESTRICT_RENDER_ON'
+ row.prop(modifier, "use", text="", icon=icon)
sub = row.row(align=True)
+ sub.operator("scene.freestyle_modifier_copy", icon='NONE', text="Copy")
sub.operator("scene.freestyle_modifier_move", icon='TRIA_UP', text="").direction = 'UP'
sub.operator("scene.freestyle_modifier_move", icon='TRIA_DOWN', text="").direction = 'DOWN'
- row.operator("scene.freestyle_modifier_remove", icon='X', text="")
+ sub.operator("scene.freestyle_modifier_remove", icon='X', text="")
def draw_modifier_common(self, box, modifier):
row = box.row()
@@ -378,8 +379,8 @@
row.prop(modifier, "mapping", text="")
sub = row.column()
sub.prop(modifier, "invert")
- if modifier.mapping == "CURVE":
- sub.enabled = False
+ if modifier.mapping == 'CURVE':
+ sub.active = False
box.template_curve_mapping(modifier, "curve")
if has_range:
row = box.row(align=True)
@@ -399,32 +400,32 @@
box = col.box()
self.draw_modifier_common(box, modifier)
- if modifier.type == "ALONG_STROKE":
+ if modifier.type == 'ALONG_STROKE':
self.draw_modifier_color_ramp_common(box, modifier, False)
- elif modifier.type == "DISTANCE_FROM_OBJECT":
+ elif modifier.type == 'DISTANCE_FROM_OBJECT':
box.prop(modifier, "target")
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list