diff options
Diffstat (limited to 'release/scripts/startup/bl_ui/properties_freestyle.py')
-rw-r--r-- | release/scripts/startup/bl_ui/properties_freestyle.py | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/release/scripts/startup/bl_ui/properties_freestyle.py b/release/scripts/startup/bl_ui/properties_freestyle.py index 31a638d3c7e..c5716dff86d 100644 --- a/release/scripts/startup/bl_ui/properties_freestyle.py +++ b/release/scripts/startup/bl_ui/properties_freestyle.py @@ -344,7 +344,7 @@ class RENDERLAYER_PT_freestyle_linestyle(RenderLayerFreestyleEditorButtonsPanel, row.prop(modifier, "material_attribute", text="") sub = row.column() sub.prop(modifier, "use_ramp") - if modifier.material_attribute in {'DIFF', 'SPEC'}: + if modifier.material_attribute in {'LINE', 'DIFF', 'SPEC'}: sub.active = True show_ramp = modifier.use_ramp else: @@ -691,5 +691,37 @@ class RENDERLAYER_PT_freestyle_linestyle(RenderLayerFreestyleEditorButtonsPanel, pass +# Material properties + +class MaterialFreestyleButtonsPanel(): + bl_space_type = 'PROPERTIES' + bl_region_type = 'WINDOW' + bl_context = "material" + # COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here + + @classmethod + def poll(cls, context): + scene = context.scene + material = context.material + with_freestyle = bpy.app.build_options.freestyle + return with_freestyle and material and scene and scene.render.use_freestyle and \ + (scene.render.engine in cls.COMPAT_ENGINES) + + +class MATERIAL_PT_freestyle_line(MaterialFreestyleButtonsPanel, Panel): + bl_label = "Freestyle Line" + bl_options = {'DEFAULT_CLOSED'} + COMPAT_ENGINES = {'BLENDER_RENDER'} # TODO: 'CYCLES' + + def draw(self, context): + layout = self.layout + + mat = context.material + + row = layout.row() + row.prop(mat, "line_color", text="") + row.prop(mat, "line_priority", text="Priority") + + if __name__ == "__main__": # only for live edit. bpy.utils.register_module(__name__) |