diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2018-06-12 16:41:32 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2018-06-12 16:41:32 +0300 |
commit | 6231a077ac96b546d41404ef423fc23e1fa01803 (patch) | |
tree | 8c91217b49506ec6e7db7c48737e5ee6295df395 /source/blender/blenkernel/intern | |
parent | 1b5e3e1c019e5209b557f6699902d275b9bc67aa (diff) | |
parent | a6585fa4b1a7a4dd4b5ea21efcee36c8460ff5ec (diff) |
Merge branch 'master' into blender2.8
Conflicts:
source/blender/blenkernel/BKE_group.h
source/blender/blenkernel/BKE_object.h
source/blender/blenkernel/intern/group.c
source/blender/blenkernel/intern/library_remap.c
source/blender/blenkernel/intern/object.c
source/blender/blenloader/intern/readfile.c
source/blender/editors/object/object_group.c
source/blender/editors/object/object_relations.c
source/blender/editors/physics/rigidbody_constraint.c
source/blender/editors/physics/rigidbody_object.c
source/blender/makesrna/intern/rna_group.c
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/curve.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/displist.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/font.c | 30 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/object_dupli.c | 10 |
4 files changed, 23 insertions, 21 deletions
diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c index 01da9857864..504999b0b10 100644 --- a/source/blender/blenkernel/intern/curve.c +++ b/source/blender/blenkernel/intern/curve.c @@ -4962,7 +4962,7 @@ bool BKE_curve_minmax(Curve *cu, bool use_radius, float min[3], float max[3]) */ if (is_font) { nurb_lb = &temp_nurb_lb; - BKE_vfont_to_curve_ex(G.main, NULL, cu, FO_EDIT, nurb_lb, + BKE_vfont_to_curve_ex(NULL, cu, FO_EDIT, nurb_lb, NULL, NULL, NULL, NULL); use_radius = false; } diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c index 5e812d4e5d0..ad055a727a9 100644 --- a/source/blender/blenkernel/intern/displist.c +++ b/source/blender/blenkernel/intern/displist.c @@ -1573,7 +1573,7 @@ static void do_makeDispListCurveTypes( } if (ob->type == OB_FONT) { - BKE_vfont_to_curve_nubase(G.main, ob, FO_EDIT, &nubase); + BKE_vfont_to_curve_nubase(ob, FO_EDIT, &nubase); } else { BKE_nurbList_duplicate(&nubase, BKE_curve_nurbs_get(cu)); diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c index f7ab5415d1c..29767efa71f 100644 --- a/source/blender/blenkernel/intern/font.c +++ b/source/blender/blenkernel/intern/font.c @@ -153,7 +153,7 @@ static PackedFile *get_builtin_packedfile(void) } } -static VFontData *vfont_get_data(Main *bmain, VFont *vfont) +static VFontData *vfont_get_data(VFont *vfont) { if (vfont == NULL) { return NULL; @@ -188,10 +188,10 @@ static VFontData *vfont_get_data(Main *bmain, VFont *vfont) } } else { - pf = newPackedFile(NULL, vfont->name, ID_BLEND_PATH(bmain, &vfont->id)); + pf = newPackedFile(NULL, vfont->name, ID_BLEND_PATH_FROM_GLOBAL(&vfont->id)); if (vfont->temp_pf == NULL) { - vfont->temp_pf = newPackedFile(NULL, vfont->name, ID_BLEND_PATH(bmain, &vfont->id)); + vfont->temp_pf = newPackedFile(NULL, vfont->name, ID_BLEND_PATH_FROM_GLOBAL(&vfont->id)); } } if (!pf) { @@ -349,13 +349,13 @@ VFont *BKE_vfont_builtin_get(void) { VFont *vfont; - for (vfont = G.main->vfont.first; vfont; vfont = vfont->id.next) { + for (vfont = G_MAIN->vfont.first; vfont; vfont = vfont->id.next) { if (BKE_vfont_is_builtin(vfont)) { return vfont; } } - return BKE_vfont_load(G.main, FO_BUILTIN_NAME); + return BKE_vfont_load(G_MAIN, FO_BUILTIN_NAME); } static VChar *find_vfont_char(VFontData *vfd, unsigned int character) @@ -423,7 +423,7 @@ static void build_underline(Curve *cu, ListBase *nubase, const rctf *rect, mul_v2_fl(bp[3].vec, cu->fsize); } -static void buildchar(Main *bmain, Curve *cu, ListBase *nubase, unsigned int character, CharInfo *info, +static void buildchar(Curve *cu, ListBase *nubase, unsigned int character, CharInfo *info, float ofsx, float ofsy, float rot, int charidx) { BezTriple *bezt1, *bezt2; @@ -433,7 +433,7 @@ static void buildchar(Main *bmain, Curve *cu, ListBase *nubase, unsigned int cha VChar *che = NULL; int i; - vfd = vfont_get_data(bmain, which_vfont(cu, info)); + vfd = vfont_get_data(which_vfont(cu, info)); if (!vfd) return; #if 0 @@ -635,7 +635,7 @@ struct TempLineInfo { int wspace_nr; /* number of whitespaces of line */ }; -bool BKE_vfont_to_curve_ex(Main *bmain, Object *ob, Curve *cu, int mode, ListBase *r_nubase, +bool BKE_vfont_to_curve_ex(Object *ob, Curve *cu, int mode, ListBase *r_nubase, const wchar_t **r_text, int *r_text_len, bool *r_text_free, struct CharTrans **r_chartransdata) { @@ -677,7 +677,7 @@ bool BKE_vfont_to_curve_ex(Main *bmain, Object *ob, Curve *cu, int mode, ListBas if (cu->str == NULL) return ok; if (vfont == NULL) return ok; - vfd = vfont_get_data(bmain, vfont); + vfd = vfont_get_data(vfont); /* The VFont Data can not be found */ if (!vfd) return ok; @@ -770,7 +770,7 @@ makebreak: if (vfont == NULL) break; if (vfont != oldvfont) { - vfd = vfont_get_data(bmain, vfont); + vfd = vfont_get_data(vfont); oldvfont = vfont; } @@ -1274,7 +1274,7 @@ makebreak: } /* We do not want to see any character for \n or \r */ if (cha != '\n') - buildchar(bmain, cu, r_nubase, cha, info, ct->xof, ct->yof, ct->rot, i); + buildchar(cu, r_nubase, cha, info, ct->xof, ct->yof, ct->rot, i); if ((info->flag & CU_CHINFO_UNDERLINE) && (cha != '\n')) { float ulwidth, uloverlap = 0.0f; @@ -1340,19 +1340,19 @@ finally: } -bool BKE_vfont_to_curve_nubase(Main *bmain, Object *ob, int mode, ListBase *r_nubase) +bool BKE_vfont_to_curve_nubase(Object *ob, int mode, ListBase *r_nubase) { BLI_assert(ob->type == OB_FONT); - return BKE_vfont_to_curve_ex(bmain, ob, ob->data, mode, r_nubase, + return BKE_vfont_to_curve_ex(ob, ob->data, mode, r_nubase, NULL, NULL, NULL, NULL); } -bool BKE_vfont_to_curve(Main *bmain, Object *ob, int mode) +bool BKE_vfont_to_curve(Object *ob, int mode) { Curve *cu = ob->data; - return BKE_vfont_to_curve_ex(bmain, ob, ob->data, mode, &cu->nurb, NULL, NULL, NULL, NULL); + return BKE_vfont_to_curve_ex(ob, ob->data, mode, &cu->nurb, NULL, NULL, NULL, NULL); } diff --git a/source/blender/blenkernel/intern/object_dupli.c b/source/blender/blenkernel/intern/object_dupli.c index 73e7041fda8..57cdfdebcd3 100644 --- a/source/blender/blenkernel/intern/object_dupli.c +++ b/source/blender/blenkernel/intern/object_dupli.c @@ -540,7 +540,7 @@ static const DupliGenerator gen_dupli_verts = { }; /* OB_DUPLIVERTS - FONT */ -static Object *find_family_object(const char *family, size_t family_len, unsigned int ch, GHash *family_gh) +static Object *find_family_object(Main *bmain, const char *family, size_t family_len, unsigned int ch, GHash *family_gh) { Object **ob_pt; Object *ob; @@ -557,7 +557,7 @@ static Object *find_family_object(const char *family, size_t family_len, unsigne ch_utf8[ch_utf8_len] = '\0'; ch_utf8_len += 1; /* compare with null terminator */ - for (ob = G.main->object.first; ob; ob = ob->id.next) { + for (ob = bmain->object.first; ob; ob = ob->id.next) { if (STREQLEN(ob->id.name + 2 + family_len, ch_utf8, ch_utf8_len)) { if (STREQLEN(ob->id.name + 2, family, family_len)) { break; @@ -593,7 +593,7 @@ static void make_duplis_font(const DupliContext *ctx) /* in par the family name is stored, use this to find the other objects */ - BKE_vfont_to_curve_ex(G.main, par, par->data, FO_DUPLI, NULL, + BKE_vfont_to_curve_ex(par, par->data, FO_DUPLI, NULL, &text, &text_len, &text_free, &chartransdata); if (text == NULL || chartransdata == NULL) { @@ -614,7 +614,9 @@ static void make_duplis_font(const DupliContext *ctx) /* advance matching BLI_strncpy_wchar_from_utf8 */ for (a = 0; a < text_len; a++, ct++) { - ob = find_family_object(cu->family, family_len, (unsigned int)text[a], family_gh); + /* XXX That G.main is *really* ugly, but not sure what to do here... + * Definitively don't think it would be safe to put back Main *bmain pointer in DupliContext as done in 2.7x? */ + ob = find_family_object(G.main, cu->family, family_len, (unsigned int)text[a], family_gh); if (ob) { vec[0] = fsize * (ct->xof - xof); vec[1] = fsize * (ct->yof - yof); |