[Bf-blender-cvs] [35823bb99e4] greasepencil-experimental: Merge branch 'greasepencil-object'

Sergey Sharybin noreply at git.blender.org
Sat Jan 5 08:22:11 CET 2019


Commit: 35823bb99e44672125ba76ff9bbd94a2ede8920b
Author: Sergey Sharybin
Date:   Fri Jan 4 11:41:35 2019 +0000
Branches: greasepencil-experimental
https://developer.blender.org/rB35823bb99e44672125ba76ff9bbd94a2ede8920b

Merge branch 'greasepencil-object'

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

M	release/scripts/presets/keyconfig/keymap_data/blender_default.py
M	release/scripts/startup/bl_operators/wm.py
M	release/scripts/startup/bl_ui/space_image.py
M	release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
M	release/scripts/startup/bl_ui/space_topbar.py
M	source/blender/blenkernel/BKE_particle.h
M	source/blender/blenkernel/BKE_subdiv.h
M	source/blender/blenkernel/BKE_subdiv_eval.h
M	source/blender/blenkernel/intern/gpencil.c
M	source/blender/blenkernel/intern/gpencil_modifier.c
M	source/blender/blenkernel/intern/particle.c
M	source/blender/blenkernel/intern/subdiv_displacement_multires.c
M	source/blender/blenkernel/intern/subdiv_eval.c
M	source/blender/blenloader/intern/readfile.c
M	source/blender/blenloader/intern/versioning_280.c
M	source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
M	source/blender/draw/engines/eevee/eevee_depth_of_field.c
M	source/blender/editors/gpencil/gpencil_edit.c
M	source/blender/editors/gpencil/gpencil_select.c
M	source/blender/editors/gpencil/gpencil_utils.c
M	source/blender/editors/include/ED_gpencil.h
M	source/blender/editors/include/ED_object.h
M	source/blender/editors/include/UI_interface.h
M	source/blender/editors/interface/interface_layout.c
M	source/blender/editors/interface/interface_region_menu_popup.c
M	source/blender/editors/interface/interface_templates.c
M	source/blender/editors/interface/view2d.c
M	source/blender/editors/mask/mask_add.c
M	source/blender/editors/mask/mask_intern.h
M	source/blender/editors/mask/mask_ops.c
M	source/blender/editors/object/object_modifier.c
M	source/blender/editors/physics/particle_edit.c
M	source/blender/editors/screen/screen_ops.c
M	source/blender/editors/space_node/drawnode.c
M	source/blender/editors/space_node/node_intern.h
M	source/blender/editors/space_outliner/outliner_draw.c
M	source/blender/editors/space_outliner/outliner_intern.h
M	source/blender/editors/space_outliner/space_outliner.c
M	source/blender/editors/space_text/text_draw.c
M	source/blender/editors/space_view3d/view3d_buttons.c
M	source/blender/editors/transform/transform.c
M	source/blender/editors/transform/transform_conversions.c
M	source/blender/editors/transform/transform_generics.c
M	source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp
M	source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp
M	source/blender/freestyle/intern/python/BPy_SShape.cpp
M	source/blender/freestyle/intern/python/BPy_ViewShape.cpp
M	source/blender/freestyle/intern/scene_graph/Rep.h
M	source/blender/freestyle/intern/view_map/Silhouette.h
M	source/blender/freestyle/intern/view_map/ViewMap.h
M	source/blender/freestyle/intern/winged_edge/WEdge.h
M	source/blender/gpu/intern/gpu_extensions.c
M	source/blender/makesdna/DNA_scene_types.h
M	source/blender/makesrna/intern/rna_scene.c
M	source/blender/makesrna/intern/rna_sculpt_paint.c
M	source/blender/modifiers/intern/MOD_mirror.c
M	source/blender/windowmanager/intern/wm_window.c

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

diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
index e3955959a8d..2b46e39beb0 100644
--- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py
+++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
@@ -152,6 +152,12 @@ def _template_items_select_actions(params, operator):
             (operator, {"type": 'I', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'INVERT')]}),
             (operator, {"type": 'A', "value": 'DOUBLE_CLICK'}, {"properties": [("action", 'DESELECT')]}),
         ]
+    elif params.legacy:
+        # Alt+A is for playback in legacy keymap.
+        return [
+            (operator, {"type": 'A', "value": 'PRESS'}, {"properties": [("action", 'TOGGLE')]}),
+            (operator, {"type": 'I', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'INVERT')]}),
+        ]
     else:
         return [
             (operator, {"type": 'A', "value": 'PRESS'}, {"properties": [("action", 'TOGGLE')]}),
@@ -767,6 +773,7 @@ def km_uv_editor(params):
          {"properties": [("data_path", 'tool_settings.use_snap')]}),
         ("wm.context_menu_enum", {"type": 'TAB', "value": 'PRESS', "shift": True, "ctrl": True},
          {"properties": [("data_path", 'tool_settings.snap_uv_element')]}),
+        op_menu("IMAGE_MT_uvs_specials", params.context_menu_event),
     ])
 
     # 3D cursor
@@ -1411,7 +1418,6 @@ def km_image_generic(params):
         ("image.save_as", {"type": 'S', "value": 'PRESS', "shift": True}, None),
         ("image.properties", {"type": 'N', "value": 'PRESS'}, None),
         ("image.toolshelf", {"type": 'T', "value": 'PRESS'}, None),
-        op_menu("IMAGE_MT_specials", params.context_menu_event),
         ("image.cycle_render_slot", {"type": 'J', "value": 'PRESS'}, None),
         ("image.cycle_render_slot", {"type": 'J', "value": 'PRESS', "alt": True},
          {"properties": [("reverse", True)]}),
diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py
index b8db041710c..2cdcca562c7 100644
--- a/release/scripts/startup/bl_operators/wm.py
+++ b/release/scripts/startup/bl_operators/wm.py
@@ -1483,9 +1483,19 @@ class WM_OT_copy_prev_settings(Operator):
 
         old = cls._old_path()
         new = cls._new_path()
+
+        # Disable operator in case config path is overriden with environment
+        # variable. That case has no automatic per-version configuration.
+        userconfig_path = os.path.normpath(bpy.utils.user_resource('CONFIG'))
+        new_userconfig_path = os.path.normpath(os.path.join(new, "config"))
+        if userconfig_path != new_userconfig_path:
+            return False
+
+        # Enable operator if new config path does not exist yet.
         if os.path.isdir(old) and not os.path.isdir(new):
             return True
 
+        # Enable operator also if there are no new user preference yet.
         old_userpref = os.path.join(old, "config", "userpref.blend")
         new_userpref = os.path.join(new, "config", "userpref.blend")
         return os.path.isfile(old_userpref) and not os.path.isfile(new_userpref)
@@ -2693,8 +2703,8 @@ class WM_MT_splash(Menu):
         # Draw setup screen if no preferences have been saved yet.
         import os
 
-        user_path = bpy.utils.resource_path('USER')
-        userdef_path = os.path.join(user_path, "config", "userpref.blend")
+        userconfig_path = bpy.utils.user_resource('CONFIG');
+        userdef_path = os.path.join(userconfig_path, "userpref.blend")
 
         if not os.path.isfile(userdef_path):
             self.draw_setup(context)
diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py
index 69f319b4e03..f3f49d82714 100644
--- a/release/scripts/startup/bl_ui/space_image.py
+++ b/release/scripts/startup/bl_ui/space_image.py
@@ -438,7 +438,7 @@ class IMAGE_MT_uvs_select_mode(Menu):
             props.data_path = "tool_settings.uv_select_mode"
 
 
-class IMAGE_MT_specials(Menu):
+class IMAGE_MT_uvs_specials(Menu):
     bl_label = "UV Context Menu"
 
     def draw(self, context):
@@ -1325,7 +1325,7 @@ classes = (
     IMAGE_MT_uvs_mirror,
     IMAGE_MT_uvs_weldalign,
     IMAGE_MT_uvs_select_mode,
-    IMAGE_MT_specials,
+    IMAGE_MT_uvs_specials,
     IMAGE_MT_pivot_pie,
     IMAGE_MT_uvs_snap_pie,
     IMAGE_HT_header,
diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
index 18c4d8710ec..84413f6c40a 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
@@ -1134,7 +1134,7 @@ class _defs_gpencil_edit:
     @ToolDef.from_fn
     def select():
         def draw_settings(context, layout, tool):
-            pass
+            layout.prop(context.tool_settings.gpencil_sculpt, "isect_threshold")
         return dict(
             text="Select",
             icon="ops.generic.select",
@@ -1148,6 +1148,7 @@ class _defs_gpencil_edit:
         def draw_settings(context, layout, tool):
             props = tool.operator_properties("gpencil.select_box")
             layout.prop(props, "mode", expand=True)
+            layout.prop(context.tool_settings.gpencil_sculpt, "isect_threshold")
         return dict(
             text="Select Box",
             icon="ops.generic.select_box",
@@ -1161,6 +1162,7 @@ class _defs_gpencil_edit:
         def draw_settings(context, layout, tool):
             props = tool.operator_properties("gpencil.select_lasso")
             layout.prop(props, "mode", expand=True)
+            layout.prop(context.tool_settings.gpencil_sculpt, "isect_threshold")
         return dict(
             text="Select Lasso",
             icon="ops.generic.select_lasso",
@@ -1171,11 +1173,14 @@ class _defs_gpencil_edit:
 
     @ToolDef.from_fn
     def circle_select():
+        def draw_settings(context, layout, tool):
+            layout.prop(context.tool_settings.gpencil_sculpt, "isect_threshold")
         return dict(
             text="Select Circle",
             icon="ops.generic.select_circle",
             widget=None,
             keymap=(),
+            draw_settings=draw_settings,
         )
 
     @ToolDef.from_fn
diff --git a/release/scripts/startup/bl_ui/space_topbar.py b/release/scripts/startup/bl_ui/space_topbar.py
index 077003bc6ae..0757481f882 100644
--- a/release/scripts/startup/bl_ui/space_topbar.py
+++ b/release/scripts/startup/bl_ui/space_topbar.py
@@ -301,9 +301,11 @@ class _draw_left_context_mode:
             is_paint = True
             if tool.name in {"Line", "Box", "Circle", "Arc", "Curve"}:
                 is_paint = False
-            elif not tool.has_datablock:
-                return
             elif tool.name == "Cutter":
+                row = layout.row(align=True)
+                row.prop(context.tool_settings.gpencil_sculpt, "isect_threshold")
+                return
+            elif not tool.has_datablock:
                 return
 
             paint = context.tool_settings.gpencil_paint
diff --git a/source/blender/blenkernel/BKE_particle.h b/source/blender/blenkernel/BKE_particle.h
index cf123f78ae0..5a1241f1de2 100644
--- a/source/blender/blenkernel/BKE_particle.h
+++ b/source/blender/blenkernel/BKE_particle.h
@@ -303,7 +303,19 @@ void psys_set_current_num(Object *ob, int index);
 
 struct LatticeDeformData *psys_create_lattice_deform_data(struct ParticleSimulationData *sim);
 
+/* For a given evaluated particle system get its original.
+ *
+ * If this input is an original particle system already, the return value is the
+ * same as the input. */
 struct ParticleSystem *psys_orig_get(struct ParticleSystem *psys);
+
+
+/* For a given original object and its particle system, get evaluated particle
+ * system within a given dependency graph. */
+struct ParticleSystem *psys_eval_get(struct Depsgraph *depsgraph,
+                                     struct Object *object,
+                                     struct ParticleSystem *psys);
+
 bool psys_in_edit_mode(struct Depsgraph *depsgraph, const struct ParticleSystem *psys);
 bool psys_check_enabled(struct Object *ob, struct ParticleSystem *psys, const bool use_render_params);
 bool psys_check_edited(struct ParticleSystem *psys);
diff --git a/source/blender/blenkernel/BKE_subdiv.h b/source/blender/blenkernel/BKE_subdiv.h
index 0a09d3528b4..70572d30819 100644
--- a/source/blender/blenkernel/BKE_subdiv.h
+++ b/source/blender/blenkernel/BKE_subdiv.h
@@ -88,8 +88,7 @@ typedef struct SubdivStats {
 		struct {
 			/* Time spend on creating topology refiner, which includes time
 			 * spend on conversion from Blender data to OpenSubdiv data, and
-			 * time spend on topology orientation on OpenSubdiv C-API side.
-			 */
+			 * time spend on topology orientation on OpenSubdiv C-API side. */
 			double topology_refiner_creation_time;
 			/* Total time spent in BKE_subdiv_to_mesh(). */
 			double subdiv_to_mesh_time;
@@ -108,13 +107,19 @@ typedef struct SubdivStats {
 	};
 
 	/* Per-value timestamp on when corresponding BKE_subdiv_stats_begin() was
-	 * called.
-	 */
+	 * called. */
 	double begin_timestamp_[NUM_SUBDIV_STATS_VALUES];
 } SubdivStats;
 
 /* Functor which evaluates dispalcement at a given (u, v) of given ptex face. */
 typedef struct SubdivDisplacement {
+	/* Initialize displacement evaluator.
+	 *
+	 * Is called right before evaluation is actually needed. This allows to do
+	 * some lazy initialization, like allocate evaluator from a main thread but
+	 * then do actual evaluation from background job. */
+	void (*initialize)(struct SubdivDisplacement *displacement);
+
 	/* Return displacement which is to be added to the original coordinate.
 	 *
 	 * NOTE: This function is supposed to return "continuous" displacement for
@@ -124,8 +129,7 @@ typedef struct SubdivDisplacement {
 	 * displacement grids if needed.
 	 *
 	 * Averaging of displacement for vertices created for over coarse vertices
-	 * and edges is done by subdiv code.
-	 */
+	 * and edges is done by subdiv code. */
 	void (*eval_displacement)(struct SubdivDisplacement *displacement,
 	   

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list