[Bf-blender-cvs] [dd4c87cd045] blender2.8: Merge branch 'master' into blender2.8

Campbell Barton noreply at git.blender.org
Fri Dec 14 01:13:40 CET 2018


Commit: dd4c87cd0451376bce96c459d90c2b95409f0d11
Author: Campbell Barton
Date:   Fri Dec 14 11:09:42 2018 +1100
Branches: blender2.8
https://developer.blender.org/rBdd4c87cd0451376bce96c459d90c2b95409f0d11

Merge branch 'master' into blender2.8

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



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

diff --cc source/blender/blenkernel/intern/editmesh_cache.c
index f0af0ede9b1,00000000000..09bf7e9b39b
mode 100644,000000..100644
--- a/source/blender/blenkernel/intern/editmesh_cache.c
+++ b/source/blender/blenkernel/intern/editmesh_cache.c
@@@ -1,120 -1,0 +1,120 @@@
 +/*
 + * ***** BEGIN GPL LICENSE BLOCK *****
 + *
 + * This program is free software; you can redistribute it and/or
 + * modify it under the terms of the GNU General Public License
 + * as published by the Free Software Foundation; either version 2
 + * of the License, or (at your option) any later version.
 + *
 + * This program is distributed in the hope that it will be useful,
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 + * GNU General Public License for more details.
 + *
 + * You should have received a copy of the GNU General Public License
 + * along with this program; if not, write to the Free Software Foundation,
 + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 + *
 + * ***** END GPL LICENSE BLOCK *****
 + */
 +
 +/** \file blender/blenkernel/intern/editmesh_cache.c
 + *  \ingroup bke
 + *
 + * Manage edit mesh cache: #EditMeshData
 + */
 +
 +#include "MEM_guardedalloc.h"
 +
 +#include "DNA_mesh_types.h"
 +
 +#include "BLI_math.h"
 +
 +#include "BKE_editmesh.h"
 +#include "BKE_editmesh_cache.h"  /* own include */
 +
 +void BKE_editmesh_cache_ensure_poly_normals(BMEditMesh *em, EditMeshData *emd)
 +{
 +	if (!(emd->vertexCos && (emd->polyNos == NULL))) {
 +		return;
 +	}
 +
 +	BMesh *bm = em->bm;
 +	const float (*vertexCos)[3];
 +	float (*polyNos)[3];
 +
 +	BMFace *efa;
 +	BMIter fiter;
 +	int i;
 +
 +	BM_mesh_elem_index_ensure(bm, BM_VERT);
 +
 +	polyNos = MEM_mallocN(sizeof(*polyNos) * bm->totface, __func__);
 +
 +	vertexCos = emd->vertexCos;
 +
 +	BM_ITER_MESH_INDEX (efa, &fiter, bm, BM_FACES_OF_MESH, i) {
 +		BM_elem_index_set(efa, i); /* set_inline */
 +		BM_face_calc_normal_vcos(bm, efa, polyNos[i], vertexCos);
 +	}
 +	bm->elem_index_dirty &= ~BM_FACE;
 +
 +	emd->polyNos = (const float (*)[3])polyNos;
 +}
 +
 +void BKE_editmesh_cache_ensure_vert_normals(BMEditMesh *em, EditMeshData *emd)
 +{
 +	if (!(emd->vertexCos && (emd->vertexNos == NULL))) {
 +		return;
 +	}
 +
 +	BMesh *bm = em->bm;
 +	const float (*vertexCos)[3], (*polyNos)[3];
 +	float (*vertexNos)[3];
 +
 +	/* calculate vertex normals from poly normals */
 +	BKE_editmesh_cache_ensure_poly_normals(em, emd);
 +
 +	BM_mesh_elem_index_ensure(bm, BM_FACE);
 +
 +	polyNos = emd->polyNos;
 +	vertexCos = emd->vertexCos;
 +	vertexNos = MEM_callocN(sizeof(*vertexNos) * bm->totvert, __func__);
 +
 +	BM_verts_calc_normal_vcos(bm, polyNos, vertexCos, vertexNos);
 +
 +	emd->vertexNos = (const float (*)[3])vertexNos;
 +}
 +
 +void BKE_editmesh_cache_ensure_poly_centers(BMEditMesh *em, EditMeshData *emd)
 +{
 +	if (emd->polyCos != NULL) {
 +		return;
 +	}
 +	BMesh *bm = em->bm;
 +	float (*polyCos)[3];
 +
 +	BMFace *efa;
 +	BMIter fiter;
 +	int i;
 +
 +	polyCos = MEM_mallocN(sizeof(*polyCos) * bm->totface, __func__);
 +
 +	if (emd->vertexCos) {
 +		const float (*vertexCos)[3];
 +		vertexCos = emd->vertexCos;
 +
 +		BM_mesh_elem_index_ensure(bm, BM_VERT);
 +
 +		BM_ITER_MESH_INDEX (efa, &fiter, bm, BM_FACES_OF_MESH, i) {
- 			BM_face_calc_center_mean_vcos(bm, efa, polyCos[i], vertexCos);
++			BM_face_calc_center_median_vcos(bm, efa, polyCos[i], vertexCos);
 +		}
 +	}
 +	else {
 +		BM_ITER_MESH_INDEX (efa, &fiter, bm, BM_FACES_OF_MESH, i) {
- 			BM_face_calc_center_mean(efa, polyCos[i]);
++			BM_face_calc_center_median(efa, polyCos[i]);
 +		}
 +	}
 +
 +	emd->polyCos = (const float (*)[3])polyCos;
 +}
diff --cc source/blender/blenkernel/intern/scene.c
index 20eab1369d1,d038a267308..e76b1776b25
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@@ -659,13 -651,25 +659,13 @@@ void BKE_scene_init(Scene *sce
  
  	sce->toolsettings->selectmode = SCE_SELECT_VERTEX;
  	sce->toolsettings->uv_selectmode = UV_SELECT_VERTEX;
 -	sce->toolsettings->normalsize = 0.1;
  	sce->toolsettings->autokey_mode = U.autokey_mode;
  
 -	sce->toolsettings->snap_node_mode = SCE_SNAP_MODE_GRID;
  
- 	sce->toolsettings->transform_pivot_point = V3D_AROUND_CENTER_MEAN;
 -	sce->toolsettings->skgen_resolution = 100;
 -	sce->toolsettings->skgen_threshold_internal     = 0.01f;
 -	sce->toolsettings->skgen_threshold_external     = 0.01f;
 -	sce->toolsettings->skgen_angle_limit            = 45.0f;
 -	sce->toolsettings->skgen_length_ratio           = 1.3f;
 -	sce->toolsettings->skgen_length_limit           = 1.5f;
 -	sce->toolsettings->skgen_correlation_limit      = 0.98f;
 -	sce->toolsettings->skgen_symmetry_limit         = 0.1f;
 -	sce->toolsettings->skgen_postpro = SKGEN_SMOOTH;
 -	sce->toolsettings->skgen_postpro_passes = 1;
 -	sce->toolsettings->skgen_options = SKGEN_FILTER_INTERNAL | SKGEN_FILTER_EXTERNAL | SKGEN_FILTER_SMART | SKGEN_HARMONIC | SKGEN_SUB_CORRELATION | SKGEN_STICK_TO_EMBEDDING;
 -	sce->toolsettings->skgen_subdivisions[0] = SKGEN_SUB_CORRELATION;
 -	sce->toolsettings->skgen_subdivisions[1] = SKGEN_SUB_LENGTH;
 -	sce->toolsettings->skgen_subdivisions[2] = SKGEN_SUB_ANGLE;
++	sce->toolsettings->transform_pivot_point = V3D_AROUND_CENTER_MEDIAN;
 +	sce->toolsettings->snap_mode = SCE_SNAP_MODE_INCREMENT;
 +	sce->toolsettings->snap_node_mode = SCE_SNAP_MODE_GRID;
 +	sce->toolsettings->snap_uv_mode = SCE_SNAP_MODE_INCREMENT;
  
  	sce->toolsettings->curve_paint_settings.curve_type = CU_BEZIER;
  	sce->toolsettings->curve_paint_settings.flag |= CURVE_PAINT_FLAG_CORNERS_DETECT;
diff --cc source/blender/blenloader/intern/versioning_280.c
index e2ac0f16e34,00000000000..56ca663e3f0
mode 100644,000000..100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@@ -1,2525 -1,0 +1,2525 @@@
 +/*
 + * ***** BEGIN GPL LICENSE BLOCK *****
 + *
 + * This program is free software; you can redistribute it and/or
 + * modify it under the terms of the GNU General Public License
 + * as published by the Free Software Foundation; either version 2
 + * of the License, or (at your option) any later version.
 + *
 + * This program is distributed in the hope that it will be useful,
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 + * GNU General Public License for more details.
 + *
 + * You should have received a copy of the GNU General Public License
 + * along with this program; if not, write to the Free Software Foundation,
 + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 + *
 + * Contributor(s): Dalai Felinto
 + *
 + * ***** END GPL LICENSE BLOCK *****
 + *
 + */
 +
 +/** \file blender/blenloader/intern/versioning_280.c
 + *  \ingroup blenloader
 + */
 +
 +/* allow readfile to use deprecated functionality */
 +#define DNA_DEPRECATED_ALLOW
 +
 +#include <string.h>
 +#include <float.h>
 +
 +#include "BLI_listbase.h"
 +#include "BLI_math.h"
 +#include "BLI_mempool.h"
 +#include "BLI_string.h"
 +#include "BLI_string_utf8.h"
 +#include "BLI_utildefines.h"
 +
 +#include "DNA_object_types.h"
 +#include "DNA_camera_types.h"
 +#include "DNA_cloth_types.h"
 +#include "DNA_collection_types.h"
 +#include "DNA_constraint_types.h"
 +#include "DNA_gpu_types.h"
 +#include "DNA_lamp_types.h"
 +#include "DNA_layer_types.h"
 +#include "DNA_lightprobe_types.h"
 +#include "DNA_material_types.h"
 +#include "DNA_mesh_types.h"
 +#include "DNA_modifier_types.h"
 +#include "DNA_particle_types.h"
 +#include "DNA_rigidbody_types.h"
 +#include "DNA_scene_types.h"
 +#include "DNA_screen_types.h"
 +#include "DNA_view3d_types.h"
 +#include "DNA_genfile.h"
 +#include "DNA_gpencil_types.h"
 +#include "DNA_workspace_types.h"
 +#include "DNA_key_types.h"
 +#include "DNA_curve_types.h"
 +#include "DNA_armature_types.h"
 +
 +#include "BKE_action.h"
 +#include "BKE_cloth.h"
 +#include "BKE_collection.h"
 +#include "BKE_constraint.h"
 +#include "BKE_colortools.h"
 +#include "BKE_customdata.h"
 +#include "BKE_freestyle.h"
 +#include "BKE_gpencil.h"
 +#include "BKE_idprop.h"
 +#include "BKE_image.h"
 +#include "BKE_key.h"
 +#include "BKE_library.h"
 +#include "BKE_layer.h"
 +#include "BKE_main.h"
 +#include "BKE_material.h"
 +#include "BKE_mesh.h"
 +#include "BKE_node.h"
 +#include "BKE_object.h"
 +#include "BKE_paint.h"
 +#include "BKE_pointcache.h"
 +#include "BKE_report.h"
 +#include "BKE_rigidbody.h"
 +#include "BKE_scene.h"
 +#include "BKE_screen.h"
 +#include "BKE_sequencer.h"
 +#include "BKE_studiolight.h"
 +#include "BKE_unit.h"
 +#include "BKE_workspace.h"
 +
 +/* Only for IMB_BlendMode */
 +#include "IMB_imbuf.h"
 +
 +#include "DEG_depsgraph.h"
 +
 +#include "BLT_translation.h"
 +
 +#include "BLO_readfile.h"
 +#include "readfile.h"
 +
 +#include "MEM_guardedalloc.h"
 +
 +static bScreen *screen_parent_find(const bScreen *screen)
 +{
 +	/* can avoid lookup if screen state isn't maximized/full (parent and child store the same state) */
 +	if (ELEM(screen->state, SCREENMAXIMIZED, SCREENFULL)) {
 +		for (const ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {
 +			if (sa->full && sa->full != screen) {
 +				BLI_assert(sa->full->state == screen->state);
 +				return sa->full;
 +			}
 +		}
 +	}
 +
 +	return NULL;
 +}
 +
 +static void do_version_workspaces_create_from_screens(Main *bmain)
 +{
 +	for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) {
 +		const bScreen *screen_parent = screen_parent_find(screen);
 +		WorkSpace *workspace;
 +		if (screen->temp) {
 +			continue;
 +		}
 +
 +		if (screen_parent) {
 +			/* fullscreen with "Back to Previous" option, don't create
 +			 * a new workspace, add layout workspace containing parent */
 +			workspace = BLI_findstring(
 +			        &bmain->workspaces, screen_parent->id.name + 2, offsetof(ID, name) + 2);
 +		}
 +		else {
 +			workspace = BKE_workspace_add(bmain, screen->id.name + 2);
 +		}
 +		if (workspace == NULL) {
 +			continue;  /* Not much we can do.. */
 +		}
 +		BKE_workspace_layout_add(bmain, workspace, screen, screen->id.name + 2);
 +	}
 +}
 +
 +static void do_version_area_change_space_to_spa

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list