[Bf-blender-cvs] [6725b8d] wiggly-widgets: Merge branch 'master' into wiggly-widgets

Julian Eisel noreply at git.blender.org
Sun Jul 3 22:24:33 CEST 2016


Commit: 6725b8d56dbf97e3138d6282348b97ce2651f97b
Author: Julian Eisel
Date:   Sun Jul 3 22:23:09 2016 +0200
Branches: wiggly-widgets
https://developer.blender.org/rB6725b8d56dbf97e3138d6282348b97ce2651f97b

Merge branch 'master' into wiggly-widgets

Did some further edits on related changes.

Conflicts:
	source/blender/blenkernel/intern/object.c
	source/blender/blenlib/intern/math_vector.c
	source/blender/blenloader/intern/writefile.c
	source/blender/editors/include/ED_transform.h
	source/blender/editors/space_graph/space_graph.c
	source/blender/editors/space_image/space_image.c
	source/blender/editors/space_node/space_node.c
	source/blender/editors/space_sequencer/sequencer_draw.c
	source/blender/editors/space_sequencer/space_sequencer.c

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



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

diff --cc release/scripts/modules/bpy_extras/keyconfig_utils.py
index 4f1d94a,534dabf..90b7602
--- a/release/scripts/modules/bpy_extras/keyconfig_utils.py
+++ b/release/scripts/modules/bpy_extras/keyconfig_utils.py
@@@ -107,9 -75,10 +107,11 @@@ KM_HIERARCHY = 
  
      ('Graph Editor', 'GRAPH_EDITOR', 'WINDOW', [
          ('Graph Editor Generic', 'GRAPH_EDITOR', 'WINDOW', []),
 +        KM_WIDGETS_HIERARCHY[1]
          ]),
-     ('Dopesheet', 'DOPESHEET_EDITOR', 'WINDOW', []),
+     ('Dopesheet', 'DOPESHEET_EDITOR', 'WINDOW', [
+         ('Dopesheet Generic', 'DOPESHEET_EDITOR', 'WINDOW', []),
+         ]),
      ('NLA Editor', 'NLA_EDITOR', 'WINDOW', [
          ('NLA Channels', 'NLA_EDITOR', 'WINDOW', []),
          ('NLA Generic', 'NLA_EDITOR', 'WINDOW', []),
diff --cc source/blender/blenkernel/CMakeLists.txt
index cd81afa,b7ff81d..f812cc4
--- a/source/blender/blenkernel/CMakeLists.txt
+++ b/source/blender/blenkernel/CMakeLists.txt
@@@ -40,6 -40,6 +40,7 @@@ set(IN
  	../nodes
  	../physics
  	../render/extern/include
++	../windowmanager # XXX
  	../../../intern/ghost
  	../../../intern/guardedalloc
  	../../../intern/glew-mx
diff --cc source/blender/blenkernel/intern/facemap.c
index c6be004,0000000..28732c4
mode 100644,000000..100644
--- a/source/blender/blenkernel/intern/facemap.c
+++ b/source/blender/blenkernel/intern/facemap.c
@@@ -1,259 -1,0 +1,256 @@@
 +
 +/*
 + * ***** 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.
 + *
 + * The Original Code is Copyright (C) 2008 Blender Foundation.
 + * All rights reserved.
 + *
 + * 
 + * Contributor(s): Blender Foundation
 + *
 + * ***** END GPL LICENSE BLOCK *****
 + */
 +
 +
 +#include "DNA_object_types.h"
 +#include "DNA_mesh_types.h"
 +
- #include "WM_types.h"
- #include "WM_api.h"
- 
 +#include "BKE_context.h"
 +#include "BKE_customdata.h"
 +#include "BKE_facemap.h"
 +#include "BKE_editmesh.h"
 +#include "BKE_object.h"
 +#include "BKE_object_deform.h"
 +
 +#include "BKE_depsgraph.h"
 +
 +#include "BLI_utildefines.h"
 +#include "BLI_path_util.h"
 +#include "BLI_string.h"
 +#include "BLI_listbase.h"
 +
 +#include "BLT_translation.h"
 +
 +#include "MEM_guardedalloc.h"
 +
 +#include "RNA_define.h"
 +#include "RNA_access.h"
 +
 +#include <string.h>
 +
 +
 +static bool fmap_unique_check(void *arg, const char *name)
 +{
 +	struct {Object *ob; void *fm; } *data = arg;
 +	
 +	bFaceMap *fmap;
 +
 +	for (fmap = data->ob->fmaps.first; fmap; fmap = fmap->next) {
 +		if (data->fm != fmap) {
 +			if (!strcmp(fmap->name, name)) {
 +				return true;
 +			}
 +		}
 +	}
 +	
 +	return false;
 +}
 +
 +static bFaceMap *fmap_duplicate(bFaceMap *infmap)
 +{
 +	bFaceMap *outfmap;
 +
 +	if (!infmap)
 +		return NULL;
 +
 +	outfmap = MEM_callocN(sizeof(bFaceMap), "copy facemap");
 +
 +	/* For now, just copy everything over. */
 +	memcpy(outfmap, infmap, sizeof(bFaceMap));
 +
 +	outfmap->next = outfmap->prev = NULL;
 +
 +	return outfmap;
 +}
 +
 +void fmap_copy_list(ListBase *outbase, ListBase *inbase)
 +{
 +	bFaceMap *fmap, *fmapn;
 +
 +	BLI_listbase_clear(outbase);
 +
 +	for (fmap = inbase->first; fmap; fmap = fmap->next) {
 +		fmapn = fmap_duplicate(fmap);
 +		BLI_addtail(outbase, fmapn);
 +	}
 +}
 +
 +void fmap_unique_name(bFaceMap *fmap, Object *ob)
 +{
 +	struct {Object *ob; void *fmap; } data;
 +	data.ob = ob;
 +	data.fmap = fmap;
 +
 +	BLI_uniquename_cb(fmap_unique_check, &data, DATA_("Group"), '.', fmap->name, sizeof(fmap->name));
 +}
 +
 +bFaceMap *BKE_object_facemap_add_name(Object *ob, const char *name)
 +{
 +	bFaceMap *fmap;
 +	
 +	if (!ob || ob->type != OB_MESH)
 +		return NULL;
 +	
 +	fmap = MEM_callocN(sizeof(bFaceMap), __func__);
 +
 +	BLI_strncpy(fmap->name, name, sizeof(fmap->name));
 +
 +	BLI_addtail(&ob->fmaps, fmap);
 +	
 +	ob->actfmap = BLI_listbase_count(&ob->fmaps);
 +	
 +	fmap_unique_name(fmap, ob);
 +
 +	return fmap;
 +}
 +
 +bFaceMap *BKE_object_facemap_add(Object *ob)
 +{
 +	return BKE_object_facemap_add_name(ob, DATA_("FaceMap"));
 +}
 +
 +
 +static void object_fmap_remove_edit_mode(Object *ob, bFaceMap *fmap, bool do_selected, bool purge)
 +{
 +	const int fmap_nr = BLI_findindex(&ob->fmaps, fmap);
 +	
 +	if (ob->type == OB_MESH) {
 +		Mesh *me = ob->data;
 +		
 +		if (me->edit_btmesh) {
 +			BMEditMesh *em = me->edit_btmesh;
 +			const int cd_fmap_offset = CustomData_get_offset(&em->bm->pdata, CD_FACEMAP);
 +			
 +			if (cd_fmap_offset != -1) {
 +				BMFace *efa;
 +				BMIter iter;
 +				int *map;
 +				
 +				if (purge) {
 +					BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
 +						map = BM_ELEM_CD_GET_VOID_P(efa, cd_fmap_offset);
 +						
 +						if (map) { 
 +							if (*map == fmap_nr)
 +								*map = -1;
 +							else if (*map > fmap_nr)
 +								*map -= 1;
 +						}
 +					}
 +				}
 +				else {
 +					BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
 +						map = BM_ELEM_CD_GET_VOID_P(efa, cd_fmap_offset);
 +						
 +						if (map && *map == fmap_nr && (!do_selected || BM_elem_flag_test(efa, BM_ELEM_SELECT))) {
 +							*map = -1;
 +						}
 +					}
 +				}
 +			}
 +
 +			if (ob->actfmap == BLI_listbase_count(&ob->fmaps))
 +				ob->actfmap--;
 +			
 +			BLI_remlink(&ob->fmaps, fmap);
 +			MEM_freeN(fmap);
 +		}
 +	}
 +}
 +
 +static void object_fmap_remove_object_mode(Object *ob, bFaceMap *fmap, bool purge)
 +{
 +	const int fmap_nr = BLI_findindex(&ob->fmaps, fmap);
 +	
 +	if (ob->type == OB_MESH) {
 +		Mesh *me = ob->data;
 +		
 +		if (CustomData_has_layer(&me->pdata, CD_FACEMAP)) {
 +			int *map = CustomData_get_layer(&me->pdata, CD_FACEMAP);
 +			int i;
 +			
 +			if (map) {
 +				for (i = 0; i < me->totpoly; i++) {
 +					if (map[i] == fmap_nr)
 +						map[i] = -1;
 +					else if (purge && map[i] > fmap_nr)
 +						map[i]--;
 +				}
 +			}
 +		}
 +
 +		if (ob->actfmap == BLI_listbase_count(&ob->fmaps))
 +			ob->actfmap--;
 +		
 +		BLI_remlink(&ob->fmaps, fmap);
 +		MEM_freeN(fmap);
 +	}
 +}
 +
 +static void fmap_remove_exec(Object *ob, bFaceMap *fmap, const bool is_edit_mode, const bool purge)
 +{
 +	if (is_edit_mode)
 +		object_fmap_remove_edit_mode(ob, fmap, false, purge);
 +	else
 +		object_fmap_remove_object_mode(ob, fmap, purge);
 +}
 +
 +void BKE_object_facemap_remove(Object *ob, bFaceMap *fmap)
 +{
 +	fmap_remove_exec(ob, fmap, BKE_object_is_in_editmode(ob), true);
 +}
 +
 +void BKE_object_fmap_remove_all(Object *ob)
 +{
 +	bFaceMap *fmap = (bFaceMap *)ob->fmaps.first;
 +
 +	if (fmap) {
 +		const bool edit_mode = BKE_object_is_in_editmode_vgroup(ob);
 +
 +		while (fmap) {
 +			bFaceMap *next_fmap = fmap->next;
 +			fmap_remove_exec(ob, fmap, edit_mode, false);
 +			fmap = next_fmap;
 +		}
 +	}
 +	/* remove all dverts */
 +	if (ob->type == OB_MESH) {
 +		Mesh *me = ob->data;
 +		CustomData_free_layer(&me->pdata, CD_FACEMAP, me->totpoly, 0);
 +	}
 +	ob->actfmap = 0;
 +}
 +
 +int fmap_name_index(Object *ob, const char *name)
 +{
 +	return (name) ? BLI_findstringindex(&ob->fmaps, name, offsetof(bFaceMap, name)) : -1;
 +}
 +
 +bFaceMap *fmap_find_name(Object *ob, const char *name)
 +{
 +	return BLI_findstring(&ob->fmaps, name, offsetof(bFaceMap, name));
 +}
diff --cc source/blender/blenkernel/intern/object.c
index 3883820,d4ba70e..19e8a56
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@@ -395,62 -393,29 +395,29 @@@ void BKE_object_free_caches(Object *obj
  	}
  }
  
- /* do not free object itself */
- void BKE_object_free_ex(Object *ob, bool do_id_user)
+ /** Free (or release) any data used by this object (does not free the object itself). */
+ void BKE_object_free(Object *ob)
  {
- 	int a;
- 	
+ 	BKE_animdata_free((ID *)ob, false);
+ 
  	BKE_object_free_modifiers(ob);
- 	
- 	/* disconnect specific data, but not for lib data (might be indirect data, can get relinked) */
- 	if (ob->data) {
- 		ID *id = ob->data;
- 		id_us_min(id);
- 		if (id->us == 0 && id->lib == NULL) {
- 			switch (ob->type) {
- 				case OB_MESH:
- 					BKE_mesh_unlink((Mesh *)id);
- 					break;
- 				case OB_CURVE:
- 					BKE_curve_unlink((Curve *)id);
- 					break;
- 				case OB_MBALL:
- 					BKE_mball_unlink((MetaBall *)id);
- 					break;
- 			}
- 		}
- 		ob->data = NULL;
- 	}
  
- 	if (ob->mat) {
- 		for (a = 0; a < ob->totcol; a++) {
- 			if (ob->mat[a])
- 				id_us_min(&ob->mat[a]->id);
- 		}
- 		MEM_freeN(ob->mat);
+ 	MEM_SAFE_FREE(ob->mat);
+ 	MEM_SAFE_FREE(ob->matbits);
+ 	MEM_SAFE_FREE(ob->iuser);
+ 	MEM_SAFE_FREE(ob->bb);
+ 
+ 	BLI_freelistN(&ob->defbase);
++	BLI_freelistN(&ob->fmaps);
+ 	if (ob->pose) {
+ 		BKE_pose_free_ex(ob->pose, false);
+ 		ob->pose = NULL;
  	}
- 	if (ob->matbits) MEM_freeN(ob->matbits);
- 	ob->mat = NULL;
- 	ob->matbits = NULL;
- 	if (ob->iuser) MEM_freeN(ob->iuser);
- 	ob->iuser = NULL;
- 	if (ob->bb) MEM_freeN(ob->bb); 
- 	ob->bb = NULL;
- 	if (ob->adt) BKE_animdata_free((ID *)ob);
- 	if (ob->poselib)
- 		id_us_min(&ob->poselib->id);
- 	if (ob->gpd)
- 		id_us_min(&ob->gpd->id);
- 	if (ob->defbase.first)
- 		BLI_freelistN(&ob->defbase);
- 	if (ob->fmaps.first)
- 		BLI_freelistN(&ob->fmaps);
- 	if (ob->pose)
- 		BKE_pose_free_ex(ob->pose, do_id_user);
- 	if (ob->mpath)
+ 	if (ob->mpath) {
  		animviz_free_motionpath(ob->mpath);
 -		ob->mpath = NULL;
+ 	}
  	BKE_bproperty_free_list(&ob->prop);
- 	
+ 
  	free_sensors(&ob->sensors);
  	free_controllers(&ob->controllers);
  	free_actuators(&ob->actuators);
diff --cc source/blender/blenkernel/intern/screen.c
index a9fe7db,857bd54..2f57bf4
--- a/source/blender/blenkernel/intern/screen.c
+++ b/source/blender/blenkernel/intern/screen.c
@@@ -341,12 -3

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list