[Bf-blender-cvs] [40b748d] master: Fix for missing update changing VFont.filepath
Campbell Barton
noreply at git.blender.org
Sat Mar 5 07:51:34 CET 2016
Commit: 40b748d40f7efddbd07f35081a3264215025ffb8
Author: Campbell Barton
Date: Sat Mar 5 17:40:33 2016 +1100
Branches: master
https://developer.blender.org/rB40b748d40f7efddbd07f35081a3264215025ffb8
Fix for missing update changing VFont.filepath
Changing the filepath wouldn't reload the font even after calling scene.update().
===================================================================
M source/blender/blenkernel/intern/depsgraph.c
M source/blender/makesdna/DNA_curve_types.h
===================================================================
diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c
index 55c54cd..a029c8c 100644
--- a/source/blender/blenkernel/intern/depsgraph.c
+++ b/source/blender/blenkernel/intern/depsgraph.c
@@ -2586,7 +2586,18 @@ static void dag_id_flush_update(Main *bmain, Scene *sce, ID *id)
}
}
}
-
+ else if (idtype == ID_VF) {
+ for (obt = bmain->object.first; obt; obt = obt->id.next) {
+ if (obt->type == OB_FONT) {
+ Curve *cu = obt->data;
+ if (ELEM((struct VFont *)id, CURVE_VFONT_ANY(cu))) {
+ obt->recalc |= OB_RECALC_DATA;
+ lib_id_recalc_data_tag(bmain, &obt->id);
+ }
+ }
+ }
+ }
+
/* set flags based on textures - can influence depgraph via modifiers */
if (idtype == ID_TE) {
for (obt = bmain->object.first; obt; obt = obt->id.next) {
@@ -2953,18 +2964,6 @@ void DAG_id_tag_update_ex(Main *bmain, ID *id, short flag)
}
}
}
- else if (idtype == ID_VF) {
- /* this is weak still, should be done delayed as well */
- for (ob = bmain->object.first; ob; ob = ob->id.next) {
- if (ob->type == OB_FONT) {
- Curve *cu = ob->data;
-
- if (ELEM((struct VFont *)id, cu->vfont, cu->vfontb, cu->vfonti, cu->vfontbi)) {
- ob->recalc |= (flag & OB_RECALC_ALL);
- }
- }
- }
- }
else {
/* disable because this is called on various ID types automatically.
* where printing warning is not useful. for now just ignore */
diff --git a/source/blender/makesdna/DNA_curve_types.h b/source/blender/makesdna/DNA_curve_types.h
index 9be3fbc..8f711c1 100644
--- a/source/blender/makesdna/DNA_curve_types.h
+++ b/source/blender/makesdna/DNA_curve_types.h
@@ -268,6 +268,9 @@ typedef struct Curve {
} Curve;
+#define CURVE_VFONT_ANY(cu) \
+ ((cu)->vfont), ((cu)->vfontb), ((cu)->vfonti), ((cu)->vfontbi)
+
/* **************** CURVE ********************* */
/* Curve.texflag */
More information about the Bf-blender-cvs
mailing list