From 215ed84779da71ab8c1c580766f1771617e4828d Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 4 Oct 2011 12:30:26 +0000 Subject: Partial fix #27978: Problem exporting OGG Theora-Vorbis video (and other audio codecs) Ogg format does support only vorbis, theora, speex and flac audio codecs. Added check for result of av_write_header() and show info in header about error while initializing streams. This commit also fixed crash when using vorbis audio format. It used to be floating point exception. SOlved by initializing audio_stream->codec->time_base with proper rational value as it's done in FFmpeg sources. --- source/blender/blenkernel/intern/writeffmpeg.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c index 6010770e1ee..21289b07f8d 100644 --- a/source/blender/blenkernel/intern/writeffmpeg.c +++ b/source/blender/blenkernel/intern/writeffmpeg.c @@ -571,6 +571,10 @@ static AVStream* alloc_audio_stream(RenderData *rd, int codec_id, AVFormatContex return NULL; } + /* need to prevent floating point exception when using vorbis audio codec, + initialize this value in the same way as it's done in FFmpeg iteslf (sergey) */ + st->codec->time_base = (AVRational){1, st->codec->sample_rate}; + audio_outbuf_size = FF_MIN_BUFFER_SIZE; if((c->codec_id >= CODEC_ID_PCM_S16LE) && (c->codec_id <= CODEC_ID_PCM_DVD)) @@ -743,7 +747,11 @@ static int start_ffmpeg_impl(struct RenderData *rd, int rectx, int recty, Report } } - av_write_header(of); + if (av_write_header(of) < 0) { + BKE_report(reports, RPT_ERROR, "Could not initialize streams. Probably unsupported codec combination."); + return 0; + } + outfile = of; av_dump_format(of, 0, name, 1); -- cgit v1.2.3 From ffe9824011e34c8ab57c7be89350979e6343ce9f Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 4 Oct 2011 15:10:24 +0000 Subject: Correction for own recent commit -- didn't know it's unsupported in MSVC to do such things. --- source/blender/blenkernel/intern/writeffmpeg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c index 21289b07f8d..425af0272a3 100644 --- a/source/blender/blenkernel/intern/writeffmpeg.c +++ b/source/blender/blenkernel/intern/writeffmpeg.c @@ -573,7 +573,8 @@ static AVStream* alloc_audio_stream(RenderData *rd, int codec_id, AVFormatContex /* need to prevent floating point exception when using vorbis audio codec, initialize this value in the same way as it's done in FFmpeg iteslf (sergey) */ - st->codec->time_base = (AVRational){1, st->codec->sample_rate}; + st->codec->time_base.num= 1; + st->codec->time_base.den= st->codec->sample_rate; audio_outbuf_size = FF_MIN_BUFFER_SIZE; -- cgit v1.2.3 From be143cc037ad80dd792546bf0e2bd22b70c32ffe Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Thu, 6 Oct 2011 06:56:45 +0000 Subject: texface fix: if material is not used by mesh set default bge mat flag (backface culling on) report by Mitchell Stokes over IRC, but probably one of the reason people have been asking to expose the Game Settings material panel in the Render engine as well. --- source/blender/blenkernel/intern/material.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index 6e1303e375e..a763941cfe9 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -1995,6 +1995,11 @@ int do_version_tface(Main *main, int fileload) } } } + /* material is not used by faces with texface + * set the default flag - do it only once */ + else + if (fileload) + ma->game.flag = GEMAT_BACKCULL; } return nowarning; -- cgit v1.2.3 From 47253d0a2cd7dd5e1aee41eecb1898f490ac4b61 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 7 Oct 2011 00:26:04 +0000 Subject: fix for own bad mistake, broke vector curve handles. --- source/blender/blenkernel/intern/colortools.c | 6 ++---- source/blender/blenkernel/intern/curve.c | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/intern/colortools.c b/source/blender/blenkernel/intern/colortools.c index 7747e4750b7..7e92a09ce99 100644 --- a/source/blender/blenkernel/intern/colortools.c +++ b/source/blender/blenkernel/intern/colortools.c @@ -419,12 +419,10 @@ static void calchandle_curvemap(BezTriple *bezt, BezTriple *prev, BezTriple *nex } if(bezt->h1==HD_VECT) { /* vector */ - mul_v2_fl(dvec_a, 1.0f/3.0f); - sub_v2_v2v2(p2-3, p2, dvec_a); + madd_v2_v2v2fl(p2-3, p2, dvec_a, -1.0f/3.0f); } if(bezt->h2==HD_VECT) { - mul_v2_fl(dvec_b, 1.0f/3.0f); - sub_v2_v2v2(p2+3, p2, dvec_b); + madd_v2_v2v2fl(p2+3, p2, dvec_b, 1.0f/3.0f); } } diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c index b703c33f174..c69ced86a6c 100644 --- a/source/blender/blenkernel/intern/curve.c +++ b/source/blender/blenkernel/intern/curve.c @@ -2595,12 +2595,10 @@ void calchandleNurb(BezTriple *bezt, BezTriple *prev, BezTriple *next, int mode) } if(bezt->h1==HD_VECT) { /* vector */ - mul_v3_fl(dvec_a, 1.0f/3.0f); - sub_v3_v3v3(p2-3, p2, dvec_a); + madd_v3_v3v3fl(p2-3, p2, dvec_a, -1.0f/3.0f); } if(bezt->h2==HD_VECT) { - mul_v3_fl(dvec_b, 1.0f/3.0f); - sub_v3_v3v3(p2+3, p2, dvec_b); + madd_v3_v3v3fl(p2+3, p2, dvec_b, 1.0f/3.0f); } len_b= len_v3v3(p2, p2+3); -- cgit v1.2.3 From 011a3645bf1d587101ec7cb9bf6a0a0d1421802a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 8 Oct 2011 11:02:58 +0000 Subject: fix [#28846] Relative paths on linked scene fails --- source/blender/blenkernel/BKE_font.h | 5 +++-- source/blender/blenkernel/BKE_packedFile.h | 2 +- source/blender/blenkernel/intern/anim.c | 2 +- source/blender/blenkernel/intern/displist.c | 2 +- source/blender/blenkernel/intern/font.c | 28 +++++++++++++-------------- source/blender/blenkernel/intern/image.c | 4 ++-- source/blender/blenkernel/intern/packedFile.c | 10 +++++----- 7 files changed, 27 insertions(+), 26 deletions(-) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/BKE_font.h b/source/blender/blenkernel/BKE_font.h index 2195b370a5f..e4e8805164a 100644 --- a/source/blender/blenkernel/BKE_font.h +++ b/source/blender/blenkernel/BKE_font.h @@ -46,6 +46,7 @@ struct Curve; struct objfnt; struct TmpFont; struct CharInfo; +struct Main; struct chartrans { float xof, yof; @@ -77,10 +78,10 @@ void BKE_font_register_builtin(void *mem, int size); void free_vfont(struct VFont *sc); void free_ttfont(void); struct VFont *get_builtin_font(void); -struct VFont *load_vfont(const char *name); +struct VFont *load_vfont(struct Main *bmain, const char *name); struct TmpFont *vfont_find_tmpfont(struct VFont *vfont); -struct chartrans *BKE_text_to_curve(struct Scene *scene, struct Object *ob, int mode); +struct chartrans *BKE_text_to_curve(struct Main *bmain, struct Scene *scene, struct Object *ob, int mode); int BKE_font_getselection(struct Object *ob, int *start, int *end); diff --git a/source/blender/blenkernel/BKE_packedFile.h b/source/blender/blenkernel/BKE_packedFile.h index 541c581e762..556ff26e621 100644 --- a/source/blender/blenkernel/BKE_packedFile.h +++ b/source/blender/blenkernel/BKE_packedFile.h @@ -45,7 +45,7 @@ struct ReportList; struct VFont; /* pack */ -struct PackedFile *newPackedFile(struct ReportList *reports, const char *filename); +struct PackedFile *newPackedFile(struct ReportList *reports, const char *filename, const char *relabase); struct PackedFile *newPackedFileMemory(void *mem, int memlen); void packAll(struct Main *bmain, struct ReportList *reports); diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c index 824bbb8f70d..3accceb5464 100644 --- a/source/blender/blenkernel/intern/anim.c +++ b/source/blender/blenkernel/intern/anim.c @@ -1514,7 +1514,7 @@ static void font_duplilist(ListBase *lb, Scene *scene, Object *par, int level, i /* in par the family name is stored, use this to find the other objects */ - chartransdata= BKE_text_to_curve(scene, par, FO_DUPLI); + chartransdata= BKE_text_to_curve(G.main, scene, par, FO_DUPLI); if(chartransdata==NULL) return; cu= par->data; diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c index acc900d0b71..6704d06be52 100644 --- a/source/blender/blenkernel/intern/displist.c +++ b/source/blender/blenkernel/intern/displist.c @@ -1207,7 +1207,7 @@ static void do_makeDispListCurveTypes(Scene *scene, Object *ob, ListBase *dispba if(cu->path) free_path(cu->path); cu->path= NULL; - if(ob->type==OB_FONT) BKE_text_to_curve(scene, ob, 0); + if(ob->type==OB_FONT) BKE_text_to_curve(G.main, scene, ob, 0); if(!forOrco) curve_calc_modifiers_pre(scene, ob, forRender, &originalVerts, &deformedVerts, &numVerts); diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c index 6898615c753..c82aa855a7b 100644 --- a/source/blender/blenkernel/intern/font.c +++ b/source/blender/blenkernel/intern/font.c @@ -284,7 +284,7 @@ struct TmpFont *vfont_find_tmpfont(VFont *vfont) return tmpfnt; } -static VFontData *vfont_get_data(VFont *vfont) +static VFontData *vfont_get_data(Main *bmain, VFont *vfont) { struct TmpFont *tmpfnt = NULL; PackedFile *tpf; @@ -319,11 +319,11 @@ static VFontData *vfont_get_data(VFont *vfont) BLI_addtail(&ttfdata, tmpfnt); } } else { - pf= newPackedFile(NULL, vfont->name); + pf= newPackedFile(NULL, vfont->name, ID_BLEND_PATH(bmain, &vfont->id)); if(!tmpfnt) { - tpf= newPackedFile(NULL, vfont->name); + tpf= newPackedFile(NULL, vfont->name, ID_BLEND_PATH(bmain, &vfont->id)); // Add temporary packed file to globals tmpfnt= (struct TmpFont *) MEM_callocN(sizeof(struct TmpFont), "temp_font"); @@ -351,7 +351,7 @@ static VFontData *vfont_get_data(VFont *vfont) return vfont->data; } -VFont *load_vfont(const char *name) +VFont *load_vfont(Main *bmain, const char *name) { char filename[FILE_MAXFILE]; VFont *vfont= NULL; @@ -371,8 +371,8 @@ VFont *load_vfont(const char *name) BLI_strncpy(dir, name, sizeof(dir)); BLI_splitdirstring(dir, filename); - pf= newPackedFile(NULL, name); - tpf= newPackedFile(NULL, name); + pf= newPackedFile(NULL, name, bmain->name); + tpf= newPackedFile(NULL, name, bmain->name); is_builtin= 0; } @@ -382,7 +382,7 @@ VFont *load_vfont(const char *name) vfd= BLI_vfontdata_from_freetypefont(pf); if (vfd) { - vfont = alloc_libblock(&G.main->vfont, ID_VF, filename); + vfont = alloc_libblock(&bmain->vfont, ID_VF, filename); vfont->data = vfd; /* if there's a font name, use it for the ID name */ @@ -439,7 +439,7 @@ VFont *get_builtin_font(void) if (strcmp(vf->name, FO_BUILTIN_NAME)==0) return vf; - return load_vfont(FO_BUILTIN_NAME); + return load_vfont(G.main, FO_BUILTIN_NAME); } static VChar *find_vfont_char(VFontData *vfd, intptr_t character) @@ -500,7 +500,7 @@ static void build_underline(Curve *cu, float x1, float y1, float x2, float y2, i } -static void buildchar(Curve *cu, unsigned long character, CharInfo *info, float ofsx, float ofsy, float rot, int charidx) +static void buildchar(Main *bmain, Curve *cu, unsigned long character, CharInfo *info, float ofsx, float ofsy, float rot, int charidx) { BezTriple *bezt1, *bezt2; Nurb *nu1 = NULL, *nu2 = NULL; @@ -509,7 +509,7 @@ static void buildchar(Curve *cu, unsigned long character, CharInfo *info, float VChar *che = NULL; int i; - vfd= vfont_get_data(which_vfont(cu, info)); + vfd= vfont_get_data(bmain, which_vfont(cu, info)); if (!vfd) return; /* @@ -662,7 +662,7 @@ static float char_width(Curve *cu, VChar *che, CharInfo *info) } } -struct chartrans *BKE_text_to_curve(Scene *scene, Object *ob, int mode) +struct chartrans *BKE_text_to_curve(Main *bmain, Scene *scene, Object *ob, int mode) { VFont *vfont, *oldvfont; VFontData *vfd= NULL; @@ -714,7 +714,7 @@ struct chartrans *BKE_text_to_curve(Scene *scene, Object *ob, int mode) if (cu->tb==NULL) cu->tb= MEM_callocN(MAXTEXTBOX*sizeof(TextBox), "TextBox compat"); - vfd= vfont_get_data(vfont); + vfd= vfont_get_data(bmain, vfont); /* The VFont Data can not be found */ if(!vfd) { @@ -792,7 +792,7 @@ struct chartrans *BKE_text_to_curve(Scene *scene, Object *ob, int mode) } if (vfont != oldvfont) { - vfd= vfont_get_data(vfont); + vfd= vfont_get_data(bmain, vfont); oldvfont = vfont; } @@ -1157,7 +1157,7 @@ struct chartrans *BKE_text_to_curve(Scene *scene, Object *ob, int mode) } // We do not want to see any character for \n or \r if(cha != '\n' && cha != '\r') - buildchar(cu, cha, info, ct->xof, ct->yof, ct->rot, i); + buildchar(bmain, cu, cha, info, ct->xof, ct->yof, ct->rot, i); if ((info->flag & CU_CHINFO_UNDERLINE) && (cu->textoncurve == NULL) && (cha != '\n') && (cha != '\r')) { float ulwidth, uloverlap= 0.0f; diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index d764826cd47..834961bf6e7 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -1480,7 +1480,7 @@ void BKE_image_signal(Image *ima, ImageUser *iuser, int signal) /* try to repack file */ if(ima->packedfile) { PackedFile *pf; - pf = newPackedFile(NULL, ima->name); + pf = newPackedFile(NULL, ima->name, ID_BLEND_PATH(G.main, &ima->id)); if (pf) { freePackedFile(ima->packedfile); ima->packedfile = pf; @@ -1860,7 +1860,7 @@ static ImBuf *image_load_image_file(Image *ima, ImageUser *iuser, int cfra) /* make packed file for autopack */ if ((ima->packedfile == NULL) && (G.fileflags & G_AUTOPACK)) - ima->packedfile = newPackedFile(NULL, str); + ima->packedfile = newPackedFile(NULL, str, ID_BLEND_PATH(G.main, &ima->id)); } } else diff --git a/source/blender/blenkernel/intern/packedFile.c b/source/blender/blenkernel/intern/packedFile.c index ed729d819b7..4bc40bde949 100644 --- a/source/blender/blenkernel/intern/packedFile.c +++ b/source/blender/blenkernel/intern/packedFile.c @@ -168,7 +168,7 @@ PackedFile *newPackedFileMemory(void *mem, int memlen) return pf; } -PackedFile *newPackedFile(ReportList *reports, const char *filename) +PackedFile *newPackedFile(ReportList *reports, const char *filename, const char *basepath) { PackedFile *pf = NULL; int file, filelen; @@ -185,7 +185,7 @@ PackedFile *newPackedFile(ReportList *reports, const char *filename) // convert relative filenames to absolute filenames strcpy(name, filename); - BLI_path_abs(name, G.main->name); + BLI_path_abs(name, basepath); // open the file // and create a PackedFile structure @@ -224,7 +224,7 @@ void packAll(Main *bmain, ReportList *reports) for(ima=bmain->image.first; ima; ima=ima->id.next) { if(ima->packedfile == NULL && ima->id.lib==NULL) { if(ima->source==IMA_SRC_FILE) { - ima->packedfile = newPackedFile(reports, ima->name); + ima->packedfile = newPackedFile(reports, ima->name, ID_BLEND_PATH(bmain, &ima->id)); } else if(ELEM(ima->source, IMA_SRC_SEQUENCE, IMA_SRC_MOVIE)) { BKE_reportf(reports, RPT_WARNING, "Image '%s' skipped, movies and image sequences not supported.", ima->id.name+2); @@ -234,11 +234,11 @@ void packAll(Main *bmain, ReportList *reports) for(vf=bmain->vfont.first; vf; vf=vf->id.next) if(vf->packedfile == NULL && vf->id.lib==NULL && strcmp(vf->name, FO_BUILTIN_NAME) != 0) - vf->packedfile = newPackedFile(reports, vf->name); + vf->packedfile = newPackedFile(reports, vf->name, bmain->name); for(sound=bmain->sound.first; sound; sound=sound->id.next) if(sound->packedfile == NULL && sound->id.lib==NULL) - sound->packedfile = newPackedFile(reports, sound->name); + sound->packedfile = newPackedFile(reports, sound->name, bmain->name); } -- cgit v1.2.3 From 21eb8b92a0acaaeebfe54073de1f3fd076174d10 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 8 Oct 2011 11:11:54 +0000 Subject: use newly added ID_BLEND_PATH() in more places. --- source/blender/blenkernel/intern/customdata.c | 4 +--- source/blender/blenkernel/intern/image.c | 17 ++++------------- source/blender/blenkernel/intern/sound.c | 9 +-------- 3 files changed, 6 insertions(+), 24 deletions(-) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c index 30da2e01011..d407bbee602 100644 --- a/source/blender/blenkernel/intern/customdata.c +++ b/source/blender/blenkernel/intern/customdata.c @@ -2383,10 +2383,8 @@ int CustomData_verify_versions(struct CustomData *data, int index) static void customdata_external_filename(char filename[FILE_MAX], ID *id, CustomDataExternal *external) { - char *path = (id->lib)? id->lib->filepath: G.main->name; - BLI_strncpy(filename, external->filename, FILE_MAX); - BLI_path_abs(filename, path); + BLI_path_abs(filename, ID_BLEND_PATH(G.main, id)); } void CustomData_external_reload(CustomData *data, ID *UNUSED(id), CustomDataMask mask, int totelem) diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index 834961bf6e7..f6210d3a516 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -1653,10 +1653,7 @@ static ImBuf *image_load_sequence_file(Image *ima, ImageUser *iuser, int frame) BLI_stringdec(name, head, tail, &numlen); BLI_stringenc(name, head, tail, numlen, frame); - if(ima->id.lib) - BLI_path_abs(name, ima->id.lib->filepath); - else - BLI_path_abs(name, G.main->name); + BLI_path_abs(name, ID_BLEND_PATH(G.main, &ima->id)); flag= IB_rect|IB_multilayer; if(ima->flag & IMA_DO_PREMUL) @@ -1768,11 +1765,8 @@ static ImBuf *image_load_movie_file(Image *ima, ImageUser *iuser, int frame) char str[FILE_MAX]; BLI_strncpy(str, ima->name, FILE_MAX); - if(ima->id.lib) - BLI_path_abs(str, ima->id.lib->filepath); - else - BLI_path_abs(str, G.main->name); - + BLI_path_abs(str, ID_BLEND_PATH(G.main, &ima->id)); + /* FIXME: make several stream accessible in image editor, too*/ ima->anim = openanim(str, IB_rect, 0); @@ -1834,10 +1828,7 @@ static ImBuf *image_load_image_file(Image *ima, ImageUser *iuser, int cfra) /* get the right string */ BLI_strncpy(str, ima->name, sizeof(str)); - if(ima->id.lib) - BLI_path_abs(str, ima->id.lib->filepath); - else - BLI_path_abs(str, G.main->name); + BLI_path_abs(str, ID_BLEND_PATH(G.main, &ima->id)); /* read ibuf */ ibuf = IMB_loadiffname(str, flag); diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index 73d0d70778f..f2d92154c66 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -340,20 +340,13 @@ void sound_load(struct Main *bmain, struct bSound* sound) #endif { char fullpath[FILE_MAX]; - char *path; /* load sound */ PackedFile* pf = sound->packedfile; /* dont modify soundact->sound->name, only change a copy */ BLI_strncpy(fullpath, sound->name, sizeof(fullpath)); - - if(sound->id.lib) - path = sound->id.lib->filepath; - else - path = bmain->name; - - BLI_path_abs(fullpath, path); + BLI_path_abs(fullpath, ID_BLEND_PATH(bmain, &sound->id)); /* but we need a packed file then */ if (pf) -- cgit v1.2.3 From 8714fb7019e853703ce8b102edac43d84b7bbe14 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 9 Oct 2011 06:03:38 +0000 Subject: replace sprintf with strcpy where no formatting is done and return value isn't used. --- source/blender/blenkernel/intern/gpencil.c | 2 +- source/blender/blenkernel/intern/library.c | 4 ++-- source/blender/blenkernel/intern/nla.c | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c index c2e94cc97db..d56c9a63a91 100644 --- a/source/blender/blenkernel/intern/gpencil.c +++ b/source/blender/blenkernel/intern/gpencil.c @@ -182,7 +182,7 @@ bGPDlayer *gpencil_layer_addnew (bGPdata *gpd) gpl->thickness = 3; /* auto-name */ - sprintf(gpl->info, "GP_Layer"); + strcpy(gpl->info, "GP_Layer"); BLI_uniquename(&gpd->layers, gpl, "GP_Layer", '.', offsetof(bGPDlayer, info[0]), sizeof(gpl->info)); /* make this one the active one */ diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index 677a2922666..1dc53811fc0 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -941,9 +941,9 @@ static void get_flags_for_id(ID *id, char *buf) isnode= ((Tex *)id)->use_nodes; if (id->us<0) - sprintf(buf, "-1W "); + strcpy(buf, "-1W "); else if (!id->lib && !isfake && id->us && !isnode) - sprintf(buf, " "); + strcpy(buf, " "); else if(isnode) sprintf(buf, "%c%cN%c ", id->lib?'L':' ', isfake?'F':' ', (id->us==0)?'O':' '); else diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index 6ce80342dd6..9c5cf9f05fa 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -1284,16 +1284,16 @@ void BKE_nlastrip_validate_name (AnimData *adt, NlaStrip *strip) if (strip->name[0]==0) { switch (strip->type) { case NLASTRIP_TYPE_CLIP: /* act-clip */ - sprintf(strip->name, "%s", (strip->act)?(strip->act->id.name+2):("")); + BLI_strncpy(strip->name, (strip->act)?(strip->act->id.name+2):(""), sizeof(strip->name)); break; case NLASTRIP_TYPE_TRANSITION: /* transition */ - sprintf(strip->name, "Transition"); + BLI_strncpy(strip->name, "Transition", sizeof(strip->name)); break; case NLASTRIP_TYPE_META: /* meta */ - sprintf(strip->name, "Meta"); + BLI_strncpy(strip->name, "Meta", sizeof(strip->name)); break; default: - sprintf(strip->name, "NLA Strip"); + BLI_strncpy(strip->name, "NLA Strip", sizeof(strip->name)); break; } } -- cgit v1.2.3 From 7306eb84f07c92a5bced22f7f38dd7de1770c425 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 9 Oct 2011 21:11:51 +0000 Subject: move NavMesh draw code out of being a modifier and into DerivedMesh drawing hack (which IMHO is less bad then mis-using a modifier only to override drawing calls). --- source/blender/blenkernel/BKE_mesh.h | 2 + source/blender/blenkernel/CMakeLists.txt | 2 + source/blender/blenkernel/intern/DerivedMesh.c | 186 +++++++++++++++++++++++++ source/blender/blenkernel/intern/mesh.c | 16 +++ 4 files changed, 206 insertions(+) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/BKE_mesh.h b/source/blender/blenkernel/BKE_mesh.h index 95490b1aff6..052e18a98ea 100644 --- a/source/blender/blenkernel/BKE_mesh.h +++ b/source/blender/blenkernel/BKE_mesh.h @@ -161,6 +161,8 @@ int BKE_mesh_validate_dm(struct DerivedMesh *dm); void BKE_mesh_calc_edges(struct Mesh *mesh, int update); +void BKE_mesh_ensure_navmesh(struct Mesh *me); + #ifdef __cplusplus } #endif diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt index 91749143008..856810b048a 100644 --- a/source/blender/blenkernel/CMakeLists.txt +++ b/source/blender/blenkernel/CMakeLists.txt @@ -359,6 +359,8 @@ if(WITH_GAMEENGINE) intern/navmesh_conversion.c BKE_navmesh_conversion.h ) + + add_definitions(-DWITH_GAMEENGINE) endif() ## Warnings as errors, this is too strict! diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index 5e462238f31..9c90ec23d3c 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -62,6 +62,10 @@ #include "BKE_multires.h" #include "BKE_armature.h" +#ifdef WITH_GAMEENGINE +#include "BKE_navmesh_conversion.h" +#endif + #include "BLO_sys_types.h" // for intptr_t support #include "GL/glew.h" @@ -73,6 +77,8 @@ extern GLubyte stipple_quarttone[128]; /* glutil.c, bad level data */ +static DerivedMesh *navmesh_dm_createNavMeshForVisualization(DerivedMesh *dm); + /////////////////////////////////// /////////////////////////////////// @@ -2105,6 +2111,18 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos add_orco_dm(ob, NULL, *deform_r, NULL, CD_ORCO); } +#ifdef WITH_GAMEENGINE + /* NavMesh - this is a hack but saves having a NavMesh modifier */ + if (ob->body_type == OB_BODY_TYPE_NAVMESH && finaldm->type == DM_TYPE_CDDM) { + DerivedMesh *tdm; + tdm= navmesh_dm_createNavMeshForVisualization(finaldm); + if (finaldm != tdm) { + finaldm->release(finaldm); + finaldm= tdm; + } + } +#endif /* WITH_GAMEENGINE */ + *final_r = finaldm; if(orcodm) @@ -2939,3 +2957,171 @@ void DM_set_object_boundbox(Object *ob, DerivedMesh *dm) boundbox_set_from_min_max(ob->bb, min, max); } + +/* --- NAVMESH (begin) --- */ +#ifdef WITH_GAMEENGINE + +BM_INLINE int navmesh_bit(int a, int b) +{ + return (a & (1 << b)) >> b; +} + +BM_INLINE void navmesh_intToCol(int i, float* col) +{ + int r = navmesh_bit(i, 0) + navmesh_bit(i, 3) * 2 + 1; + int g = navmesh_bit(i, 1) + navmesh_bit(i, 4) * 2 + 1; + int b = navmesh_bit(i, 2) + navmesh_bit(i, 5) * 2 + 1; + col[0] = 1 - r*63.0f/255.0f; + col[1] = 1 - g*63.0f/255.0f; + col[2] = 1 - b*63.0f/255.0f; +} + +static void navmesh_drawColored(DerivedMesh *dm) +{ + int a, glmode; + MVert *mvert = (MVert *)CustomData_get_layer(&dm->vertData, CD_MVERT); + MFace *mface = (MFace *)CustomData_get_layer(&dm->faceData, CD_MFACE); + int* polygonIdx = (int*)CustomData_get_layer(&dm->faceData, CD_RECAST); + const float BLACK_COLOR[3] = {0.f, 0.f, 0.f}; + float col[3]; + + if (!polygonIdx) + return; + + /* + //UI_ThemeColor(TH_WIRE); + glDisable(GL_LIGHTING); + glLineWidth(2.0); + dm->drawEdges(dm, 0, 1); + glLineWidth(1.0); + glEnable(GL_LIGHTING);*/ + + glDisable(GL_LIGHTING); + if(GPU_buffer_legacy(dm) ) { + DEBUG_VBO( "Using legacy code. drawNavMeshColored\n" ); + //glShadeModel(GL_SMOOTH); + glBegin(glmode = GL_QUADS); + for(a = 0; a < dm->numFaceData; a++, mface++) { + int new_glmode = mface->v4?GL_QUADS:GL_TRIANGLES; + int polygonIdx = *(int*)CustomData_get(&dm->faceData, a, CD_RECAST); + if (polygonIdx<=0) + memcpy(col, BLACK_COLOR, 3*sizeof(float)); + else + navmesh_intToCol(polygonIdx, col); + + if(new_glmode != glmode) { + glEnd(); + glBegin(glmode = new_glmode); + } + glColor3fv(col); + glVertex3fv(mvert[mface->v1].co); + glVertex3fv(mvert[mface->v2].co); + glVertex3fv(mvert[mface->v3].co); + if(mface->v4) { + glVertex3fv(mvert[mface->v4].co); + } + } + glEnd(); + } + glEnable(GL_LIGHTING); +} + +static void navmesh_DM_drawFacesTex(DerivedMesh *dm, int (*setDrawOptions)(MTFace *tface, int has_mcol, int matnr)) +{ + (void) setDrawOptions; + + navmesh_drawColored(dm); +} + +static void navmesh_DM_drawFacesSolid(DerivedMesh *dm, + float (*partial_redraw_planes)[4], + int UNUSED(fast), int (*setMaterial)(int, void *attribs)) +{ + (void) partial_redraw_planes; + (void) setMaterial; + + //drawFacesSolid_original(dm, partial_redraw_planes, fast, setMaterial); + navmesh_drawColored(dm); +} + +static DerivedMesh *navmesh_dm_createNavMeshForVisualization(DerivedMesh *dm) +{ + DerivedMesh *result; + int maxFaces = dm->getNumFaces(dm); + int *recastData; + int vertsPerPoly=0, nverts=0, ndtris=0, npolys=0; + float* verts=NULL; + unsigned short *dtris=NULL, *dmeshes=NULL, *polys=NULL; + int *dtrisToPolysMap=NULL, *dtrisToTrisMap=NULL, *trisToFacesMap=NULL; + int res; + + result = CDDM_copy(dm); + if (!CustomData_has_layer(&result->faceData, CD_RECAST)) + { + int *sourceRecastData = (int*)CustomData_get_layer(&dm->faceData, CD_RECAST); + CustomData_add_layer_named(&result->faceData, CD_RECAST, CD_DUPLICATE, + sourceRecastData, maxFaces, "recastData"); + } + recastData = (int*)CustomData_get_layer(&result->faceData, CD_RECAST); + result->drawFacesTex = navmesh_DM_drawFacesTex; + result->drawFacesSolid = navmesh_DM_drawFacesSolid; + + + //process mesh + res = buildNavMeshDataByDerivedMesh(dm, &vertsPerPoly, &nverts, &verts, &ndtris, &dtris, + &npolys, &dmeshes, &polys, &dtrisToPolysMap, &dtrisToTrisMap, + &trisToFacesMap); + if (res) + { + size_t polyIdx; + + //invalidate concave polygon + for (polyIdx=0; polyIdx<(size_t)npolys; polyIdx++) + { + unsigned short* poly = &polys[polyIdx*2*vertsPerPoly]; + if (!polyIsConvex(poly, vertsPerPoly, verts)) + { + //set negative polygon idx to all faces + unsigned short *dmesh = &dmeshes[4*polyIdx]; + unsigned short tbase = dmesh[2]; + unsigned short tnum = dmesh[3]; + unsigned short ti; + + for (ti=0; ti0) + recastData[faceidx] = -recastData[faceidx]; + } + } + } + + } + else + { + printf("Error during creation polygon infos\n"); + } + + //clean up + if (verts!=NULL) + MEM_freeN(verts); + if (dtris!=NULL) + MEM_freeN(dtris); + if (dmeshes!=NULL) + MEM_freeN(dmeshes); + if (polys!=NULL) + MEM_freeN(polys); + if (dtrisToPolysMap!=NULL) + MEM_freeN(dtrisToPolysMap); + if (dtrisToTrisMap!=NULL) + MEM_freeN(dtrisToTrisMap); + if (trisToFacesMap!=NULL) + MEM_freeN(trisToFacesMap); + + return result; +} + +#endif /* WITH_GAMEENGINE */ + +/* --- NAVMESH (end) --- */ diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index 810e7c285e8..2c7653b6e1c 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -1606,3 +1606,19 @@ void mesh_translate(Mesh *me, float offset[3], int do_keys) } } } + + +void BKE_mesh_ensure_navmesh(Mesh *me) +{ + if (!CustomData_has_layer(&me->fdata, CD_RECAST)) { + int i; + int numFaces = me->totface; + int* recastData; + CustomData_add_layer_named(&me->fdata, CD_RECAST, CD_CALLOC, NULL, numFaces, "recastData"); + recastData = (int*)CustomData_get_layer(&me->fdata, CD_RECAST); + for (i=0; ifdata, CD_RECAST, CD_REFERENCE, recastData, numFaces, "recastData"); + } +} -- cgit v1.2.3 From 17b66b46ad3a09e948ec8143e394d1d9df6df6d6 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 9 Oct 2011 21:43:13 +0000 Subject: fix crash for recent navmesh edits when setting a non-mesh object to a navmesh. also minor cleanup. --- source/blender/blenkernel/CMakeLists.txt | 2 +- source/blender/blenkernel/intern/DerivedMesh.c | 44 ++++++++++++-------------- 2 files changed, 21 insertions(+), 25 deletions(-) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt index 856810b048a..bfadff06400 100644 --- a/source/blender/blenkernel/CMakeLists.txt +++ b/source/blender/blenkernel/CMakeLists.txt @@ -353,7 +353,7 @@ endif() if(WITH_GAMEENGINE) list(APPEND INC_SYS - ../../../extern/recastnavigation + ../../../extern/recastnavigation ) list(APPEND SRC intern/navmesh_conversion.c diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index 9c90ec23d3c..6b9a65ddfa2 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -2113,7 +2113,7 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos #ifdef WITH_GAMEENGINE /* NavMesh - this is a hack but saves having a NavMesh modifier */ - if (ob->body_type == OB_BODY_TYPE_NAVMESH && finaldm->type == DM_TYPE_CDDM) { + if ((ob->gameflag & OB_NAVMESH) && (finaldm->type == DM_TYPE_CDDM)) { DerivedMesh *tdm; tdm= navmesh_dm_createNavMeshForVisualization(finaldm); if (finaldm != tdm) { @@ -2966,7 +2966,7 @@ BM_INLINE int navmesh_bit(int a, int b) return (a & (1 << b)) >> b; } -BM_INLINE void navmesh_intToCol(int i, float* col) +static void navmesh_intToCol(int i, float* col) { int r = navmesh_bit(i, 0) + navmesh_bit(i, 3) * 2 + 1; int g = navmesh_bit(i, 1) + navmesh_bit(i, 4) * 2 + 1; @@ -3034,8 +3034,8 @@ static void navmesh_DM_drawFacesTex(DerivedMesh *dm, int (*setDrawOptions)(MTFac } static void navmesh_DM_drawFacesSolid(DerivedMesh *dm, - float (*partial_redraw_planes)[4], - int UNUSED(fast), int (*setMaterial)(int, void *attribs)) + float (*partial_redraw_planes)[4], + int UNUSED(fast), int (*setMaterial)(int, void *attribs)) { (void) partial_redraw_planes; (void) setMaterial; @@ -3056,54 +3056,50 @@ static DerivedMesh *navmesh_dm_createNavMeshForVisualization(DerivedMesh *dm) int res; result = CDDM_copy(dm); - if (!CustomData_has_layer(&result->faceData, CD_RECAST)) - { + if (!CustomData_has_layer(&result->faceData, CD_RECAST)) { int *sourceRecastData = (int*)CustomData_get_layer(&dm->faceData, CD_RECAST); CustomData_add_layer_named(&result->faceData, CD_RECAST, CD_DUPLICATE, sourceRecastData, maxFaces, "recastData"); } recastData = (int*)CustomData_get_layer(&result->faceData, CD_RECAST); + + /* note: This is not good design! - really should not be doing this */ result->drawFacesTex = navmesh_DM_drawFacesTex; result->drawFacesSolid = navmesh_DM_drawFacesSolid; - //process mesh + /* process mesh */ res = buildNavMeshDataByDerivedMesh(dm, &vertsPerPoly, &nverts, &verts, &ndtris, &dtris, - &npolys, &dmeshes, &polys, &dtrisToPolysMap, &dtrisToTrisMap, - &trisToFacesMap); - if (res) - { + &npolys, &dmeshes, &polys, &dtrisToPolysMap, &dtrisToTrisMap, + &trisToFacesMap); + if (res) { size_t polyIdx; - //invalidate concave polygon - for (polyIdx=0; polyIdx<(size_t)npolys; polyIdx++) - { + /* invalidate concave polygon */ + for (polyIdx=0; polyIdx<(size_t)npolys; polyIdx++) { unsigned short* poly = &polys[polyIdx*2*vertsPerPoly]; - if (!polyIsConvex(poly, vertsPerPoly, verts)) - { - //set negative polygon idx to all faces + if (!polyIsConvex(poly, vertsPerPoly, verts)) { + /* set negative polygon idx to all faces */ unsigned short *dmesh = &dmeshes[4*polyIdx]; unsigned short tbase = dmesh[2]; unsigned short tnum = dmesh[3]; unsigned short ti; - for (ti=0; ti0) + if (recastData[faceidx] > 0) { recastData[faceidx] = -recastData[faceidx]; + } } } } - } - else - { + else { printf("Error during creation polygon infos\n"); } - //clean up + /* clean up */ if (verts!=NULL) MEM_freeN(verts); if (dtris!=NULL) -- cgit v1.2.3 From 39c4e3ae3c9668f8d5b3ba1e901b824a747db02e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 9 Oct 2011 23:04:31 +0000 Subject: fix for editmode opengl drawing (bug from own recent optimization), need to set glShadeModel() outside glBegin(GL_QUADS / GL_TRIANGLES). --- source/blender/blenkernel/intern/DerivedMesh.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index 6b9a65ddfa2..e46ea1bbe38 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -697,9 +697,11 @@ static void emDM_drawMappedFaces(DerivedMesh *dm, int (*setDrawOptions)(void *us else { const GLenum shade_type= drawSmooth ? GL_SMOOTH : GL_FLAT; if (shade_type != shade_prev) { - glShadeModel((shade_prev= shade_type)); + if(poly_prev != GL_ZERO) glEnd(); + glShadeModel((shade_prev= shade_type)); /* same as below but switch shading */ + glBegin((poly_prev= poly_type)); } - if(poly_type != poly_prev) { + else if(poly_type != poly_prev) { if(poly_prev != GL_ZERO) glEnd(); glBegin((poly_prev= poly_type)); } @@ -762,9 +764,11 @@ static void emDM_drawMappedFaces(DerivedMesh *dm, int (*setDrawOptions)(void *us else { const GLenum shade_type= drawSmooth ? GL_SMOOTH : GL_FLAT; if (shade_type != shade_prev) { - glShadeModel((shade_prev= shade_type)); + if(poly_prev != GL_ZERO) glEnd(); + glShadeModel((shade_prev= shade_type)); /* same as below but switch shading */ + glBegin((poly_prev= poly_type)); } - if(poly_type != poly_prev) { + else if(poly_type != poly_prev) { if(poly_prev != GL_ZERO) glEnd(); glBegin((poly_prev= poly_type)); } -- cgit v1.2.3 From 7b3ea6cc2caf1df9c510a97a3272924f1a51a768 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 10 Oct 2011 00:01:44 +0000 Subject: mesh VBO drawing code was swapping red/blue vertex colors - this is confusing because MCol.r is blue and MCol.b is red but not excuse! (and how come nobody noticed this?). - fixed this error in 4 places. --- source/blender/blenkernel/intern/cdderivedmesh.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c index 707bf95f9c3..0b5fd939580 100644 --- a/source/blender/blenkernel/intern/cdderivedmesh.c +++ b/source/blender/blenkernel/intern/cdderivedmesh.c @@ -756,9 +756,10 @@ static void cdDM_drawFacesTex_common(DerivedMesh *dm, unsigned char *colors = MEM_mallocN(dm->getNumFaces(dm)*4*3*sizeof(unsigned char), "cdDM_drawFacesTex_common"); for( i=0; i < dm->getNumFaces(dm); i++ ) { for( j=0; j < 4; j++ ) { - colors[i*12+j*3] = col[i*4+j].r; + /* bgr -> rgb is intentional (and stupid), but how its stored internally */ + colors[i*12+j*3] = col[i*4+j].b; colors[i*12+j*3+1] = col[i*4+j].g; - colors[i*12+j*3+2] = col[i*4+j].b; + colors[i*12+j*3+2] = col[i*4+j].r; } } GPU_color3_upload(dm,colors); -- cgit v1.2.3 From f0cd9f987de21ce7f32c6ccdf47d0e91fe73c39e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 10 Oct 2011 02:56:26 +0000 Subject: - for some reason navmesh wasnt drawing when VBO was enabled. - fix navmesh crash (may well have been from own changes) - changing VBO's now redraws all windows - useful for checking if VBO draws differently. --- source/blender/blenkernel/intern/DerivedMesh.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index e46ea1bbe38..53973608cd6 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -3001,7 +3001,7 @@ static void navmesh_drawColored(DerivedMesh *dm) glEnable(GL_LIGHTING);*/ glDisable(GL_LIGHTING); - if(GPU_buffer_legacy(dm) ) { + /* if(GPU_buffer_legacy(dm) ) */ { /* TODO - VBO draw code, not high priority - campbell */ DEBUG_VBO( "Using legacy code. drawNavMeshColored\n" ); //glShadeModel(GL_SMOOTH); glBegin(glmode = GL_QUADS); @@ -3062,8 +3062,10 @@ static DerivedMesh *navmesh_dm_createNavMeshForVisualization(DerivedMesh *dm) result = CDDM_copy(dm); if (!CustomData_has_layer(&result->faceData, CD_RECAST)) { int *sourceRecastData = (int*)CustomData_get_layer(&dm->faceData, CD_RECAST); - CustomData_add_layer_named(&result->faceData, CD_RECAST, CD_DUPLICATE, - sourceRecastData, maxFaces, "recastData"); + if (sourceRecastData) { + CustomData_add_layer_named(&result->faceData, CD_RECAST, CD_DUPLICATE, + sourceRecastData, maxFaces, "recastData"); + } } recastData = (int*)CustomData_get_layer(&result->faceData, CD_RECAST); -- cgit v1.2.3 From 2de1bd7dc568d30edd8656cb221720dc0d881f4f Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 10 Oct 2011 07:21:42 +0000 Subject: updates to navmesh - 2 new navmesh operators, reset and clear navmesh data. - rename operators to be more consistent with existing names. - some minor edits to draw function, was getting the custom data for every index when it already had the array. --- source/blender/blenkernel/intern/DerivedMesh.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index 53973608cd6..bc6492f92ae 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -2970,7 +2970,7 @@ BM_INLINE int navmesh_bit(int a, int b) return (a & (1 << b)) >> b; } -static void navmesh_intToCol(int i, float* col) +BM_INLINE void navmesh_intToCol(int i, float col[3]) { int r = navmesh_bit(i, 0) + navmesh_bit(i, 3) * 2 + 1; int g = navmesh_bit(i, 1) + navmesh_bit(i, 4) * 2 + 1; @@ -2985,8 +2985,7 @@ static void navmesh_drawColored(DerivedMesh *dm) int a, glmode; MVert *mvert = (MVert *)CustomData_get_layer(&dm->vertData, CD_MVERT); MFace *mface = (MFace *)CustomData_get_layer(&dm->faceData, CD_MFACE); - int* polygonIdx = (int*)CustomData_get_layer(&dm->faceData, CD_RECAST); - const float BLACK_COLOR[3] = {0.f, 0.f, 0.f}; + int *polygonIdx = (int *)CustomData_get_layer(&dm->faceData, CD_RECAST); float col[3]; if (!polygonIdx) @@ -3007,11 +3006,13 @@ static void navmesh_drawColored(DerivedMesh *dm) glBegin(glmode = GL_QUADS); for(a = 0; a < dm->numFaceData; a++, mface++) { int new_glmode = mface->v4?GL_QUADS:GL_TRIANGLES; - int polygonIdx = *(int*)CustomData_get(&dm->faceData, a, CD_RECAST); - if (polygonIdx<=0) - memcpy(col, BLACK_COLOR, 3*sizeof(float)); - else - navmesh_intToCol(polygonIdx, col); + int pi = polygonIdx[a]; + if (pi <= 0) { + zero_v3(col); + } + else { + navmesh_intToCol(pi, col); + } if(new_glmode != glmode) { glEnd(); -- cgit v1.2.3 From bc40f110932b8d63d226cc370d380a5edf16234a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 10 Oct 2011 09:38:02 +0000 Subject: header cleanup (no functional changes) --- source/blender/blenkernel/BKE_action.h | 2 + source/blender/blenkernel/BKE_anim.h | 2 + source/blender/blenkernel/BKE_animsys.h | 2 + source/blender/blenkernel/BKE_armature.h | 2 + source/blender/blenkernel/BKE_bullet.h | 1 - source/blender/blenkernel/BKE_cdderivedmesh.h | 54 ++++++++--------- source/blender/blenkernel/BKE_customdata.h | 54 ++++++++--------- source/blender/blenkernel/BKE_displist.h | 2 +- source/blender/blenkernel/BKE_icons.h | 55 +++++++++-------- source/blender/blenkernel/BKE_mesh.h | 4 +- source/blender/blenkernel/BKE_navmesh_conversion.h | 56 +++++++++--------- source/blender/blenkernel/BKE_nla.h | 2 + source/blender/blenkernel/BKE_paint.h | 2 + source/blender/blenkernel/BKE_pointcache.h | 53 ++++++++--------- source/blender/blenkernel/BKE_shrinkwrap.h | 2 + source/blender/blenkernel/BKE_subsurf.h | 3 +- source/blender/blenkernel/BKE_suggestions.h | 2 +- source/blender/blenkernel/BKE_unit.h | 1 + source/blender/blenkernel/BKE_writeffmpeg.h | 2 + source/blender/blenkernel/BKE_writeframeserver.h | 2 + source/blender/blenkernel/intern/CCGSubSurf.c | 3 +- source/blender/blenkernel/intern/CCGSubSurf.h | 3 +- source/blender/blenkernel/intern/action.c | 2 + source/blender/blenkernel/intern/anim.c | 4 +- source/blender/blenkernel/intern/anim_sys.c | 2 + source/blender/blenkernel/intern/armature.c | 2 + source/blender/blenkernel/intern/blender.c | 5 +- source/blender/blenkernel/intern/bmfont.c | 6 +- source/blender/blenkernel/intern/boids.c | 4 +- source/blender/blenkernel/intern/bullet.c | 3 +- source/blender/blenkernel/intern/bvhutils.c | 1 - source/blender/blenkernel/intern/cdderivedmesh.c | 66 ++++++++++----------- source/blender/blenkernel/intern/colortools.c | 2 +- source/blender/blenkernel/intern/constraint.c | 2 + source/blender/blenkernel/intern/curve.c | 5 +- source/blender/blenkernel/intern/customdata.c | 64 ++++++++++---------- source/blender/blenkernel/intern/deform.c | 9 +-- source/blender/blenkernel/intern/displist.c | 4 +- source/blender/blenkernel/intern/effect.c | 4 +- source/blender/blenkernel/intern/fcurve.c | 2 + source/blender/blenkernel/intern/fmodifier.c | 2 + source/blender/blenkernel/intern/font.c | 4 +- source/blender/blenkernel/intern/gpencil.c | 2 + source/blender/blenkernel/intern/icons.c | 56 +++++++++--------- source/blender/blenkernel/intern/image.c | 3 +- source/blender/blenkernel/intern/image_gen.c | 3 +- source/blender/blenkernel/intern/ipo.c | 4 +- source/blender/blenkernel/intern/key.c | 5 +- source/blender/blenkernel/intern/lattice.c | 3 - source/blender/blenkernel/intern/material.c | 5 +- source/blender/blenkernel/intern/mball.c | 16 +++-- source/blender/blenkernel/intern/mesh.c | 6 +- source/blender/blenkernel/intern/modifier.c | 68 +++++++++++----------- .../blender/blenkernel/intern/navmesh_conversion.c | 60 ++++++++++--------- source/blender/blenkernel/intern/nla.c | 2 + source/blender/blenkernel/intern/object.c | 4 +- source/blender/blenkernel/intern/packedFile.c | 2 - source/blender/blenkernel/intern/particle.c | 4 +- source/blender/blenkernel/intern/particle_system.c | 4 +- source/blender/blenkernel/intern/property.c | 7 +-- source/blender/blenkernel/intern/scene.c | 4 +- source/blender/blenkernel/intern/script.c | 6 +- source/blender/blenkernel/intern/seqcache.c | 2 +- source/blender/blenkernel/intern/sequencer.c | 2 +- source/blender/blenkernel/intern/sketch.c | 1 - source/blender/blenkernel/intern/smoke.c | 2 - source/blender/blenkernel/intern/softbody.c | 3 +- source/blender/blenkernel/intern/speaker.c | 4 +- source/blender/blenkernel/intern/text.c | 4 +- source/blender/blenkernel/intern/texture.c | 4 +- source/blender/blenkernel/intern/world.c | 5 +- source/blender/blenkernel/intern/writeavi.c | 7 +-- source/blender/blenkernel/intern/writeffmpeg.c | 7 ++- .../blender/blenkernel/intern/writeframeserver.c | 7 ++- 74 files changed, 393 insertions(+), 421 deletions(-) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/BKE_action.h b/source/blender/blenkernel/BKE_action.h index 67efb7752ea..f2fc4afca13 100644 --- a/source/blender/blenkernel/BKE_action.h +++ b/source/blender/blenkernel/BKE_action.h @@ -1,4 +1,6 @@ /* + * $Id: + * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or diff --git a/source/blender/blenkernel/BKE_anim.h b/source/blender/blenkernel/BKE_anim.h index 44aebdf6205..07b6f284025 100644 --- a/source/blender/blenkernel/BKE_anim.h +++ b/source/blender/blenkernel/BKE_anim.h @@ -1,4 +1,6 @@ /* + * $Id: + * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or diff --git a/source/blender/blenkernel/BKE_animsys.h b/source/blender/blenkernel/BKE_animsys.h index 98f9ee14c7e..92a9c3d6810 100644 --- a/source/blender/blenkernel/BKE_animsys.h +++ b/source/blender/blenkernel/BKE_animsys.h @@ -1,4 +1,6 @@ /* + * $Id: + * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or diff --git a/source/blender/blenkernel/BKE_armature.h b/source/blender/blenkernel/BKE_armature.h index 8836999bc9b..a12997c1259 100644 --- a/source/blender/blenkernel/BKE_armature.h +++ b/source/blender/blenkernel/BKE_armature.h @@ -1,4 +1,6 @@ /* + * $Id: + * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or diff --git a/source/blender/blenkernel/BKE_bullet.h b/source/blender/blenkernel/BKE_bullet.h index 76358c4485b..2756ded3a08 100644 --- a/source/blender/blenkernel/BKE_bullet.h +++ b/source/blender/blenkernel/BKE_bullet.h @@ -1,5 +1,4 @@ /* - * * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/blenkernel/BKE_cdderivedmesh.h b/source/blender/blenkernel/BKE_cdderivedmesh.h index 1edec2b69d9..07158f5f3fa 100644 --- a/source/blender/blenkernel/BKE_cdderivedmesh.h +++ b/source/blender/blenkernel/BKE_cdderivedmesh.h @@ -1,31 +1,31 @@ /* -* $Id$ -* -* ***** BEGIN GPL LICENSE BLOCK ***** -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License -* as published by the Free Software Foundation; either version 2 -* of the License, or (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software Foundation, -* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -* -* The Original Code is Copyright (C) 2006 Blender Foundation. -* All rights reserved. -* -* The Original Code is: all of this file. -* -* Contributor(s): Ben Batt -* -* ***** END GPL LICENSE BLOCK ***** -*/ + * $Id$ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * The Original Code is Copyright (C) 2006 Blender Foundation. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): Ben Batt + * + * ***** END GPL LICENSE BLOCK ***** + */ /** \file BKE_cdderivedmesh.h * \ingroup bke diff --git a/source/blender/blenkernel/BKE_customdata.h b/source/blender/blenkernel/BKE_customdata.h index c30100ea55a..4eb8e5a8d96 100644 --- a/source/blender/blenkernel/BKE_customdata.h +++ b/source/blender/blenkernel/BKE_customdata.h @@ -1,31 +1,31 @@ /* -* $Id$ -* -* ***** BEGIN GPL LICENSE BLOCK ***** -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License -* as published by the Free Software Foundation; either version 2 -* of the License, or (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software Foundation, -* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -* -* The Original Code is Copyright (C) 2006 Blender Foundation. -* All rights reserved. -* -* The Original Code is: all of this file. -* -* Contributor(s): Ben Batt -* -* ***** END GPL LICENSE BLOCK ***** -*/ + * $Id$ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * The Original Code is Copyright (C) 2006 Blender Foundation. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): Ben Batt + * + * ***** END GPL LICENSE BLOCK ***** + */ /** \file BKE_customdata.h * \ingroup bke diff --git a/source/blender/blenkernel/BKE_displist.h b/source/blender/blenkernel/BKE_displist.h index b00db53a199..1eed0aaca00 100644 --- a/source/blender/blenkernel/BKE_displist.h +++ b/source/blender/blenkernel/BKE_displist.h @@ -1,5 +1,5 @@ /* - $Id$ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/blenkernel/BKE_icons.h b/source/blender/blenkernel/BKE_icons.h index 3c12a5d615d..9f7d4aeb0d3 100644 --- a/source/blender/blenkernel/BKE_icons.h +++ b/source/blender/blenkernel/BKE_icons.h @@ -1,32 +1,31 @@ /* -* $Id$ -* -* ***** BEGIN GPL LICENSE BLOCK ***** -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License -* as published by the Free Software Foundation; either version 2 -* of the License, or (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software Foundation, -* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -* -* The Original Code is Copyright (C) 2006-2007 Blender Foundation. -* All rights reserved. -* -* The Original Code is: all of this file. -* -* Contributor(s): none yet. -* -* ***** END GPL LICENSE BLOCK ***** -* -*/ + * $Id$ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * The Original Code is Copyright (C) 2006-2007 Blender Foundation. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + */ #ifndef BKE_ICONS_H #define BKE_ICONS_H diff --git a/source/blender/blenkernel/BKE_mesh.h b/source/blender/blenkernel/BKE_mesh.h index 052e18a98ea..347263bb290 100644 --- a/source/blender/blenkernel/BKE_mesh.h +++ b/source/blender/blenkernel/BKE_mesh.h @@ -1,6 +1,4 @@ /* - * blenlib/BKE_mesh.h (mar-2001 nzc) - * * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -24,7 +22,7 @@ * * The Original Code is: all of this file. * - * Contributor(s): none yet. + * Contributor(s): (mar-2001 nzc) * * ***** END GPL LICENSE BLOCK ***** */ diff --git a/source/blender/blenkernel/BKE_navmesh_conversion.h b/source/blender/blenkernel/BKE_navmesh_conversion.h index 01d32321c81..1880e1e6728 100644 --- a/source/blender/blenkernel/BKE_navmesh_conversion.h +++ b/source/blender/blenkernel/BKE_navmesh_conversion.h @@ -1,31 +1,31 @@ -/** -* $Id$ -* -* ***** BEGIN GPL LICENSE BLOCK ***** -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License -* as published by the Free Software Foundation; either version 2 -* of the License, or (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software Foundation, -* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -* -* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. -* All rights reserved. -* -* The Original Code is: all of this file. -* -* Contributor(s): none yet. -* -* ***** END GPL LICENSE BLOCK ***** -*/ +/* + * $Id$ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + */ #ifndef BKE_NAVMESH_CONVERSION_H #define BKE_NAVMESH_CONVERSION_H diff --git a/source/blender/blenkernel/BKE_nla.h b/source/blender/blenkernel/BKE_nla.h index 773c5ced1cb..1fc817bfa6c 100644 --- a/source/blender/blenkernel/BKE_nla.h +++ b/source/blender/blenkernel/BKE_nla.h @@ -1,4 +1,6 @@ /* + * $Id: + * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h index 2578a90808a..97cd6196015 100644 --- a/source/blender/blenkernel/BKE_paint.h +++ b/source/blender/blenkernel/BKE_paint.h @@ -1,4 +1,6 @@ /* + * $Id: + * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or diff --git a/source/blender/blenkernel/BKE_pointcache.h b/source/blender/blenkernel/BKE_pointcache.h index 346368a5958..a028f5d119b 100644 --- a/source/blender/blenkernel/BKE_pointcache.h +++ b/source/blender/blenkernel/BKE_pointcache.h @@ -1,30 +1,31 @@ /* -* -* ***** BEGIN GPL LICENSE BLOCK ***** -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License -* as published by the Free Software Foundation; either version 2 -* of the License, or (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software Foundation, -* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -* -* The Original Code is Copyright (C) 2006 Blender Foundation. -* All rights reserved. -* -* The Original Code is: all of this file. -* -* Contributor(s): Campbell Barton -* -* ***** END GPL LICENSE BLOCK ***** -*/ + * $Id: + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * The Original Code is Copyright (C) 2006 Blender Foundation. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): Campbell Barton + * + * ***** END GPL LICENSE BLOCK ***** + */ #ifndef BKE_POINTCACHE_H #define BKE_POINTCACHE_H diff --git a/source/blender/blenkernel/BKE_shrinkwrap.h b/source/blender/blenkernel/BKE_shrinkwrap.h index d1fef8b0ce1..bb8dfebcec2 100644 --- a/source/blender/blenkernel/BKE_shrinkwrap.h +++ b/source/blender/blenkernel/BKE_shrinkwrap.h @@ -1,4 +1,6 @@ /* + * $Id: + * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or diff --git a/source/blender/blenkernel/BKE_subsurf.h b/source/blender/blenkernel/BKE_subsurf.h index a400c1e27b9..30142c12601 100644 --- a/source/blender/blenkernel/BKE_subsurf.h +++ b/source/blender/blenkernel/BKE_subsurf.h @@ -1,4 +1,5 @@ -/* $Id$ +/* + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/blenkernel/BKE_suggestions.h b/source/blender/blenkernel/BKE_suggestions.h index e215cabd70f..c684271cbbf 100644 --- a/source/blender/blenkernel/BKE_suggestions.h +++ b/source/blender/blenkernel/BKE_suggestions.h @@ -1,4 +1,4 @@ -/* +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/blenkernel/BKE_unit.h b/source/blender/blenkernel/BKE_unit.h index 0a3e56c8cba..17d594a2445 100644 --- a/source/blender/blenkernel/BKE_unit.h +++ b/source/blender/blenkernel/BKE_unit.h @@ -1,4 +1,5 @@ /* + * $Id: * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/blenkernel/BKE_writeffmpeg.h b/source/blender/blenkernel/BKE_writeffmpeg.h index 2b10f1b246c..3342960d7a4 100644 --- a/source/blender/blenkernel/BKE_writeffmpeg.h +++ b/source/blender/blenkernel/BKE_writeffmpeg.h @@ -1,4 +1,6 @@ /* + * $Id: + * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or diff --git a/source/blender/blenkernel/BKE_writeframeserver.h b/source/blender/blenkernel/BKE_writeframeserver.h index 2117a23b938..d9d2c37c3d4 100644 --- a/source/blender/blenkernel/BKE_writeframeserver.h +++ b/source/blender/blenkernel/BKE_writeframeserver.h @@ -1,4 +1,6 @@ /* + * $Id: + * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or diff --git a/source/blender/blenkernel/intern/CCGSubSurf.c b/source/blender/blenkernel/intern/CCGSubSurf.c index a311ca15e5e..bf9acb224d5 100644 --- a/source/blender/blenkernel/intern/CCGSubSurf.c +++ b/source/blender/blenkernel/intern/CCGSubSurf.c @@ -1,7 +1,8 @@ +/* $Id$ */ + /** \file blender/blenkernel/intern/CCGSubSurf.c * \ingroup bke */ -/* $Id$ */ #include #include diff --git a/source/blender/blenkernel/intern/CCGSubSurf.h b/source/blender/blenkernel/intern/CCGSubSurf.h index 363d1e01f98..1835e63727d 100644 --- a/source/blender/blenkernel/intern/CCGSubSurf.h +++ b/source/blender/blenkernel/intern/CCGSubSurf.h @@ -1,7 +1,8 @@ +/* $Id$ */ + /** \file blender/blenkernel/intern/CCGSubSurf.h * \ingroup bke */ -/* $Id$ */ typedef void* CCGMeshHDL; typedef void* CCGVertHDL; diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c index 8d18a1c27e7..93dffe0986a 100644 --- a/source/blender/blenkernel/intern/action.c +++ b/source/blender/blenkernel/intern/action.c @@ -1,4 +1,6 @@ /* + * $Id: + * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c index 3accceb5464..3d7ec60805f 100644 --- a/source/blender/blenkernel/intern/anim.c +++ b/source/blender/blenkernel/intern/anim.c @@ -1,4 +1,6 @@ -/* +/* + * $Id: + * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index 13abf18e20c..994862dd6c8 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -1,4 +1,6 @@ /* + * $Id: + * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c index 1149d8eee25..f065c87d5c7 100644 --- a/source/blender/blenkernel/intern/armature.c +++ b/source/blender/blenkernel/intern/armature.c @@ -1,4 +1,6 @@ /* + * $Id: + * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c index 1c729470da4..5358a26e660 100644 --- a/source/blender/blenkernel/intern/blender.c +++ b/source/blender/blenkernel/intern/blender.c @@ -1,7 +1,4 @@ -/* blender.c jan 94 MIXED MODEL - * - * common help functions and data - * +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/blenkernel/intern/bmfont.c b/source/blender/blenkernel/intern/bmfont.c index 6b1f313d88d..d73d7509644 100644 --- a/source/blender/blenkernel/intern/bmfont.c +++ b/source/blender/blenkernel/intern/bmfont.c @@ -1,8 +1,4 @@ /* - * bmfont.c - * - * 04-10-2000 frank - * * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -26,7 +22,7 @@ * * The Original Code is: all of this file. * - * Contributor(s): none yet. + * Contributor(s): 04-10-2000 frank. * * ***** END GPL LICENSE BLOCK ***** * diff --git a/source/blender/blenkernel/intern/boids.c b/source/blender/blenkernel/intern/boids.c index f9f210fbae4..2a478d4ffe2 100644 --- a/source/blender/blenkernel/intern/boids.c +++ b/source/blender/blenkernel/intern/boids.c @@ -1,6 +1,4 @@ -/* boids.c - * - * +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/blenkernel/intern/bullet.c b/source/blender/blenkernel/intern/bullet.c index 72f5e907800..e4a02434cba 100644 --- a/source/blender/blenkernel/intern/bullet.c +++ b/source/blender/blenkernel/intern/bullet.c @@ -1,5 +1,4 @@ -/* - * +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/blenkernel/intern/bvhutils.c b/source/blender/blenkernel/intern/bvhutils.c index c3aeb440938..2ce6b92922d 100644 --- a/source/blender/blenkernel/intern/bvhutils.c +++ b/source/blender/blenkernel/intern/bvhutils.c @@ -1,5 +1,4 @@ /* - * * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c index 0b5fd939580..4d37d8e0606 100644 --- a/source/blender/blenkernel/intern/cdderivedmesh.c +++ b/source/blender/blenkernel/intern/cdderivedmesh.c @@ -1,41 +1,41 @@ /* -* $Id$ -* -* ***** BEGIN GPL LICENSE BLOCK ***** -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License -* as published by the Free Software Foundation; either version 2 -* of the License, or (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software Foundation, -* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -* -* The Original Code is Copyright (C) 2006 Blender Foundation. -* All rights reserved. -* -* The Original Code is: all of this file. -* -* Contributor(s): Ben Batt -* -* ***** END GPL LICENSE BLOCK ***** -* -* Implementation of CDDerivedMesh. -* -* BKE_cdderivedmesh.h contains the function prototypes for this file. -* -*/ + * $Id$ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * The Original Code is Copyright (C) 2006 Blender Foundation. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): Ben Batt + * + * ***** END GPL LICENSE BLOCK ***** + * + * Implementation of CDDerivedMesh. + * + * BKE_cdderivedmesh.h contains the function prototypes for this file. + * + */ /** \file blender/blenkernel/intern/cdderivedmesh.c * \ingroup bke */ - + #include "GL/glew.h" #include "BLI_blenlib.h" diff --git a/source/blender/blenkernel/intern/colortools.c b/source/blender/blenkernel/intern/colortools.c index 7e92a09ce99..83003809a37 100644 --- a/source/blender/blenkernel/intern/colortools.c +++ b/source/blender/blenkernel/intern/colortools.c @@ -1,4 +1,4 @@ -/* +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index 75e137bc9fb..dff32dbbe8c 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -1,4 +1,6 @@ /* + * $Id: + * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c index c69ced86a6c..2e9ad11c6ca 100644 --- a/source/blender/blenkernel/intern/curve.c +++ b/source/blender/blenkernel/intern/curve.c @@ -1,7 +1,4 @@ - -/* curve.c - * - * +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c index d407bbee602..7d98119610b 100644 --- a/source/blender/blenkernel/intern/customdata.c +++ b/source/blender/blenkernel/intern/customdata.c @@ -1,36 +1,36 @@ /* -* $Id$ -* -* ***** BEGIN GPL LICENSE BLOCK ***** -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License -* as published by the Free Software Foundation; either version 2 -* of the License, or (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software Foundation, -* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -* -* The Original Code is Copyright (C) 2006 Blender Foundation. -* All rights reserved. -* -* The Original Code is: all of this file. -* -* Contributor(s): Ben Batt -* -* ***** END GPL LICENSE BLOCK ***** -* -* Implementation of CustomData. -* -* BKE_customdata.h contains the function prototypes for this file. -* -*/ + * $Id$ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * The Original Code is Copyright (C) 2006 Blender Foundation. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): Ben Batt + * + * ***** END GPL LICENSE BLOCK ***** + * + * Implementation of CustomData. + * + * BKE_customdata.h contains the function prototypes for this file. + * + */ /** \file blender/blenkernel/intern/customdata.c * \ingroup bke diff --git a/source/blender/blenkernel/intern/deform.c b/source/blender/blenkernel/intern/deform.c index 11a0a5884ee..f18f533d460 100644 --- a/source/blender/blenkernel/intern/deform.c +++ b/source/blender/blenkernel/intern/deform.c @@ -1,9 +1,4 @@ -/* deform.c June 2001 - * - * support for deformation groups - * - * Reevan McKay - * +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -27,7 +22,7 @@ * * The Original Code is: all of this file. * - * Contributor(s): none yet. + * Contributor(s): Reevan McKay * * ***** END GPL LICENSE BLOCK ***** */ diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c index 6704d06be52..fb67c07cfe9 100644 --- a/source/blender/blenkernel/intern/displist.c +++ b/source/blender/blenkernel/intern/displist.c @@ -1,6 +1,4 @@ -/* displist.c - * - * +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c index 7fb9f96e0cf..5ce7b82a45f 100644 --- a/source/blender/blenkernel/intern/effect.c +++ b/source/blender/blenkernel/intern/effect.c @@ -1,6 +1,4 @@ -/* effect.c - * - * +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c index 8ea80ae9296..1aa352b4ad8 100644 --- a/source/blender/blenkernel/intern/fcurve.c +++ b/source/blender/blenkernel/intern/fcurve.c @@ -1,4 +1,6 @@ /* + * $Id: + * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or diff --git a/source/blender/blenkernel/intern/fmodifier.c b/source/blender/blenkernel/intern/fmodifier.c index 95c0aa60991..b1e5af4f7cc 100644 --- a/source/blender/blenkernel/intern/fmodifier.c +++ b/source/blender/blenkernel/intern/fmodifier.c @@ -1,4 +1,6 @@ /* + * $Id: + * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c index c82aa855a7b..4c8d0cf998d 100644 --- a/source/blender/blenkernel/intern/font.c +++ b/source/blender/blenkernel/intern/font.c @@ -1,6 +1,4 @@ -/* font.c - * - * +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c index d56c9a63a91..4a54fdfd63d 100644 --- a/source/blender/blenkernel/intern/gpencil.c +++ b/source/blender/blenkernel/intern/gpencil.c @@ -1,4 +1,6 @@ /* + * $Id: + * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or diff --git a/source/blender/blenkernel/intern/icons.c b/source/blender/blenkernel/intern/icons.c index 9effd25c142..07bb4666134 100644 --- a/source/blender/blenkernel/intern/icons.c +++ b/source/blender/blenkernel/intern/icons.c @@ -1,32 +1,32 @@ /* -* $Id$ -* -* ***** BEGIN GPL LICENSE BLOCK ***** -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License -* as published by the Free Software Foundation; either version 2 -* of the License, or (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software Foundation, -* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -* -* The Original Code is Copyright (C) 2006-2007 Blender Foundation. -* All rights reserved. -* -* The Original Code is: all of this file. -* -* Contributor(s): none yet. -* -* ***** END GPL LICENSE BLOCK ***** -* -*/ + * $Id$ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * The Original Code is Copyright (C) 2006-2007 Blender Foundation. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + * + */ /** \file blender/blenkernel/intern/icons.c * \ingroup bke diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index f6210d3a516..cf8f96c143a 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -1,5 +1,4 @@ -/* image.c - * +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/blenkernel/intern/image_gen.c b/source/blender/blenkernel/intern/image_gen.c index 5b237665290..f4d1ff4241d 100644 --- a/source/blender/blenkernel/intern/image_gen.c +++ b/source/blender/blenkernel/intern/image_gen.c @@ -1,5 +1,4 @@ -/* image_gen.c - * +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c index b885e608b15..8578402765b 100644 --- a/source/blender/blenkernel/intern/ipo.c +++ b/source/blender/blenkernel/intern/ipo.c @@ -1,4 +1,6 @@ -/* +/* + * $Id: + * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or diff --git a/source/blender/blenkernel/intern/key.c b/source/blender/blenkernel/intern/key.c index 656bb3ef853..9e48e691b87 100644 --- a/source/blender/blenkernel/intern/key.c +++ b/source/blender/blenkernel/intern/key.c @@ -1,7 +1,4 @@ - -/* key.c - * - * +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/blenkernel/intern/lattice.c b/source/blender/blenkernel/intern/lattice.c index 094214858f9..cbff9c2337e 100644 --- a/source/blender/blenkernel/intern/lattice.c +++ b/source/blender/blenkernel/intern/lattice.c @@ -1,7 +1,4 @@ /* - * lattice.c - * - * * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index a763941cfe9..ed9be989dbd 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -1,7 +1,4 @@ - -/* material.c - * - * +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c index 555d35726bc..05d07ddf918 100644 --- a/source/blender/blenkernel/intern/mball.c +++ b/source/blender/blenkernel/intern/mball.c @@ -1,11 +1,4 @@ -/* mball.c - * - * MetaBalls are created from a single Object (with a name without number in it), - * here the DispList and BoundBox also is located. - * All objects with the same name (but with a number in it) are added to this. - * - * texture coordinates are patched within the displist - * +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -30,13 +23,18 @@ * Contributor(s): Jiri Hnidek . * * ***** END GPL LICENSE BLOCK ***** + * + * MetaBalls are created from a single Object (with a name without number in it), + * here the DispList and BoundBox also is located. + * All objects with the same name (but with a number in it) are added to this. + * + * texture coordinates are patched within the displist */ /** \file blender/blenkernel/intern/mball.c * \ingroup bke */ - #include #include #include diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index 2c7653b6e1c..9574c886ccc 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -1,8 +1,4 @@ - -/* mesh.c - * - * - * +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index fe26c0ccd2d..9de75a49998 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -1,38 +1,38 @@ /* -* $Id$ -* -* ***** BEGIN GPL LICENSE BLOCK ***** -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License -* as published by the Free Software Foundation; either version 2 -* of the License, or (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software Foundation, -* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -* -* The Original Code is Copyright (C) 2005 by the Blender Foundation. -* All rights reserved. -* -* Contributor(s): Daniel Dunbar -* Ton Roosendaal, -* Ben Batt, -* Brecht Van Lommel, -* Campbell Barton -* -* ***** END GPL LICENSE BLOCK ***** -* -* Modifier stack implementation. -* -* BKE_modifier.h contains the function prototypes for this file. -* -*/ + * $Id$ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * The Original Code is Copyright (C) 2005 by the Blender Foundation. + * All rights reserved. + * + * Contributor(s): Daniel Dunbar + * Ton Roosendaal, + * Ben Batt, + * Brecht Van Lommel, + * Campbell Barton + * + * ***** END GPL LICENSE BLOCK ***** + * + * Modifier stack implementation. + * + * BKE_modifier.h contains the function prototypes for this file. + * + */ /** \file blender/blenkernel/intern/modifier.c * \ingroup bke diff --git a/source/blender/blenkernel/intern/navmesh_conversion.c b/source/blender/blenkernel/intern/navmesh_conversion.c index 04f6ff19564..f670486484b 100644 --- a/source/blender/blenkernel/intern/navmesh_conversion.c +++ b/source/blender/blenkernel/intern/navmesh_conversion.c @@ -1,31 +1,35 @@ -/** -* $Id$ -* -* ***** BEGIN GPL LICENSE BLOCK ***** -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License -* as published by the Free Software Foundation; either version 2 -* of the License, or (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software Foundation, -* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -* -* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. -* All rights reserved. -* -* The Original Code is: all of this file. -* -* Contributor(s): none yet. -* -* ***** END GPL LICENSE BLOCK ***** -*/ +/* + * $Id$ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +/** \file blender/blenkernel/intern/navmesh_conversion.c + * \ingroup bke + */ #include #include diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index 9c5cf9f05fa..4f34093e345 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -1,4 +1,6 @@ /* + * $Id: + * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 81a31c83e95..2b6db72bd07 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -1,6 +1,4 @@ -/* object.c - * - * +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/blenkernel/intern/packedFile.c b/source/blender/blenkernel/intern/packedFile.c index 4bc40bde949..2c8975e9cb4 100644 --- a/source/blender/blenkernel/intern/packedFile.c +++ b/source/blender/blenkernel/intern/packedFile.c @@ -1,6 +1,4 @@ /* - * blenkernel/packedFile.c - (cleaned up mar-01 nzc) - * * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index 06fb2d3927c..806a7871948 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -1,6 +1,4 @@ -/* particle.c - * - * +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index c0f1e3dd697..6b601ed4b1a 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -1,6 +1,4 @@ -/* particle_system.c - * - * +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/blenkernel/intern/property.c b/source/blender/blenkernel/intern/property.c index d0e4832889b..cdf2e39a4dd 100644 --- a/source/blender/blenkernel/intern/property.c +++ b/source/blender/blenkernel/intern/property.c @@ -1,7 +1,4 @@ - -/* property.c june 2000 - * - * ton roosendaal +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -25,7 +22,7 @@ * * The Original Code is: all of this file. * - * Contributor(s): none yet. + * Contributor(s): ton roosendaal * * ***** END GPL LICENSE BLOCK ***** */ diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 1a72405ad5e..5ea635d8c30 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -1,6 +1,4 @@ -/* scene.c - * - * +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/blenkernel/intern/script.c b/source/blender/blenkernel/intern/script.c index 77153fc37ba..77a79a6c8a4 100644 --- a/source/blender/blenkernel/intern/script.c +++ b/source/blender/blenkernel/intern/script.c @@ -1,10 +1,6 @@ -/* blenkernel/script.c - * - * +/* * $Id$ * - * Function(s) related to struct script management. - * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or diff --git a/source/blender/blenkernel/intern/seqcache.c b/source/blender/blenkernel/intern/seqcache.c index 00f88fb6202..88e9d9209d4 100644 --- a/source/blender/blenkernel/intern/seqcache.c +++ b/source/blender/blenkernel/intern/seqcache.c @@ -1,5 +1,5 @@ /* -* $Id$ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 08848c35add..5a2c53f5b9b 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -1,5 +1,5 @@ /* -* $Id$ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/blenkernel/intern/sketch.c b/source/blender/blenkernel/intern/sketch.c index 432dc9ec609..a5afc0afda1 100644 --- a/source/blender/blenkernel/intern/sketch.c +++ b/source/blender/blenkernel/intern/sketch.c @@ -1,5 +1,4 @@ /* - * * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c index 6ab1574ca80..85140841f15 100644 --- a/source/blender/blenkernel/intern/smoke.c +++ b/source/blender/blenkernel/intern/smoke.c @@ -1,6 +1,4 @@ /* - * smoke.c - * * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c index 784c67d6d77..88f72c33802 100644 --- a/source/blender/blenkernel/intern/softbody.c +++ b/source/blender/blenkernel/intern/softbody.c @@ -1,5 +1,4 @@ -/* softbody.c - * +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/blenkernel/intern/speaker.c b/source/blender/blenkernel/intern/speaker.c index 200dbd41899..ae29230423f 100644 --- a/source/blender/blenkernel/intern/speaker.c +++ b/source/blender/blenkernel/intern/speaker.c @@ -1,6 +1,4 @@ -/* speaker.c - * - * +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c index 02cffcec249..b5fc76a8551 100644 --- a/source/blender/blenkernel/intern/text.c +++ b/source/blender/blenkernel/intern/text.c @@ -1,6 +1,4 @@ -/* text.c - * - * +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c index ea6f6eb702b..d344f79bb6c 100644 --- a/source/blender/blenkernel/intern/texture.c +++ b/source/blender/blenkernel/intern/texture.c @@ -1,6 +1,4 @@ -/* texture.c - * - * +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/blenkernel/intern/world.c b/source/blender/blenkernel/intern/world.c index d413177873f..7d278f37cfb 100644 --- a/source/blender/blenkernel/intern/world.c +++ b/source/blender/blenkernel/intern/world.c @@ -1,7 +1,4 @@ - -/* world.c - * - * +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/blenkernel/intern/writeavi.c b/source/blender/blenkernel/intern/writeavi.c index 769a3f9b11e..b989d44c391 100644 --- a/source/blender/blenkernel/intern/writeavi.c +++ b/source/blender/blenkernel/intern/writeavi.c @@ -1,7 +1,4 @@ /* - * Functions for writing avi-format files. - * Added interface for generic movie support (ton) - * * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -28,7 +25,9 @@ * Contributor(s): Robert Wenzlaff * * ***** END GPL LICENSE BLOCK ***** - * + * + * Functions for writing avi-format files. + * Added interface for generic movie support (ton) */ /** \file blender/blenkernel/intern/writeavi.c diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c index 425af0272a3..58a2f45e876 100644 --- a/source/blender/blenkernel/intern/writeffmpeg.c +++ b/source/blender/blenkernel/intern/writeffmpeg.c @@ -1,6 +1,3 @@ -/** \file blender/blenkernel/intern/writeffmpeg.c - * \ingroup bke - */ /* * $Id$ * @@ -20,6 +17,10 @@ * */ +/** \file blender/blenkernel/intern/writeffmpeg.c + * \ingroup bke + */ + #ifdef WITH_FFMPEG #include #include diff --git a/source/blender/blenkernel/intern/writeframeserver.c b/source/blender/blenkernel/intern/writeframeserver.c index 15cb3b66db7..d42b952617f 100644 --- a/source/blender/blenkernel/intern/writeframeserver.c +++ b/source/blender/blenkernel/intern/writeframeserver.c @@ -1,6 +1,3 @@ -/** \file blender/blenkernel/intern/writeframeserver.c - * \ingroup bke - */ /* * $Id$ * @@ -22,6 +19,10 @@ * */ +/** \file blender/blenkernel/intern/writeframeserver.c + * \ingroup bke + */ + #ifdef WITH_FRAMESERVER #include -- cgit v1.2.3 From 54adf3de62ef5ff6859bad922b179badb7689880 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 10 Oct 2011 09:44:14 +0000 Subject: fix bad svn ID tags --- source/blender/blenkernel/BKE_action.h | 2 +- source/blender/blenkernel/BKE_anim.h | 2 +- source/blender/blenkernel/BKE_animsys.h | 2 +- source/blender/blenkernel/BKE_armature.h | 2 +- source/blender/blenkernel/BKE_nla.h | 2 +- source/blender/blenkernel/BKE_paint.h | 2 +- source/blender/blenkernel/BKE_pointcache.h | 2 +- source/blender/blenkernel/BKE_shrinkwrap.h | 2 +- source/blender/blenkernel/BKE_unit.h | 2 +- source/blender/blenkernel/BKE_writeffmpeg.h | 2 +- source/blender/blenkernel/BKE_writeframeserver.h | 2 +- source/blender/blenkernel/intern/action.c | 2 +- source/blender/blenkernel/intern/anim.c | 2 +- source/blender/blenkernel/intern/anim_sys.c | 2 +- source/blender/blenkernel/intern/armature.c | 2 +- source/blender/blenkernel/intern/constraint.c | 2 +- source/blender/blenkernel/intern/fcurve.c | 2 +- source/blender/blenkernel/intern/fmodifier.c | 2 +- source/blender/blenkernel/intern/gpencil.c | 2 +- source/blender/blenkernel/intern/ipo.c | 2 +- source/blender/blenkernel/intern/nla.c | 2 +- 21 files changed, 21 insertions(+), 21 deletions(-) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/BKE_action.h b/source/blender/blenkernel/BKE_action.h index f2fc4afca13..7d3de68c005 100644 --- a/source/blender/blenkernel/BKE_action.h +++ b/source/blender/blenkernel/BKE_action.h @@ -1,5 +1,5 @@ /* - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/blenkernel/BKE_anim.h b/source/blender/blenkernel/BKE_anim.h index 07b6f284025..da389c6f1d0 100644 --- a/source/blender/blenkernel/BKE_anim.h +++ b/source/blender/blenkernel/BKE_anim.h @@ -1,5 +1,5 @@ /* - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/blenkernel/BKE_animsys.h b/source/blender/blenkernel/BKE_animsys.h index 92a9c3d6810..bf619d76e68 100644 --- a/source/blender/blenkernel/BKE_animsys.h +++ b/source/blender/blenkernel/BKE_animsys.h @@ -1,5 +1,5 @@ /* - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/blenkernel/BKE_armature.h b/source/blender/blenkernel/BKE_armature.h index a12997c1259..a0660490baf 100644 --- a/source/blender/blenkernel/BKE_armature.h +++ b/source/blender/blenkernel/BKE_armature.h @@ -1,5 +1,5 @@ /* - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/blenkernel/BKE_nla.h b/source/blender/blenkernel/BKE_nla.h index 1fc817bfa6c..49c1f8acd24 100644 --- a/source/blender/blenkernel/BKE_nla.h +++ b/source/blender/blenkernel/BKE_nla.h @@ -1,5 +1,5 @@ /* - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h index 97cd6196015..f8463bab55f 100644 --- a/source/blender/blenkernel/BKE_paint.h +++ b/source/blender/blenkernel/BKE_paint.h @@ -1,5 +1,5 @@ /* - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/blenkernel/BKE_pointcache.h b/source/blender/blenkernel/BKE_pointcache.h index a028f5d119b..fcfa6ccf9f4 100644 --- a/source/blender/blenkernel/BKE_pointcache.h +++ b/source/blender/blenkernel/BKE_pointcache.h @@ -1,5 +1,5 @@ /* - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/blenkernel/BKE_shrinkwrap.h b/source/blender/blenkernel/BKE_shrinkwrap.h index bb8dfebcec2..9deb71a3474 100644 --- a/source/blender/blenkernel/BKE_shrinkwrap.h +++ b/source/blender/blenkernel/BKE_shrinkwrap.h @@ -1,5 +1,5 @@ /* - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/blenkernel/BKE_unit.h b/source/blender/blenkernel/BKE_unit.h index 17d594a2445..269941597b0 100644 --- a/source/blender/blenkernel/BKE_unit.h +++ b/source/blender/blenkernel/BKE_unit.h @@ -1,5 +1,5 @@ /* - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/blenkernel/BKE_writeffmpeg.h b/source/blender/blenkernel/BKE_writeffmpeg.h index 3342960d7a4..8345f0f5d2e 100644 --- a/source/blender/blenkernel/BKE_writeffmpeg.h +++ b/source/blender/blenkernel/BKE_writeffmpeg.h @@ -1,5 +1,5 @@ /* - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/blenkernel/BKE_writeframeserver.h b/source/blender/blenkernel/BKE_writeframeserver.h index d9d2c37c3d4..8b2022076bb 100644 --- a/source/blender/blenkernel/BKE_writeframeserver.h +++ b/source/blender/blenkernel/BKE_writeframeserver.h @@ -1,5 +1,5 @@ /* - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c index 93dffe0986a..8b9f5ac98d3 100644 --- a/source/blender/blenkernel/intern/action.c +++ b/source/blender/blenkernel/intern/action.c @@ -1,5 +1,5 @@ /* - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c index 3d7ec60805f..cd2c272a1c2 100644 --- a/source/blender/blenkernel/intern/anim.c +++ b/source/blender/blenkernel/intern/anim.c @@ -1,5 +1,5 @@ /* - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index 994862dd6c8..3cf14fa45ab 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -1,5 +1,5 @@ /* - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c index f065c87d5c7..fbbce58414e 100644 --- a/source/blender/blenkernel/intern/armature.c +++ b/source/blender/blenkernel/intern/armature.c @@ -1,5 +1,5 @@ /* - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index dff32dbbe8c..591e0b6a8d2 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -1,5 +1,5 @@ /* - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c index 1aa352b4ad8..e2326b005c1 100644 --- a/source/blender/blenkernel/intern/fcurve.c +++ b/source/blender/blenkernel/intern/fcurve.c @@ -1,5 +1,5 @@ /* - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/blenkernel/intern/fmodifier.c b/source/blender/blenkernel/intern/fmodifier.c index b1e5af4f7cc..d5c54893128 100644 --- a/source/blender/blenkernel/intern/fmodifier.c +++ b/source/blender/blenkernel/intern/fmodifier.c @@ -1,5 +1,5 @@ /* - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c index 4a54fdfd63d..06ca7b7b509 100644 --- a/source/blender/blenkernel/intern/gpencil.c +++ b/source/blender/blenkernel/intern/gpencil.c @@ -1,5 +1,5 @@ /* - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c index 8578402765b..91f3c7a22ba 100644 --- a/source/blender/blenkernel/intern/ipo.c +++ b/source/blender/blenkernel/intern/ipo.c @@ -1,5 +1,5 @@ /* - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index 4f34093e345..97347d85deb 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -1,5 +1,5 @@ /* - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * -- cgit v1.2.3 From fa5275cdfa136dd81a15cd2d37f8dadf77f7bcee Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 11 Oct 2011 04:09:11 +0000 Subject: - bpy.path.abspath(), added optional library argument since any paths from linked datablocks are relative to this, not the blend files path, this saves kludgy path code wherever libraries may be used. - Image "Edit Externally" operator can now edit relative library images. also minor edits to navmesh. --- source/blender/blenkernel/intern/DerivedMesh.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index bc6492f92ae..c379111ccfd 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -64,6 +64,7 @@ #ifdef WITH_GAMEENGINE #include "BKE_navmesh_conversion.h" +static DerivedMesh *navmesh_dm_createNavMeshForVisualization(DerivedMesh *dm); #endif #include "BLO_sys_types.h" // for intptr_t support @@ -77,8 +78,6 @@ extern GLubyte stipple_quarttone[128]; /* glutil.c, bad level data */ -static DerivedMesh *navmesh_dm_createNavMeshForVisualization(DerivedMesh *dm); - /////////////////////////////////// /////////////////////////////////// -- cgit v1.2.3 From 4750f24663cc4077861de80a38dcd21af781f30d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 11 Oct 2011 23:08:17 +0000 Subject: fix for crash caused by invalid active material index while editing text. also added some better error checking in object_remove_material_slot() so it will print an error rather then crashing if this case ever happens again. --- source/blender/blenkernel/intern/font.c | 2 +- source/blender/blenkernel/intern/material.c | 19 +++++++++++++------ 2 files changed, 14 insertions(+), 7 deletions(-) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c index 4c8d0cf998d..9c01b35b91a 100644 --- a/source/blender/blenkernel/intern/font.c +++ b/source/blender/blenkernel/intern/font.c @@ -546,7 +546,7 @@ static void buildchar(Main *bmain, Curve *cu, unsigned long character, CharInfo nu2->knotsu = nu2->knotsv = NULL; nu2->flag= CU_SMOOTH; nu2->charidx = charidx; - if (info->mat_nr) { + if (info->mat_nr > 0) { nu2->mat_nr= info->mat_nr-1; } else { diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index ed9be989dbd..ebd05ab9bf8 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -1105,8 +1105,17 @@ int object_remove_material_slot(Object *ob) short *totcolp; short a, actcol; - if(ob==NULL || ob->totcol==0) return FALSE; - + if (ob==NULL || ob->totcol==0) { + return FALSE; + } + + /* this should never happen and used to crash */ + if (ob->actcol <= 0) { + printf("%s: invalid material index %d, report a bug!\n", __func__, ob->actcol); + BLI_assert(0); + return FALSE; + } + /* take a mesh/curve/mball as starting point, remove 1 index, * AND with all objects that share the ob->data * @@ -1119,10 +1128,8 @@ int object_remove_material_slot(Object *ob) if(*matarar==NULL) return FALSE; /* we delete the actcol */ - if(ob->totcol) { - mao= (*matarar)[ob->actcol-1]; - if(mao) mao->id.us--; - } + mao= (*matarar)[ob->actcol-1]; + if(mao) mao->id.us--; for(a=ob->actcol; atotcol; a++) (*matarar)[a-1]= (*matarar)[a]; -- cgit v1.2.3 From 03c72a5ba0fd29542eced2276f63241d3b8cd572 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 13 Oct 2011 04:06:32 +0000 Subject: ensure grease pencil layer names are unique when set through rna. --- source/blender/blenkernel/intern/gpencil.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c index 06ca7b7b509..fa493315d4b 100644 --- a/source/blender/blenkernel/intern/gpencil.c +++ b/source/blender/blenkernel/intern/gpencil.c @@ -185,7 +185,7 @@ bGPDlayer *gpencil_layer_addnew (bGPdata *gpd) /* auto-name */ strcpy(gpl->info, "GP_Layer"); - BLI_uniquename(&gpd->layers, gpl, "GP_Layer", '.', offsetof(bGPDlayer, info[0]), sizeof(gpl->info)); + BLI_uniquename(&gpd->layers, gpl, "GP_Layer", '.', offsetof(bGPDlayer, info), sizeof(gpl->info)); /* make this one the active one */ gpencil_layer_setactive(gpd, gpl); -- cgit v1.2.3