Merge branch 'master' into blender2.8

Conflicts:
	source/blender/blenloader/intern/versioning_270.c
	source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
	source/blender/depsgraph/intern/builder/deg_builder_relations.cc
	source/blender/editors/space_view3d/drawobject.c
This commit is contained in:
Bastien Montagne
2016-11-19 16:28:39 +01:00
44 changed files with 1376 additions and 919 deletions

View File

@@ -154,8 +154,6 @@ def load_scripts(reload_scripts=False, refresh_scripts=False):
original_modules = _sys.modules.values()
if reload_scripts:
_bpy_types.TypeMap.clear()
# just unload, don't change user defaults, this means we can sync
# to reload. note that they will only actually reload of the
# modification time changes. This `won't` work for packages so...
@@ -163,6 +161,9 @@ def load_scripts(reload_scripts=False, refresh_scripts=False):
for module_name in [ext.module for ext in _user_preferences.addons]:
_addon_utils.disable(module_name)
# *AFTER* unregistering all add-ons, otherwise all calls to unregister_module() will silently fail (do nothing).
_bpy_types.TypeMap.clear()
def register_module_call(mod):
register = getattr(mod, "register", None)
if register:

View File

@@ -189,6 +189,14 @@ def object_data_add(context, obdata, operator=None, use_active_layer=True, name=
scene.update() # apply location
# scene.objects.active = obj_new
# Match up UV layers, this is needed so adding an object with UV's
# doesn't create new layers when there happens to be a naming mis-match.
uv_new = obdata.uv_layers.active
if uv_new is not None:
uv_act = obj_act.data.uv_layers.active
if uv_act is not None:
uv_new.name = uv_act.name
bpy.ops.object.join() # join into the active.
if obdata:
bpy.data.meshes.remove(obdata)

View File

@@ -84,26 +84,27 @@ def add_torus(major_rad, minor_rad, major_seg, minor_seg):
def add_uvs(mesh, minor_seg, major_seg):
mesh.uv_textures.new()
uv_layer = mesh.uv_layers.active
u_step = 1.0/major_seg
v_step = 1.0/minor_seg
uv_data = mesh.uv_layers.active.data
polygons = mesh.polygons
u_step = 1.0 / major_seg
v_step = 1.0 / minor_seg
vertex_index = 0
u = 0.5
for major_index in range(major_seg):
v = 0.5
for minor_index in range(minor_seg):
loops = mesh.polygons[vertex_index].loop_indices
if minor_index == minor_seg-1 and major_index == 0:
uv_layer.data[loops[1]].uv = (u, v)
uv_layer.data[loops[2]].uv = (u + u_step, v)
uv_layer.data[loops[0]].uv = (u, v + v_step)
uv_layer.data[loops[3]].uv = (u + u_step, v + v_step)
loops = polygons[vertex_index].loop_indices
if minor_index == minor_seg - 1 and major_index == 0:
uv_data[loops[1]].uv = (u, v)
uv_data[loops[2]].uv = (u + u_step, v)
uv_data[loops[0]].uv = (u, v + v_step)
uv_data[loops[3]].uv = (u + u_step, v + v_step)
else:
uv_layer.data[loops[0]].uv = (u, v)
uv_layer.data[loops[1]].uv = (u + u_step, v)
uv_layer.data[loops[3]].uv = (u, v + v_step)
uv_layer.data[loops[2]].uv = (u + u_step, v + v_step)
uv_data[loops[0]].uv = (u, v)
uv_data[loops[1]].uv = (u + u_step, v)
uv_data[loops[3]].uv = (u, v + v_step)
uv_data[loops[2]].uv = (u + u_step, v + v_step)
v = (v + v_step) % 1.0
vertex_index += 1
u = (u + u_step) % 1.0

View File

@@ -117,16 +117,14 @@ def brush_texpaint_common(panel, context, layout, brush, settings, projpaint=Fal
col.label("Gradient Colors")
col.template_color_ramp(brush, "gradient", expand=True)
if brush.image_tool != 'FILL':
if brush.image_tool == 'DRAW':
col.label("Background Color")
row = col.row(align=True)
panel.prop_unified_color(row, context, brush, "secondary_color", text="")
if brush.image_tool == 'DRAW':
col.prop(brush, "gradient_stroke_mode", text="Mode")
if brush.gradient_stroke_mode in {'SPACING_REPEAT', 'SPACING_CLAMP'}:
col.prop(brush, "grad_spacing")
elif brush.image_tool == 'FILL':
else: # if brush.image_tool == 'FILL':
col.prop(brush, "gradient_fill_mode")
else:
row = col.row(align=True)
@@ -137,6 +135,9 @@ def brush_texpaint_common(panel, context, layout, brush, settings, projpaint=Fal
panel.prop_unified_color(row, context, brush, "secondary_color", text="")
row.separator()
row.operator("paint.brush_colors_flip", icon='FILE_REFRESH', text="")
else:
if brush.image_tool == 'FILL' and not projpaint:
col.prop(brush, "fill_threshold")
elif brush.image_tool == 'SOFTEN':
col = layout.column(align=True)