Fix for missing toggle switches to enable/disable linesets. Also gave

uniform property name "use" to all toggle switches in Freestyle-related
options, according to recent RNA renaming.
This commit is contained in:
2010-10-10 23:34:27 +00:00
parent 84f5a9a718
commit cc77207ca4
5 changed files with 12 additions and 12 deletions

View File

@@ -479,7 +479,7 @@ def process(layer_name, lineset_name):
ConstantThicknessShader(linestyle.thickness),
ConstantColorShader(color.r, color.g, color.b, linestyle.alpha)]
for m in linestyle.color_modifiers:
if not m.enabled:
if not m.use:
continue
if m.type == "ALONG_STROKE":
shaders_list.append(ColorAlongStrokeShader(
@@ -493,7 +493,7 @@ def process(layer_name, lineset_name):
m.blend, m.influence, m.color_ramp, m.target,
m.range_min, m.range_max))
for m in linestyle.alpha_modifiers:
if not m.enabled:
if not m.use:
continue
if m.type == "ALONG_STROKE":
shaders_list.append(AlphaAlongStrokeShader(
@@ -507,7 +507,7 @@ def process(layer_name, lineset_name):
m.blend, m.influence, m.mapping, m.invert, m.curve, m.target,
m.range_min, m.range_max))
for m in linestyle.thickness_modifiers:
if not m.enabled:
if not m.use:
continue
if m.type == "ALONG_STROKE":
shaders_list.append(ThicknessAlongStrokeShader(

View File

@@ -266,7 +266,7 @@ class RENDER_PT_freestyle(RenderButtonsPanel, bpy.types.Panel):
box = layout.box()
box.context_pointer_set("freestyle_module", module)
row = box.row(align=True)
row.prop(module, "is_displayed", text="")
row.prop(module, "use", text="")
row.prop(module, "module_path", text="")
row.operator("scene.freestyle_module_remove", icon='X', text="")
row.operator("scene.freestyle_module_move", icon='TRIA_UP', text="").direction = 'UP'
@@ -296,7 +296,7 @@ class RENDER_PT_freestyle_linestyle(RenderButtonsPanel, bpy.types.Panel):
row.operator("scene.freestyle_modifier_toggle_fold", icon=icon, text="", emboss=False)
row.label(text=modifier.rna_type.name)
row.prop(modifier, "name", text="")
row.prop(modifier, "enabled", text="")
row.prop(modifier, "use", text="")
sub = row.row(align=True)
sub.operator("scene.freestyle_modifier_move", icon='TRIA_UP', text="").direction = 'UP'
sub.operator("scene.freestyle_modifier_move", icon='TRIA_DOWN', text="").direction = 'DOWN'

View File

@@ -1991,7 +1991,7 @@ static void list_item_row(bContext *C, uiLayout *layout, PointerRNA *ptr, Pointe
uiBlockSetEmboss(block, UI_EMBOSS);
uiDefButR(block, OPTION, 0, "", 0, 0, UI_UNIT_X, UI_UNIT_Y, ptr, "use_textures", i, 0, 0, 0, 0, NULL);
}
else if(RNA_struct_is_a(itemptr->type, &RNA_SceneRenderLayer)) {
else if(RNA_struct_is_a(itemptr->type, &RNA_SceneRenderLayer) || RNA_struct_is_a(itemptr->type, &RNA_FreestyleLineSet)) {
uiItemL(sub, name, icon);
uiBlockSetEmboss(block, UI_EMBOSS);
uiDefButR(block, OPTION, 0, "", 0, 0, UI_UNIT_X, UI_UNIT_Y, itemptr, "use", 0, 0, 0, 0, 0, NULL);

View File

@@ -145,9 +145,9 @@ static void rna_def_modifier_type_common(StructRNA *srna, EnumPropertyItem *modi
RNA_def_property_ui_text(prop, "Influence", "Influence factor by which the modifier changes the property.");
RNA_def_property_update(prop, NC_SCENE, NULL);
prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
prop= RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "modifier.flags", LS_MODIFIER_ENABLED);
RNA_def_property_ui_text(prop, "Enabled", "True if the modifier is enabled.");
RNA_def_property_ui_text(prop, "Use", "Enable or disable this modifier during stroke rendering.");
prop= RNA_def_property(srna, "expanded", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "modifier.flags", LS_MODIFIER_EXPANDED);

View File

@@ -1667,9 +1667,9 @@ static void rna_def_freestyle_settings(BlenderRNA *brna)
RNA_def_property_update(prop, NC_SCENE, NULL);
RNA_def_struct_name_property(srna, prop);
prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
prop= RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", FREESTYLE_LINESET_ENABLED);
RNA_def_property_ui_text(prop, "Enabled", "Enable or disable the line set.");
RNA_def_property_ui_text(prop, "Use", "Enable or disable this line set during stroke rendering.");
RNA_def_property_update(prop, NC_SCENE, NULL);
prop= RNA_def_property(srna, "select_by_visibility", PROP_BOOLEAN, PROP_NONE);
@@ -1773,9 +1773,9 @@ static void rna_def_freestyle_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Module Path", "Path to a style module file.");
RNA_def_property_update(prop, NC_SCENE, NULL);
prop= RNA_def_property(srna, "is_displayed", PROP_BOOLEAN, PROP_NONE);
prop= RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "is_displayed", 1);
RNA_def_property_ui_text(prop, "Is Displayed", "Enable this style module during the rendering.");
RNA_def_property_ui_text(prop, "Use", "Enable or disable this style module during stroke rendering.");
RNA_def_property_update(prop, NC_SCENE, NULL);
/* FreestyleSettings */