Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYimingWu <xp8110@outlook.com>2021-03-16 21:35:53 +0300
committerSebastian Parborg <darkdefende@gmail.com>2021-03-16 21:59:09 +0300
commit3e87d8a4315d794efff659e40f0bb9e34e2aec8a (patch)
tree0c51740d7eef76e85736fbc2da34856c76405e94 /release/scripts/startup/bl_ui/properties_collection.py
parent877238e2b7f5a1d8c7e705a0112f9d9b16df77d3 (diff)
Grease Pencil: Add LineArt modifier
This adds the LineArt grease pencil modifier. It takes objects or collections as input and generates various grease pencil lines from these objects with the help of the active scene camera. For example it can generate contour lines, intersection lines and crease lines to name a few. This is really useful as artists can then use 3D meshes to automatically generate grease pencil lines for characters, enviroments or other visualization purposes. These lines can then be baked and edited as regular grease pencil lines. Reviewed By: Sebastian Parborg, Antonio Vazquez, Matias Mendiola Differential Revision: http://developer.blender.org/D8758
Diffstat (limited to 'release/scripts/startup/bl_ui/properties_collection.py')
-rw-r--r--release/scripts/startup/bl_ui/properties_collection.py98
1 files changed, 98 insertions, 0 deletions
diff --git a/release/scripts/startup/bl_ui/properties_collection.py b/release/scripts/startup/bl_ui/properties_collection.py
new file mode 100644
index 00000000000..fa4c3cdb779
--- /dev/null
+++ b/release/scripts/startup/bl_ui/properties_collection.py
@@ -0,0 +1,98 @@
+# ##### 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_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")
+
+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")
+
+classes = (
+ COLLECTION_PT_collection_flags,
+ COLLECTION_PT_lineart_collection,
+ COLLECTION_PT_instancing,
+)
+
+if __name__ == "__main__": # only for live edit.
+ from bpy.utils import register_class
+ for cls in classes:
+ register_class(cls)