This repository has been archived on 2023-10-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
blender-archive/release/scripts/startup/bl_ui/properties_collection.py
Hans Goudey be33d3eccd UI: Tweak labels, descriptions, and panel layout for line art
Changes include:
 - Use `IFACE_` for UI labels set in the modifier panels
 - Use a sub-sub-panel for transparency
 - Fix grammar and spelling mistakes
 - Use more natural user-friendly wording
 - Make descriptions more specific and more useful
 - Don't capitalize "line art" in descriptions (tooltips)

These changes are aimed at making the UI strings more consistent with
the rest of the UI and being more helpful to someone trying to understand
how to use the modifier.

Differential Revision: https://developer.blender.org/D10750
2021-03-17 13:46:41 -04:00

101 lines
3.1 KiB
Python

# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
from bpy.types import Panel
class CollectionButtonsPanel:
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "collection"
def lineart_make_line_type_entry(col, line_type, text_disp, expand, search_from):
col.prop(line_type, "use", text=text_disp)
if line_type.use and expand:
col.prop_search(line_type, "layer", search_from,
"layers", icon='GREASEPENCIL')
col.prop_search(line_type, "material", search_from,
"materials", icon='SHADING_TEXTURE')
class COLLECTION_PT_collection_flags(CollectionButtonsPanel, Panel):
bl_label = "Restrictions"
@classmethod
def poll(cls, context):
vl = context.view_layer
vlc = vl.active_layer_collection
return (vlc.name != 'Master Collection')
def draw(self, context):
layout = self.layout
layout.use_property_split = True
layout.use_property_decorate = False
collection = context.collection
vl = context.view_layer
vlc = vl.active_layer_collection
col = layout.column(align=True)
col.prop(collection, "hide_select", text="Selectable", toggle=False, invert_checkbox=True)
col.prop(collection, "hide_render", toggle=False)
col = layout.column(align=True)
col.prop(vlc, "holdout", toggle=False)
col.prop(vlc, "indirect_only", toggle=False)
class COLLECTION_PT_instancing(CollectionButtonsPanel, Panel):
bl_label = "Instancing"
def draw(self, context):
layout = self.layout
layout.use_property_split = True
layout.use_property_decorate = False
collection = context.collection
row = layout.row()
row.prop(collection, "instance_offset")
class COLLECTION_PT_lineart_collection(CollectionButtonsPanel, Panel):
bl_label = "Line Art"
def draw(self, context):
layout = self.layout
layout.use_property_split = True
layout.use_property_decorate = False
collection = context.collection
row = layout.row()
row.prop(collection, "lineart_usage")
classes = (
COLLECTION_PT_collection_flags,
COLLECTION_PT_instancing,
COLLECTION_PT_lineart_collection,
)
if __name__ == "__main__": # only for live edit.
from bpy.utils import register_class
for cls in classes:
register_class(cls)