RNA fix/addition: Made scene render freestyle_settings.linesets consistent
with recent changes in the trunk revision 31570 for adding scene render layers' active and active_index properties.
This commit is contained in:
@@ -198,14 +198,14 @@ class RENDER_PT_freestyle(RenderButtonsPanel, bpy.types.Panel):
|
||||
col.prop(freestyle, "sphere_radius")
|
||||
col.prop(freestyle, "kr_derivative_epsilon")
|
||||
|
||||
lineset = freestyle.active_lineset
|
||||
lineset = freestyle.linesets.active
|
||||
|
||||
col.label(text="Line Sets:")
|
||||
row = col.row()
|
||||
rows = 2
|
||||
if lineset:
|
||||
rows = 5
|
||||
row.template_list(freestyle, "linesets", freestyle, "active_lineset_index", rows=rows)
|
||||
row.template_list(freestyle, "linesets", freestyle.linesets, "active_index", rows=rows)
|
||||
|
||||
sub = row.column()
|
||||
subsub = sub.column(align=True)
|
||||
@@ -284,7 +284,7 @@ class RENDER_PT_freestyle_linestyle(RenderButtonsPanel, bpy.types.Panel):
|
||||
rl = rd.layers.active
|
||||
if rl and rl.use_freestyle:
|
||||
freestyle = rl.freestyle_settings
|
||||
return freestyle.mode == "EDITOR" and freestyle.active_lineset
|
||||
return freestyle.mode == "EDITOR" and freestyle.linesets.active
|
||||
return False
|
||||
|
||||
def draw_modifier_box_header(self, box, modifier):
|
||||
@@ -377,7 +377,7 @@ class RENDER_PT_freestyle_linestyle(RenderButtonsPanel, bpy.types.Panel):
|
||||
|
||||
rd = context.scene.render
|
||||
rl = rd.layers.active
|
||||
lineset = rl.freestyle_settings.active_lineset
|
||||
lineset = rl.freestyle_settings.linesets.active
|
||||
linestyle = lineset.linestyle
|
||||
|
||||
split = layout.split()
|
||||
|
||||
@@ -1581,6 +1581,28 @@ void rna_def_render_layer_common(StructRNA *srna, int scene)
|
||||
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
||||
}
|
||||
|
||||
static void rna_def_freestyle_linesets(BlenderRNA *brna, PropertyRNA *cprop)
|
||||
{
|
||||
StructRNA *srna;
|
||||
PropertyRNA *prop;
|
||||
|
||||
RNA_def_property_srna(cprop, "Linesets");
|
||||
srna= RNA_def_struct(brna, "Linesets", NULL);
|
||||
RNA_def_struct_sdna(srna, "RenderData");
|
||||
RNA_def_struct_ui_text(srna, "Line Sets", "Line sets for associating lines and style parameters");
|
||||
|
||||
prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
|
||||
RNA_def_property_struct_type(prop, "FreestyleLineSet");
|
||||
RNA_def_property_pointer_funcs(prop, "rna_FreestyleSettings_active_lineset_get", NULL, NULL, NULL);
|
||||
RNA_def_property_ui_text(prop, "Active Line Set", "Active line set being displayed");
|
||||
RNA_def_property_update(prop, NC_SCENE, NULL);
|
||||
|
||||
prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED);
|
||||
RNA_def_property_int_funcs(prop, "rna_FreestyleSettings_active_lineset_index_get", "rna_FreestyleSettings_active_lineset_index_set", "rna_FreestyleSettings_active_lineset_index_range");
|
||||
RNA_def_property_ui_text(prop, "Active Line Set Index", "Index of active line set slot");
|
||||
RNA_def_property_update(prop, NC_SCENE, NULL);
|
||||
}
|
||||
|
||||
static void rna_def_freestyle_settings(BlenderRNA *brna)
|
||||
{
|
||||
StructRNA *srna;
|
||||
@@ -1792,18 +1814,8 @@ static void rna_def_freestyle_settings(BlenderRNA *brna)
|
||||
prop= RNA_def_property(srna, "linesets", PROP_COLLECTION, PROP_NONE);
|
||||
RNA_def_property_collection_sdna(prop, NULL, "linesets", NULL);
|
||||
RNA_def_property_struct_type(prop, "FreestyleLineSet");
|
||||
RNA_def_property_ui_text(prop, "Line Sets", "Line sets for associating lines and style parameters");
|
||||
|
||||
prop= RNA_def_property(srna, "active_lineset", PROP_POINTER, PROP_NONE);
|
||||
RNA_def_property_struct_type(prop, "FreestyleLineSet");
|
||||
RNA_def_property_pointer_funcs(prop, "rna_FreestyleSettings_active_lineset_get", NULL, NULL, NULL);
|
||||
RNA_def_property_ui_text(prop, "Active Line Set", "Active line set being displayed");
|
||||
RNA_def_property_update(prop, NC_SCENE, NULL);
|
||||
|
||||
prop= RNA_def_property(srna, "active_lineset_index", PROP_INT, PROP_UNSIGNED);
|
||||
RNA_def_property_int_funcs(prop, "rna_FreestyleSettings_active_lineset_index_get", "rna_FreestyleSettings_active_lineset_index_set", "rna_FreestyleSettings_active_lineset_index_range");
|
||||
RNA_def_property_ui_text(prop, "Active Line Set Index", "Index of active line set slot");
|
||||
RNA_def_property_update(prop, NC_SCENE, NULL);
|
||||
RNA_def_property_ui_text(prop, "Line Sets", "");
|
||||
rna_def_freestyle_linesets(brna, prop);
|
||||
}
|
||||
|
||||
static void rna_def_scene_game_data(BlenderRNA *brna)
|
||||
|
||||
Reference in New Issue
Block a user