[Bf-blender-cvs] [cc31d7bb490] blender2.8: Probe: Add new object datablock

Clément Foucault noreply at git.blender.org
Fri Jun 9 01:27:11 CEST 2017


Commit: cc31d7bb49090194e13fc4ebe58bb8f7f63f4186
Author: Clément Foucault
Date:   Tue Jun 6 22:47:41 2017 +0200
Branches: blender2.8
https://developer.blender.org/rBcc31d7bb49090194e13fc4ebe58bb8f7f63f4186

Probe: Add new object datablock

We went for a new datablock because blending probe functionality with empties was going to be messy.

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

M	source/blender/CMakeLists.txt
M	source/blender/blenkernel/BKE_library.h
M	source/blender/blenkernel/BKE_main.h
A	source/blender/blenkernel/BKE_probe.h
M	source/blender/blenkernel/CMakeLists.txt
M	source/blender/blenkernel/intern/anim_sys.c
M	source/blender/blenkernel/intern/idcode.c
M	source/blender/blenkernel/intern/library.c
M	source/blender/blenkernel/intern/library_remap.c
M	source/blender/blenkernel/intern/object.c
A	source/blender/blenkernel/intern/probe.c
M	source/blender/blenloader/intern/readfile.c
M	source/blender/blenloader/intern/writefile.c
M	source/blender/blentranslation/BLT_translation.h
M	source/blender/editors/interface/interface_icons.c
M	source/blender/editors/interface/interface_templates.c
M	source/blender/editors/space_file/filesel.c
M	source/blender/editors/space_outliner/outliner_intern.h
M	source/blender/makesdna/DNA_ID.h
M	source/blender/makesdna/DNA_object_types.h
A	source/blender/makesdna/DNA_probe_types.h
M	source/blender/makesdna/intern/makesdna.c
M	source/blender/makesrna/intern/CMakeLists.txt
M	source/blender/makesrna/intern/makesrna.c
M	source/blender/makesrna/intern/rna_ID.c
M	source/blender/makesrna/intern/rna_internal.h
M	source/blender/makesrna/intern/rna_main.c
M	source/blender/makesrna/intern/rna_main_api.c
M	source/blender/makesrna/intern/rna_object.c
A	source/blender/makesrna/intern/rna_probe.c
M	source/blender/makesrna/intern/rna_space.c

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

diff --git a/source/blender/CMakeLists.txt b/source/blender/CMakeLists.txt
index 1788c889719..9c392993e58 100644
--- a/source/blender/CMakeLists.txt
+++ b/source/blender/CMakeLists.txt
@@ -71,6 +71,7 @@ set(SRC_DNA_INC
 	${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_outliner_types.h
 	${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_packedFile_types.h
 	${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_particle_types.h
+	${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_probe_types.h
 	${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_property_types.h
 	${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_rigidbody_types.h
 	${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_scene_types.h
diff --git a/source/blender/blenkernel/BKE_library.h b/source/blender/blenkernel/BKE_library.h
index dcc15c66c3e..863920c9c38 100644
--- a/source/blender/blenkernel/BKE_library.h
+++ b/source/blender/blenkernel/BKE_library.h
@@ -95,7 +95,7 @@ void id_clear_lib_data_ex(struct Main *bmain, struct ID *id, const bool id_in_ma
 
 struct ListBase *which_libbase(struct Main *mainlib, short type);
 
-#define MAX_LIBARRAY    36
+#define MAX_LIBARRAY    37
 int set_listbasepointers(struct Main *main, struct ListBase *lb[MAX_LIBARRAY]);
 
 /* Main API */
diff --git a/source/blender/blenkernel/BKE_main.h b/source/blender/blenkernel/BKE_main.h
index a616429fa95..2f38eeb25df 100644
--- a/source/blender/blenkernel/BKE_main.h
+++ b/source/blender/blenkernel/BKE_main.h
@@ -108,6 +108,7 @@ typedef struct Main {
 	ListBase vfont;
 	ListBase text;
 	ListBase speaker;
+	ListBase probe;
 	ListBase sound;
 	ListBase group;
 	ListBase armature;
diff --git a/source/blender/blenkernel/BKE_probe.h b/source/blender/blenkernel/BKE_probe.h
new file mode 100644
index 00000000000..29e42e06113
--- /dev/null
+++ b/source/blender/blenkernel/BKE_probe.h
@@ -0,0 +1,45 @@
+/*
+ * ***** 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) Blender Foundation.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#ifndef __BKE_PROBE_H__
+#define __BKE_PROBE_H__
+
+/** \file BKE_probe.h
+ *  \ingroup bke
+ *  \brief General operations for probes.
+ */
+
+struct Main;
+struct Probe;
+
+void BKE_probe_init(struct Probe *probe);
+void *BKE_probe_add(struct Main *bmain, const char *name);
+struct Probe *BKE_probe_copy(struct Main *bmain, struct Probe *probe);
+void BKE_probe_make_local(struct Main *bmain, struct Probe *probe, const bool lib_local);
+void BKE_probe_free(struct Probe *probe);
+
+#endif /* __BKE_PROBE_H__ */
diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt
index 44dcb0a51ae..c1f80a1a976 100644
--- a/source/blender/blenkernel/CMakeLists.txt
+++ b/source/blender/blenkernel/CMakeLists.txt
@@ -159,6 +159,7 @@ set(SRC
 	intern/pbvh.c
 	intern/pbvh_bmesh.c
 	intern/pointcache.c
+	intern/probe.c
 	intern/property.c
 	intern/layer.c
 	intern/report.c
@@ -280,6 +281,7 @@ set(SRC
 	BKE_particle.h
 	BKE_pbvh.h
 	BKE_pointcache.h
+	BKE_probe.h
 	BKE_property.h
 	BKE_layer.h
 	BKE_report.h
diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c
index b9937957236..585e5183608 100644
--- a/source/blender/blenkernel/intern/anim_sys.c
+++ b/source/blender/blenkernel/intern/anim_sys.c
@@ -94,6 +94,7 @@ bool id_type_can_have_animdata(const short id_type)
 		case ID_MA: case ID_TE: case ID_NT:
 		case ID_LA: case ID_CA: case ID_WO:
 		case ID_LS:
+		case ID_PRB:
 		case ID_SPK:
 		case ID_SCE:
 		case ID_MC:
diff --git a/source/blender/blenkernel/intern/idcode.c b/source/blender/blenkernel/intern/idcode.c
index e905eaeed76..315fc32502a 100644
--- a/source/blender/blenkernel/intern/idcode.c
+++ b/source/blender/blenkernel/intern/idcode.c
@@ -81,6 +81,7 @@ static IDType idtypes[] = {
 	{ ID_PA,   "ParticleSettings",   "particles",       BLT_I18NCONTEXT_ID_PARTICLESETTINGS,   IDTYPE_FLAGS_ISLINKABLE },
 	{ ID_PAL,  "Palettes",           "palettes",        BLT_I18NCONTEXT_ID_PALETTE,            IDTYPE_FLAGS_ISLINKABLE },
 	{ ID_PC,   "PaintCurve",         "paint_curves",    BLT_I18NCONTEXT_ID_PAINTCURVE,         IDTYPE_FLAGS_ISLINKABLE },
+	{ ID_PRB,  "Probe",              "probes",          BLT_I18NCONTEXT_ID_PROBE,              IDTYPE_FLAGS_ISLINKABLE },
 	{ ID_SCE,  "Scene",              "scenes",          BLT_I18NCONTEXT_ID_SCENE,              IDTYPE_FLAGS_ISLINKABLE },
 	{ ID_SCR,  "Screen",             "screens",         BLT_I18NCONTEXT_ID_SCREEN,             IDTYPE_FLAGS_ISLINKABLE },
 	{ ID_SEQ,  "Sequence",           "sequences",       BLT_I18NCONTEXT_ID_SEQUENCE,           0                       }, /* not actually ID data */
@@ -204,6 +205,7 @@ int BKE_idcode_to_idfilter(const short idcode)
 		CASE_IDFILTER(PA);
 		CASE_IDFILTER(PAL);
 		CASE_IDFILTER(PC);
+		CASE_IDFILTER(PRB);
 		CASE_IDFILTER(SCE);
 		CASE_IDFILTER(SPK);
 		CASE_IDFILTER(SO);
@@ -249,6 +251,7 @@ short BKE_idcode_from_idfilter(const int idfilter)
 		CASE_IDFILTER(PA);
 		CASE_IDFILTER(PAL);
 		CASE_IDFILTER(PC);
+		CASE_IDFILTER(PRB);
 		CASE_IDFILTER(SCE);
 		CASE_IDFILTER(SPK);
 		CASE_IDFILTER(SO);
@@ -296,6 +299,7 @@ int BKE_idcode_to_index(const short idcode)
 		CASE_IDINDEX(PA);
 		CASE_IDINDEX(PAL);
 		CASE_IDINDEX(PC);
+		CASE_IDINDEX(PRB);
 		CASE_IDINDEX(SCE);
 		CASE_IDINDEX(SCR);
 		CASE_IDINDEX(SPK);
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index b81465a1b1d..7f7985ff990 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -62,6 +62,7 @@
 #include "DNA_mask_types.h"
 #include "DNA_node_types.h"
 #include "DNA_object_types.h"
+#include "DNA_probe_types.h"
 #include "DNA_scene_types.h"
 #include "DNA_screen_types.h"
 #include "DNA_speaker_types.h"
@@ -117,6 +118,7 @@
 #include "BKE_paint.h"
 #include "BKE_particle.h"
 #include "BKE_packedFile.h"
+#include "BKE_probe.h"
 #include "BKE_sound.h"
 #include "BKE_speaker.h"
 #include "BKE_scene.h"
@@ -419,6 +421,9 @@ bool id_make_local(Main *bmain, ID *id, const bool test, const bool lib_local)
 		case ID_SPK:
 			if (!test) BKE_speaker_make_local(bmain, (Speaker *)id, lib_local);
 			return true;
+		case ID_PRB:
+			if (!test) BKE_probe_make_local(bmain, (Probe *)id, lib_local);
+			return true;
 		case ID_WO:
 			if (!test) BKE_world_make_local(bmain, (World *)id, lib_local);
 			return true;
@@ -532,6 +537,9 @@ bool id_copy(Main *bmain, ID *id, ID **newid, bool test)
 		case ID_SPK:
 			if (!test) *newid = (ID *)BKE_speaker_copy(bmain, (Speaker *)id);
 			return true;
+		case ID_PRB:
+			if (!test) *newid = (ID *)BKE_probe_copy(bmain, (Probe *)id);
+			return true;
 		case ID_CA:
 			if (!test) *newid = (ID *)BKE_camera_copy(bmain, (Camera *)id);
 			return true;
@@ -669,6 +677,8 @@ ListBase *which_libbase(Main *mainlib, short type)
 			return &(mainlib->text);
 		case ID_SPK:
 			return &(mainlib->speaker);
+		case ID_PRB:
+			return &(mainlib->probe);
 		case ID_SO:
 			return &(mainlib->sound);
 		case ID_GR:
@@ -839,6 +849,7 @@ int set_listbasepointers(Main *main, ListBase **lb)
 	lb[INDEX_ID_BR]  = &(main->brush);
 	lb[INDEX_ID_PA]  = &(main->particle);
 	lb[INDEX_ID_SPK] = &(main->speaker);
+	lb[INDEX_ID_PRB] = &(main->probe);
 
 	lb[INDEX_ID_WO]  = &(main->world);
 	lb[INDEX_ID_MC]  = &(main->movieclip);
@@ -931,6 +942,9 @@ void *BKE_libblock_alloc_notest(short type)
 		case ID_SPK:
 			id = MEM_callocN(sizeof(Speaker), "speaker");
 			break;
+		case ID_PRB:
+			id = MEM_callocN(sizeof(Probe), "probe");
+			break;
 		case ID_SO:
 			id = MEM_callocN(sizeof(bSound), "sound");
 			break;
@@ -1057,6 +1071,9 @@ void BKE_libblock_init_empty(ID *id)
 		case ID_SPK:
 			BKE_speaker_init((Speaker *)id);
 			break;
+		case ID_PRB:
+			BKE_probe_init((Probe *)id);
+			break;
 		case ID_CA:
 			BKE_camera_init((Camera *)id);
 			break;
diff --git a/source/blender/blenkernel/intern/library_remap.c b/source/blender/blenkernel/intern/library_remap.c
index 235b10dd1da..23a2eaf4970 100644
--- a/source/blender/blenkernel/intern/library_remap.c
+++ b/source/blender/blenkernel/intern/library_remap.c
@@ -53,6 +53,7 @@
 #include "DNA_mask_types.h"
 #include "DNA_node_types.h"
 #include "DNA_object_types.h"
+#include "DNA_probe_types.h"
 #include "DNA_scene_types.h"
 #include "DNA_screen_types.h"
 #include "DNA_speaker_types.h"
@@ -99,6 +100,7 @@
 #include "BKE_object.h"
 #include "BKE_paint.h"
 #include "BKE_particle.h"
+#include "BKE_probe.h"
 #include "BKE_sca.h"
 #include "BKE_speaker.h"
 #include "BKE_sound.h"
@@ -838,6 +840,9 @@ void BKE_libblock_free_ex(Main *bmain, void *idv, const bool do_id_user, const b
 		case ID_SPK:
 			BKE_speaker_free((Speaker *)id);
 			break;
+		case ID_PRB:
+			BKE_probe_free((Probe *)id);
+			break;
 		case ID_SO:
 			BKE_sound_free((bSound *)id);
 			break;
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index 9a2251b0f93..db580e3ea2b 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -58,6 +58,7 @@
 #include "DNA_view3d_types.h"
 #include "DNA_world_types.h"
 #include "DNA_object_types.h"
+#include "DNA_probe_types.h"
 #include "DNA_property_types.h"
 #include "DNA_rigidbody_types.h"
 
@@ -107,6 +108,7 @@
 #include "BKE_paint.h"
 #include "BKE_particle.h"
 #include "BKE_pointcache.h"
+#include "BKE_probe.h"
 #include "BKE_property.h"
 #include "BKE_rigidbody.h"
 #

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list