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:
authorDan Eicher <dan@eu.phorio.us>2012-05-29 17:59:31 +0400
committerDan Eicher <dan@eu.phorio.us>2012-05-29 17:59:31 +0400
commit45dbb715eea363d33125de04411ac4ce5e7a63a9 (patch)
tree897fec31c430d62ae9ecdf55e844e5267dda5641 /source/blender/makesrna/intern/rna_scene.c
parentb1e8063d6999d2eaad62f52bb81ced0876d1aced (diff)
Revert makesrna part of r47158 because it broke building blenderplayer
Apparently not supposed to call ED_* functions from there Also added a missing "\n" that's been annoying me for a long while
Diffstat (limited to 'source/blender/makesrna/intern/rna_scene.c')
-rw-r--r--source/blender/makesrna/intern/rna_scene.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 33f1c529b18..5b355e56911 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -304,7 +304,6 @@ EnumPropertyItem image_color_depth_items[] = {
#include "ED_mesh.h"
#include "ED_keyframing.h"
#include "ED_image.h"
-#include "ED_object.h"
#include "RE_engine.h"
@@ -339,17 +338,24 @@ static PointerRNA rna_Scene_objects_get(CollectionPropertyIterator *iter)
static Base *rna_Scene_object_link(Scene *scene, bContext *C, ReportList *reports, Object *ob)
{
Scene *scene_act = CTX_data_scene(C);
- Base *base = ED_object_scene_link(reports, scene, ob);
+ Base *base;
- if (base == NULL) {
+ if (BKE_scene_base_find(scene, ob)) {
+ BKE_reportf(reports, RPT_ERROR, "Object \"%s\" is already in scene \"%s\"", ob->id.name + 2, scene->id.name + 2);
return NULL;
}
+ base = BKE_scene_base_add(scene, ob);
+ id_us_plus(&ob->id);
+
+ /* this is similar to what object_add_type and BKE_object_add do */
+ base->lay = scene->lay;
+
/* when linking to an inactive scene don't touch the layer */
if (scene == scene_act)
ob->lay = base->lay;
- /* ob->recalc |= OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME; */
+ ob->recalc |= OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME;
/* slows down importers too much, run scene.update() */
/* DAG_scene_sort(G.main, scene); */