Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2017-06-06 23:47:41 +0300
committerClément Foucault <foucault.clem@gmail.com>2017-06-09 02:15:17 +0300
commitcc31d7bb49090194e13fc4ebe58bb8f7f63f4186 (patch)
tree14727b9362cca5c15300c1f76dc45240cd9030b4 /source/blender/blenkernel/intern/library.c
parent346619159ae39dfb4063f563d498eec32bba13aa (diff)
Probe: Add new object datablock
We went for a new datablock because blending probe functionality with empties was going to be messy.
Diffstat (limited to 'source/blender/blenkernel/intern/library.c')
-rw-r--r--source/blender/blenkernel/intern/library.c17
1 files changed, 17 insertions, 0 deletions
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;