[Bf-blender-cvs] [c88e5512291] hair_guides_grooming: Revert "Cleanup: Temporarily removed all groom object type code, move it to a separate branch."

Lukas Tönne noreply at git.blender.org
Mon May 21 11:56:07 CEST 2018


Commit: c88e5512291f8e6e63306ba352e26f7bc440f3ba
Author: Lukas Tönne
Date:   Mon May 21 10:54:58 2018 +0100
Branches: hair_guides_grooming
https://developer.blender.org/rBc88e5512291f8e6e63306ba352e26f7bc440f3ba

Revert "Cleanup: Temporarily removed all groom object type code, move it to a separate branch."

This reverts commit b5fa901697ffe62287eae5186c0f29d118364897.

===================================================================

M	build_files/cmake/macros.cmake
M	release/scripts/startup/bl_ui/__init__.py
A	release/scripts/startup/bl_ui/properties_data_groom.py
M	release/scripts/startup/bl_ui/space_view3d.py
M	source/blender/CMakeLists.txt
M	source/blender/blenkernel/BKE_context.h
A	source/blender/blenkernel/BKE_groom.h
M	source/blender/blenkernel/BKE_library.h
M	source/blender/blenkernel/BKE_main.h
M	source/blender/blenkernel/CMakeLists.txt
M	source/blender/blenkernel/intern/context.c
A	source/blender/blenkernel/intern/groom.c
M	source/blender/blenkernel/intern/idcode.c
M	source/blender/blenkernel/intern/library.c
M	source/blender/blenkernel/intern/library_query.c
M	source/blender/blenkernel/intern/library_remap.c
M	source/blender/blenkernel/intern/object.c
M	source/blender/blenkernel/intern/object_update.c
M	source/blender/blenloader/intern/readfile.c
M	source/blender/blenloader/intern/writefile.c
M	source/blender/blentranslation/BLT_translation.h
M	source/blender/bmesh/CMakeLists.txt
M	source/blender/bmesh/intern/bmesh_opdefines.c
M	source/blender/bmesh/intern/bmesh_operators_private.h
M	source/blender/bmesh/intern/bmesh_walkers_impl.c
A	source/blender/bmesh/operators/bmo_face_island.c
M	source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
M	source/blender/depsgraph/intern/builder/deg_builder_nodes.h
M	source/blender/depsgraph/intern/builder/deg_builder_relations.cc
M	source/blender/depsgraph/intern/builder/deg_builder_relations.h
M	source/blender/depsgraph/intern/depsgraph_tag.cc
M	source/blender/draw/CMakeLists.txt
M	source/blender/draw/engines/eevee/eevee_materials.c
M	source/blender/draw/intern/draw_cache.c
M	source/blender/draw/intern/draw_cache.h
M	source/blender/draw/intern/draw_cache_impl.h
A	source/blender/draw/intern/draw_cache_impl_groom.c
M	source/blender/draw/intern/draw_manager.c
M	source/blender/draw/modes/draw_mode_engines.h
A	source/blender/draw/modes/edit_groom_mode.c
M	source/blender/draw/modes/object_mode.c
A	source/blender/draw/modes/shaders/edit_groom_overlay_frag.glsl
A	source/blender/draw/modes/shaders/edit_groom_overlay_loosevert_vert.glsl
M	source/blender/editors/CMakeLists.txt
A	source/blender/editors/groom/CMakeLists.txt
A	source/blender/editors/groom/editgroom.c
A	source/blender/editors/groom/editgroom_region.c
A	source/blender/editors/groom/editgroom_select.c
A	source/blender/editors/groom/groom_hair.c
A	source/blender/editors/groom/groom_intern.h
A	source/blender/editors/groom/groom_ops.c
A	source/blender/editors/include/ED_groom.h
M	source/blender/editors/include/ED_screen.h
M	source/blender/editors/include/ED_view3d.h
M	source/blender/editors/include/UI_icons.h
M	source/blender/editors/object/object_add.c
M	source/blender/editors/object/object_edit.c
M	source/blender/editors/object/object_intern.h
M	source/blender/editors/object/object_modes.c
M	source/blender/editors/object/object_ops.c
M	source/blender/editors/object/object_relations.c
M	source/blender/editors/screen/screen_ops.c
M	source/blender/editors/space_api/spacetypes.c
M	source/blender/editors/space_buttons/buttons_context.c
M	source/blender/editors/space_outliner/outliner_draw.c
M	source/blender/editors/space_outliner/outliner_intern.h
M	source/blender/editors/space_outliner/outliner_tree.c
M	source/blender/editors/space_view3d/space_view3d.c
M	source/blender/editors/space_view3d/view3d_iterators.c
M	source/blender/editors/space_view3d/view3d_select.c
M	source/blender/editors/transform/transform.h
M	source/blender/editors/transform/transform_conversions.c
M	source/blender/editors/transform/transform_generics.c
M	source/blender/makesdna/DNA_ID.h
A	source/blender/makesdna/DNA_groom_types.h
M	source/blender/makesdna/DNA_object_types.h
M	source/blender/makesdna/DNA_scene_types.h
M	source/blender/makesdna/intern/makesdna.c
M	source/blender/makesrna/RNA_access.h
M	source/blender/makesrna/intern/CMakeLists.txt
M	source/blender/makesrna/intern/makesrna.c
M	source/blender/makesrna/intern/rna_ID.c
A	source/blender/makesrna/intern/rna_groom.c
M	source/blender/makesrna/intern/rna_internal.h
M	source/blender/makesrna/intern/rna_main_api.c
M	source/blender/makesrna/intern/rna_object.c
M	source/blender/makesrna/intern/rna_scene.c
M	source/blender/makesrna/intern/rna_sculpt_paint.c
M	source/blender/windowmanager/WM_types.h
M	source/blender/windowmanager/intern/wm_keymap.c

===================================================================

diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake
index 3bb435fa892..818a4f1764e 100644
--- a/build_files/cmake/macros.cmake
+++ b/build_files/cmake/macros.cmake
@@ -610,6 +610,7 @@ function(SETUP_BLENDER_SORTED_LIBS)
 		bf_editor_datafiles
 		bf_editor_mask
 		bf_editor_io
+		bf_editor_groom
 
 		bf_render
 		bf_python
diff --git a/release/scripts/startup/bl_ui/__init__.py b/release/scripts/startup/bl_ui/__init__.py
index ae0e8dac6bb..09094c941e2 100644
--- a/release/scripts/startup/bl_ui/__init__.py
+++ b/release/scripts/startup/bl_ui/__init__.py
@@ -34,6 +34,7 @@ _modules = [
     "properties_data_camera",
     "properties_data_curve",
     "properties_data_empty",
+    "properties_data_groom",
     "properties_data_lamp",
     "properties_data_lattice",
     "properties_data_mesh",
diff --git a/release/scripts/startup/bl_ui/properties_data_groom.py b/release/scripts/startup/bl_ui/properties_data_groom.py
new file mode 100644
index 00000000000..2e6a9661714
--- /dev/null
+++ b/release/scripts/startup/bl_ui/properties_data_groom.py
@@ -0,0 +1,136 @@
+# ##### 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>
+import bpy
+from bpy.types import Menu, Panel
+from rna_prop_ui import PropertyPanel
+
+
+class GROOM_UL_bundles(bpy.types.UIList):
+    def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index, flt_flag):
+        groom = data
+        bundle = item
+
+        if self.layout_type in {'DEFAULT', 'COMPACT'}:
+            row = layout.row(align=True)
+            if not bundle.is_bound:
+                row.label(icon='ERROR')
+            if groom.scalp_object:
+                row.prop_search(bundle, "scalp_facemap", groom.scalp_object, "face_maps", text="")
+            else:
+                row.prop(bundle, "scalp_facemap", text="")
+
+        elif self.layout_type == 'GRID':
+            layout.alignment = 'CENTER'
+            layout.label(text="", icon_value=icon)
+
+
+class DataButtonsPanel:
+    bl_space_type = 'PROPERTIES'
+    bl_region_type = 'WINDOW'
+    bl_context = "data"
+
+    @classmethod
+    def poll(cls, context):
+        return context.groom
+
+
+class DATA_PT_context_groom(DataButtonsPanel, Panel):
+    bl_label = ""
+    bl_options = {'HIDE_HEADER'}
+
+    def draw(self, context):
+        layout = self.layout
+        ob = context.object
+        groom = context.groom
+        space = context.space_data
+
+        split = layout.split(percentage=0.65)
+
+        if ob:
+            split.template_ID(ob, "data")
+        elif groom:
+            split.template_ID(space, "pin_id")
+
+
+class DATA_PT_groom(DataButtonsPanel, Panel):
+    bl_label = "Groom"
+
+    def draw(self, context):
+        layout = self.layout
+
+        groom = context.groom
+
+        layout.template_list("GROOM_UL_bundles", "bundles",
+                             groom, "bundles",
+                             groom.bundles, "active_index")
+
+        split = layout.split()
+
+        col = split.column()
+        col.label("Scalp Object:")
+        col.prop(groom, "scalp_object", "")
+
+        col = split.column()
+        col.label("Curves:")
+        col.prop(groom, "curve_resolution", "Resolution")
+
+
+class DATA_PT_groom_hair(DataButtonsPanel, Panel):
+    bl_label = "Hair"
+
+    def draw(self, context):
+        layout = self.layout
+        groom = context.groom
+
+        layout.operator("groom.hair_distribute")
+
+
+class DATA_PT_groom_draw_settings(DataButtonsPanel, Panel):
+    bl_label = "Draw Settings"
+
+    def draw(self, context):
+        layout = self.layout
+        groom = context.groom
+        ds = groom.hair_draw_settings
+
+        split = layout.split()
+        col = split.column()
+        col.label("Follicles:")
+        col.prop(ds, "follicle_mode", expand=True)
+
+
+class DATA_PT_custom_props_groom(DataButtonsPanel, PropertyPanel, Panel):
+    _context_path = "object.data"
+    _property_type = bpy.types.Groom
+
+
+classes = (
+    GROOM_UL_bundles,
+    DATA_PT_context_groom,
+    DATA_PT_groom,
+    DATA_PT_groom_hair,
+    DATA_PT_groom_draw_settings,
+    DATA_PT_custom_props_groom,
+)
+
+if __name__ == "__main__":  # only for live edit.
+    from bpy.utils import register_class
+    for cls in classes:
+        register_class(cls)
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index f20e9021e28..097ba2f73e7 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -77,7 +77,10 @@ class VIEW3D_HT_header(Header):
             # mode = obj.mode
 
             # Particle edit
-            if mode == 'PARTICLE_EDIT':
+            if mode == 'EDIT' and obj.type == 'GROOM':
+                row = layout.row()
+                row.prop(toolsettings.groom_edit_settings, "mode", text="", expand=True)
+            elif mode == 'PARTICLE_EDIT':
                 row = layout.row()
                 row.prop(toolsettings.particle_edit, "select_mode", text="", expand=True)
 
@@ -150,6 +153,8 @@ class VIEW3D_MT_editor_menus(Menu):
             layout.menu("INFO_MT_surface_add", text="Add")
         elif mode_string == 'EDIT_METABALL':
             layout.menu("INFO_MT_metaball_add", text="Add")
+        elif mode_string == 'EDIT_GROOM':
+            layout.menu("INFO_MT_groom_add", text="Add")
         elif mode_string == 'EDIT_ARMATURE':
             layout.menu("INFO_MT_edit_armature_add", text="Add")
 
@@ -1221,6 +1226,17 @@ class INFO_MT_metaball_add(Menu):
         layout.operator_enum("object.metaball_add", "type")
 
 
+class INFO_MT_groom_add(Menu):
+    bl_idname = "INFO_MT_groom_add"
+    bl_label = "Groom"
+
+    def draw(self, context):
+        layout = self.layout
+
+        layout.operator_context = 'INVOKE_REGION_WIN'
+        layout.operator("object.groom_add")
+
+
 class INFO_MT_edit_curve_add(Menu):
     bl_idname = "INFO_MT_edit_curve_add"
     bl_label = "Add"
@@ -1311,6 +1327,7 @@ class INFO_MT_add(Menu):
         # layout.operator_menu_enum("object.surface_add", "type", text="Surface", icon='OUTLINER_OB_SURFACE')
         layout.menu("INFO_MT_surface_add", icon='OUTLINER_OB_SURFACE')
         layout.menu("INFO_MT_metaball_add", text="Metaball", icon='OUTLINER_OB_META')
+        layout.menu("INFO_MT_groom_add", text="Groom", icon='OUTLINER_OB_GROOM')
         layout.operator("object.text_add", text="Text", icon='OUTLINER_OB_FONT')
         layout.separator()
 
@@ -3153,6 +3170,28 @@ class VIEW3D_MT_edit_lattice(Menu):
         layout.menu("VIEW3D_MT_edit_proportional")
 
 
+class VIEW3D_MT_edit_groom(Menu):
+    bl_label = "Groom"
+
+    def draw(self, context):
+        layout = self.layout
+
+        edit_object = context.edit_object
+        groom = edit_object.data
+
+        layout.menu("VIEW3D_MT_undo_redo")
+
+        layout.separator()
+
+        layout.menu("VIEW3D_MT_transform")
+        layout.menu("VIEW3D_MT_mirror")
+        layout.menu("VIEW3D_MT_snap")
+
+        layout.separator()
+
+        layout.operator("groom.region_add")
+
+
 class VIEW3D_MT_edit_armature(Menu):
     bl_label = "Armature"
 
@@ -3956,6 +3995,7 @@ classes = (
     INFO_MT_curve_add,
     INFO_MT_surface_add,
     INFO_MT_metaball_add,
+    INFO_MT_groom_add,
     INFO_MT_edit_curve_add,
     INFO_MT_edit_armature_add,
     INFO_MT_armature_add,
@@ -4035,6 +4075,7 @@ classes = (
     VIEW3D_MT_edit_meta,
     VIEW3D_MT_edit_meta_showhide,
     VIEW3D_MT_edit_lattice,
+    VIEW3D_MT_edit_groom,
     VIEW3D_MT_edit_armature,
     VIEW3D_MT_armature_specials,
     VIEW3D_MT_edit_armature_parent,
diff --git a/source/blender/CMakeLists.txt b/source/blender/CMakeLists.txt
index c3b15845cf7..b88e5e88cfe 100644
--- a/source/blender/CMakeLists.txt
+++ b/source/blender/CMakeLists.txt
@@ -46,6 +46,7 @@ set(SRC_DNA_INC
 	${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_genfile.h
 	${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_gpencil_types.h
 	${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_gpu_types.h
+	${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_groom_types.h
 	${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_group_types.h
 	${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_hair_types.h
 	${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_image_types.h
diff --git a/source/blender/blenkernel/BKE_context.h b/source/blender/blenkernel/BKE_context.h
index e224863a27f..4277e957aa9 100644
--- a/source/blender/blenkernel/BKE_context.h
+++ b/source/blender/blenkernel/BKE_context.h
@@ -113,6 +113,7 @@ enum {
 	CTX_MODE_EDIT_ARMATURE,
 	CTX_MODE_EDIT_METABALL,
 	CTX_MODE_EDIT_LATTICE,
+	CTX_MODE_EDIT_GROOM,
 	CTX_MODE_POSE,
 	CTX_MODE_SCULPT,
 	CTX_MODE_PAINT_WEIGHT,
diff --git a/source/blender/blenkernel/BKE_groom.h b/source/blender/blenkernel/BKE_groom.h
new file mode 100644
index 00000000000..ef15223dd45
--- /dev/null
+++ b/source/blender/blenkernel/BKE_groom.h
@@ -0,0 +1,125 @@
+/*
+ * ***** 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 ha

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list