[Bf-committers] [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).
Dalai Felinto
dfelinto at gmail.com
Sat Feb 23 03:02:22 CET 2013
Hi Campbell,
I see blenderkernel/intern/node.c still using a lot of G.main. Is it in the
plans to handle them eventually?
For example:
1881 /* XXX hack, should be done by depsgraph!! */
1882 ntreeVerifyNodes(G.main, &ntree->id);
Just yesterday I closed/rejected the following report because although the
G.main above is NULL, and it crashes the Blenderplayer (when opening old
files) I thought this would be tackled only in the overpraised depsgraph
refactor:
http://projects.blender.org/tracker/?func=detail&atid=306&aid=29730&group_id=9
Anyhoo, I'm not that comfortable with changing the nodetree and depsgraph
code now, specially if there are undergoing changes. But if you are still
going to work on it, I thought it wouldn't hurt to see if this (now
abandoned) report get fixed "by chance".
Thanks,
Dalai
2013/2/22 Campbell Barton <ideasman42 at gmail.com>
> 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 <<<
>
> _______________________________________________
> Bf-blender-cvs mailing list
> Bf-blender-cvs at blender.org
> http://lists.blender.org/mailman/listinfo/bf-blender-cvs
>
More information about the Bf-committers
mailing list