diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-10-10 00:26:56 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-10-10 00:26:56 +0400 |
commit | 855885425c2efd17859fb94d421140d27a100aba (patch) | |
tree | 78503cb036710c4efc5242ddd1a6bc73c19efb58 | |
parent | 92ddc03126dfa706d693575323bff1bbceb1bfcb (diff) | |
parent | 9d70e050a27ce4700e0e16dd120c343bd5ecc2a6 (diff) |
Merging r40848 through r40876 from trunk into soc-2011-tomato
39 files changed, 264 insertions, 251 deletions
diff --git a/po/update_msg.py b/po/update_msg.py index ca19e036637..5986d96f14b 100644 --- a/po/update_msg.py +++ b/po/update_msg.py @@ -123,8 +123,10 @@ def dump_messages_rna(messages): continue msgsrc = "bpy.types.%s.%s" % (bl_rna.identifier, prop.identifier) - messages.setdefault(prop.name, []).append(msgsrc) - messages.setdefault(prop.description, []).append(msgsrc) + if prop.name and prop.name != prop.identifier: + messages.setdefault(prop.name, []).append(msgsrc) + if prop.description: + messages.setdefault(prop.description, []).append(msgsrc) if isinstance(prop, bpy.types.EnumProperty): for item in prop.enum_items: @@ -132,8 +134,11 @@ def dump_messages_rna(messages): prop.identifier, item.identifier, ) - messages.setdefault(item.name, []).append(msgsrc) - messages.setdefault(item.description, []).append(msgsrc) + # Here identifier and name can be the same! + if item.name: # and item.name != item.identifier: + messages.setdefault(item.name, []).append(msgsrc) + if item.description: + messages.setdefault(item.description, []).append(msgsrc) def walkRNA(bl_rna): diff --git a/release/scripts/startup/bl_operators/object_align.py b/release/scripts/startup/bl_operators/object_align.py index 50e9bfb5b98..dd052c36ade 100644 --- a/release/scripts/startup/bl_operators/object_align.py +++ b/release/scripts/startup/bl_operators/object_align.py @@ -140,7 +140,7 @@ def align_objects(align_x, for obj, bb_world in objs: - if bb_quality: + if bb_quality and obj.type == 'MESH': GBB = GlobalBB_HQ(obj) else: GBB = GlobalBB_LQ(bb_world) @@ -204,7 +204,7 @@ def align_objects(align_x, matrix_world = obj.matrix_world.copy() bb_world = [matrix_world * Vector(v[:]) for v in obj.bound_box] - if bb_quality: + if bb_quality and obj.type == 'MESH': GBB = GlobalBB_HQ(obj) else: GBB = GlobalBB_LQ(bb_world) diff --git a/release/scripts/startup/keyingsets_builtins.py b/release/scripts/startup/keyingsets_builtins.py index 6b12c95e072..c7922a0dfa1 100644 --- a/release/scripts/startup/keyingsets_builtins.py +++ b/release/scripts/startup/keyingsets_builtins.py @@ -353,14 +353,26 @@ class BUILTIN_KSI_WholeCharacter(KeyingSetInfo): # custom properties def doCustomProps(ksi, ks, bone): + + prop_type_compat = {bpy.types.BooleanProperty, + bpy.types.IntProperty, + bpy.types.FloatProperty} + # go over all custom properties for bone - for prop, val in bone.items(): + for prop in bone.keys(): # ignore special "_RNA_UI" used for UI editing if prop == "_RNA_UI": continue # for now, just add all of 'em - ksi.addProp(ks, bone, '["%s"]' % (prop)) + prop_rna = type(bone).bl_rna.properties.get(prop, None) + if prop_rna is None: + prop_path = '["%s"]' % prop + if bone.path_resolve(prop_path, False).rna_type in prop_type_compat: + ksi.addProp(ks, bone, prop_path) + elif prop_rna.is_animatable: + ksi.addProp(ks, bone, prop) + ############################### 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/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/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/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/image.c b/source/blender/blenkernel/intern/image.c index d764826cd47..f6210d3a516 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; @@ -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); @@ -1860,7 +1851,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/library.c b/source/blender/blenkernel/intern/library.c index 8377d71447c..c0812e9a746 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -952,9 +952,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):("<No Action>")); + BLI_strncpy(strip->name, (strip->act)?(strip->act->id.name+2):("<No Action>"), 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; } } 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); } 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) diff --git a/source/blender/blenlib/intern/winstuff.c b/source/blender/blenlib/intern/winstuff.c index bf816a91fb3..3b14abb0bee 100644 --- a/source/blender/blenlib/intern/winstuff.c +++ b/source/blender/blenlib/intern/winstuff.c @@ -109,7 +109,7 @@ void RegisterBlendExtension(void) { lresult = RegCreateKeyEx(root, "blendfile", 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hkey, &dwd); if (lresult == ERROR_SUCCESS) { - sprintf(buffer,"%s","Blender File"); + strcpy(buffer,"Blender File"); lresult = RegSetValueEx(hkey, NULL, 0, REG_SZ, (BYTE*)buffer, strlen(buffer) + 1); RegCloseKey(hkey); } diff --git a/source/blender/editors/animation/anim_draw.c b/source/blender/editors/animation/anim_draw.c index d2b1fcc4abd..2774bd2cda4 100644 --- a/source/blender/editors/animation/anim_draw.c +++ b/source/blender/editors/animation/anim_draw.c @@ -71,12 +71,12 @@ void ANIM_timecode_string_from_frame (char *str, Scene *scene, int power, short if (timecodes) { int hours=0, minutes=0, seconds=0, frames=0; float raw_seconds= cfra; - char neg[2]= ""; + char neg[2]= {'\0'}; /* get cframes */ if (cfra < 0) { /* correction for negative cfraues */ - sprintf(neg, "-"); + neg[0]= '-'; cfra = -cfra; } if (cfra >= 3600) { diff --git a/source/blender/editors/animation/anim_ipo_utils.c b/source/blender/editors/animation/anim_ipo_utils.c index 9c43671cdf4..383e0bac796 100644 --- a/source/blender/editors/animation/anim_ipo_utils.c +++ b/source/blender/editors/animation/anim_ipo_utils.c @@ -63,9 +63,9 @@ int getname_anim_fcurve(char *name, ID *id, FCurve *fcu) return icon; else if ELEM3(NULL, id, fcu, fcu->rna_path) { if (fcu == NULL) - sprintf(name, "<invalid>"); + strcpy(name, "<invalid>"); else if (fcu->rna_path == NULL) - sprintf(name, "<no path>"); + strcpy(name, "<no path>"); else /* id == NULL */ BLI_snprintf(name, 256, "%s[%d]", fcu->rna_path, fcu->array_index); } diff --git a/source/blender/editors/curve/editfont.c b/source/blender/editors/curve/editfont.c index fcac070f84e..d8257c524c1 100644 --- a/source/blender/editors/curve/editfont.c +++ b/source/blender/editors/curve/editfont.c @@ -259,6 +259,7 @@ static int insert_into_textbuf(Object *obedit, uintptr_t c) static void text_update_edited(bContext *C, Scene *scene, Object *obedit, int recalc, int mode) { + struct Main *bmain= CTX_data_main(C); Curve *cu= obedit->data; EditFont *ef= cu->editfont; cu->curinfo = ef->textbufinfo[cu->pos?cu->pos-1:0]; @@ -269,7 +270,7 @@ static void text_update_edited(bContext *C, Scene *scene, Object *obedit, int re if(mode == FO_EDIT) update_string(cu); - BKE_text_to_curve(scene, obedit, mode); + BKE_text_to_curve(bmain, scene, obedit, mode); if(recalc) DAG_id_tag_update(obedit->data, 0); @@ -928,9 +929,10 @@ static int move_cursor(bContext *C, int type, int select) if(select == 0) { if(cu->selstart) { + struct Main *bmain= CTX_data_main(C); cu->selstart = cu->selend = 0; update_string(cu); - BKE_text_to_curve(scene, obedit, FO_SELCHANGE); + BKE_text_to_curve(bmain, scene, obedit, FO_SELCHANGE); } } @@ -1644,13 +1646,14 @@ static int open_cancel(bContext *UNUSED(C), wmOperator *op) static int open_exec(bContext *C, wmOperator *op) { + struct Main *bmain= CTX_data_main(C); VFont *font; PropertyPointerRNA *pprop; PointerRNA idptr; char filepath[FILE_MAX]; RNA_string_get(op->ptr, "filepath", filepath); - font= load_vfont(filepath); + font= load_vfont(bmain, filepath); if(!font) { if(op->customdata) MEM_freeN(op->customdata); diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 72925dd9c3a..b2e5fc9c2ae 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -1318,12 +1318,12 @@ static void ui_textedit_set_cursor_pos(uiBut *but, uiHandleButtonData *data, sho } /* mouse inside the widget */ else if (x >= startx) { - float aspect= (but->block->aspect); + const float aspect_sqrt= sqrtf(but->block->aspect); but->pos= strlen(origstr)-but->ofs; /* XXX does not take zoom level into account */ - while (startx + aspect*BLF_width(fstyle->uifont_id, origstr+but->ofs) > x) { + while (startx + aspect_sqrt * BLF_width(fstyle->uifont_id, origstr+but->ofs) > x) { if (but->pos <= 0) break; but->pos--; origstr[but->pos+but->ofs] = 0; @@ -1379,133 +1379,115 @@ static int ui_textedit_type_ascii(uiBut *but, uiHandleButtonData *data, char asc return changed; } -static void ui_textedit_move(uiBut *but, uiHandleButtonData *data, int direction, int select, int jump) +static void ui_textedit_move(uiBut *but, uiHandleButtonData *data, int direction, int select, int jump, int jump_all) { - char *str; - int len; + const char *str= data->str; + const int len= strlen(str); + const int pos_prev= but->pos; + const int has_sel= (but->selend - but->selsta) > 0; - str= data->str; - len= strlen(str); - - if(direction) { /* right*/ - /* if there's a selection */ - if ((but->selend - but->selsta) > 0) { - /* extend the selection based on the first direction taken */ - if(select) { - if (!data->selextend) { - data->selextend = EXTEND_RIGHT; - } - if (data->selextend == EXTEND_RIGHT) { - but->selend++; - if (but->selend > len) but->selend = len; - } else if (data->selextend == EXTEND_LEFT) { - but->selsta++; - /* if the selection start has gone past the end, - * flip them so they're in sync again */ - if (but->selsta == but->selend) { - but->pos = but->selsta; - data->selextend = EXTEND_RIGHT; - } - } - } else { + /* special case, quit selection and set cursor */ + if (has_sel && !select) { + if (jump_all) { + but->selsta = but->selend= but->pos = direction ? len : 0; + } + else { + if (direction) { but->selsta = but->pos = but->selend; - data->selextend = 0; } - } else { - if(select) { - /* make a selection, starting from the cursor position */ - int tlen; - but->selsta = but->pos; - - but->pos++; - if(but->pos > (tlen= strlen(str))) but->pos= tlen; - - but->selend = but->pos; - } else if(jump) { - /* jump betweenn special characters (/,\,_,-, etc.), + else { + but->pos = but->selend = but->selsta; + } + } + data->selextend = 0; + } + else { + if(direction) { /* right*/ + if(jump) { + /* jump between special characters (/,\,_,-, etc.), * look at function test_special_char() for complete * list of special character, ctr -> */ while(but->pos < len) { but->pos++; - if(test_special_char(str[but->pos])) break; + if(!jump_all && test_special_char(str[but->pos])) break; } - } else { - int tlen; + } + else { but->pos++; - if(but->pos > (tlen= strlen(str))) but->pos= tlen; + if(but->pos > len) but->pos= len; } } - } - else { /* left */ - /* if there's a selection */ - if ((but->selend - but->selsta) > 0) { - /* extend the selection based on the first direction taken */ - if(select) { - if (!data->selextend) { - data->selextend = EXTEND_LEFT; - } - if (data->selextend == EXTEND_LEFT) { - but->selsta--; - if (but->selsta < 0) but->selsta = 0; - } else if (data->selextend == EXTEND_RIGHT) { - but->selend--; - /* if the selection start has gone past the end, - * flip them so they're in sync again */ - if (but->selsta == but->selend) { - but->pos = but->selsta; - data->selextend = EXTEND_LEFT; - } + else { /* left */ + if(jump) { + + /* left only: compensate for index/change in direction */ + if(but->pos > 0) { + but->pos--; } - } else { - but->pos = but->selend = but->selsta; - data->selextend = 0; - } - } else { - if(select) { - /* make a selection, starting from the cursor position */ - but->selend = but->pos; - - but->pos--; - if(but->pos<0) but->pos= 0; - - but->selsta = but->pos; - } else if(jump) { - /* jump betweenn special characters (/,\,_,-, etc.), + + /* jump between special characters (/,\,_,-, etc.), * look at function test_special_char() for complete * list of special character, ctr -> */ while(but->pos > 0){ but->pos--; - if(test_special_char(str[but->pos])) break; + if(!jump_all && test_special_char(str[but->pos])) break; + } + + /* left only: compensate for index/change in direction */ + if((but->pos != 0) && ABS(pos_prev - but->pos) > 1) { + but->pos++; } - } else { + + } + else { if(but->pos>0) but->pos--; } } - } -} - -static void ui_textedit_move_end(uiBut *but, uiHandleButtonData *data, int direction, int select) -{ - char *str; - str= data->str; - if(direction) { /* right */ if(select) { - but->selsta = but->pos; - but->selend = strlen(str); - data->selextend = EXTEND_RIGHT; - } else { - but->selsta = but->selend = but->pos= strlen(str); - } - } - else { /* left */ - if(select) { - but->selend = but->pos; - but->selsta = 0; - data->selextend = EXTEND_LEFT; - } else { - but->selsta = but->selend = but->pos= 0; + /* existing selection */ + if (has_sel) { + + if(data->selextend == 0) { + data->selextend= EXTEND_RIGHT; + } + + if (direction) { + if (data->selextend == EXTEND_RIGHT) { + but->selend= but->pos; + } + else { + but->selsta= but->pos; + } + } + else { + if (data->selextend == EXTEND_LEFT) { + but->selsta= but->pos; + } + else { + but->selend= but->pos; + } + } + + if (but->selend < but->selsta) { + SWAP(short, but->selsta, but->selend); + data->selextend= (data->selextend == EXTEND_RIGHT) ? EXTEND_LEFT : EXTEND_RIGHT; + } + + } /* new selection */ + else { + if (direction) { + data->selextend= EXTEND_RIGHT; + but->selend= but->pos; + but->selsta= pos_prev; + } + else { + data->selextend= EXTEND_LEFT; + but->selend= pos_prev; + but->selsta= but->pos; + } + } } } } @@ -1842,11 +1824,11 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle } break; case RIGHTARROWKEY: - ui_textedit_move(but, data, 1, event->shift, event->ctrl); + ui_textedit_move(but, data, 1, event->shift, event->ctrl, FALSE); retval= WM_UI_HANDLER_BREAK; break; case LEFTARROWKEY: - ui_textedit_move(but, data, 0, event->shift, event->ctrl); + ui_textedit_move(but, data, 0, event->shift, event->ctrl, FALSE); retval= WM_UI_HANDLER_BREAK; break; case DOWNARROWKEY: @@ -1856,7 +1838,7 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle } /* pass on purposedly */ case ENDKEY: - ui_textedit_move_end(but, data, 1, event->shift); + ui_textedit_move(but, data, 1, event->shift, TRUE, TRUE); retval= WM_UI_HANDLER_BREAK; break; case UPARROWKEY: @@ -1866,7 +1848,7 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle } /* pass on purposedly */ case HOMEKEY: - ui_textedit_move_end(but, data, 0, event->shift); + ui_textedit_move(but, data, 0, event->shift, TRUE, TRUE); retval= WM_UI_HANDLER_BREAK; break; case PADENTER: diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index a50dd00ef16..76cbfdc88e7 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -1221,7 +1221,7 @@ static void copy_attr(Main *bmain, Scene *scene, View3D *v3d, short event) cu1->vfontbi= cu->vfontbi; id_us_plus((ID *)cu1->vfontbi); - BKE_text_to_curve(scene, base->object, 0); /* needed? */ + BKE_text_to_curve(bmain, scene, base->object, 0); /* needed? */ BLI_strncpy(cu1->family, cu->family, sizeof(cu1->family)); diff --git a/source/blender/editors/sound/sound_ops.c b/source/blender/editors/sound/sound_ops.c index 5b72e87f95a..d03c2b19300 100644 --- a/source/blender/editors/sound/sound_ops.c +++ b/source/blender/editors/sound/sound_ops.c @@ -519,6 +519,7 @@ static int sound_poll(bContext *C) static int pack_exec(bContext *C, wmOperator *op) { + Main *bmain= CTX_data_main(C); Editing* ed = CTX_data_scene(C)->ed; bSound* sound; @@ -530,7 +531,7 @@ static int pack_exec(bContext *C, wmOperator *op) if(!sound || sound->packedfile) return OPERATOR_CANCELLED; - sound->packedfile= newPackedFile(op->reports, sound->name); + sound->packedfile= newPackedFile(op->reports, sound->name, ID_BLEND_PATH(bmain, &sound->id)); sound_load(CTX_data_main(C), sound); return OPERATOR_FINISHED; diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 45bd1d58a53..33c3ae45a58 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -1567,6 +1567,7 @@ static int pack_test(bContext *C, wmOperator *op) static int pack_exec(bContext *C, wmOperator *op) { + struct Main *bmain= CTX_data_main(C); Image *ima= CTX_data_edit_image(C); ImBuf *ibuf= BKE_image_get_ibuf(ima, NULL); int as_png= RNA_boolean_get(op->ptr, "as_png"); @@ -1582,7 +1583,7 @@ static int pack_exec(bContext *C, wmOperator *op) if(as_png) BKE_image_memorypack(ima); else - ima->packedfile= newPackedFile(op->reports, ima->name); + ima->packedfile= newPackedFile(op->reports, ima->name, ID_BLEND_PATH(bmain, &ima->id)); WM_event_add_notifier(C, NC_IMAGE|NA_EDITED, ima); diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index 8677a9fe8bf..c5c39ed334c 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -1989,7 +1989,7 @@ void VIEW3D_OT_select_border(wmOperatorType *ot) /* much like facesel_face_pick()*/ /* returns 0 if not found, otherwise 1 */ -static int vertsel_vert_pick(struct bContext *C, Mesh *me, const int mval[2], unsigned int *index, short rect) +static int vertsel_vert_pick(struct bContext *C, Mesh *me, const int mval[2], unsigned int *index, int size) { ViewContext vc; view3d_set_viewcontext(C, &vc); @@ -1997,12 +1997,12 @@ static int vertsel_vert_pick(struct bContext *C, Mesh *me, const int mval[2], un if (!me || me->totvert==0) return 0; - if (rect) { + if (size > 0) { /* sample rect to increase changes of selecting, so that when clicking on an face in the backbuf, we can still select a vert */ int dist; - *index = view3d_sample_backbuf_rect(&vc, mval, 3, 1, me->totvert+1, &dist,0,NULL, NULL); + *index = view3d_sample_backbuf_rect(&vc, mval, size, 1, me->totvert+1, &dist,0,NULL, NULL); } else { /* sample only on the exact position */ @@ -2024,7 +2024,8 @@ static int mouse_weight_paint_vertex_select(bContext *C, const int mval[2], shor Mesh* me= obact->data; /* already checked for NULL */ unsigned int index = 0; MVert *mv; - if(vertsel_vert_pick(C, me, mval, &index, 1)) { + + if(vertsel_vert_pick(C, me, mval, &index, 50)) { mv = me->mvert+index; if(extend) { mv->flag ^= SELECT; diff --git a/source/blender/editors/util/ed_util.c b/source/blender/editors/util/ed_util.c index 3dd7514429e..d46f4b0ed30 100644 --- a/source/blender/editors/util/ed_util.c +++ b/source/blender/editors/util/ed_util.c @@ -171,7 +171,7 @@ void unpack_menu(bContext *C, const char *opname, const char *id_name, const cha pup= uiPupMenuBegin(C, "Unpack file", ICON_NONE); layout= uiPupMenuLayout(pup); - sprintf(line, "Remove Pack"); + strcpy(line, "Remove Pack"); props_ptr= uiItemFullO(layout, opname, line, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS); RNA_enum_set(&props_ptr, "method", PF_REMOVE); RNA_string_set(&props_ptr, "id", id_name); diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h index 44b517a16a1..3b54480e4c2 100644 --- a/source/blender/makesdna/DNA_ID.h +++ b/source/blender/makesdna/DNA_ID.h @@ -207,6 +207,8 @@ typedef struct PreviewImage { #define ID_CHECK_UNDO(id) ((GS((id)->name) != ID_SCR) && (GS((id)->name) != ID_WM)) +#define ID_BLEND_PATH(_bmain, _id) ((_id)->lib ? (_id)->lib->filepath : (_bmain)->name) + #ifdef GS #undef GS #endif diff --git a/source/blender/makesrna/intern/rna_fluidsim.c b/source/blender/makesrna/intern/rna_fluidsim.c index 82911ebb3be..ba90aca47a3 100644 --- a/source/blender/makesrna/intern/rna_fluidsim.c +++ b/source/blender/makesrna/intern/rna_fluidsim.c @@ -141,12 +141,12 @@ static void rna_FluidSettings_update_type(Main *bmain, Scene *scene, PointerRNA psys->part= part; psys->pointcache= BKE_ptcache_add(&psys->ptcaches); psys->flag |= PSYS_ENABLED; - sprintf(psys->name, "FluidParticles"); + BLI_strncpy(psys->name, "FluidParticles", sizeof(psys->name)); BLI_addtail(&ob->particlesystem,psys); /* add modifier */ psmd= (ParticleSystemModifierData*)modifier_new(eModifierType_ParticleSystem); - sprintf(psmd->modifier.name, "FluidParticleSystem" ); + BLI_strncpy(psmd->modifier.name, "FluidParticleSystem", sizeof(psmd->modifier.name)); psmd->psys= psys; BLI_addtail(&ob->modifiers, psmd); modifier_unique_name(&ob->modifiers, (ModifierData *)psmd); diff --git a/source/blender/makesrna/intern/rna_image_api.c b/source/blender/makesrna/intern/rna_image_api.c index b7827989a94..50ce816d7a1 100644 --- a/source/blender/makesrna/intern/rna_image_api.c +++ b/source/blender/makesrna/intern/rna_image_api.c @@ -142,7 +142,7 @@ static void rna_Image_pack(Image *image, ReportList *reports, int as_png) BKE_image_memorypack(image); } else { - image->packedfile= newPackedFile(reports, image->name); + image->packedfile= newPackedFile(reports, image->name, ID_BLEND_PATH(G.main, &image->id)); } } } diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c index 3c07d5158de..52c4bf36aee 100644 --- a/source/blender/makesrna/intern/rna_main_api.c +++ b/source/blender/makesrna/intern/rna_main_api.c @@ -346,12 +346,12 @@ void rna_Main_metaballs_remove(Main *bmain, ReportList *reports, struct MetaBall mb->id.name+2, ID_REAL_USERS(mb)); } -VFont *rna_Main_fonts_load(Main *UNUSED(bmain), ReportList *reports, const char *filepath) +VFont *rna_Main_fonts_load(Main *bmain, ReportList *reports, const char *filepath) { VFont *font; errno= 0; - font= load_vfont(filepath); + font= load_vfont(bmain, filepath); if(!font) BKE_reportf(reports, RPT_ERROR, "Can't read: \"%s\", %s", filepath, diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index 5259ee1f6d1..f7d1b5d20cf 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -275,7 +275,7 @@ static void rna_Smoke_set_type(Main *bmain, Scene *scene, PointerRNA *ptr) part->end = 250.0f; part->ren_as = PART_DRAW_NOT; part->draw_as = PART_DRAW_DOT; - sprintf(psys->name, "SmokeParticles"); + BLI_strncpy(psys->name, "SmokeParticles", sizeof(psys->name)); psys->recalc |= (PSYS_RECALC_RESET|PSYS_RECALC_PHYS); DAG_id_tag_update(ptr->id.data, OB_RECALC_DATA); } diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c index 454fd6275d9..376b0c529d0 100644 --- a/source/blender/makesrna/intern/rna_rna.c +++ b/source/blender/makesrna/intern/rna_rna.c @@ -506,6 +506,13 @@ static int rna_Property_readonly_get(PointerRNA *ptr) return prop->flag & PROP_EDITABLE ? 0:1; } +static int rna_Property_animatable_get(PointerRNA *ptr) +{ + PropertyRNA *prop= (PropertyRNA*)ptr->data; + + return (prop->flag & PROP_ANIMATABLE) != 0; +} + static int rna_Property_use_output_get(PointerRNA *ptr) { PropertyRNA *prop= (PropertyRNA*)ptr->data; @@ -1066,6 +1073,11 @@ static void rna_def_property(BlenderRNA *brna) RNA_def_property_boolean_funcs(prop, "rna_Property_readonly_get", NULL); RNA_def_property_ui_text(prop, "Read Only", "Property is editable through RNA"); + prop= RNA_def_property(srna, "is_animatable", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_boolean_funcs(prop, "rna_Property_animatable_get", NULL); + RNA_def_property_ui_text(prop, "Animatable", "Property is animatable through RNA"); + prop= RNA_def_property(srna, "is_required", PROP_BOOLEAN, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_boolean_funcs(prop, "rna_Property_is_required_get", NULL); diff --git a/source/blender/python/generic/bpy_internal_import.c b/source/blender/python/generic/bpy_internal_import.c index 90260100c83..d29bc798399 100644 --- a/source/blender/python/generic/bpy_internal_import.c +++ b/source/blender/python/generic/bpy_internal_import.c @@ -93,7 +93,7 @@ void bpy_import_main_set(struct Main *maggie) /* returns a dummy filename for a textblock so we can tell what file a text block comes from */ void bpy_text_filename_get(char *fn, size_t fn_len, Text *text) { - BLI_snprintf(fn, fn_len, "%s%c%s", text->id.lib ? text->id.lib->filepath : bpy_import_main->name, SEP, text->id.name+2); + BLI_snprintf(fn, fn_len, "%s%c%s", ID_BLEND_PATH(bpy_import_main, &text->id), SEP, text->id.name+2); } PyObject *bpy_text_import(Text *text) diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index f79f1d01a96..cb68f9cf2dc 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -84,6 +84,11 @@ static PyObject* pyrna_struct_Subtype(PointerRNA *ptr); static PyObject *pyrna_prop_collection_values(BPy_PropertyRNA *self); +#define BPY_DOC_ID_PROP_TYPE_NOTE \ +" .. note:: Only :class:`bpy.types.ID`, :class:`bpy.types.Bone` and \n" \ +" :class:`bpy.types.PoseBone` classes support custom properties.\n" + + int pyrna_struct_validity_check(BPy_StructRNA *pysrna) { if(pysrna->ptr.type) @@ -2746,8 +2751,7 @@ PyDoc_STRVAR(pyrna_struct_keys_doc, " :return: custom property keys.\n" " :rtype: list of strings\n" "\n" -" .. note:: Only :class:`ID`, :class:`Bone` and :class:`PoseBone` classes\n" -" support custom properties.\n" +BPY_DOC_ID_PROP_TYPE_NOTE ); static PyObject *pyrna_struct_keys(BPy_PropertyRNA *self) { @@ -2775,8 +2779,7 @@ PyDoc_STRVAR(pyrna_struct_items_doc, " :return: custom property key, value pairs.\n" " :rtype: list of key, value tuples\n" "\n" -" .. note:: Only :class:`ID`, :class:`Bone` and :class:`PoseBone`\n" -" classes support custom properties.\n" +BPY_DOC_ID_PROP_TYPE_NOTE ); static PyObject *pyrna_struct_items(BPy_PropertyRNA *self) { @@ -2804,8 +2807,7 @@ PyDoc_STRVAR(pyrna_struct_values_doc, " :return: custom property values.\n" " :rtype: list\n" "\n" -" .. note:: Only :class:`ID`, :class:`Bone` and :class:`PoseBone`\n" -" classes support custom properties.\n" +BPY_DOC_ID_PROP_TYPE_NOTE ); static PyObject *pyrna_struct_values(BPy_PropertyRNA *self) { @@ -3655,18 +3657,28 @@ static PyObject *pyrna_struct_get_id_data(BPy_DummyPointerRNA *self) Py_RETURN_NONE; } +static PyObject *pyrna_struct_get_rna_type(BPy_PropertyRNA *self) +{ + PointerRNA tptr; + RNA_pointer_create(NULL, &RNA_Property, self->prop, &tptr); + return pyrna_struct_Subtype(&tptr); +} + + + /*****************************************************************************/ /* Python attributes get/set structure: */ /*****************************************************************************/ static PyGetSetDef pyrna_prop_getseters[]= { - {(char *)"id_data", (getter)pyrna_struct_get_id_data, (setter)NULL, (char *)"The :class:`ID` object this datablock is from or None, (not available for all data types)", NULL}, + {(char *)"id_data", (getter)pyrna_struct_get_id_data, (setter)NULL, (char *)"The :class:`bpy.types.ID` object this datablock is from or None, (not available for all data types)", NULL}, + {(char *)"rna_type", (getter)pyrna_struct_get_rna_type, (setter)NULL, (char *)"The property type for introspection", NULL}, {NULL, NULL, NULL, NULL, NULL} /* Sentinel */ }; static PyGetSetDef pyrna_struct_getseters[]= { - {(char *)"id_data", (getter)pyrna_struct_get_id_data, (setter)NULL, (char *)"The :class:`ID` object this datablock is from or None, (not available for all data types)", NULL}, + {(char *)"id_data", (getter)pyrna_struct_get_id_data, (setter)NULL, (char *)"The :class:`bpy.types.ID` object this datablock is from or None, (not available for all data types)", NULL}, {NULL, NULL, NULL, NULL, NULL} /* Sentinel */ }; @@ -3773,8 +3785,7 @@ PyDoc_STRVAR(pyrna_struct_get_doc, " *key* is not found.\n" " :type default: Undefined\n" "\n" -" .. note:: Only :class:`ID`, :class:`Bone` and :class:`PoseBone`\n" -" classes support custom properties.\n" +BPY_DOC_ID_PROP_TYPE_NOTE ); static PyObject *pyrna_struct_get(BPy_StructRNA *self, PyObject *args) { diff --git a/source/blender/python/intern/bpy_rna_anim.c b/source/blender/python/intern/bpy_rna_anim.c index 8bde1db96ca..d766acc098e 100644 --- a/source/blender/python/intern/bpy_rna_anim.c +++ b/source/blender/python/intern/bpy_rna_anim.c @@ -273,7 +273,7 @@ char pyrna_struct_driver_add_doc[] = " :arg index: array index of the property drive. Defaults to -1 for all indices or a single channel if the property is not an array.\n" " :type index: int\n" " :return: The driver(s) added.\n" -" :rtype: :class:`FCurve` or list if index is -1 with an array property.\n" +" :rtype: :class:`bpy.types.FCurve` or list if index is -1 with an array property.\n" ; PyObject *pyrna_struct_driver_add(BPy_StructRNA *self, PyObject *args) { diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index 7dc769ca70b..ac3a409433d 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -587,12 +587,12 @@ elseif(WIN32) FILES ${LIBDIR}/thumbhandler/lib/BlendThumb.dll DESTINATION ${TARGETDIR} ) - else() - install( - FILES ${LIBDIR}/thumbhandler/lib/BlendThumb64.dll - DESTINATION ${TARGETDIR} - ) endif() + + install( # x86 builds can run on x64 Windows, so this is required at all times + FILES ${LIBDIR}/thumbhandler/lib/BlendThumb64.dll + DESTINATION ${TARGETDIR} + ) elseif(APPLE) set(SOURCEDIR ${CMAKE_SOURCE_DIR}/source/darwin/blender.app) diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index 853b36b54f7..e5e9c3330e5 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -110,9 +110,9 @@ KX_GameObject::KX_GameObject( m_pGraphicController(NULL), m_xray(false), m_pHitObject(NULL), + m_pObstacleSimulation(NULL), m_actionManager(NULL), - m_isDeformable(false), - m_pObstacleSimulation(NULL) + m_isDeformable(false) #ifdef WITH_PYTHON , m_attr_dict(NULL) #endif diff --git a/source/gameengine/Ketsji/KX_ObstacleSimulation.cpp b/source/gameengine/Ketsji/KX_ObstacleSimulation.cpp index 5f78d9a3722..c2b53fb71ba 100644 --- a/source/gameengine/Ketsji/KX_ObstacleSimulation.cpp +++ b/source/gameengine/Ketsji/KX_ObstacleSimulation.cpp @@ -633,7 +633,7 @@ static void processSamples(KX_Obstacle* activeObst, KX_NavMeshObject* activeNavM const float ivmax = 1.0f / vmax; - float adir[2], adist; + float adir[2] /*, adist */; vcpy(adir, activeObst->pvel); if (vlen(adir) > 0.01f) vnorm(adir); @@ -641,7 +641,7 @@ static void processSamples(KX_Obstacle* activeObst, KX_NavMeshObject* activeNavM vset(adir,0,0); float activeObstPos[2]; vset(activeObstPos, activeObst->m_pos.x(), activeObst->m_pos.y()); - adist = vdot(adir, activeObstPos); + /* adist = vdot(adir, activeObstPos); */ float minPenalty = FLT_MAX; diff --git a/source/gameengine/Ketsji/KX_SteeringActuator.cpp b/source/gameengine/Ketsji/KX_SteeringActuator.cpp index 1edecdf44d2..f998da18f83 100644 --- a/source/gameengine/Ketsji/KX_SteeringActuator.cpp +++ b/source/gameengine/Ketsji/KX_SteeringActuator.cpp @@ -46,38 +46,38 @@ /* ------------------------------------------------------------------------- */ KX_SteeringActuator::KX_SteeringActuator(SCA_IObject *gameobj, - int mode, - KX_GameObject *target, - KX_GameObject *navmesh, - float distance, - float velocity, - float acceleration, - float turnspeed, - bool isSelfTerminated, - int pathUpdatePeriod, - KX_ObstacleSimulation* simulation, - short facingmode, - bool normalup, - bool enableVisualization) : - SCA_IActuator(gameobj, KX_ACT_STEERING), - m_mode(mode), - m_target(target), - m_distance(distance), - m_velocity(velocity), - m_acceleration(acceleration), - m_turnspeed(turnspeed), - m_isSelfTerminated(isSelfTerminated), - m_pathUpdatePeriod(pathUpdatePeriod), - m_updateTime(0), - m_isActive(false), - m_simulation(simulation), - m_enableVisualization(enableVisualization), - m_facingMode(facingmode), - m_normalUp(normalup), - m_obstacle(NULL), - m_pathLen(0), - m_wayPointIdx(-1), - m_steerVec(MT_Vector3(0, 0, 0)) + int mode, + KX_GameObject *target, + KX_GameObject *navmesh, + float distance, + float velocity, + float acceleration, + float turnspeed, + bool isSelfTerminated, + int pathUpdatePeriod, + KX_ObstacleSimulation* simulation, + short facingmode, + bool normalup, + bool enableVisualization) + : SCA_IActuator(gameobj, KX_ACT_STEERING), + m_target(target), + m_mode(mode), + m_distance(distance), + m_velocity(velocity), + m_acceleration(acceleration), + m_turnspeed(turnspeed), + m_simulation(simulation), + m_updateTime(0), + m_obstacle(NULL), + m_isActive(false), + m_isSelfTerminated(isSelfTerminated), + m_enableVisualization(enableVisualization), + m_facingMode(facingmode), + m_normalUp(normalup), + m_pathLen(0), + m_pathUpdatePeriod(pathUpdatePeriod), + m_wayPointIdx(-1), + m_steerVec(MT_Vector3(0, 0, 0)) { m_navmesh = static_cast<KX_NavMeshObject*>(navmesh); if (m_navmesh) diff --git a/source/gameengine/Ketsji/KX_SteeringActuator.h b/source/gameengine/Ketsji/KX_SteeringActuator.h index 4f8303107f7..d337799976b 100644 --- a/source/gameengine/Ketsji/KX_SteeringActuator.h +++ b/source/gameengine/Ketsji/KX_SteeringActuator.h @@ -56,12 +56,12 @@ class KX_SteeringActuator : public SCA_IActuator int m_mode; float m_distance; float m_velocity; - float m_acceleration; + float m_acceleration; float m_turnspeed; KX_ObstacleSimulation* m_simulation; - KX_Obstacle* m_obstacle; double m_updateTime; + KX_Obstacle* m_obstacle; bool m_isActive; bool m_isSelfTerminated; bool m_enableVisualization; |