[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [54773] trunk/blender/source/blender: fix for error in the blenderplayer caused by r54727 (can't assume G. main is valid on load).
Campbell Barton
ideasman42 at gmail.com
Sat Feb 23 02:33:47 CET 2013
Revision: 54773
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=54773
Author: campbellbarton
Date: 2013-02-23 01:33:47 +0000 (Sat, 23 Feb 2013)
Log Message:
-----------
fix for error in the blenderplayer caused by r54727 (can't assume G.main is valid on load).
Revision Links:
--------------
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=54727
Modified Paths:
--------------
trunk/blender/source/blender/blenkernel/BKE_depsgraph.h
trunk/blender/source/blender/blenkernel/intern/depsgraph.c
trunk/blender/source/blender/blenloader/intern/readfile.c
Modified: trunk/blender/source/blender/blenkernel/BKE_depsgraph.h
===================================================================
--- trunk/blender/source/blender/blenkernel/BKE_depsgraph.h 2013-02-23 01:17:01 UTC (rev 54772)
+++ trunk/blender/source/blender/blenkernel/BKE_depsgraph.h 2013-02-23 01:33:47 UTC (rev 54773)
@@ -118,6 +118,7 @@
void DAG_on_visible_update(struct Main *bmain, const short do_time);
/* tag datablock to get updated for the next redraw */
+void DAG_id_tag_update_ex(struct Main *bmain, struct ID *id, short flag);
void DAG_id_tag_update(struct ID *id, short flag);
/* flush all tagged updates */
void DAG_ids_flush_tagged(struct Main *bmain);
Modified: trunk/blender/source/blender/blenkernel/intern/depsgraph.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/depsgraph.c 2013-02-23 01:17:01 UTC (rev 54772)
+++ trunk/blender/source/blender/blenkernel/intern/depsgraph.c 2013-02-23 01:33:47 UTC (rev 54773)
@@ -2914,12 +2914,10 @@
memset(bmain->id_tag_update, 0, sizeof(bmain->id_tag_update));
}
-void DAG_id_tag_update(ID *id, short flag)
+void DAG_id_tag_update_ex(Main *bmain, ID *id, short flag)
{
- Main *bmain = G.main;
+ if (id == NULL) return;
- if (id == NULL) return;
-
/* tag ID for update */
if (flag) {
if (flag & OB_RECALC_OB)
@@ -2974,6 +2972,11 @@
}
}
+void DAG_id_tag_update(ID *id, short flag)
+{
+ DAG_id_tag_update_ex(G.main, id, flag);
+}
+
void DAG_id_type_tag(Main *bmain, short idtype)
{
if (idtype == ID_NT) {
Modified: trunk/blender/source/blender/blenloader/intern/readfile.c
===================================================================
--- trunk/blender/source/blender/blenloader/intern/readfile.c 2013-02-23 01:17:01 UTC (rev 54772)
+++ trunk/blender/source/blender/blenloader/intern/readfile.c 2013-02-23 01:33:47 UTC (rev 54773)
@@ -2712,7 +2712,7 @@
}
}
-static void lib_link_pose(FileData *fd, Object *ob, bPose *pose)
+static void lib_link_pose(FileData *fd, Main *bmain, Object *ob, bPose *pose)
{
bPoseChannel *pchan;
bArmature *arm = ob->data;
@@ -2756,7 +2756,7 @@
}
if (rebuild) {
- DAG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME);
+ DAG_id_tag_update_ex(bmain, &ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME);
pose->flag |= POSE_RECALC;
}
}
@@ -4221,7 +4221,7 @@
/* if id.us==0 a new base will be created later on */
/* WARNING! Also check expand_object(), should reflect the stuff below. */
- lib_link_pose(fd, ob, ob->pose);
+ lib_link_pose(fd, main, ob, ob->pose);
lib_link_constraints(fd, &ob->id, &ob->constraints);
// XXX deprecated - old animation system <<<
More information about the Bf-blender-cvs
mailing list