[Bf-blender-cvs] [f91b797b2b6] blender2.8: Tool System: remove duplicate gpencil draw UI

2018-11-14 Thread Campbell Barton
Commit: f91b797b2b6b9d02721c8bf7449602d9f839a15b
Author: Campbell Barton
Date:   Wed Nov 14 19:19:04 2018 +1100
Branches: blender2.8
https://developer.blender.org/rBf91b797b2b6b9d02721c8bf7449602d9f839a15b

Tool System: remove duplicate gpencil draw UI

Tool properties showed options twice.

===

M   release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
M   release/scripts/startup/bl_ui/space_topbar.py

===

diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py 
b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
index cea897ae8e9..86d2fe88c39 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
@@ -1214,50 +1214,8 @@ class _defs_gpencil_paint:
 ),
 )
 
-@staticmethod
-def draw_color_selector(context, layout, gp_settings):
-ma = gp_settings.material
-row = layout.row(align=True)
-
-icon_id = 0
-if ma:
-icon_id = ma.id_data.preview.icon_id
-txt_ma = ma.name
-maxw = 25
-if len(txt_ma) > maxw:
-txt_ma = txt_ma[:maxw - 5] + '..' + txt_ma[-3:]
-else:
-txt_ma = ""
-
-row.label(text="Material:")
-sub = row.row()
-sub.ui_units_x = 8
-sub.popover(
-panel="TOPBAR_PT_gpencil_materials",
-text=txt_ma,
-icon_value=icon_id,
-)
-
-row.prop(gp_settings, "use_material_pin", text="")
-
-def draw_settings_common(context, layout, tool):
-row = layout.row(align=True)
-ts = context.scene.tool_settings
-gp_settings = ts.gpencil_paint
-brush = gp_settings.brush
-gp_brush = brush.gpencil_settings
-row.template_ID_preview(gp_settings, "brush", rows=3, cols=8, 
hide_buttons=True)
-
-if brush and brush.gpencil_tool == 'DRAW':
-row = layout.row(align=True)
-row.prop(brush, "size", text="Radius")
-row = layout.row(align=True)
-row.prop(gp_brush, "pen_strength", slider=True)
-
-_defs_gpencil_paint.draw_color_selector(context, layout, gp_brush)
-
-@ToolDef.from_fn.with_args(draw_settings=draw_settings_common)
-def line(*, draw_settings):
+@ToolDef.from_fn
+def line():
 return dict(
 text="Line",
 icon="ops.gpencil.primitive_line",
@@ -1267,11 +1225,10 @@ class _defs_gpencil_paint:
  dict(type='LINE', wait_for_input=False),
  dict(type='EVT_TWEAK_A', value='ANY')),
 ),
-draw_settings=draw_settings,
 )
 
-@ToolDef.from_fn.with_args(draw_settings=draw_settings_common)
-def box(*, draw_settings):
+@ToolDef.from_fn
+def box():
 return dict(
 text="Box",
 icon="ops.gpencil.primitive_box",
@@ -1281,11 +1238,10 @@ class _defs_gpencil_paint:
  dict(type='BOX', wait_for_input=False),
  dict(type='EVT_TWEAK_A', value='ANY')),
 ),
-draw_settings=draw_settings,
 )
 
-@ToolDef.from_fn.with_args(draw_settings=draw_settings_common)
-def circle(*, draw_settings):
+@ToolDef.from_fn
+def circle():
 return dict(
 text="Circle",
 icon="ops.gpencil.primitive_circle",
@@ -1295,7 +1251,6 @@ class _defs_gpencil_paint:
  dict(type='CIRCLE', wait_for_input=False),
  dict(type='EVT_TWEAK_A', value='ANY')),
 ),
-draw_settings=draw_settings,
 )
 
 
diff --git a/release/scripts/startup/bl_ui/space_topbar.py 
b/release/scripts/startup/bl_ui/space_topbar.py
index 5d2e98bdd8a..6fffba1fe39 100644
--- a/release/scripts/startup/bl_ui/space_topbar.py
+++ b/release/scripts/startup/bl_ui/space_topbar.py
@@ -297,8 +297,13 @@ class _draw_left_context_mode:
 
 @staticmethod
 def GPENCIL_PAINT(context, layout, tool):
+if tool is None:
+return
 
-if (tool is None) or (not tool.has_datablock):
+is_paint = True
+if (tool.name in {"Line", "Box", "Circle"}):
+is_paint = False
+elif (not tool.has_datablock):
 return
 
 paint = context.tool_settings.gpencil_paint
@@ -358,13 +363,15 @@ class _draw_left_context_mode:
 row.prop(gp_settings, "fill_draw_mode", text="")
 row.prop(gp_settings, "show_fill_boundary", text="", 
icon='GRID')
 
-else:  # bgpsettings.tool == 'DRAW':
+else:  # brush.gpencil_tool == 'DRAW':
 row = layout.row(align=True)
 row.prop(brush, "size", text="Radius")
-row.prop(gp_settings, "use_pressure", text="", 

[Bf-blender-cvs] [c3d03b4434c] blender2.8: Lamps: Remove HEMI light type

2018-11-14 Thread Clément Foucault
Commit: c3d03b4434c8554bbfff6cdc549bb089dec1da28
Author: Clément Foucault
Date:   Wed Nov 14 11:44:05 2018 +0100
Branches: blender2.8
https://developer.blender.org/rBc3d03b4434c8554bbfff6cdc549bb089dec1da28

Lamps: Remove HEMI light type

This type is not supported by either Eevee or Cycles. If other types of
lamps are needed by external engines, we should support adding custom types.

===

M   intern/cycles/blender/addon/ui.py
M   intern/cycles/blender/blender_object.cpp
M   source/blender/blenloader/intern/versioning_280.c
M   source/blender/collada/DocumentImporter.cpp
M   source/blender/collada/LightExporter.cpp
M   source/blender/draw/modes/object_mode.c
M   source/blender/editors/object/object_add.c
M   source/blender/editors/object/object_transform.c
M   source/blender/editors/space_outliner/outliner_draw.c
M   source/blender/editors/space_view3d/view3d_gizmo_lamp.c
M   source/blender/makesdna/DNA_lamp_types.h
M   source/blender/makesrna/intern/rna_lamp.c

===

diff --git a/intern/cycles/blender/addon/ui.py 
b/intern/cycles/blender/addon/ui.py
index 6372a2f5eba..e0bea93e1c2 100644
--- a/intern/cycles/blender/addon/ui.py
+++ b/intern/cycles/blender/addon/ui.py
@@ -1371,9 +1371,6 @@ class CYCLES_LIGHT_PT_light(CyclesButtonsPanel, Panel):
 if light.type == 'AREA':
 col.prop(clamp, "is_portal", text="Portal")
 
-if light.type == 'HEMI':
-layout.label(text="Not supported, interpreted as sun light")
-
 
 class CYCLES_LIGHT_PT_nodes(CyclesButtonsPanel, Panel):
 bl_label = "Nodes"
diff --git a/intern/cycles/blender/blender_object.cpp 
b/intern/cycles/blender/blender_object.cpp
index dcadc735b8e..a57edf9b940 100644
--- a/intern/cycles/blender/blender_object.cpp
+++ b/intern/cycles/blender/blender_object.cpp
@@ -145,11 +145,12 @@ void BlenderSync::sync_light(BL::Object& b_parent,
light->spot_smooth = b_spot_light.spot_blend();
break;
}
-   case BL::Light::type_HEMI: {
-   light->type = LIGHT_DISTANT;
-   light->size = 0.0f;
-   break;
-   }
+   /* Hemi were removed from 2.8 */
+   // case BL::Light::type_HEMI: {
+   //  light->type = LIGHT_DISTANT;
+   //  light->size = 0.0f;
+   //  break;
+   // }
case BL::Light::type_SUN: {
BL::SunLight b_sun_light(b_light);
light->size = b_sun_light.shadow_soft_size();
diff --git a/source/blender/blenloader/intern/versioning_280.c 
b/source/blender/blenloader/intern/versioning_280.c
index a72304a6d92..2049856cfa6 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -2258,6 +2258,13 @@ void blo_do_versions_280(FileData *fd, Library 
*UNUSED(lib), Main *bmain)
}
}
 
+   for (Lamp *la = bmain->lamp.first; la; la = la->id.next) {
+   /* Removed Hemi lights. */
+   if (!ELEM(la->type, LA_LOCAL, LA_SUN, LA_SPOT, 
LA_AREA)) {
+   la->type = LA_SUN;
+   }
+   }
+
if (!DNA_struct_elem_find(fd->filesdna, "Brush", "char", 
"weightpaint_tool")) {
/* Magic defines from old files (2.7x) */
 
diff --git a/source/blender/collada/DocumentImporter.cpp 
b/source/blender/collada/DocumentImporter.cpp
index 50a9e351bc6..f10252c01c5 100644
--- a/source/blender/collada/DocumentImporter.cpp
+++ b/source/blender/collada/DocumentImporter.cpp
@@ -1200,7 +1200,8 @@ bool DocumentImporter::writeLight(const COLLADAFW::Light 
*light)
switch (type) {
case COLLADAFW::Light::AMBIENT_LIGHT:
{
-   lamp->type = LA_HEMI;
+   /* TODO Fix */
+   // lamp->type = LA_HEMI;
}
break;
case COLLADAFW::Light::SPOT_LIGHT:
diff --git a/source/blender/collada/LightExporter.cpp 
b/source/blender/collada/LightExporter.cpp
index 11377e06ce8..53fcbd1bb1a 100644
--- a/source/blender/collada/LightExporter.cpp
+++ b/source/blender/collada/LightExporter.cpp
@@ -90,13 +90,14 @@ void LightsExporter::operator()(Object *ob)
addLight(cla);
}
// hemi
-   else if (la->type == LA_HEMI) {
-   COLLADASW::AmbientLight cla(mSW, la_id, la_name);
-   cla.setColor(col, false, "color");
-   cla.setConstantAttenuation(constatt);
-   exportBlenderProfile(cla, la);
-   

[Bf-blender-cvs] [61ecd3d24e0] blender2.8: minor cleanup

2018-11-14 Thread Jacques Lucke
Commit: 61ecd3d24e0cc20bd9ec4e4282a100e241fcf190
Author: Jacques Lucke
Date:   Wed Nov 14 13:04:12 2018 +0100
Branches: blender2.8
https://developer.blender.org/rB61ecd3d24e0cc20bd9ec4e4282a100e241fcf190

minor cleanup

===

M   source/blender/python/gpu/gpu_py_shader.c

===

diff --git a/source/blender/python/gpu/gpu_py_shader.c 
b/source/blender/python/gpu/gpu_py_shader.c
index eeacd087884..3b2665cc4a2 100644
--- a/source/blender/python/gpu/gpu_py_shader.c
+++ b/source/blender/python/gpu/gpu_py_shader.c
@@ -697,9 +697,9 @@ static PyObject *bpygpu_shader_unbind(BPyGPUShader 
*UNUSED(self))
 PyDoc_STRVAR(bpygpu_shader_from_builtin_doc,
 ".. function:: from_builtin(shader_name)\n"
 "\n"
-"Shaders that are embedded in the blender internal code.\n"
-"They all read the uniform 'mat4 ModelViewProjectionMatrix', which can be 
edited by the 'gpu.matrix' module.\n"
-"For more details, you can check the shader code with the function 
'gpu.shader.code_from_builtin';\n"
+"   Shaders that are embedded in the blender internal code.\n"
+"   They all read the uniform 'mat4 ModelViewProjectionMatrix', which can be 
edited by the 'gpu.matrix' module.\n"
+"   For more details, you can check the shader code with the function 
'gpu.shader.code_from_builtin';\n"
 "\n"
 "   :param shader_name: One of these builtin shader names: {\n"
 "   '2D_UNIFORM_COLOR',\n"
@@ -710,8 +710,8 @@ PyDoc_STRVAR(bpygpu_shader_from_builtin_doc,
 "   '3D_FLAT_COLOR',\n"
 "   '3D_SMOOTH_COLOR'}\n"
 "   :type shader_name: str\n"
-"   :return: the shader object\n"
-"   :rtype: bpy.types.GPUShader\n"
+"   :return: Shader object corresponding to the given name.\n"
+"   :rtype: :class:`bpy.types.GPUShader`\n"
 );
 static PyObject *bpygpu_shader_from_builtin(PyObject *UNUSED(self), PyObject 
*arg)
 {
@@ -729,7 +729,7 @@ static PyObject *bpygpu_shader_from_builtin(PyObject 
*UNUSED(self), PyObject *ar
 PyDoc_STRVAR(bpygpu_shader_code_from_builtin_doc,
 ".. function:: code_from_builtin(shader_name)\n"
 "\n"
-"Exposes the internal shader code for query.\n"
+"   Exposes the internal shader code for query.\n"
 "\n"
 "   :param shader_name: One of these builtin shader names: {\n"
 "   '2D_UNIFORM_COLOR',\n"

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [69a9bcc2067] blender2.8: minor cleanup

2018-11-14 Thread Jacques Lucke
Commit: 69a9bcc2067bfc975ad3e9aa2e61eb7b76c2b187
Author: Jacques Lucke
Date:   Wed Nov 14 13:05:45 2018 +0100
Branches: blender2.8
https://developer.blender.org/rB69a9bcc2067bfc975ad3e9aa2e61eb7b76c2b187

minor cleanup

===

M   source/blender/python/gpu/gpu_py_shader.c

===

diff --git a/source/blender/python/gpu/gpu_py_shader.c 
b/source/blender/python/gpu/gpu_py_shader.c
index 3b2665cc4a2..5f1ea7a33ce 100644
--- a/source/blender/python/gpu/gpu_py_shader.c
+++ b/source/blender/python/gpu/gpu_py_shader.c
@@ -740,7 +740,7 @@ PyDoc_STRVAR(bpygpu_shader_code_from_builtin_doc,
 "   '3D_FLAT_COLOR',\n"
 "   '3D_SMOOTH_COLOR'}\n"
 "   :type shader_name: str\n"
-"   :return: vertex, fragment and geometry shader codes.\n"
+"   :return: Vertex, fragment and geometry shader codes.\n"
 "   :rtype: dict\n"
 );
 static PyObject *bpygpu_shader_code_from_builtin(BPyGPUShader *UNUSED(self), 
PyObject *arg)

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [4722003ca53] blender2.8: Fix icon in Clip Editor header (Graph view type with enabled Filters)

2018-11-14 Thread Philipp Oeser
Commit: 4722003ca539e7742d462752049a9dd1ba7e2571
Author: Philipp Oeser
Date:   Wed Nov 14 12:39:17 2018 +0100
Branches: blender2.8
https://developer.blender.org/rB4722003ca539e7742d462752049a9dd1ba7e2571

Fix icon in Clip Editor header (Graph view type with enabled Filters)

fix provided by sebastian_k over IRC, thx!

===

M   release/scripts/startup/bl_ui/space_clip.py

===

diff --git a/release/scripts/startup/bl_ui/space_clip.py 
b/release/scripts/startup/bl_ui/space_clip.py
index a9e5443fcbe..50cf4bf9c0d 100644
--- a/release/scripts/startup/bl_ui/space_clip.py
+++ b/release/scripts/startup/bl_ui/space_clip.py
@@ -210,7 +210,7 @@ class CLIP_HT_header(Header):
 sub.active = clip.tracking.reconstruction.is_valid
 sub.prop(sc, "show_graph_frames", icon='SEQUENCE', text="")
 
-row.prop(sc, "show_graph_tracks_motion", icon='IPO', 
text="")
+row.prop(sc, "show_graph_tracks_motion", icon='GRAPH', 
text="")
 row.prop(sc, "show_graph_tracks_error", icon='ANIM', 
text="")
 else:
 row.prop(sc, "show_filters", icon='DISCLOSURE_TRI_RIGHT',

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [57573e0da99] blender2.8: Fix copy tracking settings operators

2018-11-14 Thread Philipp Oeser
Commit: 57573e0da994d4f81a830a0b25f89e49ef44ad9a
Author: Philipp Oeser
Date:   Wed Nov 14 12:32:49 2018 +0100
Branches: blender2.8
https://developer.blender.org/rB57573e0da994d4f81a830a0b25f89e49ef44ad9a

Fix copy tracking settings operators

use keyword arguments

===

M   release/scripts/startup/bl_operators/clip.py

===

diff --git a/release/scripts/startup/bl_operators/clip.py 
b/release/scripts/startup/bl_operators/clip.py
index 975a59e1a36..74b3e420cdf 100644
--- a/release/scripts/startup/bl_operators/clip.py
+++ b/release/scripts/startup/bl_operators/clip.py
@@ -99,7 +99,7 @@ def CLIP_default_settings_from_track(clip, track, framenr):
 width = clip.size[0]
 height = clip.size[1]
 
-marker = track.markers.find_frame(framenr, False)
+marker = track.markers.find_frame(framenr, exact=False)
 pattern_bb = marker.pattern_bound_box
 
 pattern = Vector(pattern_bb[1]) - Vector(pattern_bb[0])
@@ -1053,11 +1053,11 @@ class 
CLIP_OT_track_settings_to_track(bpy.types.Operator):
 track = clip.tracking.tracks.active
 
 framenr = context.scene.frame_current - clip.frame_start + 1
-marker = track.markers.find_frame(framenr, False)
+marker = track.markers.find_frame(framenr, exact=False)
 
 for t in clip.tracking.tracks:
 if t.select and t != track:
-marker_selected = t.markers.find_frame(framenr, False)
+marker_selected = t.markers.find_frame(framenr, exact=False)
 for attr in self._attrs_track:
 setattr(t, attr, getattr(track, attr))
 for attr in self._attrs_marker:

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [0b0b3d7f7e7] blender2.8: Keymap: assigning keys for tools now checks mode

2018-11-14 Thread Campbell Barton
Commit: 0b0b3d7f7e720f2073406247957b800e11e4ef98
Author: Campbell Barton
Date:   Wed Nov 14 20:26:00 2018 +1100
Branches: blender2.8
https://developer.blender.org/rB0b0b3d7f7e720f2073406247957b800e11e4ef98

Keymap: assigning keys for tools now checks mode

Adding shortcuts to tools was always adding to the top-level window map.

===

M   source/blender/blenkernel/BKE_context.h
M   source/blender/windowmanager/WM_keymap.h
M   source/blender/windowmanager/intern/wm_keymap_utils.c

===

diff --git a/source/blender/blenkernel/BKE_context.h 
b/source/blender/blenkernel/BKE_context.h
index 9379853af29..798150aee3c 100644
--- a/source/blender/blenkernel/BKE_context.h
+++ b/source/blender/blenkernel/BKE_context.h
@@ -103,7 +103,7 @@ typedef struct bContextStore {
 
 /* for the context's rna mode enum
  * keep aligned with data_mode_strings in context.c */
-enum {
+enum eContextObjectMode {
CTX_MODE_EDIT_MESH = 0,
CTX_MODE_EDIT_CURVE,
CTX_MODE_EDIT_SURFACE,
@@ -122,8 +122,8 @@ enum {
CTX_MODE_GPENCIL_EDIT,
CTX_MODE_GPENCIL_SCULPT,
CTX_MODE_GPENCIL_WEIGHT,
-   CTX_MODE_NUM /* must be last */
 };
+#define CTX_MODE_NUM (CTX_MODE_GPENCIL_WEIGHT + 1)
 
 /* Context */
 
diff --git a/source/blender/windowmanager/WM_keymap.h 
b/source/blender/windowmanager/WM_keymap.h
index f93ef005b2a..6072749b283 100644
--- a/source/blender/windowmanager/WM_keymap.h
+++ b/source/blender/windowmanager/WM_keymap.h
@@ -101,6 +101,7 @@ void WM_keymap_add_context_enum_set_items(
 wmKeyMap *keymap, const struct EnumPropertyItem *items, const char 
*data_path,
 int type_start, int val, int modifier, int keymodifier);
 
+wmKeyMap *WM_keymap_guess_from_context(const struct bContext *C);
 wmKeyMap *WM_keymap_guess_opname(const struct bContext *C, const char *opname);
 
 void WM_keymap_fix_linking(void);
diff --git a/source/blender/windowmanager/intern/wm_keymap_utils.c 
b/source/blender/windowmanager/intern/wm_keymap_utils.c
index 47dc07f556e..e3fe1b7abdd 100644
--- a/source/blender/windowmanager/intern/wm_keymap_utils.c
+++ b/source/blender/windowmanager/intern/wm_keymap_utils.c
@@ -102,6 +102,52 @@ void WM_keymap_add_context_enum_set_items(
 /** \name Introspection
  * \{ */
 
+wmKeyMap *WM_keymap_guess_from_context(const bContext *C)
+{
+   SpaceLink *sl = CTX_wm_space_data(C);
+   const char *km_id = NULL;
+   if (sl->spacetype == SPACE_VIEW3D) {
+   const enum eContextObjectMode mode = CTX_data_mode_enum(C);
+   switch (mode) {
+   case CTX_MODE_EDIT_MESH:km_id = "Mesh"; 
break;
+   case CTX_MODE_EDIT_CURVE:   km_id = "Curve"; 
break;
+   case CTX_MODE_EDIT_SURFACE: km_id = "Curve"; 
break;
+   case CTX_MODE_EDIT_TEXT:km_id = "Font"; 
break;
+   case CTX_MODE_EDIT_ARMATURE:km_id = "Armature"; 
break;
+   case CTX_MODE_EDIT_METABALL:km_id = "Metaball"; 
break;
+   case CTX_MODE_EDIT_LATTICE: km_id = "Lattice"; 
break;
+   case CTX_MODE_POSE: km_id = "Pose"; 
break;
+   case CTX_MODE_SCULPT:   km_id = "Sculpt"; 
break;
+   case CTX_MODE_PAINT_WEIGHT: km_id = "Weight 
Paint"; break;
+   case CTX_MODE_PAINT_VERTEX: km_id = "Vertex 
Paint"; break;
+   case CTX_MODE_PAINT_TEXTURE:km_id = "Image 
Paint"; break;
+   case CTX_MODE_PARTICLE: km_id = "Particle"; 
break;
+   case CTX_MODE_OBJECT:   km_id = "Object 
Mode"; break;
+   case CTX_MODE_GPENCIL_PAINT:km_id = "Grease 
Pencil Stroke Paint Mode"; break;
+   case CTX_MODE_GPENCIL_EDIT: km_id = "Grease 
Pencil Stroke Edit Mode"; break;
+   case CTX_MODE_GPENCIL_SCULPT:   km_id = "Grease 
Pencil Stroke Sculpt Mode"; break;
+   case CTX_MODE_GPENCIL_WEIGHT:   km_id = "Grease 
Pencil Stroke Weight Mode"; break;
+   }
+   }
+   else if (sl->spacetype == SPACE_IMAGE) {
+   const SpaceImage *sima = (SpaceImage *)sl;
+   const eSpaceImage_Mode mode = sima->mode;
+   switch (mode) {
+   case SI_MODE_VIEW:  km_id = "Image"; break;
+   case SI_MODE_PAINT: km_id = "Image Paint"; break;
+   case SI_MODE_MASK:  km_id = "Mask Editing"; break;
+   case SI_MODE_UV:km_id = "UV Editor"; break;
+   }
+   }
+   else {
+   return NULL;
+   }
+
+   wmKeyMap *km = 

[Bf-blender-cvs] [43ee433dcec] blender2.8: UI: Comment out "Clip border" operator

2018-11-14 Thread Clément Foucault
Commit: 43ee433dceccf13868da683ec781b30f17185a2b
Author: Clément Foucault
Date:   Wed Nov 14 11:45:29 2018 +0100
Branches: blender2.8
https://developer.blender.org/rB43ee433dceccf13868da683ec781b30f17185a2b

UI: Comment out "Clip border" operator

Also Remove it from the UI as it has not been ported to 2.8 and it is a
delicate thing to do.

===

M   release/scripts/presets/keyconfig/3dsmax.py
M   release/scripts/presets/keyconfig/keymap_data/blender_default.py
M   release/scripts/presets/keyconfig/maya.py
M   release/scripts/startup/bl_ui/space_view3d.py
M   source/blender/editors/space_view3d/view3d_edit.c
M   source/blender/editors/space_view3d/view3d_intern.h
M   source/blender/editors/space_view3d/view3d_ops.c
M   source/blender/windowmanager/intern/wm_operators.c

===

diff --git a/release/scripts/presets/keyconfig/3dsmax.py 
b/release/scripts/presets/keyconfig/3dsmax.py
index 3024a5638f2..206dc820f04 100644
--- a/release/scripts/presets/keyconfig/3dsmax.py
+++ b/release/scripts/presets/keyconfig/3dsmax.py
@@ -655,7 +655,7 @@ kmi.properties.deselect = False
 kmi = km.keymap_items.new('view3d.select_lasso', 'EVT_TWEAK_A', 'ANY', 
shift=True, ctrl=True)
 kmi.properties.deselect = True
 kmi = km.keymap_items.new('view3d.select_circle', 'C', 'PRESS', alt=True)
-kmi = km.keymap_items.new('view3d.clip_border', 'B', 'PRESS', alt=True)
+# kmi = km.keymap_items.new('view3d.clip_border', 'B', 'PRESS', alt=True)
 kmi = km.keymap_items.new('view3d.zoom_border', 'B', 'PRESS', shift=True)
 kmi = km.keymap_items.new('view3d.render_border', 'B', 'PRESS', shift=True)
 kmi.properties.camera_only = True
diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py 
b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
index e501f4e91ab..0320238a681 100644
--- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py
+++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
@@ -936,7 +936,7 @@ def km_view3d(params):
  {"properties": [("mode", 'SUB')]}),
 ("view3d.select_circle", {"type": 'C', "value": 'PRESS'}, None),
 # Borders.
-("view3d.clip_border", {"type": 'B', "value": 'PRESS', "alt": True}, 
None),
+# ("view3d.clip_border", {"type": 'B', "value": 'PRESS', "alt": True}, 
None),
 ("view3d.zoom_border", {"type": 'B', "value": 'PRESS', "shift": True}, 
None),
 ("view3d.render_border", {"type": 'B', "value": 'PRESS', "ctrl": 
True}, None),
 ("view3d.clear_render_border", {"type": 'B', "value": 'PRESS', "ctrl": 
True, "alt": True}, None),
diff --git a/release/scripts/presets/keyconfig/maya.py 
b/release/scripts/presets/keyconfig/maya.py
index 60e58d6324a..1ce2fb34ccf 100644
--- a/release/scripts/presets/keyconfig/maya.py
+++ b/release/scripts/presets/keyconfig/maya.py
@@ -1058,7 +1058,7 @@ kmi = km.keymap_items.new('view3d.select_lasso', 
'EVT_TWEAK_M', 'ANY', ctrl=True
 kmi.properties.deselect = True
 kmi = km.keymap_items.new('view3d.select_lasso', 'EVT_TWEAK_M', 'ANY', 
any=True)
 kmi = km.keymap_items.new('view3d.select_circle', 'Q', 'PRESS', shift=True)
-kmi = km.keymap_items.new('view3d.clip_border', 'B', 'PRESS', alt=True)
+# kmi = km.keymap_items.new('view3d.clip_border', 'B', 'PRESS', alt=True)
 kmi = km.keymap_items.new('view3d.zoom_border', 'B', 'PRESS', shift=True)
 kmi = km.keymap_items.new('wm.call_menu', 'S', 'PRESS', shift=True, ctrl=True)
 kmi.properties.name = 'VIEW3D_MT_snap'
diff --git a/release/scripts/startup/bl_ui/space_view3d.py 
b/release/scripts/startup/bl_ui/space_view3d.py
index ae360788a36..095f1e73eac 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -763,7 +763,7 @@ class VIEW3D_MT_view_borders(Menu):
 
 def draw(self, context):
 layout = self.layout
-layout.operator("view3d.clip_border", text="Clipping Border...")
+# layout.operator("view3d.clip_border", text="Clipping Border...")
 layout.operator("view3d.render_border", text="Render Border...")
 
 layout.separator()
diff --git a/source/blender/editors/space_view3d/view3d_edit.c 
b/source/blender/editors/space_view3d/view3d_edit.c
index 7f102189121..dea28b75745 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -4550,6 +4550,8 @@ void ED_view3d_clipping_local(RegionView3D *rv3d, float 
mat[4][4])
calc_local_clipping(rv3d->clip_local, rv3d->clipbb, mat);
 }
 
+#if 0 /* TODO Missing from 2.8 drawing code. Find a solution to support clip 
border then uncomment it. */
+
 static int view3d_clipping_exec(bContext *C, wmOperator *op)
 {
ARegion *ar = CTX_wm_region(C);
@@ -4606,6 +4608,7 @@ void VIEW3D_OT_clip_border(wmOperatorType *ot)
/* properties */

[Bf-blender-cvs] [92166ecd91d] blender2.8: Py API: Remove GPUShader.transform_feedback_enable/disable

2018-11-14 Thread Jacques Lucke
Commit: 92166ecd91dfd464307e5292d1357b6bb652d8d4
Author: Jacques Lucke
Date:   Wed Nov 14 12:26:34 2018 +0100
Branches: blender2.8
https://developer.blender.org/rB92166ecd91dfd464307e5292d1357b6bb652d8d4

Py API: Remove GPUShader.transform_feedback_enable/disable

It couldn't really be used in the current implementation, so it is better to 
remove it instead of confusing everyone.

===

M   source/blender/python/gpu/gpu_py_shader.c

===

diff --git a/source/blender/python/gpu/gpu_py_shader.c 
b/source/blender/python/gpu/gpu_py_shader.c
index 46acf22d7e2..eeacd087884 100644
--- a/source/blender/python/gpu/gpu_py_shader.c
+++ b/source/blender/python/gpu/gpu_py_shader.c
@@ -153,35 +153,6 @@ static PyObject *bpygpu_shader_bind(BPyGPUShader *self)
Py_RETURN_NONE;
 }
 
-PyDoc_STRVAR(bpygpu_shader_transform_feedback_enable_doc,
-".. method:: transform_feedback_enable(vbo_id)\n"
-"\n"
-"   Start transform feedback operation.\n"
-"\n"
-"   :return: true if transform feedback was succesfully enabled.\n"
-"   :rtype: `bool`\n"
-);
-static PyObject *bpygpu_shader_transform_feedback_enable(
-BPyGPUShader *self, PyObject *arg)
-{
-   uint vbo_id;
-   if ((vbo_id = PyC_Long_AsU32(arg)) == (uint)-1) {
-   return NULL;
-   }
-   return 
PyBool_FromLong(GPU_shader_transform_feedback_enable(self->shader, vbo_id));
-}
-
-PyDoc_STRVAR(bpygpu_shader_transform_feedback_disable_doc,
-".. method:: transform_feedback_disable()\n"
-"\n"
-"   Disable transform feedback.\n"
-);
-static PyObject *bpygpu_transform_feedback_disable(BPyGPUShader *self)
-{
-   GPU_shader_transform_feedback_disable(self->shader);
-   Py_RETURN_NONE;
-}
-
 PyDoc_STRVAR(bpygpu_shader_uniform_from_name_doc,
 ".. method:: uniform_from_name(name)\n"
 "\n"
@@ -610,12 +581,6 @@ static PyObject *bpygpu_shader_calc_format(BPyGPUShader 
*self, PyObject *UNUSED(
 static struct PyMethodDef bpygpu_shader_methods[] = {
{"bind", (PyCFunction)bpygpu_shader_bind,
 METH_NOARGS, bpygpu_shader_bind_doc},
-   {"transform_feedback_enable",
-(PyCFunction)bpygpu_shader_transform_feedback_enable,
-METH_O, bpygpu_shader_transform_feedback_enable_doc},
-   {"transform_feedback_disable",
-(PyCFunction)bpygpu_transform_feedback_disable,
-METH_NOARGS, bpygpu_shader_transform_feedback_disable_doc},
{"uniform_from_name",
 (PyCFunction)bpygpu_shader_uniform_from_name,
 METH_O, bpygpu_shader_uniform_from_name_doc},

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [87786566929] blender2.8: minor api docs fix

2018-11-14 Thread Jacques Lucke
Commit: 87786566929610e8717b859cc6e61637d70a9ab0
Author: Jacques Lucke
Date:   Wed Nov 14 12:33:10 2018 +0100
Branches: blender2.8
https://developer.blender.org/rB87786566929610e8717b859cc6e61637d70a9ab0

minor api docs fix

===

M   source/blender/python/gpu/gpu_py_vertex_buffer.c

===

diff --git a/source/blender/python/gpu/gpu_py_vertex_buffer.c 
b/source/blender/python/gpu/gpu_py_vertex_buffer.c
index 19d47a3e4e7..c13e3f2195e 100644
--- a/source/blender/python/gpu/gpu_py_vertex_buffer.c
+++ b/source/blender/python/gpu/gpu_py_vertex_buffer.c
@@ -313,7 +313,7 @@ static void bpygpu_VertBuf_dealloc(BPyGPUVertBuf *self)
 PyDoc_STRVAR(py_gpu_vertex_buffer_doc,
 ".. class:: GPUVertBuf(len, format)\n"
 "\n"
-"   Contains a VBO."
+"   Contains a VBO.\n"
 "\n"
 "   :param len: Amount of vertices that will fit into this buffer.\n"
 "   :type type: `int`\n"

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [5c27c76ed3a] blender2.8: Depsgraph: fix relations for drivers on bone weight in Armature constraint.

2018-11-14 Thread Alexander Gavrilov
Commit: 5c27c76ed3a9683c5d54745add6713eb562996e8
Author: Alexander Gavrilov
Date:   Wed Nov 14 14:01:28 2018 +0300
Branches: blender2.8
https://developer.blender.org/rB5c27c76ed3a9683c5d54745add6713eb562996e8

Depsgraph: fix relations for drivers on bone weight in Armature constraint.

===

M   source/blender/blenkernel/BKE_constraint.h
M   source/blender/blenkernel/intern/constraint.c
M   source/blender/depsgraph/intern/depsgraph.cc
M   source/blender/makesrna/RNA_access.h
M   source/blender/makesrna/intern/rna_constraint.c

===

diff --git a/source/blender/blenkernel/BKE_constraint.h 
b/source/blender/blenkernel/BKE_constraint.h
index e7672001a15..bfcdcb68c4a 100644
--- a/source/blender/blenkernel/BKE_constraint.h
+++ b/source/blender/blenkernel/BKE_constraint.h
@@ -138,7 +138,7 @@ struct bConstraint *BKE_constraints_active_get(struct 
ListBase *list);
 voidBKE_constraints_active_set(ListBase *list, struct 
bConstraint *con);
 struct bConstraint *BKE_constraints_find_name(struct ListBase *list, const 
char *name);
 
-struct bConstraint *BKE_constraint_find_from_target(struct Object *ob, struct 
bConstraintTarget *tgt);
+struct bConstraint *BKE_constraint_find_from_target(struct Object *ob, struct 
bConstraintTarget *tgt, struct bPoseChannel **r_pchan);
 
 struct bConstraint *BKE_constraint_add_for_object(struct Object *ob, const 
char *name, short type);
 struct bConstraint *BKE_constraint_add_for_pose(struct Object *ob, struct 
bPoseChannel *pchan, const char *name, short type);
diff --git a/source/blender/blenkernel/intern/constraint.c 
b/source/blender/blenkernel/intern/constraint.c
index e16117745c9..8dfb50cd159 100644
--- a/source/blender/blenkernel/intern/constraint.c
+++ b/source/blender/blenkernel/intern/constraint.c
@@ -5058,8 +5058,12 @@ static bConstraint 
*constraint_list_find_from_target(ListBase *constraints, bCon
 }
 
 /* Finds the constraint that owns the given target within the object. */
-bConstraint *BKE_constraint_find_from_target(Object *ob, bConstraintTarget 
*tgt)
+bConstraint *BKE_constraint_find_from_target(Object *ob, bConstraintTarget 
*tgt, bPoseChannel **r_pchan)
 {
+   if (r_pchan != NULL) {
+   *r_pchan = NULL;
+   }
+
bConstraint *result = 
constraint_list_find_from_target(>constraints, tgt);
 
if (result != NULL) {
@@ -5071,6 +5075,10 @@ bConstraint *BKE_constraint_find_from_target(Object *ob, 
bConstraintTarget *tgt)
result = 
constraint_list_find_from_target(>constraints, tgt);
 
if (result != NULL) {
+   if (r_pchan != NULL) {
+   *r_pchan = pchan;
+   }
+
return result;
}
}
diff --git a/source/blender/depsgraph/intern/depsgraph.cc 
b/source/blender/depsgraph/intern/depsgraph.cc
index d3c9560bcb1..7f47dce9f47 100644
--- a/source/blender/depsgraph/intern/depsgraph.cc
+++ b/source/blender/depsgraph/intern/depsgraph.cc
@@ -51,6 +51,7 @@ extern "C" {
 #include "RNA_access.h"
 
 #include "BKE_scene.h"
+#include "BKE_constraint.h"
 }
 
 #include 
@@ -183,6 +184,25 @@ static bool pointer_to_component_node_criteria(
}
}
}
+   else if (ELEM(ptr->type, _ConstraintTarget, 
_ConstraintTargetBone)) {
+   Object *object = (Object *)ptr->id.data;
+   bConstraintTarget *tgt = (bConstraintTarget *)ptr->data;
+   /* Check whether is object or bone constraint. */
+   bPoseChannel *pchan = NULL;
+   bConstraint *con = BKE_constraint_find_from_target(object, tgt, 
);
+   if (con != NULL) {
+   if (pchan != NULL) {
+   *type = DEG_NODE_TYPE_BONE;
+   *operation_code = DEG_OPCODE_BONE_LOCAL;
+   *subdata = pchan->name;
+   }
+   else {
+   *type = DEG_NODE_TYPE_TRANSFORM;
+   *operation_code = DEG_OPCODE_TRANSFORM_LOCAL;
+   }
+   return true;
+   }
+   }
else if (RNA_struct_is_a(ptr->type, _Modifier)) {
*type = DEG_NODE_TYPE_GEOMETRY;
return true;
diff --git a/source/blender/makesrna/RNA_access.h 
b/source/blender/makesrna/RNA_access.h
index 2f4d999c4fb..a74479e193c 100644
--- a/source/blender/makesrna/RNA_access.h
+++ b/source/blender/makesrna/RNA_access.h
@@ -198,6 +198,7 @@ extern StructRNA RNA_CompositorNodeZcombine;
 extern StructRNA RNA_ConsoleLine;
 extern StructRNA RNA_Constraint;
 extern StructRNA RNA_ConstraintTarget;
+extern StructRNA RNA_ConstraintTargetBone;
 

[Bf-blender-cvs] [69a04c61402] blender2.8: Cleanup: correct flag comparisons

2018-11-14 Thread Campbell Barton
Commit: 69a04c61402cf4e09927640d2588764bcfd2a357
Author: Campbell Barton
Date:   Wed Nov 14 23:30:20 2018 +1100
Branches: blender2.8
https://developer.blender.org/rB69a04c61402cf4e09927640d2588764bcfd2a357

Cleanup: correct flag comparisons

Also use smaller types for shading data.

===

M   source/blender/blenloader/intern/versioning_280.c
M   source/blender/draw/engines/workbench/workbench_data.c
M   source/blender/editors/space_view3d/space_view3d.c
M   source/blender/makesdna/DNA_view3d_types.h

===

diff --git a/source/blender/blenloader/intern/versioning_280.c 
b/source/blender/blenloader/intern/versioning_280.c
index 2049856cfa6..9521c05f7f0 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -1809,7 +1809,7 @@ void blo_do_versions_280(FileData *fd, Library 
*UNUSED(lib), Main *bmain)
}
}
 
-   if (!DNA_struct_elem_find(fd->filesdna, "View3DShadeing", 
"short", "background_type")) {
+   if (!DNA_struct_elem_find(fd->filesdna, "View3DShadeing", 
"char", "background_type")) {
for (bScreen *screen = bmain->screen.first; screen; 
screen = screen->id.next) {
for (ScrArea *sa = screen->areabase.first; sa; 
sa = sa->next) {
for (SpaceLink *sl = 
sa->spacedata.first; sl; sl = sl->next) {
diff --git a/source/blender/draw/engines/workbench/workbench_data.c 
b/source/blender/draw/engines/workbench/workbench_data.c
index 29a3249782d..aa99883bb6b 100644
--- a/source/blender/draw/engines/workbench/workbench_data.c
+++ b/source/blender/draw/engines/workbench/workbench_data.c
@@ -55,13 +55,13 @@ void workbench_private_data_init(WORKBENCH_PrivateData *wpd)
wd->matcap_orientation = (wpd->shading.flag & 
V3D_SHADING_MATCAP_FLIP_X) != 0;
wd->background_alpha = (DRW_state_is_image_render() && 
scene->r.alphamode == R_ALPHAPREMUL) ? 0.0f : 1.0f;
 
-   if (!v3d || ((v3d->shading.background_type & 
V3D_SHADING_BACKGROUND_WORLD) &&
+   if (!v3d || ((v3d->shading.background_type == 
V3D_SHADING_BACKGROUND_WORLD) &&
(scene->world != NULL)))
{
copy_v3_v3(wd->background_color_low, >world->horr);
copy_v3_v3(wd->background_color_high, >world->horr);
}
-   else if (v3d->shading.background_type & 
V3D_SHADING_BACKGROUND_VIEWPORT) {
+   else if (v3d->shading.background_type == 
V3D_SHADING_BACKGROUND_VIEWPORT) {
copy_v3_v3(wd->background_color_low, 
v3d->shading.background_color);
copy_v3_v3(wd->background_color_high, 
v3d->shading.background_color);
}
diff --git a/source/blender/editors/space_view3d/space_view3d.c 
b/source/blender/editors/space_view3d/space_view3d.c
index 044cb56d367..4fe2fe08fc9 100644
--- a/source/blender/editors/space_view3d/space_view3d.c
+++ b/source/blender/editors/space_view3d/space_view3d.c
@@ -1333,8 +1333,9 @@ static void space_view3d_listener(
switch (wmn->data) {
case ND_WORLD_DRAW:
case ND_WORLD:
-   if (v3d->shading.background_type & 
V3D_SHADING_BACKGROUND_WORLD)
+   if (v3d->shading.background_type == 
V3D_SHADING_BACKGROUND_WORLD) {

ED_area_tag_redraw_regiontype(sa, RGN_TYPE_WINDOW);
+   }
break;
}
break;
diff --git a/source/blender/makesdna/DNA_view3d_types.h 
b/source/blender/makesdna/DNA_view3d_types.h
index 6796c9d4d00..d0880b0af9a 100644
--- a/source/blender/makesdna/DNA_view3d_types.h
+++ b/source/blender/makesdna/DNA_view3d_types.h
@@ -139,11 +139,11 @@ typedef struct View3DShading {
short prev_type;   /* Runtime, for toggle between rendered viewport. */
 
short flag;
-   short color_type;
+   char color_type;
+   char _pad0[7];
 
-   short light;
-   short background_type;
-   short pad2[2];
+   char light;
+   char background_type;
 
char studio_light[256]; /* FILE_MAXFILE */
char matcap[256]; /* FILE_MAXFILE */

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [c94f806dc73] blender2.8: WM: remove warning when toolbar not found

2018-11-14 Thread Campbell Barton
Commit: c94f806dc7381bf72e24bf9b02311f3c66112fc5
Author: Campbell Barton
Date:   Thu Nov 15 09:50:13 2018 +1100
Branches: blender2.8
https://developer.blender.org/rBc94f806dc7381bf72e24bf9b02311f3c66112fc5

WM: remove warning when toolbar not found

Not useful for general usage, so removing.

===

M   release/scripts/startup/bl_operators/wm.py

===

diff --git a/release/scripts/startup/bl_operators/wm.py 
b/release/scripts/startup/bl_operators/wm.py
index 92ac18e0f6f..6bf0e742ff6 100644
--- a/release/scripts/startup/bl_operators/wm.py
+++ b/release/scripts/startup/bl_operators/wm.py
@@ -2419,7 +2419,6 @@ class WM_OT_toolbar(Operator):
 
 cls = ToolSelectPanelHelper._tool_class_from_space_type(space_type)
 if cls is None:
-self.report({'WARNING'}, f"Toolbar not found for {space_type!r}")
 return {'CANCELLED'}
 
 wm = context.window_manager

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [3ecc79fa1ae] blender2.8: Gizmo: use color fading to show depth for navigate

2018-11-14 Thread Campbell Barton
Commit: 3ecc79fa1aec0e8494369cae0e27549702f19dee
Author: Campbell Barton
Date:   Thu Nov 15 09:44:03 2018 +1100
Branches: blender2.8
https://developer.blender.org/rB3ecc79fa1aec0e8494369cae0e27549702f19dee

Gizmo: use color fading to show depth for navigate

Previously the positive axis was always brighter,
now use bright colors which face towards the view.

===

M   source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c

===

diff --git a/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c 
b/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c
index 422f6e07c68..ae5ce27cd8d 100644
--- a/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c
+++ b/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c
@@ -224,6 +224,7 @@ static void axis_geom_draw(
static const float axis_black[4] = {0, 0, 0, 1};
static float axis_color[3][4];
 
+   const float axis_depth_bias = 0.01f;
 
 #ifdef USE_AXIS_FONT
struct {
@@ -270,7 +271,7 @@ static void axis_geom_draw(
const bool is_highlight = index + 1 == gz->highlight_part;
 
/* Draw slightly before, so axis aligned arrows draw ontop. */
-   if ((draw_center_done == false) && 
(axis_order[axis_index].depth > -0.01f)) {
+   if ((draw_center_done == false) && 
(axis_order[axis_index].depth > -axis_depth_bias)) {
 
/* Circle defining active area (revert back to 2D 
space). */
if (color[3] != 0.0f) {
@@ -304,6 +305,17 @@ static void axis_geom_draw(
const float *color_current = is_highlight ? 
axis_highlight : axis_color[axis];
float color_current_fade[4];
 
+   /* Flip the faded state when axis aligned, since we're 
hiding the front-mode axis
+* otherwise we see the color for the back-most axis, 
which is useful for
+* click-to-rotate 180d but not useful to visualize.
+*
+* Use depth bias so axis-aligned views show the 
positive axis as being in-front.
+* This is a detail so primary axes show as dominant.
+*/
+   const bool is_pos_color = (
+   ((axis_order[axis_index].depth > 
(axis_depth_bias * (is_pos ? -1 : 1))) == (axis_align != axis)));
+
+
if (select == false) {
 #ifdef USE_FADE_BACKGROUND
interp_v3_v3v3(color_current_fade, 
draw_info->color_bg, color_current, is_highlight ? 1.0 : 0.5f);
@@ -321,7 +333,7 @@ static void axis_geom_draw(
if (is_pos) {
float v_start[3];
GPU_line_width(2.0f);
-   immUniformColor4fv(color_current);
+   immUniformColor4fv(is_pos_color ? color_current 
: color_current_fade);
immBegin(GPU_PRIM_LINES, 2);
if (axis_align == -1) {
zero_v3(v_start);
@@ -341,11 +353,6 @@ static void axis_geom_draw(
 
/* Axis Ball. */
{
-   /* Flip the faded state when axis aligned, 
since we're hiding the front-mode axis
-* otherwise we see the color for the back-most 
axis, which is useful for
-* click-to-rotate 180d but not useful to 
visualize. */
-   const bool is_pos_color = is_pos == (axis_align 
!= axis);
-
GPU_matrix_push();
GPU_matrix_translate_3fv(v_final);
GPU_matrix_scale_1f(show_axis_char ? 
AXIS_HANDLE_SIZE_FG : AXIS_HANDLE_SIZE_BG);

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [27eba3867ae] blender2.8: Keymap: move tool system keymaps into the default keymap

2018-11-14 Thread Campbell Barton
Commit: 27eba3867ae9489b1fc87aab49481a69e8f84822
Author: Campbell Barton
Date:   Thu Nov 15 12:22:36 2018 +1100
Branches: blender2.8
https://developer.blender.org/rB27eba3867ae9489b1fc87aab49481a69e8f84822

Keymap: move tool system keymaps into the default keymap

Note that tools can still define their keymaps,
since it's useful for add-ons.

===

M   release/scripts/presets/keyconfig/keymap_data/blender_default.py
M   release/scripts/startup/bl_ui/space_toolsystem_toolbar.py

===

diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py 
b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
index 0320238a681..6e062e9d317 100644
--- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py
+++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
@@ -71,6 +71,7 @@ class KeymapParams:
 # 
--
 # Constants
 
+
 # Physical layout.
 NUMBERS_1 = ('ONE', 'TWO', 'THREE', 'FOUR', 'FIVE', 'SIX', 'SEVEN', 'EIGHT', 
'NINE', 'ZERO')
 # Numeric order.
@@ -161,6 +162,22 @@ def _template_items_proportional_editing(*, 
connected=False):
 ]
 
 
+# Tool System Templates
+
+def _template_items_tool_select_actions(operator, *, type, value):
+kmi_args = {"type": type, "value": value}
+return [
+(operator, kmi_args,
+ {"properties": [("mode", 'SET')]}),
+(operator, {**kmi_args, "shift": True},
+ {"properties": [("mode", 'ADD')]}),
+(operator, {**kmi_args, "ctrl": True},
+ {"properties": [("mode", 'SUB')]}),
+(operator, {**kmi_args, "shift": True, "ctrl": True},
+ {"properties": [("mode", 'AND')]}),
+]
+
+
 # 
--
 # Window, Screen, Areas, Regions
 
@@ -4790,6 +4807,838 @@ def km_backdrop_transform_widget(_params):
 return keymap
 
 
+# 
--
+# Tool System Keymaps
+#
+# Named are auto-generated based on the tool name and it's toolbar.
+
+def km_image_editor_tool_uv_cursor(_params):
+return (
+"Image Editor Tool: Uv, Cursor",
+{"space_type": 'IMAGE_EDITOR', "region_type": 'WINDOW'},
+{"items": (
+("uv.cursor_set", {"type": 'ACTIONMOUSE', "value": 'PRESS'}, None),
+("transform.translate", {"type": 'EVT_TWEAK_A', "value": 'ANY'},
+ {"properties": [("release_confirm", True), ("cursor_transform", 
True)]}),
+),
+},
+)
+
+
+def km_image_editor_tool_uv_select_box(_params):
+return (
+"Image Editor Tool: Uv, Select Box",
+{"space_type": 'IMAGE_EDITOR', "region_type": 'WINDOW'},
+{"items": (
+("uv.select_box", {"type": 'EVT_TWEAK_A', "value": 'ANY'}, None),
+("uv.select_box", {"type": 'EVT_TWEAK_A', "value": 'ANY', "ctrl": 
True},
+ {"properties": [("deselect", True)]}),
+),
+},
+)
+
+
+def km_image_editor_tool_uv_select_circle(_params):
+return (
+"Image Editor Tool: Uv, Select Circle",
+{"space_type": 'IMAGE_EDITOR', "region_type": 'WINDOW'},
+{"items": (
+("uv.select_circle", {"type": 'ACTIONMOUSE', "value": 'PRESS'},
+ {"properties": [("deselect", False)]}),
+("uv.select_circle", {"type": 'ACTIONMOUSE', "value": 'PRESS', 
"ctrl": True},
+ {"properties": [("deselect", True)]}),
+),
+},
+)
+
+
+def km_image_editor_tool_uv_select_lasso(_params):
+return (
+"Image Editor Tool: Uv, Select Lasso",
+{"space_type": 'IMAGE_EDITOR', "region_type": 'WINDOW'},
+{"items": (
+("uv.select_lasso", {"type": 'EVT_TWEAK_A', "value": 'ANY'},
+ {"properties": [("deselect", False)]}),
+),
+},
+)
+
+
+def km_image_editor_tool_uv_annotate(_params):
+return (
+"Image Editor Tool: Uv, Annotate",
+{"space_type": 'IMAGE_EDITOR', "region_type": 'WINDOW'},
+{"items": (
+("gpencil.annotate", {"type": 'ACTIONMOUSE', "value": 'PRESS'},
+ {"properties": [("mode", 'DRAW'), ("wait_for_input", False)]}),
+),
+},
+)
+
+
+def km_image_editor_tool_uv_annotate_line(_params):
+return (
+"Image Editor Tool: Uv, Annotate Line",
+{"space_type": 'IMAGE_EDITOR', "region_type": 'WINDOW'},
+{"items": (
+("gpencil.annotate", {"type": 'EVT_TWEAK_A', "value": 'ANY'},
+ {"properties": [("mode", 'DRAW_STRAIGHT'), ("wait_for_input", 
False)]}),
+),
+},
+)
+
+
+def km_image_editor_tool_uv_annotate_polygon(_params):
+return (
+"Image Editor Tool: Uv, Annotate Polygon",
+{"space_type": 'IMAGE_EDITOR', 

[Bf-blender-cvs] [02d77e5bf56] blender2.8: Keymap: use parameters for tool keymap

2018-11-14 Thread Campbell Barton
Commit: 02d77e5bf56cdbbf7defe249a319fca14738725f
Author: Campbell Barton
Date:   Thu Nov 15 12:54:44 2018 +1100
Branches: blender2.8
https://developer.blender.org/rB02d77e5bf56cdbbf7defe249a319fca14738725f

Keymap: use parameters for tool keymap

===

M   release/scripts/presets/keyconfig/keymap_data/blender_default.py

===

diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py 
b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
index 6e062e9d317..276e2a99dbc 100644
--- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py
+++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
@@ -4812,677 +4812,677 @@ def km_backdrop_transform_widget(_params):
 #
 # Named are auto-generated based on the tool name and it's toolbar.
 
-def km_image_editor_tool_uv_cursor(_params):
+def km_image_editor_tool_uv_cursor(params):
 return (
 "Image Editor Tool: Uv, Cursor",
 {"space_type": 'IMAGE_EDITOR', "region_type": 'WINDOW'},
 {"items": (
-("uv.cursor_set", {"type": 'ACTIONMOUSE', "value": 'PRESS'}, None),
-("transform.translate", {"type": 'EVT_TWEAK_A', "value": 'ANY'},
+("uv.cursor_set", {"type": params.action_mouse, "value": 'PRESS'}, 
None),
+("transform.translate", {"type": params.action_tweak, "value": 
'ANY'},
  {"properties": [("release_confirm", True), ("cursor_transform", 
True)]}),
 ),
 },
 )
 
 
-def km_image_editor_tool_uv_select_box(_params):
+def km_image_editor_tool_uv_select_box(params):
 return (
 "Image Editor Tool: Uv, Select Box",
 {"space_type": 'IMAGE_EDITOR', "region_type": 'WINDOW'},
 {"items": (
-("uv.select_box", {"type": 'EVT_TWEAK_A', "value": 'ANY'}, None),
-("uv.select_box", {"type": 'EVT_TWEAK_A', "value": 'ANY', "ctrl": 
True},
+("uv.select_box", {"type": params.action_tweak, "value": 'ANY'}, 
None),
+("uv.select_box", {"type": params.action_tweak, "value": 'ANY', 
"ctrl": True},
  {"properties": [("deselect", True)]}),
 ),
 },
 )
 
 
-def km_image_editor_tool_uv_select_circle(_params):
+def km_image_editor_tool_uv_select_circle(params):
 return (
 "Image Editor Tool: Uv, Select Circle",
 {"space_type": 'IMAGE_EDITOR', "region_type": 'WINDOW'},
 {"items": (
-("uv.select_circle", {"type": 'ACTIONMOUSE', "value": 'PRESS'},
+("uv.select_circle", {"type": params.action_mouse, "value": 
'PRESS'},
  {"properties": [("deselect", False)]}),
-("uv.select_circle", {"type": 'ACTIONMOUSE', "value": 'PRESS', 
"ctrl": True},
+("uv.select_circle", {"type": params.action_mouse, "value": 
'PRESS', "ctrl": True},
  {"properties": [("deselect", True)]}),
 ),
 },
 )
 
 
-def km_image_editor_tool_uv_select_lasso(_params):
+def km_image_editor_tool_uv_select_lasso(params):
 return (
 "Image Editor Tool: Uv, Select Lasso",
 {"space_type": 'IMAGE_EDITOR', "region_type": 'WINDOW'},
 {"items": (
-("uv.select_lasso", {"type": 'EVT_TWEAK_A', "value": 'ANY'},
+("uv.select_lasso", {"type": params.action_tweak, "value": 'ANY'},
  {"properties": [("deselect", False)]}),
 ),
 },
 )
 
 
-def km_image_editor_tool_uv_annotate(_params):
+def km_image_editor_tool_uv_annotate(params):
 return (
 "Image Editor Tool: Uv, Annotate",
 {"space_type": 'IMAGE_EDITOR', "region_type": 'WINDOW'},
 {"items": (
-("gpencil.annotate", {"type": 'ACTIONMOUSE', "value": 'PRESS'},
+("gpencil.annotate", {"type": params.action_mouse, "value": 
'PRESS'},
  {"properties": [("mode", 'DRAW'), ("wait_for_input", False)]}),
 ),
 },
 )
 
 
-def km_image_editor_tool_uv_annotate_line(_params):
+def km_image_editor_tool_uv_annotate_line(params):
 return (
 "Image Editor Tool: Uv, Annotate Line",
 {"space_type": 'IMAGE_EDITOR', "region_type": 'WINDOW'},
 {"items": (
-("gpencil.annotate", {"type": 'EVT_TWEAK_A', "value": 'ANY'},
+("gpencil.annotate", {"type": params.action_tweak, "value": 'ANY'},
  {"properties": [("mode", 'DRAW_STRAIGHT'), ("wait_for_input", 
False)]}),
 ),
 },
 )
 
 
-def km_image_editor_tool_uv_annotate_polygon(_params):
+def km_image_editor_tool_uv_annotate_polygon(params):
 return (
 "Image Editor Tool: Uv, Annotate Polygon",
 {"space_type": 'IMAGE_EDITOR', "region_type": 'WINDOW'},
 {"items": (
-("gpencil.annotate", {"type": 'ACTIONMOUSE', "value": 'PRESS'},
+("gpencil.annotate", {"type": params.action_mouse, 

[Bf-blender-cvs] [fdd1fea8514] blender2.8: Depsgraph: Cleanup, code style

2018-11-14 Thread Sergey Sharybin
Commit: fdd1fea8514952efc3f2f78d61381ef0fba3d211
Author: Sergey Sharybin
Date:   Tue Nov 13 17:21:41 2018 +0100
Branches: blender2.8
https://developer.blender.org/rBfdd1fea8514952efc3f2f78d61381ef0fba3d211

Depsgraph: Cleanup, code style

Should be no functional changes.

===

M   source/blender/depsgraph/DEG_depsgraph_physics.h
M   source/blender/depsgraph/intern/depsgraph_physics.cc

===

diff --git a/source/blender/depsgraph/DEG_depsgraph_physics.h 
b/source/blender/depsgraph/DEG_depsgraph_physics.h
index fd35a7fb2c0..642b3cbfc30 100644
--- a/source/blender/depsgraph/DEG_depsgraph_physics.h
+++ b/source/blender/depsgraph/DEG_depsgraph_physics.h
@@ -69,7 +69,7 @@ void DEG_add_collision_relations(struct DepsNodeHandle 
*handle,
  struct Object *object,
  struct Collection *collection,
  unsigned int modifier_type,
- DEG_CollobjFilterFunction fn,
+ DEG_CollobjFilterFunction filter_function,
  const char *name);
 void DEG_add_forcefield_relations(struct DepsNodeHandle *handle,
   struct Object *object,
diff --git a/source/blender/depsgraph/intern/depsgraph_physics.cc 
b/source/blender/depsgraph/intern/depsgraph_physics.cc
index 1868069f0ac..1299542e823 100644
--- a/source/blender/depsgraph/intern/depsgraph_physics.cc
+++ b/source/blender/depsgraph/intern/depsgraph_physics.cc
@@ -50,9 +50,10 @@ extern "C" {
 #include "depsgraph.h"
 #include "depsgraph_intern.h"
 
-/*** Evaluation Query API */
+/*** Evaluation Query API 
*/
 
-static ePhysicsRelationType modifier_to_relation_type(unsigned int 
modifier_type)
+static ePhysicsRelationType modifier_to_relation_type(
+unsigned int modifier_type)
 {
switch (modifier_type) {
case eModifierType_Collision:
@@ -70,27 +71,32 @@ static ePhysicsRelationType 
modifier_to_relation_type(unsigned int modifier_type
 ListBase *DEG_get_effector_relations(const Depsgraph *graph,
  Collection *collection)
 {
-   const DEG::Depsgraph *deg_graph = reinterpret_cast(graph);
+   const DEG::Depsgraph *deg_graph =
+   reinterpret_cast(graph);
if (deg_graph->physics_relations[DEG_PHYSICS_EFFECTOR] == NULL) {
return NULL;
}
 
ID *collection_orig = DEG_get_original_id(>id);
-   return (ListBase 
*)BLI_ghash_lookup(deg_graph->physics_relations[DEG_PHYSICS_EFFECTOR], 
collection_orig);
+   return (ListBase *)BLI_ghash_lookup(
+   deg_graph->physics_relations[DEG_PHYSICS_EFFECTOR],
+   collection_orig);
 }
 
 ListBase *DEG_get_collision_relations(const Depsgraph *graph,
   Collection *collection,
   unsigned int modifier_type)
 {
-   const DEG::Depsgraph *deg_graph = reinterpret_cast(graph);
+   const DEG::Depsgraph *deg_graph =
+   reinterpret_cast(graph);
const ePhysicsRelationType type = 
modifier_to_relation_type(modifier_type);
if (deg_graph->physics_relations[type] == NULL) {
return NULL;
}
-
ID *collection_orig = DEG_get_original_id(>id);
-   return (ListBase *)BLI_ghash_lookup(deg_graph->physics_relations[type], 
collection_orig);
+   return (ListBase *)BLI_ghash_lookup(
+   deg_graph->physics_relations[type],
+   collection_orig);
 }
 
 /** Depsgraph Building API /
@@ -99,20 +105,25 @@ void DEG_add_collision_relations(DepsNodeHandle *handle,
  Object *object,
  Collection *collection,
  unsigned int modifier_type,
- DEG_CollobjFilterFunction fn,
+ DEG_CollobjFilterFunction filter_function,
  const char *name)
 {
Depsgraph *depsgraph = DEG_get_graph_from_handle(handle);
DEG::Depsgraph *deg_graph = (DEG::Depsgraph *)depsgraph;
-   ListBase *relations = deg_build_collision_relations(deg_graph, 
collection, modifier_type);
-
+   ListBase *relations = deg_build_collision_relations(
+   deg_graph, collection, modifier_type);
LISTBASE_FOREACH (CollisionRelation *, relation, relations) {
Object *ob1 = relation->ob;
-   if (ob1 != object) {
-   if (!fn || fn(ob1, modifiers_findByType(ob1, 
(ModifierType)modifier_type))) {
-   DEG_add_object_relation(handle, ob1, 

[Bf-blender-cvs] [1d8db50538c] blender2.8: Depsgraph: Remove unused operation code

2018-11-14 Thread Sergey Sharybin
Commit: 1d8db50538c4ba933d0a5faf97807ace1a9f6386
Author: Sergey Sharybin
Date:   Tue Nov 13 19:31:44 2018 +0100
Branches: blender2.8
https://developer.blender.org/rB1d8db50538c4ba933d0a5faf97807ace1a9f6386

Depsgraph: Remove unused operation code

===

M   source/blender/depsgraph/DEG_depsgraph_build.h
M   source/blender/depsgraph/intern/depsgraph_build.cc
M   source/blender/depsgraph/intern/depsgraph_physics.cc

===

diff --git a/source/blender/depsgraph/DEG_depsgraph_build.h 
b/source/blender/depsgraph/DEG_depsgraph_build.h
index c09c811121b..1895b483644 100644
--- a/source/blender/depsgraph/DEG_depsgraph_build.h
+++ b/source/blender/depsgraph/DEG_depsgraph_build.h
@@ -125,8 +125,6 @@ typedef enum eDepsObjectComponentType {
/* Bone Component - Child/Subcomponent of Pose */
DEG_OB_COMP_BONE,
 
-   /* Particle Systems Component */
-   DEG_OB_COMP_EVAL_PARTICLES,
/* Material Shading Component */
DEG_OB_COMP_SHADING,
/* Cache Component */
diff --git a/source/blender/depsgraph/intern/depsgraph_build.cc 
b/source/blender/depsgraph/intern/depsgraph_build.cc
index eb125229c6a..f5b84b91dbe 100644
--- a/source/blender/depsgraph/intern/depsgraph_build.cc
+++ b/source/blender/depsgraph/intern/depsgraph_build.cc
@@ -93,7 +93,6 @@ static DEG::eDepsNode_Type deg_build_object_component_type(
case DEG_OB_COMP_GEOMETRY:  return 
DEG::DEG_NODE_TYPE_GEOMETRY;
case DEG_OB_COMP_EVAL_POSE: return 
DEG::DEG_NODE_TYPE_EVAL_POSE;
case DEG_OB_COMP_BONE:  return 
DEG::DEG_NODE_TYPE_BONE;
-   case DEG_OB_COMP_EVAL_PARTICLES:return 
DEG::DEG_NODE_TYPE_EVAL_PARTICLES;
case DEG_OB_COMP_SHADING:   return 
DEG::DEG_NODE_TYPE_SHADING;
case DEG_OB_COMP_CACHE: return 
DEG::DEG_NODE_TYPE_CACHE;
}
diff --git a/source/blender/depsgraph/intern/depsgraph_physics.cc 
b/source/blender/depsgraph/intern/depsgraph_physics.cc
index 1299542e823..0a54caebace 100644
--- a/source/blender/depsgraph/intern/depsgraph_physics.cc
+++ b/source/blender/depsgraph/intern/depsgraph_physics.cc
@@ -149,10 +149,9 @@ void DEG_add_forcefield_relations(DepsNodeHandle *handle,
DEG_add_object_relation(
handle, relation->ob, DEG_OB_COMP_TRANSFORM, name);
if (relation->psys) {
-   DEG_add_object_relation(
-   handle, relation->ob, 
DEG_OB_COMP_EVAL_PARTICLES, name);
-   /* TODO: remove this when/if EVAL_PARTICLES is 
sufficient for up to
-* date particles. */
+   /* TODO(sergey): Consider going more granular with more 
dedicated
+* particle system operation.
+*/
DEG_add_object_relation(
handle, relation->ob, DEG_OB_COMP_GEOMETRY, 
name);
}

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [7d2bb2c9d95] collada2.8: Merge remote-tracking branch 'origin/blender2.8' into collada2.8

2018-11-14 Thread Gaia Clary
Commit: 7d2bb2c9d95a288290af3cfa3f0a4d144c8aefc9
Author: Gaia Clary
Date:   Wed Nov 14 12:36:02 2018 +0100
Branches: collada2.8
https://developer.blender.org/rB7d2bb2c9d95a288290af3cfa3f0a4d144c8aefc9

Merge remote-tracking branch 'origin/blender2.8' into collada2.8

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [199017ac14c] collada2.8: feature: Collada: Added initial support for texture import

2018-11-14 Thread Gaia Clary
Commit: 199017ac14cf850978d7ed5ed64b655ba1257ece
Author: Gaia Clary
Date:   Tue Nov 6 23:24:42 2018 +0100
Branches: collada2.8
https://developer.blender.org/rB199017ac14cf850978d7ed5ed64b655ba1257ece

feature: Collada: Added initial support for texture import

===

M   source/blender/collada/CMakeLists.txt
M   source/blender/collada/DocumentImporter.cpp
M   source/blender/collada/DocumentImporter.h
M   source/blender/collada/ErrorHandler.cpp
A   source/blender/collada/Materials.cpp
A   source/blender/collada/Materials.h

===

diff --git a/source/blender/collada/CMakeLists.txt 
b/source/blender/collada/CMakeLists.txt
index 2aca4cd57e5..240493ae5a9 100644
--- a/source/blender/collada/CMakeLists.txt
+++ b/source/blender/collada/CMakeLists.txt
@@ -72,6 +72,7 @@ set(SRC
MaterialExporter.cpp
MeshImporter.cpp
SkinInfo.cpp
+   Materials.cpp
SceneExporter.cpp
TransformReader.cpp
TransformWriter.cpp
@@ -103,6 +104,7 @@ set(SRC
LightExporter.h
MaterialExporter.h
MeshImporter.h
+   Materials.h
SkinInfo.h
SceneExporter.h
TransformReader.h
diff --git a/source/blender/collada/DocumentImporter.cpp 
b/source/blender/collada/DocumentImporter.cpp
index 6a72f86f64f..f1fdf8f83c8 100644
--- a/source/blender/collada/DocumentImporter.cpp
+++ b/source/blender/collada/DocumentImporter.cpp
@@ -92,7 +92,7 @@ extern "C" {
 
 #include "collada_internal.h"
 #include "collada_utils.h"
-
+#include "materials.h"
 
 /*
  * COLLADA Importer limitations:
@@ -767,31 +767,14 @@ bool DocumentImporter::writeMaterial(const 
COLLADAFW::Material *cmat)
 
 void DocumentImporter::write_profile_COMMON(COLLADAFW::EffectCommon *ef, 
Material *ma)
 {
-   add_material_shader(ef, ma);
+   MaterialNode matNode = MaterialNode(mContext, ef, ma, uid_image_map);
 
-   // reflectivity
-   ma->metallic = ef->getReflectivity().getFloatValue();
-   // index of refraction
-#if 0
-   ma->ang = ef->getIndexOfRefraction().getFloatValue();
-#endif
+   matNode.set_reflectivity(ef->getReflectivity().getFloatValue());
+   matNode.set_ior(ef->getIndexOfRefraction().getFloatValue());
+   matNode.set_diffuse(ef->getDiffuse());
 
COLLADAFW::Color col;
 
-   // DIFFUSE
-   // color
-   if (ef->getDiffuse().isColor()) {
-   col = ef->getDiffuse().getColor();
-   ma->r = col.getRed();
-   ma->g = col.getGreen();
-   ma->b = col.getBlue();
-   }
-   // texture
-   else if (ef->getDiffuse().isTexture()) {
-#if 0
-   COLLADAFW::Texture ctex = ef->getDiffuse().getTexture();
-#endif
-   }
// AMBIENT
// color
if (ef->getAmbient().isColor()) {
@@ -805,6 +788,7 @@ void 
DocumentImporter::write_profile_COMMON(COLLADAFW::EffectCommon *ef, Materia
COLLADAFW::Texture ctex = ef->getAmbient().getTexture();
 #endif
}
+
// SPECULAR
// color
if (ef->getSpecular().isColor()) {
@@ -819,6 +803,7 @@ void 
DocumentImporter::write_profile_COMMON(COLLADAFW::EffectCommon *ef, Materia
COLLADAFW::Texture ctex = ef->getSpecular().getTexture();
 #endif
}
+
// REFLECTIVE
// color
if (ef->getReflective().isColor()) {
@@ -868,38 +853,6 @@ void 
DocumentImporter::write_profile_COMMON(COLLADAFW::EffectCommon *ef, Materia
}
 }
 
-void DocumentImporter::add_material_shader(COLLADAFW::EffectCommon *ef, 
Material *ma)
-{
-   bc_add_default_shader(mContext, ma);
-
-#if 0
-   COLLADAFW::EffectCommon::ShaderType shader = ef->getShaderType();
-   // Currently we only support PBR based shaders
-   // TODO: simulate the effects with PBR
-
-   // blinn
-   if (shader == COLLADAFW::EffectCommon::SHADER_BLINN) {
-   ma->spec_shader = MA_SPEC_BLINN;
-   ma->spec = ef->getShininess().getFloatValue();
-   }
-   // phong
-   else if (shader == COLLADAFW::EffectCommon::SHADER_PHONG) {
-   ma->spec_shader = MA_SPEC_PHONG;
-   ma->har = ef->getShininess().getFloatValue();
-   }
-   // lambert
-   else if (shader == COLLADAFW::EffectCommon::SHADER_LAMBERT) {
-   ma->diff_shader = MA_DIFF_LAMBERT;
-   }
-   // default - lambert
-   else {
-   ma->diff_shader = MA_DIFF_LAMBERT;
-   fprintf(stderr, "Current shader type is not supported, default 
to lambert.\n");
-   }
-#endif
-
-}
-
 /** When this method is called, the writer must write the effect.
  * \return The writer should return true, if writing succeeded, false 
otherwise.*/
 
diff --git a/source/blender/collada/DocumentImporter.h 
b/source/blender/collada/DocumentImporter.h
index eeceff45f0c..5d5c5df2aaf 100644
--- 

[Bf-blender-cvs] [f0759a413ea] collada2.8: fix: export preset for SL rigged used a no longer existing parameter

2018-11-14 Thread Gaia Clary
Commit: f0759a413ea1a3c34a1363f0969e968233468b48
Author: Gaia Clary
Date:   Mon Nov 12 12:25:14 2018 +0100
Branches: collada2.8
https://developer.blender.org/rBf0759a413ea1a3c34a1363f0969e968233468b48

fix: export preset for SL rigged used a no longer existing parameter

===

M   
release/scripts/presets/operator/wm.collada_export/sl_plus_open_sim_rigged.py

===

diff --git 
a/release/scripts/presets/operator/wm.collada_export/sl_plus_open_sim_rigged.py 
b/release/scripts/presets/operator/wm.collada_export/sl_plus_open_sim_rigged.py
index 7825a4d0f32..311d71c4557 100644
--- 
a/release/scripts/presets/operator/wm.collada_export/sl_plus_open_sim_rigged.py
+++ 
b/release/scripts/presets/operator/wm.collada_export/sl_plus_open_sim_rigged.py
@@ -10,7 +10,6 @@ op.include_armatures = True
 op.include_shapekeys = False
 op.deform_bones_only = True
 op.active_uv_only = True
-op.include_uv_textures = True
 op.use_texture_copies = True
 op.triangulate = True
 op.use_object_instantiation = False

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [6e5f271a006] collada2.8: added initial support for material import (wip)

2018-11-14 Thread Gaia Clary
Commit: 6e5f271a006b4cd5193507c9de94ca0f462e132a
Author: Gaia Clary
Date:   Tue Nov 6 16:41:21 2018 +0100
Branches: collada2.8
https://developer.blender.org/rB6e5f271a006b4cd5193507c9de94ca0f462e132a

added initial support for material import (wip)

===

M   source/blender/collada/AnimationImporter.cpp
M   source/blender/collada/AnimationImporter.h
M   source/blender/collada/DocumentImporter.cpp
M   source/blender/collada/DocumentImporter.h
M   source/blender/collada/EffectExporter.cpp
M   source/blender/collada/EffectExporter.h
M   source/blender/collada/collada_utils.cpp
M   source/blender/collada/collada_utils.h

===

diff --git a/source/blender/collada/AnimationImporter.cpp 
b/source/blender/collada/AnimationImporter.cpp
index 23e54fa1e85..b581c6647ba 100644
--- a/source/blender/collada/AnimationImporter.cpp
+++ b/source/blender/collada/AnimationImporter.cpp
@@ -1303,7 +1303,7 @@ AnimationImporter::AnimMix 
*AnimationImporter::get_animation_type(const COLLADAF
continue;
}
else {
-   types->transform = types->transform | NODE_TRANSFORM;
+   types->transform = types->transform | BC_NODE_TRANSFORM;
break;
}
}
diff --git a/source/blender/collada/AnimationImporter.h 
b/source/blender/collada/AnimationImporter.h
index cfee9d12af2..4fa4864cbb0 100644
--- a/source/blender/collada/AnimationImporter.h
+++ b/source/blender/collada/AnimationImporter.h
@@ -125,8 +125,8 @@ private:
 
enum AnimationType
{
-   INANIMATE = 0,
-   NODE_TRANSFORM = 1,
+   BC_INANIMATE = 0,
+   BC_NODE_TRANSFORM = 1
};
 
struct AnimMix
diff --git a/source/blender/collada/DocumentImporter.cpp 
b/source/blender/collada/DocumentImporter.cpp
index 82133c42e56..6a72f86f64f 100644
--- a/source/blender/collada/DocumentImporter.cpp
+++ b/source/blender/collada/DocumentImporter.cpp
@@ -764,39 +764,11 @@ bool DocumentImporter::writeMaterial(const 
COLLADAFW::Material *cmat)
return true;
 }
 
+
 void DocumentImporter::write_profile_COMMON(COLLADAFW::EffectCommon *ef, 
Material *ma)
 {
-   COLLADAFW::EffectCommon::ShaderType shader = ef->getShaderType();
+   add_material_shader(ef, ma);
 
-   // TODO: add back texture and extended material parameter support
-
-   // blinn
-   if (shader == COLLADAFW::EffectCommon::SHADER_BLINN) {
-#if 0
-   ma->spec_shader = MA_SPEC_BLINN;
-   ma->spec = ef->getShininess().getFloatValue();
-#endif
-   }
-   // phong
-   else if (shader == COLLADAFW::EffectCommon::SHADER_PHONG) {
-#if 0
-   ma->spec_shader = MA_SPEC_PHONG;
-   ma->har = ef->getShininess().getFloatValue();
-#endif
-   }
-   // lambert
-   else if (shader == COLLADAFW::EffectCommon::SHADER_LAMBERT) {
-#if 0
-   ma->diff_shader = MA_DIFF_LAMBERT;
-#endif
-   }
-   // default - lambert
-   else {
-#if 0
-   ma->diff_shader = MA_DIFF_LAMBERT;
-   fprintf(stderr, "Current shader type is not supported, default 
to lambert.\n");
-#endif
-   }
// reflectivity
ma->metallic = ef->getReflectivity().getFloatValue();
// index of refraction
@@ -896,6 +868,38 @@ void 
DocumentImporter::write_profile_COMMON(COLLADAFW::EffectCommon *ef, Materia
}
 }
 
+void DocumentImporter::add_material_shader(COLLADAFW::EffectCommon *ef, 
Material *ma)
+{
+   bc_add_default_shader(mContext, ma);
+
+#if 0
+   COLLADAFW::EffectCommon::ShaderType shader = ef->getShaderType();
+   // Currently we only support PBR based shaders
+   // TODO: simulate the effects with PBR
+
+   // blinn
+   if (shader == COLLADAFW::EffectCommon::SHADER_BLINN) {
+   ma->spec_shader = MA_SPEC_BLINN;
+   ma->spec = ef->getShininess().getFloatValue();
+   }
+   // phong
+   else if (shader == COLLADAFW::EffectCommon::SHADER_PHONG) {
+   ma->spec_shader = MA_SPEC_PHONG;
+   ma->har = ef->getShininess().getFloatValue();
+   }
+   // lambert
+   else if (shader == COLLADAFW::EffectCommon::SHADER_LAMBERT) {
+   ma->diff_shader = MA_DIFF_LAMBERT;
+   }
+   // default - lambert
+   else {
+   ma->diff_shader = MA_DIFF_LAMBERT;
+   fprintf(stderr, "Current shader type is not supported, default 
to lambert.\n");
+   }
+#endif
+
+}
+
 /** When this method is called, the writer must write the effect.
  * \return The writer should return true, if writing succeeded, false 
otherwise.*/
 
diff --git a/source/blender/collada/DocumentImporter.h 

[Bf-blender-cvs] [fd31a63a5c3] collada2.8: Merge branch 'blender2.8' of git.blender.org:blender into collada2.8

2018-11-14 Thread Gaia Clary
Commit: fd31a63a5c35a1fc40fd2418f5a245e81b8c7b62
Author: Gaia Clary
Date:   Tue Nov 6 16:41:51 2018 +0100
Branches: collada2.8
https://developer.blender.org/rBfd31a63a5c35a1fc40fd2418f5a245e81b8c7b62

Merge branch 'blender2.8' of git.blender.org:blender into collada2.8

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [7254e92ba2c] collada2.8: material importer - initial version

2018-11-14 Thread Gaia Clary
Commit: 7254e92ba2c36024bcd5f636040148504f8abef6
Author: Gaia Clary
Date:   Mon Nov 12 20:42:11 2018 +0100
Branches: collada2.8
https://developer.blender.org/rB7254e92ba2c36024bcd5f636040148504f8abef6

material importer - initial version

===

M   source/blender/collada/ArmatureExporter.cpp
M   source/blender/collada/ArmatureExporter.h
M   source/blender/collada/DocumentExporter.cpp
M   source/blender/collada/DocumentExporter.h
M   source/blender/collada/DocumentImporter.cpp
M   source/blender/collada/DocumentImporter.h
M   source/blender/collada/EffectExporter.cpp
M   source/blender/collada/EffectExporter.h
M   source/blender/collada/ImageExporter.cpp
M   source/blender/collada/ImageExporter.h
M   source/blender/collada/MaterialExporter.h
M   source/blender/collada/Materials.cpp
M   source/blender/collada/Materials.h
M   source/blender/collada/SceneExporter.cpp
M   source/blender/collada/SceneExporter.h
M   source/blender/collada/collada.cpp
M   source/blender/collada/collada.h
M   source/blender/collada/collada_internal.cpp
M   source/blender/collada/collada_utils.cpp
M   source/blender/collada/collada_utils.h
M   source/blender/editors/io/io_collada.c

===

diff --git a/source/blender/collada/ArmatureExporter.cpp 
b/source/blender/collada/ArmatureExporter.cpp
index 35947abebfd..daee25b66d1 100644
--- a/source/blender/collada/ArmatureExporter.cpp
+++ b/source/blender/collada/ArmatureExporter.cpp
@@ -58,37 +58,38 @@ extern "C" {
 // XXX exporter writes wrong data for shared armatures.  A separate
 // controller should be written for each armature-mesh binding how do
 // we make controller ids then?
-ArmatureExporter::ArmatureExporter(bContext *C, COLLADASW::StreamWriter *sw, 
const ExportSettings *export_settings) :
+ArmatureExporter::ArmatureExporter(bContext *C, Depsgraph *depsgraph, 
COLLADASW::StreamWriter *sw, const ExportSettings *export_settings) :
mContext(C),
+   depsgraph(depsgraph),
COLLADASW::LibraryControllers(sw), export_settings(export_settings)
 {
 }
 
 // write bone nodes
 void ArmatureExporter::add_armature_bones(
-   bContext *C, Depsgraph *depsgraph, Object *ob_arm,
-   Scene *sce, SceneExporter *se,
+   Object *ob_arm,
+   ViewLayer *view_layer,
+   SceneExporter *se,
std::vector& child_objects)
 
 {
-   Main *bmain = CTX_data_main(mContext);
// write bone nodes
 
bArmature *armature = (bArmature *)ob_arm->data;
bool is_edited = armature->edbo != NULL;
 
-   if (!is_edited)
+   if (!is_edited) {
ED_armature_to_edit(armature);
+   }
 
for (Bone *bone = (Bone *)armature->bonebase.first; bone; bone = 
bone->next) {
// start from root bones
if (!bone->parent) {
-   add_bone_node(C, depsgraph, bone, ob_arm, sce, se, 
child_objects);
+   add_bone_node(mContext, depsgraph, view_layer, bone, 
ob_arm, se, child_objects);
}
}
 
if (!is_edited) {
-   ED_armature_from_edit(bmain, armature);
ED_armature_edit_free(armature);
}
 }
@@ -166,9 +167,14 @@ void ArmatureExporter::find_objects_using_armature(Object 
*ob_arm, std::vector& child_objects)
+void ArmatureExporter::add_bone_node(
+   bContext *C, 
+   Depsgraph *depsgraph, 
+   ViewLayer *view_layer,
+   Bone *bone,
+   Object *ob_arm,
+SceneExporter *se,
+std::vector& child_objects)
 {
if (!(this->export_settings->deform_bones_only && bone->flag & 
BONE_NO_DEFORM)) {
std::string node_id = translate_id(id_name(ob_arm) + "_" + 
bone->name);
@@ -240,7 +246,7 @@ void ArmatureExporter::add_bone_node(bContext *C, Depsgraph 
*depsgraph, Bone *bo
mul_m4_m4m4((*i)->parentinv, 
temp, (*i)->parentinv);
}
 
-   se->writeNodes(C, depsgraph, *i, sce);
+   se->writeNodes(C, depsgraph, 
view_layer, *i);
copy_m4_m4((*i)->parentinv, 
backup_parinv);
child_objects.erase(i++);
}
@@ -248,13 +254,13 @@ void ArmatureExporter::add_bone_node(bContext *C, 
Depsgraph *depsgraph, Bone *bo
}
 
for (Bone *child = (Bone *)bone->childbase.first; 
child; child = child->next) {
-   add_bone_node(C, depsgraph, child, ob_arm, sce, 
se, child_objects);
+   add_bone_node(C, depsgraph, view_layer, child, 
ob_arm, se, child_objects);
}
node.end();
  

[Bf-blender-cvs] [2e169054802] collada2.8: fix: collada adjust importer/exporter for no longer supported HEMI lights

2018-11-14 Thread Gaia Clary
Commit: 2e169054802825f1ab5e74560ef188bc62a14f85
Author: Gaia Clary
Date:   Wed Nov 14 14:50:56 2018 +0100
Branches: collada2.8
https://developer.blender.org/rB2e169054802825f1ab5e74560ef188bc62a14f85

fix: collada adjust importer/exporter for no longer supported HEMI lights

===

M   source/blender/collada/DocumentImporter.cpp
M   source/blender/collada/LightExporter.cpp

===

diff --git a/source/blender/collada/DocumentImporter.cpp 
b/source/blender/collada/DocumentImporter.cpp
index 2ed302f8ac1..83491829565 100644
--- a/source/blender/collada/DocumentImporter.cpp
+++ b/source/blender/collada/DocumentImporter.cpp
@@ -1075,11 +1075,10 @@ bool DocumentImporter::writeLight(const 
COLLADAFW::Light *light)
lamp->energy = e;
lamp->dist = d;
 
-   COLLADAFW::Light::LightType type = light->getLightType();
-   switch (type) {
+   switch (light->getLightType()) {
case COLLADAFW::Light::AMBIENT_LIGHT:
{
-   lamp->type = LA_HEMI;
+   lamp->type = LA_SUN; //TODO needs more thoughts
}
break;
case COLLADAFW::Light::SPOT_LIGHT:
diff --git a/source/blender/collada/LightExporter.cpp 
b/source/blender/collada/LightExporter.cpp
index 11377e06ce8..b1f805bfb87 100644
--- a/source/blender/collada/LightExporter.cpp
+++ b/source/blender/collada/LightExporter.cpp
@@ -89,14 +89,7 @@ void LightsExporter::operator()(Object *ob)
exportBlenderProfile(cla, la);
addLight(cla);
}
-   // hemi
-   else if (la->type == LA_HEMI) {
-   COLLADASW::AmbientLight cla(mSW, la_id, la_name);
-   cla.setColor(col, false, "color");
-   cla.setConstantAttenuation(constatt);
-   exportBlenderProfile(cla, la);
-   addLight(cla);
-   }
+
// spot
else if (la->type == LA_SPOT) {
COLLADASW::SpotLight cla(mSW, la_id, la_name);

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [2aab0e85cf2] collada2.8: Merge remote-tracking branch 'origin/blender2.8' into collada2.8

2018-11-14 Thread Gaia Clary
Commit: 2aab0e85cf2f8c3bc7c65d97873d1b1125dcdd39
Author: Gaia Clary
Date:   Wed Nov 14 13:02:12 2018 +0100
Branches: collada2.8
https://developer.blender.org/rB2aab0e85cf2f8c3bc7c65d97873d1b1125dcdd39

Merge remote-tracking branch 'origin/blender2.8' into collada2.8

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [4290c938e51] collada2.8: Merge remote-tracking branch 'origin/blender2.8' into collada2.8

2018-11-14 Thread Gaia Clary
Commit: 4290c938e5140c72448d6260997b3ecbafa6b5c5
Author: Gaia Clary
Date:   Tue Nov 13 17:22:38 2018 +0100
Branches: collada2.8
https://developer.blender.org/rB4290c938e5140c72448d6260997b3ecbafa6b5c5

Merge remote-tracking branch 'origin/blender2.8' into collada2.8

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [3749eac075c] collada2.8: Merge remote-tracking branch 'origin/blender2.8' into collada2.8

2018-11-14 Thread Gaia Clary
Commit: 3749eac075c6ca52a13ae6c3869ecc7e95bd598f
Author: Gaia Clary
Date:   Tue Nov 13 17:21:51 2018 +0100
Branches: collada2.8
https://developer.blender.org/rB3749eac075c6ca52a13ae6c3869ecc7e95bd598f

Merge remote-tracking branch 'origin/blender2.8' into collada2.8

===



===

diff --cc source/blender/collada/collada_utils.cpp
index 3b967c85def,5019916b06f..54514da8d4a
--- a/source/blender/collada/collada_utils.cpp
+++ b/source/blender/collada/collada_utils.cpp
@@@ -46,28 -44,18 +46,29 @@@ extern "C" 
  
  #include "BLI_math.h"
  #include "BLI_linklist.h"
 +#include "BLI_listbase.h"
  
 +#include "BKE_action.h"
  #include "BKE_context.h"
  #include "BKE_customdata.h"
 +#include "BKE_constraint.h"
 +#include "BKE_key.h"
 +#include "BKE_material.h"
 +#include "BKE_node.h"
 +#include "BKE_object.h"
  #include "BKE_global.h"
  #include "BKE_layer.h"
+ #include "BKE_library.h"
  #include "BKE_mesh.h"
  #include "BKE_mesh_runtime.h"
+ #include "BKE_object.h"
  #include "BKE_scene.h"
- #include "BKE_main.h"
  
  #include "ED_armature.h"
 +#include "ED_screen.h"
 +#include "ED_node.h"
 +
 +#include "MEM_guardedalloc.h"
  
  #include "WM_api.h" // XXX hrm, see if we can do without this
  #include "WM_types.h"
diff --cc source/blender/collada/collada_utils.h
index 1cb9de027c3,001a2f5fe1b..08232ed8c36
--- a/source/blender/collada/collada_utils.h
+++ b/source/blender/collada/collada_utils.h
@@@ -58,6 -49,6 +58,7 @@@ extern "C" 
  #include "BLI_utildefines.h"
  #include "BLI_string.h"
  
++#include "BKE_main.h"
  #include "BKE_context.h"
  #include "BKE_object.h"
  #include "BKE_scene.h"

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [d3c08b1aa62] blender2.8: Depsgraph: Fix missing point cache reset when physics changes

2018-11-14 Thread Sergey Sharybin
Commit: d3c08b1aa62d0e6b373621cbd2da7342796f9625
Author: Sergey Sharybin
Date:   Wed Nov 14 11:24:54 2018 +0100
Branches: blender2.8
https://developer.blender.org/rBd3c08b1aa62d0e6b373621cbd2da7342796f9625

Depsgraph: Fix missing point cache reset when physics changes

Among all the lines moved around, the general idea is quite simple.
Actually, there are two ideas implemented there.

First one, is when object itself is tagged for update, we tag its
point cache component for evaluation, which makes it so point cache
is properly reset. We do it implicitly because otherwise we'll need
to go everywhere and add explicit tag in almost all the properties.

Second thing is, we link all collider and force fields to a point
cache component using special type of link. This type of link only
allows flush if change is caused by a user update. This way reset
does not happen when change is caused due to animation, but will
properly happen when user causes indirect change to the objects
which are part of physics simulation.

===

M   source/blender/blenkernel/BKE_object.h
M   source/blender/blenkernel/intern/object_update.c
M   source/blender/depsgraph/DEG_depsgraph.h
M   source/blender/depsgraph/DEG_depsgraph_build.h
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/debug/deg_debug_relations_graphviz.cc
M   source/blender/depsgraph/intern/depsgraph.h
M   source/blender/depsgraph/intern/depsgraph_build.cc
M   source/blender/depsgraph/intern/depsgraph_eval.cc
M   source/blender/depsgraph/intern/depsgraph_physics.cc
M   source/blender/depsgraph/intern/depsgraph_tag.cc
M   source/blender/depsgraph/intern/depsgraph_type_defines.cc
M   source/blender/depsgraph/intern/depsgraph_types.h
M   source/blender/depsgraph/intern/eval/deg_eval_flush.cc
M   source/blender/depsgraph/intern/nodes/deg_node.h
M   source/blender/depsgraph/intern/nodes/deg_node_component.cc
M   source/blender/depsgraph/intern/nodes/deg_node_component.h
M   source/blender/depsgraph/intern/nodes/deg_node_id.cc
M   source/blender/depsgraph/intern/nodes/deg_node_id.h
M   source/blender/depsgraph/intern/nodes/deg_node_operation.cc
M   source/blender/depsgraph/intern/nodes/deg_node_operation.h
M   source/blender/depsgraph/intern/nodes/deg_node_time.cc
M   source/blender/depsgraph/intern/nodes/deg_node_time.h

===

diff --git a/source/blender/blenkernel/BKE_object.h 
b/source/blender/blenkernel/BKE_object.h
index 8085c541600..6d950ec01f6 100644
--- a/source/blender/blenkernel/BKE_object.h
+++ b/source/blender/blenkernel/BKE_object.h
@@ -245,7 +245,7 @@ void BKE_object_eval_uber_data(
 struct Scene *scene,
 struct Object *ob);
 
-void BKE_object_eval_cloth(
+void BKE_object_eval_ptcache_reset(
 struct Depsgraph *depsgraph,
 struct Scene *scene,
 struct Object *object);
diff --git a/source/blender/blenkernel/intern/object_update.c 
b/source/blender/blenkernel/intern/object_update.c
index 902237d7ac8..267f64aa53f 100644
--- a/source/blender/blenkernel/intern/object_update.c
+++ b/source/blender/blenkernel/intern/object_update.c
@@ -343,9 +343,9 @@ void BKE_object_eval_uber_data(Depsgraph *depsgraph,
BKE_object_batch_cache_dirty_tag(ob);
 }
 
-void BKE_object_eval_cloth(Depsgraph *depsgraph,
-   Scene *scene,
-   Object *object)
+void BKE_object_eval_ptcache_reset(Depsgraph *depsgraph,
+   Scene *scene,
+   Object *object)
 {
DEG_debug_print_eval(depsgraph, __func__, object->id.name, object);
BKE_ptcache_object_reset(scene, object, PTCACHE_RESET_DEPSGRAPH);
diff --git a/source/blender/depsgraph/DEG_depsgraph.h 
b/source/blender/depsgraph/DEG_depsgraph.h
index 75572a91440..fa2675297bc 100644
--- a/source/blender/depsgraph/DEG_depsgraph.h
+++ b/source/blender/depsgraph/DEG_depsgraph.h
@@ -147,11 +147,12 @@ typedef enum eDepsgraph_Tag {
/* Tag shading components for update.
 * Only parameters of material changed).
 */
-   DEG_TAG_SHADING_UPDATE  = (1 << 9),
-   DEG_TAG_SELECT_UPDATE   = (1 << 10),
-   DEG_TAG_BASE_FLAGS_UPDATE = (1 << 11),
+   DEG_TAG_SHADING_UPDATE   = (1 << 9),
+   DEG_TAG_SELECT_UPDATE= (1 << 10),
+   DEG_TAG_BASE_FLAGS_UPDATE= (1 << 11),
+   DEG_TAG_POINT_CACHE_UPDATE   = (1 << 12),
/* Only inform editors about the change. Don't modify datablock itself. 
*/
-   DEG_TAG_EDITORS_UPDATE = (1 << 12),
+   

[Bf-blender-cvs] [39cd872acbc] blender2.8: Add function to query whether object has any point cache

2018-11-14 Thread Sergey Sharybin
Commit: 39cd872acbcc913f9df4f6620680a2e7f89c5098
Author: Sergey Sharybin
Date:   Tue Nov 13 17:51:58 2018 +0100
Branches: blender2.8
https://developer.blender.org/rB39cd872acbcc913f9df4f6620680a2e7f89c5098

Add function to query whether object has any point cache

===

M   source/blender/blenkernel/BKE_pointcache.h
M   source/blender/blenkernel/intern/pointcache.c

===

diff --git a/source/blender/blenkernel/BKE_pointcache.h 
b/source/blender/blenkernel/BKE_pointcache.h
index 7456a4bfb15..f13f84e4eb2 100644
--- a/source/blender/blenkernel/BKE_pointcache.h
+++ b/source/blender/blenkernel/BKE_pointcache.h
@@ -293,6 +293,11 @@ PTCacheID BKE_ptcache_id_find(struct Object *ob, struct 
Scene *scene, struct Poi
 void BKE_ptcache_ids_from_object(
 struct ListBase *lb, struct Object *ob, struct Scene *scene, int 
duplis);
 
+/** Query funcs /
+
+/* Check whether object has a point cache. */
+bool BKE_ptcache_object_has(struct Scene *scene, struct Object *ob, int 
duplis);
+
 /* Global funcs /
 void BKE_ptcache_remove(void);
 
diff --git a/source/blender/blenkernel/intern/pointcache.c 
b/source/blender/blenkernel/intern/pointcache.c
index 60defc575f4..0dc192db8f0 100644
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@ -1829,6 +1829,18 @@ void BKE_ptcache_ids_from_object(ListBase *lb, Object 
*ob, Scene *scene, int dup
scene, ob, duplis, ptcache_ids_from_object_cb, );
 }
 
+static bool ptcache_object_has_cb(PTCacheID *UNUSED(pid),
+  void *UNUSED(userdata))
+{
+   return false;
+}
+
+bool BKE_ptcache_object_has(struct Scene *scene, struct Object *ob, int duplis)
+{
+   return !foreach_object_ptcache(
+   scene, ob, duplis, ptcache_object_has_cb, NULL);
+}
+
 /* File handling */
 
 static const char *ptcache_file_extension(const PTCacheID *pid)

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [ec2fea733bd] blender2.8: Make object point cache iteration more generic

2018-11-14 Thread Sergey Sharybin
Commit: ec2fea733bda8c83ef1e7585ff5d99ce7407fb25
Author: Sergey Sharybin
Date:   Tue Nov 13 17:48:00 2018 +0100
Branches: blender2.8
https://developer.blender.org/rBec2fea733bda8c83ef1e7585ff5d99ce7407fb25

Make object point cache iteration more generic

Currently should be no functional changes, but this will
simplify implementing some incoming logic.

===

M   source/blender/blenkernel/intern/pointcache.c

===

diff --git a/source/blender/blenkernel/intern/pointcache.c 
b/source/blender/blenkernel/intern/pointcache.c
index 99451a7b6c1..60defc575f4 100644
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@ -1672,88 +1672,161 @@ PTCacheID BKE_ptcache_id_find(Object *ob, Scene 
*scene, PointCache *cache)
return result;
 }
 
-void BKE_ptcache_ids_from_object(ListBase *lb, Object *ob, Scene *scene, int 
duplis)
-{
-   PTCacheID *pid;
-   ParticleSystem *psys;
-   ModifierData *md;
-
-   lb->first= lb->last= NULL;
-
-   if (ob->soft) {
-   pid= MEM_callocN(sizeof(PTCacheID), "PTCacheID");
-   BKE_ptcache_id_from_softbody(pid, ob, ob->soft);
-   BLI_addtail(lb, pid);
-   }
+/* Callback which is used by point cache foreach() family of functions.
+ *
+ * Receives ID of the point cache.
+ *
+ * NOTE: This ID is owned by foreach() routines and can not be used outside of
+ * the foreach loop. This means that if one wants to store them those are to be
+ * malloced and copied over.
+ *
+ * If the function returns false, then foreach() loop aborts.
+ */
+typedef bool (*ForeachPtcacheCb)(PTCacheID *pid, void *userdata);
 
-   for (psys=ob->particlesystem.first; psys; psys=psys->next) {
-   if (psys->part==NULL)
+static bool foreach_object_particle_ptcache(Object *object,
+ForeachPtcacheCb callback,
+void *callback_user_data)
+{
+   PTCacheID pid;
+   for (ParticleSystem *psys = object->particlesystem.first;
+psys != NULL;
+psys = psys->next)
+   {
+   if (psys->part==NULL) {
continue;
-
-   /* check to make sure point cache is actually used by the 
particles */
-   if (ELEM(psys->part->phystype, PART_PHYS_NO, PART_PHYS_KEYED))
+   }
+   /* Check to make sure point cache is actually used by the 
particles. */
+   if (ELEM(psys->part->phystype, PART_PHYS_NO, PART_PHYS_KEYED)) {
continue;
-
-   /* hair needs to be included in id-list for cache edit mode to 
work */
-   /* if (psys->part->type == PART_HAIR && (psys->flag & 
PSYS_HAIR_DYNAMICS)==0) */
-   /*  continue; */
-
-   if (psys->part->type == PART_FLUID)
+   }
+   /* Hair needs to be included in id-list for cache edit mode to 
work. */
+#if 0
+   if ((psys->part->type == PART_HAIR) &&
+   (psys->flag & PSYS_HAIR_DYNAMICS) == 0)
+   {
continue;
-
-   pid= MEM_callocN(sizeof(PTCacheID), "PTCacheID");
-   BKE_ptcache_id_from_particles(pid, ob, psys);
-   BLI_addtail(lb, pid);
+   }
+#endif
+   if (psys->part->type == PART_FLUID) {
+   continue;
+   }
+   BKE_ptcache_id_from_particles(, object, psys);
+   if (!callback(, callback_user_data)) {
+   return false;
+   }
}
+   return true;
+}
 
-   for (md=ob->modifiers.first; md; md=md->next) {
+static bool foreach_object_modifier_ptcache(Object *object,
+ForeachPtcacheCb callback,
+void *callback_user_data)
+{
+   PTCacheID pid;
+   for (ModifierData *md = object->modifiers.first; md != NULL; md = 
md->next) {
if (md->type == eModifierType_Cloth) {
-   pid= MEM_callocN(sizeof(PTCacheID), "PTCacheID");
-   BKE_ptcache_id_from_cloth(pid, ob, 
(ClothModifierData*)md);
-   BLI_addtail(lb, pid);
+   BKE_ptcache_id_from_cloth(, object, 
(ClothModifierData*)md);
+   if (!callback(, callback_user_data)) {
+   return false;
+   }
}
else if (md->type == eModifierType_Smoke) {
SmokeModifierData *smd = (SmokeModifierData *)md;
if (smd->type & MOD_SMOKE_TYPE_DOMAIN) {
-   pid= MEM_callocN(sizeof(PTCacheID), 
"PTCacheID");
-   

[Bf-blender-cvs] [eefae747dad] blender2.8: Depsgraph: Remove meaningless evaluation mode

2018-11-14 Thread Sergey Sharybin
Commit: eefae747dadd0b9febfa6641307d6a898a13a1d4
Author: Sergey Sharybin
Date:   Wed Nov 14 11:43:25 2018 +0100
Branches: blender2.8
https://developer.blender.org/rBeefae747dadd0b9febfa6641307d6a898a13a1d4

Depsgraph: Remove meaningless evaluation mode

With the current implementation it only confuses logic around
checks like vewport/render subdivision levels.

If this mode is really needed for any decision making, implement
this properly.

===

M   source/blender/depsgraph/DEG_depsgraph.h
M   source/blender/depsgraph/intern/depsgraph_query_filter.cc

===

diff --git a/source/blender/depsgraph/DEG_depsgraph.h 
b/source/blender/depsgraph/DEG_depsgraph.h
index fa2675297bc..c87ba188677 100644
--- a/source/blender/depsgraph/DEG_depsgraph.h
+++ b/source/blender/depsgraph/DEG_depsgraph.h
@@ -71,7 +71,6 @@ struct ViewLayer;
 typedef enum eEvaluationMode {
DAG_EVAL_VIEWPORT   = 0,/* evaluate for OpenGL viewport */
DAG_EVAL_RENDER = 1,/* evaluate for render purposes */
-   DAG_EVAL_BACKGROUND = 2,/* evaluate in background for 
baking/caching */
 } eEvaluationMode;
 
 /* DagNode->eval_flags */
diff --git a/source/blender/depsgraph/intern/depsgraph_query_filter.cc 
b/source/blender/depsgraph/intern/depsgraph_query_filter.cc
index 83963e7e5b2..1b44d4229e6 100644
--- a/source/blender/depsgraph/intern/depsgraph_query_filter.cc
+++ b/source/blender/depsgraph/intern/depsgraph_query_filter.cc
@@ -200,7 +200,7 @@ Depsgraph *DEG_graph_filter(const Depsgraph *graph_src, 
Main *bmain, DEG_FilterQ
/* TODO: Improve the builders to not add any ID nodes we don't need 
later (e.g. ProxyBuilder?) */
Depsgraph *graph_new = DEG_graph_new(deg_graph_src->scene,
 deg_graph_src->view_layer,
-DAG_EVAL_BACKGROUND);
+deg_graph_src->mode);
DEG_graph_build_from_view_layer(graph_new,
bmain,
deg_graph_src->scene,

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [1386a4a0f2b] blender2.8: Gizmo: get background color based on view option

2018-11-14 Thread Campbell Barton
Commit: 1386a4a0f2b03f44f123381448240652788cca29
Author: Campbell Barton
Date:   Thu Nov 15 00:05:54 2018 +1100
Branches: blender2.8
https://developer.blender.org/rB1386a4a0f2b03f44f123381448240652788cca29

Gizmo: get background color based on view option

===

M   source/blender/editors/include/ED_view3d.h
M   source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c
M   source/blender/editors/space_view3d/view3d_utils.c

===

diff --git a/source/blender/editors/include/ED_view3d.h 
b/source/blender/editors/include/ED_view3d.h
index 35c92c3561b..f0c805eea8d 100644
--- a/source/blender/editors/include/ED_view3d.h
+++ b/source/blender/editors/include/ED_view3d.h
@@ -107,6 +107,7 @@ enum eV3DCursorOrient {
V3D_CURSOR_ORIENT_GEOM,
 };
 
+void ED_view3d_background_color_get(const struct Scene *scene, const struct 
View3D *v3d, float r_color[3]);
 struct View3DCursor *ED_view3d_cursor3d_get(struct Scene *scene, struct View3D 
*v3d);
 void ED_view3d_cursor3d_calc_mat3(const struct Scene *scene, const struct 
View3D *v3d, float mat[3][3]);
 void ED_view3d_cursor3d_calc_mat4(const struct Scene *scene, const struct 
View3D *v3d, float mat[4][4]);
diff --git a/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c 
b/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c
index 3ea563fb918..acffb29c82a 100644
--- a/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c
+++ b/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c
@@ -184,7 +184,10 @@ static void draw_xyz_wire(
 
 static void axis_geom_draw(
 const wmGizmo *gz, const float color[4], const bool UNUSED(select),
-/* Needed for screen-aligned font drawing. */
+#ifdef USE_FADE_BACKGROUND
+const float color_bg[3],
+#endif
+/* Matrix is needed for screen-aligned font drawing. */
 const float matrix_final[4][4])
 {
GPU_line_width(gz->line_width);
@@ -253,11 +256,6 @@ static void axis_geom_draw(
}
}
 
-#ifdef USE_FADE_BACKGROUND
-   float color_bg[3];
-   UI_GetThemeColor3fv(TH_HIGH_GRAD, color_bg);
-#endif
-
for (int axis_index = 0; axis_index < ARRAY_SIZE(axis_order); 
axis_index++) {
const int index = axis_order[axis_index].index;
const int axis = axis_order[axis_index].axis;
@@ -376,7 +374,7 @@ static void axis_geom_draw(
 }
 
 static void axis3d_draw_intern(
-const bContext *UNUSED(C), wmGizmo *gz,
+const bContext *C, wmGizmo *gz,
 const bool select, const bool highlight)
 {
const float *color = highlight ? gz->color_hi : gz->color;
@@ -394,8 +392,25 @@ static void axis3d_draw_intern(
GPU_matrix_push();
GPU_matrix_mul(matrix_final);
 
+#ifdef USE_FADE_BACKGROUND
+   float color_bg[3];
+   if (select == false) {
+   ED_view3d_background_color_get(CTX_data_scene(C), 
CTX_wm_view3d(C), color_bg);
+   }
+   else {
+   zero_v3(color_bg);
+   }
+#else
+   UNUSED_VARS(C);
+#endif
+
GPU_blend(true);
-   axis_geom_draw(gz, color, select, matrix_final);
+   axis_geom_draw(
+   gz, color, select,
+#ifdef USE_FADE_BACKGROUND
+   color_bg,
+#endif
+   matrix_final);
GPU_blend(false);
GPU_matrix_pop();
 }
diff --git a/source/blender/editors/space_view3d/view3d_utils.c 
b/source/blender/editors/space_view3d/view3d_utils.c
index 9b006bf4d9b..022fccd7ce7 100644
--- a/source/blender/editors/space_view3d/view3d_utils.c
+++ b/source/blender/editors/space_view3d/view3d_utils.c
@@ -36,6 +36,7 @@
 #include "DNA_curve_types.h"
 #include "DNA_object_types.h"
 #include "DNA_scene_types.h"
+#include "DNA_world_types.h"
 
 #include "MEM_guardedalloc.h"
 
@@ -65,6 +66,8 @@
 #include "ED_screen.h"
 #include "ED_view3d.h"
 
+#include "UI_resources.h"
+
 #include "view3d_intern.h"  /* own include */
 
 /*  */
@@ -72,6 +75,22 @@
  *
  * \{ */
 
+void ED_view3d_background_color_get(const Scene *scene, const View3D *v3d, 
float r_color[3])
+{
+   switch (v3d->shading.background_type) {
+   case V3D_SHADING_BACKGROUND_WORLD:
+   copy_v3_v3(r_color, >world->horr);
+   break;
+   case V3D_SHADING_BACKGROUND_VIEWPORT:
+   copy_v3_v3(r_color, v3d->shading.background_color);
+   break;
+   case V3D_SHADING_BACKGROUND_THEME:
+   default:
+   UI_GetThemeColor3fv(TH_HIGH_GRAD, r_color);
+   break;
+   }
+}
+
 View3DCursor *ED_view3d_cursor3d_get(Scene *scene, View3D *v3d)
 {
if (v3d && v3d->localvd) {

___
Bf-blender-cvs mailing list

[Bf-blender-cvs] [c437c017e33] collada2.8: Merge branch 'collada' into blender2.8

2018-11-14 Thread Gaia Clary
Commit: c437c017e33f3e76c56744ce9e06a127dbc77323
Author: Gaia Clary
Date:   Thu Oct 25 22:45:40 2018 +0200
Branches: collada2.8
https://developer.blender.org/rBc437c017e33f3e76c56744ce9e06a127dbc77323

Merge branch 'collada' into blender2.8

===



===

diff --cc source/blender/collada/AnimationClipExporter.h
index 8a48ca29090,2dbe98ffe31..d76a3fa1380
--- a/source/blender/collada/AnimationClipExporter.h
+++ b/source/blender/collada/AnimationClipExporter.h
@@@ -20,32 -20,31 +20,31 @@@
   * * END GPL LICENSE BLOCK *
   */
  
- /** \file DocumentExporter.h
-  *  \ingroup collada
-  */
- 
- #ifndef __DOCUMENTEXPORTER_H__
- #define __DOCUMENTEXPORTER_H__
- 
- #include "collada.h"
- 
- extern "C" {
- #include "DNA_customdata_types.h"
- 
- }
+ #include 
+ #include 
+ #include 
  
- struct Scene;
+ #include "COLLADASWLibraryAnimationClips.h"
  
- class DocumentExporter
- {
-  public:
-   DocumentExporter(Depsgraph *depsgraph, const ExportSettings 
*export_settings);
-   int  exportCurrentScene(bContext *C, Scene *sce);
  
-   void exportScenes(const char *filename);
+ class AnimationClipExporter:COLLADASW::LibraryAnimationClips {
  private:
 -  EvaluationContext * eval_ctx;
 +  Depsgraph *depsgraph;
+   Scene *scene;
+   COLLADASW::StreamWriter *sw;
const ExportSettings *export_settings;
- };
+   std::vector> anim_meta;
+ 
+ public:
  
- #endif
 -  AnimationClipExporter(EvaluationContext *eval_ctx, 
COLLADASW::StreamWriter *sw, const ExportSettings *export_settings, 
std::vector> anim_meta) :
 -  eval_ctx(eval_ctx),
++  AnimationClipExporter(Depsgraph *depsgraph , COLLADASW::StreamWriter 
*sw, const ExportSettings *export_settings, 
std::vector> anim_meta) :
++  depsgraph(depsgraph),
+   COLLADASW::LibraryAnimationClips(sw),
+   export_settings(export_settings),
+   anim_meta(anim_meta)
+   {
+   this->sw = sw;
+   }
+ 
+   void exportAnimationClips(Scene *sce);
 -};
++};
diff --cc source/blender/collada/AnimationExporter.cpp
index ef9611778c9,a5968f9323f..217fb08f014
--- a/source/blender/collada/AnimationExporter.cpp
+++ b/source/blender/collada/AnimationExporter.cpp
@@@ -20,356 -20,198 +20,202 @@@
   * * END GPL LICENSE BLOCK *
   */
  
 +/** \file AnimationExporter.cpp
 + *  \ingroup collada
 + */
 +
  #include "GeometryExporter.h"
  #include "AnimationExporter.h"
+ #include "AnimationClipExporter.h"
+ #include "BCAnimationSampler.h"
  #include "MaterialExporter.h"
+ #include "collada_utils.h"
  
- template
- void forEachObjectInExportSet(Scene *sce, Functor , LinkNode *export_set)
- {
-   LinkNode *node;
-   for (node = export_set; node; node = node->next) {
-   Object *ob = (Object *)node->link;
-   f(ob);
-   }
- }
+ std::string EMPTY_STRING;
  
- bool AnimationExporter::exportAnimations(Main *bmain, Scene *sce)
+ std::string AnimationExporter::get_axis_name(std::string channel, int id)
  {
-   bool has_animations = hasAnimations(sce);
-   m_bmain = bmain;
-   if (has_animations) {
-   this->scene = sce;
- 
-   openLibrary();
+   static std::map> 
BC_COLLADA_AXIS_FROM_TYPE = {
+   { "color" ,{ "R", "G", "B" } },
+   { "specular_color",{ "R", "G", "B" } },
+   { "diffuse_color",{ "R", "G", "B" } },
+   { "alpha",{ "R", "G", "B" } },
+   { "scale",{ "X", "Y", "Z" } },
+   { "location",{ "X", "Y", "Z" } },
+   { "rotation_euler",{ "X", "Y", "Z" } }
+   };
  
-   forEachObjectInExportSet(sce, *this, 
this->export_settings->export_set);
+   std::map>::const_iterator it;
+   it = BC_COLLADA_AXIS_FROM_TYPE.find(channel);
+   if (it == BC_COLLADA_AXIS_FROM_TYPE.end())
+   return "";
  
-   closeLibrary();
-   }
-   return has_animations;
+   const std::vector  = it->second;
+   if (id >= subchannel.size())
+   return "";
+   return subchannel[id];
  }
  
- bool AnimationExporter::is_flat_line(std::vector , int 
channel_count)
+ bool AnimationExporter::open_animation_container(bool has_container, Object 
*ob)
  {
-   for (int i = 0; i < values.size(); i += channel_count) {
-   for (int j = 0; j < channel_count; j++) {
-   if (!bc_in_range(values[j], values[i+j], 0.01))
-   return false;
-   }
+   if (!has_container) {
+   char anim_id[200];
+   sprintf(anim_id, "action_container-%s", 
translate_id(id_name(ob)).c_str());
+   openAnimation(anim_id, id_name(ob));
}
return true;
  }
- /*
-  * This function creates a complete LINEAR Collada  Entry with all 
needed
-  * 

[Bf-blender-cvs] [e7e5930efb4] collada2.8: Merge branch 'blender2.8' of git.blender.org:blender into blender2.8

2018-11-14 Thread Gaia Clary
Commit: e7e5930efb4c0f3495f3c2098a4b61014e66c282
Author: Gaia Clary
Date:   Thu Oct 25 23:01:21 2018 +0200
Branches: collada2.8
https://developer.blender.org/rBe7e5930efb4c0f3495f3c2098a4b61014e66c282

Merge branch 'blender2.8' of git.blender.org:blender into blender2.8

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [9f298e2c81e] collada2.8: Merge remote-tracking branch 'origin/blender2.8' into collada2.8

2018-11-14 Thread Gaia Clary
Commit: 9f298e2c81e94fd1cf50f584c56a67ad0f7a663e
Author: Gaia Clary
Date:   Thu Oct 25 23:09:04 2018 +0200
Branches: collada2.8
https://developer.blender.org/rB9f298e2c81e94fd1cf50f584c56a67ad0f7a663e

Merge remote-tracking branch 'origin/blender2.8' into collada2.8

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [c1b507f7332] collada2.8: Merge remote-tracking branch 'origin/blender2.8' into collada2.8

2018-11-14 Thread unknown
Commit: c1b507f73326e68e288ee051108c023a74506534
Author: unknown
Date:   Wed Oct 31 20:57:09 2018 +0100
Branches: collada2.8
https://developer.blender.org/rBc1b507f73326e68e288ee051108c023a74506534

Merge remote-tracking branch 'origin/blender2.8' into collada2.8

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [9dcd4f9fcdd] collada2.8: Merge remote-tracking branch 'origin/blender2.8' into collada2.8

2018-11-14 Thread Gaia Clary
Commit: 9dcd4f9fcdd2f31c997539110bc171ec510b29a8
Author: Gaia Clary
Date:   Mon Oct 29 08:39:36 2018 +0100
Branches: collada2.8
https://developer.blender.org/rB9dcd4f9fcdd2f31c997539110bc171ec510b29a8

Merge remote-tracking branch 'origin/blender2.8' into collada2.8

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [af6585cc9cf] collada2.8: Merge branch 'blender2.8' of git.blender.org:blender into collada2.8

2018-11-14 Thread Gaia Clary
Commit: af6585cc9cfc15e8f5cb3c371b9be22001658243
Author: Gaia Clary
Date:   Fri Nov 2 11:33:07 2018 +0100
Branches: collada2.8
https://developer.blender.org/rBaf6585cc9cfc15e8f5cb3c371b9be22001658243

Merge branch 'blender2.8' of git.blender.org:blender into collada2.8

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [569ad49a01e] collada2.8: fix: Collada: remove not needed Context attribute from DocumentExporter

2018-11-14 Thread Gaia Clary
Commit: 569ad49a01e83704bb0b3600350fccd3235acba9
Author: Gaia Clary
Date:   Thu Nov 1 19:45:57 2018 +0100
Branches: collada2.8
https://developer.blender.org/rB569ad49a01e83704bb0b3600350fccd3235acba9

fix: Collada: remove not needed Context attribute from DocumentExporter

===

M   source/blender/collada/DocumentExporter.cpp
M   source/blender/collada/DocumentExporter.h

===

diff --git a/source/blender/collada/DocumentExporter.cpp 
b/source/blender/collada/DocumentExporter.cpp
index 6aea8a50c64..a87c05fe9bb 100644
--- a/source/blender/collada/DocumentExporter.cpp
+++ b/source/blender/collada/DocumentExporter.cpp
@@ -182,7 +182,7 @@ static COLLADABU::NativeString make_temp_filepath(const 
char *name, const char *
 
 int DocumentExporter::exportCurrentScene(bContext *C, Scene *sce)
 {
-   Main *bmain = CTX_data_main(mContext);
+   Main *bmain = CTX_data_main(C);
PointerRNA sceneptr, unit_settings;
PropertyRNA *system; /* unused , *scale; */
 
@@ -291,7 +291,7 @@ int DocumentExporter::exportCurrentScene(bContext *C, Scene 
*sce)
}
 
// 
-   ArmatureExporter arm_exporter(mContext, writer, this->export_settings);
+   ArmatureExporter arm_exporter(C, writer, this->export_settings);
ControllerExporter controller_exporter(writer, this->export_settings);
if (bc_has_object_type(export_set, OB_ARMATURE) || 
this->export_settings->include_shapekeys)
{
@@ -300,7 +300,7 @@ int DocumentExporter::exportCurrentScene(bContext *C, Scene 
*sce)
 
// 
 
-   SceneExporter se(mContext, writer, _exporter, 
this->export_settings);
+   SceneExporter se(C, writer, _exporter, this->export_settings);
 
if (this->export_settings->include_animations) {
// 
diff --git a/source/blender/collada/DocumentExporter.h 
b/source/blender/collada/DocumentExporter.h
index 774aa953aca..743df6f04c8 100644
--- a/source/blender/collada/DocumentExporter.h
+++ b/source/blender/collada/DocumentExporter.h
@@ -44,7 +44,6 @@ class DocumentExporter
void exportScenes(const char *filename);
 private:
Depsgraph *depsgraph;
-   bContext *mContext;
const ExportSettings *export_settings;
 };

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [9f2b380b415] collada2.8: Merge remote-tracking branch 'origin/blender2.8' into collada2.8

2018-11-14 Thread unknown
Commit: 9f2b380b415c95999f68228329a87587ef9c2df0
Author: unknown
Date:   Wed Oct 31 23:52:06 2018 +0100
Branches: collada2.8
https://developer.blender.org/rB9f2b380b415c95999f68228329a87587ef9c2df0

Merge remote-tracking branch 'origin/blender2.8' into collada2.8

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [eac9021c628] collada2.8: Merge remote-tracking branch 'origin/blender2.8' into collada2.8

2018-11-14 Thread unknown
Commit: eac9021c628d90b284a6365b1b415b3bfb46efb2
Author: unknown
Date:   Wed Oct 31 21:17:03 2018 +0100
Branches: collada2.8
https://developer.blender.org/rBeac9021c628d90b284a6365b1b415b3bfb46efb2

Merge remote-tracking branch 'origin/blender2.8' into collada2.8

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [d3ca5f8395f] collada2.8: Merge remote-tracking branch 'origin/blender2.8' into collada2.8

2018-11-14 Thread Gaia Clary
Commit: d3ca5f8395f9e3c2a6dd9f0bdf9adbc40a177bee
Author: Gaia Clary
Date:   Thu Nov 1 19:46:17 2018 +0100
Branches: collada2.8
https://developer.blender.org/rBd3ca5f8395f9e3c2a6dd9f0bdf9adbc40a177bee

Merge remote-tracking branch 'origin/blender2.8' into collada2.8

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [58dfe293cb5] collada2.8: Merge remote-tracking branch 'origin/blender2.8' into collada2.8

2018-11-14 Thread unknown
Commit: 58dfe293cb5e684268f588bc12021370bad62991
Author: unknown
Date:   Thu Nov 1 09:30:37 2018 +0100
Branches: collada2.8
https://developer.blender.org/rB58dfe293cb5e684268f588bc12021370bad62991

Merge remote-tracking branch 'origin/blender2.8' into collada2.8

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [087e086ef98] collada2.8: Merge remote-tracking branch 'origin/blender2.8' into collada2.8

2018-11-14 Thread Gaia Clary
Commit: 087e086ef9840ece503f6d9fdfe354a758bcf1fa
Author: Gaia Clary
Date:   Mon Oct 29 12:02:56 2018 +0100
Branches: collada2.8
https://developer.blender.org/rB087e086ef9840ece503f6d9fdfe354a758bcf1fa

Merge remote-tracking branch 'origin/blender2.8' into collada2.8

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [b3d84853ac5] blender2.8: Keymap: remove keymap export that wrote API calls

2018-11-14 Thread Campbell Barton
Commit: b3d84853ac5f90e0f54a19ee088ce67c7bd47ec7
Author: Campbell Barton
Date:   Thu Nov 15 13:51:55 2018 +1100
Branches: blender2.8
https://developer.blender.org/rBb3d84853ac5f90e0f54a19ee088ce67c7bd47ec7

Keymap: remove keymap export that wrote API calls

Use new keymap format which defines data to be loaded.

===

M   release/scripts/modules/bpy_extras/keyconfig_utils.py
D   release/scripts/modules/bpy_extras/keyconfig_utils_experimental.py

===

diff --git a/release/scripts/modules/bpy_extras/keyconfig_utils.py 
b/release/scripts/modules/bpy_extras/keyconfig_utils.py
index 0509c29ef19..316884e3fe1 100644
--- a/release/scripts/modules/bpy_extras/keyconfig_utils.py
+++ b/release/scripts/modules/bpy_extras/keyconfig_utils.py
@@ -276,107 +276,109 @@ def addon_keymap_unregister(wm, keymaps_description):
 
 
 # -
-# Utility functions
+# Import/Export Functions
 
-def km_exists_in(km, export_keymaps):
-for km2, kc in export_keymaps:
-if km2.name == km.name:
-return True
-return False
 
+def indent(levels):
+return levels * " "
 
-def keyconfig_merge(kc1, kc2):
-""" note: kc1 takes priority over kc2
-"""
-merged_keymaps = [(km, kc1) for km in kc1.keymaps]
-if kc1 != kc2:
-merged_keymaps.extend((km, kc2) for km in kc2.keymaps if not 
km_exists_in(km, merged_keymaps))
-
-return merged_keymaps
 
+def round_float_32(f):
+from struct import pack, unpack
+return unpack("f", pack("f", f))[0]
 
-def _export_properties(prefix, properties, kmi_id, lines=None):
-from bpy.types import OperatorProperties
 
-if lines is None:
-lines = []
+def repr_f32(f):
+f_round = round_float_32(f)
+f_str = repr(f)
+f_str_frac = f_str.partition(".")[2]
+if not f_str_frac:
+return f_str
+for i in range(1, len(f_str_frac)):
+f_test = round(f, i)
+f_test_round = round_float_32(f_test)
+if f_test_round == f_round:
+return "%.*f" % (i, f_test)
+return f_str
 
-def string_value(value):
-if isinstance(value, (str, bool, float, int)):
-return repr(value)
-elif hasattr(value, "__len__"):
-return repr(list(value))
 
-print("Export key configuration: can't write ", value)
-return ""
-
-for pname in properties.bl_rna.properties.keys():
-if pname != "rna_type":
-value = getattr(properties, pname)
-if isinstance(value, OperatorProperties):
-_export_properties(prefix + "." + pname, value, kmi_id, lines)
-elif properties.is_property_set(pname):
-value = string_value(value)
-if value != "":
-lines.append("kmi_props_setattr(%s, '%s', %s)\n" % 
(prefix, pname, value))
-return lines
-
-
-def _kmistr(kmi, is_modal):
-if is_modal:
-kmi_id = kmi.propvalue
-kmi_newfunc = 'new_modal'
-else:
-kmi_id = kmi.idname
-kmi_newfunc = 'new'
-s = ["kmi = km.keymap_items.%s(\'%s\', \'%s\', \'%s\'" % (kmi_newfunc, 
kmi_id, kmi.type, kmi.value)]
+def kmi_args_as_data(kmi):
+s = [
+f"\"type\": '{kmi.type}'",
+f"\"value\": '{kmi.value}'"
+]
 
 if kmi.any:
-s.append(", any=True")
+s.append("\"any\": True")
 else:
 if kmi.shift:
-s.append(", shift=True")
+s.append("\"shift\": True")
 if kmi.ctrl:
-s.append(", ctrl=True")
+s.append("\"ctrl\": True")
 if kmi.alt:
-s.append(", alt=True")
+s.append("\"alt\": True")
 if kmi.oskey:
-s.append(", oskey=True")
+s.append("\"oskey\": True")
 if kmi.key_modifier and kmi.key_modifier != 'NONE':
-s.append(", key_modifier=\'%s\'" % kmi.key_modifier)
+s.append(f"\"key_modifier\": '{kmi.key_modifier}'")
 
-s.append(")\n")
+return "{" + ", ".join(s) + "}"
 
-props = kmi.properties
 
-if props is not None:
-_export_properties("kmi.properties", props, kmi_id, s)
+def _kmi_properties_to_lines_recursive(level, properties, lines):
+from bpy.types import OperatorProperties
 
-if not kmi.active:
-s.append("kmi.active = False\n")
+def string_value(value):
+if isinstance(value, (str, bool, int)):
+return repr(value)
+elif isinstance(value, float):
+return repr_f32(value)
+elif getattr(value, '__len__', False):
+return repr(tuple(value))
+raise Exception(f"Export key configuration: can't write {value!r}")
 
-return "".join(s)
+for pname in properties.bl_rna.properties.keys():
+if pname != "rna_type":
+value = getattr(properties, pname)
+

[Bf-blender-cvs] [349d85eb9e4] blender2.8: Missed when moving tool keymaps

2018-11-14 Thread Campbell Barton
Commit: 349d85eb9e4bc1e4ee65cff278abda47891b6c1c
Author: Campbell Barton
Date:   Thu Nov 15 13:34:47 2018 +1100
Branches: blender2.8
https://developer.blender.org/rB349d85eb9e4bc1e4ee65cff278abda47891b6c1c

Missed when moving tool keymaps

===

M   release/scripts/startup/bl_ui/space_toolsystem_toolbar.py

===

diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py 
b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
index 44058a97e0d..533d8209ab6 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
@@ -1074,14 +1074,7 @@ class _defs_gpencil_edit:
 text="Select Circle",
 icon="ops.generic.select_circle",
 widget=None,
-keymap=(
-("gpencil.select_circle",
- dict(),
- dict(type='EVT_TWEAK_A', value='ANY')),
-("gpencil.select_circle",
- dict(deselect=True),
- dict(type='ACTIONMOUSE', value='PRESS', ctrl=True)),
-),
+keymap=(),
 )
 
 @ToolDef.from_fn
@@ -1090,11 +1083,7 @@ class _defs_gpencil_edit:
 text="Shear",
 icon="ops.gpencil.edit_shear",
 widget=None,
-keymap=(
-("transform.shear",
- dict(release_confirm=True),
- dict(type='EVT_TWEAK_A', value='ANY')),
-),
+keymap=(),
 )
 
 @ToolDef.from_fn
@@ -1103,11 +1092,7 @@ class _defs_gpencil_edit:
 text="To Sphere",
 icon="ops.transform.tosphere",
 widget=None,
-keymap=(
-("transform.tosphere",
- dict(release_confirm=True),
- dict(type='EVT_TWEAK_A', value='ANY')),
-),
+keymap=(),
 )

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [8734a09379d] blender2.8: Tool System: use preset keymap loading logic

2018-11-14 Thread Campbell Barton
Commit: 8734a09379dce6d2ca8d0fdd2083821233520e78
Author: Campbell Barton
Date:   Thu Nov 15 13:36:23 2018 +1100
Branches: blender2.8
https://developer.blender.org/rB8734a09379dce6d2ca8d0fdd2083821233520e78

Tool System: use preset keymap loading logic

The data structures for tool keymaps and presets were different,
use the same structure and expose function publicly.

===

M   release/scripts/modules/bpy_extras/keyconfig_utils.py
M   release/scripts/modules/bpy_extras/keyconfig_utils_experimental.py
M   release/scripts/startup/bl_ui/space_toolsystem_common.py

===

diff --git a/release/scripts/modules/bpy_extras/keyconfig_utils.py 
b/release/scripts/modules/bpy_extras/keyconfig_utils.py
index 1cad1c965b0..0509c29ef19 100644
--- a/release/scripts/modules/bpy_extras/keyconfig_utils.py
+++ b/release/scripts/modules/bpy_extras/keyconfig_utils.py
@@ -476,6 +476,7 @@ def keyconfig_test(kc):
 # so key configs are always data.
 from .keyconfig_utils_experimental import (
 keyconfig_export_as_data,
+keymap_items_from_data,
 keyconfig_import_from_data,
 keyconfig_module_from_preset,
 )
diff --git a/release/scripts/modules/bpy_extras/keyconfig_utils_experimental.py 
b/release/scripts/modules/bpy_extras/keyconfig_utils_experimental.py
index b93da5ec6da..3077b2e2fbf 100644
--- a/release/scripts/modules/bpy_extras/keyconfig_utils_experimental.py
+++ b/release/scripts/modules/bpy_extras/keyconfig_utils_experimental.py
@@ -20,6 +20,7 @@
 
 __all__ = (
 "keyconfig_export_as_data",
+"keymap_items_from_data",
 "keyconfig_import_from_data",
 "keyconfig_module_from_preset",
 )
@@ -205,44 +206,46 @@ def keyconfig_export_as_data(wm, kc, filepath, *, 
all_keymaps=False):
 fw("
keyconfig_import_from_data(os.path.splitext(os.path.basename(__file__))[0], 
keyconfig_data)\n")
 
 
+def _kmi_props_setattr(kmi_props, attr, value):
+if type(value) is list:
+kmi_subprop = getattr(kmi_props, attr)
+for subattr, subvalue in value:
+_kmi_props_setattr(kmi_subprop, subattr, subvalue)
+return
+
+try:
+setattr(kmi_props, attr, value)
+except AttributeError:
+print(f"Warning: property '{attr}' not found in keymap item 
'{kmi_props.__class__.__name__}'")
+except Exception as ex:
+print(f"Warning: {ex!r}")
+
+
+def keymap_items_from_data(km, km_items, is_modal=False):
+new_fn = getattr(km.keymap_items, "new_modal" if is_modal else "new")
+for (kmi_idname, kmi_args, kmi_data) in km_items:
+kmi = new_fn(kmi_idname, **kmi_args)
+if kmi_data is not None:
+if not kmi_data.get("active", True):
+kmi.active = False
+kmi_props_data = kmi_data.get("properties", None)
+if kmi_props_data is not None:
+kmi_props = kmi.properties
+for attr, value in kmi_props_data:
+_kmi_props_setattr(kmi_props, attr, value)
+
+
 def keyconfig_import_from_data(name, keyconfig_data):
 # Load data in the format defined above.
 #
 # Runs at load time, keep this fast!
 
-def kmi_props_setattr(kmi_props, attr, value):
-if type(value) is list:
-kmi_subprop = getattr(kmi_props, attr)
-for subattr, subvalue in value:
-kmi_props_setattr(kmi_subprop, subattr, subvalue)
-return
-
-try:
-setattr(kmi_props, attr, value)
-except AttributeError:
-print(f"Warning: property '{attr}' not found in keymap item 
'{kmi_props.__class__.__name__}'")
-except Exception as ex:
-print(f"Warning: {ex!r}")
-
 import bpy
 wm = bpy.context.window_manager
 kc = wm.keyconfigs.new(name)
-del name
-
 for (km_name, km_args, km_content) in keyconfig_data:
 km = kc.keymaps.new(km_name, **km_args)
-is_modal = km_args.get("modal", False)
-new_fn = getattr(km.keymap_items, "new_modal" if is_modal else "new")
-for (kmi_idname, kmi_args, kmi_data) in km_content["items"]:
-kmi = new_fn(kmi_idname, **kmi_args)
-if kmi_data is not None:
-if not kmi_data.get("active", True):
-kmi.active = False
-kmi_props_data = kmi_data.get("properties", None)
-if kmi_props_data is not None:
-kmi_props = kmi.properties
-for attr, value in kmi_props_data:
-kmi_props_setattr(kmi_props, attr, value)
+keymap_items_from_data(km, km_content["items"], 
is_modal=km_args.get("modal", False))
 
 
 def keyconfig_module_from_preset(name, preset_reference_filename=None):
diff --git a/release/scripts/startup/bl_ui/space_toolsystem_common.py 
b/release/scripts/startup/bl_ui/space_toolsystem_common.py
index 

[Bf-blender-cvs] [8c7727946c5] blender2.8: Gizmo: tweak navigation drawing for axis views

2018-11-14 Thread Campbell Barton
Commit: 8c7727946c5bbf5119cd82c3ae08dcb65ab8076e
Author: Campbell Barton
Date:   Thu Nov 15 14:11:08 2018 +1100
Branches: blender2.8
https://developer.blender.org/rB8c7727946c5bbf5119cd82c3ae08dcb65ab8076e

Gizmo: tweak navigation drawing for axis views

Axis aligned views now show both small/large handles,
this makes it possible to well if the view is in front or behind.

===

M   source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c

===

diff --git a/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c 
b/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c
index ae5ce27cd8d..356f671345a 100644
--- a/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c
+++ b/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c
@@ -292,8 +292,8 @@ static void axis_geom_draw(
 
bool ok = true;
 
-   /* skip view align axis */
-   if ((axis_align == axis) && (gz->matrix_offset[axis][2] > 0.0f) 
== is_pos) {
+   /* Skip view align axis when selecting (allows to switch to 
opposite side). */
+   if (select && ((axis_align == axis) && 
(gz->matrix_offset[axis][2] > 0.0f) == is_pos)) {
ok = false;
}
if (ok) {
@@ -313,7 +313,7 @@ static void axis_geom_draw(
 * This is a detail so primary axes show as dominant.
 */
const bool is_pos_color = (
-   ((axis_order[axis_index].depth > 
(axis_depth_bias * (is_pos ? -1 : 1))) == (axis_align != axis)));
+   axis_order[axis_index].depth > (axis_depth_bias 
* (is_pos ? -1 : 1)));
 
 
if (select == false) {
@@ -355,7 +355,7 @@ static void axis_geom_draw(
{
GPU_matrix_push();
GPU_matrix_translate_3fv(v_final);
-   GPU_matrix_scale_1f(show_axis_char ? 
AXIS_HANDLE_SIZE_FG : AXIS_HANDLE_SIZE_BG);
+   GPU_matrix_scale_1f(is_pos ? 
AXIS_HANDLE_SIZE_FG : AXIS_HANDLE_SIZE_BG);
 
GPUBatch *sphere = GPU_batch_preset_sphere(0);
GPU_batch_program_set_builtin(sphere, 
GPU_SHADER_3D_UNIFORM_COLOR);

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [02a21420e8b] blender2.8: Fix gizmos in the node editor

2018-11-14 Thread Campbell Barton
Commit: 02a21420e8bdede1252ece3315cec9a233bd994f
Author: Campbell Barton
Date:   Thu Nov 15 15:43:50 2018 +1100
Branches: blender2.8
https://developer.blender.org/rB02a21420e8bdede1252ece3315cec9a233bd994f

Fix gizmos in the node editor

===

M   source/blender/editors/space_node/space_node.c

===

diff --git a/source/blender/editors/space_node/space_node.c 
b/source/blender/editors/space_node/space_node.c
index ba5703946c3..85820ec3e13 100644
--- a/source/blender/editors/space_node/space_node.c
+++ b/source/blender/editors/space_node/space_node.c
@@ -979,13 +979,12 @@ void ED_spacetype_node(void)
/* regions: main window */
art = MEM_callocN(sizeof(ARegionType), "spacetype node region");
art->regionid = RGN_TYPE_WINDOW;
-   art->keymapflag = ED_KEYMAP_GIZMO;
art->init = node_main_region_init;
art->draw = node_main_region_draw;
+   art->keymapflag = ED_KEYMAP_UI | ED_KEYMAP_GIZMO | ED_KEYMAP_VIEW2D | 
ED_KEYMAP_FRAMES | ED_KEYMAP_GPENCIL;
art->listener = node_region_listener;
art->cursor = node_cursor;
art->event_cursor = true;
-   art->keymapflag = ED_KEYMAP_UI | ED_KEYMAP_VIEW2D | ED_KEYMAP_FRAMES | 
ED_KEYMAP_GPENCIL;
 
BLI_addhead(>regiontypes, art);

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [7c033658610] blender2.8: WM: use spacebar press event (not double click)

2018-11-14 Thread Campbell Barton
Commit: 7c0336586102f5ba860c632e762b9317a1bfec20
Author: Campbell Barton
Date:   Thu Nov 15 17:12:33 2018 +1100
Branches: blender2.8
https://developer.blender.org/rB7c0336586102f5ba860c632e762b9317a1bfec20

WM: use spacebar press event (not double click)

Functionality) is nicer but this uses a hack to make it work,
keep the code under a variable in case we want to remove.

===

M   release/scripts/startup/bl_operators/wm.py
M   release/scripts/startup/bl_ui/space_toolsystem_common.py

===

diff --git a/release/scripts/startup/bl_operators/wm.py 
b/release/scripts/startup/bl_operators/wm.py
index 6bf0e742ff6..860f497ba6b 100644
--- a/release/scripts/startup/bl_operators/wm.py
+++ b/release/scripts/startup/bl_operators/wm.py
@@ -35,6 +35,10 @@ from bpy.props import (
 
 from bpy.app.translations import pgettext_tip as tip_
 
+# FIXME, we need a way to detect key repeat events.
+# unfortunately checking event previous values isn't reliable.
+use_toolbar_release_hack = True
+
 
 rna_path_prop = StringProperty(
 name="Context Attributes",
@@ -2383,6 +2387,18 @@ class WM_OT_tool_set_by_name(Operator):
 
 space_type: rna_space_type_prop
 
+if use_toolbar_release_hack:
+def invoke(self, context, event):
+# Hack :S
+if not self.properties.is_property_set("name"):
+WM_OT_toolbar._key_held = False
+return {'PASS_THROUGH'}
+elif WM_OT_toolbar._key_held and event.value != 'RELEASE':
+return {'PASS_THROUGH'}
+WM_OT_toolbar._key_held = False
+
+return self.execute(context)
+
 def execute(self, context):
 from bl_ui.space_toolsystem_common import (
 activate_by_name,
@@ -2406,6 +2422,9 @@ class WM_OT_toolbar(Operator):
 bl_idname = "wm.toolbar"
 bl_label = "Toolbar"
 
+if use_toolbar_release_hack:
+_key_held = False
+
 @classmethod
 def poll(cls, context):
 return context.space_data is not None
@@ -2425,6 +2444,10 @@ class WM_OT_toolbar(Operator):
 keymap = keymap_from_context(context, space_type)
 
 def draw_menu(popover, context):
+if use_toolbar_release_hack:
+# Release event sets false.
+WM_OT_toolbar._key_held = True
+
 layout = popover.layout
 layout.operator_context = 'INVOKE_REGION_WIN'
 cls.draw_cls(layout, context, detect_layout=False, scale_y=1.0)
diff --git a/release/scripts/startup/bl_ui/space_toolsystem_common.py 
b/release/scripts/startup/bl_ui/space_toolsystem_common.py
index 31fe865ca41..e06224b8924 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_common.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_common.py
@@ -746,6 +746,8 @@ def keymap_from_context(context, space_type):
 if ToolSelectPanelHelper._tool_get_by_name(context, space_type, 
tap_reset_tool)[1] is None:
 use_tap_reset = False
 
+from bl_operators.wm import use_toolbar_release_hack
+
 # Pie-menu style release to activate.
 use_release_confirm = True
 
@@ -816,7 +818,7 @@ def keymap_from_context(context, space_type):
 if kmi_toolbar_tuple not in kmi_unique_args:
 kmi = keymap.keymap_items.new(
 "wm.tool_set_by_name",
-value='DOUBLE_CLICK',
+value='PRESS' if use_toolbar_release_hack else 'DOUBLE_CLICK',
 **kmi_toolbar_args,
 )
 kmi.properties.name = tap_reset_tool
@@ -1013,6 +1015,15 @@ def keymap_from_context(context, space_type):
 )
 kmi.properties.skip_depressed = True
 
+if use_toolbar_release_hack:
+# ... or pass through to let the toolbar know we're released.
+# Let the operator know we're released.
+kmi = keymap.keymap_items.new(
+"wm.tool_set_by_name",
+type=kmi_toolbar_type,
+value='RELEASE',
+)
+
 wm.keyconfigs.update()
 return keymap

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [49cd13768f4] blender2.8: UI: 'Add Object' rename dimensions

2018-11-14 Thread Campbell Barton
Commit: 49cd13768f4435ca4d109768e5a6a96db21404ee
Author: Campbell Barton
Date:   Thu Nov 15 17:44:50 2018 +1100
Branches: blender2.8
https://developer.blender.org/rB49cd13768f4435ca4d109768e5a6a96db21404ee

UI: 'Add Object' rename dimensions

D3943 by @Zachman w/ edits

===

M   source/blender/editors/curve/editcurve_add.c
M   source/blender/editors/include/ED_object.h
M   source/blender/editors/mesh/editmesh_add.c
M   source/blender/editors/object/object_add.c

===

diff --git a/source/blender/editors/curve/editcurve_add.c 
b/source/blender/editors/curve/editcurve_add.c
index 2dd3b21b875..7eabd9c96e8 100644
--- a/source/blender/editors/curve/editcurve_add.c
+++ b/source/blender/editors/curve/editcurve_add.c
@@ -564,7 +564,7 @@ void CURVE_OT_primitive_bezier_curve_add(wmOperatorType *ot)
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 
-   ED_object_add_unit_props(ot);
+   ED_object_add_unit_props_radius(ot);
ED_object_add_generic_props(ot, true);
 }
 
@@ -587,7 +587,7 @@ void CURVE_OT_primitive_bezier_circle_add(wmOperatorType 
*ot)
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 
-   ED_object_add_unit_props(ot);
+   ED_object_add_unit_props_radius(ot);
ED_object_add_generic_props(ot, true);
 }
 
@@ -610,7 +610,7 @@ void CURVE_OT_primitive_nurbs_curve_add(wmOperatorType *ot)
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 
-   ED_object_add_unit_props(ot);
+   ED_object_add_unit_props_radius(ot);
ED_object_add_generic_props(ot, true);
 }
 
@@ -633,7 +633,7 @@ void CURVE_OT_primitive_nurbs_circle_add(wmOperatorType *ot)
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 
-   ED_object_add_unit_props(ot);
+   ED_object_add_unit_props_radius(ot);
ED_object_add_generic_props(ot, true);
 }
 
@@ -656,7 +656,7 @@ void CURVE_OT_primitive_nurbs_path_add(wmOperatorType *ot)
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 
-   ED_object_add_unit_props(ot);
+   ED_object_add_unit_props_radius(ot);
ED_object_add_generic_props(ot, true);
 }
 
@@ -680,7 +680,7 @@ void 
SURFACE_OT_primitive_nurbs_surface_curve_add(wmOperatorType *ot)
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 
-   ED_object_add_unit_props(ot);
+   ED_object_add_unit_props_radius(ot);
ED_object_add_generic_props(ot, true);
 }
 
@@ -703,7 +703,7 @@ void 
SURFACE_OT_primitive_nurbs_surface_circle_add(wmOperatorType *ot)
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 
-   ED_object_add_unit_props(ot);
+   ED_object_add_unit_props_radius(ot);
ED_object_add_generic_props(ot, true);
 }
 
@@ -726,7 +726,7 @@ void 
SURFACE_OT_primitive_nurbs_surface_surface_add(wmOperatorType *ot)
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 
-   ED_object_add_unit_props(ot);
+   ED_object_add_unit_props_radius(ot);
ED_object_add_generic_props(ot, true);
 }
 
@@ -749,7 +749,7 @@ void 
SURFACE_OT_primitive_nurbs_surface_cylinder_add(wmOperatorType *ot)
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 
-   ED_object_add_unit_props(ot);
+   ED_object_add_unit_props_radius(ot);
ED_object_add_generic_props(ot, true);
 }
 
@@ -772,7 +772,7 @@ void 
SURFACE_OT_primitive_nurbs_surface_sphere_add(wmOperatorType *ot)
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 
-   ED_object_add_unit_props(ot);
+   ED_object_add_unit_props_radius(ot);
ED_object_add_generic_props(ot, true);
 }
 
@@ -795,6 +795,6 @@ void 
SURFACE_OT_primitive_nurbs_surface_torus_add(wmOperatorType *ot)
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 
-   ED_object_add_unit_props(ot);
+   ED_object_add_unit_props_radius(ot);
ED_object_add_generic_props(ot, true);
 }
diff --git a/source/blender/editors/include/ED_object.h 
b/source/blender/editors/include/ED_object.h
index afe037c92d1..4547aaae5d4 100644
--- a/source/blender/editors/include/ED_object.h
+++ b/source/blender/editors/include/ED_object.h
@@ -171,7 +171,8 @@ float ED_object_new_primitive_matrix(
 /* Avoid allowing too much insane values even by typing (typos can hang/crash 
Blender otherwise). */
 #define OBJECT_ADD_SIZE_MAXF 1.0e12f
 
-void ED_object_add_unit_props(struct wmOperatorType *ot);
+void ED_object_add_unit_props_size(struct wmOperatorType *ot);
+void ED_object_add_unit_props_radius(struct wmOperatorType *ot);
 void ED_object_add_generic_props(struct wmOperatorType *ot, bool do_editmode);
 void ED_object_add_mesh_props(struct wmOperatorType *ot);
 bool ED_object_add_generic_get_opts(struct bContext *C, struct wmOperator *op, 
const char view_align_axis,
diff --git 

[Bf-blender-cvs] [5ec1d709e77] blender2.8: WM: use Python bytecode cache to run presets

2018-11-14 Thread Campbell Barton
Commit: 5ec1d709e7717537b9f60e4b9ea997c56f6c5c15
Author: Campbell Barton
Date:   Thu Nov 15 18:42:23 2018 +1100
Branches: blender2.8
https://developer.blender.org/rB5ec1d709e7717537b9f60e4b9ea997c56f6c5c15

WM: use Python bytecode cache to run presets

Key-maps can be very large, avoid parsing on every startup.

===

M   release/scripts/modules/bpy_extras/keyconfig_utils.py
M   release/scripts/startup/bl_operators/presets.py

===

diff --git a/release/scripts/modules/bpy_extras/keyconfig_utils.py 
b/release/scripts/modules/bpy_extras/keyconfig_utils.py
index 316884e3fe1..51f1980f519 100644
--- a/release/scripts/modules/bpy_extras/keyconfig_utils.py
+++ b/release/scripts/modules/bpy_extras/keyconfig_utils.py
@@ -514,7 +514,7 @@ def keyconfig_module_from_preset(name, 
preset_reference_filename=None):
 preset_path = bpy.utils.preset_find(name, "keyconfig")
 
 # module name isn't used or added to 'sys.modules'.
-mod_spec = importlib.util.spec_from_file_location("__bl_keymap__", 
preset_path)
+mod_spec = importlib.util.spec_from_file_location("__main__", preset_path)
 mod = importlib.util.module_from_spec(mod_spec)
 mod_spec.loader.exec_module(mod)
 return mod
diff --git a/release/scripts/startup/bl_operators/presets.py 
b/release/scripts/startup/bl_operators/presets.py
index 5ff8f6f591c..9b83ee92ab4 100644
--- a/release/scripts/startup/bl_operators/presets.py
+++ b/release/scripts/startup/bl_operators/presets.py
@@ -245,9 +245,14 @@ class ExecutePreset(Operator):
 if hasattr(preset_class, "reset_cb"):
 preset_class.reset_cb(context)
 
-# execute the preset using script.python_file_run
 if ext == ".py":
-bpy.ops.script.python_file_run(filepath=filepath)
+import importlib.util
+mod_spec = importlib.util.spec_from_file_location("__main__", 
filepath)
+try:
+
mod_spec.loader.exec_module(importlib.util.module_from_spec(mod_spec))
+except Exception as ex:
+self.report({'ERROR'}, "Failed to executge the preset: " + 
repr(ex))
+
 elif ext == ".xml":
 import rna_xml
 rna_xml.xml_file_run(context,

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [b8d21f9b9bf] blender2.8: Cleanup: typo, whitespace

2018-11-14 Thread Campbell Barton
Commit: b8d21f9b9bfced8fc82aa8a4ada98f5ee06c70d5
Author: Campbell Barton
Date:   Thu Nov 15 18:50:18 2018 +1100
Branches: blender2.8
https://developer.blender.org/rBb8d21f9b9bfced8fc82aa8a4ada98f5ee06c70d5

Cleanup: typo, whitespace

===

M   release/scripts/startup/bl_operators/presets.py
M   source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc
M   source/blender/editors/gpencil/gpencil_utils.c

===

diff --git a/release/scripts/startup/bl_operators/presets.py 
b/release/scripts/startup/bl_operators/presets.py
index 9b83ee92ab4..f66c7082033 100644
--- a/release/scripts/startup/bl_operators/presets.py
+++ b/release/scripts/startup/bl_operators/presets.py
@@ -251,7 +251,7 @@ class ExecutePreset(Operator):
 try:
 
mod_spec.loader.exec_module(importlib.util.module_from_spec(mod_spec))
 except Exception as ex:
-self.report({'ERROR'}, "Failed to executge the preset: " + 
repr(ex))
+self.report({'ERROR'}, "Failed to execute the preset: " + 
repr(ex))
 
 elif ext == ".xml":
 import rna_xml
diff --git 
a/source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc 
b/source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc
index 39dfac2fca7..8197fa116e6 100644
--- a/source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc
+++ b/source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc
@@ -96,7 +96,7 @@ static const int deg_debug_node_type_color_map[][2] = {
 {DEG_NODE_TYPE_SHADING_PARAMETERS, 9},
 {DEG_NODE_TYPE_CACHE,  10},
 {DEG_NODE_TYPE_POINT_CACHE,11},
-{DEG_NODE_TYPE_LAYER_COLLECTIONS , 12},
+{DEG_NODE_TYPE_LAYER_COLLECTIONS,  12},
 {DEG_NODE_TYPE_COPY_ON_WRITE,  13},
 {-1,   0}
 };
diff --git a/source/blender/editors/gpencil/gpencil_utils.c 
b/source/blender/editors/gpencil/gpencil_utils.c
index 85ba5c55b80..6cb539a5f60 100644
--- a/source/blender/editors/gpencil/gpencil_utils.c
+++ b/source/blender/editors/gpencil/gpencil_utils.c
@@ -1447,7 +1447,7 @@ static bool gp_check_cursor_region(bContext *C, int 
mval[2])
Object *ob = CTX_data_active_object(C);
 
if ((ob == NULL) ||
-   (!ELEM(ob->mode, OB_MODE_GPENCIL_PAINT, OB_MODE_GPENCIL_SCULPT, 
OB_MODE_GPENCIL_WEIGHT)))
+   (!ELEM(ob->mode, OB_MODE_GPENCIL_PAINT, OB_MODE_GPENCIL_SCULPT, 
OB_MODE_GPENCIL_WEIGHT)))
{
return false;
}

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [46ac317a292] blender2.8: Py API Docs: documentation for gpu_extras.presets

2018-11-14 Thread Jacques Lucke
Commit: 46ac317a292d94f73e1583929423d8a3c5f14530
Author: Jacques Lucke
Date:   Wed Nov 14 16:43:09 2018 +0100
Branches: blender2.8
https://developer.blender.org/rB46ac317a292d94f73e1583929423d8a3c5f14530

Py API Docs: documentation for gpu_extras.presets

===

M   release/scripts/modules/gpu_extras/presets.py

===

diff --git a/release/scripts/modules/gpu_extras/presets.py 
b/release/scripts/modules/gpu_extras/presets.py
index 2bd8d25e46b..015608b3586 100644
--- a/release/scripts/modules/gpu_extras/presets.py
+++ b/release/scripts/modules/gpu_extras/presets.py
@@ -17,6 +17,19 @@
 # * END GPL LICENSE BLOCK *
 
 def draw_circle_2d(position, color, radius, segments=32):
+"""
+Draw a circle.
+
+:arg position: Position where the circle will be drawn.
+:type position: 2D Vector
+:arg color: Color of the circle. To use transparency GL_BLEND has to be 
enabled.
+:type color: tuple containing RGBA values
+:arg radius: Radius of the circle.
+:type radius: float
+:arg segments: How many segments will be used to draw the circle.
+Higher values give besser results but the drawing will take longer.
+:type segments: int
+"""
 from math import sin, cos, pi
 import gpu
 from gpu.types import (
@@ -45,6 +58,19 @@ def draw_circle_2d(position, color, radius, segments=32):
 
 
 def draw_texture_2d(texture_id, position, width, height):
+"""
+Draw a 2d texture.
+
+:arg texture_id: OpenGL id of the texture (e.g. 
:class:`bpy.types.Image.bindcode`).
+:type texture_id: int
+:arg position: Position of the lower left corner.
+:type position: 2D Vector
+:arg width: Width of the image when drawn (not necessarily
+the original width of the texture).
+:type width: float
+:arg height: Height of the image when drawn.
+:type height: float
+"""
 import gpu
 import bgl
 from . batch import batch_for_shader

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [d2dd278c5e2] blender2.8: Fix typo in comment.

2018-11-14 Thread Bastien Montagne
Commit: d2dd278c5e2f4d41bc94df7fca959cca6d2526d0
Author: Bastien Montagne
Date:   Wed Nov 14 16:46:33 2018 +0100
Branches: blender2.8
https://developer.blender.org/rBd2dd278c5e2f4d41bc94df7fca959cca6d2526d0

Fix typo in comment.

===

M   source/blender/makesrna/intern/rna_collection.c

===

diff --git a/source/blender/makesrna/intern/rna_collection.c 
b/source/blender/makesrna/intern/rna_collection.c
index 2279dc6880d..03e00708738 100644
--- a/source/blender/makesrna/intern/rna_collection.c
+++ b/source/blender/makesrna/intern/rna_collection.c
@@ -162,7 +162,7 @@ static PointerRNA 
rna_Collection_children_get(CollectionPropertyIterator *iter)
 {
ListBaseIterator *internal = >internal.listbase;
 
-   /* we are actually iterating a CollectionBase list, so override get */
+   /* we are actually iterating a CollectionChild list, so override get */
CollectionChild *child = (CollectionChild *)internal->link;
return rna_pointer_inherit_refine(>parent, _Collection, 
child->collection);
 }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [b7855862327] blender2.8: Fix T57558: Outliner displaying same object twice in some cases.

2018-11-14 Thread Bastien Montagne
Commit: b7855862327043b858c5787864ada6f2a2c86ea4
Author: Bastien Montagne
Date:   Wed Nov 14 16:40:37 2018 +0100
Branches: blender2.8
https://developer.blender.org/rBb7855862327043b858c5787864ada6f2a2c86ea4

Fix T57558: Outliner displaying same object twice in some cases.

Logical flaw in `BKE_scene_objects_iterator_begin()` code (two errors
actually, wrong handling of first object of Master collection, and
missing call to `object_base_unique()` to 'register' that first object
and avoid getting it returned a second time).

Simply fixed by always calling `BKE_scene_objects_iterator_next()`
after minimal proper init, that one knows how to do the things. ;)

===

M   source/blender/blenkernel/intern/collection.c

===

diff --git a/source/blender/blenkernel/intern/collection.c 
b/source/blender/blenkernel/intern/collection.c
index 47fb3622c66..7b7898392d4 100644
--- a/source/blender/blenkernel/intern/collection.c
+++ b/source/blender/blenkernel/intern/collection.c
@@ -1137,16 +1137,13 @@ void BKE_scene_objects_iterator_begin(BLI_Iterator 
*iter, void *data_in)
BKE_scene_collections_iterator_begin(>scene_collection_iter, 
scene);
 
Collection *collection = data->scene_collection_iter.current;
-   if (collection->gobject.first != NULL) {
-   iter->current = ((CollectionObject 
*)collection->gobject.first)->ob;
-   }
-   else {
-   BKE_scene_objects_iterator_next(iter);
-   }
+   data->cob_next = collection->gobject.first;
+
+   BKE_scene_objects_iterator_next(iter);
 }
 
 /**
- * Gets the first unique object in the sequence
+ * Ensures we only get each object once, even when included in several 
collections.
  */
 static CollectionObject *object_base_unique(GSet *gs, CollectionObject *cob)
 {

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [b44e6f2b3d3] blender2.8: Fix T57760: Depsgraph 'object_instances' showing incorrect list of objects.

2018-11-14 Thread Bastien Montagne
Commit: b44e6f2b3d32e604c3030eaf61b15e0e2a20d520
Author: Bastien Montagne
Date:   Wed Nov 14 17:04:10 2018 +0100
Branches: blender2.8
https://developer.blender.org/rBb44e6f2b3d32e604c3030eaf61b15e0e2a20d520

Fix T57760: Depsgraph 'object_instances' showing incorrect list of objects.

It appears that Python gets next item before using current one, which
would break our Depsgraph instance iterator (since only current item is
valid there, we use the same memory at each iteration).

Working around that with an ugly ping-pong game between two sets of
iterator data, so that previous one (C RNA-iterator-wise) remains valid
memory for Python to access to.

===

M   source/blender/makesrna/intern/rna_depsgraph.c

===

diff --git a/source/blender/makesrna/intern/rna_depsgraph.c 
b/source/blender/makesrna/intern/rna_depsgraph.c
index 7bfd3f679d8..4c455915361 100644
--- a/source/blender/makesrna/intern/rna_depsgraph.c
+++ b/source/blender/makesrna/intern/rna_depsgraph.c
@@ -280,38 +280,59 @@ static PointerRNA 
rna_Depsgraph_objects_get(CollectionPropertyIterator *iter)
  * Contains extra information about duplicator and persistent ID.
  */
 
+/* XXX Ugly python seems to query next item of an iterator before using 
current one (see T57558).
+ * This forces us to use that nasty ping-pong game between two sets of 
iterator data, so that previous one remains
+ * valid memory for python to access to. Yuck.
+ */
+typedef struct RNA_Depsgraph_Instances_Iterator
+{
+   BLI_Iterator iterators[2];
+   DEGObjectIterData deg_data[2];
+   int counter;
+} RNA_Depsgraph_Instances_Iterator;
+
 static void rna_Depsgraph_object_instances_begin(CollectionPropertyIterator 
*iter, PointerRNA *ptr)
 {
-   iter->internal.custom = MEM_callocN(sizeof(BLI_Iterator), __func__);
-   DEGObjectIterData *data = MEM_callocN(sizeof(DEGObjectIterData), 
__func__);
+   RNA_Depsgraph_Instances_Iterator *di_it = iter->internal.custom = 
MEM_callocN(sizeof(*di_it), __func__);
 
+   DEGObjectIterData *data = _it->deg_data[0];
data->graph = (Depsgraph *)ptr->data;
data->flag = DEG_ITER_OBJECT_FLAG_LINKED_DIRECTLY |
 DEG_ITER_OBJECT_FLAG_LINKED_VIA_SET |
 DEG_ITER_OBJECT_FLAG_VISIBLE |
 DEG_ITER_OBJECT_FLAG_DUPLI;
 
-   ((BLI_Iterator *)iter->internal.custom)->valid = true;
-   DEG_iterator_objects_begin(iter->internal.custom, data);
-   iter->valid = ((BLI_Iterator *)iter->internal.custom)->valid;
+   di_it->iterators[0].valid = true;
+   DEG_iterator_objects_begin(_it->iterators[0], data);
+   iter->valid = di_it->iterators[0].valid;
 }
 
 static void rna_Depsgraph_object_instances_next(CollectionPropertyIterator 
*iter)
 {
-   DEG_iterator_objects_next(iter->internal.custom);
-   iter->valid = ((BLI_Iterator *)iter->internal.custom)->valid;
+   RNA_Depsgraph_Instances_Iterator *di_it = 
(RNA_Depsgraph_Instances_Iterator *)iter->internal.custom;
+
+   /* We need to copy current iterator status to next one beeing worked 
on. */
+   di_it->iterators[(di_it->counter + 1) % 2] = 
di_it->iterators[di_it->counter % 2];
+   di_it->deg_data[(di_it->counter + 1) % 2] = 
di_it->deg_data[di_it->counter % 2];
+   di_it->counter++;
+
+   di_it->iterators[di_it->counter % 2].data = 
_it->deg_data[di_it->counter % 2];
+   DEG_iterator_objects_next(_it->iterators[di_it->counter % 2]);
+   iter->valid = di_it->iterators[di_it->counter % 2].valid;
 }
 
 static void rna_Depsgraph_object_instances_end(CollectionPropertyIterator 
*iter)
 {
-   DEG_iterator_objects_end(iter->internal.custom);
-   MEM_freeN(((BLI_Iterator *)iter->internal.custom)->data);
-   MEM_freeN(iter->internal.custom);
+   RNA_Depsgraph_Instances_Iterator *di_it = 
(RNA_Depsgraph_Instances_Iterator *)iter->internal.custom;
+   DEG_iterator_objects_end(_it->iterators[0]);
+   DEG_iterator_objects_end(_it->iterators[1]);
+   MEM_freeN(di_it);
 }
 
 static PointerRNA 
rna_Depsgraph_object_instances_get(CollectionPropertyIterator *iter)
 {
-   BLI_Iterator *iterator = (BLI_Iterator *)iter->internal.custom;
+   RNA_Depsgraph_Instances_Iterator *di_it = 
(RNA_Depsgraph_Instances_Iterator *)iter->internal.custom;
+   BLI_Iterator *iterator = _it->iterators[di_it->counter % 2];
return rna_pointer_inherit_refine(>parent, 
_DepsgraphObjectInstance, iterator);
 }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [10bab568d33] blender2.8: Fix assertion failure evaluating depsgraph on an empty armature.

2018-11-14 Thread Alexander Gavrilov
Commit: 10bab568d3392dcd9feb11597d308c9ddc208c7a
Author: Alexander Gavrilov
Date:   Wed Nov 14 18:54:56 2018 +0300
Branches: blender2.8
https://developer.blender.org/rB10bab568d3392dcd9feb11597d308c9ddc208c7a

Fix assertion failure evaluating depsgraph on an empty armature.

If there are no bones, chan_array may not be allocated.

===

M   source/blender/blenkernel/intern/armature_update.c

===

diff --git a/source/blender/blenkernel/intern/armature_update.c 
b/source/blender/blenkernel/intern/armature_update.c
index ce87050f8bf..c9e072caa6e 100644
--- a/source/blender/blenkernel/intern/armature_update.c
+++ b/source/blender/blenkernel/intern/armature_update.c
@@ -760,9 +760,8 @@ void BKE_pose_eval_cleanup(struct Depsgraph *depsgraph,
/* release the IK tree */
BIK_release_tree(scene, ob, ctime);
 
-   BLI_assert(pose->chan_array != NULL);
-   MEM_freeN(pose->chan_array);
-   pose->chan_array = NULL;
+   BLI_assert(pose->chan_array != NULL || 
BLI_listbase_is_empty(>chanbase));
+   MEM_SAFE_FREE(pose->chan_array);
 }
 
 void BKE_pose_eval_proxy_init(struct Depsgraph *depsgraph, Object *object)

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [8073d672abe] collada2.8: fix: collada: exporting object parent/child hierarchies only exported the root object

2018-11-14 Thread Gaia Clary
Commit: 8073d672abe9562ac0c23e43fd292bc6e1dac548
Author: Gaia Clary
Date:   Wed Nov 14 17:20:32 2018 +0100
Branches: collada2.8
https://developer.blender.org/rB8073d672abe9562ac0c23e43fd292bc6e1dac548

fix: collada: exporting object parent/child hierarchies only exported the root 
object

===

M   source/blender/collada/SceneExporter.cpp

===

diff --git a/source/blender/collada/SceneExporter.cpp 
b/source/blender/collada/SceneExporter.cpp
index f90d08aad59..e3d97b37ca6 100644
--- a/source/blender/collada/SceneExporter.cpp
+++ b/source/blender/collada/SceneExporter.cpp
@@ -162,7 +162,6 @@ void SceneExporter::writeNodes(bContext *C, Depsgraph 
*depsgraph, ViewLayer *vie
// 
else if (ob->type == OB_ARMATURE) {
arm_exporter->add_armature_bones(ob, view_layer, this, 
child_objects);
-   writeNodeList(C, depsgraph, view_layer, child_objects, 
ob);
}
 
// 
@@ -232,11 +231,8 @@ void SceneExporter::writeNodes(bContext *C, Depsgraph 
*depsgraph, ViewLayer *vie
con = con->next;
}
}
-   writeNodeList(C, depsgraph, view_layer, child_objects, 
ob);
-   }
-   else {
-   writeNodeList(C, depsgraph, view_layer, child_objects, 
ob);
}
+   writeNodeList(C, depsgraph, view_layer, child_objects, ob);
colladaNode.end();
}
 }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [a4fccde67a9] blender2.8: Fix some templates for 2.8.

2018-11-14 Thread Bastien Montagne
Commit: a4fccde67a9b4ab23765acba8932e66a46487511
Author: Bastien Montagne
Date:   Wed Nov 14 18:19:41 2018 +0100
Branches: blender2.8
https://developer.blender.org/rBa4fccde67a9b4ab23765acba8932e66a46487511

Fix some templates for 2.8.

===

M   release/scripts/templates_py/addon_add_object.py
M   release/scripts/templates_py/background_job.py
M   release/scripts/templates_py/custom_nodes.py

===

diff --git a/release/scripts/templates_py/addon_add_object.py 
b/release/scripts/templates_py/addon_add_object.py
index d7ee145175f..6e51149e451 100644
--- a/release/scripts/templates_py/addon_add_object.py
+++ b/release/scripts/templates_py/addon_add_object.py
@@ -2,7 +2,7 @@ bl_info = {
 "name": "New Object",
 "author": "Your Name Here",
 "version": (1, 0),
-"blender": (2, 75, 0),
+"blender": (2, 80, 0),
 "location": "View3D > Add > Mesh > New Object",
 "description": "Adds a new Mesh Object",
 "warning": "",
diff --git a/release/scripts/templates_py/background_job.py 
b/release/scripts/templates_py/background_job.py
index c64c1de91d1..c28c7275fce 100644
--- a/release/scripts/templates_py/background_job.py
+++ b/release/scripts/templates_py/background_job.py
@@ -17,11 +17,11 @@
 #
 # See blender --help for details.
 
+
 import bpy
 
 
 def example_function(text, save_path, render_path):
-
 # Clear existing objects.
 bpy.ops.wm.read_factory_settings(use_empty=True)
 
@@ -31,23 +31,25 @@ def example_function(text, save_path, render_path):
 
 # Text Object
 txt_ob = bpy.data.objects.new(name="MyText", object_data=txt_data)
-scene.objects.link(txt_ob)   # add the data to the scene as an object
+scene.collection.objects.link(txt_ob)   # add the data to the scene as an 
object
 txt_data.body = text # the body text to the command line arg given
 txt_data.align_x = 'CENTER'  # center text
 
 # Camera
 cam_data = bpy.data.cameras.new("MyCam")
 cam_ob = bpy.data.objects.new(name="MyCam", object_data=cam_data)
-scene.objects.link(cam_ob)  # instance the camera object in the scene
+scene.collection.objects.link(cam_ob)  # instance the camera object in the 
scene
 scene.camera = cam_ob   # set the active camera
 cam_ob.location = 0.0, 0.0, 10.0
 
 # Light
 light_data = bpy.data.lights.new("MyLight", 'POINT')
 light_ob = bpy.data.objects.new(name="MyCam", object_data=light_data)
-scene.objects.link(light_ob)
+scene.collection.objects.link(light_ob)
 light_ob.location = 2.0, 2.0, 5.0
 
+scene.update()
+
 if save_path:
 bpy.ops.wm.save_as_mainfile(filepath=save_path)
 
diff --git a/release/scripts/templates_py/custom_nodes.py 
b/release/scripts/templates_py/custom_nodes.py
index a2701360c9b..02dcaccbde4 100644
--- a/release/scripts/templates_py/custom_nodes.py
+++ b/release/scripts/templates_py/custom_nodes.py
@@ -43,7 +43,7 @@ class MyCustomSocket(NodeSocket):
 # Optional function for drawing the socket input value
 def draw(self, context, layout, node, text):
 if self.is_output or self.is_linked:
-layout.label(text)
+layout.label(text=text)
 else:
 layout.prop(self, "my_enum_prop", text=text)

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [844c7440fcb] blender2.8: Fix (unreported) `bpy.ops.wm.read_factory_settings(use_empty=True)` crash.

2018-11-14 Thread Bastien Montagne
Commit: 844c7440fcbf2aa30d73418f43e6cb42cf27a6ee
Author: Bastien Montagne
Date:   Wed Nov 14 18:04:01 2018 +0100
Branches: blender2.8
https://developer.blender.org/rB844c7440fcbf2aa30d73418f43e6cb42cf27a6ee

Fix (unreported) `bpy.ops.wm.read_factory_settings(use_empty=True)` crash.

`BKE_blendfile_read_make_empty()` was not preserving workspaces...

===

M   source/blender/blenkernel/intern/blendfile.c

===

diff --git a/source/blender/blenkernel/intern/blendfile.c 
b/source/blender/blenkernel/intern/blendfile.c
index 5f716d191e4..5a975402c90 100644
--- a/source/blender/blenkernel/intern/blendfile.c
+++ b/source/blender/blenkernel/intern/blendfile.c
@@ -468,7 +468,7 @@ void BKE_blendfile_read_make_empty(bContext *C)
while (a--) {
id = lbarray[a]->first;
if (id != NULL) {
-   if (ELEM(GS(id->name), ID_SCE, ID_SCR, ID_WM)) {
+   if (ELEM(GS(id->name), ID_SCE, ID_SCR, ID_WM, ID_WS)) {
continue;
}
while ((id = lbarray[a]->first)) {

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [e20557046b9] blender2.8: Depsgraph: suppress logs from add_relation on invalid driver variables.

2018-11-14 Thread Alexander Gavrilov
Commit: e20557046b9d949385466d6e24a3fb3f580c4761
Author: Alexander Gavrilov
Date:   Wed Nov 14 20:16:55 2018 +0300
Branches: blender2.8
https://developer.blender.org/rBe20557046b9d949385466d6e24a3fb3f580c4761

Depsgraph: suppress logs from add_relation on invalid driver variables.

Rig generators (e.g. rigify) use dummy drivers to attach extra
ID references to rigs for Append/Link. These references use
Single Property variables with empty path, which is intentionally
invalid and shouldn't produce low-level error logs from depsgraph.

The removed code would always print an error because RNAPathKey
requires a valid path to produce a non-NULL reference.

===

M   source/blender/depsgraph/intern/builder/deg_builder_relations.cc

===

diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc 
b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
index e66c3a25e33..8080376488b 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
@@ -1529,17 +1529,8 @@ void DepsgraphRelationBuilder::build_driver_variables(ID 
*id, FCurve *fcu)
}
}
else {
-   if (dtar->id == id) {
-   /* Ignore input dependency if we're 
driving properties of
-* the same ID, otherwise we'll be 
ending up in a cyclic
-* dependency here.
-*/
-   continue;
-   }
-   /* Resolve path to get node. */
-   RNAPathKey target_key(dtar->id,
- dtar->rna_path ? 
dtar->rna_path : "");
-   add_relation(target_key, driver_key, "RNA 
Target -> Driver");
+   /* If rna_path is NULL, and 
DTAR_FLAG_STRUCT_REF isn't set, this
+* is an incomplete target reference, so 
nothing to do here. */
}
}
DRIVER_TARGETS_LOOPER_END

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [7d908f87b44] collada2.8: Merge remote-tracking branch 'origin/blender2.8' into collada2.8

2018-11-14 Thread Gaia Clary
Commit: 7d908f87b44f1e341831f9d6bddd661ed73394b1
Author: Gaia Clary
Date:   Wed Nov 14 17:21:17 2018 +0100
Branches: collada2.8
https://developer.blender.org/rB7d908f87b44f1e341831f9d6bddd661ed73394b1

Merge remote-tracking branch 'origin/blender2.8' into collada2.8

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [6f08124fbd1] blender2.8: Fix assert in bevel modifier with certain geometry.

2018-11-14 Thread Brecht Van Lommel
Commit: 6f08124fbd1265dc42edfcb0f7bafe21c08d1827
Author: Brecht Van Lommel
Date:   Wed Nov 14 18:15:48 2018 +0100
Branches: blender2.8
https://developer.blender.org/rB6f08124fbd1265dc42edfcb0f7bafe21c08d1827

Fix assert in bevel modifier with certain geometry.

This happened in in the barbershop_interior.blend benchmark file, seems
duplicate hash entries are ok for this algorithm.

===

M   source/blender/bmesh/tools/bmesh_bevel.c

===

diff --git a/source/blender/bmesh/tools/bmesh_bevel.c 
b/source/blender/bmesh/tools/bmesh_bevel.c
index 905131e3318..ad576e61acb 100644
--- a/source/blender/bmesh/tools/bmesh_bevel.c
+++ b/source/blender/bmesh/tools/bmesh_bevel.c
@@ -5686,6 +5686,7 @@ void BM_mesh_bevel(
else {
clnordata = mod_bmop_customdata;
clnordata->faceHash = BLI_ghash_ptr_new(__func__);
+   BLI_ghash_flag_set(clnordata->faceHash, 
GHASH_FLAG_ALLOW_DUPES);
bp.faceHash = clnordata->faceHash;
}

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [78207eac9b9] blender2.8: Py API Docs: New custom shader example

2018-11-14 Thread Jacques Lucke
Commit: 78207eac9b9b576ae66731ea257103f84b0ea41b
Author: Jacques Lucke
Date:   Wed Nov 14 18:41:28 2018 +0100
Branches: blender2.8
https://developer.blender.org/rB78207eac9b9b576ae66731ea257103f84b0ea41b

Py API Docs: New custom shader example

===

A   doc/python_api/examples/gpu.11.py

===

diff --git a/doc/python_api/examples/gpu.11.py 
b/doc/python_api/examples/gpu.11.py
new file mode 100644
index 000..61e7a842a59
--- /dev/null
+++ b/doc/python_api/examples/gpu.11.py
@@ -0,0 +1,61 @@
+"""
+Custom Shader for dotted 3D Line
+
+
+In this example the arc length (distance to the first point on the line) is 
calculated in every vertex.
+Between the vertex and fragment shader that value is automatically 
interpolated for all points that will be visible on the screen.
+In the fragment shader the `sin` of the arc length is calculated.
+Based on the result a decision is made on whether the fragment should be drawn 
or not.
+"""
+import bpy
+import gpu
+from random import random
+from mathutils import Vector
+from gpu_extras.batch import batch_for_shader
+
+vertex_shader = '''
+uniform mat4 u_ViewProjectionMatrix;
+
+in vec3 position;
+in float arcLength;
+
+out float v_ArcLength;
+
+void main()
+{
+v_ArcLength = arcLength;
+gl_Position = u_ViewProjectionMatrix * vec4(position, 1.0f);
+}
+'''
+
+fragment_shader = '''
+uniform float u_Scale;
+
+in float v_ArcLength;
+
+void main()
+{
+if (step(sin(v_ArcLength * u_Scale), 0.5) == 1) discard;
+gl_FragColor = vec4(1.0);
+}
+'''
+
+coords = [Vector((random(), random(), random())) * 5 for _ in range(5)]
+
+arc_lengths = [0]
+for a, b in zip(coords[:-1], coords[1:]):
+arc_lengths.append(arc_lengths[-1] + (a - b).length)
+
+shader = gpu.types.GPUShader(vertex_shader, fragment_shader)
+batch = batch_for_shader(shader, 'LINE_STRIP',
+{"position" : coords,
+ "arcLength" : arc_lengths})
+
+def draw():
+shader.bind()
+matrix = bpy.context.region_data.perspective_matrix
+shader.uniform_float("u_ViewProjectionMatrix", matrix)
+shader.uniform_float("u_Scale", 10)
+batch.draw(shader)
+
+bpy.types.SpaceView3D.draw_handler_add(draw, (), 'WINDOW', 'POST_VIEW')
\ No newline at end of file

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [445b60270fb] collada2.8: fix: collada: preserve original object and bone names in export

2018-11-14 Thread Gaia Clary
Commit: 445b60270fbd85eba978765520274988896e5e32
Author: Gaia Clary
Date:   Wed Nov 14 20:18:29 2018 +0100
Branches: collada2.8
https://developer.blender.org/rB445b60270fbd85eba978765520274988896e5e32

fix: collada: preserve original object and bone names in export

===

M   source/blender/collada/AnimationExporter.cpp
M   source/blender/collada/GeometryExporter.cpp
M   source/blender/collada/SceneExporter.cpp

===

diff --git a/source/blender/collada/AnimationExporter.cpp 
b/source/blender/collada/AnimationExporter.cpp
index 217fb08f014..7d11dd7668e 100644
--- a/source/blender/collada/AnimationExporter.cpp
+++ b/source/blender/collada/AnimationExporter.cpp
@@ -61,7 +61,7 @@ bool AnimationExporter::open_animation_container(bool 
has_container, Object *ob)
if (!has_container) {
char anim_id[200];
sprintf(anim_id, "action_container-%s", 
translate_id(id_name(ob)).c_str());
-   openAnimation(anim_id, id_name(ob));
+   openAnimation(anim_id, encode_xml(id_name(ob)));
}
return true;
 }
@@ -229,7 +229,7 @@ void AnimationExporter::export_matrix_animation(Object *ob, 
BCAnimationSampler &
bool is_animated = sampler.get_object_samples(samples, ob);
if (is_animated) {
bAction *action = bc_getSceneObjectAction(ob);
-   std::string name = id_name(ob);
+   std::string name = encode_xml(id_name(ob));
std::string action_name = (action == NULL) ? name + 
"-action" : id_name(action);
std::string channel_type = "transform";
std::string axis = "";
@@ -329,7 +329,7 @@ void AnimationExporter::export_curve_animation(
bAction *action = bc_getSceneObjectAction(ob);
action_name = (action) ? id_name(action) : "constraint_anim";
 
-   const std::string curve_name = curve.get_animation_name(ob);
+   const std::string curve_name = encode_xml(curve.get_animation_name(ob));
std::string id = bc_get_action_id(action_name, curve_name, 
channel_target, axis, ".");
 
std::string collada_target = translate_id(curve_name);
@@ -353,7 +353,7 @@ void AnimationExporter::export_bone_animation(Object *ob, 
Bone *bone, BCFrames &
 {
bAction* action = bc_getSceneObjectAction(ob);
std::string bone_name(bone->name);
-   std::string name = id_name(ob);
+   std::string name = encode_xml(id_name(ob));
std::string id = bc_get_action_id(id_name(action), name, bone_name, 
"pose_matrix");
std::string target = translate_id(id_name(ob) + "_" + bone_name) + 
"/transform";
 
diff --git a/source/blender/collada/GeometryExporter.cpp 
b/source/blender/collada/GeometryExporter.cpp
index 928509cbef9..5030b8f5b26 100644
--- a/source/blender/collada/GeometryExporter.cpp
+++ b/source/blender/collada/GeometryExporter.cpp
@@ -91,6 +91,7 @@ void GeometryExporter::operator()(Object *ob)
}
 
std::string geom_name = (use_instantiation) ? id_name(ob->data) : 
id_name(ob);
+   geom_name = encode_xml(geom_name);
 
exportedGeometry.insert(geom_id);
 
diff --git a/source/blender/collada/SceneExporter.cpp 
b/source/blender/collada/SceneExporter.cpp
index e3d97b37ca6..2981b1c8b30 100644
--- a/source/blender/collada/SceneExporter.cpp
+++ b/source/blender/collada/SceneExporter.cpp
@@ -44,8 +44,8 @@ void SceneExporter::exportScene(bContext *C, Depsgraph 
*depsgraph)
 {
ViewLayer *view_layer = DEG_get_evaluated_view_layer(depsgraph);
//  
-   std::string id_naming = id_name(view_layer);
-   openVisualScene(translate_id(id_naming), id_naming);
+   std::string name = id_name(view_layer);
+   openVisualScene(translate_id(name), encode_xml(name));
exportHierarchy(C, depsgraph, view_layer);
closeVisualScene();
closeLibrary();
@@ -129,7 +129,7 @@ void SceneExporter::writeNodes(bContext *C, Depsgraph 
*depsgraph, ViewLayer *vie
if (can_export) {
COLLADASW::Node colladaNode(mSW);
colladaNode.setNodeId(translate_id(id_name(ob)));
-   colladaNode.setNodeName(translate_id(id_name(ob)));
+   colladaNode.setNodeName(encode_xml(id_name(ob)));
colladaNode.setType(COLLADASW::Node::NODE);
 
colladaNode.start();
@@ -151,7 +151,7 @@ void SceneExporter::writeNodes(bContext *C, Depsgraph 
*depsgraph, ViewLayer *vie
if (!instance_controller_created) {
COLLADASW::InstanceGeometry instGeom(mSW);

instGeom.setUrl(COLLADASW::URI(COLLADABU::Utils::EMPTY_STRING, 
get_geometry_id(ob, this->export_settings->use_object_instantiation)));
-   

[Bf-blender-cvs] [5fa08d1ff02] collada2.8: refactor: collada: move generation of effect id names into own function

2018-11-14 Thread Gaia Clary
Commit: 5fa08d1ff0282dc778c844e351179776044015d6
Author: Gaia Clary
Date:   Wed Nov 14 19:46:19 2018 +0100
Branches: collada2.8
https://developer.blender.org/rB5fa08d1ff0282dc778c844e351179776044015d6

refactor: collada: move generation of effect id names into own function

===

M   source/blender/collada/EffectExporter.cpp

===

diff --git a/source/blender/collada/EffectExporter.cpp 
b/source/blender/collada/EffectExporter.cpp
index be77bfadadc..5c702304e27 100644
--- a/source/blender/collada/EffectExporter.cpp
+++ b/source/blender/collada/EffectExporter.cpp
@@ -178,7 +178,7 @@ void EffectsExporter::operator()(Material *ma, Object *ob)
 {
KeyImageMap material_image_map;
 
-   openEffect(translate_id(id_name(ma)) + "-effect");
+   openEffect(get_effect_id(ma));
 
COLLADASW::EffectProfile ep(mSW);
ep.setProfileType(COLLADASW::EffectProfile::COMMON);

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [14d4c5477df] collada2.8: fix: collada: preserve original material names in export

2018-11-14 Thread Gaia Clary
Commit: 14d4c5477dff6c0e6eeba13e0b9f3ce37dccfecf
Author: Gaia Clary
Date:   Wed Nov 14 19:47:09 2018 +0100
Branches: collada2.8
https://developer.blender.org/rB14d4c5477dff6c0e6eeba13e0b9f3ce37dccfecf

fix: collada: preserve original material names in export

===

M   source/blender/collada/MaterialExporter.cpp

===

diff --git a/source/blender/collada/MaterialExporter.cpp 
b/source/blender/collada/MaterialExporter.cpp
index 4aece997f72..2fa71817ac8 100644
--- a/source/blender/collada/MaterialExporter.cpp
+++ b/source/blender/collada/MaterialExporter.cpp
@@ -68,12 +68,12 @@ bool MaterialsExporter::hasMaterials(Scene *sce)
 
 void MaterialsExporter::operator()(Material *ma, Object *ob)
 {
-   std::string name(id_name(ma));
+   std::string mat_name = encode_xml(id_name(ma));
+   std::string mat_id = get_material_id(ma);
+   std::string eff_id = get_effect_id(ma);
 
-   openMaterial(get_material_id(ma), translate_id(name));
-
-   std::string efid = translate_id(name) + "-effect";
-   addInstanceEffect(COLLADASW::URI(COLLADABU::Utils::EMPTY_STRING, efid));
+   openMaterial(mat_id, mat_name);
+   addInstanceEffect(COLLADASW::URI(COLLADABU::Utils::EMPTY_STRING, 
eff_id));
 
closeMaterial();
 }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [0833084fd6c] collada2.8: Merge remote-tracking branch 'origin/blender2.8' into collada2.8

2018-11-14 Thread Gaia Clary
Commit: 0833084fd6c907b98e857fcb3b7844694fbe3f8e
Author: Gaia Clary
Date:   Wed Nov 14 19:47:47 2018 +0100
Branches: collada2.8
https://developer.blender.org/rB0833084fd6c907b98e857fcb3b7844694fbe3f8e

Merge remote-tracking branch 'origin/blender2.8' into collada2.8

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [cf43f4ed2f6] collada2.8: new: collada: support proper setup of collada attribute names (wip)

2018-11-14 Thread Gaia Clary
Commit: cf43f4ed2f6776d759c74665a88dbdd744054667
Author: Gaia Clary
Date:   Wed Nov 14 19:43:29 2018 +0100
Branches: collada2.8
https://developer.blender.org/rBcf43f4ed2f6776d759c74665a88dbdd744054667

new: collada: support proper setup of collada attribute names (wip)

===

M   source/blender/collada/collada_internal.cpp
M   source/blender/collada/collada_internal.h

===

diff --git a/source/blender/collada/collada_internal.cpp 
b/source/blender/collada/collada_internal.cpp
index 273af508b6d..64de0596ac5 100644
--- a/source/blender/collada/collada_internal.cpp
+++ b/source/blender/collada/collada_internal.cpp
@@ -311,6 +311,33 @@ std::string id_name(void *id)
return ((ID *)id)->name + 2;
 }
 
+std::string encode_xml(std::string xml)
+{
+   const std::map escape {
+   {'<' , ""  },
+   {'>' , ""  },
+   {'"' , ""},
+   {'\'', ""},
+   {'&' , "" }
+   };
+
+   std::map::const_iterator it;
+   std::string encoded_xml = "";
+
+   for (unsigned int i = 0; i < xml.size(); i++) {
+   char c = xml.at(i);
+   it = escape.find(c);
+
+   if (it == escape.end()) {
+   encoded_xml += c;
+   }
+   else {
+   encoded_xml += it->second;
+   }
+   }
+   return encoded_xml;
+}
+
 std::string get_geometry_id(Object *ob)
 {
return translate_id(id_name(ob->data)) + "-mesh";
@@ -342,6 +369,11 @@ std::string get_camera_id(Object *ob)
return translate_id(id_name(ob)) + "-camera";
 }
 
+std::string get_effect_id(Material *mat)
+{
+   return translate_id(id_name(mat)) + "-effect";
+}
+
 std::string get_material_id(Material *mat)
 {
return translate_id(id_name(mat)) + "-material";
diff --git a/source/blender/collada/collada_internal.h 
b/source/blender/collada/collada_internal.h
index 3237a802073..a84457f75e7 100644
--- a/source/blender/collada/collada_internal.h
+++ b/source/blender/collada/collada_internal.h
@@ -91,6 +91,7 @@ extern std::string translate_id(const std::string );
 extern std::string translate_id(const char *idString);
 
 extern std::string id_name(void *id);
+extern std::string encode_xml(std::string xml);
 
 extern std::string get_geometry_id(Object *ob);
 extern std::string get_geometry_id(Object *ob, bool use_instantiation);
@@ -100,9 +101,9 @@ extern std::string get_light_id(Object *ob);
 extern std::string get_joint_sid(Bone *bone);
 
 extern std::string get_camera_id(Object *ob);
+extern std::string get_morph_id(Object *ob);
 
+extern std::string get_effect_id(Material *mat);
 extern std::string get_material_id(Material *mat);
 
-extern std::string get_morph_id(Object *ob);
-
 #endif /* __COLLADA_INTERNAL_H__ */

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [28e7c94de26] blender2.8: Gizmo: minor fix for navigation axis color

2018-11-14 Thread Campbell Barton
Commit: 28e7c94de26a4706af16d6f2893917ca910a27ce
Author: Campbell Barton
Date:   Thu Nov 15 08:17:16 2018 +1100
Branches: blender2.8
https://developer.blender.org/rB28e7c94de26a4706af16d6f2893917ca910a27ce

Gizmo: minor fix for navigation axis color

When view aligned, the near axis was hidden,
making it seem as if the opposite axis was at the front.

===

M   source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c

===

diff --git a/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c 
b/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c
index c32a8f46182..422f6e07c68 100644
--- a/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c
+++ b/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c
@@ -341,13 +341,18 @@ static void axis_geom_draw(
 
/* Axis Ball. */
{
+   /* Flip the faded state when axis aligned, 
since we're hiding the front-mode axis
+* otherwise we see the color for the back-most 
axis, which is useful for
+* click-to-rotate 180d but not useful to 
visualize. */
+   const bool is_pos_color = is_pos == (axis_align 
!= axis);
+
GPU_matrix_push();
GPU_matrix_translate_3fv(v_final);
GPU_matrix_scale_1f(show_axis_char ? 
AXIS_HANDLE_SIZE_FG : AXIS_HANDLE_SIZE_BG);
 
GPUBatch *sphere = GPU_batch_preset_sphere(0);
GPU_batch_program_set_builtin(sphere, 
GPU_SHADER_3D_UNIFORM_COLOR);
-   GPU_batch_uniform_4fv(sphere, "color", is_pos ? 
color_current : color_current_fade);
+   GPU_batch_uniform_4fv(sphere, "color", 
is_pos_color ? color_current : color_current_fade);
GPU_batch_draw(sphere);
GPU_matrix_pop();
}

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [d04947b4220] blender2.8: Gizmo: skip text drawing w/ select for navigate

2018-11-14 Thread Campbell Barton
Commit: d04947b42209a6af08e399c004a31d235e0c7eb9
Author: Campbell Barton
Date:   Thu Nov 15 07:58:03 2018 +1100
Branches: blender2.8
https://developer.blender.org/rBd04947b42209a6af08e399c004a31d235e0c7eb9

Gizmo: skip text drawing w/ select for navigate

Also use struct for storing extra args.

===

M   source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c

===

diff --git a/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c 
b/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c
index acffb29c82a..c32a8f46182 100644
--- a/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c
+++ b/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c
@@ -60,9 +60,9 @@
 
 #include "view3d_intern.h"
 
+#define USE_AXIS_FONT
 #define USE_FADE_BACKGROUND
 
-#define USE_AXIS_FONT
 #ifdef USE_AXIS_FONT
 #  include "BLF_api.h"
 #endif
@@ -76,6 +76,16 @@
 /* How far axis handles are away from the center. */
 #define AXIS_HANDLE_OFFSET (1.0f - AXIS_HANDLE_SIZE_FG)
 
+struct AxisDrawInfo {
+   /* Matrix is needed for screen-aligned font drawing. */
+#ifdef USE_AXIS_FONT
+   float matrix_final[4][4];
+#endif
+#ifdef USE_FADE_BACKGROUND
+   float color_bg[3];
+#endif
+};
+
 #ifndef USE_AXIS_FONT
 /**
  * \param viewmat_local_unit is typically the 'rv3d->viewmatob'
@@ -182,13 +192,12 @@ static void draw_xyz_wire(
 }
 #endif  /* !USE_AXIS_FONT */
 
+/**
+ * \param draw_info: Extra data needed for drawing.
+ */
 static void axis_geom_draw(
-const wmGizmo *gz, const float color[4], const bool UNUSED(select),
-#ifdef USE_FADE_BACKGROUND
-const float color_bg[3],
-#endif
-/* Matrix is needed for screen-aligned font drawing. */
-const float matrix_final[4][4])
+const wmGizmo *gz, const float color[4], const bool select,
+const struct AxisDrawInfo *draw_info)
 {
GPU_line_width(gz->line_width);
 
@@ -222,7 +231,7 @@ static void axis_geom_draw(
int id;
} font;
 
-   {
+   if (select == false) {
font.id = blf_mono_font;
BLF_disable(font.id, BLF_ROTATION | BLF_SHADOW | BLF_MATRIX | 
BLF_ASPECT | BLF_WORD_WRAP);
BLF_color4fv(font.id, axis_black);
@@ -233,14 +242,12 @@ static void axis_geom_draw(
 * show without any rotation. */
float m3[3][3];
float m3_offset[3][3];
-   copy_m3_m4(m3, matrix_final);
+   copy_m3_m4(m3, draw_info->matrix_final);
copy_m3_m4(m3_offset, gz->matrix_offset);
mul_m3_m3m3(m3, m3, m3_offset);
invert_m3(m3);
copy_m4_m3(font.matrix, m3);
}
-#else
-   UNUSED_VARS(matrix_final);
 #endif
 
GPU_matrix_push();
@@ -297,13 +304,18 @@ static void axis_geom_draw(
const float *color_current = is_highlight ? 
axis_highlight : axis_color[axis];
float color_current_fade[4];
 
+   if (select == false) {
 #ifdef USE_FADE_BACKGROUND
-   interp_v3_v3v3(color_current_fade, color_bg, 
color_current, is_highlight ? 1.0 : 0.5f);
-   color_current_fade[3] = color_current[3];
+   interp_v3_v3v3(color_current_fade, 
draw_info->color_bg, color_current, is_highlight ? 1.0 : 0.5f);
+   color_current_fade[3] = color_current[3];
 #else
-   copy_v4_v4(color_current_fade, color_current);
-   color_current_fade[3] *= 0.2;
+   copy_v4_v4(color_current_fade, color_current);
+   color_current_fade[3] *= 0.2;
 #endif
+   }
+   else {
+   copy_v4_fl(color_current_fade, 1.0f);
+   }
 
/* Axis Line. */
if (is_pos) {
@@ -341,7 +353,7 @@ static void axis_geom_draw(
}
 
/* Axis XYZ Character. */
-   if (show_axis_char) {
+   if (show_axis_char && (select == false)) {
 #ifdef USE_AXIS_FONT
immUnbindProgram();
 
@@ -392,13 +404,17 @@ static void axis3d_draw_intern(
GPU_matrix_push();
GPU_matrix_mul(matrix_final);
 
-#ifdef USE_FADE_BACKGROUND
-   float color_bg[3];
+
+   struct AxisDrawInfo draw_info;
+#ifdef USE_AXIS_FONT
if (select == false) {
-   ED_view3d_background_color_get(CTX_data_scene(C), 
CTX_wm_view3d(C), color_bg);
+   copy_m4_m4(draw_info.matrix_final, matrix_final);
}
-   else {
-   zero_v3(color_bg);
+#endif
+
+#ifdef USE_FADE_BACKGROUND
+   if (select == false) {
+