diff options
Diffstat (limited to 'source')
179 files changed, 3940 insertions, 1278 deletions
diff --git a/source/Makefile b/source/Makefile index 2ab5b4faeab..12e47ba5863 100644 --- a/source/Makefile +++ b/source/Makefile @@ -120,6 +120,7 @@ COMLIB += $(NAN_BSP)/lib/$(DEBUG_DIR)libbsp.a COMLIB += $(NAN_BOOLOP)/lib/$(DEBUG_DIR)libboolop.a COMLIB += $(NAN_MOTO)/lib/$(DEBUG_DIR)libmoto.a COMLIB += $(NAN_DECIMATION)/lib/$(DEBUG_DIR)libdecimation.a +COMLIB += $(NAN_GHOST)/lib/$(DEBUG_DIR)libghost.a ifeq ($(WITH_FFMPEG),true) COMLIB += $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)libaud_ffmpeg.a diff --git a/source/blender/blenfont/intern/blf_lang.c b/source/blender/blenfont/intern/blf_lang.c index bc2de70222d..1baf2c82ef7 100644 --- a/source/blender/blenfont/intern/blf_lang.c +++ b/source/blender/blenfont/intern/blf_lang.c @@ -59,65 +59,19 @@ char global_messagepath[1024]; char global_language[32]; char global_encoding_name[32]; -#if defined(__APPLE__) -void BLF_lang_init(void) /* Apple Only, todo - use BLI_gethome_folder */ -{ - char *bundlepath; - - strcpy(global_encoding_name, SYSTEM_ENCODING_DEFAULT); - - /* set messagepath directory */ -#ifndef LOCALEDIR -#define LOCALEDIR "/usr/share/locale" -#endif - - strcpy(global_messagepath, ".blender/locale"); - - if (!BLI_exist(global_messagepath)) { /* locale not in current dir */ - BLI_make_file_string("/", global_messagepath, BLI_gethome(), ".blender/locale"); - if (!BLI_exist(global_messagepath)) { /* locale not in home dir */ - /* message catalogs are stored inside the application bundle */ - bundlepath= BLI_getbundle(); - strcpy(global_messagepath, bundlepath); - strcat(global_messagepath, "/Contents/Resources/locale"); - if (!BLI_exist(global_messagepath)) { /* locale not in bundle (now that's odd..) */ - strcpy(global_messagepath, LOCALEDIR); - - if (!BLI_exist(global_messagepath)) { /* locale not in LOCALEDIR */ - strcpy(global_messagepath, "message"); /* old compatibility as last */ - } - } - } - } -} -#elif defined(_WIN32) -void BLF_lang_init(void) /* Windows Only, todo - use BLI_gethome_folder */ +void BLF_lang_init(void) { - strcpy(global_encoding_name, SYSTEM_ENCODING_DEFAULT); + char *messagepath= BLI_get_folder(BLENDER_DATAFILES, "locale"); - strcpy(global_messagepath, ".blender/locale"); - - if (!BLI_exist(global_messagepath)) { /* locale not in current dir */ - BLI_make_file_string("/", global_messagepath, BLI_gethome(), ".blender/locale"); - - if (!BLI_exist(global_messagepath)) { /* locale not in home dir */ - BLI_make_file_string("/", global_messagepath, BLI_gethome(), "/locale"); - } - } -} -#else -void BLF_lang_init(void) /* not win or mac */ -{ - char *messagepath= BLI_gethome_folder("locale", BLI_GETHOME_ALL); + BLI_strncpy(global_encoding_name, SYSTEM_ENCODING_DEFAULT, sizeof(global_encoding_name)); - if(messagepath) - strncpy(global_messagepath, messagepath, sizeof(global_messagepath)); + if (messagepath) + BLI_strncpy(global_messagepath, messagepath, sizeof(global_messagepath)); else global_messagepath[0]= '\0'; - } -#endif + void BLF_lang_set(const char *str) { diff --git a/source/blender/blenkernel/BKE_displist.h b/source/blender/blenkernel/BKE_displist.h index 9e75e55adf6..df0627f61ba 100644 --- a/source/blender/blenkernel/BKE_displist.h +++ b/source/blender/blenkernel/BKE_displist.h @@ -93,6 +93,7 @@ extern void makeDispListCurveTypes(struct Scene *scene, struct Object *ob, int f extern void makeDispListCurveTypes_forRender(struct Scene *scene, struct Object *ob, struct ListBase *dispbase, struct DerivedMesh **derivedFinal, int forOrco); extern void makeDispListCurveTypes_forOrco(struct Scene *scene, struct Object *ob, struct ListBase *dispbase); extern void makeDispListMBall(struct Scene *scene, struct Object *ob); +extern void makeDispListMBall_forRender(struct Scene *scene, struct Object *ob, struct ListBase *dispbase); extern void shadeDispList(struct Scene *scene, struct Base *base); extern void shadeMeshMCol(struct Scene *scene, struct Object *ob, struct Mesh *me); diff --git a/source/blender/blenkernel/BKE_image.h b/source/blender/blenkernel/BKE_image.h index 7bdb9aaf709..d7eb5fe8246 100644 --- a/source/blender/blenkernel/BKE_image.h +++ b/source/blender/blenkernel/BKE_image.h @@ -115,7 +115,7 @@ void BKE_image_release_ibuf(struct Image *ima, void *lock); struct Image *BKE_add_image_file(const char *name, int frame); /* adds image, adds ibuf, generates color or pattern */ -struct Image *BKE_add_image_size(int width, int height, char *name, int floatbuf, short uvtestgrid, float color[4]); +struct Image *BKE_add_image_size(int width, int height, char *name, int depth, int floatbuf, short uvtestgrid, float color[4]); /* adds image from imbuf, owns imbuf */ struct Image *BKE_add_image_imbuf(struct ImBuf *ibuf); diff --git a/source/blender/blenkernel/BKE_lattice.h b/source/blender/blenkernel/BKE_lattice.h index f35dff53cd5..880f3f7e724 100644 --- a/source/blender/blenkernel/BKE_lattice.h +++ b/source/blender/blenkernel/BKE_lattice.h @@ -49,7 +49,7 @@ void init_latt_deform(struct Object *oblatt, struct Object *ob); void calc_latt_deform(struct Object *, float *co, float weight); void end_latt_deform(struct Object *); -int object_deform_mball(struct Object *ob); +int object_deform_mball(struct Object *ob, struct ListBase *dispbase); void outside_lattice(struct Lattice *lt); void curve_deform_verts(struct Scene *scene, struct Object *cuOb, struct Object *target, diff --git a/source/blender/blenkernel/BKE_mball.h b/source/blender/blenkernel/BKE_mball.h index e28e2c4d86e..5d41f4e374e 100644 --- a/source/blender/blenkernel/BKE_mball.h +++ b/source/blender/blenkernel/BKE_mball.h @@ -97,6 +97,7 @@ typedef struct process { /* parameters, function, storage */ CENTERLIST **centers; /* cube center hash table */ CORNER **corners; /* corner value hash table */ EDGELIST **edges; /* edge and vertex id hash table */ + float scale[3]; } PROCESS; /* dividing scene using octal tree makes polygonisation faster */ @@ -163,11 +164,12 @@ struct MetaBall *add_mball(char *name); struct MetaBall *copy_mball(struct MetaBall *mb); void make_local_mball(struct MetaBall *mb); void tex_space_mball(struct Object *ob); -float *make_orco_mball(struct Object *ob); +float *make_orco_mball(struct Object *ob, struct ListBase *dispbase); void copy_mball_properties(struct Scene *scene, struct Object *active_object); struct Object *find_basis_mball(struct Scene *scene, struct Object *ob); int is_basis_mball(struct Object *ob); -void metaball_polygonize(struct Scene *scene, struct Object *ob); +int is_mball_basis_for(struct Object *ob1, struct Object *ob2); +void metaball_polygonize(struct Scene *scene, struct Object *ob, struct ListBase *dispbase); void calc_mballco(struct MetaElem *ml, float *vec); float densfunc(struct MetaElem *ball, float x, float y, float z); float metaball(float x, float y, float z); diff --git a/source/blender/blenkernel/BKE_multires.h b/source/blender/blenkernel/BKE_multires.h index e8bbb58a895..39fc795e6ff 100644 --- a/source/blender/blenkernel/BKE_multires.h +++ b/source/blender/blenkernel/BKE_multires.h @@ -47,7 +47,8 @@ void multires_force_external_reload(struct Object *ob); struct DerivedMesh *multires_dm_create_from_derived(struct MultiresModifierData*, int local_mmd, struct DerivedMesh*, struct Object *, int, int); -struct MultiresModifierData *find_multires_modifier(struct Scene *scene, struct Object *ob); +struct MultiresModifierData *find_multires_modifier_before(struct Scene *scene, + struct ModifierData *lastmd); struct DerivedMesh *get_multires_dm(struct Scene *scene, struct MultiresModifierData *mmd, struct Object *ob); void multiresModifier_join(struct Object *); diff --git a/source/blender/blenkernel/BKE_scene.h b/source/blender/blenkernel/BKE_scene.h index 090979b33e9..b5b0a72d2d8 100644 --- a/source/blender/blenkernel/BKE_scene.h +++ b/source/blender/blenkernel/BKE_scene.h @@ -58,7 +58,7 @@ struct Scene *add_scene(char *name); struct Base *object_in_scene(struct Object *ob, struct Scene *sce); void set_scene_bg(struct Scene *sce); -void set_scene_name(char *name); +struct Scene *set_scene_name(char *name); struct Scene *copy_scene(struct Main *bmain, struct Scene *sce, int type); void unlink_scene(struct Main *bmain, struct Scene *sce, struct Scene *newsce); @@ -80,6 +80,8 @@ void scene_select_base(struct Scene *sce, struct Base *selbase); /* checks for cycle, returns 1 if it's all OK */ int scene_check_setscene(struct Scene *sce); +float BKE_curframe(struct Scene *scene); + void scene_update_tagged(struct Scene *sce); void scene_update_for_newframe(struct Scene *sce, unsigned int lay); diff --git a/source/blender/blenkernel/SConscript b/source/blender/blenkernel/SConscript index 85d4934609d..00c6415018b 100644 --- a/source/blender/blenkernel/SConscript +++ b/source/blender/blenkernel/SConscript @@ -67,6 +67,7 @@ if env['BF_NO_ELBEEM']: if env['WITH_BF_LCMS']: defs.append('WITH_LCMS') + incs += ' ' + env['BF_LCMS_INC'] if env['WITH_BF_LZO']: incs += ' #/extern/lzo/minilzo' diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c index 50552d33c41..6c8e5c48745 100644 --- a/source/blender/blenkernel/intern/action.c +++ b/source/blender/blenkernel/intern/action.c @@ -1418,7 +1418,7 @@ static void do_nla(Scene *scene, Object *ob, int blocktype) bActionStrip *strip, *striplast=NULL, *stripfirst=NULL; float striptime, frametime, length, actlength; float blendfac, stripframe; - float scene_cfra= frame_to_float(scene, scene->r.cfra); + float scene_cfra= BKE_curframe(scene); int doit, dostride; if(blocktype==ID_AR) { diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c index 6044cfa7692..fa0ddc5f1d3 100644 --- a/source/blender/blenkernel/intern/anim.c +++ b/source/blender/blenkernel/intern/anim.c @@ -1532,7 +1532,10 @@ void free_object_duplilist(ListBase *lb) { DupliObject *dob; - for(dob= lb->first; dob; dob= dob->next) { + /* loop in reverse order, if object is instanced multiple times + the original layer may not really be original otherwise, proper + solution is more complicated */ + for(dob= lb->last; dob; dob= dob->prev) { dob->ob->lay= dob->origlay; copy_m4_m4(dob->ob->obmat, dob->omat); } diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c index 134d49cdf24..57e72fc5671 100644 --- a/source/blender/blenkernel/intern/blender.c +++ b/source/blender/blenkernel/intern/blender.c @@ -55,6 +55,7 @@ #include "BLI_blenlib.h" #include "BLI_dynstr.h" +#include "BLI_path_util.h" #include "IMB_imbuf.h" @@ -64,6 +65,7 @@ #include "BKE_displist.h" #include "BKE_global.h" #include "BKE_idprop.h" +#include "BKE_ipo.h" #include "BKE_library.h" #include "BKE_main.h" #include "BKE_node.h" @@ -286,6 +288,11 @@ static void setup_app_data(bContext *C, BlendFileData *bfd, char *filename) //setscreen(G.curscreen); } + // FIXME: this version patching should really be part of the file-reading code, + // but we still get too many unrelated data-corruption crashes otherwise... + if (G.main->versionfile < 250) + do_versions_ipos_to_animato(G.main); + if(recover && bfd->filename[0] && G.relbase_valid) { /* in case of autosave or quit.blend, use original filename instead * use relbase_valid to make sure the file is saved, else we get <memory2> in the filename */ @@ -362,7 +369,7 @@ int BKE_read_file(bContext *C, char *dir, void *unused, ReportList *reports) BlendFileData *bfd; int retval= 1; - if(strstr(dir, ".B25.blend")==0) /* dont print user-pref loading */ + if(strstr(dir, BLENDER_STARTUP_FILE)==0) /* dont print user-pref loading */ printf("read blend: %s\n", dir); bfd= BLO_read_from_file(dir, reports); diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c index 9bba893c2c8..a586ca57966 100644 --- a/source/blender/blenkernel/intern/cdderivedmesh.c +++ b/source/blender/blenkernel/intern/cdderivedmesh.c @@ -885,7 +885,7 @@ static void cdDM_drawMappedFaces(DerivedMesh *dm, int (*setDrawOptions)(void *us else orig = actualFace; - if(setDrawOptions && !setDrawOptions(userData, orig, &drawSmooth)) + if(draw && setDrawOptions && !setDrawOptions(userData, orig, &drawSmooth)) draw = 0; /* Goal is to draw as long of a contiguous triangle diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c index 4be5cce38a8..0dbdd802ff6 100644 --- a/source/blender/blenkernel/intern/depsgraph.c +++ b/source/blender/blenkernel/intern/depsgraph.c @@ -1754,7 +1754,7 @@ static void flush_update_node(DagNode *node, unsigned int layer, int curtime) node->lasttime= curtime; ob= node->ob; - if(ob && (ob->recalc & OB_RECALC)) { + if(ob && (ob->recalc & OB_RECALC_ALL)) { all_layer= node->scelay; /* got an object node that changes, now check relations */ @@ -1797,7 +1797,7 @@ static void flush_update_node(DagNode *node, unsigned int layer, int curtime) if(ob->recalc & OB_RECALC_DATA) object_free_display(ob); - ob->recalc &= ~OB_RECALC; + ob->recalc &= ~OB_RECALC_ALL; } } @@ -1810,7 +1810,7 @@ static void flush_update_node(DagNode *node, unsigned int layer, int curtime) if(itA->node->type==ID_OB) { obc= itA->node->ob; /* child moves */ - if((obc->recalc & OB_RECALC)==OB_RECALC_OB) { + if((obc->recalc & OB_RECALC_ALL)==OB_RECALC_OB) { /* parent has deforming info */ if(itA->type & (DAG_RL_OB_DATA|DAG_RL_DATA_DATA)) { // printf("parent %s changes ob %s\n", ob->id.name, obc->id.name); @@ -1864,7 +1864,7 @@ static void flush_pointcache_reset(Scene *scene, DagNode *node, int curtime, int if(itA->node->lasttime!=curtime) { ob= (Object*)(node->ob); - if(reset || (ob->recalc & OB_RECALC)) { + if(reset || (ob->recalc & OB_RECALC_ALL)) { if(BKE_ptcache_object_reset(scene, ob, PTCACHE_RESET_DEPSGRAPH)) ob->recalc |= OB_RECALC_DATA; @@ -1946,7 +1946,7 @@ void DAG_scene_flush_update(Scene *sce, unsigned int lay, int time) if(itA->node->lasttime!=lasttime && itA->node->type==ID_OB) { ob= (Object*)(itA->node->ob); - if(ob->recalc & OB_RECALC) { + if(ob->recalc & OB_RECALC_ALL) { if(BKE_ptcache_object_reset(sce, ob, PTCACHE_RESET_DEPSGRAPH)) ob->recalc |= OB_RECALC_DATA; @@ -1962,11 +1962,30 @@ void DAG_scene_flush_update(Scene *sce, unsigned int lay, int time) static int object_modifiers_use_time(Object *ob) { ModifierData *md; - + + /* check if a modifier in modifier stack needs time input */ for (md=ob->modifiers.first; md; md=md->next) if (modifier_dependsOnTime(md)) return 1; - + + /* check whether any modifiers are animated */ + if (ob->adt) { + AnimData *adt = ob->adt; + + /* action - check for F-Curves with paths containing 'modifiers[' */ + if (adt->action) { + FCurve *fcu; + + for (fcu = adt->action->curves.first; fcu; fcu = fcu->next) { + if (fcu->rna_path && strstr(fcu->rna_path, "modifiers[")) + return 1; + } + } + + // XXX: also, should check NLA strips, though for now assume that nobody uses + // that and we can omit that for performance reasons... + } + return 0; } @@ -2026,14 +2045,14 @@ static void dag_object_time_update_flags(Object *ob) /* this case is for groups with nla, whilst nla target has no action or nla */ for(strip= ob->nlastrips.first; strip; strip= strip->next) { if(strip->object) - strip->object->recalc |= OB_RECALC; + strip->object->recalc |= OB_RECALC_ALL; } } } #endif // XXX old animation system if(animdata_use_time(ob->adt)) { - ob->recalc |= OB_RECALC; + ob->recalc |= OB_RECALC_OB; ob->adt->recalc |= ADT_RECALC_ANIM; } @@ -2276,7 +2295,7 @@ void DAG_id_flush_update(ID *id, short flag) /* set flags & pointcache for object */ if(GS(id->name) == ID_OB) { ob= (Object*)id; - ob->recalc |= (flag & OB_RECALC); + ob->recalc |= (flag & OB_RECALC_ALL); BKE_ptcache_object_reset(sce, ob, PTCACHE_RESET_DEPSGRAPH); if(flag & OB_RECALC_DATA) { @@ -2284,8 +2303,10 @@ void DAG_id_flush_update(ID *id, short flag) id= ob->data; /* no point in trying in this cases */ - if(!id || id->us <= 1) + if(id && id->us <= 1) { + dag_editors_update(bmain, id); id= NULL; + } } } @@ -2331,7 +2352,7 @@ void DAG_id_flush_update(ID *id, short flag) for(obt=bmain->object.first; obt; obt= obt->id.next) { Key *key= ob_get_key(obt); if(!(ob && obt == ob) && ((ID *)key == id)) { - obt->flag |= (OB_RECALC|OB_RECALC_DATA); + obt->flag |= (OB_RECALC_OB|OB_RECALC_DATA); BKE_ptcache_object_reset(sce, obt, PTCACHE_RESET_DEPSGRAPH); } } @@ -2344,7 +2365,7 @@ void DAG_id_flush_update(ID *id, short flag) for(psys=obt->particlesystem.first; psys; psys=psys->next) { if(&psys->part->id == id) { BKE_ptcache_object_reset(sce, obt, PTCACHE_RESET_DEPSGRAPH); - obt->recalc |= (flag & OB_RECALC); + obt->recalc |= (flag & OB_RECALC_ALL); psys->recalc |= (flag & PSYS_RECALC); } } @@ -2424,7 +2445,7 @@ void DAG_id_update_flags(ID *id) GroupObject *go; /* primitive; tag all... this call helps building groups for particles */ for(go= group->gobject.first; go; go= go->next) - go->ob->recalc= OB_RECALC; + go->ob->recalc= OB_RECALC_ALL; } } else { diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c index a958d8c353b..716d3110bc3 100644 --- a/source/blender/blenkernel/intern/displist.c +++ b/source/blender/blenkernel/intern/displist.c @@ -1172,20 +1172,30 @@ void makeDispListMBall(Scene *scene, Object *ob) { if(!ob || ob->type!=OB_MBALL) return; + // XXX: mball stuff uses plenty of global variables + // while this is unchanged updating during render is unsafe + if(G.rendering) return; + freedisplist(&(ob->disp)); - + if(ob->type==OB_MBALL) { if(ob==find_basis_mball(scene, ob)) { - metaball_polygonize(scene, ob); + metaball_polygonize(scene, ob, &ob->disp); tex_space_mball(ob); - object_deform_mball(ob); + object_deform_mball(ob, &ob->disp); } } boundbox_displist(ob); } +void makeDispListMBall_forRender(Scene *scene, Object *ob, ListBase *dispbase) +{ + metaball_polygonize(scene, ob, dispbase); + object_deform_mball(ob, dispbase); +} + static ModifierData *curve_get_tesselate_point(Scene *scene, Object *ob, int forRender, int editmode) { ModifierData *md = modifiers_getVirtualModifierList(ob); diff --git a/source/blender/blenkernel/intern/exotic.c b/source/blender/blenkernel/intern/exotic.c index 91c5a633ff6..cdefbb54ecf 100644 --- a/source/blender/blenkernel/intern/exotic.c +++ b/source/blender/blenkernel/intern/exotic.c @@ -4071,7 +4071,7 @@ static void dxf_read(Scene *scene, char *filename) ob->dupon= 1; ob->dupoff= 0; ob->dupsta= 1; ob->dupend= 100; - ob->recalc= OB_RECALC; /* needed because of weird way of adding libdata directly */ + ob->recalc= OB_RECALC_ALL; /* needed because of weird way of adding libdata directly */ ob->data= obdata; ((ID*)ob->data)->us++; diff --git a/source/blender/blenkernel/intern/group.c b/source/blender/blenkernel/intern/group.c index c8848572643..6377a6f6ccd 100644 --- a/source/blender/blenkernel/intern/group.c +++ b/source/blender/blenkernel/intern/group.c @@ -280,6 +280,7 @@ int group_is_animated(Object *parent, Group *group) return 0; } +#if 0 // add back when timeoffset & animsys work again /* only replaces object strips or action when parent nla instructs it */ /* keep checking nla.c though, in case internal structure of strip changes */ static void group_replaces_nla(Object *parent, Object *target, char mode) @@ -319,6 +320,7 @@ static void group_replaces_nla(Object *parent, Object *target, char mode) } } } +#endif /* puts all group members in local timing system, after this call you can draw everything, leaves tags in objects to signal it needs further updating */ @@ -328,6 +330,11 @@ void group_handle_recalc_and_update(Scene *scene, Object *parent, Group *group) { GroupObject *go; +#if 0 /* warning, isnt clearing the recalc flag on the object which causes it to run all the time, + * not just on frame change. + * This isnt working because the animation data is only re-evalyated on frame change so commenting for now + * but when its enabled at some point it will need to be changed so as not to update so much - campbell */ + /* if animated group... */ if(give_timeoffset(parent) != 0.0f || parent->nlastrips.first) { int cfrao; @@ -353,7 +360,9 @@ void group_handle_recalc_and_update(Scene *scene, Object *parent, Group *group) /* restore */ scene->r.cfra= cfrao; } - else { + else +#endif + { /* only do existing tags, as set by regular depsgraph */ for(go= group->gobject.first; go; go= go->next) { if(go->ob) { diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index f06e9302a60..4daa38001bf 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -328,13 +328,6 @@ Image *BKE_add_image_file(const char *name, int frame) const char *libname; char str[FILE_MAX], strtest[FILE_MAX]; - /* escape when name is directory */ - len= strlen(name); - if(len) { - if(name[len-1]=='/' || name[len-1]=='\\') - return NULL; - } - BLI_strncpy(str, name, sizeof(str)); BLI_path_abs(str, G.sce); @@ -380,18 +373,18 @@ Image *BKE_add_image_file(const char *name, int frame) return ima; } -static ImBuf *add_ibuf_size(int width, int height, char *name, int floatbuf, short uvtestgrid, float color[4]) +static ImBuf *add_ibuf_size(int width, int height, char *name, int depth, int floatbuf, short uvtestgrid, float color[4]) { ImBuf *ibuf; unsigned char *rect= NULL; float *rect_float= NULL; if (floatbuf) { - ibuf= IMB_allocImBuf(width, height, 24, IB_rectfloat, 0); + ibuf= IMB_allocImBuf(width, height, depth, IB_rectfloat, 0); rect_float= (float*)ibuf->rect_float; } else { - ibuf= IMB_allocImBuf(width, height, 24, IB_rect, 0); + ibuf= IMB_allocImBuf(width, height, depth, IB_rect, 0); rect= (unsigned char*)ibuf->rect; } @@ -413,7 +406,7 @@ static ImBuf *add_ibuf_size(int width, int height, char *name, int floatbuf, sho } /* adds new image block, creates ImBuf and initializes color */ -Image *BKE_add_image_size(int width, int height, char *name, int floatbuf, short uvtestgrid, float color[4]) +Image *BKE_add_image_size(int width, int height, char *name, int depth, int floatbuf, short uvtestgrid, float color[4]) { /* on save, type is changed to FILE in editsima.c */ Image *ima= image_alloc(name, IMA_SRC_GENERATED, IMA_TYPE_UV_TEST); @@ -426,7 +419,7 @@ Image *BKE_add_image_size(int width, int height, char *name, int floatbuf, short ima->gen_y= height; ima->gen_type= uvtestgrid; - ibuf= add_ibuf_size(width, height, name, floatbuf, uvtestgrid, color); + ibuf= add_ibuf_size(width, height, name, depth, floatbuf, uvtestgrid, color); image_assign_ibuf(ima, ibuf, IMA_NO_INDEX, 0); ima->ok= IMA_OK_LOADED; @@ -2075,7 +2068,7 @@ ImBuf *BKE_image_acquire_ibuf(Image *ima, ImageUser *iuser, void **lock_r) /* UV testgrid or black or solid etc */ if(ima->gen_x==0) ima->gen_x= 1024; if(ima->gen_y==0) ima->gen_y= 1024; - ibuf= add_ibuf_size(ima->gen_x, ima->gen_y, ima->name, 0, ima->gen_type, color); + ibuf= add_ibuf_size(ima->gen_x, ima->gen_y, ima->name, 24, 0, ima->gen_type, color); image_assign_ibuf(ima, ibuf, IMA_NO_INDEX, 0); ima->ok= IMA_OK_LOADED; } diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c index 7f2ac50acd5..cd8ab8290e5 100644 --- a/source/blender/blenkernel/intern/ipo.c +++ b/source/blender/blenkernel/intern/ipo.c @@ -1068,7 +1068,7 @@ static void fcurve_add_to_list (ListBase *groups, ListBase *list, FCurve *fcu, c bActionGroup *agrp= NULL; /* init the temp action */ - //memset(&tmp_act, 0, sizeof(bAction)); // XXX only enable this line if we get errors + memset(&tmp_act, 0, sizeof(bAction)); // XXX only enable this line if we get errors tmp_act.groups.first= groups->first; tmp_act.groups.last= groups->last; tmp_act.curves.first= list->first; @@ -1084,8 +1084,8 @@ static void fcurve_add_to_list (ListBase *groups, ListBase *list, FCurve *fcu, c agrp= MEM_callocN(sizeof(bActionGroup), "bActionGroup"); agrp->flag = AGRP_SELECTED; - if(muteipo) agrp->flag |= AGRP_MUTED; - + if (muteipo) agrp->flag |= AGRP_MUTED; + strncpy(agrp->name, grpname, sizeof(agrp->name)); BLI_addtail(&tmp_act.groups, agrp); @@ -1097,9 +1097,9 @@ static void fcurve_add_to_list (ListBase *groups, ListBase *list, FCurve *fcu, c /* WARNING: this func should only need to look at the stuff we initialised, if not, things may crash */ action_groups_add_channel(&tmp_act, agrp, fcu); - if(agrp->flag & AGRP_MUTED) /* flush down */ + if (agrp->flag & AGRP_MUTED) /* flush down */ fcu->flag |= FCURVE_MUTED; - + /* set the output lists based on the ones in the temp action */ groups->first= tmp_act.groups.first; groups->last= tmp_act.groups.last; @@ -1843,9 +1843,9 @@ void do_versions_ipos_to_animato(Main *main) Editing * ed = scene->ed; if (ed && ed->seqbasep) { Sequence * seq; - + adt= BKE_id_add_animdata(id); - + SEQ_BEGIN(ed, seq) { IpoCurve *icu = (seq->ipo) ? seq->ipo->curve.first : NULL; short adrcode = SEQ_FAC1; @@ -1877,8 +1877,7 @@ void do_versions_ipos_to_animato(Main *main) icu->adrcode = adrcode; /* convert IPO */ - ipo_to_animdata((ID *)scene, seq->ipo, - NULL, NULL, seq); + ipo_to_animdata((ID *)scene, seq->ipo, NULL, NULL, seq); seq->ipo->id.us--; seq->ipo = NULL; } diff --git a/source/blender/blenkernel/intern/lattice.c b/source/blender/blenkernel/intern/lattice.c index 1954bac7e93..5824afd9ded 100644 --- a/source/blender/blenkernel/intern/lattice.c +++ b/source/blender/blenkernel/intern/lattice.c @@ -869,12 +869,12 @@ void lattice_deform_verts(Object *laOb, Object *target, DerivedMesh *dm, end_latt_deform(laOb); } -int object_deform_mball(Object *ob) +int object_deform_mball(Object *ob, ListBase *dispbase) { if(ob->parent && ob->parent->type==OB_LATTICE && ob->partype==PARSKEL) { DispList *dl; - for (dl=ob->disp.first; dl; dl=dl->next) { + for (dl=dispbase->first; dl; dl=dl->next) { lattice_deform_verts(ob->parent, ob, NULL, (float(*)[3]) dl->verts, dl->nr, NULL); } diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index 02118d4a3ef..dc0be1e2e35 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -452,7 +452,7 @@ void recalc_all_library_objects(Main *main) /* flag for full recalc */ for(ob=main->object.first; ob; ob=ob->id.next) if(ob->id.lib) - ob->recalc |= OB_RECALC; + ob->recalc |= OB_RECALC_ALL; } /* note: MAX_LIBARRAY define should match this code */ diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c index 3acc46967be..da9740a1486 100644 --- a/source/blender/blenkernel/intern/mball.c +++ b/source/blender/blenkernel/intern/mball.c @@ -226,7 +226,7 @@ void tex_space_mball(Object *ob) boundbox_set_from_min_max(bb, min, max); } -float *make_orco_mball(Object *ob) +float *make_orco_mball(Object *ob, ListBase *dispbase) { BoundBox *bb; DispList *dl; @@ -243,7 +243,7 @@ float *make_orco_mball(Object *ob) loc[2]= (bb->vec[0][2]+bb->vec[1][2])/2.0f; size[2]= bb->vec[1][2]-loc[2]; - dl= ob->disp.first; + dl= dispbase->first; orcodata= MEM_mallocN(sizeof(float)*3*dl->nr, "MballOrco"); data= dl->verts; @@ -275,6 +275,19 @@ int is_basis_mball(Object *ob) return 1; } +/* return nonzero if ob1 is a basis mball for ob */ +int is_mball_basis_for(Object *ob1, Object *ob2) +{ + int basis1nr, basis2nr; + char basis1name[32], basis2name[32]; + + splitIDname(ob1->id.name+2, basis1name, &basis1nr); + splitIDname(ob2->id.name+2, basis2name, &basis2nr); + + if(!strcmp(basis1name, basis2name)) return is_basis_mball(ob1); + else return 0; +} + /* \brief copy some properties from object to other metaball object with same base name * * When some properties (wiresize, threshold, update flags) of metaball are changed, then this properties @@ -876,11 +889,11 @@ CORNER *setcorner (PROCESS* p, int i, int j, int k) c = (CORNER *) new_pgn_element(sizeof(CORNER)); c->i = i; - c->x = ((float)i-0.5f)*p->size; + c->x = ((float)i-0.5f)*p->size/p->scale[0]; c->j = j; - c->y = ((float)j-0.5f)*p->size; + c->y = ((float)j-0.5f)*p->size/p->scale[1]; c->k = k; - c->z = ((float)k-0.5f)*p->size; + c->z = ((float)k-0.5f)*p->size/p->scale[2]; c->value = p->function(c->x, c->y, c->z); c->next = p->corners[index]; @@ -1409,9 +1422,9 @@ void find_first_points(PROCESS *mbproc, MetaBall *mb, int a) workp_v = in_v; max_len = sqrt((out.x-in.x)*(out.x-in.x) + (out.y-in.y)*(out.y-in.y) + (out.z-in.z)*(out.z-in.z)); - nx = abs((out.x - in.x)/mbproc->size); - ny = abs((out.y - in.y)/mbproc->size); - nz = abs((out.z - in.z)/mbproc->size); + nx = abs((out.x - in.x)/mbproc->size*mbproc->scale[0]); + ny = abs((out.y - in.y)/mbproc->size*mbproc->scale[1]); + nz = abs((out.z - in.z)/mbproc->size*mbproc->scale[2]); MAXN = MAX3(nx,ny,nz); if(MAXN!=0.0f) { @@ -1430,9 +1443,9 @@ void find_first_points(PROCESS *mbproc, MetaBall *mb, int a) if((tmp_v<0.0 && workp_v>=0.0)||(tmp_v>0.0 && workp_v<=0.0)) { /* indexes of CUBE, which includes "first point" */ - c_i= (int)floor(workp.x/mbproc->size); - c_j= (int)floor(workp.y/mbproc->size); - c_k= (int)floor(workp.z/mbproc->size); + c_i= (int)floor(workp.x/mbproc->size*mbproc->scale[0]); + c_j= (int)floor(workp.y/mbproc->size*mbproc->scale[1]); + c_k= (int)floor(workp.z/mbproc->size*mbproc->scale[2]); /* add CUBE (with indexes c_i, c_j, c_k) to the stack, * this cube includes found point of Implicit Surface */ @@ -2075,21 +2088,23 @@ void init_metaball_octal_tree(int depth) subdivide_metaball_octal_node(node, size[0], size[1], size[2], metaball_tree->depth); } -void metaball_polygonize(Scene *scene, Object *ob) +void metaball_polygonize(Scene *scene, Object *ob, ListBase *dispbase) { PROCESS mbproc; MetaBall *mb; DispList *dl; int a, nr_cubes; float *ve, *no, totsize, width; - + float smat[3][3]; + mb= ob->data; if(totelem==0) return; if(!(G.rendering) && (mb->flag==MB_UPDATE_NEVER)) return; if(G.moving && mb->flag==MB_UPDATE_FAST) return; - freedisplist(&ob->disp); + object_scale_to_mat3(ob, smat); + curindex= totindex= 0; indices= 0; thresh= mb->thresh; @@ -2130,6 +2145,7 @@ void metaball_polygonize(Scene *scene, Object *ob) width= mb->wiresize; if(G.moving && mb->flag==MB_UPDATE_HALFRES) width*= 2; } + /* nr_cubes is just for safety, minimum is totsize */ nr_cubes= (int)(0.5+totsize/width); @@ -2140,6 +2156,11 @@ void metaball_polygonize(Scene *scene, Object *ob) mbproc.cubes= 0; mbproc.delta = width/(float)(RES*RES); + /* to keep constant resolution for any motherball scale */ + mbproc.scale[0]= smat[0][0]; + mbproc.scale[1]= smat[1][1]; + mbproc.scale[2]= smat[2][2]; + polygonize(&mbproc, mb); MEM_freeN(mainb); @@ -2152,9 +2173,8 @@ void metaball_polygonize(Scene *scene, Object *ob) } if(curindex) { - dl= MEM_callocN(sizeof(DispList), "mbaldisp"); - BLI_addtail(&ob->disp, dl); + BLI_addtail(dispbase, dl); dl->type= DL_INDEX4; dl->nr= mbproc.vertices.count; dl->parts= curindex; diff --git a/source/blender/blenkernel/intern/multires.c b/source/blender/blenkernel/intern/multires.c index 76d82889cda..56d517f1e13 100644 --- a/source/blender/blenkernel/intern/multires.c +++ b/source/blender/blenkernel/intern/multires.c @@ -75,11 +75,11 @@ DerivedMesh *get_multires_dm(Scene *scene, MultiresModifierData *mmd, Object *ob return dm; } -MultiresModifierData *find_multires_modifier(Scene *scene, Object *ob) +MultiresModifierData *find_multires_modifier_before(Scene *scene, ModifierData *lastmd) { ModifierData *md; - for(md = ob->modifiers.first; md; md = md->next) { + for(md = lastmd; md; md = md->prev) { if(md->type == eModifierType_Multires) { if (modifier_isEnabled(scene, md, eModifierMode_Realtime)) return (MultiresModifierData*)md; @@ -249,6 +249,9 @@ int multiresModifier_reshapeFromDeformMod(Scene *scene, MultiresModifierData *mm int numVerts, result; float (*deformedVerts)[3]; + if(multires_get_level(ob, mmd, 0) == 0) + return 0; + /* Create DerivedMesh for deformation modifier */ dm = get_multires_dm(scene, mmd, ob); numVerts= dm->getNumVerts(dm); diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 4e90387a2c3..1b8405a91de 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -317,7 +317,7 @@ static void unlink_object__unlinkModifierLinks(void *userData, Object *ob, Objec if (*obpoin==unlinkOb) { *obpoin = NULL; - ob->recalc |= OB_RECALC; + ob->recalc |= OB_RECALC_ALL; // XXX: should this just be OB_RECALC_DATA? } } @@ -357,7 +357,7 @@ void unlink_object(Scene *scene, Object *ob) if(obt->parent==ob) { obt->parent= NULL; - obt->recalc |= OB_RECALC; + obt->recalc |= OB_RECALC_ALL; } modifiers_foreachObjectLink(obt, unlink_object__unlinkModifierLinks, ob); @@ -367,15 +367,15 @@ void unlink_object(Scene *scene, Object *ob) if(cu->bevobj==ob) { cu->bevobj= NULL; - obt->recalc |= OB_RECALC; + obt->recalc |= OB_RECALC_ALL; } if(cu->taperobj==ob) { cu->taperobj= NULL; - obt->recalc |= OB_RECALC; + obt->recalc |= OB_RECALC_ALL; } if(cu->textoncurve==ob) { cu->textoncurve= NULL; - obt->recalc |= OB_RECALC; + obt->recalc |= OB_RECALC_ALL; } } else if(obt->type==OB_ARMATURE && obt->pose) { @@ -404,6 +404,9 @@ void unlink_object(Scene *scene, Object *ob) if(pchan->custom==ob) pchan->custom= NULL; } + } else if(ELEM(OB_MBALL, ob->type, obt->type)) { + if(is_mball_basis_for(obt, ob)) + obt->recalc|= OB_RECALC_DATA; } sca_remove_ob_poin(obt, ob); @@ -536,13 +539,7 @@ void unlink_object(Scene *scene, Object *ob) } tex= tex->id.next; } - - /* mballs (scene==NULL when called from library.c) */ - if(scene && ob->type==OB_MBALL) { - obt= find_basis_mball(scene, ob); - if(obt) freedisplist(&obt->disp); - } - + /* worlds */ wrld= G.main->world.first; while(wrld) { @@ -986,7 +983,7 @@ static char *get_obdata_defname(int type) case OB_MESH: return "Mesh"; case OB_CURVE: return "Curve"; case OB_SURF: return "Surf"; - case OB_FONT: return "Font"; + case OB_FONT: return "Text"; case OB_MBALL: return "Mball"; case OB_CAMERA: return "Camera"; case OB_LAMP: return "Lamp"; @@ -1090,7 +1087,7 @@ Object *add_object(struct Scene *scene, int type) base= scene_add_base(scene, ob); scene_select_base(scene, base); - ob->recalc |= OB_RECALC; + ob->recalc |= OB_RECALC_ALL; return ob; } @@ -1536,7 +1533,7 @@ void object_make_proxy(Object *ob, Object *target, Object *gob) ob->proxy_group= gob; id_lib_extern(&target->id); - ob->recalc= target->recalc= OB_RECALC; + ob->recalc= target->recalc= OB_RECALC_ALL; /* copy transform */ if(gob) { @@ -1605,20 +1602,8 @@ void object_make_proxy(Object *ob, Object *target, Object *gob) /* there is also a timing calculation in drawobject() */ -float bluroffs= 0.0f, fieldoffs= 0.0f; int no_speed_curve= 0; -/* ugly calls from render */ -void set_mblur_offs(float blur) -{ - bluroffs= blur; -} - -void set_field_offs(float field) -{ - fieldoffs= field; -} - void disable_speed_curve(int val) { no_speed_curve= val; @@ -1628,11 +1613,9 @@ void disable_speed_curve(int val) /* ob can be NULL */ float bsystem_time(struct Scene *scene, Object *ob, float cfra, float ofs) { - /* returns float ( see frame_to_float in ipo.c) */ + /* returns float ( see BKE_curframe in scene.c) */ + cfra += scene->r.subframe; - /* bluroffs and fieldoffs are ugly globals that are set by render */ - cfra+= bluroffs+fieldoffs; - /* global time */ if (scene) cfra*= scene->r.framelen; @@ -1741,10 +1724,8 @@ void object_to_mat4(Object *ob, float mat[][4]) object_to_mat3(ob, tmat); copy_m4_m3(mat, tmat); - - mat[3][0]= ob->loc[0] + ob->dloc[0]; - mat[3][1]= ob->loc[1] + ob->dloc[1]; - mat[3][2]= ob->loc[2] + ob->dloc[2]; + + add_v3_v3v3(mat[3], ob->loc, ob->dloc); } int enable_cu_speed= 1; @@ -2493,14 +2474,15 @@ void object_tfm_restore(Object *ob, void *obtfm_pt) /* requires flags to be set! */ void object_handle_update(Scene *scene, Object *ob) { - if(ob->recalc & OB_RECALC) { + if(ob->recalc & OB_RECALC_ALL) { /* speed optimization for animation lookups */ if(ob->pose) make_pose_channels_hash(ob->pose); /* XXX new animsys warning: depsgraph tag OB_RECALC_DATA should not skip drivers, which is only in where_is_object now */ - if(ob->recalc & OB_RECALC) { + // XXX: should this case be OB_RECALC_OB instead? + if(ob->recalc & OB_RECALC_ALL) { if (G.f & G_DEBUG) printf("recalcob %s\n", ob->id.name+2); @@ -2642,7 +2624,7 @@ void object_handle_update(Scene *scene, Object *ob) object_handle_update(scene, ob->proxy); } - ob->recalc &= ~OB_RECALC; + ob->recalc &= ~OB_RECALC_ALL; } /* the case when this is a group proxy, object_update is called in group.c */ diff --git a/source/blender/blenkernel/intern/packedFile.c b/source/blender/blenkernel/intern/packedFile.c index db457f043e7..b01f570898e 100644 --- a/source/blender/blenkernel/intern/packedFile.c +++ b/source/blender/blenkernel/intern/packedFile.c @@ -224,7 +224,7 @@ void packAll(Main *bmain, ReportList *reports) vf->packedfile = newPackedFile(reports, vf->name); for(sound=bmain->sound.first; sound; sound=sound->id.next) - if(sound->packedfile == NULL && vf->id.lib==NULL) + if(sound->packedfile == NULL && sound->id.lib==NULL) sound->packedfile = newPackedFile(reports, sound->name); } diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index 0c55cc2aaac..f33ac2ad380 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -3536,6 +3536,7 @@ ParticleSettings *psys_copy_settings(ParticleSettings *part) partn= copy_libblock(part); if(partn->pd) partn->pd= MEM_dupallocN(part->pd); if(partn->pd2) partn->pd2= MEM_dupallocN(part->pd2); + partn->effector_weights = MEM_dupallocN(part->effector_weights); partn->boids = boid_copy_settings(part->boids); diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index aa0ed983154..3ed2181f908 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -3925,7 +3925,7 @@ void particle_system_update(Scene *scene, Object *ob, ParticleSystem *psys) if(!psys_check_enabled(ob, psys)) return; - cfra= bsystem_time(scene, ob, (float)scene->r.cfra, 0.0f); + cfra= BKE_curframe(scene); sim.psmd= psys_get_modifier(ob, psys); /* system was already updated from modifier stack */ @@ -3943,7 +3943,7 @@ void particle_system_update(Scene *scene, Object *ob, ParticleSystem *psys) BKE_animsys_evaluate_animdata(&part->id, part->adt, cfra, ADT_RECALC_DRIVERS); /* TODO: only free child paths in case of PSYS_RECALC_CHILD */ - if(psys->recalc & PSYS_RECALC || ob->recalc & OB_RECALC) + if(psys->recalc & PSYS_RECALC || ob->recalc & OB_RECALC_ALL) psys_free_path_cache(psys, NULL); if(psys->recalc & PSYS_RECALC_CHILD) diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 4c38913fa56..cd4c2e9f98e 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -560,18 +560,17 @@ void set_scene_bg(Scene *scene) } /* called from creator.c */ -void set_scene_name(char *name) +Scene *set_scene_name(char *name) { - Scene *sce; - - for (sce= G.main->scene.first; sce; sce= sce->id.next) { - if (BLI_streq(name, sce->id.name+2)) { - set_scene_bg(sce); - return; - } + Scene *sce= (Scene *)find_id("SC", name); + if(sce) { + set_scene_bg(sce); + printf("Scene switch: '%s' in file: '%s'\n", name, G.sce); + return sce; } - - //XXX error("Can't find scene: %s", name); + + printf("Can't find scene: '%s' in file: '%s'\n", name, G.sce); + return NULL; } void unlink_scene(Main *bmain, Scene *sce, Scene *newsce) @@ -886,22 +885,16 @@ int scene_check_setscene(Scene *sce) return 1; } -/* This (evil) function is needed to cope with two legacy Blender rendering features -* mblur (motion blur that renders 'subframes' and blurs them together), and fields -* rendering. Thus, the use of ugly globals from object.c -*/ -// BAD... EVIL... JUJU...!!!! -// XXX moved here temporarily -float frame_to_float (Scene *scene, int cfra) /* see also bsystem_time in object.c */ +/* This function is needed to cope with fractional frames - including two Blender rendering features +* mblur (motion blur that renders 'subframes' and blurs them together), and fields rendering. */ + +/* see also bsystem_time in object.c */ +float BKE_curframe(Scene *scene) { - extern float bluroffs; /* bad stuff borrowed from object.c */ - extern float fieldoffs; - float ctime; - - ctime= (float)cfra; - ctime+= bluroffs+fieldoffs; - ctime*= scene->r.framelen; - + float ctime = scene->r.cfra; + ctime+= scene->r.subframe; + ctime*= scene->r.framelen; + return ctime; } @@ -921,6 +914,9 @@ static void scene_update_tagged_recursive(Scene *scene, Scene *scene_parent) if(ob->dup_group && (ob->transflag & OB_DUPLIGROUP)) group_handle_recalc_and_update(scene_parent, ob, ob->dup_group); + + /* always update layer, so that animating layers works */ + base->lay= ob->lay; } } @@ -936,7 +932,7 @@ void scene_update_tagged(Scene *scene) /* recalc scene animation data here (for sequencer) */ { - float ctime = frame_to_float(scene, scene->r.cfra); + float ctime = BKE_curframe(scene); AnimData *adt= BKE_animdata_from_id(&scene->id); if(adt && (adt->recalc & ADT_RECALC_ANIM)) @@ -953,7 +949,7 @@ void scene_update_tagged(Scene *scene) /* applies changes right away, does all sets too */ void scene_update_for_newframe(Scene *sce, unsigned int lay) { - float ctime = frame_to_float(sce, sce->r.cfra); + float ctime = BKE_curframe(sce); Scene *sce_iter; /* clear animation overrides */ diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 4241f481c30..a4c1527c3c5 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -49,6 +49,7 @@ #include "RNA_access.h" #include "RE_pipeline.h" +#include "BLI_math.h" #include "BLI_fileops.h" #include "BLI_listbase.h" #include "BLI_path_util.h" @@ -213,6 +214,8 @@ void seq_free_strip(Strip *strip) MEM_freeN(strip); } +static void seq_free_animdata(Scene *scene, Sequence *seq); + void seq_free_sequence(Scene *scene, Sequence *seq) { if(seq->strip) seq_free_strip(seq->strip); @@ -236,6 +239,8 @@ void seq_free_sequence(Scene *scene, Sequence *seq) sound_remove_scene_sound(scene, seq->scene_sound); } + seq_free_animdata(scene, seq); + MEM_freeN(seq); } @@ -545,8 +550,8 @@ void calc_sequence(Scene *scene, Sequence *seq) if(seq->type==SEQ_META) { seqm= seq->seqbase.first; if(seqm) { - min= 1000000; - max= -1000000; + min= MAXFRAME * 2; + max= -MAXFRAME * 2; while(seqm) { if(seqm->startdisp < min) min= seqm->startdisp; if(seqm->enddisp > max) max= seqm->enddisp; @@ -1488,15 +1493,16 @@ static StripColorBalance calc_cb(StripColorBalance * cb_) StripColorBalance cb = *cb_; int c; - if (cb.flag & SEQ_COLOR_BALANCE_INVERSE_LIFT) { - for (c = 0; c < 3; c++) { - cb.lift[c] = 1.0 - cb.lift[c]; - } - } else { + for (c = 0; c < 3; c++) { + cb.lift[c] = 2.0f - pow(cb.lift[c], 2); + } + + if(cb.flag & SEQ_COLOR_BALANCE_INVERSE_LIFT) { for (c = 0; c < 3; c++) { - cb.lift[c] = -(1.0 - cb.lift[c]); + cb.lift[c] = 2.0f - cb.lift[c]; } } + if (cb.flag & SEQ_COLOR_BALANCE_INVERSE_GAIN) { for (c = 0; c < 3; c++) { if (cb.gain[c] != 0.0) { @@ -1520,25 +1526,22 @@ static StripColorBalance calc_cb(StripColorBalance * cb_) return cb; } +/* pow(p[c] * cb.gain[c] + cb.lift[c], cb.gamma[c]) * mul;*/ +MINLINE float color_balance_fl(const float v, const float lift, const float gain, const float gamma, const float mul) +{ + return powf(powf(v * gain, lift), gamma) * mul; +} + static void make_cb_table_byte(float lift, float gain, float gamma, unsigned char * table, float mul) { int y; for (y = 0; y < 256; y++) { - float v = 1.0 * y / 255; - v *= gain; - v += lift; - v = pow(v, gamma); - v *= mul; - if ( v > 1.0) { - v = 1.0; - } else if (v < 0.0) { - v = 0.0; - } + float v= color_balance_fl((float)y * (1.0 / 255.0f), lift, gain, gamma, mul); + CLAMP(v, 0.0f, 1.0f); table[y] = v * 255; } - } static void make_cb_table_float(float lift, float gain, float gamma, @@ -1547,11 +1550,7 @@ static void make_cb_table_float(float lift, float gain, float gamma, int y; for (y = 0; y < 256; y++) { - float v = (float) y * 1.0 / 255.0; - v *= gain; - v += lift; - v = pow(v, gamma); - v *= mul; + float v= color_balance_fl((float)y * (1.0 / 255.0f), lift, gain, gamma, mul); table[y] = v; } } @@ -1622,8 +1621,7 @@ static void color_balance_float_float(Sequence * seq, TStripElem* se, float mul) while (p < e) { int c; for (c = 0; c < 3; c++) { - p[c] = pow(p[c] * cb.gain[c] + cb.lift[c], - cb.gamma[c]) * mul; + p[c]= color_balance_fl(p[c], cb.lift[c], cb.gain[c], cb.gamma[c], mul); } p += 4; } @@ -3842,6 +3840,33 @@ void seq_offset_animdata(Scene *scene, Sequence *seq, int ofs) } } +/* XXX - hackish function needed to remove all fcurves belonging to a sequencer strip */ +static void seq_free_animdata(Scene *scene, Sequence *seq) +{ + char str[32]; + FCurve *fcu; + + if(scene->adt==NULL || scene->adt->action==NULL) + return; + + sprintf(str, "[\"%s\"]", seq->name+2); + + fcu= scene->adt->action->curves.first; + + while (fcu) { + if(strstr(fcu->rna_path, "sequence_editor.sequences_all[") && strstr(fcu->rna_path, str)) { + FCurve *next_fcu = fcu->next; + + BLI_remlink(&scene->adt->action->curves, fcu); + free_fcurve(fcu); + + fcu = next_fcu; + } else { + fcu = fcu->next; + } + } +} + Sequence *get_seq_by_name(ListBase *seqbase, const char *name, int recursive) { @@ -3909,7 +3934,7 @@ int seq_active_pair_get(Scene *scene, Sequence **seq_act, Sequence **seq_other) void seq_load_apply(Scene *scene, Sequence *seq, SeqLoadInfo *seq_load) { if(seq) { - strcpy(seq->name, seq_load->name); + BLI_strncpy(seq->name+2, seq_load->name, sizeof(seq->name)-2); seqbase_unique_name_recursive(&scene->ed->seqbase, seq); if(seq_load->flag & SEQ_LOAD_FRAME_ADVANCE) { @@ -3963,8 +3988,7 @@ Sequence *sequencer_add_image_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo seq = alloc_sequence(seqbasep, seq_load->start_frame, seq_load->channel); seq->type= SEQ_IMAGE; - BLI_strncpy(seq->name+2, "Image", SEQ_NAME_MAXSTR-2); - seqbase_unique_name_recursive(&scene->ed->seqbase, seq); + seq->blend_mode= SEQ_CROSS; /* so alpha adjustment fade to the strip below */ /* basic defaults */ seq->strip= strip= MEM_callocN(sizeof(Strip), "strip"); @@ -3972,8 +3996,8 @@ Sequence *sequencer_add_image_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo strip->len = seq->len = seq_load->len ? seq_load->len : 1; strip->us= 1; strip->stripdata= se= MEM_callocN(seq->len*sizeof(StripElem), "stripelem"); - BLI_split_dirfile(seq_load->path, strip->dir, se->name); - + BLI_strncpy(strip->dir, seq_load->path, sizeof(strip->dir)); + seq_load_apply(scene, seq, seq_load); return seq; @@ -4056,8 +4080,9 @@ Sequence *sequencer_add_movie_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo return NULL; seq = alloc_sequence(seqbasep, seq_load->start_frame, seq_load->channel); - seq->type= SEQ_MOVIE; + seq->blend_mode= SEQ_CROSS; /* so alpha adjustment fade to the strip below */ + seq->anim= an; seq->anim_preseek = IMB_anim_get_preseek(an); BLI_strncpy(seq->name+2, "Movie", SEQ_NAME_MAXSTR-2); @@ -4085,6 +4110,9 @@ Sequence *sequencer_add_movie_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo seq_load->channel--; } + if(seq_load->name[0] == '\0') + BLI_strncpy(seq_load->name, se->name, sizeof(seq_load->name)); + /* can be NULL */ seq_load_apply(scene, seq, seq_load); diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c index 31826f5be28..57816b7e470 100644 --- a/source/blender/blenkernel/intern/texture.c +++ b/source/blender/blenkernel/intern/texture.c @@ -451,6 +451,7 @@ void default_tex(Tex *tex) tex->nabla= 0.025; // also in do_versions tex->bright= 1.0; tex->contrast= 1.0; + tex->saturation= 1.0; tex->filtersize= 1.0; tex->rfac= 1.0; tex->gfac= 1.0; @@ -1132,6 +1133,7 @@ PointDensity *BKE_add_pointdensity(void) pd->totpoints = 0; pd->object = NULL; pd->psys = 0; + pd->psys_cache_space= TEX_PD_WORLDSPACE; return pd; } diff --git a/source/blender/blenlib/BLI_path_util.h b/source/blender/blenlib/BLI_path_util.h index fb30e991200..d149f15cd35 100644 --- a/source/blender/blenlib/BLI_path_util.h +++ b/source/blender/blenlib/BLI_path_util.h @@ -33,6 +33,10 @@ #ifndef BLI_UTIL_H #define BLI_UTIL_H +#ifdef __cplusplus +extern "C" { +#endif + struct ListBase; struct direntry; @@ -45,6 +49,63 @@ char *BLI_gethome_folder(char *folder_name, int flag); #define BLI_GETHOME_USER 1<<3 /* home folder ~/.blender */ #define BLI_GETHOME_ALL (BLI_GETHOME_SYSTEM|BLI_GETHOME_LOCAL|BLI_GETHOME_USER) + +#ifdef __APPLE__ +typedef enum { + BasePath_Temporary = 1, + BasePath_BlenderShared, + BasePath_BlenderUser, + BasePath_ApplicationBundle +} basePathesTypes; + +/** + * Gets the base path. The path may not exist. + * Note that return string must be copied as its persistence is not guaranteed + * + * @return base path of pathType + */ +const char* BLI_osx_getBasePath(basePathesTypes pathType); +#endif + +char *BLI_get_folder(int folder_id, char *subfolder); +char *BLI_get_folder_create(int folder_id, char *subfolder); + +/* folder_id */ + +/* general, will find baserd on user/local/system priority */ +#define BLENDER_CONFIG 1 +#define BLENDER_DATAFILES 2 +#define BLENDER_SCRIPTS 3 +#define BLENDER_PLUGINS 4 +#define BLENDER_PYTHON 5 + +/* user-specific */ +#define BLENDER_USER_CONFIG 31 +#define BLENDER_USER_DATAFILES 32 +#define BLENDER_USER_SCRIPTS 33 +#define BLENDER_USER_PLUGINS 34 + +/* system */ +#define BLENDER_SYSTEM_CONFIG 51 /* optional */ +#define BLENDER_SYSTEM_DATAFILES 52 +#define BLENDER_SYSTEM_SCRIPTS 53 +#define BLENDER_SYSTEM_PLUGINS 54 +#define BLENDER_SYSTEM_PYTHON 54 + +#define BLENDER_TEMP 80 + +#define BLENDER_USERFOLDER(id) (id >= BLENDER_USER_CONFIG && id <= BLENDER_USER_PLUGINS) + +#define BLENDER_STARTUP_FILE "startup.blend" +#define BLENDER_BOOKMARK_FILE "bookmarks.txt" +#define BLENDER_HISTORY_FILE "recent-files.txt" + +#ifdef WIN32 +#define BLENDER_BASE_FORMAT "%s\\Blender Foundation\\Blender\\%s" +#else +#define BLENDER_BASE_FORMAT "%s/.blender/%s" +#endif + void BLI_setenv(const char *env, const char *val); void BLI_setenv_if_new(const char *env, const char* val); @@ -135,18 +196,13 @@ char *get_install_dir(void); void BLI_where_is_temp(char *fullname, int usertemp); - /** - * determines the full path to the application bundle on OS X - * - * @return path to application bundle - */ -#ifdef __APPLE__ -char* BLI_getbundle(void); -#endif - #ifdef WITH_ICONV void BLI_string_to_utf8(char *original, char *utf_8, const char *code); #endif +#ifdef __cplusplus +} +#endif + #endif diff --git a/source/blender/blenlib/intern/BLI_args.c b/source/blender/blenlib/intern/BLI_args.c index dc964639e68..8d72311f80b 100644 --- a/source/blender/blenlib/intern/BLI_args.c +++ b/source/blender/blenlib/intern/BLI_args.c @@ -284,7 +284,8 @@ void BLI_argsParse(struct bArgs *ba, int pass, BA_ArgCallback default_cb, void * } i += retval; } else if (retval == -1){ - ba->passes[i] = pass; + if (a->key->pass != -1) + ba->passes[i] = pass; break; } } diff --git a/source/blender/blenlib/intern/BLI_bfile.c b/source/blender/blenlib/intern/BLI_bfile.c index dc593e23bdc..b9ac6875b20 100644 --- a/source/blender/blenlib/intern/BLI_bfile.c +++ b/source/blender/blenlib/intern/BLI_bfile.c @@ -34,6 +34,7 @@ #else #include <io.h> #include "BLI_winstuff.h" + static char* find_in_pathlist(char* filename, char* pathlist); #endif #include <sys/types.h> #include <sys/stat.h> @@ -47,8 +48,6 @@ #include "BLI_storage.h" #include "BLI_bfile.h" -#include "GHOST_C-api.h" - /* Internal bfile classification flags */ #define BCF_OPEN (0) #define BCF_FOPEN (1<<0) @@ -63,13 +62,8 @@ /* Declaration of internal functions */ -static void chomp(char* line); -static void expand_envvars(char* src, char* dst); static void fill_paths(BFILE *bfile, const char *path, const char *relpath); -static char* find_in_pathlist(char* filename, char* pathlist); -static void init_vars_from_file(const char* path); static void free_paths(BFILE* bfile); -static void setup_temp(); /*** Exported functions ***/ @@ -274,205 +268,9 @@ void BLI_bfile_set_error(BFILE *bfile, int error) { } -void BLI_bfile_init_vars() { - char file[MAXPATHLEN]; - char temp[MAXPATHLEN]; - extern char bprogname[]; - FILE* fp; - - /* This one is unconditional */ - sprintf(temp, "%d", BLENDER_VERSION); - BLI_setenv("BLENDER_VERSION", temp); - - /* Is this unpack&run? */ - sprintf(temp, "%s/%d/environment", dirname(bprogname), BLENDER_VERSION); - if (BLI_exist(temp)) { - BLI_setenv_if_new("BLENDER_SHARE", dirname(bprogname)); - } else { - BLI_setenv_if_new("BLENDER_SHARE", (const char*)GHOST_getSystemDir()); - } - - strcpy(file, (const char*)GHOST_getUserDir()); - BLI_add_slash(file); - strcat(file, LAST_SESSION_FILE); - fp = fopen(file, "r"); - /* 1st line, read previous version */ - if (fp && (fscanf(fp, "%3c\n", temp) == 1)) { - temp[3] = '\0'; - BLI_setenv("BLENDER_VERSION_PREV", temp); - /* 2nd line, read previous session path if needed */ - if (!getenv("BLENDER_TEMP")) { - if ((fgets(temp, MAXPATHLEN, fp) != NULL)) { - /* Clean any \n */ - chomp(temp); - /* Check the dir is still there or generate new one */ - if (!BLI_exist(temp)) { - setup_temp(); - } - } else { - /* We have to generate it for sure */ - setup_temp(); - } - } - } else { - /* Probably new user, or only <=249 before */ - BLI_setenv("BLENDER_VERSION_PREV", "0"); - setup_temp(); - } - - if (fp) { - fclose(fp); - } - - /* Loaded session info (or created), so time to store current data */ - // TODO use own fuctions to get safe saving - fp = fopen(file, "w"); - if (fp) { - fprintf(fp, "%s\n%s\n", getenv("BLENDER_VERSION"), getenv("BLENDER_TEMP")); - fclose(fp); - } - - /* Load vars from user and system files */ - strcpy(file, (const char *)GHOST_getUserDir()); - BLI_add_slash(file); - strcat(file, ENVIRONMENT_FILE); - init_vars_from_file(file); - sprintf(temp, "/%d/environment", BLENDER_VERSION); - BLI_make_file_string("/", file, getenv("BLENDER_SHARE"), temp); - init_vars_from_file(file); -} - - /*** Internal functions ***/ /** - Eliminate trailing EOL by writing a \0 over it. - Name taken from Perl. - */ -static void chomp(char* line) { - int len = strlen(line); -#ifndef WIN32 - if (line[len - 1] == '\n') { - line[len - 1] = '\0'; - } -#else - if ((line[len - 2] == '\r' ) && ((line[len - 1] == '\n'))) { - line[len - 2] = '\0'; - } -#endif /* WIN32 */ -} - - -/** - Parse a file with lines like FOO=bar (comment lines have # as first - character) assigning to envvar FOO the value bar if FOO does not - exist yet. - Any white space before FOO, around the = or trailing will be used, - so beware. - */ -#define MAX_LINE 4096 -#define ENV_VAR 256 -#define VAR_LEN 8192 -static void init_vars_from_file(const char* path) { - char line[MAX_LINE]; - char name[ENV_VAR]; - FILE *fp; - char* separator; - char expanded[VAR_LEN]; - - fp = fopen(path, "r"); - if (!fp) return; - - while (fgets(line, MAX_LINE, fp) != NULL) { - /* Ignore comment lines */ - if (line[0] == '#') - continue; - - /* Split into envvar name and contents */ - separator = strchr(line, '='); - if (separator && ((separator - line) < ENV_VAR)) { - /* First remove EOL */ - chomp(line); - strncpy(name, line, separator - line); - name[separator - line] = '\0'; - expand_envvars(separator + 1, expanded); - BLI_setenv_if_new(name, expanded); - } - } - fclose(fp); -} - - -/** - Look for ${} (or %%) env vars in src and expand if the var - exists (even if empty value). If not exist, the name is left as is. - The process is done all over src, and nested ${${}} is not supported. - src must be \0 terminated, and dst must be big enough. -*/ -#ifndef WIN32 - #define ENVVAR_PREFFIX "${" - #define ENVVAR_P_SIZE 2 - #define ENVVAR_SUFFIX "}" - #define ENVVAR_S_SIZE 1 -#else - #define ENVVAR_PREFFIX "%" - #define ENVVAR_P_SIZE 1 - #define ENVVAR_SUFFIX "%" - #define ENVVAR_S_SIZE 1 -#endif /* WIN32 */ -static void expand_envvars(char* src, char* dst) { - char* hit1; - char* hit2; - char name[ENV_VAR]; - char* value; - int prevlen; - int done = 0; - char* source = src; - - dst[0] = '\0'; - while (!done) { - hit1 = strstr(source, ENVVAR_PREFFIX); - if (hit1) { - hit2 = strstr(hit1 + ENVVAR_P_SIZE, ENVVAR_SUFFIX); - if (hit2) { - /* "Copy" the leading part, if any */ - if (hit1 != source) { - prevlen = strlen(dst); - strncat(dst, source, hit1 - source); - dst[prevlen + (hit1 - source)] = '\0'; - } - /* Figure the name of the env var we just found */ - strncpy(name, hit1 + ENVVAR_P_SIZE, - hit2 - (hit1 + ENVVAR_P_SIZE)); - name[hit2 - (hit1 + ENVVAR_P_SIZE)] = '\0'; - /* See if we can get something with that name */ - value = getenv(name); - if (value) { - /* Push the var value */ - strcat(dst, value); - } else { - /* Leave the var name, so it is clear that it failed */ - strcat(dst, ENVVAR_PREFFIX); - strcat(dst, name); - strcat(dst, ENVVAR_SUFFIX); - } - /* Continue after closing mark, like a new string */ - source = hit2 + ENVVAR_S_SIZE; - } else { - /* Non terminated var so "copy as is" and finish */ - strcat(dst, source); - done = 1; - } - } else { - /* "Copy" whatever is left */ - strcat(dst, source); - done = 1; - } - } -} - - -/** Return a full path if the filename exists when combined with any item from pathlist. Or NULL otherwise. */ @@ -481,6 +279,8 @@ static void expand_envvars(char* src, char* dst) { #else #define SEPARATOR ':' #endif + +#ifdef WIN32 static char* find_in_pathlist(char* filename, char* pathlist) { char first[FILE_MAX + 10]; char* rest = NULL; @@ -510,7 +310,7 @@ static char* find_in_pathlist(char* filename, char* pathlist) { return NULL; } } - +#endif /** Setup fpath and tpath based in the needs of the bfile. @@ -570,24 +370,3 @@ static void free_paths(BFILE* bfile) { MEM_freeN(bfile->tpath); } } - - -/** - Create a temp directory in safe and multiuser way. - */ -static void setup_temp() { - char template[MAXPATHLEN]; - char* tempdir; - - if (getenv("TMPDIR")) { - sprintf(template, "%s/blender-XXXXXX", getenv("TMPDIR")); - } else { - sprintf(template, "/tmp/blender-XXXXXX"); -// MacOSX NSTemporaryDirectory and WIN32 ??? -// https://bugs.launchpad.net/cuneiform-linux/+bug/267136 -// https://svn.r-project.org/R/trunk/src/main/mkdtemp.c - } - tempdir = mkdtemp(template); - BLI_setenv("BLENDER_TEMP", tempdir); -} - diff --git a/source/blender/blenlib/intern/bpath.c b/source/blender/blenlib/intern/bpath.c index a56cbb65538..fbe71019379 100644 --- a/source/blender/blenlib/intern/bpath.c +++ b/source/blender/blenlib/intern/bpath.c @@ -62,9 +62,6 @@ /* for sequence */ //XXX #include "BSE_sequence.h" //XXX define below from BSE_sequence.h - otherwise potentially odd behaviour -#define SEQ_HAS_PATH(_seq) ( (_seq)->type==SEQ_MOVIE || (_seq)->type==SEQ_IMAGE || (_seq)->type==SEQ_SOUND ) - - #define FILE_MAX 240 diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c index 045ac5a013f..7be8e069bd0 100644 --- a/source/blender/blenlib/intern/path_util.c +++ b/source/blender/blenlib/intern/path_util.c @@ -44,9 +44,9 @@ #include "BLI_storage_types.h" #include "BKE_utildefines.h" +#include "BKE_blender.h" // BLENDER_VERSION - - +#include "GHOST_Path-api.h" #ifdef WIN32 @@ -63,11 +63,6 @@ #else /* non windows */ -#ifdef __APPLE__ -#include <sys/param.h> -#include <CoreFoundation/CoreFoundation.h> -#endif - #ifdef __linux__ #include "binreloc.h" #endif @@ -107,7 +102,7 @@ int BLI_stringdec(const char *string, char *head, char *tail, unsigned short *nu if (found) break; } } - if (found){ + if (found) { if (tail) strcpy(tail, &string[nume+1]); if (head) { strcpy(head,string); @@ -765,7 +760,11 @@ char *BLI_gethome(void) { } - /* add user profile support for WIN 2K / NT */ + /* add user profile support for WIN 2K / NT. + * This is %APPDATA%, which translates to either + * %USERPROFILE%\Application Data or since Vista + * to %USERPROFILE%\AppData\Roaming + */ hResult = SHGetFolderPath(NULL, CSIDL_APPDATA, NULL, SHGFP_TYPE_CURRENT, appdatapath); if (hResult == S_OK) @@ -800,7 +799,7 @@ char *BLI_gethome(void) { /* this function returns the path to a blender folder, if it exists * utility functions for BLI_gethome_folder */ -/* #define PATH_DEBUG */ /* for testing paths that are checked */ +// #define PATH_DEBUG /* for testing paths that are checked */ static int test_data_path(char *targetpath, char *path_base, char *path_sep, char *folder_name) { @@ -911,6 +910,272 @@ char *BLI_gethome_folder(char *folder_name, int flag) return NULL; } + +/* NEW stuff, to be cleaned up when fully migrated */ +/* ************************************************************* */ +/* ************************************************************* */ + +// #define PATH_DEBUG2 + +static char *blender_version_decimal(void) +{ + static char version_str[5]; + sprintf(version_str, "%d.%02d", BLENDER_VERSION/100, BLENDER_VERSION%100); + return version_str; +} + +static int test_path(char *targetpath, char *path_base, char *path_sep, char *folder_name) +{ + char tmppath[FILE_MAX]; + + if(path_sep) BLI_join_dirfile(tmppath, path_base, path_sep); + else BLI_strncpy(tmppath, path_base, sizeof(tmppath)); + + BLI_make_file_string("/", targetpath, tmppath, folder_name); + + if (BLI_exists(targetpath)) { +#ifdef PATH_DEBUG2 + printf("\tpath found: %s\n", targetpath); +#endif + return 1; + } + else { +#ifdef PATH_DEBUG2 + printf("\tpath missing: %s\n", targetpath); +#endif + //targetpath[0] = '\0'; + return 0; + } +} + +static int test_env_path(char *path, char *envvar) +{ + char *env = envvar?getenv(envvar):NULL; + if (!env) return 0; + + if (BLI_exists(env)) { + BLI_strncpy(path, env, FILE_MAX); + return 1; + } else { + path[0] = '\0'; + return 0; + } +} + +static int get_path_local(char *targetpath, char *folder_name) +{ + extern char bprogname[]; /* argv[0] from creator.c */ + char bprogdir[FILE_MAX]; + char cwd[FILE_MAX]; + char *s; + int i; + +#ifdef PATH_DEBUG2 + printf("get_path_local...\n"); +#endif + + + /* use argv[0] (bprogname) to get the path to the executable */ + s = BLI_last_slash(bprogname); + i = s - bprogname + 1; + BLI_strncpy(bprogdir, bprogname, i); + + /* try EXECUTABLE_DIR/folder_name */ + if(test_path(targetpath, bprogdir, "", folder_name)) + return 1; + + /* try CWD/release/folder_name */ + if(test_path(targetpath, BLI_getwdN(cwd), "release", folder_name)) + return 1; + + /* try EXECUTABLE_DIR/release/folder_name */ + if(test_path(targetpath, bprogdir, "release", folder_name)) + return 1; + + /* try EXECUTABLE_DIR/2.5/folder_name - new default directory for local blender installed files */ + if(test_path(targetpath, bprogdir, blender_version_decimal(), folder_name)) + return 1; + + /* try ./.blender/folder_name -- DEPRECATED, need to update build systems */ + if(test_path(targetpath, bprogdir, ".blender", folder_name)) + return 1; + + return 0; +} + +static int get_path_user(char *targetpath, char *folder_name, char *envvar) +{ + char user_path[FILE_MAX]; + const char *user_base_path; + + user_path[0] = '\0'; + + if (test_env_path(targetpath, envvar)) + return 1; + + user_base_path = (const char *)GHOST_getUserDir(); + if (user_base_path) { + BLI_snprintf(user_path, FILE_MAX, BLENDER_BASE_FORMAT, user_base_path, blender_version_decimal()); + } + + if(!user_path[0]) + return 0; + +#ifdef PATH_DEBUG2 + printf("get_path_user: %s\n", user_path); +#endif + + /* try $HOME/folder_name */ + return test_path(targetpath, user_path, NULL, folder_name); +} + +static int get_path_system(char *targetpath, char *folder_name, char *envvar) +{ + char system_path[FILE_MAX]; + const char *system_base_path; + + system_path[0] = '\0'; + + if (test_env_path(targetpath, envvar)) + return 1; + + system_base_path = (const char *)GHOST_getSystemDir(); + if (system_base_path) { + BLI_snprintf(system_path, FILE_MAX, BLENDER_BASE_FORMAT, system_base_path, blender_version_decimal()); + } + + if(!system_path[0]) + return 0; + +#ifdef PATH_DEBUG2 + printf("get_path_system: %s\n", system_path); +#endif + + /* try $BLENDERPATH/folder_name */ + return test_path(targetpath, system_path, NULL, folder_name); +} + +/* get a folder out of the 'folder_id' presets for paths */ +/* returns the path if found, NULL string if not */ +char *BLI_get_folder(int folder_id, char *subfolder) +{ + static char path[FILE_MAX] = ""; + char search_path[FILE_MAX]; + + switch (folder_id) { + case BLENDER_DATAFILES: /* general case */ + BLI_join_dirfile(search_path, "datafiles", subfolder); + if (get_path_user(path, search_path, "BLENDER_USER_DATAFILES")) break; + if (get_path_local(path, search_path)) break; + if (get_path_system(path, search_path, "BLENDER_SYSTEM_DATAFILES")) break; + return NULL; + + case BLENDER_USER_DATAFILES: + BLI_join_dirfile(search_path, "datafiles", subfolder); + if (get_path_user(path, search_path, "BLENDER_USER_DATAFILES")) break; + return NULL; + + case BLENDER_SYSTEM_DATAFILES: + BLI_join_dirfile(search_path, "datafiles", subfolder); + if (get_path_system(path, search_path, "BLENDER_SYSTEM_DATAFILES")) break; + return NULL; + + case BLENDER_CONFIG: /* general case */ + BLI_join_dirfile(search_path, "config", subfolder); + if (get_path_user(path, search_path, "BLENDER_USER_CONFIG")) break; + if (get_path_local(path, search_path)) break; + if (get_path_system(path, search_path, "BLENDER_SYSTEM_CONFIG")) break; + return NULL; + + case BLENDER_USER_CONFIG: + BLI_join_dirfile(search_path, "config", subfolder); + if (get_path_user(path, search_path, "BLENDER_USER_CONFIG")) break; + return NULL; + + case BLENDER_SYSTEM_CONFIG: + BLI_join_dirfile(search_path, "config", subfolder); + if (get_path_system(path, search_path, "BLENDER_SYSTEM_CONFIG")) break; + return NULL; + + case BLENDER_SCRIPTS: /* general case */ + BLI_join_dirfile(search_path, "scripts", subfolder); + if (get_path_user(path, search_path, "BLENDER_USER_SCRIPTS")) break; + if (get_path_local(path, search_path)) break; + if (get_path_system(path, search_path, "BLENDER_SYSTEM_SCRIPTS")) break; + return NULL; + + case BLENDER_USER_SCRIPTS: + BLI_join_dirfile(search_path, "scripts", subfolder); + if (get_path_user(path, search_path, "BLENDER_USER_SCRIPTS")) break; + return NULL; + + case BLENDER_SYSTEM_SCRIPTS: + BLI_join_dirfile(search_path, "scripts", subfolder); + if (get_path_system(path, search_path, "BLENDER_SYSTEM_SCRIPTS")) break; + return NULL; + + case BLENDER_PYTHON: /* general case */ + BLI_join_dirfile(search_path, "python", subfolder); + if (get_path_local(path, search_path)) break; + if (get_path_system(path, search_path, "BLENDER_SYSTEM_PYTHON")) break; + return NULL; + + case BLENDER_SYSTEM_PYTHON: + BLI_join_dirfile(search_path, "python", subfolder); + + if (get_path_system(path, search_path, "BLENDER_SYSTEM_PYTHON")) break; + return NULL; + } + + return path; +} + +static char *BLI_get_user_folder_notest(int folder_id, char *subfolder) +{ + static char path[FILE_MAX] = ""; + char search_path[FILE_MAX]; + + switch (folder_id) { + case BLENDER_USER_DATAFILES: + BLI_join_dirfile(search_path, "datafiles", subfolder); + get_path_user(path, search_path, "BLENDER_USER_DATAFILES"); + break; + case BLENDER_USER_CONFIG: + BLI_join_dirfile(search_path, "config", subfolder); + get_path_user(path, search_path, "BLENDER_USER_CONFIG"); + break; + } + if ('\0' == path[0]) { + return NULL; + } + return path; +} + +char *BLI_get_folder_create(int folder_id, char *subfolder) +{ + char *path; + + /* only for user folders */ + if (!ELEM(folder_id, BLENDER_USER_DATAFILES, BLENDER_USER_CONFIG)) + return NULL; + + path = BLI_get_folder(folder_id, subfolder); + + if (!path) { + path = BLI_get_user_folder_notest(folder_id, subfolder); + if (path) BLI_recurdir_fileops(path); + } + + return path; +} + + +/* End new stuff */ +/* ************************************************************* */ +/* ************************************************************* */ + + + #ifdef PATH_DEBUG #undef PATH_DEBUG #endif @@ -1164,6 +1429,9 @@ void BLI_join_dirfile(char *string, const char *dir, const char *file) if(string != dir) /* compare pointers */ BLI_strncpy(string, dir, FILE_MAX); + + if (!file) + return; sl_dir= BLI_add_slash(string); @@ -1471,26 +1739,6 @@ char *get_install_dir(void) { } } -/* - * returns absolute path to the app bundle - * only useful on OS X - */ -#ifdef __APPLE__ -char* BLI_getbundle(void) { - CFURLRef bundleURL; - CFStringRef pathStr; - static char path[MAXPATHLEN]; - CFBundleRef mainBundle = CFBundleGetMainBundle(); - - bundleURL = CFBundleCopyBundleURL(mainBundle); - pathStr = CFURLCopyFileSystemPath(bundleURL, kCFURLPOSIXPathStyle); - CFStringGetCString(pathStr, path, MAXPATHLEN, kCFStringEncodingASCII); - CFRelease(pathStr); - CFRelease(bundleURL); - return path; -} -#endif - #ifdef WITH_ICONV void BLI_string_to_utf8(char *original, char *utf_8, const char *code) diff --git a/source/blender/blenlib/intern/pbvh.c b/source/blender/blenlib/intern/pbvh.c index 92e2c88e8a1..82e2090c432 100644 --- a/source/blender/blenlib/intern/pbvh.c +++ b/source/blender/blenlib/intern/pbvh.c @@ -30,6 +30,7 @@ #include "BKE_DerivedMesh.h" #include "BKE_mesh.h" /* for mesh_calc_normals */ +#include "BKE_global.h" /* for mesh_calc_normals */ #include "gpu_buffers.h" @@ -350,12 +351,14 @@ static void build_mesh_leaf_node(PBVH *bvh, PBVHNode *node) if(node->face_vert_indices[i] < 0) node->face_vert_indices[i]= -node->face_vert_indices[i] + node->uniq_verts - 1; - node->draw_buffers = - GPU_build_mesh_buffers(map, bvh->verts, bvh->faces, + if(!G.background) { + node->draw_buffers = + GPU_build_mesh_buffers(map, bvh->verts, bvh->faces, node->prim_indices, node->totprim, node->vert_indices, node->uniq_verts, node->uniq_verts + node->face_verts); + } node->flag |= PBVH_UpdateDrawBuffers; @@ -364,10 +367,11 @@ static void build_mesh_leaf_node(PBVH *bvh, PBVHNode *node) static void build_grids_leaf_node(PBVH *bvh, PBVHNode *node) { - node->draw_buffers = - GPU_build_grid_buffers(bvh->grids, node->prim_indices, + if(!G.background) { + node->draw_buffers = + GPU_build_grid_buffers(bvh->grids, node->prim_indices, node->totprim, bvh->gridsize); - + } node->flag |= PBVH_UpdateDrawBuffers; } diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index e10a982dc2a..e16448472da 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -959,11 +959,11 @@ static FileData *blo_decode_and_check(FileData *fd, ReportList *reports) FileData *blo_openblenderfile(char *name, ReportList *reports) { gzFile gzfile; - + errno= 0; gzfile= gzopen(name, "rb"); - if (NULL == gzfile) { - BKE_report(reports, RPT_ERROR, "Unable to open"); + if (gzfile == Z_NULL) { + BKE_reportf(reports, RPT_ERROR, "Unable to open \"%s\": %s.", name, errno ? strerror(errno) : "Unknown erro reading file"); return NULL; } else { FileData *fd = filedata_new(); @@ -996,7 +996,7 @@ FileData *blo_openblendermemory(void *mem, int memsize, ReportList *reports) FileData *blo_openblendermemfile(MemFile *memfile, ReportList *reports) { if (!memfile) { - BKE_report(reports, RPT_ERROR, "Unable to open"); + BKE_report(reports, RPT_ERROR, "Unable to open blend <memory>"); return NULL; } else { FileData *fd= filedata_new(); @@ -2244,7 +2244,7 @@ static void lib_link_pose(FileData *fd, Object *ob, bPose *pose) } if(rebuild) { - ob->recalc= OB_RECALC; + ob->recalc= OB_RECALC_ALL; pose->flag |= POSE_RECALC; } } @@ -3458,7 +3458,7 @@ static void lib_link_object(FileData *fd, Main *main) /* this triggers object_update to always use a copy */ ob->proxy->proxy_from= ob; /* force proxy updates after load/undo, a bit weak */ - ob->recalc= ob->proxy->recalc= OB_RECALC; + ob->recalc= ob->proxy->recalc= OB_RECALC_ALL; } } ob->proxy_group= newlibadr(fd, ob->id.lib, ob->proxy_group); @@ -4571,6 +4571,7 @@ static void lib_link_screen(FileData *fd, Main *main) if(sc->id.flag & LIB_NEEDLINK) { sc->id.us= 1; sc->scene= newlibadr(fd, sc->id.lib, sc->scene); + sc->animtimer= NULL; /* saved in rare cases */ sa= sc->areabase.first; while(sa) { @@ -7915,7 +7916,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) if(ob->type==OB_ARMATURE) { if(ob->pose) ob->pose->flag |= POSE_RECALC; - ob->recalc |= OB_RECALC; // cannot call stuff now (pointers!), done in setup_app_data + ob->recalc |= OB_RECALC_ALL; // cannot call stuff now (pointers!), done in setup_app_data /* new generic xray option */ arm= newlibadr(fd, lib, ob->data); @@ -10878,6 +10879,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) Object *ob; Scene *scene; bScreen *sc; + Tex *tex; for (sc= main->screen.first; sc; sc= sc->id.next) { ScrArea *sa; @@ -10886,11 +10888,27 @@ static void do_versions(FileData *fd, Library *lib, Main *main) for (sl= sa->spacedata.first; sl; sl= sl->next) { if (sl->spacetype == SPACE_NODE) { SpaceNode *snode= (SpaceNode *)sl; - + ListBase *regionbase; + ARegion *ar; + + if (sl == sa->spacedata.first) + regionbase = &sa->regionbase; + else + regionbase = &sl->regionbase; + if (snode->v2d.minzoom > 0.09f) snode->v2d.minzoom= 0.09f; if (snode->v2d.maxzoom < 2.31f) snode->v2d.maxzoom= 2.31f; + + for (ar= regionbase->first; ar; ar= ar->next) { + if (ar->regiontype == RGN_TYPE_WINDOW) { + if (ar->v2d.minzoom > 0.09f) + ar->v2d.minzoom= 0.09f; + if (ar->v2d.maxzoom < 2.31f) + ar->v2d.maxzoom= 2.31f; + } + } } else if (sl->spacetype == SPACE_TIME) { SpaceTime *stime= (SpaceTime *)sl; @@ -10952,6 +10970,13 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } } + for(tex= main->tex.first; tex; tex= tex->id.next) { + /* if youre picky, this isn't correct until we do a version bump + * since you could set saturation to be 0.0*/ + if(tex->saturation==0.0f) + tex->saturation= 1.0f; + } + } /* WATCH IT!!!: pointers from libdata have not been converted yet here! */ @@ -10960,13 +10985,14 @@ static void do_versions(FileData *fd, Library *lib, Main *main) /* don't forget to set version number in blender.c! */ } +#if 0 // XXX: disabled for now... we still don't have this in the right place in the loading code for it to work static void do_versions_after_linking(FileData *fd, Library *lib, Main *main) { - /* old Animation System (using IPO's) needs to be converted to the new Animato system - */ + /* old Animation System (using IPO's) needs to be converted to the new Animato system */ if(main->versionfile < 250) do_versions_ipos_to_animato(main); } +#endif static void lib_link_all(FileData *fd, Main *main) { @@ -11114,7 +11140,7 @@ BlendFileData *blo_read_file_internal(FileData *fd, const char *filename) blo_join_main(&fd->mainlist); lib_link_all(fd, bfd->main); - do_versions_after_linking(fd, NULL, bfd->main); + //do_versions_after_linking(fd, NULL, bfd->main); // XXX: not here (or even in this function at all)! this causes crashes on many files - Aligorith (July 04, 2010) lib_verify_nodetree(bfd->main, 1); fix_relpaths_library(fd->relabase, bfd->main); /* make all relative paths, relative to the open blend file */ @@ -12084,7 +12110,7 @@ static void give_base_to_groups(Main *mainvar, Scene *scene) base= scene_add_base(scene, ob); base->flag |= SELECT; base->object->flag= base->flag; - ob->recalc |= OB_RECALC; + ob->recalc |= OB_RECALC_ALL; scene->basact= base; /* assign the group */ @@ -12143,6 +12169,7 @@ static void append_named_part(const bContext *C, Main *mainl, FileData *fd, char ob->lay = scene->lay; } } + ob->mode= 0; base->lay= ob->lay; base->object= ob; ob->id.us++; diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index faa6a131e8f..f873dca4011 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -2506,7 +2506,7 @@ int BLO_write_file(Main *mainvar, char *dir, int write_flags, ReportList *report file = open(tempname,O_BINARY+O_WRONLY+O_CREAT+O_TRUNC, 0666); if(file == -1) { - BKE_report(reports, RPT_ERROR, "Unable to open file for writing."); + BKE_reportf(reports, RPT_ERROR, "Can't open file for writing: %s.", strerror(errno)); return 0; } @@ -2527,7 +2527,7 @@ int BLO_write_file(Main *mainvar, char *dir, int write_flags, ReportList *report makeFilesAbsolute(G.sce, NULL); } - BLI_make_file_string(G.sce, userfilename, BLI_gethome(), ".B25.blend"); + BLI_make_file_string(G.sce, userfilename, BLI_get_folder_create(BLENDER_USER_CONFIG, NULL), BLENDER_STARTUP_FILE); write_user_block= BLI_streq(dir, userfilename); if(write_flags & G_FILE_RELATIVE_REMAP) diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c index fee66384e65..09fbdf2d70d 100644 --- a/source/blender/editors/animation/anim_channels_defines.c +++ b/source/blender/editors/animation/anim_channels_defines.c @@ -3206,6 +3206,7 @@ void ANIM_channel_draw_widgets (bAnimContext *ac, bAnimListElem *ale, uiBlock *b */ if ((draw_sliders) && ELEM(ale->type, ANIMTYPE_FCURVE, ANIMTYPE_SHAPEKEY)) { /* adjust offset */ + // TODO: make slider width dynamic, so that they can be easier to use when the view is wide enough offset += SLIDER_WIDTH; /* need backdrop behind sliders... */ diff --git a/source/blender/editors/animation/anim_deps.c b/source/blender/editors/animation/anim_deps.c index 82575cf58fa..5312e97c604 100644 --- a/source/blender/editors/animation/anim_deps.c +++ b/source/blender/editors/animation/anim_deps.c @@ -90,7 +90,7 @@ void ANIM_list_elem_update(Scene *scene, bAnimListElem *ale) else { /* in other case we do standard depsgaph update, ideally we'd be calling property update functions here too ... */ - DAG_id_flush_update(id, OB_RECALC); // XXX or do we want something more restrictive? + DAG_id_flush_update(id, OB_RECALC_ALL); // XXX or do we want something more restrictive? } } @@ -106,7 +106,7 @@ void ANIM_id_update(Scene *scene, ID *id) adt->recalc |= ADT_RECALC_ANIM; /* set recalc flags */ - DAG_id_flush_update(id, OB_RECALC); // XXX or do we want something more restrictive? + DAG_id_flush_update(id, OB_RECALC_ALL); // XXX or do we want something more restrictive? } } diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c index 67f2cb834e0..a9c9830f07f 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -797,7 +797,7 @@ bAnimListElem *make_new_animlistelem (void *data, short datatype, void *owner, s /* ----------------------------------------- */ /* NOTE: when this function returns true, the F-Curve is to be skipped */ -static int skip_fcurve_selected_data(FCurve *fcu, ID *owner_id, int filter_mode) +static int skip_fcurve_selected_data(bDopeSheet *ads, FCurve *fcu, ID *owner_id, int filter_mode) { if (GS(owner_id->name) == ID_OB) { Object *ob= (Object *)owner_id; @@ -814,9 +814,8 @@ static int skip_fcurve_selected_data(FCurve *fcu, ID *owner_id, int filter_mode) /* check whether to continue or skip */ if ((pchan) && (pchan->bone)) { - /* if only visible channels, skip if bone not visible */ - // TODO: should we just do this always? - if (filter_mode & ANIMFILTER_VISIBLE) { + /* if only visible channels, skip if bone not visible unless user wants channels from hidden data too */ + if ((filter_mode & ANIMFILTER_VISIBLE) && !(ads->filterflag & ADS_FILTER_INCL_HIDDEN)) { bArmature *arm= (bArmature *)ob->data; if ((arm->layer & pchan->bone->layer) == 0) @@ -887,7 +886,7 @@ static FCurve *animdata_filter_fcurve_next (bDopeSheet *ads, FCurve *first, bAct * - this will also affect things like Drivers, and also works for Bone Constraints */ if ( ((ads) && (ads->filterflag & ADS_FILTER_ONLYSEL)) && (owner_id) ) { - if (skip_fcurve_selected_data(fcu, owner_id, filter_mode)) + if (skip_fcurve_selected_data(ads, fcu, owner_id, filter_mode)) continue; } @@ -946,6 +945,13 @@ static int animdata_filter_action (bAnimContext *ac, ListBase *anim_data, bDopeS FCurve *lastchan=NULL; int items = 0; + /* don't include anything from this action if it is linked in from another file, + * and we're getting stuff for editing... + */ + // TODO: need a way of tagging other channels that may also be affected... + if ((filter_mode & ANIMFILTER_FOREDIT) && (act->id.lib)) + return 0; + /* loop over groups */ // TODO: in future, should we expect to need nested groups? for (agrp= act->groups.first; agrp; agrp= agrp->next) { @@ -2105,11 +2111,14 @@ static int animdata_filter_dopesheet (bAnimContext *ac, ListBase *anim_data, bDo /* firstly, check if object can be included, by the following factors: * - if only visible, must check for layer and also viewport visibility + * --> while tools may demand only visible, user setting takes priority + * as user option controls whether sets of channels get included while + * tool-flag takes into account collapsed/open channels too * - if only selected, must check if object is selected * - there must be animation data to edit */ // TODO: if cache is implemented, just check name here, and then - if (filter_mode & ANIMFILTER_VISIBLE) { + if ((filter_mode & ANIMFILTER_VISIBLE) && !(ads->filterflag & ADS_FILTER_INCL_HIDDEN)) { /* layer visibility - we check both object and base, since these may not be in sync yet */ if ((sce->lay & (ob->lay|base->lay))==0) continue; diff --git a/source/blender/editors/animation/anim_ops.c b/source/blender/editors/animation/anim_ops.c index 88d6051b23b..11ba3cfffed 100644 --- a/source/blender/editors/animation/anim_ops.c +++ b/source/blender/editors/animation/anim_ops.c @@ -69,6 +69,7 @@ static void change_frame_apply(bContext *C, wmOperator *op) /* set the new frame number */ CFRA= RNA_int_get(op->ptr, "frame"); FRAMENUMBER_MIN_CLAMP(CFRA); + SUBFRA = 0.f; /* do updates */ sound_seek_scene(C); diff --git a/source/blender/editors/animation/keyframes_draw.c b/source/blender/editors/animation/keyframes_draw.c index a8c184937d9..2290909325e 100644 --- a/source/blender/editors/animation/keyframes_draw.c +++ b/source/blender/editors/animation/keyframes_draw.c @@ -240,7 +240,7 @@ static BezTriple *abk_get_bezt_with_value (ActBeztColumn *abk, float value) /* look over each BezTriple in this container */ for (i = 0; i < abk->numBezts; i++) { /* only do exact match for now... */ - if (i >= sizeof(abk->bezts)/sizeof(BezTriple)) { + if (/*i >= MAX_ABK_BUFSIZE*/0) { // TODO: this case needs special handling } else { @@ -283,7 +283,7 @@ static void add_bezt_to_keyblocks_list(DLRBT_Tree *blocks, DLRBT_Tree *beztTree, abk= (ActBeztColumn *)BLI_dlrbTree_search_prev(beztTree, compare_abk_bezt, beztn); /* if applicable, the BezTriple with the same value */ prev= (abk) ? abk_get_bezt_with_value(abk, beztn->vec[1][1]) : NULL; - + /* check if block needed - same value(s)? * -> firstly, handles must have same central value as each other * -> secondly, handles which control that section of the curve must be constant diff --git a/source/blender/editors/animation/keyingsets.c b/source/blender/editors/animation/keyingsets.c index f496cec7b39..1c06266a148 100644 --- a/source/blender/editors/animation/keyingsets.c +++ b/source/blender/editors/animation/keyingsets.c @@ -918,7 +918,7 @@ int ANIM_apply_keyingset (bContext *C, ListBase *dsources, bAction *act, KeyingS { Object *ob= (Object *)ksp->id; - ob->recalc |= OB_RECALC; + ob->recalc |= OB_RECALC_ALL; // XXX: only object transforms only? } break; } diff --git a/source/blender/editors/armature/editarmature_sketch.c b/source/blender/editors/armature/editarmature_sketch.c index fdc89936029..a1af68458f6 100644 --- a/source/blender/editors/armature/editarmature_sketch.c +++ b/source/blender/editors/armature/editarmature_sketch.c @@ -2679,6 +2679,7 @@ static int sketch_draw_modal(bContext *C, wmOperator *op, wmEvent *event, short RNA_boolean_set(op->ptr, "snap", snap); break; case MOUSEMOVE: + case INBETWEEN_MOUSEMOVE: dd->mval[0] = event->mval[0]; dd->mval[1] = event->mval[1]; sk_draw_stroke(C, sketch, stk, dd, snap); diff --git a/source/blender/editors/armature/meshlaplacian.c b/source/blender/editors/armature/meshlaplacian.c index 546a15467c4..0325232e5b9 100644 --- a/source/blender/editors/armature/meshlaplacian.c +++ b/source/blender/editors/armature/meshlaplacian.c @@ -1922,7 +1922,7 @@ static void heat_weighting_bind(Scene *scene, DerivedMesh *dm, MeshDeformModifie } #endif -void mesh_deform_bind(Scene *scene, DerivedMesh *dm, MeshDeformModifierData *mmd, float *vertexcos, int totvert, float cagemat[][4]) +void mesh_deform_bind(Scene *scene, MeshDeformModifierData *mmd, float *vertexcos, int totvert, float cagemat[][4]) { MeshDeformBind mdb; MVert *mvert; diff --git a/source/blender/editors/armature/meshlaplacian.h b/source/blender/editors/armature/meshlaplacian.h index 4e5fbec9c82..640eb33c945 100644 --- a/source/blender/editors/armature/meshlaplacian.h +++ b/source/blender/editors/armature/meshlaplacian.h @@ -78,7 +78,7 @@ void rigid_deform_end(int cancel); /* Harmonic Coordinates */ -void mesh_deform_bind(struct Scene *scene, struct DerivedMesh *dm, +void mesh_deform_bind(struct Scene *scene, struct MeshDeformModifierData *mmd, float *vertexcos, int totvert, float cagemat[][4]); diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index dad111432de..186f3f20082 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -5219,8 +5219,8 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newname) float tmp_vec[3] = {0.f, 0.f, 0.f}; if(newname) { - rename_id((ID *)obedit, "SurfDonut"); - rename_id((ID *)obedit->data, "SurfDonut"); + rename_id((ID *)obedit, "SurfTorus"); + rename_id((ID *)obedit->data, "SurfTorus"); } xzproj= 1; diff --git a/source/blender/editors/curve/editfont.c b/source/blender/editors/curve/editfont.c index 3a5f185c550..7d5af54b640 100644 --- a/source/blender/editors/curve/editfont.c +++ b/source/blender/editors/curve/editfont.c @@ -417,7 +417,7 @@ void FONT_OT_file_paste(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - WM_operator_properties_filesel(ot, FOLDERFILE|TEXTFILE, FILE_SPECIAL, FILE_OPENFILE, 0); + WM_operator_properties_filesel(ot, FOLDERFILE|TEXTFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH); } /******************* paste buffer operator ********************/ @@ -1732,7 +1732,7 @@ void FONT_OT_open(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - WM_operator_properties_filesel(ot, FOLDERFILE|FTFONTFILE, FILE_SPECIAL, FILE_OPENFILE, 0); + WM_operator_properties_filesel(ot, FOLDERFILE|FTFONTFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH); } /******************* delete operator *********************/ diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h index 230a3e8a3dd..5fb7fa41752 100644 --- a/source/blender/editors/include/ED_anim_api.h +++ b/source/blender/editors/include/ED_anim_api.h @@ -102,8 +102,11 @@ typedef struct bAnimListElem { int flag; /* copy of elem's flags for quick access */ int index; /* for un-named data, the index of the data in it's collection */ - void *key_data; /* motion data - mostly F-Curves, but can be other types too */ + short elemFlag; /* flags for the list elem instance (not the data it represents) */ + short datatype; /* type of motion data to expect */ + void *key_data; /* motion data - mostly F-Curves, but can be other types too */ + struct ID *id; /* ID block that channel is attached to */ struct AnimData *adt; /* source of the animation data attached to ID block (for convenience) */ diff --git a/source/blender/editors/include/ED_armature.h b/source/blender/editors/include/ED_armature.h index 67387dc2e08..d2d1e2a1d69 100644 --- a/source/blender/editors/include/ED_armature.h +++ b/source/blender/editors/include/ED_armature.h @@ -165,7 +165,7 @@ void BDR_drawSketch(const struct bContext *vc); int BDR_drawSketchNames(struct ViewContext *vc); /* meshlaplacian.c */ -void mesh_deform_bind(struct Scene *scene, struct DerivedMesh *dm, +void mesh_deform_bind(struct Scene *scene, struct MeshDeformModifierData *mmd, float *vertexcos, int totvert, float cagemat[][4]); diff --git a/source/blender/editors/include/ED_keyframing.h b/source/blender/editors/include/ED_keyframing.h index 86a1f5c4031..fc5e3a43a62 100644 --- a/source/blender/editors/include/ED_keyframing.h +++ b/source/blender/editors/include/ED_keyframing.h @@ -257,7 +257,7 @@ short fcurve_frame_has_keyframe(struct FCurve *fcu, float frame, short filter); * Checks whether a keyframe exists for the given ID-block one the given frame. * - It is recommended to call this method over the other keyframe-checkers directly, * in case some detail of the implementation changes... - * - frame: the value of this is quite often result of frame_to_float(CFRA) + * - frame: the value of this is quite often result of BKE_curframe() */ short id_frame_has_keyframe(struct ID *id, float frame, short filter); diff --git a/source/blender/editors/include/ED_render.h b/source/blender/editors/include/ED_render.h index 6100ecd436f..f34670da471 100644 --- a/source/blender/editors/include/ED_render.h +++ b/source/blender/editors/include/ED_render.h @@ -78,6 +78,7 @@ void ED_preview_free_dbase(void); void ED_preview_shader_job(const struct bContext *C, void *owner, struct ID *id, struct ID *parent, struct MTex *slot, int sizex, int sizey, int method); void ED_preview_icon_job(const struct bContext *C, void *owner, struct ID *id, unsigned int *rect, int sizex, int sizey); +void ED_preview_kill_jobs(const struct bContext *C); void ED_preview_draw(const struct bContext *C, void *idp, void *parentp, void *slot, rcti *rect); diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index db479b45472..93e91d02599 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -142,7 +142,7 @@ typedef struct uiLayout uiLayout; #define UI_BUT_ALIGN_DOWN (1<<17) #define UI_BUT_DISABLED (1<<18) -#define UI_BUT_UNUSED (1<<19) +#define UI_BUT_COLOR_LOCK (1<<19) #define UI_BUT_ANIMATED (1<<20) #define UI_BUT_ANIMATED_KEY (1<<21) #define UI_BUT_DRIVEN (1<<22) @@ -152,6 +152,9 @@ typedef struct uiLayout uiLayout; #define UI_BUT_IMMEDIATE (1<<26) #define UI_BUT_NO_TOOLTIP (1<<27) +#define UI_BUT_VEC_SIZE_LOCK (1<<28) /* used to flag if color hsv-circle should keep luminance */ +#define UI_BUT_COLOR_CUBIC (1<<29) /* cubic saturation for the color wheel */ + #define UI_PANEL_WIDTH 340 #define UI_COMPACT_PANEL_WIDTH 160 @@ -676,14 +679,14 @@ void uiTemplateAnyID(uiLayout *layout, struct bContext *C, struct PointerRNA *pt void uiTemplatePathBuilder(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, char *propname, struct PointerRNA *root_ptr, char *text); uiLayout *uiTemplateModifier(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, int compact); -uiLayout *uiTemplateConstraint(uiLayout *layout, struct PointerRNA *ptr); +uiLayout *uiTemplateConstraint(uiLayout *layout, struct PointerRNA *ptr, int compact); void uiTemplatePreview(uiLayout *layout, struct ID *id, struct ID *parent, struct MTex *slot); void uiTemplateColorRamp(uiLayout *layout, struct PointerRNA *ptr, char *propname, int expand); void uiTemplateHistogram(uiLayout *layout, struct PointerRNA *ptr, char *propname, int expand); void uiTemplateWaveform(uiLayout *layout, struct PointerRNA *ptr, char *propname, int expand); void uiTemplateVectorscope(uiLayout *layout, struct PointerRNA *ptr, char *propname, int expand); void uiTemplateCurveMapping(uiLayout *layout, struct PointerRNA *ptr, char *propname, int type, int levels, int brush); -void uiTemplateColorWheel(uiLayout *layout, struct PointerRNA *ptr, char *propname, int value_slider, int lock); +void uiTemplateColorWheel(uiLayout *layout, struct PointerRNA *ptr, char *propname, int value_slider, int lock, int lock_luminosity, int cubic); void uiTemplateTriColorSet(uiLayout *layout, struct PointerRNA *ptr, char *propname); void uiTemplateLayers(uiLayout *layout, struct PointerRNA *ptr, char *propname, PointerRNA *used_ptr, char *used_propname, int active_layer); diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 1f9c2bb9ce0..a19113d4b27 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -24,6 +24,7 @@ */ #include <float.h> +#include <limits.h> #include <math.h> #include <stdlib.h> #include <string.h> @@ -235,7 +236,7 @@ static uiBut *ui_but_last(uiBlock *block) static int ui_is_a_warp_but(uiBut *but) { if(U.uiflag & USER_CONTINUOUS_MOUSE) - if(ELEM(but->type, NUM, NUMABS)) + if(ELEM3(but->type, NUM, NUMABS, HSVCIRCLE)) return TRUE; return FALSE; @@ -2223,7 +2224,6 @@ static int ui_numedit_but_NUM(uiBut *but, uiHandleButtonData *data, float fac, i softmax= but->softmax; softrange= softmax - softmin; - if(ui_is_a_warp_but(but)) { /* Mouse location isn't screen clamped to the screen so use a linear mapping * 2px == 1-int, or 1px == 1-ClickStep */ @@ -2283,15 +2283,18 @@ static int ui_numedit_but_NUM(uiBut *but, uiHandleButtonData *data, float fac, i /* Use a non-linear mapping of the mouse drag especially for large floats (normal behavior) */ deler= 500; if(!ui_is_but_float(but)) { - if((softrange)<100) deler= 200.0; - if((softrange)<25) deler= 50.0; + /* prevent large ranges from getting too out of control */ + if (softrange > 600) deler = powf(softrange, 0.75); + + if (softrange < 100) deler= 200.0; + if (softrange < 25) deler= 50.0; } deler /= fac; - if(ui_is_but_float(but) && softrange > 11) { + if(softrange > 11) { /* non linear change in mouse input- good for high precicsion */ data->dragf+= (((float)(mx-data->draglastx))/deler) * (fabs(data->dragstartx-mx)*0.002); - } else if (!ui_is_but_float(but) && softrange > 129) { /* only scale large int buttons */ + } else if (softrange > 129) { /* only scale large int buttons */ /* non linear change in mouse input- good for high precicsionm ints need less fine tuning */ data->dragf+= (((float)(mx-data->draglastx))/deler) * (fabs(data->dragstartx-mx)*0.004); } else { @@ -2299,8 +2302,7 @@ static int ui_numedit_but_NUM(uiBut *but, uiHandleButtonData *data, float fac, i data->dragf+= ((float)(mx-data->draglastx))/deler ; } - if(data->dragf>1.0) data->dragf= 1.0; - if(data->dragf<0.0) data->dragf= 0.0; + CLAMP(data->dragf, 0.0, 1.0); data->draglastx= mx; tempf= (softmin + data->dragf*softrange); @@ -2312,7 +2314,7 @@ static int ui_numedit_but_NUM(uiBut *but, uiHandleButtonData *data, float fac, i CLAMP(temp, softmin, softmax); lvalue= (int)data->value; - + if(temp != lvalue) { data->dragchange= 1; data->value= (double)temp; @@ -3045,7 +3047,7 @@ static int ui_do_but_HSVCUBE(bContext *C, uiBlock *block, uiBut *but, uiHandleBu return WM_UI_HANDLER_CONTINUE; } -static int ui_numedit_but_HSVCIRCLE(uiBut *but, uiHandleButtonData *data, int mx, int my) +static int ui_numedit_but_HSVCIRCLE(uiBut *but, uiHandleButtonData *data, int mx, int my, int shift) { rcti rect; int changed= 1; @@ -3059,13 +3061,29 @@ static int ui_numedit_but_HSVCIRCLE(uiBut *but, uiHandleButtonData *data, int mx /* exception, when using color wheel in 'locked' value state: * allow choosing a hue for black values, by giving a tiny increment */ - if (but->a2 == 1) { // lock + if (but->flag & UI_BUT_COLOR_LOCK) { // lock if (hsv[2] == 0.f) hsv[2] = 0.0001f; } - + + if(U.uiflag & USER_CONTINUOUS_MOUSE) { + float fac= shift ? 0.02 : 0.1; + /* slow down the mouse, this is fairly picky */ + mx = (data->dragstartx*(1.0f-fac) + mx*fac); + my = (data->dragstarty*(1.0f-fac) + my*fac); + } + ui_hsvcircle_vals_from_pos(hsv, hsv+1, &rect, (float)mx, (float)my); - + + if(but->flag & UI_BUT_COLOR_CUBIC) + hsv[1]= 1.0f - sqrt3f(1.0f - hsv[1]); + hsv_to_rgb(hsv[0], hsv[1], hsv[2], rgb, rgb+1, rgb+2); + + if((but->flag & UI_BUT_VEC_SIZE_LOCK) && (rgb[0] || rgb[1] || rgb[2])) { + normalize_v3(rgb); + mul_v3_fl(rgb, but->a2); + } + ui_set_but_vectorf(but, rgb); data->draglastx= mx; @@ -3092,7 +3110,7 @@ static int ui_do_but_HSVCIRCLE(bContext *C, uiBlock *block, uiBut *but, uiHandle button_activate_state(C, but, BUTTON_STATE_NUM_EDITING); /* also do drag the first time */ - if(ui_numedit_but_HSVCIRCLE(but, data, mx, my)) + if(ui_numedit_but_HSVCIRCLE(but, data, mx, my, event->shift)) ui_numedit_apply(C, block, but, data); return WM_UI_HANDLER_BREAK; @@ -3143,7 +3161,7 @@ static int ui_do_but_HSVCIRCLE(bContext *C, uiBlock *block, uiBut *but, uiHandle } else if(event->type == MOUSEMOVE) { if(mx!=data->draglastx || my!=data->draglasty) { - if(ui_numedit_but_HSVCIRCLE(but, data, mx, my)) + if(ui_numedit_but_HSVCIRCLE(but, data, mx, my, event->shift)) ui_numedit_apply(C, block, but, data); } } diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index 622b9ddbfdf..499fe3b9767 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -457,25 +457,20 @@ static void init_internal_icons() ImBuf *bbuf= NULL; int x, y, icontype; char iconfilestr[FILE_MAXDIR+FILE_MAXFILE]; - char filenamestr[FILE_MAXFILE+16]; // 16 == strlen(".blender/icons/")+1 if ((btheme!=NULL) && (strlen(btheme->tui.iconfile) > 0)) { - -#ifdef WIN32 - sprintf(filenamestr, "icons/%s", btheme->tui.iconfile); -#else - sprintf(filenamestr, ".blender/icons/%s", btheme->tui.iconfile); -#endif - - BLI_make_file_string("/", iconfilestr, BLI_gethome(), filenamestr); - - if (BLI_exists(iconfilestr)) { - bbuf = IMB_loadiffname(iconfilestr, IB_rect); - if(bbuf->x < ICON_IMAGE_W || bbuf->y < ICON_IMAGE_H) { - if (G.f & G_DEBUG) - printf("\n***WARNING***\nIcons file %s too small.\nUsing built-in Icons instead\n", iconfilestr); - IMB_freeImBuf(bbuf); - bbuf= NULL; + char *datadir= BLI_get_folder(BLENDER_DATAFILES, NULL); + if (datadir) { + BLI_make_file_string("/", iconfilestr, datadir, btheme->tui.iconfile); + + if (BLI_exists(iconfilestr)) { + bbuf = IMB_loadiffname(iconfilestr, IB_rect); + if(bbuf->x < ICON_IMAGE_W || bbuf->y < ICON_IMAGE_H) { + if (G.f & G_DEBUG) + printf("\n***WARNING***\nIcons file %s too small.\nUsing built-in Icons instead\n", iconfilestr); + IMB_freeImBuf(bbuf); + bbuf= NULL; + } } } } @@ -555,14 +550,14 @@ static void init_iconfile_list(struct ListBase *list) char icondirstr[FILE_MAX]; char iconfilestr[FILE_MAX+16]; /* allow 256 chars for file+dir */ char olddir[FILE_MAX]; - + char *datadir= NULL; + list->first = list->last = NULL; + datadir = BLI_get_folder(BLENDER_DATAFILES, NULL); -#ifdef WIN32 - BLI_make_file_string("/", icondirstr, BLI_gethome(), "icons"); -#else - BLI_make_file_string("/", icondirstr, BLI_gethome(), ".blender/icons"); -#endif + if (!datadir) return; + + BLI_make_file_string("/", icondirstr, datadir, ""); if(BLI_exists(icondirstr)==0) return; diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index ecefcf93c28..cb8130573fe 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -184,8 +184,11 @@ struct uiBut { struct bContextStore *context; + /* not ysed yet, was used in 2.4x for ui_draw_pulldown_round & friends */ + /* void (*embossfunc)(int , int , float, float, float, float, float, int); void (*sliderfunc)(int , float, float, float, float, float, float, int); + */ uiButCompleteFunc autocomplete_func; void *autofunc_arg; @@ -228,12 +231,12 @@ struct uiBut { /* Operator data */ struct wmOperatorType *optype; - int opcontext; struct IDProperty *opproperties; struct PointerRNA *opptr; + short opcontext; /* Draggable data, type is WM_DRAG_... */ - int dragtype; + short dragtype; void *dragpoin; struct ImBuf *imb; float imb_scale; diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index d91cdd5c20d..b7b9a2156ef 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -431,18 +431,14 @@ static void ui_item_array(uiLayout *layout, uiBlock *block, char *name, int icon but->type= TOG; } } - else if(ELEM(subtype, PROP_COLOR, PROP_COLOR_GAMMA) && len == 4) { - but= uiDefAutoButR(block, ptr, prop, 3, "A:", 0, 0, 0, w, UI_UNIT_Y); - if(slider && but->type==NUM) - but->type= NUMSLI; - } } uiBlockSetCurLayout(block, layout); } -static void ui_item_enum_row(uiLayout *layout, uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, char *uiname, int x, int y, int w, int h, int icon_only) +static void ui_item_enum_expand(uiLayout *layout, uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, char *uiname, int x, int y, int w, int h, int icon_only) { + uiBut *but; EnumPropertyItem *item; const char *identifier; char *name; @@ -462,11 +458,14 @@ static void ui_item_enum_row(uiLayout *layout, uiBlock *block, PointerRNA *ptr, itemw= ui_text_icon_width(block->curlayout, name, icon, 0); if(icon && strcmp(name, "") != 0 && !icon_only) - uiDefIconTextButR(block, ROW, 0, icon, name, 0, 0, itemw, h, ptr, identifier, -1, 0, value, -1, -1, NULL); + but= uiDefIconTextButR(block, ROW, 0, icon, name, 0, 0, itemw, h, ptr, identifier, -1, 0, value, -1, -1, NULL); else if(icon) - uiDefIconButR(block, ROW, 0, icon, 0, 0, itemw, h, ptr, identifier, -1, 0, value, -1, -1, NULL); + but= uiDefIconButR(block, ROW, 0, icon, 0, 0, itemw, h, ptr, identifier, -1, 0, value, -1, -1, NULL); else - uiDefButR(block, ROW, 0, name, 0, 0, itemw, h, ptr, identifier, -1, 0, value, -1, -1, NULL); + but= uiDefButR(block, ROW, 0, name, 0, 0, itemw, h, ptr, identifier, -1, 0, value, -1, -1, NULL); + + if(ui_layout_local_dir(layout) != UI_LAYOUT_HORIZONTAL) + but->flag |= UI_TEXT_LEFT; } uiBlockSetCurLayout(block, layout); @@ -514,7 +513,7 @@ static uiBut *ui_item_with_label(uiLayout *layout, uiBlock *block, char *name, i uiDefAutoButR(block, ptr, prop, index, "", icon, x, y, w-UI_UNIT_X, h); /* BUTTONS_OT_file_browse calls uiFileBrowseContextProperty */ - but= uiDefIconButO(block, BUT, "BUTTONS_OT_file_browse", WM_OP_INVOKE_DEFAULT, ICON_FILESEL, x, y, UI_UNIT_X, h, "Browse for file or directory"); + but= uiDefIconButO(block, BUT, "BUTTONS_OT_file_browse", WM_OP_INVOKE_DEFAULT, ICON_FILESEL, x, y, UI_UNIT_X, h, NULL); } else if(subtype == PROP_DIRECTION) { uiDefButR(block, BUT_NORMAL, 0, name, x, y, 100, 100, ptr, RNA_property_identifier(prop), index, 0, 0, -1, -1, NULL); @@ -614,6 +613,9 @@ PointerRNA uiItemFullO(uiLayout *layout, char *idname, char *name, int icon, IDP w= ui_text_icon_width(layout, name, icon, 0); + if (flag & UI_ITEM_R_NO_BG) + uiBlockSetEmboss(block, UI_EMBOSSN); + if(icon && strcmp(name, "") != 0) but= uiDefIconTextButO(block, BUT, ot->idname, context, icon, (char*)name, 0, 0, w, UI_UNIT_Y, NULL); else if(icon) @@ -624,7 +626,10 @@ PointerRNA uiItemFullO(uiLayout *layout, char *idname, char *name, int icon, IDP /* text alignment for toolbar buttons */ if((layout->root->type == UI_LAYOUT_TOOLBAR) && !icon) but->flag |= UI_TEXT_LEFT; - + + if (flag & UI_ITEM_R_NO_BG) + uiBlockSetEmboss(block, UI_EMBOSS); + /* assign properties */ if(properties || (flag & UI_ITEM_O_RETURN_PROPS)) { PointerRNA *opptr= uiButGetOperatorPtrRNA(but); @@ -946,7 +951,7 @@ void uiItemFullR(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int index } /* expanded enum */ else if(type == PROP_ENUM && expand) - ui_item_enum_row(layout, block, ptr, prop, name, 0, 0, w, h, icon_only); + ui_item_enum_expand(layout, block, ptr, prop, name, 0, 0, w, h, icon_only); /* property with separate label */ else if(type == PROP_ENUM || type == PROP_STRING || type == PROP_POINTER) { but= ui_item_with_label(layout, block, name, icon, ptr, prop, index, 0, 0, w, h, flag); @@ -1291,8 +1296,10 @@ static void ui_item_menu(uiLayout *layout, char *name, int icon, uiMenuCreateFun if(layout->root->type == UI_LAYOUT_HEADER) uiBlockSetEmboss(block, UI_EMBOSS); - else if(layout->root->type == UI_LAYOUT_PANEL) + else if(layout->root->type == UI_LAYOUT_PANEL) { but->type= MENU; + but->flag |= UI_TEXT_LEFT; + } } void uiItemM(uiLayout *layout, bContext *C, char *menuname, char *name, int icon) diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c index 419de8eb898..20752099814 100644 --- a/source/blender/editors/interface/interface_ops.c +++ b/source/blender/editors/interface/interface_ops.c @@ -322,6 +322,8 @@ static int copy_to_selected_list(bContext *C, PointerRNA *ptr, ListBase *lb) *lb = CTX_data_collection_get(C, "selected_editable_bones"); else if(RNA_struct_is_a(ptr->type, &RNA_PoseBone)) *lb = CTX_data_collection_get(C, "selected_pose_bones"); + else if(RNA_struct_is_a(ptr->type, &RNA_Sequence)) + *lb = CTX_data_collection_get(C, "selected_editable_sequences"); else return 0; diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index d44e4b2b4dc..fb00d4f968e 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -1795,6 +1795,9 @@ static void uiBlockPicker(uiBlock *block, float *rgb, PointerRNA *ptr, PropertyR linearrgb_to_srgb_v3_v3(rgb_gamma, rgb); } + /* sneaky way to check for alpha */ + rgb[3]= FLT_MAX; + RNA_property_float_ui_range(ptr, prop, &min, &max, &step, &precision); RNA_property_float_get_array(ptr, prop, rgb); rgb_to_hsv(rgb[0], rgb[1], rgb[2], hsv, hsv+1, hsv+2); @@ -1835,6 +1838,7 @@ static void uiBlockPicker(uiBlock *block, float *rgb, PointerRNA *ptr, PropertyR uiButSetFunc(bt, do_picker_rna_cb, bt, NULL); bt= uiDefButR(block, NUMSLI, 0, "B ", 0, -100, butwidth, UI_UNIT_Y, ptr, propname, 2, 0.0, 0.0, 0, 0, ""); uiButSetFunc(bt, do_picker_rna_cb, bt, NULL); + // could use uiItemFullR(col, ptr, prop, -1, 0, UI_ITEM_R_EXPAND|UI_ITEM_R_SLIDER, "", 0); // but need to use uiButSetFunc for updating other fake buttons @@ -1847,7 +1851,15 @@ static void uiBlockPicker(uiBlock *block, float *rgb, PointerRNA *ptr, PropertyR bt= uiDefButF(block, NUMSLI, 0, "V ", 0, -100, butwidth, UI_UNIT_Y, hsv+2, 0.0, max, 10, 3, ""); uiButSetFunc(bt, do_hsv_rna_cb, bt, hsv); uiBlockEndAlign(block); - + + if(rgb[3] != FLT_MAX) { + bt= uiDefButR(block, NUMSLI, 0, "A ", 0, -120, butwidth, UI_UNIT_Y, ptr, propname, 3, 0.0, 0.0, 0, 0, ""); + uiButSetFunc(bt, do_picker_rna_cb, bt, NULL); + } + else { + rgb[3]= 1.0f; + } + rgb_to_hsv(rgb[0], rgb[1], rgb[2], hsv, hsv+1, hsv+2); sprintf(hexcol, "%02X%02X%02X", (unsigned int)(rgb_gamma[0]*255.0), (unsigned int)(rgb_gamma[1]*255.0), (unsigned int)(rgb_gamma[2]*255.0)); diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 93529d31fcf..93c93b07232 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -80,11 +80,15 @@ void uiTemplateDopeSheetFilter(uiLayout *layout, bContext *C, PointerRNA *ptr) uiLayout *row= layout; short nlaActive= ((sa) && (sa->spacetype==SPACE_NLA)); - /* more 'generic' filtering options */ + /* most 'generic' filtering options */ row= uiLayoutRow(layout, 1); uiItemR(row, ptr, "only_selected", 0, "", 0); - uiItemR(row, ptr, "display_transforms", 0, "", 0); // xxx: include in another position instead? + uiItemR(row, ptr, "display_hidden", 0, "", 0); + + /* object-level filtering options */ + row= uiLayoutRow(layout, 1); + uiItemR(row, ptr, "display_transforms", 0, "", 0); if (nlaActive) uiItemR(row, ptr, "include_missing_nla", 0, "", 0); @@ -946,15 +950,14 @@ static void constraint_active_func(bContext *C, void *ob_v, void *con_v) } /* draw panel showing settings for a constraint */ -static uiLayout *draw_constraint(uiLayout *layout, Object *ob, bConstraint *con) +static uiLayout *draw_constraint(uiLayout *layout, Object *ob, bConstraint *con, int compact) { bPoseChannel *pchan= get_active_posechannel(ob); bConstraintTypeInfo *cti; uiBlock *block; - uiLayout *result= NULL, *col, *box, *row, *subrow; + uiLayout *result= NULL, *col, *col1, *col2, *box, *row, *subrow, *split; PointerRNA ptr; char typestr[32]; - short width = 265; short proxy_protected, xco=0, yco=0; int rb_col; @@ -987,13 +990,15 @@ static uiLayout *draw_constraint(uiLayout *layout, Object *ob, bConstraint *con) uiLayoutSetContextPointer(col, "constraint", &ptr); box= uiLayoutBox(col); - row= uiLayoutRow(box, 0); + split = uiLayoutSplit(box, 0.35, 0); + + col1= uiLayoutColumn(split, 0); + col2= uiLayoutColumn(split, 0); + row = uiLayoutRow(col1, 0); + subrow = uiLayoutRow(col2, 0); block= uiLayoutGetBlock(box); - subrow= uiLayoutRow(row, 0); - //uiLayoutSetAlignment(subrow, UI_LAYOUT_ALIGN_LEFT); - /* Draw constraint header */ uiBlockSetEmboss(block, UI_EMBOSSN); @@ -1001,7 +1006,7 @@ static uiLayout *draw_constraint(uiLayout *layout, Object *ob, bConstraint *con) rb_col= (con->flag & CONSTRAINT_ACTIVE)?50:20; /* open/close */ - uiItemR(subrow, &ptr, "expanded", UI_ITEM_R_ICON_ONLY, "", 0); + uiItemR(row, &ptr, "expanded", UI_ITEM_R_ICON_ONLY, "", 0); /* name */ uiBlockSetEmboss(block, UI_EMBOSS); @@ -1010,15 +1015,12 @@ static uiLayout *draw_constraint(uiLayout *layout, Object *ob, bConstraint *con) uiBlockSetCol(block, TH_REDALERT);*/ uiDefBut(block, LABEL, B_CONSTRAINT_TEST, typestr, xco+10, yco, 100, 18, NULL, 0.0, 0.0, 0.0, 0.0, ""); - + if(proxy_protected == 0) { uiItemR(subrow, &ptr, "name", 0, "", 0); } else uiItemL(subrow, con->name, 0); - - subrow= uiLayoutRow(row, 0); - //uiLayoutSetAlignment(subrow, UI_LAYOUT_ALIGN_RIGHT); /* proxy-protected constraints cannot be edited, so hide up/down + close buttons */ if (proxy_protected) { @@ -1053,23 +1055,36 @@ static uiLayout *draw_constraint(uiLayout *layout, Object *ob, bConstraint *con) show_upbut= ((prev_proxylock == 0) && (con->prev)); show_downbut= (con->next) ? 1 : 0; + uiLayoutSetOperatorContext(subrow, WM_OP_INVOKE_DEFAULT); + + if (compact) { + /* Draw "Delete" Button in first row, before splitting */ + uiBlockSetEmboss(block, UI_EMBOSSN); + uiItemO(subrow, "", ICON_X, "CONSTRAINT_OT_delete"); + uiBlockSetEmboss(block, UI_EMBOSS); + + subrow = uiLayoutRow(col2, 0); + } + if (show_upbut || show_downbut) { uiBlockBeginAlign(block); uiBlockSetEmboss(block, UI_EMBOSS); if (show_upbut) - uiDefIconButO(block, BUT, "CONSTRAINT_OT_move_up", WM_OP_INVOKE_DEFAULT, ICON_TRIA_UP, xco+width-50, yco, 16, 18, "Move constraint up in constraint stack"); + uiItemO(subrow, "", ICON_TRIA_UP, "CONSTRAINT_OT_move_up"); if (show_downbut) - uiDefIconButO(block, BUT, "CONSTRAINT_OT_move_down", WM_OP_INVOKE_DEFAULT, ICON_TRIA_DOWN, xco+width-50+18, yco, 16, 18, "Move constraint down in constraint stack"); + uiItemO(subrow, "", ICON_TRIA_DOWN, "CONSTRAINT_OT_move_down"); uiBlockEndAlign(block); } /* Close 'button' - emboss calls here disable drawing of 'button' behind X */ uiBlockSetEmboss(block, UI_EMBOSSN); - uiDefIconButBitS(block, ICONTOGN, CONSTRAINT_OFF, B_CONSTRAINT_TEST, ICON_CHECKBOX_DEHLT, xco+243, yco, 19, 19, &con->flag, 0.0, 0.0, 0.0, 0.0, "enable/disable constraint"); + uiItemR(subrow, &ptr, "enabled", 0, "", 0); - uiDefIconButO(block, BUT, "CONSTRAINT_OT_delete", WM_OP_INVOKE_DEFAULT, ICON_X, xco+262, yco, 19, 19, "Delete constraint"); + if (!compact) { + uiItemO(subrow, "", ICON_X, "CONSTRAINT_OT_delete"); + } uiBlockSetEmboss(block, UI_EMBOSS); } @@ -1095,7 +1110,7 @@ static uiLayout *draw_constraint(uiLayout *layout, Object *ob, bConstraint *con) return result; } -uiLayout *uiTemplateConstraint(uiLayout *layout, PointerRNA *ptr) +uiLayout *uiTemplateConstraint(uiLayout *layout, PointerRNA *ptr, int compact) { Object *ob; bConstraint *con; @@ -1123,7 +1138,7 @@ uiLayout *uiTemplateConstraint(uiLayout *layout, PointerRNA *ptr) return NULL; } - return draw_constraint(layout, ob, con); + return draw_constraint(layout, ob, con, compact); } @@ -1335,6 +1350,29 @@ static void colorband_del_cb(bContext *C, void *cb_v, void *coba_v) rna_update_cb(C, cb_v, NULL); } +static void colorband_flip_cb(bContext *C, void *cb_v, void *coba_v) +{ + CBData data_tmp[MAXCOLORBAND]; + + ColorBand *coba= coba_v; + int a; + + for(a=0; a<coba->tot; a++) { + data_tmp[a]= coba->data[coba->tot - (a + 1)]; + } + for(a=0; a<coba->tot; a++) { + data_tmp[a].pos = 1.0f - data_tmp[a].pos; + coba->data[a]= data_tmp[a]; + } + + /* may as well flip the cur*/ + coba->cur= coba->tot - (coba->cur + 1); + + ED_undo_push(C, "Flip colorband"); + + rna_update_cb(C, cb_v, NULL); +} + /* offset aligns from bottom, standard width 300, height 115 */ static void colorband_buttons_large(uiLayout *layout, uiBlock *block, ColorBand *coba, int xoffs, int yoffs, RNAUpdateCb *cb) @@ -1345,12 +1383,17 @@ static void colorband_buttons_large(uiLayout *layout, uiBlock *block, ColorBand if(coba==NULL) return; - bt= uiDefBut(block, BUT, 0, "Add", 0+xoffs,100+yoffs,50,20, 0, 0, 0, 0, 0, "Add a new color stop to the colorband"); + bt= uiDefBut(block, BUT, 0, "Add", 0+xoffs,100+yoffs,40,20, 0, 0, 0, 0, 0, "Add a new color stop to the colorband"); uiButSetNFunc(bt, colorband_add_cb, MEM_dupallocN(cb), coba); - bt= uiDefBut(block, BUT, 0, "Delete", 60+xoffs,100+yoffs,50,20, 0, 0, 0, 0, 0, "Delete the active position"); + bt= uiDefBut(block, BUT, 0, "Delete", 45+xoffs,100+yoffs,45,20, 0, 0, 0, 0, 0, "Delete the active position"); uiButSetNFunc(bt, colorband_del_cb, MEM_dupallocN(cb), coba); + + /* XXX, todo for later - convert to operator - campbell */ + bt= uiDefBut(block, BUT, 0, "F", 95+xoffs,100+yoffs,20,20, 0, 0, 0, 0, 0, "Flip colorband"); + uiButSetNFunc(bt, colorband_flip_cb, MEM_dupallocN(cb), coba); + uiDefButS(block, NUM, 0, "", 120+xoffs,100+yoffs,80, 20, &coba->cur, 0.0, (float)(MAX2(0, coba->tot-1)), 0, 0, "Choose active color stop"); bt= uiDefButS(block, MENU, 0, "Interpolation %t|Ease %x1|Cardinal %x3|Linear %x0|B-Spline %x2|Constant %x4", @@ -1361,6 +1404,8 @@ static void colorband_buttons_large(uiLayout *layout, uiBlock *block, ColorBand bt= uiDefBut(block, BUT_COLORBAND, 0, "", xoffs,65+yoffs,300,30, coba, 0, 0, 0, 0, ""); uiButSetNFunc(bt, rna_update_cb, MEM_dupallocN(cb), NULL); + + if(coba->tot) { CBData *cbd= coba->data + coba->cur; @@ -1383,8 +1428,10 @@ static void colorband_buttons_small(uiLayout *layout, uiBlock *block, ColorBand uiBlockBeginAlign(block); bt= uiDefBut(block, BUT, 0, "Add", xs,butr->ymin+20.0f,2.0f*unit,20, NULL, 0, 0, 0, 0, "Add a new color stop to the colorband"); uiButSetNFunc(bt, colorband_add_cb, MEM_dupallocN(cb), coba); - bt= uiDefBut(block, BUT, 0, "Delete", xs+2.0f*unit,butr->ymin+20.0f,2.0f*unit,20, NULL, 0, 0, 0, 0, "Delete the active position"); + bt= uiDefBut(block, BUT, 0, "Delete", xs+2.0f*unit,butr->ymin+20.0f,1.5f*unit,20, NULL, 0, 0, 0, 0, "Delete the active position"); uiButSetNFunc(bt, colorband_del_cb, MEM_dupallocN(cb), coba); + bt= uiDefBut(block, BUT, 0, "F", xs+3.5f*unit,butr->ymin+20.0f,0.5f*unit,20, NULL, 0, 0, 0, 0, "Flip the color ramp"); + uiButSetNFunc(bt, colorband_flip_cb, MEM_dupallocN(cb), coba); uiBlockEndAlign(block); if(coba->tot) { @@ -1908,37 +1955,44 @@ void uiTemplateCurveMapping(uiLayout *layout, PointerRNA *ptr, char *propname, i #define WHEEL_SIZE 100 -void uiTemplateColorWheel(uiLayout *layout, PointerRNA *ptr, char *propname, int value_slider, int lock) +void uiTemplateColorWheel(uiLayout *layout, PointerRNA *ptr, char *propname, int value_slider, int lock, int lock_luminosity, int cubic) { PropertyRNA *prop= RNA_struct_find_property(ptr, propname); uiBlock *block= uiLayoutGetBlock(layout); uiLayout *col, *row; + uiBut *but; float softmin, softmax, step, precision; if (!prop) { printf("uiTemplateColorWheel: property not found: %s\n", propname); return; } - + RNA_property_float_ui_range(ptr, prop, &softmin, &softmax, &step, &precision); col = uiLayoutColumn(layout, 0); row= uiLayoutRow(col, 1); - uiDefButR(block, HSVCIRCLE, 0, "", 0, 0, WHEEL_SIZE, WHEEL_SIZE, ptr, propname, -1, 0.0, 0.0, 0, lock, ""); - + but= uiDefButR(block, HSVCIRCLE, 0, "", 0, 0, WHEEL_SIZE, WHEEL_SIZE, ptr, propname, -1, 0.0, 0.0, 0, 0, ""); + + if(lock) { + but->flag |= UI_BUT_COLOR_LOCK; + } + + if(lock_luminosity) { + float color[4]; /* incase of alpha */ + but->flag |= UI_BUT_VEC_SIZE_LOCK; + RNA_property_float_get_array(ptr, prop, color); + but->a2= len_v3(color); + } + + if(cubic) + but->flag |= UI_BUT_COLOR_CUBIC; + uiItemS(row); if (value_slider) uiDefButR(block, HSVCUBE, 0, "", WHEEL_SIZE+6, 0, 14, WHEEL_SIZE, ptr, propname, -1, softmin, softmax, 9, 0, ""); - - /* maybe a switch for this? - row= uiLayoutRow(col, 0); - if(ELEM(RNA_property_subtype(prop), PROP_COLOR, PROP_COLOR_GAMMA) && RNA_property_array_length(ptr, prop) == 4) { - but= uiDefAutoButR(block, ptr, prop, 3, "A:", 0, 0, 0, WHEEL_SIZE+20, UI_UNIT_Y); - } - */ - } @@ -2410,13 +2464,13 @@ static void do_running_jobs(bContext *C, void *arg, int event) G.afbreek= 1; break; case B_STOPCAST: - WM_jobs_stop(CTX_wm_manager(C), CTX_wm_screen(C)); + WM_jobs_stop(CTX_wm_manager(C), CTX_wm_screen(C), NULL); break; case B_STOPANIM: WM_operator_name_call(C, "SCREEN_OT_animation_play", WM_OP_INVOKE_SCREEN, NULL); break; case B_STOPCOMPO: - WM_jobs_stop(CTX_wm_manager(C), CTX_wm_area(C)); + WM_jobs_stop(CTX_wm_manager(C), CTX_wm_area(C), NULL); break; } } diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index 8f0f794585a..d2860adbf50 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -608,14 +608,67 @@ static void widgetbase_draw(uiWidgetBase *wtb, uiWidgetColors *wcol) /* backdrop non AA */ if(wtb->inner) { if(wcol->shaded==0) { - - /* filled center, solid */ - glColor4ubv((unsigned char*)wcol->inner); - glBegin(GL_POLYGON); - for(a=0; a<wtb->totvert; a++) - glVertex2fv(wtb->inner_v[a]); - glEnd(); + if (wcol->alpha_check) { + GLubyte checker_stipple_sml[32*32/8] = + { + 255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0, \ + 255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0, \ + 0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255, \ + 0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255, \ + 255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0, \ + 255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0, \ + 0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255, \ + 0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255, \ + }; + + float x_mid= 0.0f; /* used for dumb clamping of values */ + + /* dark checkers */ + glColor4ub(100, 100, 100, 255); + glBegin(GL_POLYGON); + for(a=0; a<wtb->totvert; a++) { + glVertex2fv(wtb->inner_v[a]); + } + glEnd(); + + /* light checkers */ + glEnable(GL_POLYGON_STIPPLE); + glColor4ub(160, 160, 160, 255); + glPolygonStipple(checker_stipple_sml); + glBegin(GL_POLYGON); + for(a=0; a<wtb->totvert; a++) { + glVertex2fv(wtb->inner_v[a]); + } + glEnd(); + glDisable(GL_POLYGON_STIPPLE); + /* alpha fill */ + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + + glColor4ubv((unsigned char*)wcol->inner); + glBegin(GL_POLYGON); + for(a=0; a<wtb->totvert; a++) { + glVertex2fv(wtb->inner_v[a]); + x_mid += wtb->inner_v[a][0]; + } + x_mid /= wtb->totvert; + glEnd(); + + /* 1/2 solid color */ + glColor4ub(wcol->inner[0], wcol->inner[1], wcol->inner[2], 255); + glBegin(GL_POLYGON); + for(a=0; a<wtb->totvert; a++) + glVertex2f(MIN2(wtb->inner_v[a][0], x_mid), wtb->inner_v[a][1]); + glEnd(); + } + else { + /* simple fill */ + glColor4ubv((unsigned char*)wcol->inner); + glBegin(GL_POLYGON); + for(a=0; a<wtb->totvert; a++) + glVertex2fv(wtb->inner_v[a]); + glEnd(); + } } else { char col1[4], col2[4]; @@ -1603,10 +1656,10 @@ void ui_draw_but_HSVCIRCLE(uiBut *but, uiWidgetColors *wcol, rcti *rect) rgb_to_hsv(rgb[0], rgb[1], rgb[2], hsv, hsv+1, hsv+2); copy_v3_v3(hsvo, hsv); - /* exception: if 'lock' is set (stored in but->a2), + /* exception: if 'lock' is set * lock the value of the color wheel to 1. * Useful for color correction tools where you're only interested in hue. */ - if (but->a2) hsv[2] = 1.f; + if (but->flag & UI_BUT_COLOR_LOCK) hsv[2] = 1.f; hsv_to_rgb(0.f, 0.f, hsv[2], colcent, colcent+1, colcent+2); @@ -1621,6 +1674,8 @@ void ui_draw_but_HSVCIRCLE(uiBut *but, uiWidgetColors *wcol, rcti *rect) float co= cos(ang); ui_hsvcircle_vals_from_pos(hsv, hsv+1, rect, centx + co*radius, centy + si*radius); + CLAMP(hsv[2], 0.0f, 1.0f); /* for display only */ + hsv_to_rgb(hsv[0], hsv[1], hsv[2], col, col+1, col+2); glColor3fv(col); glVertex2f( centx + co*radius, centy + si*radius); @@ -1635,14 +1690,19 @@ void ui_draw_but_HSVCIRCLE(uiBut *but, uiWidgetColors *wcol, rcti *rect) glEnable(GL_BLEND); glEnable(GL_LINE_SMOOTH ); glColor3ubv((unsigned char*)wcol->outline); - glutil_draw_lined_arc(0.0f, M_PI*2.0, radius, tot); + glutil_draw_lined_arc(0.0f, M_PI*2.0, radius, tot + 1); glDisable(GL_BLEND); glDisable(GL_LINE_SMOOTH ); glPopMatrix(); /* cursor */ ang= 2.0f*M_PI*hsvo[0] + 0.5f*M_PI; - radius= hsvo[1]*radius; + + if(but->flag & UI_BUT_COLOR_CUBIC) + radius= (1.0f - pow(1.0f - hsvo[1], 3.0f)) *radius; + else + radius= hsvo[1] * radius; + ui_hsv_cursor(centx + cos(-ang)*radius, centy + sin(-ang)*radius); } @@ -2208,9 +2268,15 @@ static void widget_swatch(uiBut *but, uiWidgetColors *wcol, rcti *rect, int stat float col[4]; int color_profile = but->block->color_profile; + col[3]= 1.0f; + if (but->rnaprop) { if (RNA_property_subtype(but->rnaprop) == PROP_COLOR_GAMMA) color_profile = BLI_PR_NONE; + + if(RNA_property_array_length(&but->rnapoin, but->rnaprop)==4) { + col[3]= RNA_property_float_get_index(&but->rnapoin, but->rnaprop, 3); + } } widget_init(&wtb); @@ -2226,8 +2292,10 @@ static void widget_swatch(uiBut *but, uiWidgetColors *wcol, rcti *rect, int stat wcol->inner[0]= FTOCHAR(col[0]); wcol->inner[1]= FTOCHAR(col[1]); wcol->inner[2]= FTOCHAR(col[2]); + wcol->inner[3]= FTOCHAR(col[3]); wcol->shaded = 0; - + wcol->alpha_check = (wcol->inner[3] < 255); + widgetbase_draw(&wtb, wcol); } diff --git a/source/blender/editors/mesh/editmesh_add.c b/source/blender/editors/mesh/editmesh_add.c index a7a0a854f1b..6cdd1dff1fc 100644 --- a/source/blender/editors/mesh/editmesh_add.c +++ b/source/blender/editors/mesh/editmesh_add.c @@ -1262,6 +1262,23 @@ static void make_prim(Object *obedit, int type, float mat[4][4], int tot, int se /* ********* add primitive operators ************* */ +static char *get_mesh_defname(int type) +{ + switch (type) { + case PRIM_PLANE: return "Plane"; + case PRIM_CUBE: return "Cube"; + case PRIM_CIRCLE: return "Circle"; + case PRIM_CYLINDER: return "Tube"; + case PRIM_CONE: return "Cone"; + case PRIM_GRID: return "Grid"; + case PRIM_UVSPHERE: return "Sphere"; + case PRIM_ICOSPHERE: return "Icosphere"; + case PRIM_MONKEY: return "Monkey"; + default: + return "Mesh"; + } +} + static void make_prim_ext(bContext *C, float *loc, float *rot, int enter_editmode, unsigned int layer, int type, int tot, int seg, int subdiv, float dia, float depth, int ext, int fill) @@ -1274,6 +1291,9 @@ static void make_prim_ext(bContext *C, float *loc, float *rot, int enter_editmod if(obedit==NULL || obedit->type!=OB_MESH) { obedit= ED_object_add_type(C, OB_MESH, loc, rot, FALSE, layer); + rename_id((ID *)obedit, get_mesh_defname(type)); + rename_id((ID *)obedit->data, get_mesh_defname(type)); + /* create editmode */ ED_object_enter_editmode(C, EM_DO_UNDO|EM_IGNORE_LAYER); /* rare cases the active layer is messed up */ newob = 1; diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 13656ca1b7e..a46d154cc22 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -1030,7 +1030,7 @@ void MESH_OT_spin(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* props */ - RNA_def_int(ot->srna, "steps", 9, 0, INT_MAX, "Steps", "Steps", 0, INT_MAX); + RNA_def_int(ot->srna, "steps", 9, 0, INT_MAX, "Steps", "Steps", 0, 128); RNA_def_boolean(ot->srna, "dupli", 0, "Dupli", "Make Duplicates"); RNA_def_float(ot->srna, "degrees", 90.0f, -FLT_MAX, FLT_MAX, "Degrees", "Degrees", -360.0f, 360.0f); diff --git a/source/blender/editors/metaball/mball_edit.c b/source/blender/editors/metaball/mball_edit.c index 62261c3c68f..11534f57f75 100644 --- a/source/blender/editors/metaball/mball_edit.c +++ b/source/blender/editors/metaball/mball_edit.c @@ -47,6 +47,7 @@ #include "BKE_depsgraph.h" #include "BKE_object.h" #include "BKE_context.h" +#include "BKE_library.h" #include "ED_screen.h" #include "ED_view3d.h" @@ -59,6 +60,10 @@ /* This function is used to free all MetaElems from MetaBall */ void free_editMball(Object *obedit) { + MetaBall *mb = (MetaBall*)obedit->data; + + mb->editelems= NULL; + mb->lastelem= NULL; } /* This function is called, when MetaBall Object is @@ -83,10 +88,6 @@ void make_editMball(Object *obedit) * from object->data->edit_elems to object->data->elems. */ void load_editMball(Object *obedit) { - MetaBall *mb = (MetaBall*)obedit->data; - - mb->editelems= NULL; - mb->lastelem= NULL; } /* Add metaelem primitive to metaball object (which is in edit mode) */ @@ -122,24 +123,29 @@ MetaElem *add_metaball_primitive(bContext *C, float mat[4][4], int type, int new case MB_BALL: ml->type = MB_BALL; ml->expx= ml->expy= ml->expz= 1.0; + break; case MB_TUBE: ml->type = MB_TUBE; ml->expx= ml->expy= ml->expz= 1.0; + break; case MB_PLANE: ml->type = MB_PLANE; ml->expx= ml->expy= ml->expz= 1.0; + break; case MB_ELIPSOID: ml->type = MB_ELIPSOID; ml->expx= 1.2f; ml->expy= 0.8f; ml->expz= 1.0; + break; case MB_CUBE: ml->type = MB_CUBE; ml->expx= ml->expy= ml->expz= 1.0; + break; default: break; diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index ee0fd2b47e9..757c167c496 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -183,7 +183,7 @@ void ED_object_add_generic_props(wmOperatorType *ot, int do_editmode) RNA_def_float_vector(ot->srna, "location", 3, NULL, -FLT_MAX, FLT_MAX, "Location", "Location for the newly added object.", -FLT_MAX, FLT_MAX); RNA_def_float_rotation(ot->srna, "rotation", 3, NULL, -FLT_MAX, FLT_MAX, "Rotation", "Rotation for the newly added object", -FLT_MAX, FLT_MAX); - prop = RNA_def_boolean_layer_member(ot->srna, "layer", 32, NULL, "Layer", ""); + prop = RNA_def_boolean_layer_member(ot->srna, "layer", 20, NULL, "Layer", ""); RNA_def_property_flag(prop, PROP_HIDDEN); } @@ -193,32 +193,28 @@ static void object_add_generic_invoke_options(bContext *C, wmOperator *op) if (!RNA_property_is_set(op->ptr, "enter_editmode")) RNA_boolean_set(op->ptr, "enter_editmode", U.flag & USER_ADD_EDITMODE); - if (!RNA_property_is_set(op->ptr, "location")) { + if(!RNA_property_is_set(op->ptr, "location")) { float loc[3]; ED_object_location_from_view(C, loc); RNA_float_set_array(op->ptr, "location", loc); } - if (!RNA_property_is_set(op->ptr, "layer")) { + if(!RNA_property_is_set(op->ptr, "layer")) { View3D *v3d = CTX_wm_view3d(C); Scene *scene = CTX_data_scene(C); - int a, values[32], layer; + int a, values[20], layer; - if (v3d) { - if (v3d->localvd) { - layer = v3d->layact + v3d->lay; - for(a=0; a<32; a++) - values[a]= (layer & (1<<a)); - } else { - layer = (v3d->scenelock)?scene->layact:v3d->layact; + if(v3d) { + layer = (v3d->scenelock && !v3d->localvd)? scene->layact: v3d->layact; - for(a=0; a<32; a++) - values[a]= (layer & (1<<a)); - } - } else { + for(a=0; a<20; a++) + values[a]= (layer & (1<<a)); + } + else { layer = scene->layact; - for(a=0; a<32; a++) + + for(a=0; a<20; a++) values[a]= (layer & (1<<a)); } @@ -234,7 +230,8 @@ int ED_object_add_generic_invoke(bContext *C, wmOperator *op, wmEvent *event) int ED_object_add_generic_get_opts(bContext *C, wmOperator *op, float *loc, float *rot, int *enter_editmode, unsigned int *layer) { - int a, layer_values[32]; + View3D *v3d = CTX_wm_view3d(C); + int a, layer_values[20]; int view_align; *enter_editmode = FALSE; @@ -245,7 +242,7 @@ int ED_object_add_generic_get_opts(bContext *C, wmOperator *op, float *loc, floa if(RNA_property_is_set(op->ptr, "layer")) { RNA_boolean_get_array(op->ptr, "layer", layer_values); - for(a=0; a<32; a++) { + for(a=0; a<20; a++) { if(layer_values[a]) *layer |= (1 << a); else @@ -258,6 +255,11 @@ int ED_object_add_generic_get_opts(bContext *C, wmOperator *op, float *loc, floa *layer = scene->layact; } + /* in local view we additionally add local view layers, + not part of operator properties */ + if(v3d && v3d->localvd) + *layer |= v3d->lay; + if (RNA_property_is_set(op->ptr, "view_align")) view_align = RNA_boolean_get(op->ptr, "view_align"); else @@ -671,6 +673,19 @@ void OBJECT_OT_armature_add(wmOperatorType *ot) ED_object_add_generic_props(ot, TRUE); } +static char *get_lamp_defname(int type) +{ + switch (type) { + case LA_LOCAL: return "Point"; + case LA_SUN: return "Sun"; + case LA_SPOT: return "Spot"; + case LA_HEMI: return "Hemi"; + case LA_AREA: return "Area"; + default: + return "Lamp"; + } +} + static int object_lamp_add_exec(bContext *C, wmOperator *op) { Object *ob; @@ -687,6 +702,9 @@ static int object_lamp_add_exec(bContext *C, wmOperator *op) if(ob && ob->data) ((Lamp*)ob->data)->type= type; + rename_id((ID *)ob, get_lamp_defname(type)); + rename_id((ID *)ob->data, get_lamp_defname(type)); + return OPERATOR_FINISHED; } @@ -1051,7 +1069,7 @@ static Base *duplibase_for_convert(Scene *scene, Base *base, Object *ob) } obn= copy_object(ob); - obn->recalc |= OB_RECALC; + obn->recalc |= OB_RECALC_ALL; basen= MEM_mallocN(sizeof(Base), "duplibase"); *basen= *base; @@ -1134,7 +1152,7 @@ static int convert_exec(bContext *C, wmOperator *op) newob->data= copy_mesh(me); } else { newob = ob; - ob->recalc |= OB_RECALC; + ob->recalc |= OB_RECALC_ALL; } /* make new mesh data from the original copy */ @@ -1195,7 +1213,7 @@ static int convert_exec(bContext *C, wmOperator *op) for(ob1= G.main->object.first; ob1; ob1=ob1->id.next) { if(ob1->data==ob->data) { ob1->type= OB_CURVE; - ob1->recalc |= OB_RECALC; + ob1->recalc |= OB_RECALC_ALL; } } } @@ -1386,7 +1404,7 @@ static Base *object_add_duplicate_internal(Scene *scene, Base *base, int dupflag } else { obn= copy_object(ob); - obn->recalc |= OB_RECALC; + obn->recalc |= OB_RECALC_ALL; basen= MEM_mallocN(sizeof(Base), "duplibase"); *basen= *base; diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c index 7b61d8de43f..b1dc41531ef 100644 --- a/source/blender/editors/object/object_constraint.c +++ b/source/blender/editors/object/object_constraint.c @@ -866,7 +866,7 @@ void CONSTRAINT_OT_move_down (wmOperatorType *ot) /* identifiers */ ot->name= "Move Constraint Down"; ot->idname= "CONSTRAINT_OT_move_down"; - ot->description= "Move constraint down constraint stack"; + ot->description= "Move constraint down in constraint stack"; /* callbacks */ ot->exec= constraint_move_down_exec; @@ -913,7 +913,7 @@ void CONSTRAINT_OT_move_up (wmOperatorType *ot) /* identifiers */ ot->name= "Move Constraint Up"; ot->idname= "CONSTRAINT_OT_move_up"; - ot->description= "Move constraint up constraint stack"; + ot->description= "Move constraint up in constraint stack"; /* callbacks */ ot->exec= constraint_move_up_exec; diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 5f61da4ae37..d3226b1adf4 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -468,7 +468,7 @@ void ED_object_enter_editmode(bContext *C, int flag) scene->obedit= ob; ED_armature_to_edit(ob); /* to ensure all goes in restposition and without striding */ - DAG_id_flush_update(&ob->id, OB_RECALC); + DAG_id_flush_update(&ob->id, OB_RECALC_ALL); // XXX: should this be OB_RECALC_DATA? WM_event_add_notifier(C, NC_SCENE|ND_MODE|NS_EDITMODE_ARMATURE, scene); } @@ -1792,6 +1792,11 @@ static int shade_smooth_exec(bContext *C, wmOperator *op) return (done)? OPERATOR_FINISHED: OPERATOR_CANCELLED; } +static int shade_poll(bContext *C) +{ + return (ED_operator_object_active_editable(C) && !ED_operator_editmesh(C)); +} + void OBJECT_OT_shade_flat(wmOperatorType *ot) { /* identifiers */ @@ -1799,7 +1804,7 @@ void OBJECT_OT_shade_flat(wmOperatorType *ot) ot->idname= "OBJECT_OT_shade_flat"; /* api callbacks */ - ot->poll= ED_operator_object_active_editable; + ot->poll= shade_poll; ot->exec= shade_smooth_exec; /* flags */ @@ -1813,7 +1818,7 @@ void OBJECT_OT_shade_smooth(wmOperatorType *ot) ot->idname= "OBJECT_OT_shade_smooth"; /* api callbacks */ - ot->poll= ED_operator_object_active_editable; + ot->poll= shade_poll; ot->exec= shade_smooth_exec; /* flags */ diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 56742413358..0661b675668 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -399,7 +399,7 @@ static int modifier_apply_obdata(ReportList *reports, Scene *scene, Object *ob, if (ob->type==OB_MESH) { DerivedMesh *dm; Mesh *me = ob->data; - MultiresModifierData *mmd= find_multires_modifier(scene, ob); + MultiresModifierData *mmd= find_multires_modifier_before(scene, md); if( me->key) { BKE_report(reports, RPT_ERROR, "Modifier cannot be applied to Mesh with Shape Keys"); @@ -412,12 +412,15 @@ static int modifier_apply_obdata(ReportList *reports, Scene *scene, Object *ob, if(md->type == eModifierType_Multires) multires_force_update(ob); - if (mmd && mti->type==eModifierTypeType_OnlyDeform) { - multiresModifier_reshapeFromDeformMod (scene, mmd, ob, md); + if (mmd && mmd->totlvl && mti->type==eModifierTypeType_OnlyDeform) { + if(!multiresModifier_reshapeFromDeformMod (scene, mmd, ob, md)) { + BKE_report(reports, RPT_ERROR, "Multires modifier returned error, skipping apply"); + return 0; + } } else { dm = mesh_create_derived_for_modifier(scene, ob, md); if (!dm) { - BKE_report(reports, RPT_ERROR, "Modifier is returned error, skipping apply"); + BKE_report(reports, RPT_ERROR, "Modifier returned error, skipping apply"); return 0; } @@ -1081,7 +1084,7 @@ void OBJECT_OT_multires_external_save(wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - WM_operator_properties_filesel(ot, FOLDERFILE|BTXFILE, FILE_SPECIAL, FILE_SAVE, FILE_RELPATH); + WM_operator_properties_filesel(ot, FOLDERFILE|BTXFILE, FILE_SPECIAL, FILE_SAVE, WM_FILESEL_FILEPATH|WM_FILESEL_RELPATH); edit_modifier_properties(ot); } diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 28eb919dbe7..fbc6075796c 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -193,7 +193,7 @@ static int vertex_parent_set_exec(bContext *C, wmOperator *op) CTX_DATA_BEGIN(C, Object*, ob, selected_editable_objects) { if(ob != obedit) { - ob->recalc |= OB_RECALC; + ob->recalc |= OB_RECALC_ALL; par= obedit->parent; while(par) { @@ -339,7 +339,7 @@ static int make_proxy_exec (bContext *C, wmOperator *op) /* depsgraph flushes are needed for the new data */ DAG_scene_sort(scene); - DAG_id_flush_update(&newob->id, OB_RECALC); + DAG_id_flush_update(&newob->id, OB_RECALC_ALL); WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, newob); } else { @@ -427,7 +427,7 @@ static int parent_clear_exec(bContext *C, wmOperator *op) else if(type == 2) unit_m4(ob->parentinv); - ob->recalc |= OB_RECALC; + ob->recalc |= OB_RECALC_ALL; } CTX_DATA_END; @@ -869,7 +869,7 @@ static int object_track_clear_exec(bContext *C, wmOperator *op) /* remove track-object for old track */ ob->track= NULL; - ob->recalc |= OB_RECALC; + ob->recalc |= OB_RECALC_ALL; /* also remove all tracking constraints */ for (con= ob->constraints.last; con; con= pcon) { @@ -935,7 +935,7 @@ static int track_set_exec(bContext *C, wmOperator *op) data = con->data; data->tar = obact; - ob->recalc |= OB_RECALC; + ob->recalc |= OB_RECALC_ALL; /* Lamp and Camera track differently by default */ if (ob->type == OB_LAMP || ob->type == OB_CAMERA) @@ -954,7 +954,7 @@ static int track_set_exec(bContext *C, wmOperator *op) data = con->data; data->tar = obact; - ob->recalc |= OB_RECALC; + ob->recalc |= OB_RECALC_ALL; /* Lamp and Camera track differently by default */ if (ob->type == OB_LAMP || ob->type == OB_CAMERA) { @@ -975,7 +975,7 @@ static int track_set_exec(bContext *C, wmOperator *op) data = con->data; data->tar = obact; - ob->recalc |= OB_RECALC; + ob->recalc |= OB_RECALC_ALL; /* Lamp and Camera track differently by default */ if (ob->type == OB_LAMP || ob->type == OB_CAMERA) { @@ -1191,24 +1191,25 @@ enum { /* Return 1 if make link data is allow, zero otherwise */ static int allow_make_links_data(int ev, Object *ob, Object *obt) { - if (ev == MAKE_LINKS_OBDATA) { - if (ob->type == OB_MESH && obt->type == OB_MESH) - return(1); + switch(ev) { + case MAKE_LINKS_OBDATA: + if (ob->type == obt->type && ob->type != OB_EMPTY) + return 1; + break; + case MAKE_LINKS_MATERIALS: + if (ELEM5(ob->type, OB_MESH, OB_CURVE, OB_FONT, OB_SURF, OB_MBALL) && + ELEM5(obt->type, OB_MESH, OB_CURVE, OB_FONT, OB_SURF, OB_MBALL)) + return 1; + break; + case MAKE_LINKS_ANIMDATA: + case MAKE_LINKS_DUPLIGROUP: + return 1; + case MAKE_LINKS_MODIFIERS: + if (ob->type != OB_EMPTY && obt->type != OB_EMPTY) + return 1; + break; } - else if (ev == MAKE_LINKS_MATERIALS) { - if ((ob->type == OB_MESH || ob->type == OB_CURVE || ob->type == OB_FONT || ob->type == OB_SURF || ob->type == OB_MBALL) && - (obt->type == OB_MESH || obt->type == OB_CURVE || obt->type == OB_FONT || obt->type == OB_SURF || obt->type == OB_MBALL)) - return(1); - } - else if (ev == MAKE_LINKS_ANIMDATA) - return(1); - else if (ev == MAKE_LINKS_DUPLIGROUP) - return(1); - else if (ev == MAKE_LINKS_MODIFIERS) { - if (ob->type != OB_EMPTY && obt->type != OB_EMPTY) - return(1); - } - return(0); + return 0; } static int make_links_data_exec(bContext *C, wmOperator *op) @@ -1258,7 +1259,7 @@ static int make_links_data_exec(bContext *C, wmOperator *op) break; case MAKE_LINKS_MODIFIERS: object_link_modifiers(obt, ob); - obt->recalc |= OB_RECALC; + obt->recalc |= OB_RECALC_ALL; break; } } diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c index 48ad3bbcc94..7110c3aa7a7 100644 --- a/source/blender/editors/render/render_internal.c +++ b/source/blender/editors/render/render_internal.c @@ -403,7 +403,7 @@ static int screen_render_exec(bContext *C, wmOperator *op) Render *re= RE_NewRender(scene->id.name); Image *ima; View3D *v3d= CTX_wm_view3d(C); - int lay= (v3d)? v3d->lay|scene->lay: scene->lay; + int lay= (v3d)? v3d->lay: scene->lay; if(re==NULL) { re= RE_NewRender(scene->id.name); @@ -508,11 +508,14 @@ static void image_renderinfo_cb(void *rjv, RenderStats *rs) rr= RE_AcquireResultRead(rj->re); - /* malloc OK here, stats_draw is not in tile threads */ - if(rr->text==NULL) - rr->text= MEM_callocN(IMA_MAX_RENDER_TEXT, "rendertext"); + if(rr) { + /* malloc OK here, stats_draw is not in tile threads */ + if(rr->text==NULL) + rr->text= MEM_callocN(IMA_MAX_RENDER_TEXT, "rendertext"); + + make_renderinfo_string(rs, rj->scene, rr->text); + } - make_renderinfo_string(rs, rj->scene, rr->text); RE_ReleaseResult(rj->re); /* make jobs timer to send notifier */ @@ -634,7 +637,7 @@ static int screen_render_invoke(bContext *C, wmOperator *op, wmEvent *event) multires_force_render_update(CTX_data_active_object(C)); /* get editmode results */ - ED_object_exit_editmode(C, EM_FREEDATA|EM_DO_UNDO); /* 0 = does not exit editmode */ + ED_object_exit_editmode(C, 0); /* 0 = does not exit editmode */ // store spare // get view3d layer, local layer, make this nice api call to render @@ -666,7 +669,7 @@ static int screen_render_invoke(bContext *C, wmOperator *op, wmEvent *event) rj->scene= scene; rj->win= CTX_wm_window(C); rj->srl = srl; - rj->lay = (v3d)? v3d->lay|scene->lay: scene->lay; + rj->lay = (v3d)? v3d->lay: scene->lay; rj->anim= RNA_boolean_get(op->ptr, "animation"); rj->iuser.scene= scene; rj->iuser.ok= 1; diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c index 7cc074a74fd..5881d50c309 100644 --- a/source/blender/editors/render/render_opengl.c +++ b/source/blender/editors/render/render_opengl.c @@ -233,7 +233,7 @@ static int screen_opengl_render_init(bContext *C, wmOperator *op) rr= RE_AcquireResultWrite(oglrender->re); if(rr->rectf==NULL) - rr->rectf= MEM_mallocN(sizeof(float)*4*sizex*sizey, "32 bits rects"); + rr->rectf= MEM_callocN(sizeof(float)*4*sizex*sizey, "screen_opengl_render_init rect"); RE_ReleaseResult(oglrender->re); return 1; @@ -402,9 +402,10 @@ static int screen_opengl_render_modal(bContext *C, wmOperator *op, wmEvent *even return OPERATOR_RUNNING_MODAL; } - ret= screen_opengl_render_anim_step(C, op); - + /* run first because screen_opengl_render_anim_step can free oglrender */ WM_event_add_notifier(C, NC_SCENE|ND_RENDER_RESULT, oglrender->scene); + + ret= screen_opengl_render_anim_step(C, op); /* stop at the end or on error */ if(ret == 0) { diff --git a/source/blender/editors/render/render_preview.c b/source/blender/editors/render/render_preview.c index 898a8f527c3..ae2462b95f8 100644 --- a/source/blender/editors/render/render_preview.c +++ b/source/blender/editors/render/render_preview.c @@ -1153,4 +1153,10 @@ void ED_preview_shader_job(const bContext *C, void *owner, ID *id, ID *parent, M WM_jobs_start(CTX_wm_manager(C), steve); } +void ED_preview_kill_jobs(const struct bContext *C) +{ + wmWindowManager *wm= CTX_wm_manager(C); + if(wm) + WM_jobs_kill(wm, NULL, common_preview_startjob); +} diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c index 36a62919b5a..81f32c402da 100644 --- a/source/blender/editors/render/render_shading.c +++ b/source/blender/editors/render/render_shading.c @@ -1129,7 +1129,7 @@ void TEXTURE_OT_envmap_save(wmOperatorType *ot) /* properties */ //RNA_def_enum(ot->srna, "file_type", image_file_type_items, R_PNG, "File Type", "File type to save image as."); - WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE|MOVIEFILE, FILE_SPECIAL, FILE_SAVE, FILE_RELPATH); + WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE|MOVIEFILE, FILE_SPECIAL, FILE_SAVE, WM_FILESEL_FILEPATH|WM_FILESEL_RELPATH); } static int envmap_clear_exec(bContext *C, wmOperator *op) diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 65b2923d884..fa7064b817d 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -177,14 +177,18 @@ static void area_draw_azone(short x1, short y1, short x2, short y2) float dx= 0.3f*(xmax-xmin); float dy= 0.3f*(ymax-ymin); - glColor4ub(255, 255, 255, 80); + glColor4ub(255, 255, 255, 180); fdrawline(xmin, ymax, xmax, ymin); + glColor4ub(255, 255, 255, 130); fdrawline(xmin, ymax-dy, xmax-dx, ymin); + glColor4ub(255, 255, 255, 80); fdrawline(xmin, ymax-2*dy, xmax-2*dx, ymin); - glColor4ub(0, 0, 0, 150); + glColor4ub(0, 0, 0, 210); fdrawline(xmin, ymax+1, xmax+1, ymin); + glColor4ub(0, 0, 0, 180); fdrawline(xmin, ymax-dy+1, xmax-dx+1, ymin); + glColor4ub(0, 0, 0, 150); fdrawline(xmin, ymax-2*dy+1, xmax-2*dx+1, ymin); } diff --git a/source/blender/editors/screen/screen_context.c b/source/blender/editors/screen/screen_context.c index 2d5af4aa705..de1312501d4 100644 --- a/source/blender/editors/screen/screen_context.c +++ b/source/blender/editors/screen/screen_context.c @@ -29,6 +29,7 @@ #include "DNA_object_types.h" #include "DNA_armature_types.h" +#include "DNA_sequence_types.h" #include "DNA_scene_types.h" #include "DNA_screen_types.h" @@ -36,6 +37,7 @@ #include "BKE_utildefines.h" #include "BKE_global.h" #include "BKE_action.h" +#include "BKE_sequencer.h" #include "RNA_access.h" @@ -66,7 +68,9 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult "visible_pose_bones", "selected_pose_bones", "active_bone", "active_pose_bone", "active_base", "active_object", "object", "edit_object", "sculpt_object", "vertex_paint_object", "weight_paint_object", - "texture_paint_object", "particle_edit_object", NULL}; + "texture_paint_object", "particle_edit_object", + "selected_sequences", "selected_editable_sequences", /* sequencer */ + NULL}; CTX_data_dir_set(result, dir); return 1; @@ -317,6 +321,32 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult return 1; } + else if(CTX_data_equals(member, "selected_strips")) { + Editing *ed= seq_give_editing(scene, FALSE); + if(ed) { + Sequence *seq; + for (seq= ed->seqbasep->first; seq; seq= seq->next) { + if (seq->flag & SELECT) { + CTX_data_list_add(result, &scene->id, &RNA_Sequence, seq); + } + } + CTX_data_type_set(result, CTX_DATA_TYPE_COLLECTION); + return 1; + } + } + else if(CTX_data_equals(member, "selected_editable_sequences")) { + Editing *ed= seq_give_editing(scene, FALSE); + if(ed) { + Sequence *seq; + for (seq= ed->seqbasep->first; seq; seq= seq->next) { + if (seq->flag & SELECT && !(seq->flag & SEQ_LOCK)) { + CTX_data_list_add(result, &scene->id, &RNA_Sequence, seq); + } + } + CTX_data_type_set(result, CTX_DATA_TYPE_COLLECTION); + return 1; + } + } else { return 0; /* not found */ } diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 515b06feba1..5aeb50b34c5 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -1504,6 +1504,7 @@ static int frame_offset_exec(bContext *C, wmOperator *op) delta = RNA_int_get(op->ptr, "delta"); CTX_data_scene(C)->r.cfra += delta; + CTX_data_scene(C)->r.subframe = 0.f; sound_seek_scene(C); diff --git a/source/blender/editors/screen/screendump.c b/source/blender/editors/screen/screendump.c index 5f592aeba52..d5cd8285515 100644 --- a/source/blender/editors/screen/screendump.c +++ b/source/blender/editors/screen/screendump.c @@ -171,7 +171,7 @@ void SCREEN_OT_screenshot(wmOperatorType *ot) ot->flag= 0; - WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE, FILE_SPECIAL, FILE_SAVE, 0); + WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE, FILE_SPECIAL, FILE_SAVE, WM_FILESEL_FILEPATH); RNA_def_boolean(ot->srna, "full", 1, "Full Screen", ""); } diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index 6269b9c5e09..41908bbe388 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -3552,16 +3552,18 @@ static void blend_color_mix_float(float *cp, const float *cp1, const float *cp2, cp[3]= mfac*cp1[3] + fac*cp2[3]; } -static void blend_color_mix_rgb(unsigned char *cp, const unsigned char *cp1, const unsigned char *cp2, const int fac) +static void blend_color_mix_accum(unsigned char *cp, const unsigned char *cp1, const unsigned char *cp2, const int fac) { /* this and other blending modes previously used >>8 instead of /255. both are not equivalent (>>8 is /256), and the former results in rounding errors that can turn colors black fast after repeated blending */ const int mfac= 255-fac; + const int alpha= cp1[3] + ((fac * cp2[3]) / 255); cp[0]= (mfac*cp1[0]+fac*cp2[0])/255; cp[1]= (mfac*cp1[1]+fac*cp2[1])/255; cp[2]= (mfac*cp1[2]+fac*cp2[2])/255; + cp[3]= alpha > 255 ? 255 : alpha; } static void do_projectpaint_clone(ProjPaintState *ps, ProjPixel *projPixel, float *rgba, float alpha, float mask) @@ -3732,7 +3734,8 @@ static void *do_projectpaint_thread(void *ph_v) bicubic_interpolation_color(ps->reproject_ibuf, projPixel->newColor.ch, NULL, projPixel->projCoSS[0], projPixel->projCoSS[1]); if(projPixel->newColor.ch[3]) { mask = ((float)projPixel->mask)/65535.0f; - blend_color_mix_rgb(projPixel->pixel.ch_pt, projPixel->origColor.ch, projPixel->newColor.ch, (mask*projPixel->newColor.ch[3])); + blend_color_mix_accum(projPixel->pixel.ch_pt, projPixel->origColor.ch, projPixel->newColor.ch, (mask*projPixel->newColor.ch[3])); + } } } diff --git a/source/blender/editors/sound/sound_ops.c b/source/blender/editors/sound/sound_ops.c index f362c584585..0d2dfd75863 100644 --- a/source/blender/editors/sound/sound_ops.c +++ b/source/blender/editors/sound/sound_ops.c @@ -150,7 +150,7 @@ void SOUND_OT_open(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - WM_operator_properties_filesel(ot, FOLDERFILE|SOUNDFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE, FILE_RELPATH); + WM_operator_properties_filesel(ot, FOLDERFILE|SOUNDFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_RELPATH); RNA_def_boolean(ot->srna, "cache", FALSE, "Cache", "Cache the sound in memory."); } diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c index 01c8ede6a2a..0e2a7f690c5 100644 --- a/source/blender/editors/space_action/action_edit.c +++ b/source/blender/editors/space_action/action_edit.c @@ -1138,6 +1138,7 @@ static int actkeys_framejump_exec(bContext *C, wmOperator *op) if (ked.i1) { Scene *scene= ac.scene; CFRA= (int)floor((ked.f1 / ked.i1) + 0.5f); + SUBFRA= 0.f; } /* set notifier that things have changed */ diff --git a/source/blender/editors/space_buttons/buttons_ops.c b/source/blender/editors/space_buttons/buttons_ops.c index 96cf79d880f..ebdc0d37b43 100644 --- a/source/blender/editors/space_buttons/buttons_ops.c +++ b/source/blender/editors/space_buttons/buttons_ops.c @@ -32,7 +32,10 @@ #include "DNA_userdef_types.h" +#include "BLI_fileops.h" + #include "BKE_context.h" +#include "BKE_global.h" /* G.sce only */ #include "WM_api.h" #include "WM_types.h" @@ -120,30 +123,53 @@ static int file_browse_invoke(bContext *C, wmOperator *op, wmEvent *event) if(!prop) return OPERATOR_CANCELLED; - - fbo= MEM_callocN(sizeof(FileBrowseOp), "FileBrowseOp"); - fbo->ptr= ptr; - fbo->prop= prop; - op->customdata= fbo; str= RNA_property_string_get_alloc(&ptr, prop, 0, 0); - RNA_string_set(op->ptr, "filepath", str); - MEM_freeN(str); - if(RNA_struct_find_property(op->ptr, "relative_path")) - if(!RNA_property_is_set(op->ptr, "relative_path")) - RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS); + /* useful yet irritating feature, Shift+Click to open the file + * Alt+Click to browse a folder in the OS's browser */ + if(event->shift || event->alt) { + PointerRNA props_ptr; - WM_event_add_fileselect(C, op); - - return OPERATOR_RUNNING_MODAL; + if(event->alt) { + char *lslash= BLI_last_slash(str); + if(lslash) + *lslash= '\0'; + } + + + WM_operator_properties_create(&props_ptr, "WM_OT_path_open"); + RNA_string_set(&props_ptr, "filepath", str); + WM_operator_name_call(C, "WM_OT_path_open", WM_OP_EXEC_DEFAULT, &props_ptr); + WM_operator_properties_free(&props_ptr); + + MEM_freeN(str); + return OPERATOR_CANCELLED; + } + else { + fbo= MEM_callocN(sizeof(FileBrowseOp), "FileBrowseOp"); + fbo->ptr= ptr; + fbo->prop= prop; + op->customdata= fbo; + + RNA_string_set(op->ptr, "filepath", str); + MEM_freeN(str); + + if(RNA_struct_find_property(op->ptr, "relative_path")) + if(!RNA_property_is_set(op->ptr, "relative_path")) + RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS); + + WM_event_add_fileselect(C, op); + + return OPERATOR_RUNNING_MODAL; + } } void BUTTONS_OT_file_browse(wmOperatorType *ot) { /* identifiers */ ot->name= "Accept"; - ot->description="Open a file browser"; + ot->description="Open a file browser, Hold Shift to open the file, Alt to browse containing directory"; ot->idname= "BUTTONS_OT_file_browse"; /* api callbacks */ @@ -152,6 +178,6 @@ void BUTTONS_OT_file_browse(wmOperatorType *ot) ot->cancel= file_browse_cancel; /* properties */ - WM_operator_properties_filesel(ot, 0, FILE_SPECIAL, FILE_OPENFILE, FILE_RELPATH); + WM_operator_properties_filesel(ot, 0, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH|WM_FILESEL_RELPATH); } diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index 7c2a2f436cc..55a44b36a52 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -391,7 +391,7 @@ static int bookmark_add_exec(bContext *C, wmOperator *op) char name[FILE_MAX]; fsmenu_insert_entry(fsmenu, FS_CATEGORY_BOOKMARKS, params->dir, 0, 1); - BLI_make_file_string("/", name, BLI_gethome(), ".Bfs"); + BLI_make_file_string("/", name, BLI_get_folder_create(BLENDER_USER_CONFIG, NULL), BLENDER_BOOKMARK_FILE); fsmenu_write_file(fsmenu, name); } @@ -423,7 +423,7 @@ static int bookmark_delete_exec(bContext *C, wmOperator *op) char name[FILE_MAX]; fsmenu_remove_entry(fsmenu, FS_CATEGORY_BOOKMARKS, index); - BLI_make_file_string("/", name, BLI_gethome(), ".Bfs"); + BLI_make_file_string("/", name, BLI_get_folder_create(BLENDER_USER_CONFIG, NULL), BLENDER_BOOKMARK_FILE); fsmenu_write_file(fsmenu, name); ED_area_tag_redraw(sa); } @@ -619,7 +619,7 @@ int file_exec(bContext *C, wmOperator *exec_op) folderlist_free(sfile->folders_next); fsmenu_insert_entry(fsmenu_get(), FS_CATEGORY_RECENT, sfile->params->dir,0, 1); - BLI_make_file_string(G.sce, filepath, BLI_gethome(), ".Bfs"); + BLI_make_file_string(G.sce, filepath, BLI_get_folder_create(BLENDER_USER_CONFIG, NULL), BLENDER_BOOKMARK_FILE); fsmenu_write_file(fsmenu_get(), filepath); WM_event_fileselect_event(C, op, EVT_FILESELECT_EXEC); diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index 5e4887827b6..37653d616c4 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -1360,7 +1360,7 @@ void thumbnails_start(struct FileList* filelist, const struct bContext* C) void thumbnails_stop(struct FileList* filelist, const struct bContext* C) { - WM_jobs_kill(CTX_wm_manager(C), filelist); + WM_jobs_kill(CTX_wm_manager(C), filelist, NULL); } int thumbnails_running(struct FileList* filelist, const struct bContext* C) diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c index abb3a6a7a35..086d4f9cce2 100644 --- a/source/blender/editors/space_file/filesel.c +++ b/source/blender/editors/space_file/filesel.c @@ -102,7 +102,6 @@ FileSelectParams* ED_fileselect_get_params(struct SpaceFile *sfile) short ED_fileselect_set_params(SpaceFile *sfile) { - char name[FILE_MAX], dir[FILE_MAX], file[FILE_MAX]; FileSelectParams *params; wmOperator *op = sfile->op; @@ -110,10 +109,7 @@ short ED_fileselect_set_params(SpaceFile *sfile) if (!sfile->params) { sfile->params= MEM_callocN(sizeof(FileSelectParams), "fileselparams"); /* set path to most recently opened .blend */ - BLI_strncpy(sfile->params->dir, G.sce, sizeof(sfile->params->dir)); - BLI_split_dirfile(G.sce, dir, file); - BLI_strncpy(sfile->params->file, file, sizeof(sfile->params->file)); - BLI_make_file_string(G.sce, sfile->params->dir, dir, ""); /* XXX needed ? - also solve G.sce */ + BLI_split_dirfile(G.sce, sfile->params->dir, sfile->params->file); } params = sfile->params; @@ -127,19 +123,33 @@ short ED_fileselect_set_params(SpaceFile *sfile) else params->type = FILE_SPECIAL; - if (RNA_property_is_set(op->ptr, "filepath")) { + if (RNA_struct_find_property(op->ptr, "filepath") && RNA_property_is_set(op->ptr, "filepath")) { + char name[FILE_MAX]; RNA_string_get(op->ptr, "filepath", name); if (params->type == FILE_LOADLIB) { BLI_strncpy(params->dir, name, sizeof(params->dir)); - BLI_cleanup_dir(G.sce, params->dir); - } else { - /* if operator has path set, use it, otherwise keep the last */ - BLI_path_abs(name, G.sce); - BLI_split_dirfile(name, dir, file); - BLI_strncpy(params->file, file, sizeof(params->file)); - BLI_make_file_string(G.sce, params->dir, dir, ""); /* XXX needed ? - also solve G.sce */ + sfile->params->file[0]= '\0'; + } + else { + BLI_split_dirfile(name, sfile->params->dir, sfile->params->file); } } + else { + if (RNA_struct_find_property(op->ptr, "directory") && RNA_property_is_set(op->ptr, "directory")) { + RNA_string_get(op->ptr, "directory", params->dir); + sfile->params->file[0]= '\0'; + } + + if (RNA_struct_find_property(op->ptr, "filename") && RNA_property_is_set(op->ptr, "filename")) { + RNA_string_get(op->ptr, "filename", params->file); + } + } + + if(params->dir[0]) { + BLI_cleanup_dir(G.sce, params->dir); + BLI_path_abs(params->dir, G.sce); + } + params->filter = 0; if(RNA_struct_find_property(op->ptr, "filter_blender")) params->filter |= RNA_boolean_get(op->ptr, "filter_blender") ? BLENDERFILE : 0; diff --git a/source/blender/editors/space_file/fsmenu.c b/source/blender/editors/space_file/fsmenu.c index 08a6b5a8f34..6699c0b8bc7 100644 --- a/source/blender/editors/space_file/fsmenu.c +++ b/source/blender/editors/space_file/fsmenu.c @@ -248,12 +248,41 @@ void fsmenu_write_file(struct FSMenu* fsmenu, const char *filename) fclose(fp); } -void fsmenu_read_file(struct FSMenu* fsmenu, const char *filename) +void fsmenu_read_bookmarks(struct FSMenu* fsmenu, const char *filename) { char line[256]; FSMenuCategory category = FS_CATEGORY_BOOKMARKS; FILE *fp; + fp = fopen(filename, "r"); + if (!fp) return; + + while ( fgets ( line, 256, fp ) != NULL ) /* read a line */ + { + if (strncmp(line, "[Bookmarks]", 11)==0){ + category = FS_CATEGORY_BOOKMARKS; + } else if (strncmp(line, "[Recent]", 8)==0){ + category = FS_CATEGORY_RECENT; + } else { + int len = strlen(line); + if (len>0) { + if (line[len-1] == '\n') { + line[len-1] = '\0'; + } + if (BLI_exist(line)) { + fsmenu_insert_entry(fsmenu, category, line, 0, 1); + } + } + } + } + fclose(fp); +} + +void fsmenu_read_system(struct FSMenu* fsmenu) +{ + char line[256]; + FILE *fp; + #ifdef WIN32 /* Add the drive names to the listing */ { @@ -429,15 +458,14 @@ void fsmenu_read_file(struct FSMenu* fsmenu, const char *filename) #else /* unix */ { - char dir[FILE_MAXDIR]; char *home= BLI_gethome(); if(home) { - BLI_snprintf(dir, FILE_MAXDIR, "%s/", home); - fsmenu_insert_entry(fsmenu, FS_CATEGORY_BOOKMARKS, dir, 1, 0); - BLI_snprintf(dir, FILE_MAXDIR, "%s/Desktop/", home); - if (BLI_exists(dir)) { - fsmenu_insert_entry(fsmenu, FS_CATEGORY_BOOKMARKS, dir, 1, 0); + BLI_snprintf(line, FILE_MAXDIR, "%s/", home); + fsmenu_insert_entry(fsmenu, FS_CATEGORY_BOOKMARKS, line, 1, 0); + BLI_snprintf(line, FILE_MAXDIR, "%s/Desktop/", home); + if (BLI_exists(line)) { + fsmenu_insert_entry(fsmenu, FS_CATEGORY_BOOKMARKS, line, 1, 0); } } @@ -446,7 +474,6 @@ void fsmenu_read_file(struct FSMenu* fsmenu, const char *filename) #ifdef __linux__ /* loop over mount points */ struct mntent *mnt; - FILE *fp; int len; fp = setmntent (MOUNTED, "r"); @@ -461,8 +488,8 @@ void fsmenu_read_file(struct FSMenu* fsmenu, const char *filename) len= strlen(mnt->mnt_dir); if(len && mnt->mnt_dir[len-1] != '/') { - BLI_snprintf(dir, FILE_MAXDIR, "%s/", mnt->mnt_dir); - fsmenu_insert_entry(fsmenu, FS_CATEGORY_SYSTEM, dir, 1, 0); + BLI_snprintf(line, FILE_MAXDIR, "%s/", mnt->mnt_dir); + fsmenu_insert_entry(fsmenu, FS_CATEGORY_SYSTEM, line, 1, 0); } else fsmenu_insert_entry(fsmenu, FS_CATEGORY_SYSTEM, mnt->mnt_dir, 1, 0); @@ -482,31 +509,9 @@ void fsmenu_read_file(struct FSMenu* fsmenu, const char *filename) } #endif #endif - - fp = fopen(filename, "r"); - if (!fp) return; - - while ( fgets ( line, 256, fp ) != NULL ) /* read a line */ - { - if (strncmp(line, "[Bookmarks]", 11)==0){ - category = FS_CATEGORY_BOOKMARKS; - } else if (strncmp(line, "[Recent]", 8)==0){ - category = FS_CATEGORY_RECENT; - } else { - int len = strlen(line); - if (len>0) { - if (line[len-1] == '\n') { - line[len-1] = '\0'; - } - if (BLI_exist(line)) { - fsmenu_insert_entry(fsmenu, category, line, 0, 1); - } - } - } - } - fclose(fp); } + static void fsmenu_free_category(struct FSMenu* fsmenu, FSMenuCategory category) { FSMenuEntry *fsme= fsmenu_get_category(fsmenu, category); diff --git a/source/blender/editors/space_file/fsmenu.h b/source/blender/editors/space_file/fsmenu.h index 8304b104a4f..dcf8d3eb632 100644 --- a/source/blender/editors/space_file/fsmenu.h +++ b/source/blender/editors/space_file/fsmenu.h @@ -68,7 +68,10 @@ void fsmenu_remove_entry (struct FSMenu* fsmenu, FSMenuCategory category, int i void fsmenu_write_file (struct FSMenu* fsmenu, const char *filename); /** reads the 'bookmarks' from the specified file */ -void fsmenu_read_file (struct FSMenu* fsmenu, const char *filename); +void fsmenu_read_bookmarks (struct FSMenu* fsmenu, const char *filename); + + /** adds system specific directories */ +void fsmenu_read_system (struct FSMenu* fsmenu); /** Free's all the memory associated with the fsmenu */ void fsmenu_free (struct FSMenu* fsmenu); diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c index 300a72851a4..261b7058151 100644 --- a/source/blender/editors/space_file/space_file.c +++ b/source/blender/editors/space_file/space_file.c @@ -591,9 +591,16 @@ void ED_spacetype_file(void) void ED_file_init(void) { - char name[FILE_MAX]; - BLI_make_file_string("/", name, BLI_gethome(), ".Bfs"); - fsmenu_read_file(fsmenu_get(), name); + char *cfgdir = BLI_get_folder(BLENDER_CONFIG, NULL); + + fsmenu_read_system(fsmenu_get()); + + if (cfgdir) { + char name[FILE_MAX]; + BLI_make_file_string("/", name, cfgdir, BLENDER_BOOKMARK_FILE); + fsmenu_read_bookmarks(fsmenu_get(), name); + } + filelist_init_icons(); IMB_thumb_makedirs(); } diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index 6834dfac58a..6249edc1090 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -1117,7 +1117,7 @@ void GRAPH_OT_sound_bake (wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - WM_operator_properties_filesel(ot, FOLDERFILE|SOUNDFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE, 0); + WM_operator_properties_filesel(ot, FOLDERFILE|SOUNDFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH); RNA_def_float(ot->srna, "low", 0.0f, 0.0, 100000.0, "Lowest frequency", "", 0.1, 1000.00); RNA_def_float(ot->srna, "high", 100000.0, 0.0, 100000.0, "Highest frequency", "", 0.1, 1000.00); RNA_def_float(ot->srna, "attack", 0.005, 0.0, 2.0, "Attack time", "", 0.01, 0.1); @@ -1582,6 +1582,7 @@ static int graphkeys_framejump_exec(bContext *C, wmOperator *op) /* take the average values, rounding to the nearest int for the current frame */ CFRA= (int)floor((ked.f1 / ked.i1) + 0.5f); + SUBFRA= 0.f; sipo->cursorVal= ked.f2 / (float)ked.i1; } diff --git a/source/blender/editors/space_graph/graph_ops.c b/source/blender/editors/space_graph/graph_ops.c index c6d601f9305..fa9acb282c7 100644 --- a/source/blender/editors/space_graph/graph_ops.c +++ b/source/blender/editors/space_graph/graph_ops.c @@ -71,6 +71,7 @@ static void graphview_cursor_apply(bContext *C, wmOperator *op) * NOTE: sync this part of the code with ANIM_OT_change_frame */ CFRA= RNA_int_get(op->ptr, "frame"); + SUBFRA=0.f; sound_seek_scene(C); /* set the cursor value */ diff --git a/source/blender/editors/space_image/SConscript b/source/blender/editors/space_image/SConscript index b38e1473a0c..4e1918bc327 100644 --- a/source/blender/editors/space_image/SConscript +++ b/source/blender/editors/space_image/SConscript @@ -11,6 +11,7 @@ defs = [] if env['WITH_BF_LCMS']: defs.append('WITH_LCMS') + incs += ' ' + env['BF_LCMS_INC'] if env['WITH_BF_OPENEXR']: defs.append('WITH_OPENEXR') if env['WITH_BF_TIFF']: diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index f84fd6fc430..3e269634b27 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -28,6 +28,7 @@ #include <stddef.h> #include <string.h> #include <stdlib.h> +#include <errno.h> #include "MEM_guardedalloc.h" @@ -688,10 +689,14 @@ static int open_exec(bContext *C, wmOperator *op) RNA_string_get(op->ptr, "filepath", str); /* default to frame 1 if there's no scene in context */ + + errno= 0; + ima= BKE_add_image_file(str, scene ? scene->r.cfra : 1); if(!ima) { if(op->customdata) MEM_freeN(op->customdata); + BKE_reportf(op->reports, RPT_ERROR, "Can't read: \"%s\", %s.", str, errno ? strerror(errno) : "Unsupported image format"); return OPERATOR_CANCELLED; } @@ -755,7 +760,7 @@ void IMAGE_OT_open(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE, FILE_RELPATH); + WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH|WM_FILESEL_RELPATH); } /******************** replace image operator ********************/ @@ -810,7 +815,7 @@ void IMAGE_OT_replace(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE, FILE_RELPATH); + WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH|WM_FILESEL_RELPATH); } /******************** save image as operator ********************/ @@ -998,7 +1003,7 @@ void IMAGE_OT_save_as(wmOperatorType *ot) /* properties */ RNA_def_enum(ot->srna, "file_type", image_file_type_items, R_PNG, "File Type", "File type to save image as."); - WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE|MOVIEFILE, FILE_SPECIAL, FILE_SAVE, FILE_RELPATH); + WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE|MOVIEFILE, FILE_SPECIAL, FILE_SAVE, WM_FILESEL_FILEPATH|WM_FILESEL_RELPATH); RNA_def_boolean(ot->srna, "copy", 0, "Copy", "Create a new image file without modifying the current image in blender"); } @@ -1182,7 +1187,7 @@ static int new_exec(bContext *C, wmOperator *op) PropertyRNA *prop; char name[22]; float color[4]; - int width, height, floatbuf, uvtestgrid; + int width, height, floatbuf, uvtestgrid, alpha; /* retrieve state */ sima= CTX_wm_space_image(C); @@ -1195,12 +1200,15 @@ static int new_exec(bContext *C, wmOperator *op) floatbuf= RNA_boolean_get(op->ptr, "float"); uvtestgrid= RNA_boolean_get(op->ptr, "uv_test_grid"); RNA_float_get_array(op->ptr, "color", color); - color[3]= RNA_float_get(op->ptr, "alpha"); + alpha= RNA_boolean_get(op->ptr, "alpha"); if (!floatbuf && scene->r.color_mgt_flag & R_COLOR_MANAGEMENT) linearrgb_to_srgb_v3_v3(color, color); - ima = BKE_add_image_size(width, height, name, floatbuf, uvtestgrid, color); + if(!alpha) + color[3]= 1.0f; + + ima = BKE_add_image_size(width, height, name, alpha ? 32 : 24, floatbuf, uvtestgrid, color); if(!ima) return OPERATOR_CANCELLED; @@ -1228,6 +1236,9 @@ static int new_exec(bContext *C, wmOperator *op) void IMAGE_OT_new(wmOperatorType *ot) { + PropertyRNA *prop; + float default_color[4]= {0.0f, 0.0f, 0.0f, 1.0f}; + /* identifiers */ ot->name= "New"; ot->idname= "IMAGE_OT_new"; @@ -1243,8 +1254,9 @@ void IMAGE_OT_new(wmOperatorType *ot) RNA_def_string(ot->srna, "name", "Untitled", 21, "Name", "Image datablock name."); RNA_def_int(ot->srna, "width", 1024, 1, INT_MAX, "Width", "Image width.", 1, 16384); RNA_def_int(ot->srna, "height", 1024, 1, INT_MAX, "Height", "Image height.", 1, 16384); - RNA_def_float_color(ot->srna, "color", 3, NULL, 0.0f, FLT_MAX, "Color", "Default fill color.", 0.0f, 1.0f); - RNA_def_float(ot->srna, "alpha", 1.0f, 0.0f, 1.0f, "Alpha", "Default fill alpha.", 0.0f, 1.0f); + prop= RNA_def_float_color(ot->srna, "color", 4, NULL, 0.0f, FLT_MAX, "Color", "Default fill color.", 0.0f, 1.0f); + RNA_def_property_float_array_default(prop, default_color); + RNA_def_boolean(ot->srna, "alpha", 1, "Alpha", "Create an image with an alpha channel."); RNA_def_boolean(ot->srna, "uv_test_grid", 0, "UV Test Grid", "Fill the image with a grid for UV map testing."); RNA_def_boolean(ot->srna, "float", 0, "32 bit Float", "Create image with 32 bit floating point bit depth."); } diff --git a/source/blender/editors/space_info/info_ops.c b/source/blender/editors/space_info/info_ops.c index 2a1a20aa0d7..62e82f83e58 100644 --- a/source/blender/editors/space_info/info_ops.c +++ b/source/blender/editors/space_info/info_ops.c @@ -299,7 +299,7 @@ void FILE_OT_find_missing_files(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - WM_operator_properties_filesel(ot, 0, FILE_SPECIAL, FILE_OPENFILE, 0); + WM_operator_properties_filesel(ot, 0, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH); } /********************* report box operator *********************/ diff --git a/source/blender/editors/space_info/space_info.c b/source/blender/editors/space_info/space_info.c index 0d9f1c90489..0f483f4bcec 100644 --- a/source/blender/editors/space_info/space_info.c +++ b/source/blender/editors/space_info/space_info.c @@ -38,6 +38,7 @@ #include "BKE_context.h" #include "BKE_colortools.h" +#include "BKE_global.h" #include "BKE_screen.h" #include "BKE_utildefines.h" @@ -49,7 +50,7 @@ #include "WM_types.h" #include "UI_resources.h" - +#include "UI_interface.h" #include "info_intern.h" // own include @@ -179,6 +180,31 @@ static void info_header_listener(ARegion *ar, wmNotifier *wmn) } +static void recent_files_menu(const bContext *C, Menu *menu) +{ + struct RecentFile *recent; + uiLayout *layout= menu->layout; + uiLayoutSetOperatorContext(layout, WM_OP_EXEC_REGION_WIN); + if (G.recent_files.first) { + for(recent = G.recent_files.first; (recent); recent = recent->next) { + uiItemStringO(layout, BLI_path_basename(recent->filepath), ICON_FILE_BLEND, "WM_OT_open_mainfile", "filepath", recent->filepath); + } + } else { + uiItemL(layout, "No Recent Files", 0); + } +} + +void recent_files_menu_register() +{ + MenuType *mt; + + mt= MEM_callocN(sizeof(MenuType), "spacetype info menu recent files"); + strcpy(mt->idname, "INFO_MT_file_open_recent"); + strcpy(mt->label, "Open Recent..."); + mt->draw= recent_files_menu; + WM_menutype_add(mt); +} + /* only called once, from space/spacetypes.c */ void ED_spacetype_info(void) { @@ -217,7 +243,8 @@ void ED_spacetype_info(void) BLI_addhead(&st->regiontypes, art); - + recent_files_menu_register(); + BKE_spacetype_register(st); } diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c index 409277cb66e..26b4b6fc08c 100644 --- a/source/blender/editors/space_logic/logic_window.c +++ b/source/blender/editors/space_logic/logic_window.c @@ -3184,8 +3184,8 @@ static void draw_sensor_header(uiLayout *layout, PointerRNA *ptr, PointerRNA *lo uiItemR(row, ptr, "name", 0, "", 0); subrow= uiLayoutRow(row, 0); - uiLayoutSetActive(subrow, (RNA_boolean_get(logic_ptr, "sensors_show_active_states") - && RNA_boolean_get(ptr, "expanded") || RNA_boolean_get(ptr, "pinned"))); + uiLayoutSetActive(subrow, ((RNA_boolean_get(logic_ptr, "sensors_show_active_states") + && RNA_boolean_get(ptr, "expanded")) || RNA_boolean_get(ptr, "pinned"))); uiItemR(subrow, ptr, "pinned", UI_ITEM_R_NO_BG, "", 0); uiItemO(row, "", ICON_X, "LOGIC_OT_sensor_remove"); @@ -3602,8 +3602,8 @@ static void draw_actuator_header(uiLayout *layout, PointerRNA *ptr, PointerRNA * uiItemR(row, ptr, "name", 0, "", 0); subrow= uiLayoutRow(row, 0); - uiLayoutSetActive(subrow, (RNA_boolean_get(logic_ptr, "actuators_show_active_states") - && RNA_boolean_get(ptr, "expanded") || RNA_boolean_get(ptr, "pinned"))); + uiLayoutSetActive(subrow, ((RNA_boolean_get(logic_ptr, "actuators_show_active_states") + && RNA_boolean_get(ptr, "expanded")) || RNA_boolean_get(ptr, "pinned"))); uiItemR(subrow, ptr, "pinned", UI_ITEM_R_NO_BG, "", 0); uiItemO(row, "", ICON_X, "LOGIC_OT_actuator_remove"); @@ -4436,7 +4436,7 @@ static void logic_buttons_new(bContext *C, ARegion *ar) bController *cont; PointerRNA ptr; uiLayout *split, *subsplit, *col; - int iact; + ob= (Object *)idar[a]; diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 629b1008aa0..2d111b731ad 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -107,7 +107,7 @@ static void node_buts_rgb(uiLayout *layout, bContext *C, PointerRNA *ptr) RNA_property_collection_lookup_int(ptr, prop, 0, &sockptr); col = uiLayoutColumn(layout, 0); - uiTemplateColorWheel(col, &sockptr, "default_value", 1, 0); + uiTemplateColorWheel(col, &sockptr, "default_value", 1, 0, 0, 0); uiItemR(col, &sockptr, "default_value", 0, "", 0); } @@ -947,17 +947,17 @@ static void node_composit_buts_colorbalance(uiLayout *layout, bContext *C, Point split = uiLayoutSplit(layout, 0, 0); col = uiLayoutColumn(split, 0); - uiTemplateColorWheel(col, ptr, "lift", 1, 1); + uiTemplateColorWheel(col, ptr, "lift", 1, 1, 0, 1); row = uiLayoutRow(col, 0); uiItemR(row, ptr, "lift", 0, NULL, 0); col = uiLayoutColumn(split, 0); - uiTemplateColorWheel(col, ptr, "gamma", 1, 1); + uiTemplateColorWheel(col, ptr, "gamma", 1, 1, 1, 1); row = uiLayoutRow(col, 0); uiItemR(row, ptr, "gamma", 0, NULL, 0); col = uiLayoutColumn(split, 0); - uiTemplateColorWheel(col, ptr, "gain", 1, 1); + uiTemplateColorWheel(col, ptr, "gain", 1, 1, 1, 1); row = uiLayoutRow(col, 0); uiItemR(row, ptr, "gain", 0, NULL, 0); @@ -965,17 +965,17 @@ static void node_composit_buts_colorbalance(uiLayout *layout, bContext *C, Point split = uiLayoutSplit(layout, 0, 0); col = uiLayoutColumn(split, 0); - uiTemplateColorWheel(col, ptr, "offset", 1, 1); + uiTemplateColorWheel(col, ptr, "offset", 1, 1, 0, 1); row = uiLayoutRow(col, 0); uiItemR(row, ptr, "offset", 0, NULL, 0); col = uiLayoutColumn(split, 0); - uiTemplateColorWheel(col, ptr, "power", 1, 1); + uiTemplateColorWheel(col, ptr, "power", 1, 1, 0, 1); row = uiLayoutRow(col, 0); uiItemR(row, ptr, "power", 0, NULL, 0); col = uiLayoutColumn(split, 0); - uiTemplateColorWheel(col, ptr, "slope", 1, 1); + uiTemplateColorWheel(col, ptr, "slope", 1, 1, 0, 1); row = uiLayoutRow(col, 0); uiItemR(row, ptr, "slope", 0, NULL, 0); } diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index dd838a67afa..cea88c33c5b 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -31,6 +31,7 @@ #include <stdlib.h> #include <math.h> #include <string.h> +#include <errno.h> #include "MEM_guardedalloc.h" @@ -65,6 +66,7 @@ #include "ED_node.h" #include "ED_screen.h" +#include "ED_render.h" #include "RNA_access.h" #include "RNA_define.h" @@ -548,6 +550,8 @@ static int node_group_edit_exec(bContext *C, wmOperator *op) SpaceNode *snode = CTX_wm_space_node(C); bNode *gnode; + ED_preview_kill_jobs(C); + gnode= nodeGetActive(snode->edittree); snode_make_group_editable(snode, gnode); @@ -593,6 +597,8 @@ static int node_group_ungroup_exec(bContext *C, wmOperator *op) SpaceNode *snode = CTX_wm_space_node(C); bNode *gnode; + ED_preview_kill_jobs(C); + /* are we inside of a group? */ gnode= node_tree_get_editgroup(snode->nodetree); if(gnode) @@ -1098,13 +1104,16 @@ static int node_active_link_viewer(bContext *C, wmOperator *op) SpaceNode *snode= CTX_wm_space_node(C); bNode *node; - node= editnode_get_active(snode->edittree); - if(node) { - node_link_viewer(snode, node); - snode_notify(C, snode); - } + if(!node) + return OPERATOR_CANCELLED; + + ED_preview_kill_jobs(C); + + node_link_viewer(snode, node); + snode_notify(C, snode); + return OPERATOR_FINISHED; } @@ -1466,6 +1475,8 @@ static int node_duplicate_exec(bContext *C, wmOperator *op) { SpaceNode *snode= CTX_wm_space_node(C); + ED_preview_kill_jobs(C); + ntreeCopyTree(snode->edittree, 1); /* 1 == internally selected nodes */ ntreeSolveOrder(snode->edittree); @@ -1624,7 +1635,7 @@ static int node_link_modal(bContext *C, wmOperator *op, wmEvent *event) static int node_link_init(SpaceNode *snode, NodeLinkDrag *nldrag) { bNodeLink *link; - + /* output indicated? */ if(find_indicated_socket(snode, &nldrag->node, &nldrag->sock, SOCK_OUT)) { if(nodeCountSocketLinks(snode->edittree, nldrag->sock) < nldrag->sock->limit) @@ -1678,6 +1689,8 @@ static int node_link_invoke(bContext *C, wmOperator *op, wmEvent *event) UI_view2d_region_to_view(&ar->v2d, event->x - ar->winrct.xmin, event->y - ar->winrct.ymin, &snode->mx, &snode->my); + ED_preview_kill_jobs(C); + nldrag->in_out= node_link_init(snode, nldrag); if(nldrag->in_out) { @@ -1724,6 +1737,8 @@ static int node_make_link_exec(bContext *C, wmOperator *op) SpaceNode *snode= CTX_wm_space_node(C); int replace = RNA_boolean_get(op->ptr, "replace"); + ED_preview_kill_jobs(C); + snode_autoconnect(snode, 0, replace); node_tree_verify_groups(snode->nodetree); @@ -1787,6 +1802,8 @@ static int cut_links_exec(bContext *C, wmOperator *op) if(i>1) { bNodeLink *link, *next; + + ED_preview_kill_jobs(C); for(link= snode->edittree->links.first; link; link= next) { next= link->next; @@ -1839,6 +1856,8 @@ static int node_read_renderlayers_exec(bContext *C, wmOperator *op) Scene *curscene= CTX_data_scene(C), *scene; bNode *node; + ED_preview_kill_jobs(C); + /* first tag scenes unread */ for(scene= G.main->scene.first; scene; scene= scene->id.next) scene->id.flag |= LIB_DOIT; @@ -1955,6 +1974,8 @@ static int node_group_make_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } } + + ED_preview_kill_jobs(C); gnode= nodeMakeGroupFromSelected(snode->nodetree); if(gnode==NULL) { @@ -2057,6 +2078,8 @@ static int node_preview_exec(bContext *C, wmOperator *op) if((snode == NULL) || (snode->edittree == NULL)) return OPERATOR_CANCELLED; + ED_preview_kill_jobs(C); + node_flag_toggle_exec(snode, NODE_PREVIEW); snode_notify(C, snode); @@ -2089,6 +2112,8 @@ static int node_socket_toggle_exec(bContext *C, wmOperator *op) if((snode == NULL) || (snode->edittree == NULL)) return OPERATOR_CANCELLED; + ED_preview_kill_jobs(C); + for(node= snode->edittree->nodes.first; node; node= node->next) { if(node->flag & SELECT) { if(node_has_hidden_sockets(node)) { @@ -2137,6 +2162,8 @@ static int node_mute_exec(bContext *C, wmOperator *op) if(node_tree_get_editgroup(snode->nodetree)) return OPERATOR_CANCELLED; + ED_preview_kill_jobs(C); + for(node= snode->edittree->nodes.first; node; node= node->next) { if(node->flag & SELECT) { if(node->inputs.first && node->outputs.first) { @@ -2173,6 +2200,8 @@ static int node_delete_exec(bContext *C, wmOperator *op) SpaceNode *snode= CTX_wm_space_node(C); bNode *node, *next; + ED_preview_kill_jobs(C); + for(node= snode->edittree->nodes.first; node; node= next) { next= node->next; if(node->flag & SELECT) { @@ -2248,25 +2277,34 @@ static int node_add_file_exec(bContext *C, wmOperator *op) { char path[FILE_MAX]; RNA_string_get(op->ptr, "filepath", path); + + errno= 0; + ima= BKE_add_image_file(path, scene ? scene->r.cfra : 1); + + if(!ima) { + BKE_reportf(op->reports, RPT_ERROR, "Can't read: \"%s\", %s.", path, errno ? strerror(errno) : "Unsupported image format"); + return OPERATOR_CANCELLED; + } } else if(RNA_property_is_set(op->ptr, "name")) { char name[32]; RNA_string_get(op->ptr, "name", name); ima= (Image *)find_id("IM", name); + + if(!ima) { + BKE_reportf(op->reports, RPT_ERROR, "Image named \"%s\", not found.", name); + return OPERATOR_CANCELLED; + } } - if(!ima) { - BKE_report(op->reports, RPT_ERROR, "Not an Image."); - return OPERATOR_CANCELLED; - } - - node_deselectall(snode); if (snode->nodetree->type==NTREE_COMPOSIT) ntype = CMP_NODE_IMAGE; + + ED_preview_kill_jobs(C); node = node_add_node(snode, scene, ntype, snode->mx, snode->my); @@ -2312,7 +2350,7 @@ void NODE_OT_add_file(wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE, FILE_SPECIAL, FILE_OPENFILE, 0); //XXX TODO, relative_path + WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH); //XXX TODO, relative_path RNA_def_string(ot->srna, "name", "Image", 24, "Name", "Datablock name to assign."); } diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c index 1a56cb6d683..36ae475e64b 100644 --- a/source/blender/editors/space_sequencer/sequencer_add.c +++ b/source/blender/editors/space_sequencer/sequencer_add.c @@ -86,8 +86,6 @@ static void sequencer_generic_props__internal(wmOperatorType *ot, int flag) { - RNA_def_string(ot->srna, "name", "", MAX_ID_NAME-2, "Name", "Name of the new sequence strip"); - if(flag & SEQPROP_STARTFRAME) RNA_def_int(ot->srna, "frame_start", 0, INT_MIN, INT_MAX, "Start Frame", "Start frame of the sequence strip", INT_MIN, INT_MAX); @@ -102,6 +100,20 @@ static void sequencer_generic_props__internal(wmOperatorType *ot, int flag) RNA_def_collection_runtime(ot->srna, "files", &RNA_OperatorFileListElement, "Files", ""); } +static void sequencer_generic_invoke_path__internal(bContext *C, wmOperator *op, const char *identifier) +{ + if(RNA_struct_find_property(op->ptr, identifier)) { + Scene *scene= CTX_data_scene(C); + Sequence *last_seq= seq_active_get(scene); + if(last_seq && last_seq->strip && SEQ_HAS_PATH(last_seq)) { + char path[sizeof(last_seq->strip->dir)]; + BLI_strncpy(path, last_seq->strip->dir, sizeof(path)); + BLI_path_abs(path, G.sce); + RNA_string_set(op->ptr, identifier, path); + } + } +} + static void sequencer_generic_invoke_xy__internal(bContext *C, wmOperator *op, wmEvent *event, int flag) { ARegion *ar= CTX_wm_region(C); @@ -121,11 +133,14 @@ static void sequencer_generic_invoke_xy__internal(bContext *C, wmOperator *op, w if ((flag & SEQPROP_ENDFRAME) && RNA_property_is_set(op->ptr, "frame_end")==0) RNA_int_set(op->ptr, "frame_end", (int)mval_v2d[0] + 25); // XXX arbitary but ok for now. - + + sequencer_generic_invoke_path__internal(C, op, "filepath"); + sequencer_generic_invoke_path__internal(C, op, "directory"); } static void seq_load_operator_info(SeqLoadInfo *seq_load, wmOperator *op) { + int is_file= -1; memset(seq_load, 0, sizeof(SeqLoadInfo)); seq_load->start_frame= RNA_int_get(op->ptr, "frame_start"); @@ -134,9 +149,13 @@ static void seq_load_operator_info(SeqLoadInfo *seq_load, wmOperator *op) seq_load->channel= RNA_int_get(op->ptr, "channel"); seq_load->len= 1; // images only, if endframe isnt set! - RNA_string_get(op->ptr, "name", seq_load->name+2); - - RNA_string_get(op->ptr, "filepath", seq_load->path); /* full path, file is set by the caller */ + if(RNA_struct_find_property(op->ptr, "filepath")) { + RNA_string_get(op->ptr, "filepath", seq_load->path); /* full path, file is set by the caller */ + is_file= 1; + } else if (RNA_struct_find_property(op->ptr, "directory")) { + RNA_string_get(op->ptr, "directory", seq_load->path); /* full path, file is set by the caller */ + is_file= 0; + } if (RNA_struct_find_property(op->ptr, "frame_end")) { seq_load->end_frame = RNA_int_get(op->ptr, "frame_end"); @@ -153,6 +172,20 @@ static void seq_load_operator_info(SeqLoadInfo *seq_load, wmOperator *op) /* always use this for ops */ seq_load->flag |= SEQ_LOAD_FRAME_ADVANCE; + + + if(is_file==1) { + BLI_strncpy(seq_load->name, BLI_path_basename(seq_load->path), sizeof(seq_load->name)); + } + else if(RNA_struct_find_property(op->ptr, "files")) { + /* used for image strip */ + /* best guess, first images name */ + RNA_BEGIN(op->ptr, itemptr, "files") { + RNA_string_get(&itemptr, "name", seq_load->name); + break; + } + RNA_END; + } } /* add scene operator */ @@ -180,8 +213,9 @@ static int sequencer_add_scene_strip_exec(bContext *C, wmOperator *op) } seq = alloc_sequence(ed->seqbasep, start_frame, channel); - seq->type= SEQ_SCENE; + seq->blend_mode= SEQ_CROSS; /* so alpha adjustment fade to the strip below */ + seq->scene= sce_seq; seq->sfra= sce_seq->r.sfra; @@ -192,11 +226,9 @@ static int sequencer_add_scene_strip_exec(bContext *C, wmOperator *op) strip->stripdata= se= MEM_callocN(seq->len*sizeof(StripElem), "stripelem"); - if(RNA_property_is_set(op->ptr, "name")) - RNA_string_get(op->ptr, "name", seq->name+2); - else - strcpy(seq->name+2, sce_seq->id.name+2); - + strcpy(seq->name+2, sce_seq->id.name+2); + seqbase_unique_name_recursive(&ed->seqbase, seq); + seq->scene_sound = sound_scene_add_scene_sound(scene, seq, start_frame, start_frame + strip->len, 0); calc_sequence_disp(scene, seq); @@ -318,7 +350,10 @@ static int sequencer_add_movie_strip_invoke(bContext *C, wmOperator *op, wmEvent RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS); sequencer_generic_invoke_xy__internal(C, op, event, 0); - return WM_operator_filesel(C, op, event); + + WM_event_add_fileselect(C, op); + return OPERATOR_RUNNING_MODAL; + //return sequencer_add_movie_strip_exec(C, op); } @@ -340,7 +375,7 @@ void SEQUENCER_OT_movie_strip_add(struct wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - WM_operator_properties_filesel(ot, FOLDERFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE, FILE_RELPATH); + WM_operator_properties_filesel(ot, FOLDERFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH|WM_FILESEL_RELPATH); sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME|SEQPROP_FILES); RNA_def_boolean(ot->srna, "sound", TRUE, "Sound", "Load sound with the movie"); } @@ -363,7 +398,10 @@ static int sequencer_add_sound_strip_invoke(bContext *C, wmOperator *op, wmEvent RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS); sequencer_generic_invoke_xy__internal(C, op, event, 0); - return WM_operator_filesel(C, op, event); + + WM_event_add_fileselect(C, op); + return OPERATOR_RUNNING_MODAL; + //return sequencer_add_sound_strip_exec(C, op); } @@ -385,7 +423,7 @@ void SEQUENCER_OT_sound_strip_add(struct wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - WM_operator_properties_filesel(ot, FOLDERFILE|SOUNDFILE, FILE_SPECIAL, FILE_OPENFILE, FILE_RELPATH); + WM_operator_properties_filesel(ot, FOLDERFILE|SOUNDFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH|WM_FILESEL_RELPATH); sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME|SEQPROP_FILES); RNA_def_boolean(ot->srna, "cache", FALSE, "Cache", "Cache the sound in memory."); } @@ -409,26 +447,24 @@ static int sequencer_add_image_strip_exec(bContext *C, wmOperator *op) seq_load.len= RNA_property_collection_length(op->ptr, RNA_struct_find_property(op->ptr, "files")); if(seq_load.len==0) - seq_load.len= 1; + return OPERATOR_CANCELLED; if(seq_load.flag & SEQ_LOAD_REPLACE_SEL) deselect_all_seq(scene); - + /* main adding function */ seq= sequencer_add_image_strip(C, ed->seqbasep, &seq_load); strip= seq->strip; se= strip->stripdata; - if(seq_load.len > 1) { - RNA_BEGIN(op->ptr, itemptr, "files") { - RNA_string_get(&itemptr, "name", se->name); - se++; - } - RNA_END; + RNA_BEGIN(op->ptr, itemptr, "files") { + RNA_string_get(&itemptr, "name", se->name); + se++; } - else { - BLI_strncpy(se->name, BLI_path_basename(seq_load.path), sizeof(se->name)); + RNA_END; + + if(seq_load.len == 1) { if(seq_load.start_frame < seq_load.end_frame) { seq->endstill= seq_load.end_frame - seq_load.start_frame; } @@ -457,7 +493,10 @@ static int sequencer_add_image_strip_invoke(bContext *C, wmOperator *op, wmEvent RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS); sequencer_generic_invoke_xy__internal(C, op, event, SEQPROP_ENDFRAME); - return WM_operator_filesel(C, op, event); + + WM_event_add_fileselect(C, op); + return OPERATOR_RUNNING_MODAL; + //return sequencer_add_image_strip_exec(C, op); } @@ -479,7 +518,7 @@ void SEQUENCER_OT_image_strip_add(struct wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE, FILE_SPECIAL, FILE_OPENFILE, FILE_RELPATH); + WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_DIRECTORY|WM_FILESEL_RELPATH); sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME|SEQPROP_ENDFRAME|SEQPROP_FILES); } @@ -506,7 +545,7 @@ static int sequencer_add_effect_strip_exec(bContext *C, wmOperator *op) type= RNA_enum_get(op->ptr, "type"); - // XXX We need unique names and move to invoke + // XXX move to invoke if(!seq_effect_find_selected(scene, NULL, type, &seq1, &seq2, &seq3, &error_msg)) { BKE_report(op->reports, RPT_ERROR, error_msg); return OPERATOR_CANCELLED; @@ -522,11 +561,7 @@ static int sequencer_add_effect_strip_exec(bContext *C, wmOperator *op) seq = alloc_sequence(ed->seqbasep, start_frame, channel); seq->type= type; - if(RNA_property_is_set(op->ptr, "name")) - RNA_string_get(op->ptr, "name", seq->name+2); - else - strcpy(seq->name+2, give_seqname(seq)); - + BLI_strncpy(seq->name+2, give_seqname(seq), sizeof(seq->name)-2); seqbase_unique_name_recursive(&ed->seqbase, seq); sh = get_sequence_effect(seq); @@ -569,6 +604,18 @@ static int sequencer_add_effect_strip_exec(bContext *C, wmOperator *op) else if (seq->type==SEQ_COLOR) { SolidColorVars *colvars= (SolidColorVars *)seq->effectdata; RNA_float_get_array(op->ptr, "color", colvars->col); + seq->blend_mode= SEQ_CROSS; /* so alpha adjustment fade to the strip below */ + + } + + // XXX, this conflicts with giving a channel with invoke, perhaps we should have an active channel + // but for now this is much more usable + if(seq->seq1 || seq->seq2 || seq->seq3) { + int chan= MAX3( seq->seq1 ? seq->seq1->machine : 0, + seq->seq2 ? seq->seq2->machine : 0, + seq->seq3 ? seq->seq3->machine : 0); + if(chan < MAXSEQ) + seq->machine= chan; } if(seq_test_overlap(ed->seqbasep, seq)) shuffle_seq(ed->seqbasep, seq, scene); @@ -631,7 +678,7 @@ void SEQUENCER_OT_effect_strip_add(struct wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - WM_operator_properties_filesel(ot, 0, FILE_SPECIAL, FILE_OPENFILE, FILE_RELPATH); + WM_operator_properties_filesel(ot, 0, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH|WM_FILESEL_RELPATH); sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME|SEQPROP_ENDFRAME); RNA_def_enum(ot->srna, "type", sequencer_prop_effect_types, SEQ_CROSS, "Type", "Sequencer effect type"); RNA_def_float_vector(ot->srna, "color", 3, NULL, 0.0f, 1.0f, "Color", "Initialize the strip with this color (only used when type='COLOR')", 0.0f, 1.0f); diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index bf7f053ad71..e449490516c 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -200,46 +200,86 @@ static void drawseqwave(Sequence *seq, float x1, float y1, float x2, float y2, f } } +static void drawmeta_stipple(int value) +{ + if(value) { + glEnable(GL_POLYGON_STIPPLE); + glPolygonStipple(stipple_halftone); + + glEnable(GL_LINE_STIPPLE); + glLineStipple(1, 0x8888); + } + else { + glDisable(GL_POLYGON_STIPPLE); + glDisable(GL_LINE_STIPPLE); + } +} + static void drawmeta_contents(Scene *scene, Sequence *seqm, float x1, float y1, float x2, float y2) { /* Note, this used to use WHILE_SEQ, but it messes up the seq->depth value, (needed by transform when doing overlap checks) * so for now, just use the meta's immediate children, could be fixed but its only drawing - Campbell */ Sequence *seq; - float dx; - int nr; - char col[3]; - - nr= BLI_countlist(&seqm->seqbase); + char col[4]; - dx= (x2-x1)/nr; + int chan_min= MAXSEQ; + int chan_max= 0; + int chan_range= 0; + float draw_range= y2 - y1; + float draw_height; - if (seqm->flag & SEQ_MUTE) { - glEnable(GL_POLYGON_STIPPLE); - glPolygonStipple(stipple_halftone); - - glEnable(GL_LINE_STIPPLE); - glLineStipple(1, 0x8888); + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + + if(seqm->flag & SEQ_MUTE) + drawmeta_stipple(1); + + for (seq= seqm->seqbase.first; seq; seq= seq->next) { + chan_min= MIN2(chan_min, seq->machine); + chan_max= MAX2(chan_max, seq->machine); } - + + chan_range= (chan_max - chan_min) + 1; + draw_height= draw_range / chan_range; + + col[3]= 196; /* alpha, used for all meta children */ + for (seq= seqm->seqbase.first; seq; seq= seq->next) { - get_seq_color3ubv(scene, seq, col); - - glColor3ubv((GLubyte *)col); + if((seq->startdisp > x2 || seq->enddisp < x1) == 0) { + float y_chan= (seq->machine - chan_min) / (float)(chan_range) * draw_range; + float x1_chan= seq->startdisp; + float x2_chan= seq->enddisp; + float y1_chan, y2_chan; - glRectf(x1, y1, x1+0.9*dx, y2); - - UI_GetColorPtrBlendShade3ubv(col, col, col, 0.0, -30); - glColor3ubv((GLubyte *)col); + if((seqm->flag & SEQ_MUTE) == 0 && (seq->flag & SEQ_MUTE)) + drawmeta_stipple(1); - fdrawbox(x1, y1, x1+0.9*dx, y2); - - x1+= dx; + get_seq_color3ubv(scene, seq, col); + + glColor4ubv((GLubyte *)col); + + /* clamp within parent sequence strip bounds */ + if(x1_chan < x1) x1_chan= x1; + if(x2_chan > x2) x2_chan= x2; + + y1_chan= y1 + y_chan + (draw_height * SEQ_STRIP_OFSBOTTOM); + y2_chan= y1 + y_chan + (draw_height * SEQ_STRIP_OFSTOP); + + glRectf(x1_chan, y1_chan, x2_chan, y2_chan); + + UI_GetColorPtrBlendShade3ubv(col, col, col, 0.0, -30); + glColor4ubv((GLubyte *)col); + fdrawbox(x1_chan, y1_chan, x2_chan, y2_chan); + + if((seqm->flag & SEQ_MUTE) == 0 && (seq->flag & SEQ_MUTE)) + drawmeta_stipple(0); + } } + + if (seqm->flag & SEQ_MUTE) + drawmeta_stipple(0); - if (seqm->flag & SEQ_MUTE) { - glDisable(GL_POLYGON_STIPPLE); - glDisable(GL_LINE_STIPPLE); - } + glDisable(GL_BLEND); } /* draw a handle, for each end of a sequence strip */ @@ -619,13 +659,12 @@ static void draw_seq_strip(Scene *scene, ARegion *ar, SpaceSeq *sseq, Sequence * glDisable(GL_LINE_STIPPLE); } + if(seq->type==SEQ_META) drawmeta_contents(scene, seq, x1, y1, x2, y2); + /* calculate if seq is long enough to print a name */ x1= seq->startdisp+seq->handsize; x2= seq->enddisp-seq->handsize; - /* but first the contents of a meta */ - if(seq->type==SEQ_META) drawmeta_contents(scene, seq, x1, y1+0.15, x2, y2-0.15); - /* info text on the strip */ if(x1<v2d->cur.xmin) x1= v2d->cur.xmin; else if(x1>v2d->cur.xmax) x1= v2d->cur.xmax; diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index 6d225647a52..1592c2093c4 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -677,36 +677,6 @@ int seq_effect_find_selected(Scene *scene, Sequence *activeseq, int type, Sequen return 1; } -void reassign_inputs_seq_effect(Scene *scene) -{ - Editing *ed= seq_give_editing(scene, FALSE); - Sequence *seq1, *seq2, *seq3, *last_seq = seq_active_get(scene); - char *error_msg; - - if(last_seq==0 || !(last_seq->type & SEQ_EFFECT)) return; - if(ed==NULL) return; - - if(!seq_effect_find_selected(scene, last_seq, last_seq->type, &seq1, &seq2, &seq3, &error_msg)) { - //BKE_report(op->reports, RPT_ERROR, error_msg); // XXX operatorify - return; - } - /* see reassigning would create a cycle */ - if( seq_is_predecessor(seq1, last_seq) || - seq_is_predecessor(seq2, last_seq) || - seq_is_predecessor(seq3, last_seq) - ) { - //BKE_report(op->reports, RPT_ERROR, "Can't reassign inputs: no cycles allowed"); // XXX operatorify - return; - } - - last_seq->seq1 = seq1; - last_seq->seq2 = seq2; - last_seq->seq3 = seq3; - - update_changed_seq_and_deps(scene, last_seq, 1, 1); - -} - static Sequence *del_seq_find_replace_recurs(Scene *scene, Sequence *seq) { Sequence *seq1, *seq2, *seq3; @@ -761,7 +731,8 @@ static void recurs_del_seq_flag(Scene *scene, ListBase *lb, short flag, short de BLI_remlink(lb, seq); if(seq==last_seq) seq_active_set(scene, NULL); if(seq->type==SEQ_META) recurs_del_seq_flag(scene, &seq->seqbase, flag, 1); - if(seq->ipo) seq->ipo->id.us--; + /* if(seq->ipo) seq->ipo->id.us--; */ + /* XXX, remove fcurve */ seq_free_sequence(scene, seq); } seq= seqn; @@ -1457,6 +1428,67 @@ void SEQUENCER_OT_refresh_all(struct wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } +static int sequencer_reassign_inputs_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + Sequence *seq1, *seq2, *seq3, *last_seq = seq_active_get(scene); + char *error_msg; + + if(!seq_effect_find_selected(scene, last_seq, last_seq->type, &seq1, &seq2, &seq3, &error_msg)) { + BKE_report(op->reports, RPT_ERROR, error_msg); + return OPERATOR_CANCELLED; + } + /* see reassigning would create a cycle */ + if( seq_is_predecessor(seq1, last_seq) || + seq_is_predecessor(seq2, last_seq) || + seq_is_predecessor(seq3, last_seq) + ) { + BKE_report(op->reports, RPT_ERROR, "Can't reassign inputs: no cycles allowed"); + return OPERATOR_CANCELLED; + } + + last_seq->seq1 = seq1; + last_seq->seq2 = seq2; + last_seq->seq3 = seq3; + + update_changed_seq_and_deps(scene, last_seq, 1, 1); + + WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, scene); + + return OPERATOR_FINISHED; +} + +int sequencer_effect_poll(bContext *C) +{ + Scene *scene= CTX_data_scene(C); + Editing *ed= seq_give_editing(scene, FALSE); + + if(ed) { + Sequence *last_seq= seq_active_get(scene); + if(last_seq && (last_seq->type & SEQ_EFFECT)) { + return 1; + } + } + + return 0; +} + +void SEQUENCER_OT_reassign_inputs(struct wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Reassign Inputs"; + ot->idname= "SEQUENCER_OT_reassign_inputs"; + ot->description="Reassign the inputs for the effects strip"; + + /* api callbacks */ + ot->exec= sequencer_reassign_inputs_exec; + ot->poll= sequencer_effect_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + + /* cut operator */ static EnumPropertyItem prop_cut_types[] = { {SEQ_CUT_SOFT, "SOFT", 0, "Soft", ""}, @@ -1700,10 +1732,7 @@ static int sequencer_separate_images_exec(bContext *C, wmOperator *op) int start_ofs, cfra, frame_end; int step= RNA_int_get(op->ptr, "length"); - if(ed==NULL) - return OPERATOR_CANCELLED; - - seq= ed->seqbasep->first; + seq= ed->seqbasep->first; /* poll checks this is valid */ while (seq) { if((seq->flag & SELECT) && (seq->type == SEQ_IMAGE) && (seq->len > 1)) { @@ -1711,7 +1740,8 @@ static int sequencer_separate_images_exec(bContext *C, wmOperator *op) see seq_free_sequence below for the real free'ing */ seq_next = seq->next; BLI_remlink(ed->seqbasep, seq); - if(seq->ipo) seq->ipo->id.us--; + /* if(seq->ipo) seq->ipo->id.us--; */ + /* XXX, remove fcurve and assign to split image strips */ start_ofs = cfra = seq_tx_get_final_left(seq, 0); frame_end = seq_tx_get_final_right(seq, 0); @@ -1735,11 +1765,16 @@ static int sequencer_separate_images_exec(bContext *C, wmOperator *op) strip_new->stripdata= se_new= MEM_callocN(sizeof(StripElem)*1, "stripelem"); strncpy(se_new->name, se->name, FILE_MAXFILE-1); calc_sequence(scene, seq_new); - seq_new->flag &= ~SEQ_OVERLAP; - if (seq_test_overlap(ed->seqbasep, seq_new)) { - shuffle_seq(ed->seqbasep, seq_new, scene); + + if(step > 1) { + seq_new->flag &= ~SEQ_OVERLAP; + if (seq_test_overlap(ed->seqbasep, seq_new)) { + shuffle_seq(ed->seqbasep, seq_new, scene); + } } + /* XXX, COPY FCURVES */ + strncpy(seq_new->name+2, seq->name+2, sizeof(seq->name)-2); seqbase_unique_name_recursive(&scene->ed->seqbase, seq_new); cfra++; @@ -1857,8 +1892,7 @@ static int sequencer_meta_make_exec(bContext *C, wmOperator *op) Scene *scene= CTX_data_scene(C); Editing *ed= seq_give_editing(scene, FALSE); - Sequence *seq, *seqm, *next; - + Sequence *seq, *seqm, *next, *last_seq = seq_active_get(scene); int channel_max= 1; if(seqbase_isolated_sel_check(ed->seqbasep)==FALSE) { @@ -1883,7 +1917,7 @@ static int sequencer_meta_make_exec(bContext *C, wmOperator *op) } seq= next; } - seqm->machine= channel_max; + seqm->machine= last_seq ? last_seq->machine : channel_max; calc_sequence(scene, seqm); seqm->strip= MEM_callocN(sizeof(Strip), "metastrip"); @@ -2643,9 +2677,18 @@ static int sequencer_swap_data_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } + sound_remove_scene_sound(scene, seq_act->scene_sound); + sound_remove_scene_sound(scene, seq_other->scene_sound); + + seq_act->scene_sound= NULL; + seq_other->scene_sound= NULL; + calc_sequence(scene, seq_act); calc_sequence(scene, seq_other); + if(seq_act->sound) sound_add_scene_sound(scene, seq_act, seq_act->startdisp, seq_act->enddisp, seq_act->startofs + seq_act->anim_startofs); + if(seq_other->sound) sound_add_scene_sound(scene, seq_other, seq_other->startdisp, seq_other->enddisp, seq_other->startofs + seq_other->anim_startofs); + WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, scene); return OPERATOR_FINISHED; diff --git a/source/blender/editors/space_sequencer/sequencer_intern.h b/source/blender/editors/space_sequencer/sequencer_intern.h index 71953ff3ddd..df426e91075 100644 --- a/source/blender/editors/space_sequencer/sequencer_intern.h +++ b/source/blender/editors/space_sequencer/sequencer_intern.h @@ -85,6 +85,7 @@ void SEQUENCER_OT_lock(struct wmOperatorType *ot); void SEQUENCER_OT_unlock(struct wmOperatorType *ot); void SEQUENCER_OT_reload(struct wmOperatorType *ot); void SEQUENCER_OT_refresh_all(struct wmOperatorType *ot); +void SEQUENCER_OT_reassign_inputs(struct wmOperatorType *ot); void SEQUENCER_OT_duplicate(struct wmOperatorType *ot); void SEQUENCER_OT_delete(struct wmOperatorType *ot); void SEQUENCER_OT_images_separate(struct wmOperatorType *ot); diff --git a/source/blender/editors/space_sequencer/sequencer_ops.c b/source/blender/editors/space_sequencer/sequencer_ops.c index 69457e5c6e8..9f5a97d4446 100644 --- a/source/blender/editors/space_sequencer/sequencer_ops.c +++ b/source/blender/editors/space_sequencer/sequencer_ops.c @@ -63,6 +63,7 @@ void sequencer_operatortypes(void) WM_operatortype_append(SEQUENCER_OT_unlock); WM_operatortype_append(SEQUENCER_OT_reload); WM_operatortype_append(SEQUENCER_OT_refresh_all); + WM_operatortype_append(SEQUENCER_OT_reassign_inputs); WM_operatortype_append(SEQUENCER_OT_duplicate); WM_operatortype_append(SEQUENCER_OT_delete); WM_operatortype_append(SEQUENCER_OT_images_separate); @@ -134,6 +135,7 @@ void sequencer_keymap(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "SEQUENCER_OT_lock", LKEY, KM_PRESS, KM_SHIFT, 0); WM_keymap_add_item(keymap, "SEQUENCER_OT_unlock", LKEY, KM_PRESS, KM_SHIFT|KM_ALT, 0); + WM_keymap_add_item(keymap, "SEQUENCER_OT_reassign_inputs", RKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "SEQUENCER_OT_reload", RKEY, KM_PRESS, KM_ALT, 0); WM_keymap_add_item(keymap, "SEQUENCER_OT_duplicate", DKEY, KM_PRESS, KM_SHIFT, 0); diff --git a/source/blender/editors/space_sequencer/space_sequencer.c b/source/blender/editors/space_sequencer/space_sequencer.c index 49c2049c66c..8b7670a55bc 100644 --- a/source/blender/editors/space_sequencer/space_sequencer.c +++ b/source/blender/editors/space_sequencer/space_sequencer.c @@ -355,6 +355,7 @@ static void sequencer_main_area_listener(ARegion *ar, wmNotifier *wmn) case NC_SCENE: switch(wmn->data) { case ND_FRAME: + case ND_FRAME_RANGE: case ND_MARKERS: case ND_SEQUENCER: ED_region_tag_redraw(ar); diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index c90d257ee43..a684c4dce0e 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -295,7 +295,7 @@ void TEXT_OT_open(wmOperatorType *ot) ot->flag= OPTYPE_UNDO; /* properties */ - WM_operator_properties_filesel(ot, FOLDERFILE|TEXTFILE|PYSCRIPTFILE, FILE_SPECIAL, FILE_OPENFILE, 0); //XXX TODO, relative_path + WM_operator_properties_filesel(ot, FOLDERFILE|TEXTFILE|PYSCRIPTFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH); //XXX TODO, relative_path RNA_def_boolean(ot->srna, "internal", 0, "Make internal", "Make text file internal after loading"); } @@ -542,7 +542,7 @@ void TEXT_OT_save_as(wmOperatorType *ot) ot->poll= text_edit_poll; /* properties */ - WM_operator_properties_filesel(ot, FOLDERFILE|TEXTFILE|PYSCRIPTFILE, FILE_SPECIAL, FILE_SAVE, 0); //XXX TODO, relative_path + WM_operator_properties_filesel(ot, FOLDERFILE|TEXTFILE|PYSCRIPTFILE, FILE_SPECIAL, FILE_SAVE, WM_FILESEL_FILEPATH); //XXX TODO, relative_path } /******************* run script operator *********************/ diff --git a/source/blender/editors/space_time/space_time.c b/source/blender/editors/space_time/space_time.c index 7928fc6284a..b2e1bfb9b93 100644 --- a/source/blender/editors/space_time/space_time.c +++ b/source/blender/editors/space_time/space_time.c @@ -410,6 +410,20 @@ static void time_listener(ScrArea *sa, wmNotifier *wmn) case ND_FRAME: ED_area_tag_refresh(sa); break; + case ND_FRAME_RANGE: + { + ARegion *ar; + Scene *scene = wmn->reference; + + for (ar= sa->regionbase.first; ar; ar= ar->next) { + if (ar->regiontype==RGN_TYPE_WINDOW) { + ar->v2d.tot.xmin= (float)(SFRA - 4); + ar->v2d.tot.xmax= (float)(EFRA + 4); + break; + } + } + } + break; } case NC_SPACE: switch (wmn->data) { diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 7cae427112b..c8581abd704 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -5557,6 +5557,9 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) if (ob!=scene->obedit) { if (ob->restrictflag & OB_RESTRICT_VIEW) return; + if ((ob->restrictflag & OB_RESTRICT_RENDER) && + (v3d->flag2 & V3D_RENDER_OVERRIDE)) + return; } /* XXX particles are not safe for simultaneous threaded render */ @@ -6158,7 +6161,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) } } - if(dt<OB_SHADED) { + if(dt<OB_SHADED && (v3d->flag2 & V3D_RENDER_OVERRIDE)==0) { if((ob->gameflag & OB_DYNAMIC) || ((ob->gameflag & OB_BOUNDS) && (ob->boundtype == OB_BOUND_SPHERE))) { float imat[4][4], vec[3]; diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index 92e3b35f614..2b89fbbb656 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -749,6 +749,7 @@ static void view3d_buttons_area_listener(ARegion *ar, wmNotifier *wmn) case ND_POSE: case ND_DRAW: case ND_KEYS: + case ND_MODIFIER: ED_region_tag_redraw(ar); break; } @@ -760,6 +761,8 @@ static void view3d_buttons_area_listener(ARegion *ar, wmNotifier *wmn) ED_region_tag_redraw(ar); break; } + if (wmn->action == NA_EDITED) + ED_region_tag_redraw(ar); break; case NC_TEXTURE: /* for brush textures */ diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 96f1e058948..c3d034eebd3 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -820,7 +820,7 @@ static void draw_selected_name(Scene *scene, Object *ob, View3D *v3d) } /* colour depends on whether there is a keyframe */ - if (id_frame_has_keyframe((ID *)ob, /*frame_to_float(scene, CFRA)*/(float)(CFRA), v3d->keyflags)) + if (id_frame_has_keyframe((ID *)ob, /*BKE_curframe(scene)*/(float)(CFRA), v3d->keyflags)) UI_ThemeColor(TH_VERTEX_SELECT); else UI_ThemeColor(TH_TEXT_HI); @@ -1830,15 +1830,15 @@ static void gpu_update_lamps_shadows(Scene *scene, View3D *v3d) for(shadow=shadows.first; shadow; shadow=shadow->next) { /* this needs to be done better .. */ float viewmat[4][4], winmat[4][4]; - int drawtype, lay, winsize, flag2; + int drawtype, lay, winsize, flag2=v3d->flag2; drawtype= v3d->drawtype; lay= v3d->lay; - flag2= v3d->flag2 & V3D_SOLID_TEX; v3d->drawtype = OB_SOLID; v3d->lay &= GPU_lamp_shadow_layer(shadow->lamp); v3d->flag2 &= ~V3D_SOLID_TEX; + v3d->flag2 |= V3D_RENDER_OVERRIDE; GPU_lamp_shadow_buffer_bind(shadow->lamp, viewmat, &winsize, winmat); @@ -1859,7 +1859,7 @@ static void gpu_update_lamps_shadows(Scene *scene, View3D *v3d) v3d->drawtype= drawtype; v3d->lay= lay; - v3d->flag2 |= flag2; + v3d->flag2 = flag2; } BLI_freelistN(&shadows); @@ -1962,7 +1962,7 @@ void ED_view3d_draw_offscreen(Scene *scene, View3D *v3d, ARegion *ar, int winx, bwiny= ar->winy; ar->winx= winx; ar->winy= winy; - + /* set flags */ G.f |= G_RENDER_OGL; diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 77ba7939ccd..56714143fe9 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -728,7 +728,19 @@ static int viewrotate_invoke(bContext *C, wmOperator *op, wmEvent *event) } } -static int ED_operator_view3d_rotate(bContext *C) +static int view3d_camera_active_poll(bContext *C) +{ + if(ED_operator_view3d_active(C)) { + RegionView3D *rv3d= CTX_wm_region_view3d(C); + if(rv3d->persp==RV3D_CAMOB) { + return 1; + } + } + + return 0; +} + +static int view3d_rotate_poll(bContext *C) { if (!ED_operator_view3d_active(C)) { return 0; @@ -754,7 +766,7 @@ void VIEW3D_OT_rotate(wmOperatorType *ot) /* api callbacks */ ot->invoke= viewrotate_invoke; ot->modal= viewrotate_modal; - ot->poll= ED_operator_view3d_active; + ot->poll= view3d_rotate_poll; /* flags */ ot->flag= OPTYPE_BLOCKING|OPTYPE_GRAB_POINTER; @@ -1294,6 +1306,18 @@ static int viewhome_exec(bContext *C, wmOperator *op) /* was view3d_home() in 2. return OPERATOR_FINISHED; } +static int viewhome_poll(bContext *C) +{ + if(ED_operator_view3d_active(C)) { + RegionView3D *rv3d= CTX_wm_region_view3d(C); //XXX, when accessed from a header menu this doesnt work! + if(rv3d && rv3d->persp!=RV3D_CAMOB) { + return 1; + } + } + + return 0; +} + void VIEW3D_OT_view_all(wmOperatorType *ot) { /* identifiers */ @@ -1303,7 +1327,7 @@ void VIEW3D_OT_view_all(wmOperatorType *ot) /* api callbacks */ ot->exec= viewhome_exec; - ot->poll= ED_operator_view3d_active; + ot->poll= viewhome_poll; /* flags */ ot->flag= 0; @@ -1311,6 +1335,7 @@ void VIEW3D_OT_view_all(wmOperatorType *ot) RNA_def_boolean(ot->srna, "center", 0, "Center", ""); } + static int viewselected_exec(bContext *C, wmOperator *op) /* like a localview without local!, was centerview() in 2.4x */ { ARegion *ar= CTX_wm_region(C); @@ -1460,16 +1485,10 @@ static int viewcenter_cursor_exec(bContext *C, wmOperator *op) Scene *scene= CTX_data_scene(C); if (rv3d) { - if (rv3d->persp==RV3D_CAMOB) { - /* center the camera offset */ - rv3d->camdx= rv3d->camdy= 0.0; - } - else { - /* non camera center */ - float new_ofs[3]; - negate_v3_v3(new_ofs, give_cursor(scene, v3d)); - smooth_view(C, NULL, NULL, new_ofs, NULL, NULL, NULL); - } + /* non camera center */ + float new_ofs[3]; + negate_v3_v3(new_ofs, give_cursor(scene, v3d)); + smooth_view(C, NULL, NULL, new_ofs, NULL, NULL, NULL); if (rv3d->viewlock & RV3D_BOXVIEW) view3d_boxview_copy(CTX_wm_area(C), CTX_wm_region(C)); @@ -1493,6 +1512,32 @@ void VIEW3D_OT_view_center_cursor(wmOperatorType *ot) ot->flag= 0; } +static int view3d_center_camera_exec(bContext *C, wmOperator *op) /* was view3d_home() in 2.4x */ +{ + RegionView3D *rv3d= CTX_wm_region_view3d(C); + + rv3d->camdx= rv3d->camdy= 0.0f; + + WM_event_add_notifier(C, NC_SPACE|ND_SPACE_VIEW3D, CTX_wm_view3d(C)); + + return OPERATOR_FINISHED; +} + +void VIEW3D_OT_view_center_camera(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "View Camera Center"; + ot->description = "Center the camera view"; + ot->idname= "VIEW3D_OT_view_center_camera"; + + /* api callbacks */ + ot->exec= view3d_center_camera_exec; + ot->poll= view3d_camera_active_poll; + + /* flags */ + ot->flag= 0; +} + /* ********************* Set render border operator ****************** */ static int render_border_exec(bContext *C, wmOperator *op) @@ -1543,15 +1588,6 @@ static int render_border_exec(bContext *C, wmOperator *op) } -static int view3d_render_border_invoke(bContext *C, wmOperator *op, wmEvent *event) -{ - RegionView3D *rv3d= ED_view3d_context_rv3d(C); - - /* if not in camera view do not exec the operator*/ - if (rv3d->persp == RV3D_CAMOB) return WM_border_select_invoke(C, op, event); - else return OPERATOR_PASS_THROUGH; -} - void VIEW3D_OT_render_border(wmOperatorType *ot) { /* identifiers */ @@ -1560,11 +1596,11 @@ void VIEW3D_OT_render_border(wmOperatorType *ot) ot->idname= "VIEW3D_OT_render_border"; /* api callbacks */ - ot->invoke= view3d_render_border_invoke; + ot->invoke= WM_border_select_invoke; ot->exec= render_border_exec; ot->modal= WM_border_select_modal; - ot->poll= ED_operator_view3d_active; + ot->poll= view3d_camera_active_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -2010,7 +2046,7 @@ void VIEW3D_OT_view_orbit(wmOperatorType *ot) /* api callbacks */ ot->exec= vieworbit_exec; - ot->poll= ED_operator_view3d_active; + ot->poll= view3d_rotate_poll; /* flags */ ot->flag= 0; diff --git a/source/blender/editors/space_view3d/view3d_intern.h b/source/blender/editors/space_view3d/view3d_intern.h index 69e4006770d..3e8bc71c351 100644 --- a/source/blender/editors/space_view3d/view3d_intern.h +++ b/source/blender/editors/space_view3d/view3d_intern.h @@ -75,6 +75,7 @@ void VIEW3D_OT_view_all(struct wmOperatorType *ot); void VIEW3D_OT_viewnumpad(struct wmOperatorType *ot); void VIEW3D_OT_view_selected(struct wmOperatorType *ot); void VIEW3D_OT_view_center_cursor(struct wmOperatorType *ot); +void VIEW3D_OT_view_center_camera(struct wmOperatorType *ot); void VIEW3D_OT_view_pan(struct wmOperatorType *ot); void VIEW3D_OT_view_persportho(struct wmOperatorType *ot); void VIEW3D_OT_add_background_image(struct wmOperatorType *ot); diff --git a/source/blender/editors/space_view3d/view3d_ops.c b/source/blender/editors/space_view3d/view3d_ops.c index 08658cd752d..faeab482f72 100644 --- a/source/blender/editors/space_view3d/view3d_ops.c +++ b/source/blender/editors/space_view3d/view3d_ops.c @@ -70,6 +70,7 @@ void view3d_operatortypes(void) WM_operatortype_append(VIEW3D_OT_remove_background_image); WM_operatortype_append(VIEW3D_OT_view_selected); WM_operatortype_append(VIEW3D_OT_view_center_cursor); + WM_operatortype_append(VIEW3D_OT_view_center_camera); WM_operatortype_append(VIEW3D_OT_select); WM_operatortype_append(VIEW3D_OT_select_border); WM_operatortype_append(VIEW3D_OT_clip_border); @@ -150,7 +151,8 @@ void view3d_keymap(wmKeyConfig *keyconf) RNA_int_set(WM_keymap_add_item(keymap, "VIEW3D_OT_zoom", WHEELINMOUSE, KM_PRESS, 0, 0)->ptr, "delta", 1); RNA_int_set(WM_keymap_add_item(keymap, "VIEW3D_OT_zoom", WHEELOUTMOUSE, KM_PRESS, 0, 0)->ptr, "delta", -1); - RNA_boolean_set(WM_keymap_add_item(keymap, "VIEW3D_OT_view_all", HOMEKEY, KM_PRESS, 0, 0)->ptr, "center", 0); + WM_keymap_add_item(keymap, "VIEW3D_OT_view_center_camera", HOMEKEY, KM_PRESS, 0, 0); /* only with camera view */ + RNA_boolean_set(WM_keymap_add_item(keymap, "VIEW3D_OT_view_all", HOMEKEY, KM_PRESS, 0, 0)->ptr, "center", 0); /* only without camera view */ RNA_boolean_set(WM_keymap_add_item(keymap, "VIEW3D_OT_view_all", CKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "center", 1); /* numpad view hotkeys*/ diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 45ebbe63b15..c177f2789d0 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -479,6 +479,8 @@ static void view_editmove(unsigned short event) #define TFM_MODAL_REMOVE_SNAP 17 /* 18 and 19 used by numinput, defined in transform.h * */ +#define TFM_MODAL_PROPSIZE_UP 20 +#define TFM_MODAL_PROPSIZE_DOWN 21 /* called in transform_ops.c, on each regeneration of keymaps */ wmKeyMap* transform_modal_keymap(wmKeyConfig *keyconf) @@ -503,6 +505,8 @@ wmKeyMap* transform_modal_keymap(wmKeyConfig *keyconf) {TFM_MODAL_REMOVE_SNAP, "REMOVE_SNAP", 0, "Remove Last Snap Point", ""}, {NUM_MODAL_INCREMENT_UP, "INCREMENT_UP", 0, "Numinput Increment Up", ""}, {NUM_MODAL_INCREMENT_DOWN, "INCREMENT_DOWN", 0, "Numinput Increment Down", ""}, + {TFM_MODAL_PROPSIZE_UP, "PROPORTIONAL_SIZE_UP", 0, "Increase Proportional Influence", ""}, + {TFM_MODAL_PROPSIZE_DOWN, "PROPORTIONAL_SIZE_DOWN", 0, "Decrease Poportional Influence", ""}, {0, NULL, 0, NULL, NULL}}; wmKeyMap *keymap= WM_modalkeymap_get(keyconf, "Transform Modal Map"); @@ -532,6 +536,11 @@ wmKeyMap* transform_modal_keymap(wmKeyConfig *keyconf) WM_modalkeymap_add_item(keymap, UPARROWKEY, KM_PRESS, 0, 0, NUM_MODAL_INCREMENT_UP); WM_modalkeymap_add_item(keymap, DOWNARROWKEY, KM_PRESS, 0, 0, NUM_MODAL_INCREMENT_DOWN); + + WM_modalkeymap_add_item(keymap, PAGEUPKEY, KM_PRESS, 0, 0, TFM_MODAL_PROPSIZE_UP); + WM_modalkeymap_add_item(keymap, PAGEDOWNKEY, KM_PRESS, 0, 0, TFM_MODAL_PROPSIZE_DOWN); + WM_modalkeymap_add_item(keymap, WHEELDOWNMOUSE, KM_PRESS, 0, 0, TFM_MODAL_PROPSIZE_UP); + WM_modalkeymap_add_item(keymap, WHEELUPMOUSE, KM_PRESS, 0, 0, TFM_MODAL_PROPSIZE_DOWN); return keymap; } @@ -709,6 +718,20 @@ int transformEvent(TransInfo *t, wmEvent *event) removeSnapPoint(t); t->redraw |= TREDRAW_HARD; break; + case TFM_MODAL_PROPSIZE_UP: + if(t->flag & T_PROP_EDIT) { + t->prop_size*= 1.1f; + calculatePropRatio(t); + } + t->redraw |= TREDRAW_HARD; + break; + case TFM_MODAL_PROPSIZE_DOWN: + if (t->flag & T_PROP_EDIT) { + t->prop_size*= 0.90909090f; + calculatePropRatio(t); + } + t->redraw |= TREDRAW_HARD; + break; default: handled = 0; break; @@ -933,10 +956,6 @@ int transformEvent(TransInfo *t, wmEvent *event) if (t->flag & T_AUTOIK) { transform_autoik_update(t, 1); } - else if(t->flag & T_PROP_EDIT) { - t->prop_size*= 1.1f; - calculatePropRatio(t); - } else view_editmove(event->type); t->redraw= 1; break; @@ -952,10 +971,6 @@ int transformEvent(TransInfo *t, wmEvent *event) if (t->flag & T_AUTOIK) { transform_autoik_update(t, -1); } - else if (t->flag & T_PROP_EDIT) { - t->prop_size*= 0.90909090f; - calculatePropRatio(t); - } else view_editmove(event->type); t->redraw= 1; break; diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index d8e56331e19..555940c2f35 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -4826,7 +4826,7 @@ void special_aftertrans_update(bContext *C, TransInfo *t) // fixme... some of this stuff is not good if (ob) { if (ob->pose || ob_get_key(ob)) - DAG_id_flush_update(&ob->id, OB_RECALC); + DAG_id_flush_update(&ob->id, OB_RECALC_ALL); else DAG_id_flush_update(&ob->id, OB_RECALC_OB); } diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index 58fc93de745..98ecb07660f 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -810,7 +810,7 @@ void recalcData(TransInfo *t) /* sets recalc flags fully, instead of flushing existing ones * otherwise proxies don't function correctly */ - DAG_id_flush_update(&ob->id, OB_RECALC); + DAG_id_flush_update(&ob->id, OB_RECALC_OB); } } diff --git a/source/blender/editors/util/ed_util.c b/source/blender/editors/util/ed_util.c index 0c9ce9648c7..fbf2051f962 100644 --- a/source/blender/editors/util/ed_util.c +++ b/source/blender/editors/util/ed_util.c @@ -56,6 +56,7 @@ void ED_editors_init(bContext *C) Main *bmain= CTX_data_main(C); Scene *sce= CTX_data_scene(C); Object *ob, *obact= (sce && sce->basact)? sce->basact->object: NULL; + ID *data; /* toggle on modes for objects that were saved with these enabled. for e.g. linked objects we have to ensure that they are actually the @@ -65,8 +66,9 @@ void ED_editors_init(bContext *C) if(mode && (mode != OB_MODE_POSE)) { ob->mode= 0; + data= ob->data; - if(ob == obact) + if(ob == obact && !ob->id.lib && !(data && data->lib)) ED_object_toggle_modes(C, mode); } } diff --git a/source/blender/gpu/GPU_extensions.h b/source/blender/gpu/GPU_extensions.h index 6b98ffdede7..5275f8988a8 100644 --- a/source/blender/gpu/GPU_extensions.h +++ b/source/blender/gpu/GPU_extensions.h @@ -61,7 +61,7 @@ int GPU_print_error(char *str); int GPU_glsl_support(void); int GPU_non_power_of_two_support(void); -int GPU_24bit_color_support(void); +int GPU_color_depth(void); /* GPU Types */ diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c index dd5520608f1..1d615c8e67b 100644 --- a/source/blender/gpu/intern/gpu_buffers.c +++ b/source/blender/gpu/intern/gpu_buffers.c @@ -459,7 +459,7 @@ void *GPU_build_mesh_buffers(GHash *map, MVert *mvert, MFace *mface, for(i = 0, tottri = 0; i < totface; ++i) tottri += mface[face_indices[i]].v4 ? 2 : 1; - if(GL_ARB_vertex_buffer_object) + if(GL_ARB_vertex_buffer_object && !(U.gameflags & USER_DISABLE_VBO)) glGenBuffersARB(1, &buffers->index_buf); if(buffers->index_buf) { @@ -586,7 +586,7 @@ void *GPU_build_grid_buffers(DMGridData **grids, totquad= (gridsize-1)*(gridsize-1)*totgrid; /* Generate index buffer object */ - if(GL_ARB_vertex_buffer_object) + if(GL_ARB_vertex_buffer_object && !(U.gameflags & USER_DISABLE_VBO)) glGenBuffersARB(1, &buffers->index_buf); if(buffers->index_buf) { diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c index 4eaf969ee8a..0b7ea605ec8 100644 --- a/source/blender/gpu/intern/gpu_extensions.c +++ b/source/blender/gpu/intern/gpu_extensions.c @@ -71,7 +71,7 @@ static struct GPUGlobal { GLuint currentfb; int glslsupport; int extdisabled; - int color24bit; + int colordepth; GPUDeviceType device; GPUOSType os; GPUDriverType driver; @@ -93,7 +93,7 @@ void GPU_extensions_disable() void GPU_extensions_init() { - GLint bits; + GLint r, g, b; const char *vendor, *renderer; glewInit(); @@ -108,9 +108,11 @@ void GPU_extensions_init() if (!GLEW_ARB_vertex_shader) GG.glslsupport = 0; if (!GLEW_ARB_fragment_shader) GG.glslsupport = 0; - glGetIntegerv(GL_RED_BITS, &bits); - GG.color24bit = (bits >= 8); - + glGetIntegerv(GL_RED_BITS, &r); + glGetIntegerv(GL_GREEN_BITS, &g); + glGetIntegerv(GL_BLUE_BITS, &b); + GG.colordepth = r+g+b; /* assumes same depth for RGB */ + vendor = (const char*)glGetString(GL_VENDOR); renderer = (const char*)glGetString(GL_RENDERER); @@ -178,9 +180,9 @@ int GPU_non_power_of_two_support() return GLEW_ARB_texture_non_power_of_two; } -int GPU_24bit_color_support() +int GPU_color_depth() { - return GG.color24bit; + return GG.colordepth; } int GPU_print_error(char *str) diff --git a/source/blender/makesdna/DNA_action_types.h b/source/blender/makesdna/DNA_action_types.h index 210bb6a9af0..d0f15b78ada 100644 --- a/source/blender/makesdna/DNA_action_types.h +++ b/source/blender/makesdna/DNA_action_types.h @@ -550,6 +550,9 @@ typedef enum eDopeSheet_FilterFlag { /* NLA-specific filters */ ADS_FILTER_NLA_NOACT = (1<<25), /* if the AnimData block has no NLA data, don't include to just show Action-line */ + /* general filtering 3 */ + ADS_FILTER_INCL_HIDDEN = (1<<26), /* include 'hidden' channels too (i.e. those from hidden Objects/Bones) */ + /* combination filters (some only used at runtime) */ ADS_FILTER_NOOBDATA = (ADS_FILTER_NOCAM|ADS_FILTER_NOMAT|ADS_FILTER_NOLAM|ADS_FILTER_NOCUR|ADS_FILTER_NOPART|ADS_FILTER_NOARM), } eDopeSheet_FilterFlag; diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h index 528f06882a2..722adba1136 100644 --- a/source/blender/makesdna/DNA_modifier_types.h +++ b/source/blender/makesdna/DNA_modifier_types.h @@ -538,7 +538,7 @@ typedef struct MeshDeformModifierData { float *bindcos; /* deprecated storage of cage coords */ /* runtime */ - void (*bindfunc)(struct Scene *scene, struct DerivedMesh *dm, + void (*bindfunc)(struct Scene *scene, struct MeshDeformModifierData *mmd, float *vertexcos, int totvert, float cagemat[][4]); } MeshDeformModifierData; diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h index 9cbd304a86d..872d69f3148 100644 --- a/source/blender/makesdna/DNA_node_types.h +++ b/source/blender/makesdna/DNA_node_types.h @@ -311,6 +311,9 @@ typedef struct NodeColorBalance { float lift[3]; float gamma[3]; float gain[3]; + + /* temp storage for inverted lift */ + float lift_lgg[3]; } NodeColorBalance; typedef struct NodeColorspill { diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h index 9649b8351a6..601d2ef4fa5 100644 --- a/source/blender/makesdna/DNA_object_types.h +++ b/source/blender/makesdna/DNA_object_types.h @@ -436,7 +436,7 @@ extern Object workob; #define OB_RECALC_DATA 2 /* time flag is set when time changes need recalc, so baked systems can ignore it */ #define OB_RECALC_TIME 4 -#define OB_RECALC 7 +#define OB_RECALC_ALL 7 /* controller state */ #define OB_MAX_STATES 30 diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index 1e3102d592c..9c921629d17 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -214,12 +214,12 @@ typedef struct RenderData { struct FFMpegCodecData ffcodecdata; int cfra, sfra, efra; /* frames as in 'images' */ + float subframe; /* subframe offset from cfra, in 0.0-1.0 */ int psfra, pefra; /* start+end frames of preview range */ int images, framapto; short flag, threads; - float ctime; /* use for calcutions */ float framelen, blurfac; /** For UR edge rendering: give the edges this color */ @@ -1028,6 +1028,7 @@ typedef struct Scene { #define ID_NEW_US(a) if( (a)->id.newid) {(a)= (void *)(a)->id.newid; (a)->id.us++;} #define ID_NEW_US2(a) if( ((ID *)a)->newid) {(a)= ((ID *)a)->newid; ((ID *)a)->us++;} #define CFRA (scene->r.cfra) +#define SUBFRA (scene->r.subframe) #define F_CFRA ((float)(scene->r.cfra)) #define SFRA (scene->r.sfra) #define EFRA (scene->r.efra) diff --git a/source/blender/makesdna/DNA_sequence_types.h b/source/blender/makesdna/DNA_sequence_types.h index 84d8e8c8e67..f5ca32c6b32 100644 --- a/source/blender/makesdna/DNA_sequence_types.h +++ b/source/blender/makesdna/DNA_sequence_types.h @@ -72,8 +72,8 @@ typedef struct StripColorBalance { float gain[3]; int flag; int pad; - float exposure; - float saturation; + // float exposure; + // float saturation; } StripColorBalance; typedef struct StripProxy { @@ -324,5 +324,8 @@ typedef struct SpeedControlVars { otherwise, you can't really blend, right :) !) */ + +#define SEQ_HAS_PATH(_seq) (ELEM5((_seq)->type, SEQ_MOVIE, SEQ_IMAGE, SEQ_SOUND, SEQ_RAM_SOUND, SEQ_HD_SOUND)) + #endif diff --git a/source/blender/makesdna/DNA_texture_types.h b/source/blender/makesdna/DNA_texture_types.h index b6f72875c29..e7a5a6e5f56 100644 --- a/source/blender/makesdna/DNA_texture_types.h +++ b/source/blender/makesdna/DNA_texture_types.h @@ -203,8 +203,8 @@ typedef struct Tex { struct AnimData *adt; /* animation data (must be immediately after id for utilities to use it) */ float noisesize, turbul; - float bright, contrast, rfac, gfac, bfac; - float filtersize; + float bright, contrast, saturation, rfac, gfac, bfac; + float filtersize, pad2; /* newnoise: musgrave parameters */ float mg_H, mg_lacunarity, mg_octaves, mg_offset, mg_gain; diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index 72c067c9752..16a3b95d71a 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -119,7 +119,7 @@ typedef struct uiWidgetColors { char text_sel[4]; short shaded; short shadetop, shadedown; - short pad; + short alpha_check; } uiWidgetColors; typedef struct uiWidgetStateColors { diff --git a/source/blender/makesrna/SConscript b/source/blender/makesrna/SConscript index 8609160ef87..3fb14bd24b7 100644 --- a/source/blender/makesrna/SConscript +++ b/source/blender/makesrna/SConscript @@ -38,7 +38,8 @@ if env['WITH_BF_QUICKTIME']: if env['WITH_BF_LCMS']: defs.append('WITH_LCMS') - + incs += ' ' + env['BF_LCMS_INC'] + if env['WITH_BF_GAMEENGINE']: defs.append('GAMEBLENDER=1') diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 2d99be4461e..36c8764b3f4 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -1242,7 +1242,7 @@ static void rna_property_update(bContext *C, Main *bmain, Scene *scene, PointerR else { /* WARNING! This is so property drivers update the display! * not especially nice */ - DAG_id_flush_update(ptr->id.data, OB_RECALC); + DAG_id_flush_update(ptr->id.data, OB_RECALC_ALL); WM_main_add_notifier(NC_WINDOW, NULL); } diff --git a/source/blender/makesrna/intern/rna_action.c b/source/blender/makesrna/intern/rna_action.c index bc83af7a279..1f542e2babe 100644 --- a/source/blender/makesrna/intern/rna_action.c +++ b/source/blender/makesrna/intern/rna_action.c @@ -171,6 +171,12 @@ static void rna_def_dopesheet(BlenderRNA *brna) RNA_def_property_ui_icon(prop, ICON_RESTRICT_SELECT_OFF, 0); RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); + prop= RNA_def_property(srna, "display_hidden", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "filterflag", ADS_FILTER_INCL_HIDDEN); + RNA_def_property_ui_text(prop, "Display Hidden", "Include channels from objects/bone that aren't visible"); + RNA_def_property_ui_icon(prop, ICON_GHOST_ENABLED, 0); + RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); + /* Object Group Filtering Settings */ prop= RNA_def_property(srna, "only_group_objects", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "filterflag", ADS_FILTER_ONLYOBGROUP); diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c index d126f8543c6..a7f2761526e 100644 --- a/source/blender/makesrna/intern/rna_constraint.c +++ b/source/blender/makesrna/intern/rna_constraint.c @@ -1937,11 +1937,16 @@ void RNA_def_constraint(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Target Space", "Space that target is evaluated in"); /* flags */ + prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", CONSTRAINT_OFF); + RNA_def_property_ui_text(prop, "Enabled", "Enable/Disable Constraint"); + RNA_def_property_ui_icon(prop, ICON_CHECKBOX_DEHLT, 1); + prop= RNA_def_property(srna, "expanded", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_EXPAND); RNA_def_property_ui_text(prop, "Expanded", "Constraint's panel is expanded in UI"); RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1); - + // XXX this is really an internal flag, but it may be useful for some tools to be able to access this... prop= RNA_def_property(srna, "disabled", PROP_BOOLEAN, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); diff --git a/source/blender/makesrna/intern/rna_controller.c b/source/blender/makesrna/intern/rna_controller.c index d9523344414..275a34e3bbb 100644 --- a/source/blender/makesrna/intern/rna_controller.c +++ b/source/blender/makesrna/intern/rna_controller.c @@ -113,6 +113,7 @@ static void rna_Controller_state_get(PointerRNA *ptr, int *values) values[i] = (cont->state_mask & (1<<i)); } +#if 0 /* editable is set to false, comment for now. */ static void rna_Controller_state_set(PointerRNA *ptr, const int *values) { bController *cont= (bController *)ptr->data; @@ -135,6 +136,7 @@ static void rna_Controller_state_set(PointerRNA *ptr, const int *values) else cont->state_mask &= ~(1<<i); } } +#endif #else diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c index 3ecc844250b..09a0af9830f 100644 --- a/source/blender/makesrna/intern/rna_curve.c +++ b/source/blender/makesrna/intern/rna_curve.c @@ -834,6 +834,7 @@ static void rna_def_textbox(BlenderRNA *brna) srna= RNA_def_struct(brna, "TextBox", NULL); RNA_def_struct_ui_text(srna, "Text Box", "Text bounding box for layout"); + // XXX: still needs path function /* number values */ prop= RNA_def_property(srna, "x", PROP_FLOAT, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_group.c b/source/blender/makesrna/intern/rna_group.c index e16d586b5fa..707662e58e0 100644 --- a/source/blender/makesrna/intern/rna_group.c +++ b/source/blender/makesrna/intern/rna_group.c @@ -110,6 +110,7 @@ void RNA_def_group(BlenderRNA *brna) srna= RNA_def_struct(brna, "Group", "ID"); RNA_def_struct_ui_text(srna, "Group", "Group of Object datablocks"); RNA_def_struct_ui_icon(srna, ICON_GROUP); + RNA_def_struct_clear_flag(srna, STRUCT_ID_REFCOUNT); /* this is done on save/load in readfile.c, removed if no objects are in the group */ prop= RNA_def_property(srna, "dupli_offset", PROP_FLOAT, PROP_TRANSLATION); RNA_def_property_float_sdna(prop, NULL, "dupli_ofs"); diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c index 9e8f60af439..4a081147dd8 100644 --- a/source/blender/makesrna/intern/rna_main_api.c +++ b/source/blender/makesrna/intern/rna_main_api.c @@ -28,6 +28,7 @@ #include <stdlib.h> #include <stdio.h> +#include <errno.h> #include "RNA_define.h" #include "RNA_access.h" @@ -254,16 +255,24 @@ void rna_Main_lamps_remove(Main *bmain, ReportList *reports, Lamp *lamp) /* XXX python now has invalid pointer? */ } -Image *rna_Main_images_new(Main *bmain, char* name, int width, int height, int float_buffer) +Image *rna_Main_images_new(Main *bmain, char* name, int width, int height, int alpha, int float_buffer) { float color[4]= {0.0, 0.0, 0.0, 1.0}; - Image *image= BKE_add_image_size(width, height, name, float_buffer, 0, color); + Image *image= BKE_add_image_size(width, height, name, alpha ? 32:24, float_buffer, 0, color); image->id.us--; return image; } -Image *rna_Main_images_load(Main *bmain, char *filepath) +Image *rna_Main_images_load(Main *bmain, ReportList *reports, char *filepath) { - return BKE_add_image_file(filepath, 0); + Image *ima; + + errno= 0; + ima= BKE_add_image_file(filepath, 0); + + if(!ima) + BKE_reportf(reports, RPT_ERROR, "Can't read: \"%s\", %s.", filepath, errno ? strerror(errno) : "Unsupported image format"); + + return ima; } void rna_Main_images_remove(Main *bmain, ReportList *reports, Image *image) { @@ -317,9 +326,18 @@ void rna_Main_metaballs_remove(Main *bmain, ReportList *reports, struct MetaBall BKE_reportf(reports, RPT_ERROR, "MetaBall \"%s\" must have zero users to be removed, found %d.", mb->id.name+2, ID_REAL_USERS(mb)); } -VFont *rna_Main_fonts_load(Main *bmain, char *filepath) +VFont *rna_Main_fonts_load(Main *bmain, ReportList *reports, char *filepath) { - return load_vfont(filepath); + VFont *font; + + errno= 0; + font= load_vfont(filepath); + + if(!font) + BKE_reportf(reports, RPT_ERROR, "Can't read: \"%s\", %s.", filepath, errno ? strerror(errno) : "Unsupported font format"); + + return font; + } void rna_Main_fonts_remove(Main *bmain, ReportList *reports, VFont *vfont) { @@ -395,11 +413,16 @@ void rna_Main_texts_remove(Main *bmain, ReportList *reports, Text *text) free_libblock(&bmain->text, text); /* XXX python now has invalid pointer? */ } -Text *rna_Main_texts_load(Main *bmain, ReportList *reports, char* path) + +Text *rna_Main_texts_load(Main *bmain, ReportList *reports, char* filepath) { - Text *txt= add_text(path, bmain->name); - if(txt==NULL) - BKE_reportf(reports, RPT_ERROR, "Couldn't load text from path \"%s\".", path); + Text *txt; + + errno= 0; + txt= add_text(filepath, bmain->name); + + if(!txt) + BKE_reportf(reports, RPT_ERROR, "Can't read: \"%s\", %s.", filepath, errno ? strerror(errno) : "Unable to load text"); return txt; } @@ -702,12 +725,14 @@ void RNA_def_main_images(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_flag(parm, PROP_REQUIRED); parm= RNA_def_int(func, "width", 1024, 1, INT_MAX, "", "Width of the image.", 0, INT_MAX); parm= RNA_def_int(func, "height", 1024, 1, INT_MAX, "", "Height of the image.", 0, INT_MAX); + parm= RNA_def_boolean(func, "alpha", 0, "Alpha", "Use alpha channel"); parm= RNA_def_boolean(func, "float_buffer", 0, "Float Buffer", "Create an image with floating point color"); /* return type */ parm= RNA_def_pointer(func, "image", "Image", "", "New image datablock."); RNA_def_function_return(func, parm); func= RNA_def_function(srna, "load", "rna_Main_images_load"); + RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_ui_description(func, "Load a new image into the main database"); parm= RNA_def_string(func, "filepath", "File Path", 0, "", "path of the file to load."); RNA_def_property_flag(parm, PROP_REQUIRED); @@ -807,6 +832,7 @@ void RNA_def_main_fonts(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_struct_ui_text(srna, "Main Fonts", "Collection of fonts"); func= RNA_def_function(srna, "load", "rna_Main_fonts_load"); + RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_ui_description(func, "Load a new font into the main database"); parm= RNA_def_string(func, "filepath", "File Path", 0, "", "path of the font to load."); RNA_def_property_flag(parm, PROP_REQUIRED); diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 6606da2f3bf..2bb3a74252e 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -134,12 +134,45 @@ void rna_Object_internal_update(Main *bmain, Scene *scene, PointerRNA *ptr) DAG_id_flush_update(ptr->id.data, OB_RECALC_OB); } -void rna_Object_matrix_update(Main *bmain, Scene *scene, PointerRNA *ptr) +void rna_Object_matrix_world_update(Main *bmain, Scene *scene, PointerRNA *ptr) { object_apply_mat4(ptr->id.data, ((Object *)ptr->id.data)->obmat); rna_Object_internal_update(bmain, scene, ptr); } +void rna_Object_matrix_local_get(PointerRNA *ptr, float values[16]) +{ + Object *ob= ptr->id.data; + + if(ob->parent) { + float invmat[4][4]; /* for inverse of parent's matrix */ + invert_m4_m4(invmat, ob->parent->obmat); + mul_m4_m4m4((float(*)[4])values, ob->obmat, invmat); + } + else { + copy_m4_m4((float(*)[4])values, ob->obmat); + } +} + +void rna_Object_matrix_local_set(PointerRNA *ptr, const float values[16]) +{ + Object *ob= ptr->id.data; + + /* localspace matrix is truly relative to the parent, but parameters + * stored in object are relative to parentinv matrix. Undo the parent + * inverse part before updating obmat and calling apply_obmat() */ + if(ob->parent) { + float invmat[4][4]; + invert_m4_m4(invmat, ob->parentinv); + mul_m4_m4m4(ob->obmat, (float(*)[4])values, invmat); + } + else { + copy_m4_m4(ob->obmat, (float(*)[4])values); + } + + object_apply_mat4(ob, ob->obmat); +} + void rna_Object_internal_update_data(Main *bmain, Scene *scene, PointerRNA *ptr) { DAG_id_flush_update(ptr->id.data, OB_RECALC_DATA); @@ -1700,11 +1733,17 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update"); /* matrix */ - prop= RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX); + prop= RNA_def_property(srna, "matrix_world", PROP_FLOAT, PROP_MATRIX); RNA_def_property_float_sdna(prop, NULL, "obmat"); RNA_def_property_multi_array(prop, 2, matrix_dimsize); - RNA_def_property_ui_text(prop, "Matrix", "Transformation matrix"); - RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_matrix_update"); + RNA_def_property_ui_text(prop, "Matrix World", "Worldspace transformation matrix"); + RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_matrix_world_update"); + + prop= RNA_def_property(srna, "matrix_local", PROP_FLOAT, PROP_MATRIX); + RNA_def_property_multi_array(prop, 2, matrix_dimsize); + RNA_def_property_ui_text(prop, "Local Matrix", "Parent relative transformation matrix"); + RNA_def_property_float_funcs(prop, "rna_Object_matrix_local_get", "rna_Object_matrix_local_set", NULL); + RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, NULL); /* collections */ prop= RNA_def_property(srna, "constraints", PROP_COLLECTION, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c index 0069f3332e8..97c429209de 100644 --- a/source/blender/makesrna/intern/rna_object_force.c +++ b/source/blender/makesrna/intern/rna_object_force.c @@ -357,14 +357,19 @@ static void rna_SoftBodySettings_self_collision_set(PointerRNA *ptr, int value) static int rna_SoftBodySettings_new_aero_get(PointerRNA *ptr) { Object *data= (Object*)(ptr->id.data); - return (((data->softflag) & OB_SB_AERO_ANGLE) != 0); + if (data->softflag & OB_SB_AERO_ANGLE) + return 1; + else + return 0; } static void rna_SoftBodySettings_new_aero_set(PointerRNA *ptr, int value) { Object *data= (Object*)(ptr->id.data); - if(value) data->softflag |= OB_SB_AERO_ANGLE; - else data->softflag &= ~OB_SB_AERO_ANGLE; + if (value == 1) + data->softflag |= OB_SB_AERO_ANGLE; + else /* value == 0 */ + data->softflag &= ~OB_SB_AERO_ANGLE; } static int rna_SoftBodySettings_face_collision_get(PointerRNA *ptr) @@ -454,7 +459,7 @@ static void rna_FieldSettings_update(Main *bmain, Scene *scene, PointerRNA *ptr) part->pd2->tex= 0; } - DAG_id_flush_update(&part->id, OB_RECALC|PSYS_RECALC_RESET); + DAG_id_flush_update(&part->id, OB_RECALC_ALL|PSYS_RECALC_RESET); WM_main_add_notifier(NC_OBJECT|ND_DRAW, NULL); } @@ -496,7 +501,7 @@ static void rna_FieldSettings_shape_update(Main *bmain, Scene *scene, PointerRNA static void rna_FieldSettings_dependency_update(Main *bmain, Scene *scene, PointerRNA *ptr) { if(particle_id_check(ptr)) { - DAG_id_flush_update((ID*)ptr->id.data, OB_RECALC|PSYS_RECALC_RESET); + DAG_id_flush_update((ID*)ptr->id.data, OB_RECALC_ALL|PSYS_RECALC_RESET); } else { Object *ob= (Object*)ptr->id.data; @@ -513,7 +518,7 @@ static void rna_FieldSettings_dependency_update(Main *bmain, Scene *scene, Point DAG_scene_sort(scene); if(ob->type == OB_CURVE && ob->pd->forcefield == PFIELD_GUIDE) - DAG_id_flush_update(&ob->id, OB_RECALC); + DAG_id_flush_update(&ob->id, OB_RECALC_ALL); else DAG_id_flush_update(&ob->id, OB_RECALC_OB); @@ -623,7 +628,7 @@ static void rna_CollisionSettings_update(Main *bmain, Scene *scene, PointerRNA * { Object *ob= (Object*)ptr->id.data; - DAG_id_flush_update(&ob->id, OB_RECALC); + DAG_id_flush_update(&ob->id, OB_RECALC_ALL); WM_main_add_notifier(NC_OBJECT|ND_DRAW, ob); } @@ -1404,6 +1409,11 @@ static void rna_def_softbody(BlenderRNA *brna) {SBC_MODE_MAX, "MAXIMAL", 0, "Maximal", "Maximal Spring length * Ball Size"}, {SBC_MODE_AVGMINMAX, "MINMAX", 0, "AvMinMax", "(Min+Max)/2 * Ball Size"}, {0, NULL, 0, NULL, NULL}}; + + static EnumPropertyItem aerodynamics_type[] = { + {0, "SIMPLE", 0, "Simple", "Edges receive a drag force from surrounding media"}, + {1, "LIFT_FORCE", 0, "Lift Force", "Edges receive a lift force when passing through surrounding media"}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "SoftBodySettings", NULL); RNA_def_struct_sdna(srna, "SoftBody"); @@ -1660,12 +1670,13 @@ static void rna_def_softbody(BlenderRNA *brna) prop= RNA_def_property(srna, "face_collision", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_face_collision_get", "rna_SoftBodySettings_face_collision_set"); - RNA_def_property_ui_text(prop, "Face Collision", "Faces collide too, SLOOOOOW warning"); + RNA_def_property_ui_text(prop, "Face Collision", "Faces collide too, can be very slow"); RNA_def_property_update(prop, 0, "rna_softbody_update"); - prop= RNA_def_property(srna, "new_aero", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_new_aero_get", "rna_SoftBodySettings_new_aero_set"); - RNA_def_property_ui_text(prop, "N", "New aero(uses angle and length)"); + prop= RNA_def_property(srna, "aerodynamics_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_items(prop, aerodynamics_type); + RNA_def_property_enum_funcs(prop, "rna_SoftBodySettings_new_aero_get", "rna_SoftBodySettings_new_aero_set", NULL); + RNA_def_property_ui_text(prop, "Aerodynamics Type", "Method of calculating aerodynamic interaction"); RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "self_collision", PROP_BOOLEAN, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 0b4bb260013..3890d1b614b 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -203,7 +203,7 @@ static Base *rna_Scene_object_link(Scene *scene, bContext *C, ReportList *report if(scene == scene_act) ob->lay= base->lay; - ob->recalc |= OB_RECALC; + ob->recalc |= OB_RECALC_ALL; DAG_scene_sort(scene); @@ -3247,7 +3247,7 @@ void RNA_def_scene(BlenderRNA *brna) RNA_def_property_int_funcs(prop, NULL, "rna_Scene_start_frame_set", NULL); RNA_def_property_range(prop, MINFRAME, MAXFRAME); RNA_def_property_ui_text(prop, "Start Frame", "First frame of the playback/rendering range"); - RNA_def_property_update(prop, NC_SCENE|ND_FRAME, NULL); + RNA_def_property_update(prop, NC_SCENE|ND_FRAME_RANGE, NULL); prop= RNA_def_property(srna, "frame_end", PROP_INT, PROP_TIME); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); @@ -3255,7 +3255,7 @@ void RNA_def_scene(BlenderRNA *brna) RNA_def_property_int_funcs(prop, NULL, "rna_Scene_end_frame_set", NULL); RNA_def_property_range(prop, MINFRAME, MAXFRAME); RNA_def_property_ui_text(prop, "End Frame", "Final frame of the playback/rendering range"); - RNA_def_property_update(prop, NC_SCENE|ND_FRAME, NULL); + RNA_def_property_update(prop, NC_SCENE|ND_FRAME_RANGE, NULL); prop= RNA_def_property(srna, "frame_step", PROP_INT, PROP_TIME); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c index 4ee4fde0d8a..c7c7888a938 100644 --- a/source/blender/makesrna/intern/rna_sequencer.c +++ b/source/blender/makesrna/intern/rna_sequencer.c @@ -308,8 +308,8 @@ static StructRNA* rna_Sequence_refine(struct PointerRNA *ptr) case SEQ_MUL: case SEQ_OVERDROP: return &RNA_EffectSequence; - case SEQ_MULTICAM: - return &RNA_MulticamSequence; + case SEQ_MULTICAM: + return &RNA_MulticamSequence; case SEQ_PLUGIN: return &RNA_PluginSequence; case SEQ_WIPE: diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c index a12b8c55552..84fd217e64e 100644 --- a/source/blender/makesrna/intern/rna_texture.c +++ b/source/blender/makesrna/intern/rna_texture.c @@ -1706,6 +1706,11 @@ static void rna_def_texture(BlenderRNA *brna) RNA_def_property_range(prop, 0.01, 5); RNA_def_property_ui_text(prop, "Contrast", ""); RNA_def_property_update(prop, 0, "rna_Texture_update"); + + prop= RNA_def_property(srna, "saturation", PROP_FLOAT, PROP_NONE); + RNA_def_property_range(prop, 0, 2); + RNA_def_property_ui_text(prop, "Saturation", ""); + RNA_def_property_update(prop, 0, "rna_Texture_update"); /* RGB Factor */ prop= RNA_def_property(srna, "factor_red", PROP_FLOAT, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c index ccea5fbdf93..1c751433e31 100644 --- a/source/blender/makesrna/intern/rna_ui_api.c +++ b/source/blender/makesrna/intern/rna_ui_api.c @@ -35,7 +35,7 @@ #ifdef RNA_RUNTIME -static void rna_uiItemR(uiLayout *layout, PointerRNA *ptr, char *propname, char *name, int icon, int expand, int slider, int toggle, int icon_only, int event, int full_event, int no_bg, int index) +static void rna_uiItemR(uiLayout *layout, PointerRNA *ptr, char *propname, char *name, int icon, int expand, int slider, int toggle, int icon_only, int event, int full_event, int emboss, int index) { PropertyRNA *prop= RNA_struct_find_property(ptr, propname); int flag= 0; @@ -51,14 +51,16 @@ static void rna_uiItemR(uiLayout *layout, PointerRNA *ptr, char *propname, char flag |= (icon_only)? UI_ITEM_R_ICON_ONLY: 0; flag |= (event)? UI_ITEM_R_EVENT: 0; flag |= (full_event)? UI_ITEM_R_FULL_EVENT: 0; - flag |= (no_bg)? UI_ITEM_R_NO_BG: 0; + flag |= (emboss)? 0: UI_ITEM_R_NO_BG; uiItemFullR(layout, ptr, prop, index, 0, flag, name, icon); } -static PointerRNA rna_uiItemO(uiLayout *layout, char *opname, char *name, int icon) +static PointerRNA rna_uiItemO(uiLayout *layout, char *opname, char *name, int icon, int emboss) { - return uiItemFullO(layout, opname, name, icon, NULL, uiLayoutGetOperatorContext(layout), UI_ITEM_O_RETURN_PROPS); + int flag= UI_ITEM_O_RETURN_PROPS; + flag |= (emboss)? 0: UI_ITEM_R_NO_BG; + return uiItemFullO(layout, opname, name, icon, NULL, uiLayoutGetOperatorContext(layout), flag); } #else @@ -85,7 +87,7 @@ static void api_ui_item_op(FunctionRNA *func) { PropertyRNA *parm; parm= RNA_def_string(func, "operator", "", 0, "", "Identifier of the operator."); - RNA_def_property_flag(parm, PROP_REQUIRED); + RNA_def_property_flag(parm, PROP_REQUIRED); } static void api_ui_item_op_common(FunctionRNA *func) @@ -160,7 +162,7 @@ void RNA_api_ui_layout(StructRNA *srna) RNA_def_boolean(func, "icon_only", 0, "", "Draw only icons in buttons, no text."); RNA_def_boolean(func, "event", 0, "", "Use button to input key events."); RNA_def_boolean(func, "full_event", 0, "", "Use button to input full events including modifiers."); - RNA_def_boolean(func, "no_bg", 0, "", "Don't draw the button itself, just the icon/text."); + RNA_def_boolean(func, "emboss", 1, "", "Draw the button itself, just the icon/text."); RNA_def_int(func, "index", -1, -2, INT_MAX, "", "The index of this button, when set a single member of an array can be accessed, when set to -1 all array members are used.", -2, INT_MAX); /* RNA_NO_INDEX == -1 */ func= RNA_def_function(srna, "props_enum", "uiItemsEnumR"); @@ -186,6 +188,7 @@ void RNA_api_ui_layout(StructRNA *srna) func= RNA_def_function(srna, "operator", "rna_uiItemO"); api_ui_item_op_common(func); + RNA_def_boolean(func, "emboss", 1, "", "Draw the button itself, just the icon/text."); parm= RNA_def_pointer(func, "properties", "OperatorProperties", "", "Operator properties to fill in, return when 'properties' is set to true."); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR); RNA_def_function_return(func, parm); @@ -314,6 +317,7 @@ void RNA_api_ui_layout(StructRNA *srna) RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL); parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in."); RNA_def_function_return(func, parm); + RNA_def_boolean(func, "compact", 0, "", "Show a smaller version of the template, split on two lines."); func= RNA_def_function(srna, "template_preview", "uiTemplatePreview"); parm= RNA_def_pointer(func, "id", "ID", "", "ID datablock."); @@ -356,6 +360,8 @@ void RNA_api_ui_layout(StructRNA *srna) api_ui_item_rna_common(func); RNA_def_boolean(func, "value_slider", 0, "", "Display the value slider to the right of the color wheel"); RNA_def_boolean(func, "lock", 0, "", "Lock the color wheel display to value 1.0 regardless of actual color"); + RNA_def_boolean(func, "lock_luminosity", 0, "", "Keep the color at its original vector length"); + RNA_def_boolean(func, "cubic", 1, "", "Cubic saturation for picking values close to white"); func= RNA_def_function(srna, "template_triColorSet", "uiTemplateTriColorSet"); api_ui_item_rna_common(func); diff --git a/source/blender/makesrna/rna_cleanup/rna_booleans.txt b/source/blender/makesrna/rna_cleanup/rna_booleans.txt new file mode 100644 index 00000000000..4cae982183c --- /dev/null +++ b/source/blender/makesrna/rna_cleanup/rna_booleans.txt @@ -0,0 +1,1386 @@ +ActionActuator.continue_last_frame -> continue_last_frame: boolean Restore last frame when switching on/off, otherwise play from the start each time +ActionGroup.expanded -> show_expanded: boolean Action Group is expanded +ActionGroup.locked -> lock: boolean Action Group is locked +ActionGroup.selected -> select: boolean Action Group is selected +Actuator.expanded -> show_expanded: boolean Set actuator expanded in the user interface +AnimData.nla_enabled -> use_nla: boolean NLA stack is evaluated when evaluating this block +AnimVizMotionPaths.highlight_keyframes -> show_keyframe_highlight: boolean Emphasize position of keyframes on Motion Paths +AnimVizMotionPaths.search_all_action_keyframes -> use_keyframe_action_all: boolean For bone motion paths, search whole Action for keyframes instead of in group with matching name only (is slower) +AnimVizMotionPaths.show_frame_numbers -> show_frame_numbers: boolean Show frame numbers on Motion Paths +AnimVizMotionPaths.show_keyframe_numbers -> show_keyframe_numbers: boolean Show frame numbers of Keyframes on Motion Paths +AnimVizOnionSkinning.only_selected -> show_only_selected: boolean For Pose-Mode drawing, only draw ghosts for selected bones +Area.show_menus -> show_menus: boolean Show menus in the header +AreaLamp.dither -> use_dither: boolean Use 2x2 dithering for sampling (Constant Jittered sampling) +AreaLamp.jitter -> use_jitter: boolean Use noise for sampling (Constant Jittered sampling) +AreaLamp.only_shadow -> use_only_shadow: boolean Causes light to cast shadows only without illuminating objects +AreaLamp.shadow_layer -> use_only_shadow_layer: boolean Causes only objects on the same layer to cast shadows +AreaLamp.umbra -> use_umbra: boolean Emphasize parts that are fully shadowed (Constant Jittered sampling) +Armature.auto_ik -> use_auto_ik: boolean Add temporaral IK constraints while grabbing bones in Pose Mode +Armature.deform_bbone_rest -> use_deform_b_bone_rest: boolean Make B-Bones deform already in Rest Position +Armature.deform_envelope -> use_deform_envelope: boolean Enable Bone Envelopes when defining deform +Armature.deform_quaternion -> use_deform_quaternion: boolean Enable deform rotation with Quaternions +Armature.deform_vertexgroups -> use_deform_vertexgroups: boolean Enable Vertex Groups when defining deform +Armature.delay_deform -> use_deform_delay: boolean Don't deform children when manipulating bones in Pose Mode +Armature.draw_axes -> show_axes: boolean Draw bone axes +Armature.draw_custom_bone_shapes -> show_bone_custom: boolean Draw bones with their custom shapes +Armature.draw_group_colors -> show_group_colors: boolean Draw bone group colors +Armature.draw_names -> show_names: boolean Draw bone names +Armature.ghost_only_selected -> show_only_ghost_selected: boolean +Armature.layer -> layer: boolean Armature layer visibility +Armature.layer_protection -> layer_protect: boolean Protected layers in Proxy Instances are restored to Proxy settings on file reload and undo +Armature.x_axis_mirror -> use_mirror_x: boolean Apply changes to matching bone on opposite side of X-Axis +ArmatureModifier.b_bone_rest -> use_b_bone_rest: boolean Make B-Bones deform already in rest position +ArmatureModifier.invert -> use_vertex_group_invert: boolean Invert vertex group influence +ArmatureModifier.multi_modifier -> use_multi_modifier: boolean Use same input as previous modifier, and mix results using overall vgroup +ArmatureModifier.quaternion -> use_preserve_volume: boolean Deform rotation interpolation with quaternions +ArmatureModifier.use_bone_envelopes -> use_bone_envelopes: boolean +ArmatureModifier.use_vertex_groups -> use_vertex_groups: boolean +ArrayModifier.add_offset_object -> use_object_offset: boolean Add another object's transformation to the total offset +ArrayModifier.constant_offset -> use_constant_offset: boolean Add a constant offset +ArrayModifier.merge_adjacent_vertices -> use_merge_vertex: boolean Merge vertices in adjacent duplicates +ArrayModifier.merge_end_vertices -> use_merge_vertex_end: boolean Merge vertices in first and last duplicates +ArrayModifier.relative_offset -> use_relative_offset: boolean Add an offset relative to the object's bounding box +BackgroundImage.show_expanded -> show_expanded: boolean Show the expanded in the user interface +BevelModifier.only_vertices -> use_only_vertex: boolean Bevel verts/corners, not edges +BezierSplinePoint.hidden -> hide: boolean Visibility status +BezierSplinePoint.selected_control_point -> select_control_point: boolean Control point selection status +BezierSplinePoint.selected_handle1 -> select_left_handle: boolean Handle 1 selection status +BezierSplinePoint.selected_handle2 -> select_right_handle: boolean Handle 2 selection status +BoidRule.in_air -> use_in_air: boolean Use rule when boid is flying +BoidRule.on_land -> use_on_land: boolean Use rule when boid is on land +BoidRuleAvoid.predict -> use_predict: boolean Predict target movement +BoidRuleAvoidCollision.boids -> use_avoid: boolean Avoid collision with other boids +BoidRuleAvoidCollision.deflectors -> use_deflect: boolean Avoid collision with deflector objects +BoidRuleFollowLeader.line -> use_line: boolean Follow leader in a line +BoidRuleGoal.predict -> use_predict: boolean Predict target movement +BoidSettings.allow_climb -> use_climb: boolean Allow boids to climb goal objects +BoidSettings.allow_flight -> use_flight: boolean Allow boids to move in air +BoidSettings.allow_land -> use_land: boolean Allow boids to move on land +Bone.connected -> use_connect: boolean, (read-only) When bone has a parent, bone's head is struck to the parent's tail +Bone.cyclic_offset -> use_cyclic_offset: boolean When bone doesn't have a parent, it receives cyclic offset effects +Bone.deform -> use_deform: boolean Bone does not deform any geometry +Bone.draw_wire -> show_wire: boolean Bone is always drawn as Wireframe regardless of viewport draw mode. Useful for non-obstructive custom bone shapes +Bone.hidden -> hide: boolean Bone is not visible when it is not in Edit Mode (i.e. in Object or Pose Modes) +Bone.hinge -> use_hinge: boolean Bone inherits rotation or scale from parent bone +Bone.inherit_scale -> use_inherit_scale: boolean Bone inherits scaling from parent bone +Bone.layer -> layer: boolean Layers bone exists in +Bone.local_location -> use_local_location: boolean Bone location is set in local space +Bone.multiply_vertexgroup_with_envelope -> use_envelope_multiply: boolean When deforming bone, multiply effects of Vertex Group weights with Envelope influence +TODO * Bone.restrict_select -> restrict_select: boolean Bone is able to be selected +Bone.selected -> select: boolean +BooleanProperty.default -> default: boolean, (read-only) Default value for this number +BooleanProperty.default_array -> default_array: boolean, (read-only) Default value for this array +Brush.use_accumulate -> use_accumulate: boolean Accumulate stroke dabs on top of each other +Brush.use_airbrush -> use_airbrush: boolean Keep applying paint effect while holding mouse (spray) +Brush.use_alpha -> use_alpha: boolean When this is disabled, lock alpha while painting +Brush.use_anchor -> use_anchor: boolean Keep the brush anchored to the initial location +Brush.use_jitter_pressure -> use_jitter_pressure: boolean Enable tablet pressure sensitivity for jitter +Brush.use_persistent -> use_persistent: boolean Sculpts on a persistent layer of the mesh +Brush.use_rake -> use_rake: boolean Rotate the brush texture to match the stroke direction +Brush.use_size_pressure -> use_size_pressure: boolean Enable tablet pressure sensitivity for size +Brush.use_smooth_stroke -> use_smooth_stroke: boolean Brush lags behind mouse and follows a smoother path +Brush.use_space -> use_space: boolean Limit brush application to the distance specified by spacing +Brush.use_spacing_pressure -> use_spacing_pressure: boolean Enable tablet pressure sensitivity for spacing +Brush.use_strength_pressure -> use_strength_pressure: boolean Enable tablet pressure sensitivity for strength +Brush.use_wrap -> use_wrap: boolean Enable torus wrapping while painting +BuildModifier.randomize -> use_random: boolean Randomize the faces or edges during build +Camera.panorama -> use_panorama: boolean Render the scene with a cylindrical camera for pseudo-fisheye lens effects +Camera.show_limits -> show_limits: boolean Draw the clipping range and focus point on the camera +Camera.show_mist -> show_mist: boolean Draw a line from the Camera to indicate the mist area +Camera.show_name -> show_name: boolean Show the active Camera's name in Camera view +Camera.show_passepartout -> show_passepartout: boolean Show a darkened overlay outside the image area in Camera view +Camera.show_title_safe -> show_title_safe: boolean Show indicators for the title safe zone in Camera view +CastModifier.from_radius -> use_radius_as_size: boolean Use radius as size of projection shape (0 = auto) +CastModifier.use_transform -> use_transform: boolean Use object transform to control projection shape +CastModifier.x -> use_x: boolean +CastModifier.y -> use_y: boolean +CastModifier.z -> use_z: boolean +ChildOfConstraint.use_location_x -> use_location_x: boolean Use X Location of Parent +ChildOfConstraint.use_location_y -> use_location_y: boolean Use Y Location of Parent +ChildOfConstraint.use_location_z -> use_location_z: boolean Use Z Location of Parent +ChildOfConstraint.use_rotation_x -> use_rotation_x: boolean Use X Rotation of Parent +ChildOfConstraint.use_rotation_y -> use_rotation_y: boolean Use Y Rotation of Parent +ChildOfConstraint.use_rotation_z -> use_rotation_z: boolean Use Z Rotation of Parent +ChildOfConstraint.use_scale_x -> use_scale_x: boolean Use X Scale of Parent +ChildOfConstraint.use_scale_y -> use_scale_y: boolean Use Y Scale of Parent +ChildOfConstraint.use_scale_z -> use_scale_z: boolean Use Z Scale of Parent +ClampToConstraint.cyclic -> use_cyclic: boolean Treat curve as cyclic curve (no clamping to curve bounding box +ClothCollisionSettings.enable_collision -> use_collision: boolean Enable collisions with other objects +ClothCollisionSettings.enable_self_collision -> use_self_collision: boolean Enable self collisions +ClothSettings.pin_cloth -> use_pin_cloth: boolean Enable pinning of cloth vertices to other objects/positions +ClothSettings.stiffness_scaling -> use_stiffness_scale: boolean If enabled, stiffness can be scaled along a weight painted vertex group +TODO * CollisionSensor.collision_type -> collision_type: boolean Toggle collision on material or property +CollisionSensor.pulse -> use_pulse: boolean Changes to the set of colliding objects generates pulse +CollisionSettings.enabled -> use_collision: boolean Enable this objects as a collider for physics systems +CollisionSettings.kill_particles -> use_particle_kill: boolean Kill collided particles +CompositorNodeAlphaOver.convert_premul -> use_convert_premultiply: boolean +CompositorNodeBlur.bokeh -> use_bokeh: boolean +CompositorNodeBlur.gamma -> use_gamma_correct: boolean +CompositorNodeBlur.relative -> use_relative: boolean +CompositorNodeColorSpill.unspill -> use_unspill: boolean Compensate all channels (diffenrently) by hand +CompositorNodeCrop.crop_size -> use_crop_size: boolean Whether to crop the size of the input image +CompositorNodeDBlur.wrap -> use_wrap: boolean +CompositorNodeDefocus.gamma_correction -> use_gamma_correct: boolean Enable gamma correction before and after main process +CompositorNodeDefocus.preview -> use_preview: boolean Enable sampling mode, useful for preview when using low samplecounts +CompositorNodeDefocus.use_zbuffer -> use_zbuffer: boolean Disable when using an image as input instead of actual zbuffer (auto enabled if node not image based, eg. time node) +CompositorNodeGlare.rotate_45 -> use_rotate_45: boolean Simple star filter: add 45 degree rotation offset +CompositorNodeImage.auto_refresh -> use_auto_refresh: boolean +CompositorNodeImage.cyclic -> use_cyclic: boolean +CompositorNodeInvert.alpha -> use_alpha: boolean +CompositorNodeInvert.rgb -> invert_rgb: boolean +CompositorNodeLensdist.fit -> use_fit: boolean For positive distortion factor only: scale image such that black areas are not visible +CompositorNodeLensdist.jitter -> use_jitter: boolean Enable/disable jittering; faster, but also noisier +CompositorNodeLensdist.projector -> use_projector: boolean Enable/disable projector mode. Effect is applied in horizontal direction only +CompositorNodeMapValue.use_max -> use_max: boolean +CompositorNodeMapValue.use_min -> use_min: boolean +CompositorNodeMixRGB.alpha -> use_alpha: boolean Include alpha of second input in this operation +CompositorNodeOutputFile.exr_half -> use_exr_half: boolean +CompositorNodeVecBlur.curved -> use_curve: boolean Interpolate between frames in a bezier curve, rather than linearly +TODO * Constraint.active -> active: boolean Constraint is the one being edited +Constraint.disabled -> is_valid: boolean, (read-only) Constraint has invalid settings and will not be evaluated +Constraint.expanded -> show_expanded: boolean Constraint's panel is expanded in UI +Constraint.proxy_local -> is_proxy_local: boolean Constraint was added in this proxy instance (i.e. did not belong to source Armature) +ConstraintActuator.detect_material -> use_material_detect: boolean Detect material instead of property +ConstraintActuator.fh_normal -> use_fh_normal: boolean Add a horizontal spring force on slopes +ConstraintActuator.fh_paralel_axis -> use_fh_paralel_axis: boolean Keep object axis parallel to normal +ConstraintActuator.force_distance -> use_force_distance: boolean Force distance of object to point of impact of ray +ConstraintActuator.local -> use_local: boolean Set ray along object's axis or global axis +ConstraintActuator.normal -> use_normal: boolean Set object axis along (local axis) or parallel (global axis) to the normal at hit position +ConstraintActuator.persistent -> use_persistent: boolean Persistent actuator: stays active even if ray does not reach target +ControlFluidSettings.active -> active: boolean Object contributes to the fluid simulation +ControlFluidSettings.reverse_frames -> use_frame_reverse: boolean Reverse control object movement +Controller.expanded -> show_expanded: boolean Set controller expanded in the user interface +Controller.priority -> use_priority: boolean Mark controller for execution before all non-marked controllers (good for startup scripts) +Controller.state -> state: boolean, (read-only) Set Controller state index (1 to 30) +CopyLocationConstraint.invert_x -> invert_x: boolean Invert the X location +CopyLocationConstraint.invert_y -> invert_y: boolean Invert the Y location +CopyLocationConstraint.invert_z -> invert_z: boolean Invert the Z location +CopyLocationConstraint.use_offset -> use_offset: boolean Add original location into copied location +CopyLocationConstraint.use_x -> use_x: boolean Copy the target's X location +CopyLocationConstraint.use_y -> use_y: boolean Copy the target's Y location +CopyLocationConstraint.use_z -> use_z: boolean Copy the target's Z location +CopyRotationConstraint.invert_x -> invert_x: boolean Invert the X rotation +CopyRotationConstraint.invert_y -> invert_y: boolean Invert the Y rotation +CopyRotationConstraint.invert_z -> invert_z: boolean Invert the Z rotation +CopyRotationConstraint.use_offset -> use_offset: boolean Add original rotation into copied rotation +CopyRotationConstraint.use_x -> use_x: boolean Copy the target's X rotation +CopyRotationConstraint.use_y -> use_y: boolean Copy the target's Y rotation +CopyRotationConstraint.use_z -> use_z: boolean Copy the target's Z rotation +CopyScaleConstraint.use_offset -> use_offset: boolean Add original scale into copied scale +CopyScaleConstraint.use_x -> use_x: boolean Copy the target's X scale +CopyScaleConstraint.use_y -> use_y: boolean Copy the target's Y scale +CopyScaleConstraint.use_z -> use_z: boolean Copy the target's Z scale +Curve.auto_texspace -> use_auto_texspace: boolean Adjusts active object's texture space automatically when transforming object +Curve.back -> use_fill_back: boolean Draw filled back for extruded/beveled curves +Curve.draw_handles -> show_handles: boolean Display bezier handles in editmode +Curve.draw_normals -> show_normals: boolean Display 3D curve normals in editmode +Curve.front -> use_fill_front: boolean Draw filled front for extruded/beveled curves +Curve.map_along_length -> use_texture_map_length: boolean Generate texture mapping coordinates following the curve direction, rather than the local bounding box +Curve.use_deform_fill -> use_fill_deform: boolean Fill curve after applying deformation +Curve.use_path -> use_path: boolean Enable the curve to become a translation path +Curve.use_path_follow -> use_path_follow: boolean Make curve path children to rotate along the path +Curve.use_radius -> use_radius: boolean Option for paths: apply the curve radius with path following it and deforming +Curve.use_stretch -> use_stretch: boolean Option for curve-deform: makes deformed child to stretch along entire path +Curve.use_time_offset -> use_time_offset: boolean Children will use TimeOffs value as path distance offset +CurveMapPoint.selected -> select: boolean Selection state of the curve point +CurveMapping.clip -> use_clip: boolean Force the curve view to fit a defined boundary +DelaySensor.repeat -> use_repeat: boolean Toggle repeat option. If selected, the sensor restarts after Delay+Dur logic tics +DomainFluidSettings.generate_speed_vectors -> use_speed_vectors: boolean Generate speed vectors for vector blur +DomainFluidSettings.override_time -> use_time_override: boolean Use a custom start and end time (in seconds) instead of the scene's timeline +DomainFluidSettings.reverse_frames -> use_frame_reverse: boolean Reverse fluid frames +NEGATE * DopeSheet.collapse_summary -> show_expanded_summary: boolean Collapse summary when shown, so all other channels get hidden. (DopeSheet Editors Only) +DopeSheet.display_armature -> show_armature: boolean Include visualization of Armature related Animation data +DopeSheet.display_camera -> show_camera: boolean Include visualization of Camera related Animation data +DopeSheet.display_curve -> show_curve: boolean Include visualization of Curve related Animation data +DopeSheet.display_lamp -> show_lamp: boolean Include visualization of Lamp related Animation data +DopeSheet.display_material -> show_material: boolean Include visualization of Material related Animation data +DopeSheet.display_mesh -> show_mesh: boolean Include visualization of Mesh related Animation data +DopeSheet.display_metaball -> show_metaball: boolean Include visualization of Metaball related Animation data +DopeSheet.display_node -> show_node: boolean Include visualization of Node related Animation data +DopeSheet.display_particle -> show_particle: boolean Include visualization of Particle related Animation data +DopeSheet.display_scene -> show_scene: boolean Include visualization of Scene related Animation data +DopeSheet.display_shapekeys -> show_shapekeys: boolean Include visualization of ShapeKey related Animation data +DopeSheet.display_summary -> show_summary: boolean Display an additional 'summary' line. (DopeSheet Editors only) +DopeSheet.display_texture -> show_texture: boolean Include visualization of Texture related Animation data +DopeSheet.display_transforms -> show_transforms: boolean Include visualization of Object-level Animation data (mostly Transforms) +DopeSheet.display_world -> show_world: boolean Include visualization of World related Animation data +DopeSheet.include_missing_nla -> show_missing_nla: boolean Include Animation Data blocks with no NLA data. (NLA Editor only) +DopeSheet.only_group_objects -> show_only_group_objects: boolean Only include channels from Objects in the specified Group +DopeSheet.only_selected -> show_only_selected: boolean Only include channels relating to selected objects and data +Driver.invalid -> is_valid: boolean Driver could not be evaluated in past, so should be skipped +Driver.show_debug_info -> show_debug_info: boolean Show intermediate values for the driver calculations to allow debugging of drivers +DriverTarget.use_local_space_transforms -> use_local_space_transform: boolean Use transforms in Local Space (as opposed to the worldspace default) +EdgeSplitModifier.use_edge_angle -> use_edge_angle: boolean Split edges with high angle between faces +EdgeSplitModifier.use_sharp -> use_edge_sharp: boolean Split edges that are marked as sharp +EditBone.connected -> is_connected: boolean When bone has a parent, bone's head is struck to the parent's tail +EditBone.cyclic_offset -> use_cyclic_offset: boolean When bone doesn't have a parent, it receives cyclic offset effects +EditBone.deform -> use_deform: boolean Bone does not deform any geometry +EditBone.draw_wire -> show_wire: boolean Bone is always drawn as Wireframe regardless of viewport draw mode. Useful for non-obstructive custom bone shapes +EditBone.hidden -> hide: boolean Bone is not visible when in Edit Mode +EditBone.hinge -> use_hinge: boolean Bone inherits rotation or scale from parent bone +EditBone.inherit_scale -> use_inherit_scale: boolean Bone inherits scaling from parent bone +EditBone.layer -> layer: boolean Layers bone exists in +EditBone.local_location -> use_local_location: boolean Bone location is set in local space +EditBone.locked -> lock: boolean Bone is not able to be transformed when in Edit Mode +EditBone.multiply_vertexgroup_with_envelope -> use_envelope_multiply: boolean When deforming bone, multiply effects of Vertex Group weights with Envelope influence +EditBone.restrict_select -> restrict_select: boolean Bone is able to be selected +EditBone.selected -> select: boolean +EditBone.selected_head -> select_head: boolean +EditBone.selected_tail -> select_tail: boolean +EditObjectActuator.enable_3d_tracking -> use_track_3d: boolean Enable 3D tracking +EditObjectActuator.local_angular_velocity -> use_local_angular_velocity: boolean Apply the rotation locally +EditObjectActuator.local_linear_velocity -> use_local_linear_velocity: boolean Apply the transformation locally +EditObjectActuator.replace_display_mesh -> use_display_mesh: boolean Replace the display mesh +EditObjectActuator.replace_physics_mesh -> use_physics_mesh: boolean Replace the physics mesh (triangle bounds only - compound shapes not supported) +EffectSequence.convert_float -> use_float: boolean Convert input to float data +EffectSequence.de_interlace -> use_deinterlace: boolean For video movies to remove fields +EffectSequence.flip_x -> use_flip_x: boolean Flip on the X axis +EffectSequence.flip_y -> use_flip_y: boolean Flip on the Y axis +EffectSequence.premultiply -> use_premultiply: boolean Convert RGB from key alpha to premultiplied alpha +EffectSequence.proxy_custom_directory -> use_proxy_custom_directory: boolean Use a custom directory to store data +EffectSequence.proxy_custom_file -> use_proxy_custom_file: boolean Use a custom file to read proxy data from +EffectSequence.reverse_frames -> use_frame_reverse: boolean Reverse frame order +EffectSequence.use_color_balance -> use_color_balance: boolean (3-Way color correction) on input +EffectSequence.use_crop -> use_crop: boolean Crop image before processing +EffectSequence.use_proxy -> use_proxy: boolean Use a preview proxy for this strip +EffectSequence.use_translation -> use_translation: boolean Translate image before processing +EffectorWeights.do_growing_hair -> use_hair_grow: boolean Use force fields when growing hair +EnvironmentMap.ignore_layers -> layer_ignore: boolean Hide objects on these layers when generating the Environment Map +EnvironmentMapTexture.use_filter_size_min -> filter_size_min: boolean Use Filter Size as a minimal filter value in pixels +EnvironmentMapTexture.mipmap -> use_mipmap: boolean Uses auto-generated MIP maps for the image +EnvironmentMapTexture.mipmap_gauss -> use_mipmap_gauss: boolean Uses Gauss filter to sample down MIP maps +Event.alt -> alt: boolean, (read-only) True when the Alt/Option key is held +Event.ctrl -> ctrl: boolean, (read-only) True when the Ctrl key is held +Event.oskey -> oskey: boolean, (read-only) True when the Cmd key is held +Event.shift -> shift: boolean, (read-only) True when the Shift key is held +ExplodeModifier.alive -> show_alive: boolean Show mesh when particles are alive +ExplodeModifier.dead -> show_dead: boolean Show mesh when particles are dead +ExplodeModifier.size -> use_size: boolean Use particle size for the shrapnel +ExplodeModifier.split_edges -> use_edge_split: boolean Split face edges for nicer shrapnel +ExplodeModifier.unborn -> show_unborn: boolean Show mesh when particles are unborn +FCurve.auto_clamped_handles -> use_auto_handle_clamp: boolean All auto-handles for F-Curve are clamped +NEGATE * FCurve.disabled -> enabled: boolean F-Curve could not be evaluated in past, so should be skipped when evaluating +FCurve.locked -> lock: boolean F-Curve's settings cannot be edited +FCurve.muted -> use_mute: boolean F-Curve is not evaluated +FCurve.selected -> select: boolean F-Curve is selected for editing +NEGATE * FCurve.visible -> hide: boolean F-Curve and its keyframes are shown in the Graph Editor graphs +FCurveSample.selected -> select: boolean Selection status +FModifier.active -> active: boolean F-Curve Modifier is the one being edited +NEGATE * FModifier.disabled -> enabled: boolean, (read-only) F-Curve Modifier has invalid settings and will not be evaluated +FModifier.expanded -> show_expanded: boolean F-Curve Modifier's panel is expanded in UI +FModifier.muted -> use_mute: boolean F-Curve Modifier will not be evaluated +FModifierFunctionGenerator.additive -> use_additive: boolean Values generated by this modifier are applied on top of the existing values instead of overwriting them +FModifierGenerator.additive -> use_additive: boolean Values generated by this modifier are applied on top of the existing values instead of overwriting them +FModifierLimits.use_maximum_x -> use_x_max: boolean Use the maximum X value +FModifierLimits.use_maximum_y -> use_y_max: boolean Use the maximum Y value +FModifierLimits.use_minimum_x -> use_x_min: boolean Use the minimum X value +FModifierLimits.use_minimum_y -> use_y_min: boolean Use the minimum Y value +FModifierStepped.use_frame_end -> use_frame_end: boolean Restrict modifier to only act before its 'end' frame +FModifierStepped.use_frame_start -> use_frame_start: boolean Restrict modifier to only act after its 'start' frame +FcurveActuator.add -> use_additive: boolean F-Curve is added to the current loc/rot/scale in global or local coordinate according to Local flag +FcurveActuator.child -> use_child: boolean Update F-Curve on all children Objects as well +FcurveActuator.force -> use_force: boolean Apply F-Curve as a global or local force depending on the local option (dynamic objects only) +FcurveActuator.local -> use_local: boolean Let the F-Curve act in local coordinates, used in Force and Add mode +FieldSettings.do_absorption -> use_absorption: boolean Force gets absorbed by collision objects +FieldSettings.do_location -> use_location: boolean Effect particles' location +FieldSettings.do_rotation -> use_rotation: boolean Effect particles' dynamic rotation +FieldSettings.force_2d -> use_force_2d: boolean Apply force only in 2d +FieldSettings.global_coordinates -> use_coordinates_global: boolean Use effector/global coordinates for turbulence +FieldSettings.guide_path_add -> use_guide_path_add: boolean Based on distance/falloff it adds a portion of the entire path +FieldSettings.multiple_springs -> use_multiple_springs: boolean Every point is effected by multiple springs +FieldSettings.root_coordinates -> use_coordinates_root: boolean Texture coordinates from root particle locations +FieldSettings.use_coordinates -> use_coordinates_object: boolean Use object/global coordinates for texture +FieldSettings.use_guide_path_weight -> use_guide_path_weight: boolean Use curve weights to influence the particle influence along the curve +FieldSettings.use_max_distance -> use_distance_min: boolean Use a maximum distance for the field to work +FieldSettings.use_min_distance -> use_distance_max: boolean Use a minimum distance for the field's fall-off +FieldSettings.use_radial_max -> use_radial_max: boolean Use a maximum radial distance for the field to work +FieldSettings.use_radial_min -> use_radial_min: boolean Use a minimum radial distance for the field's fall-off +FileSelectParams.do_filter -> use_filter: boolean Enable filtering of files +FileSelectParams.filter_blender -> use_filter_blender: boolean Show .blend files +FileSelectParams.filter_folder -> use_filter_folder: boolean Show folders +FileSelectParams.filter_font -> use_filter_font: boolean Show font files +FileSelectParams.filter_image -> use_filter_image: boolean Show image files +FileSelectParams.filter_movie -> use_filter_movie: boolean Show movie files +FileSelectParams.filter_script -> use_filter_script: boolean Show script files +FileSelectParams.filter_sound -> use_filter_sound: boolean Show sound files +FileSelectParams.filter_text -> use_filter_text: boolean Show text files +FileSelectParams.hide_dot -> show_hidden: boolean Hide hidden dot files +Filter2DActuator.enable_motion_blur -> use_motion_blur: boolean Enable/Disable Motion Blur +FloorConstraint.sticky -> use_sticky: boolean Immobilize object while constrained +FloorConstraint.use_rotation -> use_rotation: boolean Use the target's rotation to determine floor +FluidFluidSettings.active -> active: boolean Object contributes to the fluid simulation +FluidFluidSettings.export_animated_mesh -> use_animated_mesh: boolean Export this mesh as an animated one. Slower, only use if really necessary (e.g. armatures or parented objects), animated pos/rot/scale IPOs do not require it +FollowPathConstraint.use_curve_follow -> use_curve_follow: boolean Object will follow the heading and banking of the curve +FollowPathConstraint.use_curve_radius -> use_curve_radius: boolean Objects scale by the curve radius +FollowPathConstraint.use_fixed_position -> use_fixed_location: boolean Object will stay locked to a single point somewhere along the length of the curve regardless of time +Function.registered -> registered: boolean, (read-only) Function is registered as callback as part of type registration +Function.registered_optional -> registered_optional: boolean, (read-only) Function is optionally registered as callback part of type registration +GPencilFrame.paint_lock -> lock_paint: boolean Frame is being edited (painted on) +GPencilFrame.selected -> select: boolean Frame is selected for editing in the DopeSheet +GPencilLayer.active -> active: boolean Set active layer for editing +GPencilLayer.frame_lock -> lock_frame: boolean Lock current frame displayed by layer +GPencilLayer.hide -> hide: boolean Set layer Visibility +GPencilLayer.locked -> lock: boolean Protect layer from further editing and/or frame changes +GPencilLayer.selected -> select: boolean Layer is selected for editing in the DopeSheet +GPencilLayer.show_points -> show_points: boolean Draw the points which make up the strokes (for debugging purposes) +GPencilLayer.use_onion_skinning -> use_onion_skin: boolean Ghost frames on either side of frame +GameBooleanProperty.value -> value: boolean Property value +GameObjectSettings.actor -> use_actor: boolean Object is detected by the Near and Radar sensor +GameObjectSettings.all_states -> states_all: boolean Set all state bits +GameObjectSettings.anisotropic_friction -> use_anisotropic_friction: boolean Enable anisotropic friction +GameObjectSettings.collision_compound -> use_collision_compound: boolean Add children to form a compound collision object +GameObjectSettings.debug_state -> show_state_debug: boolean Print state debug info in the game engine +GameObjectSettings.ghost -> use_ghost: boolean Object does not restitute collisions, like a ghost +GameObjectSettings.initial_state -> initial_state: boolean Initial state when the game starts +GameObjectSettings.lock_x_axis -> lock_location_x: boolean Disable simulation of linear motion along the X axis +GameObjectSettings.lock_x_rot_axis -> lock_rotation_x: boolean Disable simulation of angular motion along the X axis +GameObjectSettings.lock_y_axis -> lock_location_y: boolean Disable simulation of linear motion along the Y axis +GameObjectSettings.lock_y_rot_axis -> lock_rotation_y: boolean Disable simulation of angular motion along the Y axis +GameObjectSettings.lock_z_axis -> lock_location_z: boolean Disable simulation of linear motion along the Z axis +GameObjectSettings.lock_z_rot_axis -> lock_rotation_z: boolean Disable simulation of angular motion along the Z axis +GameObjectSettings.material_physics -> use_material_physics: boolean Use physics settings in materials +NEGATE * GameObjectSettings.no_sleeping -> use_sleep: boolean Disable auto (de)activation in physics simulation +GameObjectSettings.rotate_from_normal -> use_rotate_from_normal: boolean Use face normal to rotate object, so that it points away from the surface +GameObjectSettings.show_actuators -> show_actuators: boolean Shows actuators for this object in the user interface +GameObjectSettings.show_controllers -> show_controllers: boolean Shows controllers for this object in the user interface +GameObjectSettings.show_sensors -> show_sensors: boolean Shows sensors for this object in the user interface +GameObjectSettings.show_state_panel -> show_state_panel: boolean Show state panel +GameObjectSettings.use_activity_culling -> use_activity_culling: boolean Disable simulation of angular motion along the Z axis +GameObjectSettings.use_collision_bounds -> use_collision_bounds: boolean Specify a collision bounds type other than the default +GameObjectSettings.used_state -> state_used: boolean, (read-only) States which are being used by controllers +GameObjectSettings.visible_state -> state_visible: boolean State determining which controllers are displayed +GameProperty.debug -> use_debug: boolean Print debug information for this property +GameSoftBodySettings.bending_const -> use_bending_constraint: boolean Enable bending constraints +GameSoftBodySettings.cluster_rigid_to_softbody -> use_cluster_rigid_to_softbody: boolean Enable cluster collision between soft and rigid body +GameSoftBodySettings.cluster_soft_to_softbody -> use_cluster_soft_to_softbody: boolean Enable cluster collision between soft and soft body +GameSoftBodySettings.shape_match -> use_shape_match: boolean Enable soft body shape matching goal +GlowSequence.only_boost -> use_only_boost: boolean Show the glow buffer only +GreasePencil.use_stroke_endpoints -> use_stroke_endpoints: boolean Only use the first and last parts of the stroke for snapping +Group.layer -> layer: boolean Layers visible when this groups is instanced as a dupli +ID.fake_user -> use_fake_user: boolean Saves this datablock even if it has no users +ID.tag -> tag: boolean Tools can use this to tag data, (initial state is undefined) +Image.animated -> use_snimation: boolean Use as animated texture in the game engine +Image.clamp_x -> use_clamp_x: boolean Disable texture repeating horizontally +Image.clamp_y -> use_clamp_y: boolean Disable texture repeating vertically +Image.dirty -> is_dirty: boolean, (read-only) Image has changed and is not saved +Image.fields -> use_fields: boolean Use fields of the image +Image.has_data -> is_data: boolean, (read-only) True if this image has data +Image.premultiply -> use_premultiply: boolean Convert RGB from key alpha to premultiplied alpha +Image.tiles -> use_tiles: boolean Use of tilemode for faces (default shift-LMB to pick the tile for selected faces) +ImagePaint.invert_stencil -> invert_stencil: boolean Invert the stencil layer +ImagePaint.show_brush -> show_brush: boolean Enables brush shape while not drawing +ImagePaint.show_brush_draw -> show_brush_draw: boolean Enables brush shape while drawing +ImagePaint.use_backface_cull -> use_backface_cull: boolean Ignore faces pointing away from the view (faster) +ImagePaint.use_clone_layer -> use_clone_layer: boolean Use another UV layer as clone source, otherwise use 3D the cursor as the source +ImagePaint.use_normal_falloff -> use_normal_falloff: boolean Paint most on faces pointing towards the view +ImagePaint.use_occlude -> use_occlude: boolean Only paint onto the faces directly under the brush (slower) +ImagePaint.use_projection -> use_projection: boolean Use projection painting for improved consistency in the brush strokes +ImagePaint.use_stencil_layer -> use_stencil_layer: boolean Set the mask layer from the UV layer buttons +ImageSequence.convert_float -> use_float: boolean Convert input to float data +ImageSequence.de_interlace -> use_deinterlace: boolean For video movies to remove fields +ImageSequence.flip_x -> use_flip_x: boolean Flip on the X axis +ImageSequence.flip_y -> use_flip_y: boolean Flip on the Y axis +ImageSequence.premultiply -> use_premultiply: boolean Convert RGB from key alpha to premultiplied alpha +ImageSequence.proxy_custom_directory -> use_proxy_custom_directory: boolean Use a custom directory to store data +ImageSequence.proxy_custom_file -> use_proxy_custom_file: boolean Use a custom file to read proxy data from +ImageSequence.reverse_frames -> use_frame_reverse: boolean Reverse frame order +ImageSequence.use_color_balance -> use_color_balance: boolean (3-Way color correction) on input +ImageSequence.use_crop -> use_crop: boolean Crop image before processing +ImageSequence.use_proxy -> use_proxy: boolean Use a preview proxy for this strip +ImageSequence.use_translation -> use_translation: boolean Translate image before processing +ImageTexture.calculate_alpha -> use_rgb_alpha: boolean Calculates an alpha channel based on RGB values in the image +ImageTexture.checker_even -> use_checker_even: boolean Sets even checker tiles +ImageTexture.checker_odd -> use_checker_odd: boolean Sets odd checker tiles +ImageTexture.filter_size_minimum -> use_filter_size_min: boolean Use Filter Size as a minimal filter value in pixels +ImageTexture.flip_axis -> use_flip_axis: boolean Flips the texture's X and Y axis +ImageTexture.interpolation -> use_interpolation: boolean Interpolates pixels using Area filter +ImageTexture.invert_alpha -> invert_alpha: boolean Inverts all the alpha values in the image +ImageTexture.mipmap -> use_mipmap: boolean Uses auto-generated MIP maps for the image +ImageTexture.mipmap_gauss -> use_mipmap_gauss: boolean Uses Gauss filter to sample down MIP maps +ImageTexture.mirror_x -> use_mirror_x: boolean Mirrors the image repetition on the X direction +ImageTexture.mirror_y -> use_mirror_y: boolean Mirrors the image repetition on the Y direction +ImageTexture.normal_map -> use_normal_map: boolean Uses image RGB values for normal mapping +ImageTexture.use_alpha -> use_use_alpha: boolean Uses the alpha channel information in the image +ImageUser.auto_refresh -> use_auto_refresh: boolean Always refresh image on frame changes +ImageUser.cyclic -> use_cyclic: boolean Cycle the images in the movie +TODO would use is_ * InflowFluidSettings.active -> active: boolean Object contributes to the fluid simulation +InflowFluidSettings.export_animated_mesh -> use_export_animated_mesh: boolean Export this mesh as an animated one. Slower, only use if really necessary (e.g. armatures or parented objects), animated pos/rot/scale IPOs do not require it +InflowFluidSettings.local_coordinates -> use_local_coordinates: boolean Use local coordinates for inflow. (e.g. for rotating objects) +Itasc.auto_step -> use_auto_step: boolean Automatically determine the optimal number of steps for best performance/accuracy trade off +JoystickSensor.all_events -> use_all_events: boolean Triggered by all events on this joysticks current type (axis/button/hat) +Key.relative -> use_relative: boolean Makes shape keys relative +TODO would use is_ * KeyConfig.user_defined -> user_defined: boolean, (read-only) Indicates that a keyconfig was defined by the user +KeyMap.children_expanded -> show_expanded_children: boolean Children expanded in the user interface +KeyMap.items_expanded -> show_expanded_items: boolean Expanded in the user interface +TODO would use is_ * KeyMap.modal -> modal: boolean, (read-only) Indicates that a keymap is used for translate modal events for an operator +KeyMap.user_defined -> use_user_defined: boolean Keymap is defined by the user +KeyMapItem.active -> active: boolean Activate or deactivate item +TODO would use is_pressed * KeyMapItem.alt -> alt: boolean Alt key pressed +TODO would use is_pressed * KeyMapItem.any -> any: boolean Any modifier keys pressed +TODO would use is_pressed * KeyMapItem.ctrl -> ctrl: boolean Control key pressed +KeyMapItem.expanded -> show_expanded: boolean Show key map event and property details in the user interface +TODO would use is_pressed * KeyMapItem.oskey -> oskey: boolean Operating system key pressed +TODO would use is_pressed * KeyMapItem.shift -> shift: boolean Shift key pressed +TODO * KeyboardSensor.all_keys -> all_keys: boolean Trigger this sensor on any keystroke +TODO would use is_ * Keyframe.selected -> select: boolean Control point selection status +TODO would use is_ * Keyframe.selected_handle1 -> select_left_handle: boolean Handle 1 selection status +TODO would use is_ * Keyframe.selected_handle2 -> select_right_handle: boolean Handle 2 selection status +KeyingSet.absolute -> use_absolute: boolean Keying Set defines specific paths/settings to be keyframed (i.e. is not reliant on context info) +KeyingSet.insertkey_needed -> use_insertkey_needed: boolean Only insert keyframes where they're needed in the relevant F-Curves +KeyingSet.insertkey_visual -> use_insertkey_visual: boolean Insert keyframes based on 'visual transforms' +KeyingSet.insertkey_xyz_to_rgb -> use_insertkey_xyz_to_rgb: boolean Color for newly added transformation F-Curves (Location, Rotation, Scale) and also Color is based on the transform axis +KeyingSetInfo.insertkey_needed -> use_insertkey_needed: boolean Only insert keyframes where they're needed in the relevant F-Curves +KeyingSetInfo.insertkey_visual -> use_insertkey_visual: boolean Insert keyframes based on 'visual transforms' +KeyingSetInfo.insertkey_xyz_to_rgb -> use_insertkey_xyz_to_rgb: boolean Color for newly added transformation F-Curves (Location, Rotation, Scale) and also Color is based on the transform axis +KeyingSetPath.entire_array -> use_entire_array: boolean When an 'array/vector' type is chosen (Location, Rotation, Color, etc.), entire array is to be used +KeyingSetPath.insertkey_needed -> use_insertkey_needed: boolean Only insert keyframes where they're needed in the relevant F-Curves +KeyingSetPath.insertkey_visual -> use_insertkey_visual: boolean Insert keyframes based on 'visual transforms' +KeyingSetPath.insertkey_xyz_to_rgb -> use_insertkey_xyz_to_rgb: boolean Color for newly added transformation F-Curves (Location, Rotation, Scale) and also Color is based on the transform axis +KinematicConstraint.pos_lock_x -> lock_location_x: boolean Constraint position along X axis +KinematicConstraint.pos_lock_y -> lock_location_y: boolean Constraint position along Y axis +KinematicConstraint.pos_lock_z -> lock_location_z: boolean Constraint position along Z axis +KinematicConstraint.rot_lock_x -> lock_rotation_x: boolean Constraint rotation along X axis +KinematicConstraint.rot_lock_y -> lock_rotation_y: boolean Constraint rotation along Y axis +KinematicConstraint.rot_lock_z -> lock_rotation_z: boolean Constraint rotation along Z axis +KinematicConstraint.use_position -> use_location: boolean Chain follows position of target +KinematicConstraint.use_rotation -> use_rotation: boolean Chain follows rotation of target +KinematicConstraint.use_stretch -> use_stretch: boolean Enable IK Stretching +KinematicConstraint.use_tail -> use_tail: boolean Include bone's tail as last element in chain +KinematicConstraint.use_target -> use_target: boolean Disable for targetless IK +Lamp.diffuse -> use_diffuse: boolean Lamp does diffuse shading +Lamp.layer -> use_own_layer: boolean Illuminates objects only on the same layer the lamp is on +Lamp.negative -> use_negative: boolean Lamp casts negative light +Lamp.specular -> use_specular: boolean Lamp creates specular highlights +LampSkySettings.use_atmosphere -> use_atmosphere: boolean Apply sun effect on atmosphere +LampSkySettings.use_sky -> use_sky: boolean Apply sun effect on sky +LampTextureSlot.map_color -> use_map_color: boolean Lets the texture affect the basic color of the lamp +LampTextureSlot.map_shadow -> use_map_shadow: boolean Lets the texture affect the shadow color of the lamp +Lattice.outside -> use_outside: boolean Only draw, and take into account, the outer vertices +LimitLocationConstraint.limit_transform -> limit_transform: boolean Transforms are affected by this constraint as well +LimitLocationConstraint.use_maximum_x -> use_x_max: boolean Use the maximum X value +LimitLocationConstraint.use_maximum_y -> use_y_max: boolean Use the maximum Y value +LimitLocationConstraint.use_maximum_z -> use_z_max: boolean Use the maximum Z value +LimitLocationConstraint.use_minimum_x -> use_x_min: boolean Use the minimum X value +LimitLocationConstraint.use_minimum_y -> use_y_min: boolean Use the minimum Y value +LimitLocationConstraint.use_minimum_z -> use_z_min: boolean Use the minimum Z value +LimitRotationConstraint.limit_transform -> limit_transform: boolean Transforms are affected by this constraint as well +LimitRotationConstraint.use_limit_x -> use_x_limit: boolean Use the minimum X value +LimitRotationConstraint.use_limit_y -> use_y_limit: boolean Use the minimum Y value +LimitRotationConstraint.use_limit_z -> use_z_limit: boolean Use the minimum Z value +LimitScaleConstraint.limit_transform -> limit_transform: boolean Transforms are affected by this constraint as well +LimitScaleConstraint.use_maximum_x -> use_x_max: boolean Use the maximum X value +LimitScaleConstraint.use_maximum_y -> use_y_max: boolean Use the maximum Y value +LimitScaleConstraint.use_maximum_z -> use_z_max: boolean Use the maximum Z value +LimitScaleConstraint.use_minimum_x -> use_x_min: boolean Use the minimum X value +LimitScaleConstraint.use_minimum_y -> use_y_min: boolean Use the minimum Y value +LimitScaleConstraint.use_minimum_z -> use_z_min: boolean Use the minimum Z value +Main.debug -> show_debug: boolean Print debugging information in console +Main.file_is_saved -> is_saved: boolean, (read-only) Has the current session been saved to disk as a .blend file +TODO * MaskModifier.invert -> invert: boolean Use vertices that are not part of region defined +Material.cast_approximate -> use_cast_approximate: boolean Allow this material to cast shadows when using approximate ambient occlusion. +Material.cast_buffer_shadows -> use_cast_buffer_shadows: boolean Allow this material to cast shadows from shadow buffer lamps +Material.cast_shadows_only -> use_cast_shadows_only: boolean Makes objects with this material appear invisible, only casting shadows (not rendered) +Material.cubic -> use_cubic: boolean Use cubic interpolation for diffuse values, for smoother transitions +Material.exclude_mist -> use_exclude_mist: boolean Excludes this material from mist effects (in world settings) +Material.face_texture -> use_face_texture: boolean Replaces the object's base color with color from face assigned image textures +Material.face_texture_alpha -> use_face_texture_alpha: boolean Replaces the object's base alpha value with alpha from face assigned image textures +Material.full_oversampling -> use_full_oversampling: boolean Force this material to render full shading/textures for all anti-aliasing samples +Material.invert_z -> use_invert_z: boolean Renders material's faces with an inverted Z buffer (scanline only) +Material.light_group_exclusive -> use_light_group_exclusive: boolean Material uses the light group exclusively - these lamps are excluded from other scene lighting +Material.object_color -> use_object_color: boolean Modulate the result with a per-object color +Material.only_shadow -> use_shadow_only: boolean Renders shadows as the material's alpha value, making materials transparent except for shadowed areas +Material.ray_shadow_bias -> use_ray_shadow_bias: boolean Prevents raytraced shadow errors on surfaces with smooth shaded normals (terminator problem) +Material.receive_transparent_shadows -> use_receive_transparent_shadows: boolean Allow this object to receive transparent shadows casted through other objects +Material.shadeless -> use_shadeless: boolean Makes this material insensitive to light or shadow +Material.shadows -> use_shadows: boolean Allows this material to receive shadows +Material.tangent_shading -> use_tangent_shading: boolean Use the material's tangent vector instead of the normal for shading - for anisotropic shading effects +Material.traceable -> use_traceable: boolean Include this material and geometry that uses it in ray tracing calculations +Material.transparency -> use_transparency: boolean Render material as transparent +Material.use_diffuse_ramp -> use_diffuse_ramp: boolean Toggle diffuse ramp operations +Material.use_nodes -> use_nodes: boolean Use shader nodes to render the material +Material.use_sky -> use_sky: boolean Renders this material with zero alpha, with sky background in place (scanline only) +Material.use_specular_ramp -> use_specular_ramp: boolean Toggle specular ramp operations +Material.use_textures -> use_textures: boolean Enable/Disable each texture +Material.vertex_color_light -> use_vertex_color_light: boolean Add vertex colors as additional lighting +Material.vertex_color_paint -> use_vertex_color_paint: boolean Replaces object base color with vertex colors (multiplies with 'texture face' face assigned textures) +MaterialHalo.flare_mode -> use_flare_mode: boolean Renders halo as a lensflare +MaterialHalo.lines -> use_lines: boolean Renders star shaped lines over halo +MaterialHalo.ring -> use_ring: boolean Renders rings over halo +MaterialHalo.shaded -> use_shaded: boolean Lets halo receive light and shadows from external objects +MaterialHalo.soft -> use_soft: boolean Softens the edges of halos at intersections with other geometry +MaterialHalo.star -> use_star: boolean Renders halo as a star +MaterialHalo.texture -> use_texture: boolean Gives halo a texture +MaterialHalo.vertex_normal -> use_vertex_normal: boolean Uses the vertex normal to specify the dimension of the halo +MaterialHalo.xalpha -> use_xalpha: boolean Uses extreme alpha +MaterialPhysics.align_to_normal -> use_align_to_normal: boolean Align dynamic game objects along the surface normal, when inside the physics distance area +TODO * MaterialRaytraceMirror.enabled -> enabled: boolean Enable raytraced reflections +MaterialStrand.blender_units -> use_blender_units: boolean Use Blender units for widths instead of pixels +MaterialStrand.surface_diffuse -> use_surface_diffuse: boolean Make diffuse shading more similar to shading the surface +MaterialStrand.tangent_shading -> use_tangent_shading: boolean Uses direction of strands as normal for tangent-shading +TODO * MaterialSubsurfaceScattering.enabled -> enabled: boolean Enable diffuse subsurface scatting effects in a material +TODO * MaterialTextureSlot.enabled -> enabled: boolean Enable this material texture slot +MaterialTextureSlot.from_dupli -> use_from_dupli: boolean Dupli's instanced from verts, faces or particles, inherit texture coordinate from their parent +MaterialTextureSlot.from_original -> use_from_original: boolean Dupli's derive their object coordinates from the original objects transformation +MaterialTextureSlot.map_alpha -> use_map_alpha: boolean Causes the texture to affect the alpha value +MaterialTextureSlot.map_ambient -> use_map_ambient: boolean Causes the texture to affect the value of ambient +MaterialTextureSlot.map_colordiff -> use_map_colordiff: boolean Causes the texture to affect basic color of the material +MaterialTextureSlot.map_coloremission -> use_map_coloremission: boolean Causes the texture to affect the color of emission +MaterialTextureSlot.map_colorreflection -> use_map_colorreflection: boolean Causes the texture to affect the color of scattered light +MaterialTextureSlot.map_colorspec -> use_map_colorspec: boolean Causes the texture to affect the specularity color +MaterialTextureSlot.map_colortransmission -> use_map_colortransmission: boolean Causes the texture to affect the result color after other light has been scattered/absorbed +MaterialTextureSlot.map_density -> use_map_density: boolean Causes the texture to affect the volume's density +MaterialTextureSlot.map_diffuse -> use_map_diffuse: boolean Causes the texture to affect the value of the materials diffuse reflectivity +MaterialTextureSlot.map_displacement -> use_map_displacement: boolean Let the texture displace the surface +MaterialTextureSlot.map_emission -> use_map_emission: boolean Causes the texture to affect the volume's emission +MaterialTextureSlot.map_emit -> use_map_emit: boolean Causes the texture to affect the emit value +MaterialTextureSlot.map_hardness -> use_map_hardness: boolean Causes the texture to affect the hardness value +MaterialTextureSlot.map_mirror -> use_map_mirror: boolean Causes the texture to affect the mirror color +MaterialTextureSlot.map_normal -> use_map_normal: boolean Causes the texture to affect the rendered normal +MaterialTextureSlot.map_raymir -> use_map_raymir: boolean Causes the texture to affect the ray-mirror value +MaterialTextureSlot.map_reflection -> use_map_reflect: boolean Causes the texture to affect the reflected light's brightness +MaterialTextureSlot.map_scattering -> use_map_scatter: boolean Causes the texture to affect the volume's scattering +MaterialTextureSlot.map_specular -> use_map_specular: boolean Causes the texture to affect the value of specular reflectivity +MaterialTextureSlot.map_translucency -> use_map_translucency: boolean Causes the texture to affect the translucency value +MaterialTextureSlot.map_warp -> use_map_warp: boolean Let the texture warp texture coordinates of next channels +MaterialTextureSlot.new_bump -> use_new_bump: boolean Use new, corrected bump mapping code (backwards compatibility option) +MaterialVolume.external_shadows -> use_external_shadows: boolean Receive shadows from sources outside the volume (temporary) +MaterialVolume.light_cache -> use_light_cache: boolean Pre-calculate the shading information into a voxel grid, speeds up shading at slightly less accuracy +Mesh.all_edges -> show_all_edges: boolean Displays all edges for wireframe in all view modes in the 3D view +Mesh.auto_texspace -> use_auto_texspace: boolean Adjusts active object's texture space automatically when transforming object +Mesh.autosmooth -> use_autosmooth: boolean Treats all set-smoothed faces with angles less than the specified angle as 'smooth' during render +Mesh.double_sided -> use_double_sided: boolean Render/display the mesh with double or single sided lighting +Mesh.draw_bevel_weights -> show_bevel_weights: boolean Displays weights created for the Bevel modifier +Mesh.draw_creases -> show_creases: boolean Displays creases created for subsurf weighting +Mesh.draw_edge_angle -> show_edge_angle: boolean Displays the angles in the selected edges in degrees +Mesh.draw_edge_lenght -> show_edge_lenght: boolean Displays selected edge lengths +Mesh.draw_edges -> show_edges: boolean Displays selected edges using highlights in the 3D view and UV editor +Mesh.draw_face_area -> show_face_area: boolean Displays the area of selected faces +Mesh.draw_faces -> show_faces: boolean Displays all faces as shades in the 3D view and UV editor +Mesh.draw_normals -> show_normals: boolean Displays face normals as lines +Mesh.draw_seams -> show_seams: boolean Displays UV unwrapping seams +Mesh.draw_sharp -> show_sharp: boolean Displays sharp edges, used with the EdgeSplit modifier +Mesh.draw_vertex_normals -> show_vertex_normals: boolean Displays vertex normals as lines +Mesh.use_mirror_topology -> use_mirror_topology: boolean Use topology based mirroring +Mesh.use_mirror_x -> use_mirror_x: boolean X Axis mirror editing +Mesh.use_paint_mask -> use_paint_mask: boolean Face selection masking for painting +Mesh.vertex_normal_flip -> use_vertex_normal_flip: boolean Flip vertex normals towards the camera during render +MeshColorLayer.active -> active: boolean Sets the layer as active for display and editing +MeshColorLayer.active_render -> active_render: boolean Sets the layer as active for rendering +MeshDeformModifier.dynamic -> dynamic: boolean Recompute binding dynamically on top of other deformers (slower and more memory consuming.) +MeshDeformModifier.invert -> invert: boolean Invert vertex group influence +MeshDeformModifier.is_bound -> is_bound: boolean, (read-only) Whether geometry has been bound to control cage +MeshEdge.fgon -> is_fgon: boolean, (read-only) Fgon edge +TODO * MeshEdge.hidden -> hide: boolean +MeshEdge.loose -> use_loose: boolean, (read-only) Loose edge +MeshEdge.seam -> use_seam: boolean Seam edge for UV unwrapping +TODO * MeshEdge.selected -> select: boolean +MeshEdge.sharp -> use_sharp: boolean Sharp edge for the EdgeSplit modifier +TODO would use is_ * MeshFace.hidden -> hide: boolean +TODO would use is_ * MeshFace.selected -> select: boolean +TODO would use is_ * MeshFace.smooth -> use_smooth: boolean +MeshTextureFace.alpha_sort -> use_alpha_sort: boolean Enable sorting of faces for correct alpha drawing (slow, use Clip Alpha instead when possible) +MeshTextureFace.billboard -> use_billboard: boolean Billboard with Z-axis constraint +MeshTextureFace.collision -> use_collision: boolean Use face for collision and ray-sensor detection +MeshTextureFace.halo -> use_halo: boolean Screen aligned billboard +TODO would use is_ * MeshTextureFace.invisible -> invisible: boolean Make face invisible +MeshTextureFace.light -> use_light: boolean Use light for face +MeshTextureFace.object_color -> use_object_color: boolean Use ObColor instead of vertex colors +MeshTextureFace.shadow -> use_shadow_face: boolean Face is used for shadow +MeshTextureFace.shared -> use_blend_shared: boolean Blend vertex colors across face when vertices are shared +MeshTextureFace.tex -> use_render_texture: boolean Render face with texture +MeshTextureFace.text -> use_bitmap_text: boolean Enable bitmap text on face +MeshTextureFace.twoside -> use_twoside: boolean Render face two-sided +MeshTextureFace.uv_pinned -> uv_pin: boolean +MeshTextureFace.uv_selected -> uv_select: boolean +TODO * MeshTextureFaceLayer.active -> active: boolean Sets the layer as active for display and editing +TODO * MeshTextureFaceLayer.active_clone -> active_clone: boolean Sets the layer as active for cloning +TODO * MeshTextureFaceLayer.active_render -> active_render: boolean Sets the layer as active for rendering +TODO * MeshVertex.hidden -> hide: boolean +TODO would use is_ * MeshVertex.selected -> select: boolean +MetaBall.auto_texspace -> use_auto_texspace: boolean Adjusts active object's texture space automatically when transforming object +TODO * MetaElement.hide -> hide: boolean Hide element +TODO would use is_ * MetaElement.negative -> use_negative: boolean Set metaball as negative one +MetaSequence.convert_float -> use_convert_float: boolean Convert input to float data +MetaSequence.de_interlace -> use_deinterlace: boolean For video movies to remove fields +MetaSequence.flip_x -> use_flip_x: boolean Flip on the X axis +MetaSequence.flip_y -> use_flip_y: boolean Flip on the Y axis +MetaSequence.premultiply -> use_convert_premultiply: boolean Convert RGB from key alpha to premultiplied alpha +MetaSequence.proxy_custom_directory -> use_proxy_custom_directory: boolean Use a custom directory to store data +MetaSequence.proxy_custom_file -> use_proxy_custom_file: boolean Use a custom file to read proxy data from +MetaSequence.reverse_frames -> use_reverse_frames: boolean Reverse frame order +MetaSequence.use_color_balance -> use_color_balance: boolean (3-Way color correction) on input +MetaSequence.use_crop -> use_crop: boolean Crop image before processing +MetaSequence.use_proxy -> use_proxy: boolean Use a preview proxy for this strip +MetaSequence.use_translation -> use_translation: boolean Translate image before processing +MirrorModifier.clip -> use_clipping: boolean Prevents vertices from going through the mirror during transform +MirrorModifier.mirror_u -> use_mirror_u: boolean Mirror the U texture coordinate around the 0.5 point +MirrorModifier.mirror_v -> use_mirror_v: boolean Mirror the V texture coordinate around the 0.5 point +MirrorModifier.mirror_vertex_groups -> use_mirror_vertex_groups: boolean Mirror vertex groups (e.g. .R->.L) +MirrorModifier.x -> use_x: boolean Enable X axis mirror +MirrorModifier.y -> use_y: boolean Enable Y axis mirror +MirrorModifier.z -> use_z: boolean Enable Z axis mirror +Modifier.editmode -> use_in_editmode: boolean Use modifier while in the edit mode +Modifier.expanded -> show_expanded: boolean Set modifier expanded in the user interface +Modifier.on_cage -> use_on_cage: boolean Enable direct editing of modifier control cage +Modifier.realtime -> show_realtime: boolean Realtime display of a modifier +Modifier.render -> use_render: boolean Use modifier during rendering +TODO * MotionPath.editing -> editing: boolean Path is being edited +TODO * MotionPath.use_bone_head -> use_bone_head: boolean, (read-only) For PoseBone paths, use the bone head location when calculating this path +TODO would use is_ * MotionPathVert.selected -> select: boolean Path point is selected for editing +MovieSequence.convert_float -> use_convert_float: boolean Convert input to float data +MovieSequence.de_interlace -> use_deinterlace: boolean For video movies to remove fields +MovieSequence.flip_x -> use_flip_x: boolean Flip on the X axis +MovieSequence.flip_y -> use_flip_y: boolean Flip on the Y axis +MovieSequence.premultiply -> use_convert_premultiply: boolean Convert RGB from key alpha to premultiplied alpha +MovieSequence.proxy_custom_directory -> use_proxy_custom_directory: boolean Use a custom directory to store data +MovieSequence.proxy_custom_file -> use_proxy_custom_file: boolean Use a custom file to read proxy data from +TODO * MovieSequence.reverse_frames -> use_reverse_frames: boolean Reverse frame order +MovieSequence.use_color_balance -> use_color_balance: boolean (3-Way color correction) on input +MovieSequence.use_crop -> use_crop: boolean Crop image before processing +MovieSequence.use_proxy -> use_proxy: boolean Use a preview proxy for this strip +MovieSequence.use_translation -> use_translation: boolean Translate image before processing +MulticamSequence.convert_float -> use_convert_float: boolean Convert input to float data +MulticamSequence.de_interlace -> use_deinterlace: boolean For video movies to remove fields +MulticamSequence.flip_x -> use_flip_x: boolean Flip on the X axis +MulticamSequence.flip_y -> use_flip_y: boolean Flip on the Y axis +MulticamSequence.premultiply -> use_convert_premultiply: boolean Convert RGB from key alpha to premultiplied alpha +MulticamSequence.proxy_custom_directory -> use_proxy_custom_directory: boolean Use a custom directory to store data +MulticamSequence.proxy_custom_file -> use_proxy_custom_file: boolean Use a custom file to read proxy data from +TODO * MulticamSequence.reverse_frames -> use_reverse_frames: boolean Reverse frame order +MulticamSequence.use_color_balance -> use_color_balance: boolean (3-Way color correction) on input +MulticamSequence.use_crop -> use_crop: boolean Crop image before processing +MulticamSequence.use_proxy -> use_proxy: boolean Use a preview proxy for this strip +MulticamSequence.use_translation -> use_translation: boolean Translate image before processing +MultiresModifier.external -> use_external: boolean, (read-only) Store multires displacements outside the .blend file, to save memory +MultiresModifier.optimal_display -> show_optimal: boolean Skip drawing/rendering of interior subdivided edges +NetRenderSettings.master_broadcast -> use_master_broadcast: boolean broadcast master server address on local network +NetRenderSettings.master_clear -> use_master_clear: boolean delete saved files on exit +NetRenderSettings.slave_clear -> use_slave_clear: boolean delete downloaded files on exit +NetRenderSettings.slave_outputlog -> use_slave_outputlog: boolean Output render text log to console as well as sending it to the master +NetRenderSettings.slave_thumb -> use_slave_thumb: boolean Generate thumbnails on slaves instead of master +TODO I'd use is_ * NlaStrip.active -> active: boolean, (read-only) NLA Strip is active +NlaStrip.animated_influence -> use_animated_influence: boolean Influence setting is controlled by an F-Curve rather than automatically determined +NlaStrip.animated_time -> use_animated_time: boolean Strip time is controlled by an F-Curve rather than automatically determined +NlaStrip.animated_time_cyclic -> use_animated_time_cyclic: boolean Cycle the animated time within the action start & end +NlaStrip.auto_blending -> use_auto_blend: boolean Number of frames for Blending In/Out is automatically determined from overlapping strips +TODO I'd use is_ * NlaStrip.muted -> muted: boolean NLA Strip is not evaluated +TODO I'd use is_ * NlaStrip.reversed -> reversed: boolean NLA Strip is played back in reverse order (only when timing is automatically determined) +TODO I'd use is_ * NlaStrip.selected -> select: boolean NLA Strip is selected +TODO I'd use is_ * NlaTrack.active -> active: boolean, (read-only) NLA Track is active +TODO I'd use is_ * NlaTrack.locked -> lock: boolean NLA Track is locked +TODO I'd use is_ * NlaTrack.muted -> muted: boolean NLA Track is not evaluated +TODO I'd use is_ * NlaTrack.selected -> select: boolean NLA Track is selected +NlaTrack.solo -> is_solo: boolean, (read-only) NLA Track is evaluated itself (i.e. active Action and all other NLA Tracks in the same AnimData block are disabled) +Object.draw_axis -> show_axis: boolean Displays the object's origin and axis +Object.draw_bounds -> show_bounds: boolean Displays the object's bounds +Object.draw_name -> show_name: boolean Displays the object's name +Object.draw_texture_space -> show_texture_space: boolean Displays the object's texture space +Object.draw_transparent -> show_transparent: boolean Enables transparent materials for the object (Mesh only) +Object.draw_wire -> show_wire: boolean Adds the object's wireframe over solid drawing +TODO * Object.duplis_used -> is_duplis_used: boolean, (read-only) +TODO * Object.layers -> layers: boolean Layers the object is on +Object.lock_location -> lock_location: boolean Lock editing of location in the interface +Object.lock_rotation -> lock_rotation: boolean Lock editing of rotation in the interface +Object.lock_rotation_w -> lock_rotation_w: boolean Lock editing of 'angle' component of four-component rotations in the interface +Object.lock_rotations_4d -> lock_rotations_4d: boolean Lock editing of four component rotations by components (instead of as Eulers) +Object.lock_scale -> lock_scale: boolean Lock editing of scale in the interface +TODO * Object.restrict_render -> use_limit_render: boolean Restrict renderability +TODO * Object.restrict_select -> use_limit_select: boolean Restrict selection in the viewport +TODO * Object.restrict_view -> use_limit_view: boolean Restrict visibility in the viewport +TODO * Object.selected -> select: boolean Object selection state +Object.shape_key_edit_mode -> use_shape_key_edit_mode: boolean Apply shape keys in edit mode (for Meshes only) +Object.shape_key_lock -> show_shape_key: boolean Always show the current Shape for this Object +Object.slow_parent -> use_slow_parent: boolean Create a delay in the parent relationship +Object.time_offset_add_parent -> use_time_offset_add_parent: boolean Add the parents time offset value +Object.time_offset_edit -> use_time_offset_edit: boolean Use time offset when inserting keys and display time offset for F-Curve and action views +Object.time_offset_parent -> use_time_offset_parent: boolean Apply the time offset to this objects parent relationship +Object.time_offset_particle -> use_time_offset_particle: boolean Let the time offset work on the particle effect +Object.use_dupli_faces_scale -> use_dupli_faces_scale: boolean Scale dupli based on face size +Object.use_dupli_frames_speed -> use_dupli_frames_speed: boolean Set dupliframes to use the frame +Object.use_dupli_verts_rotation -> use_dupli_verts_rotation: boolean Rotate dupli according to vertex normal +Object.x_ray -> show_x_ray: boolean Makes the object draw in front of others +TODO * ObjectActuator.add_linear_velocity -> add_linear_velocity: boolean Toggles between ADD and SET linV +ObjectActuator.local_angular_velocity -> use_local_angular_velocity: boolean Angular velocity is defined in local coordinates +ObjectActuator.local_force -> use_local_force: boolean Force is defined in local coordinates +ObjectActuator.local_linear_velocity -> use_local_linear_velocity: boolean Velocity is defined in local coordinates +ObjectActuator.local_location -> use_local_location: boolean Location is defined in local coordinates +ObjectActuator.local_rotation -> use_local_rotation: boolean Rotation is defined in local coordinates +ObjectActuator.local_torque -> use_local_torque: boolean Torque is defined in local coordinates +TODO * ObjectActuator.servo_limit_x -> use_limit_servo_x: boolean Set limit to force along the X axis +TODO * ObjectActuator.servo_limit_y -> use_limit_servo_y: boolean Set limit to force along the Y axis +TODO * ObjectActuator.servo_limit_z -> use_limit_servo_z: boolean Set limit to force along the Z axis +TODO * ObjectBase.layers -> layers: boolean Layers the object base is on +TODO * ObjectBase.selected -> select: boolean Object base selection state +TODO * ObjectBase.selected_user -> is_select_user: boolean, (read-only) Object base user selection state, used to restore user selection after transformations +TODO could be is_ * ObstacleFluidSettings.active -> active: boolean Object contributes to the fluid simulation +ObstacleFluidSettings.export_animated_mesh -> use_export_animated_mesh: boolean Export this mesh as an animated one. Slower, only use if really necessary (e.g. armatures or parented objects), animated pos/rot/scale IPOs do not require it +TODO * Operator.has_reports -> has_reports: boolean, (read-only) Operator has a set of reports (warnings and errors) from last execution +OperatorStrokeElement.flip -> use_flip: boolean +OutflowFluidSettings.active -> active: boolean Object contributes to the fluid simulation +OutflowFluidSettings.export_animated_mesh -> use_export_animated_mesh: boolean Export this mesh as an animated one. Slower, only use if really necessary (e.g. armatures or parented objects), animated pos/rot/scale IPOs do not require it +Paint.fast_navigate -> show_low_resolution: boolean For multires, show low resolution while navigating the view +Paint.show_brush -> show_brush: boolean +TODO * Panel.bl_default_closed -> bl_default_closed: boolean +TODO * Panel.bl_show_header -> bl_show_header: boolean +ParentActuator.compound -> use_compound: boolean Add this object shape to the parent shape (only if the parent shape is already compound) +ParentActuator.ghost -> use_ghost: boolean Make this object ghost while parented (only if not compound) +TODO * Particle.no_disp -> no_disp: boolean +TODO * Particle.rekey -> rekey: boolean +TODO * Particle.unexist -> unexist: boolean +ParticleBrush.use_puff_volume -> use_puff_volume: boolean Apply puff to unselected end-points, (helps maintain hair volume when puffing root) +ParticleEdit.add_interpolate -> use_add_interpolate: boolean Interpolate new particles from the existing ones +ParticleEdit.auto_velocity -> use_auto_velocity: boolean Calculate point velocities automatically +ParticleEdit.draw_particles -> show_particles: boolean Draw actual particles +ParticleEdit.editable -> is_editable: boolean, (read-only) A valid edit mode exists +ParticleEdit.emitter_deflect -> use_emitter_deflect: boolean Keep paths from intersecting the emitter +ParticleEdit.fade_time -> use_fade_time: boolean Fade paths and keys further away from current frame +TODO * ParticleEdit.hair -> hair: boolean, (read-only) Editing hair +ParticleEdit.keep_lengths -> use_keep_lengths: boolean Keep path lengths constant +ParticleEdit.keep_root -> use_keep_root: boolean Keep root keys unmodified +ParticleFluidSettings.drops -> show_drops: boolean Show drop particles +ParticleFluidSettings.floats -> show_floats: boolean Show floating foam particles +ParticleFluidSettings.tracer -> show_tracer: boolean Show tracer particles +ParticleInstanceModifier.alive -> show_alive: boolean Show instances when particles are alive +ParticleInstanceModifier.children -> use_children: boolean Create instances from child particles +ParticleInstanceModifier.dead -> show_dead: boolean Show instances when particles are dead +ParticleInstanceModifier.keep_shape -> use_keep_shape: boolean Don't stretch the object +ParticleInstanceModifier.normal -> use_normal: boolean Create instances from normal particles +ParticleInstanceModifier.size -> use_size: boolean Use particle size to scale the instances +ParticleInstanceModifier.unborn -> show_unborn: boolean Show instances when particles are unborn +ParticleInstanceModifier.use_path -> use_path: boolean Create instances along particle paths +ParticleSettings.abs_path_time -> use_abs_path_time: boolean Path timing is in absolute frames +ParticleSettings.animate_branching -> use_animate_branching: boolean Animate branching +ParticleSettings.billboard_lock -> lock_billboard: boolean Lock the billboards align axis +ParticleSettings.boids_2d -> lock_boids_to_surface: boolean Constrain boids to a surface +ParticleSettings.branching -> use_branching: boolean Branch child paths from each other +ParticleSettings.child_effector -> use_child_effector: boolean Apply effectors to children +ParticleSettings.child_guide -> use_child_guide: boolean +ParticleSettings.child_render -> use_child_render: boolean +ParticleSettings.die_on_collision -> use_die_on_collision: boolean Particles die when they collide with a deflector object +ParticleSettings.died -> show_died: boolean Show particles after they have died +ParticleSettings.draw_health -> show_health: boolean Draw boid health +ParticleSettings.emitter -> use_emitter: boolean Render emitter Object also +ParticleSettings.enable_simplify -> use_simplify: boolean Remove child strands as the object becomes smaller on the screen +ParticleSettings.even_distribution -> use_even_distribution: boolean Use even distribution from faces based on face areas or edge lengths +ParticleSettings.grid_invert -> invert_grid: boolean Invert what is considered object and what is not +ParticleSettings.hair_bspline -> use_hair_bspline: boolean Interpolate hair using B-Splines +TODO * ParticleSettings.hair_geometry -> hair_geometry: boolean +ParticleSettings.material_color -> show_material_color: boolean Draw particles using material's diffuse color +ParticleSettings.num -> use_number: boolean Show particle number +ParticleSettings.parent -> use_parent: boolean Render parent particles +ParticleSettings.rand_group -> use_random_group: boolean Pick objects from group randomly +ParticleSettings.react_multiple -> use_react_multiple: boolean React multiple times +ParticleSettings.react_start_end -> use_react_start_end: boolean Give birth to unreacted particles eventually +ParticleSettings.render_adaptive -> show_path_steps: boolean Draw steps of the particle path +ParticleSettings.render_strand -> use_render_strand: boolean Use the strand primitive for rendering +ParticleSettings.rotation_dynamic -> use_rotation_dynamic: boolean Sets rotation to dynamic/constant +ParticleSettings.self_effect -> use_self_effect: boolean Particle effectors effect themselves +ParticleSettings.show_size -> show_size: boolean Show particle size +ParticleSettings.size_deflect -> use_size_deflect: boolean Use particle's size in deflection +ParticleSettings.sizemass -> use_multiply_size_mass: boolean Multiply mass by particle size +ParticleSettings.symmetric_branching -> use_symmetric_branching: boolean Start and end points are the same +ParticleSettings.trand -> use_emit_random: boolean Emit in random order of elements +ParticleSettings.unborn -> show_unborn: boolean Show particles before they are emitted +ParticleSettings.use_global_dupli -> use_global_dupli: boolean Use object's global coordinates for duplication +ParticleSettings.use_group_count -> use_group_count: boolean Use object multiple times in the same group +ParticleSettings.velocity -> show_velocity: boolean Show particle velocity +ParticleSettings.velocity_length -> use_velocity_length: boolean Multiply line length by particle speed +TODO * ParticleSettings.viewport -> viewport: boolean +ParticleSettings.whole_group -> use_whole_group: boolean Use whole group at once +ParticleSystem.editable -> is_editable: boolean, (read-only) Particle system can be edited in particle mode +ParticleSystem.edited -> is_edited: boolean, (read-only) Particle system has been edited in particle mode +TODO * ParticleSystem.global_hair -> global_hair: boolean, (read-only) Hair keys are in global coordinate space +ParticleSystem.hair_dynamics -> use_hair_dynamics: boolean Enable hair dynamics using cloth simulation +ParticleSystem.keyed_timing -> use_keyed_timing: boolean Use key times +TODO * ParticleSystem.multiple_caches -> multiple_caches: boolean, (read-only) Particle system has multiple point caches +ParticleSystem.vertex_group_clump_negate -> invert_vertex_group_clump: boolean Negate the effect of the clump vertex group +ParticleSystem.vertex_group_density_negate -> invert_vertex_group_density: boolean Negate the effect of the density vertex group +ParticleSystem.vertex_group_field_negate -> invert_vertex_group_field: boolean Negate the effect of the field vertex group +ParticleSystem.vertex_group_kink_negate -> invert_vertex_group_kink: boolean Negate the effect of the kink vertex group +ParticleSystem.vertex_group_length_negate -> invert_vertex_group_length: boolean Negate the effect of the length vertex group +ParticleSystem.vertex_group_rotation_negate -> invert_vertex_group_rotation: boolean Negate the effect of the rotation vertex group +ParticleSystem.vertex_group_roughness1_negate -> invert_vertex_group_roughness1: boolean Negate the effect of the roughness 1 vertex group +ParticleSystem.vertex_group_roughness2_negate -> invert_vertex_group_roughness2: boolean Negate the effect of the roughness 2 vertex group +ParticleSystem.vertex_group_roughness_end_negate -> invert_vertex_group_roughness_end: boolean Negate the effect of the roughness end vertex group +ParticleSystem.vertex_group_size_negate -> invert_vertex_group_size: boolean Negate the effect of the size vertex group +ParticleSystem.vertex_group_tangent_negate -> invert_vertex_group_tangent: boolean Negate the effect of the tangent vertex group +ParticleSystem.vertex_group_velocity_negate -> invert_vertex_group_velocity: boolean Negate the effect of the velocity vertex group +TODO * ParticleTarget.valid -> is_valid: boolean Keyed particles target is valid +PivotConstraint.use_relative_position -> use_relative_location: boolean Offset will be an absolute point in space instead of relative to the target +PointCache.baked -> is_baked: boolean, (read-only) +TODO * PointCache.baking -> baking: boolean, (read-only) +PointCache.disk_cache -> use_disk_cache: boolean Save cache files to disk (.blend file must be saved first) +PointCache.external -> use_external: boolean Read cache from an external location +TODO * PointCache.frames_skipped -> frames_skipped: boolean, (read-only) +PointCache.outdated -> is_outdated: boolean, (read-only) +PointCache.quick_cache -> use_quick_cache: boolean Update simulation with cache steps +PointCache.use_library_path -> use_library_path: boolean Use this files path when library linked into another file. +PointDensity.turbulence -> use_turbulence: boolean Add directed noise to the density at render-time +PointLamp.only_shadow -> use_shadow_only: boolean Causes light to cast shadows only without illuminating objects +PointLamp.shadow_layer -> use_shadow_own_layer: boolean Causes only objects on the same layer to cast shadows +PointLamp.sphere -> use_sphere: boolean Sets light intensity to zero beyond lamp distance +PoseBone.has_ik -> is_in_ik_chain: boolean, (read-only) Is part of an IK chain +TODO * PoseBone.ik_dof_x -> ik_dof_x: boolean Allow movement around the X axis +TODO * PoseBone.ik_dof_y -> ik_dof_y: boolean Allow movement around the Y axis +TODO * PoseBone.ik_dof_z -> ik_dof_z: boolean Allow movement around the Z axis +PoseBone.ik_limit_x -> lock_ik_x: boolean Limit movement around the X axis +PoseBone.ik_limit_y -> lock_ik_y: boolean Limit movement around the Y axis +PoseBone.ik_limit_z -> lock_ik_z: boolean Limit movement around the Z axis +PoseBone.ik_lin_control -> use_ik_lin_control: boolean Apply channel size as IK constraint if stretching is enabled +PoseBone.ik_rot_control -> use_ik_rot_control: boolean Apply channel rotation as IK constraint +PoseBone.lock_location -> lock_location: boolean Lock editing of location in the interface +PoseBone.lock_rotation -> lock_rotation: boolean Lock editing of rotation in the interface +PoseBone.lock_rotation_w -> lock_rotation_w: boolean Lock editing of 'angle' component of four-component rotations in the interface +PoseBone.lock_rotations_4d -> lock_rotations_4d: boolean Lock editing of four component rotations by components (instead of as Eulers) +PoseBone.lock_scale -> lock_scale: boolean Lock editing of scale in the interface +TODO * PoseBone.selected -> select: boolean +PoseTemplateSettings.generate_def_rig -> use_generate_def_rig: boolean Create a copy of the metarig, constrainted by the generated rig +Property.is_never_none -> is_never_none: boolean, (read-only) True when this value can't be set to None +Property.is_readonly -> is_readonly: boolean, (read-only) Property is editable through RNA +Property.is_required -> is_required: boolean, (read-only) False when this property is an optional argument in an RNA function +Property.registered -> is_registered: boolean, (read-only) Property is registered as part of type registration +Property.registered_optional -> is_registered_optional: boolean, (read-only) Property is optionally registered as part of type registration +Property.use_output -> is_output: boolean, (read-only) True when this property is an output value from an RNA function +TODO * PythonConstraint.script_error -> is_script_error: boolean, (read-only) The linked Python script has thrown an error +PythonConstraint.use_targets -> use_targets: boolean Use the targets indicated in the constraint panel +PythonController.debug -> use_debug: boolean Continuously reload the module from disk for editing external modules without restarting +RandomActuator.always_true -> use_always_true: boolean Always false or always true +RaySensor.x_ray_mode -> use_x_ray_mode: boolean Toggle X-Ray option (see through objects that don't have the property) +RegionView3D.box_clip -> use_box_clip: boolean Clip objects based on what's visible in other side views +RegionView3D.box_preview -> show_synced_view: boolean Sync view position between side views +RegionView3D.lock_rotation -> lock_rotation: boolean Lock view rotation in side views +TODO * RenderEngine.bl_postprocess -> use_bl_postprocess: boolean +TODO * RenderEngine.bl_preview -> use_bl_preview: boolean +TODO * RenderLayer.all_z -> all_z: boolean, (read-only) Fill in Z values for solid faces in invisible layers, for masking +TODO * RenderLayer.edge -> edge: boolean, (read-only) Render Edge-enhance in this Layer (only works for Solid faces) +TODO * RenderLayer.enabled -> enabled: boolean, (read-only) Disable or enable the render layer +TODO * RenderLayer.halo -> halo: boolean, (read-only) Render Halos in this Layer (on top of Solid) +TODO * RenderLayer.pass_ao -> pass_ao: boolean, (read-only) Deliver AO pass +TODO * RenderLayer.pass_ao_exclude -> pass_ao_exclude: boolean, (read-only) Exclude AO pass from combined +TODO * RenderLayer.pass_color -> pass_color: boolean, (read-only) Deliver shade-less color pass +TODO * RenderLayer.pass_combined -> pass_combined: boolean, (read-only) Deliver full combined RGBA buffer +TODO * RenderLayer.pass_diffuse -> pass_diffuse: boolean, (read-only) Deliver diffuse pass +TODO * RenderLayer.pass_emit -> pass_emit: boolean, (read-only) Deliver emission pass +TODO * RenderLayer.pass_emit_exclude -> pass_emit_exclude: boolean, (read-only) Exclude emission pass from combined +TODO * RenderLayer.pass_environment -> pass_environment: boolean, (read-only) Deliver environment lighting pass +TODO * RenderLayer.pass_environment_exclude -> pass_environment_exclude: boolean, (read-only) Exclude environment pass from combined +TODO * RenderLayer.pass_indirect -> pass_indirect: boolean, (read-only) Deliver indirect lighting pass +TODO * RenderLayer.pass_indirect_exclude -> pass_indirect_exclude: boolean, (read-only) Exclude indirect pass from combined +TODO * RenderLayer.pass_mist -> pass_mist: boolean, (read-only) Deliver mist factor pass (0.0-1.0) +TODO * RenderLayer.pass_normal -> pass_normal: boolean, (read-only) Deliver normal pass +TODO * RenderLayer.pass_object_index -> pass_object_index: boolean, (read-only) Deliver object index pass +TODO * RenderLayer.pass_reflection -> pass_reflection: boolean, (read-only) Deliver raytraced reflection pass +TODO * RenderLayer.pass_reflection_exclude -> pass_reflection_exclude: boolean, (read-only) Exclude raytraced reflection pass from combined +TODO * RenderLayer.pass_refraction -> pass_refraction: boolean, (read-only) Deliver raytraced refraction pass +TODO * RenderLayer.pass_refraction_exclude -> pass_refraction_exclude: boolean, (read-only) Exclude raytraced refraction pass from combined +TODO * RenderLayer.pass_shadow -> pass_shadow: boolean, (read-only) Deliver shadow pass +TODO * RenderLayer.pass_shadow_exclude -> pass_shadow_exclude: boolean, (read-only) Exclude shadow pass from combined +TODO * RenderLayer.pass_specular -> pass_specular: boolean, (read-only) Deliver specular pass +TODO * RenderLayer.pass_specular_exclude -> pass_specular_exclude: boolean, (read-only) Exclude specular pass from combined +TODO * RenderLayer.pass_uv -> pass_uv: boolean, (read-only) Deliver texture UV pass +TODO * RenderLayer.pass_vector -> pass_vector: boolean, (read-only) Deliver speed vector pass +TODO * RenderLayer.pass_z -> pass_z: boolean, (read-only) Deliver Z values pass +TODO * RenderLayer.sky -> sky: boolean, (read-only) Render Sky in this Layer +TODO * RenderLayer.solid -> solid: boolean, (read-only) Render Solid faces in this Layer +TODO * RenderLayer.strand -> strand: boolean, (read-only) Render Strands in this Layer +TODO * RenderLayer.visible_layers -> visible_layers: boolean, (read-only) Scene layers included in this render layer +TODO * RenderLayer.zmask -> zmask: boolean, (read-only) Only render what's in front of the solid z values +TODO * RenderLayer.zmask_layers -> zmask_layers: boolean, (read-only) Zmask scene layers +TODO * RenderLayer.zmask_negate -> zmask_negate: boolean, (read-only) For Zmask, only render what is behind solid z values instead of in front +TODO * RenderLayer.ztransp -> ztransp: boolean, (read-only) Render Z-Transparent faces in this Layer (On top of Solid and Halos) +RenderSettings.backbuf -> use_backbuf: boolean Render backbuffer image +RenderSettings.bake_active -> use_bake_active: boolean Bake shading on the surface of selected objects to the active object +RenderSettings.bake_clear -> use_bake_clear: boolean Clear Images before baking +RenderSettings.bake_enable_aa -> use_bake_enable_aa: boolean Enables Anti-aliasing +RenderSettings.bake_normalized -> use_bake_normalized: boolean With displacement normalize to the distance, with ambient occlusion normalize without using material settings +RenderSettings.cineon_log -> use_cineon_log: boolean Convert to logarithmic color space +RenderSettings.color_management -> use_color_management: boolean Use color profiles and gamma corrected imaging pipeline +RenderSettings.crop_to_border -> use_crop_to_border: boolean Crop the rendered frame to the defined border size +RenderSettings.edge -> edge: boolean use_Create a toon outline around the edges of geometry +RenderSettings.exr_half -> use_exr_half: boolean Use 16 bit floats instead of 32 bit floats per channel +RenderSettings.exr_preview -> use_exr_preview: boolean When rendering animations, save JPG preview images in same directory +RenderSettings.exr_zbuf -> use_exr_zbuf: boolean Save the z-depth per pixel (32 bit unsigned int zbuffer) +RenderSettings.ffmpeg_autosplit -> use_ffmpeg_autosplit: boolean Autosplit output at 2GB boundary +RenderSettings.fields -> use_fields: boolean Render image to two fields per frame, for interlaced TV output +RenderSettings.fields_still -> use_fields_still: boolean Disable the time difference between fields +RenderSettings.free_image_textures -> use_free_image_textures: boolean Free all image texture from memory after render, to save memory before compositing +RenderSettings.free_unused_nodes -> use_free_unused_nodes: boolean Free Nodes that are not used while compositing, to save memory +RenderSettings.full_sample -> use_full_sample: boolean Save for every anti-aliasing sample the entire RenderLayer results. This solves anti-aliasing issues with compositing +RenderSettings.is_movie_format -> is_movie_format: boolean, (read-only) When true the format is a movie +RenderSettings.jpeg2k_ycc -> use_jpeg2k_ycc: boolean Save luminance-chrominance-chrominance channels instead of RGB colors +RenderSettings.motion_blur -> use_motion_blur: boolean Use multi-sampled 3D scene motion blur +TODO * RenderSettings.multiple_engines -> multiple_engines: boolean, (read-only) More than one rendering engine is available +RenderSettings.render_antialiasing -> use_render_antialiasing: boolean Render and combine multiple samples per pixel to prevent jagged edges +TODO doubled?* RenderSettings.render_stamp -> render_stamp: boolean Render the stamp info text in the rendered image +RenderSettings.save_buffers -> use_save_buffers: boolean Save tiles for all RenderLayers and SceneNodes to files in the temp directory (saves memory, required for Full Sample) +RenderSettings.simplify_triangulate -> use_simplify_triangulate: boolean Disables non-planer quads being triangulated +RenderSettings.single_layer -> use_active_layer: boolean Only render the active layer +RenderSettings.stamp_camera -> use_stamp_camera: boolean Include the name of the active camera in image metadata +RenderSettings.stamp_date -> use_stamp_date: boolean Include the current date in image metadata +RenderSettings.stamp_filename -> use_stamp_filename: boolean Include the filename of the .blend file in image metadata +RenderSettings.stamp_frame -> use_stamp_frame: boolean Include the frame number in image metadata +RenderSettings.stamp_marker -> use_stamp_marker: boolean Include the name of the last marker in image metadata +RenderSettings.stamp_note -> use_stamp_note: boolean Include a custom note in image metadata +RenderSettings.stamp_render_time -> use_stamp_render_time: boolean Include the render time in the stamp image +RenderSettings.stamp_scene -> use_stamp_scene: boolean Include the name of the active scene in image metadata +RenderSettings.stamp_sequencer_strip -> use_stamp_sequencer_strip: boolean Include the name of the foreground sequence strip in image metadata +RenderSettings.stamp_time -> use_stamp_time: boolean Include the render frame as HH:MM:SS.FF in image metadata +RenderSettings.tiff_bit -> use_tiff_bit: boolean Save TIFF with 16 bits per channel +RenderSettings.use_border -> use_border: boolean Render a user-defined border region, within the frame size. Note, this disables save_buffers and full_sample +RenderSettings.use_compositing -> use_compositing: boolean Process the render result through the compositing pipeline, if compositing nodes are enabled +RenderSettings.use_envmaps -> use_envmaps: boolean Calculate environment maps while rendering +RenderSettings.use_file_extension -> use_file_extension: boolean Add the file format extensions to the rendered file name (eg: filename + .jpg) +RenderSettings.use_game_engine -> use_game_engine: boolean, (read-only) Current rendering engine is a game engine +RenderSettings.use_instances -> use_instances: boolean Instance support leads to effective memory reduction when using duplicates +RenderSettings.use_local_coords -> use_local_coords: boolean Vertex coordinates are stored localy on each primitive. Increases memory usage, but may have impact on speed +RenderSettings.use_overwrite -> use_overwrite: boolean Overwrite existing files while rendering +RenderSettings.use_placeholder -> use_placeholder: boolean Create empty placeholder files while rendering frames (similar to Unix 'touch') +RenderSettings.use_radiosity -> use_radiosity: boolean Calculate radiosity in a pre-process before rendering +RenderSettings.use_raytracing -> use_raytrace: boolean Pre-calculate the raytrace accelerator and render raytracing effects +RenderSettings.use_sequencer -> use_sequencer: boolean Process the render (and composited) result through the video sequence editor pipeline, if sequencer strips exist +RenderSettings.use_sequencer_gl_preview -> use_sequencer_gl_preview: boolean +RenderSettings.use_sequencer_gl_render -> use_sequencer_gl_render: boolean +RenderSettings.use_shadows -> use_shadows: boolean Calculate shadows while rendering +RenderSettings.use_simplify -> use_simplify: boolean Enable simplification of scene for quicker preview renders +RenderSettings.use_sss -> use_sss: boolean Calculate sub-surface scattering in materials rendering +RenderSettings.use_textures -> use_textures: boolean Use textures to affect material properties +RigidBodyJointConstraint.disable_linked_collision -> use_disable_linked_collision: boolean Disable collision between linked bodies +RigidBodyJointConstraint.draw_pivot -> show_pivot: boolean Display the pivot point and rotation in 3D view +Scene.frame_drop -> use_frame_drop: boolean Play back dropping frames if frame display is too slow +TODO * Scene.layers -> layers: boolean Layers visible when rendering the scene +TODO * Scene.mute_audio -> mute_audio: boolean Play back of audio from Sequence Editor will be muted +TODO * Scene.nla_tweakmode_on -> is_nla_tweakmode_on: boolean, (read-only) Indicates whether there is any action referenced by NLA being edited. Strictly read-only +Scene.pov_radio_always_sample -> use_pov_radio_always_sample: boolean Only use the data from the pretrace step and not gather any new samples during the final radiosity pass +Scene.pov_radio_display_advanced -> show_pov_radio_advanced: boolean Show advanced options +Scene.pov_radio_enable -> use_pov_radio_enable: boolean Enable povrays radiosity calculation +Scene.pov_radio_media -> use_pov_radio_media: boolean Radiosity estimation can be affected by media +Scene.pov_radio_normal -> use_pov_radio_normal: boolean Radiosity estimation can be affected by normals +Scene.scrub_audio -> use_scrub_audio: boolean Play audio from Sequence Editor while scrubbing +Scene.sync_audio -> use_sync_audio: boolean Play back and sync with audio clock, dropping frames if frame display is too slow +Scene.use_gravity -> use_gravity: boolean Use global gravity for all dynamics +Scene.use_nodes -> use_nodes: boolean Enable the compositing node tree +Scene.use_preview_range -> use_preview_range: boolean Use an alternative start/end frame for UI playback, rather than the scene start/end frame +SceneGameData.activity_culling -> use_activity_culling: boolean Activity culling is enabled +SceneGameData.auto_start -> use_auto_start: boolean Automatically start game at load time +SceneGameData.fullscreen -> show_fullscreen: boolean Starts player in a new fullscreen display +SceneGameData.glsl_extra_textures -> use_glsl_extra_textures: boolean Use extra textures like normal or specular maps for GLSL rendering +SceneGameData.glsl_lights -> use_glsl_lights: boolean Use lights for GLSL rendering +SceneGameData.glsl_nodes -> use_glsl_nodes: boolean Use nodes for GLSL rendering +SceneGameData.glsl_ramps -> use_glsl_ramps: boolean Use ramps for GLSL rendering +SceneGameData.glsl_shaders -> use_glsl_shaders: boolean Use shaders for GLSL rendering +SceneGameData.glsl_shadows -> use_glsl_shadows: boolean Use shadows for GLSL rendering +SceneGameData.show_debug_properties -> show_debug_properties: boolean Show properties marked for debugging while the game runs +SceneGameData.show_framerate_profile -> show_framerate_profile: boolean Show framerate and profiling information while the game runs +SceneGameData.show_physics_visualization -> show_physics_visualization: boolean Show a visualization of physics bounds and interactions +SceneGameData.use_animation_record -> use_animation_record: boolean Record animation to fcurves +SceneGameData.use_deprecation_warnings -> use_deprecation_warnings: boolean Print warnings when using deprecated features in the python API +SceneGameData.use_display_lists -> use_display_lists: boolean Use display lists to speed up rendering by keeping geometry on the GPU +SceneGameData.use_frame_rate -> use_frame_rate: boolean Respect the frame rate rather than rendering as many frames as possible +SceneGameData.use_occlusion_culling -> use_occlusion_culling: boolean Use optimized Bullet DBVT tree for view frustum and occlusion culling +SceneRenderLayer.all_z -> use_all_z: boolean Fill in Z values for solid faces in invisible layers, for masking +SceneRenderLayer.edge -> use_edge: boolean Render Edge-enhance in this Layer (only works for Solid faces) +TODO * SceneRenderLayer.enabled -> enabled: boolean Disable or enable the render layer +SceneRenderLayer.halo -> use_halo: boolean Render Halos in this Layer (on top of Solid) +SceneRenderLayer.pass_ao -> use_pass_ao: boolean Deliver AO pass +SceneRenderLayer.pass_ao_exclude -> use_pass_ao_exclude: boolean Exclude AO pass from combined +SceneRenderLayer.pass_color -> use_pass_color: boolean Deliver shade-less color pass +SceneRenderLayer.pass_combined -> use_pass_combined: boolean Deliver full combined RGBA buffer +SceneRenderLayer.pass_diffuse -> use_pass_diffuse: boolean Deliver diffuse pass +SceneRenderLayer.pass_emit -> use_pass_emit: boolean Deliver emission pass +SceneRenderLayer.pass_emit_exclude -> use_pass_emit_exclude: boolean Exclude emission pass from combined +SceneRenderLayer.pass_environment -> use_pass_environment: boolean Deliver environment lighting pass +SceneRenderLayer.pass_environment_exclude -> use_pass_environment_exclude: boolean Exclude environment pass from combined +SceneRenderLayer.pass_indirect -> use_pass_indirect: boolean Deliver indirect lighting pass +SceneRenderLayer.pass_indirect_exclude -> use_pass_indirect_exclude: boolean Exclude indirect pass from combined +SceneRenderLayer.pass_mist -> use_pass_mist: boolean Deliver mist factor pass (0.0-1.0) +SceneRenderLayer.pass_normal -> use_pass_normal: boolean Deliver normal pass +SceneRenderLayer.pass_object_index -> use_pass_object_index: boolean Deliver object index pass +SceneRenderLayer.pass_reflection -> use_pass_reflection: boolean Deliver raytraced reflection pass +SceneRenderLayer.pass_reflection_exclude -> use_pass_reflection_exclude: boolean Exclude raytraced reflection pass from combined +SceneRenderLayer.pass_refraction -> use_pass_refraction: boolean Deliver raytraced refraction pass +SceneRenderLayer.pass_refraction_exclude -> use_pass_refraction_exclude: boolean Exclude raytraced refraction pass from combined +SceneRenderLayer.pass_shadow -> use_pass_shadow: boolean Deliver shadow pass +SceneRenderLayer.pass_shadow_exclude -> use_pass_shadow_exclude: boolean Exclude shadow pass from combined +SceneRenderLayer.pass_specular -> use_pass_specular: boolean Deliver specular pass +SceneRenderLayer.pass_specular_exclude -> use_pass_specular_exclude: boolean Exclude specular pass from combined +SceneRenderLayer.pass_uv -> use_pass_uv: boolean Deliver texture UV pass +SceneRenderLayer.pass_vector -> use_pass_vector: boolean Deliver speed vector pass +SceneRenderLayer.pass_z -> use_pass_z: boolean Deliver Z values pass +SceneRenderLayer.sky -> use_sky: boolean Render Sky in this Layer +SceneRenderLayer.solid -> use_solid: boolean Render Solid faces in this Layer +SceneRenderLayer.strand -> use_strand: boolean Render Strands in this Layer +SceneRenderLayer.visible_layers -> visible_layers: boolean Scene layers included in this render layer +SceneRenderLayer.zmask -> use_zmask: boolean Only render what's in front of the solid z values +SceneRenderLayer.zmask_layers -> use_zmask_layers: boolean Zmask scene layers +SceneRenderLayer.zmask_negate -> use_zmask_negate: boolean For Zmask, only render what is behind solid z values instead of in front +SceneRenderLayer.ztransp -> use_ztransp: boolean Render Z-Transparent faces in this Layer (On top of Solid and Halos) +TODO * SceneSequence.convert_float -> convert_float: boolean Convert input to float data +TODO * SceneSequence.de_interlace -> de_interlace: boolean For video movies to remove fields +TODO * SceneSequence.flip_x -> flip_x: boolean Flip on the X axis +TODO * SceneSequence.flip_y -> flip_y: boolean Flip on the Y axis +TODO * SceneSequence.premultiply -> premultiply: boolean Convert RGB from key alpha to premultiplied alpha +TODO * SceneSequence.proxy_custom_directory -> proxy_custom_directory: boolean Use a custom directory to store data +TODO * SceneSequence.proxy_custom_file -> proxy_custom_file: boolean Use a custom file to read proxy data from +TODO * SceneSequence.reverse_frames -> reverse_frames: boolean Reverse frame order +TODO * SceneSequence.use_color_balance -> use_color_balance: boolean (3-Way color correction) on input +TODO * SceneSequence.use_crop -> use_crop: boolean Crop image before processing +TODO * SceneSequence.use_proxy -> use_proxy: boolean Use a preview proxy for this strip +TODO * SceneSequence.use_translation -> use_translation: boolean Translate image before processing +Scopes.use_full_resolution -> use_full_resolution: boolean Sample every pixel of the image +Screen.animation_playing -> is_animation_playing: boolean, (read-only) Animation playback is active +Screen.fullscreen -> is_fullscreen: boolean, (read-only) An area is maximised, filling this screen +ScrewModifier.use_normal_calculate -> use_normal_calculate: boolean Calculate the order of edges (needed for meshes, but not curves) +ScrewModifier.use_normal_flip -> use_normal_flip: boolean Flip normals of lathed faces +ScrewModifier.use_object_screw_offset -> use_object_screw_offset: boolean Use the distance between the objects to make a screw +Sculpt.lock_x -> lock_x: boolean Disallow changes to the X axis of vertices +Sculpt.lock_y -> lock_y: boolean Disallow changes to the Y axis of vertices +Sculpt.lock_z -> lock_z: boolean Disallow changes to the Z axis of vertices +Sculpt.symmetry_x -> use_symmetry_x: boolean Mirror brush across the X axis +Sculpt.symmetry_y -> use_symmetry_y: boolean Mirror brush across the Y axis +Sculpt.symmetry_z -> use_symmetry_z: boolean Mirror brush across the Z axis +Sensor.expanded -> show_expanded: boolean Set sensor expanded in the user interface +TODO * Sensor.invert -> invert: boolean Invert the level(output) of this sensor +TODO * Sensor.level -> level: boolean Level detector, trigger controllers of new states(only applicable upon logic state transition) +Sensor.pulse_false_level -> use_pulse_false_level: boolean Activate FALSE level triggering (pulse mode) +Sensor.pulse_true_level -> use_pulse_true_level: boolean Activate TRUE level triggering (pulse mode) +Sensor.tap -> use_tap: boolean Trigger controllers only for an instant, even while the sensor remains true +TODO * Sequence.frame_locked -> frame_locked: boolean Lock the animation curve to the global frame counter +TODO * Sequence.left_handle_selected -> select_left_handle: boolean +TODO * Sequence.lock -> lock: boolean Lock strip so that it can't be transformed +TODO * Sequence.mute -> mute: boolean +TODO * Sequence.right_handle_selected -> select_right_handle: boolean +TODO * Sequence.selected -> select: boolean +TODO * Sequence.use_effect_default_fade -> use_effect_default_fade: boolean Fade effect using the built-in default (usually make transition as long as effect strip) +SequenceColorBalance.inverse_gain -> invert_gain: boolean +SequenceColorBalance.inverse_gamma -> invert_gamma: boolean +SequenceColorBalance.inverse_lift -> invert_lift: boolean +ShaderNodeExtendedMaterial.diffuse -> use_diffuse: boolean Material Node outputs Diffuse +ShaderNodeExtendedMaterial.invert_normal -> invert_normal: boolean Material Node uses inverted normal +ShaderNodeExtendedMaterial.specular -> use_specular: boolean Material Node outputs Specular +ShaderNodeMapping.clamp_maximum -> use_clamp_to_max: boolean Clamp the output coordinate to a maximum value +ShaderNodeMapping.clamp_minimum -> use_clamp_to_min: boolean Clamp the output coordinate to a minimum value +ShaderNodeMaterial.diffuse -> use_diffuse: boolean Material Node outputs Diffuse +ShaderNodeMaterial.invert_normal -> invert_normal: boolean Material Node uses inverted normal +ShaderNodeMaterial.specular -> use_specular: boolean Material Node outputs Specular +ShaderNodeMixRGB.alpha -> use_alpha: boolean Include alpha of second input in this operation +ShapeActionActuator.continue_last_frame -> use_continue_last_frame: boolean Restore last frame when switching on/off, otherwise play from the start each time +TODO * ShapeKey.mute -> mute: boolean Mute this shape key +TODO see below * ShrinkwrapConstraint.use_x -> use_x: boolean Projection over X Axis +TODO see below* ShrinkwrapConstraint.use_y -> use_y: boolean Projection over Y Axis +TODO see below* ShrinkwrapConstraint.use_z -> use_z: boolean Projection over Z Axis +ShrinkwrapModifier.cull_back_faces -> use_cull_back_faces: boolean Stop vertices from projecting to a back face on the target +ShrinkwrapModifier.cull_front_faces -> use_cull_front_faces: boolean Stop vertices from projecting to a front face on the target +ShrinkwrapModifier.keep_above_surface -> use_keep_above_surface: boolean +TODO * ShrinkwrapModifier.negative -> negative: boolean Allow vertices to move in the negative direction of axis +TODO * ShrinkwrapModifier.positive -> positive: boolean Allow vertices to move in the positive direction of axis +ShrinkwrapModifier.x -> use_x: boolean +ShrinkwrapModifier.y -> use_y: boolean +ShrinkwrapModifier.z -> use_z: boolean +SimpleDeformModifier.lock_x_axis -> lock_axis_x: boolean +SimpleDeformModifier.lock_y_axis -> lock_axis_y: boolean +SimpleDeformModifier.relative -> use_relative: boolean Sets the origin of deform space to be relative to the object +SmokeDomainSettings.dissolve_smoke -> use_dissolve_smoke: boolean Enable smoke to disappear over time +SmokeDomainSettings.dissolve_smoke_log -> use_dissolve_smoke_log: boolean Using 1/x +SmokeDomainSettings.highres -> use_highres: boolean Enable high resolution (using amplification) +SmokeDomainSettings.initial_velocity -> use_initial_velocity: boolean Smoke inherits it's velocity from the emitter particle +SmokeDomainSettings.viewhighres -> show_highres: boolean Show high resolution (using amplification) +NEGATE * SmokeFlowSettings.outflow -> use_outflow: boolean Deletes smoke from simulation +SmoothModifier.x -> use_x: boolean +SmoothModifier.y -> use_y: boolean +SmoothModifier.z -> use_z: boolean +SoftBodySettings.auto_step -> use_auto_step: boolean Use velocities for automagic step sizes +SoftBodySettings.diagnose -> use_diagnose: boolean Turn on SB diagnose console prints +SoftBodySettings.edge_collision -> use_edge_collision: boolean Edges collide too +SoftBodySettings.estimate_matrix -> use_estimate_matrix: boolean estimate matrix .. split to COM , ROT ,SCALE +SoftBodySettings.face_collision -> use_face_collision: boolean Faces collide too, SLOOOOOW warning +SoftBodySettings.new_aero -> use_new_aero: boolean New aero(uses angle and length) +SoftBodySettings.self_collision -> use_self_collision: boolean Enable naive vertex ball self collision +SoftBodySettings.stiff_quads -> use_stiff_quads: boolean Adds diagonal springs on 4-gons +SoftBodySettings.use_edges -> use_edges: boolean Use Edges as springs +SoftBodySettings.use_goal -> use_goal: boolean Define forces for vertices to stick to animated position +TODO * SolidifyModifier.invert -> invert_vertex_groups_influence: boolean Invert the vertex group influence +SolidifyModifier.use_even_offset -> use_even_offset: boolean Maintain thickness by adjusting for sharp corners (slow, disable when not needed) +SolidifyModifier.use_quality_normals -> use_quality_normals: boolean Calculate normals which result in more even thickness (slow, disable when not needed) +SolidifyModifier.use_rim -> use_rim: boolean Create edge loops between the inner and outer surfaces on face edges (slow, disable when not needed) +SolidifyModifier.use_rim_material -> use_rim_material: boolean Use in the next material for rim faces +Sound.caching -> use_ram_cache: boolean The sound file is decoded and loaded into RAM +SoundActuator.enable_sound_3d -> use_sound_3d: boolean Enable/Disable 3D Sound +SpaceConsole.show_report_debug -> show_report_debug: boolean Display debug reporting info +SpaceConsole.show_report_error -> show_report_error: boolean Display error text +SpaceConsole.show_report_info -> show_report_info: boolean Display general information +SpaceConsole.show_report_operator -> show_report_operator: boolean Display the operator log +SpaceConsole.show_report_warn -> show_report_warn: boolean Display warnings +SpaceDopeSheetEditor.automerge_keyframes -> show_automerge_keyframes: boolean Show handles of Bezier control points +SpaceDopeSheetEditor.realtime_updates -> use_realtime_updates: boolean When transforming keyframes, changes to the animation data are flushed to other views +SpaceDopeSheetEditor.show_cframe_indicator -> show_cframe_indicator: boolean Show frame number beside the current frame indicator line +SpaceDopeSheetEditor.show_seconds -> show_seconds: boolean, (read-only) Show timing in seconds not frames +SpaceDopeSheetEditor.show_sliders -> show_sliders: boolean Show sliders beside F-Curve channels +SpaceDopeSheetEditor.use_marker_sync -> use_marker_sync: boolean Sync Markers with keyframe edits +SpaceGraphEditor.automerge_keyframes -> show_automerge_keyframes: boolean Show handles of Bezier control points +TODO * SpaceGraphEditor.has_ghost_curves -> has_ghost_curves: boolean Graph Editor instance has some ghost curves stored +SpaceGraphEditor.only_selected_curves_handles -> use_only_selected_curves_handles: boolean Only keyframes of selected F-Curves are visible and editable +SpaceGraphEditor.only_selected_keyframe_handles -> use_only_selected_keyframe_handles: boolean Only show and edit handles of selected keyframes +SpaceGraphEditor.realtime_updates -> use_realtime_updates: boolean When transforming keyframes, changes to the animation data are flushed to other views +SpaceGraphEditor.show_cframe_indicator -> show_cframe_indicator: boolean Show frame number beside the current frame indicator line +SpaceGraphEditor.show_cursor -> show_cursor: boolean Show 2D cursor +SpaceGraphEditor.show_handles -> show_handles: boolean Show handles of Bezier control points +SpaceGraphEditor.show_seconds -> show_seconds: boolean, (read-only) Show timing in seconds not frames +SpaceGraphEditor.show_sliders -> show_sliders: boolean Show sliders beside F-Curve channels +SpaceImageEditor.draw_repeated -> show_repeated: boolean Draw the image repeated outside of the main view +SpaceImageEditor.image_painting -> use_image_paint: boolean Enable image painting mode +SpaceImageEditor.image_pin -> show_image_pin: boolean Display current image regardless of object selection +SpaceImageEditor.show_paint -> show_paint: boolean, (read-only) Show paint related properties +SpaceImageEditor.show_render -> show_render: boolean, (read-only) Show render related properties +SpaceImageEditor.show_uvedit -> show_uvedit: boolean, (read-only) Show UV editing related properties +SpaceImageEditor.update_automatically -> use_update_automatically: boolean Update other affected window spaces automatically to reflect changes during interactive operations such as transform +SpaceImageEditor.use_grease_pencil -> use_grease_pencil: boolean Display and edit the grease pencil freehand annotations overlay +SpaceLogicEditor.actuators_show_active_objects -> show_actuators_active_objects: boolean Show actuators of active object +SpaceLogicEditor.actuators_show_active_states -> show_actuators_active_states: boolean Show only actuators connected to active states +SpaceLogicEditor.actuators_show_linked_controller -> show_actuators_linked_controller: boolean Show linked objects to the actuator +SpaceLogicEditor.actuators_show_selected_objects -> show_actuators_selected_objects: boolean Show actuators of all selected objects +SpaceLogicEditor.controllers_show_active_objects -> show_controllers_active_objects: boolean Show controllers of active object +SpaceLogicEditor.controllers_show_linked_controller -> show_controllers_linked_controller: boolean Show linked objects to sensor/actuator +SpaceLogicEditor.controllers_show_selected_objects -> show_controllers_selected_objects: boolean Show controllers of all selected objects +SpaceLogicEditor.sensors_show_active_objects -> show_sensors_active_objects: boolean Show sensors of active object +SpaceLogicEditor.sensors_show_active_states -> show_sensors_active_states: boolean Show only sensors connected to active states +SpaceLogicEditor.sensors_show_linked_controller -> show_sensors_linked_controller: boolean Show linked objects to the controller +SpaceLogicEditor.sensors_show_selected_objects -> show_sensors_selected_objects: boolean Show sensors of all selected objects +SpaceNLA.realtime_updates -> use_realtime_updates: boolean When transforming strips, changes to the animation data are flushed to other views +SpaceNLA.show_cframe_indicator -> show_cframe_indicator: boolean Show frame number beside the current frame indicator line +SpaceNLA.show_seconds -> show_seconds: boolean, (read-only) Show timing in seconds not frames +SpaceNLA.show_strip_curves -> show_strip_curves: boolean Show influence curves on strips +SpaceNodeEditor.backdrop -> show_backdrop: boolean Use active Viewer Node output as backdrop for compositing nodes +SpaceOutliner.match_case_sensitive -> use_match_case_sensitive: boolean Only use case sensitive matches of search string +SpaceOutliner.match_complete -> use_match_complete: boolean Only use complete matches of search string +SpaceOutliner.show_restriction_columns -> show_restriction_columns: boolean Show column +SpaceProperties.brush_texture -> show_brush_texture: boolean Show brush textures +SpaceProperties.use_pin_id -> use_pin_id: boolean Use the pinned context +TODO * SpaceSequenceEditor.draw_frames -> draw_frames: boolean Draw frames rather than seconds +TODO * SpaceSequenceEditor.draw_safe_margin -> draw_safe_margin: boolean Draw title safe margins in preview +TODO * SpaceSequenceEditor.separate_color_preview -> separate_color_preview: boolean Separate color channels in preview +TODO * SpaceSequenceEditor.show_cframe_indicator -> show_cframe_indicator: boolean Show frame number beside the current frame indicator line +TODO * SpaceSequenceEditor.use_grease_pencil -> use_grease_pencil: boolean Display and edit the grease pencil freehand annotations overlay +TODO * SpaceSequenceEditor.use_marker_sync -> use_marker_sync: boolean Transform markers as well as strips +SpaceTextEditor.find_all -> use_find_all: boolean Search in all text datablocks, instead of only the active one +SpaceTextEditor.find_wrap -> use_find_wrap: boolean Search again from the start of the file when reaching the end +SpaceTextEditor.line_numbers -> show_line_numbers: boolean Show line numbers next to the text +SpaceTextEditor.live_edit -> use_live_edit: boolean Run python while editing +SpaceTextEditor.overwrite -> use_overwrite: boolean Overwrite characters when typing rather than inserting them +SpaceTextEditor.syntax_highlight -> use_syntax_highlight: boolean Syntax highlight for scripting +SpaceTextEditor.word_wrap -> use_word_wrap: boolean Wrap words if there is not enough horizontal space +SpaceTimeline.only_selected -> use_only_selected: boolean Show keyframes for active Object and/or its selected channels only +SpaceTimeline.play_all_3d -> use_play_all_3d: boolean +SpaceTimeline.play_anim -> use_play_anim: boolean +SpaceTimeline.play_buttons -> use_play_buttons: boolean +SpaceTimeline.play_image -> use_play_image: boolean +SpaceTimeline.play_nodes -> use_play_nodes: boolean +SpaceTimeline.play_sequencer -> use_play_sequencer: boolean +SpaceTimeline.play_top_left -> use_play_top_left: boolean +SpaceTimeline.show_cframe_indicator -> show_cframe_indicator: boolean Show frame number beside the current frame indicator line +SpaceUVEditor.constrain_to_image_bounds -> use_constrain_to_image_bounds: boolean Constraint to stay within the image bounds while editing +SpaceUVEditor.draw_modified_edges -> show_modified_edges: boolean Draw edges after modifiers are applied +SpaceUVEditor.draw_other_objects -> show_other_objects: boolean Draw other selected objects that share the same image +SpaceUVEditor.draw_smooth_edges -> show_smooth_edges: boolean Draw UV edges anti-aliased +SpaceUVEditor.draw_stretch -> show_stretch: boolean Draw faces colored according to the difference in shape between UVs and their 3D coordinates (blue for low distortion, red for high distortion) +SpaceUVEditor.live_unwrap -> use_live_unwrap: boolean Continuously unwrap the selected UV island while transforming pinned vertices +SpaceUVEditor.normalized_coordinates -> show_normalized_coordinates: boolean Display UV coordinates from 0.0 to 1.0 rather than in pixels +SpaceUVEditor.snap_to_pixels -> use_snap_to_pixels: boolean Snap UVs to pixel locations while editing +SpaceView3D.all_object_origins -> show_all_objects_origin: boolean Show the object origin center dot for all (selected and unselected) objects +SpaceView3D.display_background_images -> show_background_images: boolean Display reference images behind objects in the 3D View +SpaceView3D.display_floor -> show_floor: boolean Show the ground plane grid in perspective view +SpaceView3D.display_render_override -> show_render_override: boolean Display only objects which will be rendered +SpaceView3D.display_x_axis -> show_axis_x: boolean Show the X axis line in perspective view +SpaceView3D.display_y_axis -> show_axis_y: boolean Show the Y axis line in perspective view +SpaceView3D.display_z_axis -> show_axis_z: boolean Show the Z axis line in perspective view +TODO * SpaceView3D.layers -> layers: boolean Layers visible in this 3D View +SpaceView3D.lock_camera_and_layers -> lock_camera_and_layers: boolean Use the scene's active camera and layers in this view, rather than local layers +SpaceView3D.manipulator -> use_manipulator: boolean Use a 3D manipulator widget for controlling transforms +SpaceView3D.manipulator_rotate -> use_manipulator_rotate: boolean Use the manipulator for rotation transformations +SpaceView3D.manipulator_scale -> use_manipulator_scale: boolean Use the manipulator for scale transformations +SpaceView3D.manipulator_translate -> use_manipulator_translate: boolean Use the manipulator for movement transformations +SpaceView3D.occlude_geometry -> use_occlude_geometry: boolean Limit selection to visible (clipped with depth buffer) +SpaceView3D.outline_selected -> show_outline_selected: boolean Show an outline highlight around selected objects in non-wireframe views +SpaceView3D.pivot_point_align -> use_pivot_point_align: boolean Manipulate object centers only +SpaceView3D.relationship_lines -> show_relationship_lines: boolean Show dashed lines indicating parent or constraint relationships +SpaceView3D.textured_solid -> show_textured_solid: boolean Display face-assigned textures in solid view +TODO * SpaceView3D.used_layers -> layers_used: boolean, (read-only) Layers that contain something +SpeedControlSequence.curve_compress_y -> use_curve_compress_y: boolean Scale F-Curve value to get the target frame number, F-Curve value runs from 0.0 to 1.0 +SpeedControlSequence.curve_velocity -> use_curve_velocity: boolean Interpret the F-Curve value as a velocity instead of a frame number +SpeedControlSequence.frame_blending -> use_frame_blend: boolean Blend two frames into the target for a smoother result +Spline.bezier_u -> use_bezier_u: boolean Make this nurbs curve or surface act like a bezier spline in the U direction (Order U must be 3 or 4, Cyclic U must be disabled) +Spline.bezier_v -> use_bezier_v: boolean Make this nurbs surface act like a bezier spline in the V direction (Order V must be 3 or 4, Cyclic V must be disabled) +Spline.cyclic_u -> use_cyclic_u: boolean Make this curve or surface a closed loop in the U direction +Spline.cyclic_v -> use_cyclic_v: boolean Make this surface a closed loop in the V direction +Spline.endpoint_u -> use_endpoint_u: boolean Make this nurbs curve or surface meet the endpoints in the U direction (Cyclic U must be disabled) +Spline.endpoint_v -> use_endpoint_v: boolean Make this nurbs surface meet the endpoints in the V direction (Cyclic V must be disabled) +TODO * Spline.hide -> hide: boolean Hide this curve in editmode +Spline.smooth -> use_smooth: boolean Smooth the normals of the surface or beveled curve +SplineIKConstraint.chain_offset -> use_chain_offset: boolean Offset the entire chain relative to the root joint +TODO * SplineIKConstraint.even_divisions -> use_even_divisions: boolean Ignore the relative lengths of the bones when fitting to the curve +SplineIKConstraint.use_curve_radius -> use_curve_radius: boolean Average radius of the endpoints is used to tweak the X and Z Scaling of the bones, on top of XZ Scale mode +SplineIKConstraint.y_stretch -> use_y_stretch: boolean Stretch the Y axis of the bones to fit the curve +TODO * SplinePoint.hidden -> hide: boolean Visibility status +TODO * SplinePoint.selected -> select_control_point: boolean Selection status +SpotLamp.auto_clip_end -> use_auto_clip_end: boolean Automatic calculation of clipping-end, based on visible vertices +SpotLamp.auto_clip_start -> use_auto_clip_start: boolean Automatic calculation of clipping-start, based on visible vertices +SpotLamp.halo -> use_halo: boolean Renders spotlight with a volumetric halo (Buffer Shadows) +SpotLamp.only_shadow -> use_shadow_only: boolean Causes light to cast shadows only without illuminating objects +SpotLamp.shadow_layer -> use_shadow_own_layer: boolean Causes only objects on the same layer to cast shadows +SpotLamp.show_cone -> show_cone: boolean Draw transparent cone in 3D view to visualize which objects are contained in it +SpotLamp.sphere -> use_sphere: boolean Sets light intensity to zero beyond lamp distance +SpotLamp.square -> use_square: boolean Casts a square spot light shape +TODO * StateActuator.state -> state: boolean +SubsurfModifier.optimal_display -> show_optimal: boolean Skip drawing/rendering of interior subdivided edges +SubsurfModifier.subsurf_uv -> use_subsurf_uv: boolean Use subsurf to subdivide UVs +SunLamp.only_shadow -> use_shadow_only: boolean Causes light to cast shadows only without illuminating objects +SunLamp.shadow_layer -> use_shadow_own_layer: boolean Causes only objects on the same layer to cast shadows +SurfaceCurve.map_along_length -> use_map_along_length: boolean Generate texture mapping coordinates following the curve direction, rather than the local bounding box +SurfaceCurve.vertex_normal_flip -> use_vertex_normal_flip: boolean Flip vertex normals towards the camera during render +TexMapping.has_maximum -> use_clip_to_max: boolean Whether to use maximum clipping value +TexMapping.has_minimum -> use_clip_to_min: boolean Whether to use minimum clipping value +Text.dirty -> is_dirty: boolean, (read-only) Text file has been edited since last save +Text.memory -> is_in_memory: boolean, (read-only) Text file is in memory, without a corresponding file on disk +Text.modified -> is_modified: boolean, (read-only) Text file on disk is different than the one in memory +Text.tabs_as_spaces -> use_tabs_as_spaces: boolean Automatically converts all new tabs into spaces +Text.use_module -> use_module: boolean Register this text as a module on loading, Text name must end with '.py' +TextCharacterFormat.bold -> use_bold: boolean +TextCharacterFormat.italic -> use_italic: boolean +TextCharacterFormat.style -> use_style: boolean +TextCharacterFormat.underline -> use_underline: boolean +TextCharacterFormat.wrap -> use_wrap: boolean +TextCurve.fast -> use_fast_editing: boolean Don't fill polygons while editing +TextCurve.map_along_length -> use_map_along_length: boolean Generate texture mapping coordinates following the curve direction, rather than the local bounding box +TextCurve.vertex_normal_flip -> use_vertex_normal_flip: boolean Flip vertex normals towards the camera during render +TextMarker.edit_all -> use_edit_all: boolean, (read-only) Edit all markers of the same group as one +TODO * TextMarker.temporary -> is_temporary: boolean, (read-only) Marker is temporary +Texture.use_color_ramp -> use_color_ramp: boolean Toggle color ramp operations +Texture.use_nodes -> use_nodes: boolean Make this a node-based texture +Texture.use_preview_alpha -> use_preview_alpha: boolean Show Alpha in Preview Render +TextureNodeMixRGB.alpha -> use_alpha: boolean Include alpha of second input in this operation +TextureSlot.negate -> use_negate: boolean Inverts the values of the texture to reverse its effect +TextureSlot.rgb_to_intensity -> use_rgb_to_intensity: boolean Converts texture RGB values to intensity (gray) values +TextureSlot.stencil -> use_stencil: boolean Use this texture as a blending value on the next texture +ThemeBoneColorSet.colored_constraints -> show_colored_constraints: boolean Allow the use of colors indicating constraints/keyed status +ThemeWidgetColors.shaded -> show_shaded: boolean +TODO * TimelineMarker.selected -> select: boolean Marker selection state +ToolSettings.auto_normalize -> use_auto_normalize: boolean Ensure all bone-deforming vertex groups add up to 1.0 while weight painting +ToolSettings.automerge_editing -> use_automerge_editing: boolean Automatically merge vertices moved to the same location +ToolSettings.bone_sketching -> use_bone_sketching: boolean DOC BROKEN +ToolSettings.etch_autoname -> use_etch_autoname: boolean DOC BROKEN +ToolSettings.etch_overdraw -> use_etch_overdraw: boolean DOC BROKEN +ToolSettings.etch_quick -> use_etch_quick: boolean DOC BROKEN +ToolSettings.mesh_selection_mode -> use_mesh_selection_mode: boolean Which mesh elements selection works on +ToolSettings.record_with_nla -> use_record_with_nla: boolean Add a new NLA Track + Strip for every loop/pass made over the animation to allow non-destructive tweaking +ToolSettings.snap -> use_snap: boolean Snap during transform +ToolSettings.snap_align_rotation -> use_snap_align_rotation: boolean Align rotation with the snapping target +ToolSettings.snap_peel_object -> use_snap_peel_object: boolean Consider objects as whole when finding volume center +ToolSettings.snap_project -> use_snap_project: boolean Project vertices on the surface of other objects +ToolSettings.use_auto_keying -> use_keyframe_insert_auto: boolean Automatic keyframe insertion for Objects and Bones +TODO * ToolSettings.uv_local_view -> show_only_uv_local_view: boolean Draw only faces with the currently displayed image assigned +ToolSettings.uv_sync_selection -> use_uv_sync_selection: boolean Keep UV and edit mode mesh selection in sync +TrackToConstraint.target_z -> use_target_z: boolean Target's Z axis, not World Z axis, will constraint the Up direction +TransformConstraint.extrapolate_motion -> use_motion_extrapolate: boolean Extrapolate ranges +TransformSequence.uniform_scale -> use_uniform_scale: boolean Scale uniformly, preserving aspect ratio +UILayout.active -> active: boolean +UILayout.enabled -> enabled: boolean +UVProjectModifier.override_image -> show_override_image: boolean Override faces' current images with the given image +UnitSettings.use_separate -> use_separate: boolean Display units in pairs +UserPreferencesEdit.auto_keyframe_insert_available -> use_keyframe_insert_auto_available: boolean Automatic keyframe insertion in available curves +UserPreferencesEdit.auto_keyframe_insert_keyingset -> use_keyframe_insert_auto_keyingset: boolean Automatic keyframe insertion using active Keying Set +UserPreferencesEdit.drag_immediately -> use_drag_immediately: boolean Moving things with a mouse drag confirms when releasing the button +UserPreferencesEdit.duplicate_action -> use_duplicate_action: boolean Causes actions to be duplicated with the object +UserPreferencesEdit.duplicate_armature -> use_duplicate_armature: boolean Causes armature data to be duplicated with the object +UserPreferencesEdit.duplicate_curve -> use_duplicate_curve: boolean Causes curve data to be duplicated with the object +UserPreferencesEdit.duplicate_fcurve -> use_duplicate_fcurve: boolean Causes F-curve data to be duplicated with the object +UserPreferencesEdit.duplicate_lamp -> use_duplicate_lamp: boolean Causes lamp data to be duplicated with the object +UserPreferencesEdit.duplicate_material -> use_duplicate_material: boolean Causes material data to be duplicated with the object +UserPreferencesEdit.duplicate_mesh -> use_duplicate_mesh: boolean Causes mesh data to be duplicated with the object +UserPreferencesEdit.duplicate_metaball -> use_duplicate_metaball: boolean Causes metaball data to be duplicated with the object +UserPreferencesEdit.duplicate_particle -> use_duplicate_particle: boolean Causes particle systems to be duplicated with the object +UserPreferencesEdit.duplicate_surface -> use_duplicate_surface: boolean Causes surface data to be duplicated with the object +UserPreferencesEdit.duplicate_text -> use_duplicate_text: boolean Causes text data to be duplicated with the object +UserPreferencesEdit.duplicate_texture -> use_duplicate_texture: boolean Causes texture data to be duplicated with the object +UserPreferencesEdit.enter_edit_mode -> use_enter_edit_mode: boolean Enter Edit Mode automatically after adding a new object +UserPreferencesEdit.global_undo -> use_global_undo: boolean Global undo works by keeping a full copy of the file itself in memory, so takes extra memory +UserPreferencesEdit.grease_pencil_simplify_stroke -> use_grease_pencil_simplify_stroke: boolean Simplify the final stroke +UserPreferencesEdit.grease_pencil_smooth_stroke -> use_grease_pencil_smooth_stroke: boolean Smooth the final stroke +UserPreferencesEdit.insertkey_xyz_to_rgb -> show_insertkey_xyz_to_rgb: boolean Color for newly added transformation F-Curves (Location, Rotation, Scale) and also Color is based on the transform axis +UserPreferencesEdit.keyframe_insert_needed -> use_keyframe_insert_needed: boolean Keyframe insertion only when keyframe needed +UserPreferencesEdit.snap_rotate -> use_snap_grid_rotate: boolean Snap objects and sub-objects to grid units when rotating +UserPreferencesEdit.snap_scale -> use_snap_grid_scale: boolean Snap objects and sub-objects to grid units when scaling +UserPreferencesEdit.snap_translate -> use_snap_grid_translate: boolean Snap objects and sub-objects to grid units when moving +UserPreferencesEdit.use_auto_keying -> use_auto_keying: boolean Automatic keyframe insertion for Objects and Bones +UserPreferencesEdit.use_negative_frames -> use_negative_frames: boolean Current frame number can be manually set to a negative value +UserPreferencesEdit.use_visual_keying -> show_visual_keying: boolean Use Visual keying automatically for constrained objects +UserPreferencesFilePaths.auto_save_temporary_files -> use_auto_save_temporary_files: boolean Automatic saving of temporary files +UserPreferencesFilePaths.compress_file -> use_file_compression: boolean Enable file compression when saving .blend files +UserPreferencesFilePaths.filter_file_extensions -> show_only_file_extensions: boolean Display only files with extensions in the image select window +UserPreferencesFilePaths.hide_dot_files_datablocks -> show_dot_files_datablocks: boolean Hide files/datablocks that start with a dot(.*) +UserPreferencesFilePaths.load_ui -> use_load_ui: boolean Load user interface setup when loading .blend files +UserPreferencesFilePaths.save_preview_images -> use_save_preview_images: boolean Enables automatic saving of preview images in the .blend file +UserPreferencesFilePaths.use_relative_paths -> use_relative_paths: boolean Default relative path option for the file selector +UserPreferencesInput.continuous_mouse -> use_continuous_mouse: boolean Allow moving the mouse outside the view on some manipulations (transform, ui control drag) +UserPreferencesInput.emulate_3_button_mouse -> use_emulate_3_button_mouse: boolean Emulates Middle Mouse with Alt+LeftMouse (doesn't work with Left Mouse Select option) +UserPreferencesInput.emulate_numpad -> use_emulate_numpad: boolean Causes the 1 to 0 keys to act as the numpad (useful for laptops) +UserPreferencesInput.invert_zoom_direction -> invert_zoom: boolean Invert the axis of mouse movement for zooming +UserPreferencesSystem.auto_execute_scripts -> use_scripts_auto_execute: boolean Allow any .blend file to run scripts automatically (unsafe with blend files from an untrusted source) +UserPreferencesSystem.enable_all_codecs -> use_preview_images: boolean Enables automatic saving of preview images in the .blend file (Windows only) +UserPreferencesSystem.international_fonts -> use_fonts_international: boolean Use international fonts +UserPreferencesSystem.tabs_as_spaces -> use_tabs_as_spaces: boolean Automatically converts all new tabs into spaces for new and loaded text files +UserPreferencesSystem.translate_buttons -> show_translate_buttons: boolean Translate button labels +UserPreferencesSystem.translate_toolbox -> show_translate_toolbox: boolean Translate toolbox menu +UserPreferencesSystem.translate_tooltips -> show_translate_tooltips: boolean Translate Tooltips +UserPreferencesSystem.use_antialiasing -> show_antialiasing: boolean Use anti-aliasing for the 3D view (may impact redraw performance) +UserPreferencesSystem.use_mipmaps -> use_mipmaps: boolean Scale textures for the 3D View (looks nicer but uses more memory and slows image reloading) +UserPreferencesSystem.use_textured_fonts -> show_fonts_textured: boolean Use textures for drawing international fonts +UserPreferencesSystem.use_vbos -> use_vertex_buffer_objects: boolean Use Vertex Buffer Objects (or Vertex Arrays, if unsupported) for viewport rendering +UserPreferencesSystem.use_weight_color_range -> show_weight_color_range: boolean Enable color range used for weight visualization in weight painting mode +UserPreferencesView.auto_depth -> use_mouse_auto_depth: boolean Use the depth under the mouse to improve view pan/rotate/zoom functionality +UserPreferencesView.auto_perspective -> show_auto_perspective: boolean Automatically switch between orthographic and perspective when changing from top/front/side views +UserPreferencesView.directional_menus -> show_directional_menus: boolean Otherwise menus, etc will always be top to bottom, left to right, no matter opening direction +UserPreferencesView.display_object_info -> show_object_info: boolean Display objects name and frame number in 3D view +UserPreferencesView.global_pivot -> show_global_pivot: boolean Lock the same rotation/scaling pivot in all 3D Views +UserPreferencesView.global_scene -> show_global_scene: boolean Forces the current Scene to be displayed in all Screens +UserPreferencesView.open_mouse_over -> use_mouse_over_open: boolean Open menu buttons and pulldowns automatically when the mouse is hovering +UserPreferencesView.pin_floating_panels -> show_pin_floating_panels: boolean Make floating panels invoked by a hotkey (e.g. N Key) open at the previous location +UserPreferencesView.rotate_around_selection -> use_rotate_around_selection: boolean Use selection as the pivot point +UserPreferencesView.show_mini_axis -> show_mini_axis: boolean Show a small rotating 3D axis in the bottom left corner of the 3D View +UserPreferencesView.show_playback_fps -> show_playback_fps: boolean Show the frames per second screen refresh rate, while animation is played back +UserPreferencesView.show_splash -> show_splash: boolean Display splash screen on startup +UserPreferencesView.show_view_name -> show_view_name: boolean Show the name of the view's direction in each 3D View +UserPreferencesView.tooltips -> use_tooltips: boolean Display tooltips +UserPreferencesView.use_column_layout -> show_column_layout: boolean Use a column layout for toolbox +UserPreferencesView.use_large_cursors -> show_large_cursors: boolean Use large mouse cursors when available +UserPreferencesView.use_manipulator -> show_manipulator: boolean Use 3D transform manipulator +UserPreferencesView.use_middle_mouse_paste -> use_mouse_mmb_paste: boolean In text window, paste with middle mouse button instead of panning +UserPreferencesView.wheel_invert_zoom -> invert_mouse_wheel_zoom: boolean Swap the Mouse Wheel zoom direction +UserPreferencesView.zoom_to_mouse -> use_zoom_ato_mouse: boolean Zoom in towards the mouse pointer's position in the 3D view, rather than the 2D window center +UserSolidLight.enabled -> use: boolean Enable this OpenGL light in solid draw mode +VertexPaint.all_faces -> use_all_faces: boolean Paint on all faces inside brush +VertexPaint.normals -> use_normals: boolean Applies the vertex normal before painting +VertexPaint.spray -> use_spray: boolean Keep applying paint effect while holding mouse +VisibilityActuator.children -> show_occluded_children: boolean Set all the children of this object to the same visibility/occlusion recursively +VisibilityActuator.occlusion -> show_occluded: boolean Set the object to occlude objects behind it. Initialized from the object type in physics button +VisibilityActuator.visible -> show: boolean Set the objects visible. Initialized from the objects render restriction toggle (access in the outliner) +VoxelData.still -> use_still: boolean Always render a still frame from the voxel data sequence +WaveModifier.cyclic -> use_cyclic: boolean Cyclic wave effect +WaveModifier.normals -> show_normals: boolean Displace along normals +WaveModifier.x -> use_x: boolean X axis motion +WaveModifier.x_normal -> use_normal_x: boolean Enable displacement along the X normal +WaveModifier.y -> use_y: boolean Y axis motion +WaveModifier.y_normal -> use_normal_y: boolean Enable displacement along the Y normal +WaveModifier.z_normal -> use_normal_z: boolean Enable displacement along the Z normal +World.blend_sky -> use_sky_blend: boolean Render background with natural progression from horizon to zenith +World.paper_sky -> use_sky_paper: boolean Flatten blend or texture coordinates +World.real_sky -> use_sky_real: boolean Render background with a real horizon, relative to the camera angle +WorldLighting.falloff -> use_falloff: boolean +WorldLighting.pixel_cache -> use_ao_pixel_cache: boolean Cache AO results in pixels and interpolate over neighbouring pixels for speedup (for Approximate) +WorldLighting.use_ambient_occlusion -> use_ao: boolean Use Ambient Occlusion to add shadowing based on distance between objects +WorldLighting.use_environment_lighting -> use_environment_lighting: boolean Add light coming from the environment +WorldLighting.use_indirect_lighting -> use_indirect_lighting: boolean Add indirect light bouncing of surrounding objects +WorldMistSettings.use_mist -> use_mist: boolean Occlude objects with the environment color as they are further away +WorldStarsSettings.use_stars -> use_stars: boolean Enable starfield generation +WorldTextureSlot.map_blend -> use_map_blend: boolean Affect the color progression of the background +WorldTextureSlot.map_horizon -> use_map_horizon: boolean Affect the color of the horizon +WorldTextureSlot.map_zenith_down -> use_map_zenith_down: boolean Affect the color of the zenith below +WorldTextureSlot.map_zenith_up -> use_map_zenith_up: boolean Affect the color of the zenith above
\ No newline at end of file diff --git a/source/blender/makesrna/rna_cleanup/rna_cleaner.py b/source/blender/makesrna/rna_cleanup/rna_cleaner.py new file mode 100755 index 00000000000..4127861e1ce --- /dev/null +++ b/source/blender/makesrna/rna_cleanup/rna_cleaner.py @@ -0,0 +1,273 @@ +#! /usr/bin/env python3 + +""" +This script is used to help cleaning RNA api. + +Typical line in the input file (elements in [] are optional). + +[comment *] ToolSettings.snap_align_rotation -> use_snap_align_rotation: boolean [Align rotation with the snapping target] +""" + + +def font_bold(mystring): + """ + Formats the string as bold, to be used in printouts. + """ + font_bold = "\033[1m" + font_reset = "\033[0;0m" + return font_bold + mystring + font_reset + + +def usage(): + """ + Prints script usage. + """ + import sys + scriptname = sys.argv[0] + sort_choices_string = '|'.join(sort_choices) + message = "\nUSAGE:" + message += "\n%s input-file (.txt|.py) order-priority (%s).\n" % (font_bold(scriptname), sort_choices_string) + message += "%s -h for help\n" % font_bold(scriptname) + print(message) + exit() + + +def help(): + """ + Prints script' help. + """ + message = '\nHELP:' + message += '\nRun this script to re-format the edits you make in the input file.\n' + message += 'Do quick modification to important fields like \'to\' and don\'t care about fields like \'changed\' or \'description\' and save.\n' + message += 'The script outputs 3 files:\n' + message += ' 1) *_clean.txt: is formatted same as the .txt input, can be edited by user.\n' + message += ' 2) *_clean.py: is formatted same as the .py input, can be edited by user.\n' + message += ' 3) rna_api.py is not formatted for readability and go under complete check. Can be used for rna cleanup.\n' + print(message) + usage() + + +def check_commandline(): + """ + Takes parameters from the commandline. + """ + import sys + # Usage + if len(sys.argv)==1 or len(sys.argv)>3: + usage() + if sys.argv[1] == '-h': + help() + elif not (sys.argv[1][-4:] == '.txt' or sys.argv[1][-3:] == '.py'): + print ('\nBad input file extension... exiting.') + usage() + else: + inputfile = sys.argv[1] + if len(sys.argv) == 2: + sort_priority = default_sort_choice + print ('\nSecond parameter missing: choosing to order by %s.' % font_bold(sort_priority)) + elif len(sys.argv)==3: + sort_priority = sys.argv[2] + if sort_priority not in sort_choices: + print('\nWrong sort_priority... exiting.') + usage() + return (inputfile, sort_priority) + + +def check_prefix(prop): + # reminder: props=[comment, changed, bclass, bfrom, bto, kwcheck, btype, description] + if '_' in prop: + prefix = prop.split('_')[0] + if prefix not in kw_prefixes: + return 'BAD-PREFIX: ' + prefix + else: + return prefix + '_' + elif prop in kw: + return 'SPECIAL-KEYWORD: ' + prop + else: + return 'BAD-KEYWORD: ' + prop + + +def check_if_changed(a,b): + if a != b: return 'changed' + else: return 'same' + + +def get_props_from_txt(input_filename): + """ + If the file is *.txt, the script assumes it is formatted as outlined in this script docstring + """ + + file=open(input_filename,'r') + file_lines=file.readlines() + file.close() + + props_list=[] + props_length_max=[0,0,0,0,0,0,0,0] + for line in file_lines: + + # debug + #print(line) + + # empty line or comment + if not line.strip() or line.startswith('#'): + continue + + # class + [bclass, tail] = [x.strip() for x in line.split('.', 1)] + + # comment + if '*' in bclass: + [comment, bclass] = [x.strip() for x in bclass.split('*', 1)] + else: + comment= '' + + # skipping the header if we have one. + # the header is assumed to be "NOTE * CLASS.FROM -> TO: TYPE DESCRIPTION" + if comment == 'NOTE' and bclass == 'CLASS': + continue + + # from + [bfrom, tail] = [x.strip() for x in tail.split('->', 1)] + + # to + [bto, tail] = [x.strip() for x in tail.split(':', 1)] + + # type, description + try: + [btype, description] = tail.split(None, 1) + if '"' in description: + description.replace('"', "'") + except ValueError: + [btype, description] = [tail,'NO DESCRIPTION'] + + # keyword-check + kwcheck = check_prefix(bto) + + # changed + changed = check_if_changed(bfrom, bto) + + # lists formatting + props=[comment, changed, bclass, bfrom, bto, kwcheck, btype, description] + props_list.append(props) + props_length_max=list(map(max,zip(props_length_max,list(map(len,props))))) + + return (props_list,props_length_max) + + +def get_props_from_py(input_filename): + """ + If the file is *.py, the script assumes it contains a python list (as "rna_api=[...]") + This means that this script executes the text in the py file with an exec(text). + """ + # adds the list "rna_api" to this function's scope + rna_api = __import__(input_filename[:-3]).rna_api + + props_length_max = [0 for i in rna_api[0]] # this way if the vector will take more elements we are safe + for index,props in enumerate(rna_api): + [comment, changed, bclass, bfrom, bto, kwcheck, btype, description] = props + kwcheck = check_prefix(bto) # keyword-check + changed = check_if_changed(bfrom, bto) # changed? + rna_api[index] = [comment, changed, bclass, bfrom, bto, kwcheck, btype, description] + props_length = list(map(len,props)) # lengths + props_length_max = list(map(max,zip(props_length_max,props_length))) # max lengths + return (rna_api,props_length_max) + + +def get_props(input_filename): + if input_filename[-4:] == '.txt': + props_list,props_length_max = get_props_from_txt(input_filename) + elif input_filename[-3:] == '.py': + props_list,props_length_max = get_props_from_py(input_filename) + return (props_list,props_length_max) + + +def sort(props_list, sort_priority): + """ + reminder + props=[comment, changed, bclass, bfrom, bto, kwcheck, btype, description] + """ + + # order based on the i-th element in lists + i = sort_choices.index(sort_priority) + if i == 0: + props_list = sorted(props_list, key=lambda p: p[i], reverse=True) + else: + props_list = sorted(props_list, key=lambda p: p[i]) + + print ('\nSorted by %s.' % font_bold(sort_priority)) + return props_list + + +def file_basename(input_filename): + # if needed will use os.path + if input_filename[-4:] == '.txt': + if input_filename[-9:] == '_work.txt': + base_filename = input_filename[:-9] + else: + base_filename = input_filename[:-4] + elif input_filename[-3:] == '.py': + if input_filename[-8:] == '_work.py': + base_filename = input_filename[:-8] + else: + base_filename = input_filename[:-3] + return base_filename + + +def write_files(basename, props_list, props_length_max): + """ + Writes in 3 files: + * output_filename_work.txt: formatted as txt input file (can be edited) + * output_filename_work.py: formatted for readability (can be edited) + * rna_api.py: unformatted, just as final output + """ + + f_rna = open("rna_api.py",'w') + f_txt = open(basename + '_work.txt','w') + f_py = open(basename + '_work.py','w') + + # reminder: props=[comment, changed, bclass, bfrom, bto, kwcheck, btype, description] + # [comment *] ToolSettings.snap_align_rotation -> use_snap_align_rotation: boolean [Align rotation with the snapping target] + rna = py = txt = '' + props_list = [['NOTE', 'CHANGED', 'CLASS', 'FROM', 'TO', 'KEYWORD-CHECK', 'TYPE', 'DESCRIPTION']] + props_list + for props in props_list: + #txt + if props[0] != '': txt += '%s * ' % props[0] # comment + txt += '%s.%s -> %s: %s %s\n' % tuple(props[2:5] + props[6:]) # skipping keyword-check + # rna_api + if props[0] == 'NOTE': indent = '# ' + else: indent = ' ' + rna += indent + '("%s", "%s", "%s", "%s", "%s"),\n' % tuple(props[2:5] + props[6:]) + # py + if props[0] == 'NOTE': indent = '# ' + else: indent = ' ' + blanks = [' '* (x[0]-x[1]) for x in zip(props_length_max,list(map(len,props)))] + props = ['"%s"%s'%(x[0],x[1]) for x in zip(props,blanks)] + py += indent + '(%s, %s, %s, %s, %s, %s, %s, %s),\n' % tuple(props) + f_txt.write(txt) + f_py.write("rna_api = [\n%s]\n" % py) + f_rna.write("rna_api = [\n%s]\n" % rna) + + print ('\nSaved %s, %s and %s.\n' % (font_bold(f_txt.name), font_bold(f_py.name), font_bold(f_rna.name) ) ) + + +def main(): + + global sort_choices, default_sort_choice + global kw_prefixes, kw + + sort_choices = ['note','changed','class','from','to','kw'] + default_sort_choice = sort_choices[0] + kw_prefixes = ['invert','is','lock','show','show_only','use','use_only'] + kw = ['hide','select','layer','state'] + + input_filename, sort_priority = check_commandline() + props_list,props_length_max = get_props(input_filename) + props_list = sort(props_list,sort_priority) + + output_basename = file_basename(input_filename) + write_files(output_basename, props_list,props_length_max) + + +if __name__=='__main__': + main() + diff --git a/source/blender/modifiers/intern/MOD_build.c b/source/blender/modifiers/intern/MOD_build.c index 05ef85b818a..47693ba337e 100644 --- a/source/blender/modifiers/intern/MOD_build.c +++ b/source/blender/modifiers/intern/MOD_build.c @@ -41,6 +41,7 @@ #include "BKE_modifier.h" #include "BKE_object.h" #include "BKE_particle.h" +#include "BKE_scene.h" static void initData(ModifierData *md) @@ -106,7 +107,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, frac = bsystem_time(md->scene, ob, md->scene->r.cfra, bmd->start - 1.0f) / bmd->length; } else { - frac = md->scene->r.cfra - bmd->start / bmd->length; + frac = BKE_curframe(md->scene) - bmd->start / bmd->length; } CLAMP(frac, 0.0, 1.0); diff --git a/source/blender/modifiers/intern/MOD_collision.c b/source/blender/modifiers/intern/MOD_collision.c index af8e7605128..7f70bd8f709 100644 --- a/source/blender/modifiers/intern/MOD_collision.c +++ b/source/blender/modifiers/intern/MOD_collision.c @@ -40,6 +40,7 @@ #include "BKE_modifier.h" #include "BKE_object.h" #include "BKE_pointcache.h" +#include "BKE_scene.h" static void initData(ModifierData *md) @@ -119,7 +120,7 @@ static void deformVerts( CDDM_apply_vert_coords(dm, vertexCos); CDDM_calc_normals(dm); - current_time = bsystem_time (md->scene, ob, ( float ) md->scene->r.cfra, 0.0 ); + current_time = BKE_curframe(md->scene); if(G.rt > 0) printf("current_time %f, collmd->time %f\n", current_time, collmd->time); diff --git a/source/blender/modifiers/intern/MOD_explode.c b/source/blender/modifiers/intern/MOD_explode.c index a45ee19b68d..7d506ebfae0 100644 --- a/source/blender/modifiers/intern/MOD_explode.c +++ b/source/blender/modifiers/intern/MOD_explode.c @@ -39,13 +39,14 @@ #include "BLI_edgehash.h" #include "BKE_cdderivedmesh.h" +#include "BKE_deform.h" #include "BKE_lattice.h" #include "BKE_mesh.h" #include "BKE_modifier.h" #include "BKE_object.h" #include "BKE_particle.h" +#include "BKE_scene.h" #include "BKE_utildefines.h" -#include "BKE_deform.h" #include "MEM_guardedalloc.h" @@ -682,7 +683,7 @@ static DerivedMesh * explodeMesh(ExplodeModifierData *emd, timestep= psys_get_timestep(&sim); //if(part->flag & PART_GLOB_TIME) - cfra=bsystem_time(scene, 0,(float)scene->r.cfra,0.0); + cfra= BKE_curframe(scene); //else // cfra=bsystem_time(scene, ob,(float)scene->r.cfra,0.0); diff --git a/source/blender/modifiers/intern/MOD_meshdeform.c b/source/blender/modifiers/intern/MOD_meshdeform.c index 623f4a5ddeb..9ae86ac4ec0 100644 --- a/source/blender/modifiers/intern/MOD_meshdeform.c +++ b/source/blender/modifiers/intern/MOD_meshdeform.c @@ -227,7 +227,7 @@ static void meshdeformModifier_do( /* progress bar redraw can make this recursive .. */ if(!recursive) { recursive = 1; - mmd->bindfunc(md->scene, dm, mmd, (float*)vertexCos, numVerts, cagemat); + mmd->bindfunc(md->scene, mmd, (float*)vertexCos, numVerts, cagemat); recursive = 0; } } @@ -275,7 +275,7 @@ static void meshdeformModifier_do( defgrp_index = defgroup_name_index(ob, mmd->defgrp_name); - if (defgrp_index >= 0) + if(dm && defgrp_index >= 0) dvert= dm->getVertDataArray(dm, CD_MDEFORMVERT); /* do deformation */ @@ -343,14 +343,11 @@ static void deformVerts( { DerivedMesh *dm= get_dm(md->scene, ob, NULL, derivedData, NULL, 0);; - if(!dm) - return; - modifier_vgroup_cache(md, vertexCos); /* if next modifier needs original vertices */ meshdeformModifier_do(md, ob, dm, vertexCos, numVerts); - if(dm != derivedData) + if(dm && dm != derivedData) dm->release(dm); } @@ -358,16 +355,11 @@ static void deformVertsEM( ModifierData *md, Object *ob, struct EditMesh *editData, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts) { - DerivedMesh *dm; - - if(!derivedData && ob->type == OB_MESH) - dm = CDDM_from_editmesh(editData, ob->data); - else - dm = derivedData; + DerivedMesh *dm= get_dm(md->scene, ob, NULL, derivedData, NULL, 0);; meshdeformModifier_do(md, ob, dm, vertexCos, numVerts); - if(dm != derivedData) + if(dm && dm != derivedData) dm->release(dm); } diff --git a/source/blender/modifiers/intern/MOD_wave.c b/source/blender/modifiers/intern/MOD_wave.c index 23e13266d80..4b55d113536 100644 --- a/source/blender/modifiers/intern/MOD_wave.c +++ b/source/blender/modifiers/intern/MOD_wave.c @@ -38,6 +38,7 @@ #include "BKE_DerivedMesh.h" #include "BKE_object.h" #include "BKE_deform.h" +#include "BKE_scene.h" #include "depsgraph_private.h" @@ -247,7 +248,7 @@ static void waveModifier_do(WaveModifierData *md, MVert *mvert = NULL; MDeformVert *dvert = NULL; int defgrp_index; - float ctime = bsystem_time(scene, ob, (float)scene->r.cfra, 0.0); + float ctime = BKE_curframe(scene); float minfac = (float)(1.0 / exp(wmd->width * wmd->narrow * wmd->width * wmd->narrow)); float lifefac = wmd->height; diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_colorbalance.c b/source/blender/nodes/intern/CMP_nodes/CMP_colorbalance.c index b40b27e06ee..f2e5815dfeb 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_colorbalance.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_colorbalance.c @@ -56,8 +56,8 @@ DO_INLINE float colorbalance_cdl(float in, float offset, float power, float slop DO_INLINE float colorbalance_lgg(float in, float lift, float gamma, float gain) { - float x = gain*(in+(lift-1)*(1-in)); - + float x= powf(in * gain, lift); + /* prevent NaN */ if (x < 0.f) x = 0.f; @@ -88,10 +88,10 @@ static void do_colorbalance_cdl_fac(bNode *node, float* out, float *in, float *f static void do_colorbalance_lgg(bNode *node, float* out, float *in) { NodeColorBalance *n= (NodeColorBalance *)node->storage; - - out[0] = colorbalance_lgg(in[0], n->lift[0], n->gamma[0], n->gain[0]); - out[1] = colorbalance_lgg(in[1], n->lift[1], n->gamma[1], n->gain[1]); - out[2] = colorbalance_lgg(in[2], n->lift[2], n->gamma[2], n->gain[2]); + + out[0] = colorbalance_lgg(in[0], n->lift_lgg[0], n->gamma[0], n->gain[0]); + out[1] = colorbalance_lgg(in[1], n->lift_lgg[1], n->gamma[1], n->gain[1]); + out[2] = colorbalance_lgg(in[2], n->lift_lgg[2], n->gamma[2], n->gain[2]); out[3] = in[3]; } @@ -99,10 +99,10 @@ static void do_colorbalance_lgg_fac(bNode *node, float* out, float *in, float *f { NodeColorBalance *n= (NodeColorBalance *)node->storage; const float mfac= 1.0f - *fac; - - out[0] = mfac*in[0] + *fac * colorbalance_lgg(in[0], n->lift[0], n->gamma[0], n->gain[0]); - out[1] = mfac*in[1] + *fac * colorbalance_lgg(in[1], n->lift[1], n->gamma[1], n->gain[1]); - out[2] = mfac*in[2] + *fac * colorbalance_lgg(in[2], n->lift[2], n->gamma[2], n->gain[2]); + + out[0] = mfac*in[0] + *fac * colorbalance_lgg(in[0], n->lift_lgg[0], n->gamma[0], n->gain[0]); + out[1] = mfac*in[1] + *fac * colorbalance_lgg(in[1], n->lift_lgg[1], n->gamma[1], n->gain[1]); + out[2] = mfac*in[2] + *fac * colorbalance_lgg(in[2], n->lift_lgg[2], n->gamma[2], n->gain[2]); out[3] = in[3]; } @@ -119,7 +119,15 @@ static void node_composit_exec_colorbalance(void *data, bNode *node, bNodeStack out[0]->data = pass_on_compbuf(cbuf); return; } - + + { + NodeColorBalance *n= (NodeColorBalance *)node->storage; + int c; + for (c = 0; c < 3; c++) { + n->lift_lgg[c] = 2.0f - pow(n->lift[c], 2); + } + } + if (cbuf) { stackbuf= alloc_compbuf(cbuf->x, cbuf->y, CB_RGBA, 1); /* create output based on image input */ diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_defocus.c b/source/blender/nodes/intern/CMP_nodes/CMP_defocus.c index 4c515df34fb..a93a5760842 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_defocus.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_defocus.c @@ -242,11 +242,9 @@ static void defocus_blur(bNode *node, CompBuf *new, CompBuf *img, CompBuf *zbuf, CompBuf *crad; // CoC radius buffer BokehCoeffs BKH[8]; // bokeh shape data, here never > 8 pts. float bkh_b[4] = {0}; // shape 2D bound - unsigned int p, px, p4, zp, cp, cp4; - float *ctcol, u, v, iZ, ct_crad, lwt, wt=0, cR2=0; - float dof_sp, maxfgc, bk_hn_theta=0, inradsq=0; float cam_fdist=1, cam_invfdist=1, cam_lens=35; - int x, y, sx, sy, len_bkh=0; + float dof_sp, maxfgc, bk_hn_theta=0, inradsq=0; + int y, len_bkh=0, ydone=0; float aspect, aperture; int minsz; //float bcrad, nmaxc, scf; @@ -288,6 +286,8 @@ static void defocus_blur(bNode *node, CompBuf *new, CompBuf *img, CompBuf *zbuf, // to prevent *reaaallly* big radius values and impossible calculation times, // limit the maximum to half the image width or height, whichever is smaller float maxr = 0.5f*(float)MIN2(img->x, img->y); + unsigned int p; + for (p=0; p<(unsigned int)(img->x*img->y); p++) { crad->rect[p] = zbuf ? (zbuf->rect[p]*nqd->scale) : inpval; // bug #5921, limit minimum @@ -298,6 +298,8 @@ static void defocus_blur(bNode *node, CompBuf *new, CompBuf *img, CompBuf *zbuf, } } else { + float wt; + // actual zbuffer. // separate foreground from background CoC's // then blur background and blend in again with foreground, @@ -305,10 +307,11 @@ static void defocus_blur(bNode *node, CompBuf *new, CompBuf *img, CompBuf *zbuf, // wts buffer here used for blendmask maxfgc = 0.f; // maximum foreground CoC radius for (y=0; y<img->y; y++) { - p = y * img->x; + unsigned int p = y * img->x; + int x; for (x=0; x<img->x; x++) { - px = p + x; - iZ = (zbuf->rect[px]==0.f) ? 0.f : (1.f/zbuf->rect[px]); + unsigned int px = p + x; + float iZ = (zbuf->rect[px]==0.f) ? 0.f : (1.f/zbuf->rect[px]); crad->rect[px] = 0.5f*(aperture*(dof_sp*(cam_invfdist - iZ) - 1.f)); if (crad->rect[px] <= 0.f) { wts->rect[px] = 1.f; @@ -342,11 +345,13 @@ static void defocus_blur(bNode *node, CompBuf *new, CompBuf *img, CompBuf *zbuf, // and blend... for (y=0; y<img->y; y++) { - p = y*img->x; + unsigned int p = y*img->x; + int x; + for (x=0; x<img->x; x++) { - px = p + x; + unsigned px = p + x; if (zbuf->rect[px]!=0.f) { - iZ = (zbuf->rect[px]==0.f) ? 0.f : (1.f/zbuf->rect[px]); + float iZ = (zbuf->rect[px]==0.f) ? 0.f : (1.f/zbuf->rect[px]); // bug #6656 part 2b, do not rescale /* @@ -373,18 +378,30 @@ static void defocus_blur(bNode *node, CompBuf *new, CompBuf *img, CompBuf *zbuf, //------------------------------------------------------------------ // main loop + #pragma omp parallel for private(y) if(!nqd->preview && img->y*img->x > 16384) schedule(guided) for (y=0; y<img->y; y++) { + unsigned int p, p4, zp, cp, cp4; + float *ctcol, u, v, ct_crad, cR2=0; + int x, sx, sy; + // some sort of visual feedback would be nice, or at least this text in the renderwin header // but for now just print some info in the console every 8 scanlines. - if (((y & 7)==0) || (y==(img->y-1))) { - if(G.background==0) { - printf("\rdefocus: Processing Line %d of %d ... ", y+1, img->y); - fflush(stdout); + #pragma omp critical + { + if (((ydone & 7)==0) || (ydone==(img->y-1))) { + if(G.background==0) { + printf("\rdefocus: Processing Line %d of %d ... ", ydone+1, img->y); + fflush(stdout); + } } + + ydone++; } - // esc set by main calling process + + // esc set by main calling process. don't break because openmp doesn't + // allow it, just continue and do nothing if(node->exec & NODE_BREAK) - break; + continue; zp = y * img->x; for (x=0; x<img->x; x++) { @@ -412,6 +429,7 @@ static void defocus_blur(bNode *node, CompBuf *new, CompBuf *img, CompBuf *zbuf, if (!nqd->preview) { int xs, xe, ys, ye; float lwt, wtcol[4] = {0}, aacol[4] = {0}; + float wt; // shape weight if (nqd->bktype==0) // disk @@ -700,7 +718,7 @@ static void defocus_blur(bNode *node, CompBuf *new, CompBuf *img, CompBuf *zbuf, else { // sampled, simple rejection sampling here, good enough unsigned int maxsam, s, ui = BLI_rand()*BLI_rand(); - float wcor, cpr = BLI_frand(); + float wcor, cpr = BLI_frand(), lwt; if (no_zbuf) maxsam = nqd->samples; // no zbuffer input, use sample value directly else { @@ -749,8 +767,10 @@ static void defocus_blur(bNode *node, CompBuf *new, CompBuf *img, CompBuf *zbuf, // finally, normalize for (y=0; y<new->y; y++) { - p = y * new->x; - p4 = p * new->type; + unsigned int p = y * new->x; + unsigned int p4 = p * new->type; + int x; + for (x=0; x<new->x; x++) { float dv = (wts->rect[p]==0.f) ? 1.f : (1.f/wts->rect[p]); new->rect[p4] *= dv; diff --git a/source/blender/python/doc/examples/bpy.data.py b/source/blender/python/doc/examples/bpy.data.py new file mode 100644 index 00000000000..0c2a463c01b --- /dev/null +++ b/source/blender/python/doc/examples/bpy.data.py @@ -0,0 +1,28 @@ +import bpy + + +# print all objects +for obj in bpy.data.objects: + print(obj.name) + + +# print all scene names in a list +print(bpy.data.scenes.keys()) + + +# remove mesh Cube +if "Cube" in bpy.data.meshes: + mesh = bpy.data.meshes["Cube"] + print("removing mesh", mesh) + bpy.data.meshes.unlink(mesh) + + +# write images into a file next to the blend +file = open(bpy.data.filepath.replace(".blend", ".txt"), 'w') + +for image in bpy.data.images: + file.write("%s %dx%d\n" % (image.filepath, image.size[0], image.size[1])) + +file.close() + + diff --git a/source/blender/python/doc/sphinx_doc_gen.py b/source/blender/python/doc/sphinx_doc_gen.py index 758e495e7ed..9e667a4b7b2 100644 --- a/source/blender/python/doc/sphinx_doc_gen.py +++ b/source/blender/python/doc/sphinx_doc_gen.py @@ -179,7 +179,11 @@ def pyprop2sphinx(ident, fw, identifier, py_prop): ''' python property to sphinx ''' - fw(ident + ".. attribute:: %s\n\n" % identifier) + # readonly properties use "data" directive, variables use "attribute" directive + if py_prop.fset is None: + fw(ident + ".. data:: %s\n\n" % identifier) + else: + fw(ident + ".. attribute:: %s\n\n" % identifier) write_indented_lines(ident + " ", fw, py_prop.__doc__) if py_prop.fset is None: fw(ident + " (readonly)\n\n") @@ -303,7 +307,7 @@ def rna2sphinx(BASEPATH): if bpy.app.build_revision != "Unknown": version_string = version_string + " r" + bpy.app.build_revision - fw("project = 'Blender 3D'\n") + fw("project = 'Blender'\n") # fw("master_doc = 'index'\n") fw("copyright = u'Blender Foundation'\n") fw("version = '%s - UNSTABLE API'\n" % version_string) @@ -330,7 +334,7 @@ def rna2sphinx(BASEPATH): fw("\n") fw("This document is an API reference for Blender %s. built %s.\n" % (version_string, bpy.app.build_date)) fw("\n") - fw("An introduction to blender and python can be found at <http://wiki.blender.org/index.php/Dev:2.5/Py/API/Intro>\n") + fw("An introduction to Blender and Python can be found at <http://wiki.blender.org/index.php/Dev:2.5/Py/API/Intro>\n") fw("\n") fw("`A PDF version of this document is also available <blender_python_reference_250.pdf>`__\n") fw("\n") @@ -357,6 +361,7 @@ def rna2sphinx(BASEPATH): fw("\n") fw(".. toctree::\n") fw(" :maxdepth: 1\n\n") + fw(" bpy.data.rst\n\n") # note: not actually a module fw(" bpy.ops.rst\n\n") fw(" bpy.types.rst\n\n") @@ -398,8 +403,8 @@ def rna2sphinx(BASEPATH): filepath = os.path.join(BASEPATH, "bpy.ops.rst") file = open(filepath, "w") fw = file.write - fw("Blender Operators (bpy.ops)\n") - fw("===========================\n\n") + fw("Operators (bpy.ops)\n") + fw("===================\n\n") fw(".. toctree::\n") fw(" :glob:\n\n") fw(" bpy.ops.*\n\n") @@ -408,14 +413,37 @@ def rna2sphinx(BASEPATH): filepath = os.path.join(BASEPATH, "bpy.types.rst") file = open(filepath, "w") fw = file.write - fw("Blender Types (bpy.types)\n") - fw("=========================\n\n") + fw("Types (bpy.types)\n") + fw("=================\n\n") fw(".. toctree::\n") fw(" :glob:\n\n") fw(" bpy.types.*\n\n") file.close() + # not actually a module, only write this file so we + # can reference in the TOC + filepath = os.path.join(BASEPATH, "bpy.data.rst") + file = open(filepath, "w") + fw = file.write + fw("Data Access (bpy.data)\n") + fw("======================\n\n") + fw(".. module:: bpy\n") + fw("\n") + fw("This module is used for all blender/python access.\n") + fw("\n") + fw(".. literalinclude:: ../examples/bpy.data.py\n") + fw("\n") + fw(".. data:: data\n") + fw("\n") + fw(" Access to blenders internal data\n") + fw("\n") + fw(" :type: :class:`bpy.types.Main`\n") + file.close() + + EXAMPLE_SET_USED.add("bpy.data") + + # python modules from bpy import utils as module pymodule2sphinx(BASEPATH, "bpy.utils", module, "Utilities (bpy.utils)") @@ -436,7 +464,7 @@ def rna2sphinx(BASEPATH): del module import blf as module - pymodule2sphinx(BASEPATH, "blf", module, "Blender Font Drawing (blf)") + pymodule2sphinx(BASEPATH, "blf", module, "Font Drawing (blf)") del module # game engine @@ -535,12 +563,21 @@ def rna2sphinx(BASEPATH): fw(".. class:: %s\n\n" % struct.identifier) fw(" %s\n\n" % struct.description) - - for prop in struct.properties: - fw(" .. attribute:: %s\n\n" % prop.identifier) + + # properties sorted in alphabetical order + zip_props_ids = zip(struct.properties, [prop.identifier for prop in struct.properties]) + zip_props_ids = sorted(zip_props_ids, key=lambda p: p[1]) + sorted_struct_properties = [x[0] for x in zip_props_ids] + + for prop in sorted_struct_properties: + type_descr = prop.get_type_description(class_fmt=":class:`%s`") + # readonly properties use "data" directive, variables properties use "attribute" directive + if 'readonly' in type_descr: + fw(" .. data:: %s\n\n" % prop.identifier) + else: + fw(" .. attribute:: %s\n\n" % prop.identifier) if prop.description: fw(" %s\n\n" % prop.description) - type_descr = prop.get_type_description(class_fmt=":class:`%s`") fw(" :type: %s\n\n" % type_descr) # python attributes diff --git a/source/blender/python/doc/sphinx_doc_gen.sh b/source/blender/python/doc/sphinx_doc_gen.sh index 03fe9a2efec..4f5f55af2bd 100755 --- a/source/blender/python/doc/sphinx_doc_gen.sh +++ b/source/blender/python/doc/sphinx_doc_gen.sh @@ -8,7 +8,7 @@ SSH_HOST="ideasman42@emo.blender.org" SSH_UPLOAD="/data/www/vhosts/www.blender.org/documentation/250PythonDoc" # dont delete existing docs, now partial updates are used for quick builds. -$BLENDER -b -P ./source/blender/python/doc/sphinx_doc_gen.py +$BLENDER --background --python ./source/blender/python/doc/sphinx_doc_gen.py # html sphinx-build source/blender/python/doc/sphinx-in source/blender/python/doc/sphinx-out diff --git a/source/blender/python/generic/bgl.c b/source/blender/python/generic/bgl.c index 806b5a5b3ce..ae19db28011 100644 --- a/source/blender/python/generic/bgl.c +++ b/source/blender/python/generic/bgl.c @@ -322,20 +322,20 @@ static int Buffer_ass_item(PyObject *self, int i, PyObject *v) } if (buf->type==GL_BYTE) { - if (!PyArg_Parse(v, "b;Coordinates must be ints", &buf->buf.asbyte[i])) + if (!PyArg_Parse(v, "b:Coordinates must be ints", &buf->buf.asbyte[i])) return -1; } else if (buf->type==GL_SHORT) { - if (!PyArg_Parse(v, "h;Coordinates must be ints", &buf->buf.asshort[i])) + if (!PyArg_Parse(v, "h:Coordinates must be ints", &buf->buf.asshort[i])) return -1; } else if (buf->type==GL_INT) { - if (!PyArg_Parse(v, "i;Coordinates must be ints", &buf->buf.asint[i])) + if (!PyArg_Parse(v, "i:Coordinates must be ints", &buf->buf.asint[i])) return -1; } else if (buf->type==GL_FLOAT) { - if (!PyArg_Parse(v, "f;Coordinates must be floats", &buf->buf.asfloat[i])) + if (!PyArg_Parse(v, "f:Coordinates must be floats", &buf->buf.asfloat[i])) return -1; } else if (buf->type==GL_DOUBLE) { - if (!PyArg_Parse(v, "d;Coordinates must be floats", &buf->buf.asdouble[i])) + if (!PyArg_Parse(v, "d:Coordinates must be floats", &buf->buf.asdouble[i])) return -1; } return 0; diff --git a/source/blender/python/generic/blf_api.c b/source/blender/python/generic/blf_api.c index 67f07ad8378..db3ce06554e 100644 --- a/source/blender/python/generic/blf_api.c +++ b/source/blender/python/generic/blf_api.c @@ -46,7 +46,7 @@ static PyObject *py_blf_position(PyObject *self, PyObject *args) int fontid; float x, y, z; - if (!PyArg_ParseTuple(args, "ifff:BLF.position", &fontid, &x, &y, &z)) + if (!PyArg_ParseTuple(args, "ifff:blf.position", &fontid, &x, &y, &z)) return NULL; BLF_position(fontid, x, y, z); @@ -71,7 +71,7 @@ static PyObject *py_blf_size(PyObject *self, PyObject *args) { int fontid, size, dpi; - if (!PyArg_ParseTuple(args, "iii:BLF.size", &fontid, &size, &dpi)) + if (!PyArg_ParseTuple(args, "iii:blf.size", &fontid, &size, &dpi)) return NULL; BLF_size(fontid, size, dpi); @@ -95,7 +95,7 @@ static PyObject *py_blf_aspect(PyObject *self, PyObject *args) float aspect; int fontid; - if (!PyArg_ParseTuple(args, "if:BLF.aspect", &fontid, &aspect)) + if (!PyArg_ParseTuple(args, "if:blf.aspect", &fontid, &aspect)) return NULL; BLF_aspect(fontid, aspect); @@ -118,7 +118,7 @@ static PyObject *py_blf_blur(PyObject *self, PyObject *args) { int blur, fontid; - if (!PyArg_ParseTuple(args, "ii:BLF.blur", &fontid, &blur)) + if (!PyArg_ParseTuple(args, "ii:blf.blur", &fontid, &blur)) return NULL; BLF_blur(fontid, blur); @@ -142,7 +142,7 @@ static PyObject *py_blf_draw(PyObject *self, PyObject *args) char *text; int fontid; - if (!PyArg_ParseTuple(args, "is:BLF.draw", &fontid, &text)) + if (!PyArg_ParseTuple(args, "is:blf.draw", &fontid, &text)) return NULL; BLF_draw(fontid, text); @@ -169,7 +169,7 @@ static PyObject *py_blf_dimensions(PyObject *self, PyObject *args) PyObject *ret; int fontid; - if (!PyArg_ParseTuple(args, "is:BLF.dimensions", &fontid, &text)) + if (!PyArg_ParseTuple(args, "is:blf.dimensions", &fontid, &text)) return NULL; BLF_width_and_height(fontid, text, &r_width, &r_height); @@ -201,7 +201,7 @@ static PyObject *py_blf_clipping(PyObject *self, PyObject *args) float xmin, ymin, xmax, ymax; int fontid; - if (!PyArg_ParseTuple(args, "iffff:BLF.clipping", &fontid, &xmin, &ymin, &xmax, &ymax)) + if (!PyArg_ParseTuple(args, "iffff:blf.clipping", &fontid, &xmin, &ymin, &xmax, &ymax)) return NULL; BLF_clipping(fontid, xmin, ymin, xmax, ymax); @@ -223,7 +223,7 @@ static PyObject *py_blf_disable(PyObject *self, PyObject *args) { int option, fontid; - if (!PyArg_ParseTuple(args, "ii:BLF.disable", &fontid, &option)) + if (!PyArg_ParseTuple(args, "ii:blf.disable", &fontid, &option)) return NULL; BLF_disable(fontid, option); @@ -245,7 +245,7 @@ static PyObject *py_blf_enable(PyObject *self, PyObject *args) { int option, fontid; - if (!PyArg_ParseTuple(args, "ii:BLF.enable", &fontid, &option)) + if (!PyArg_ParseTuple(args, "ii:blf.enable", &fontid, &option)) return NULL; BLF_enable(fontid, option); @@ -268,7 +268,7 @@ static PyObject *py_blf_rotation(PyObject *self, PyObject *args) float angle; int fontid; - if (!PyArg_ParseTuple(args, "if:BLF.rotation", &fontid, &angle)) + if (!PyArg_ParseTuple(args, "if:blf.rotation", &fontid, &angle)) return NULL; BLF_rotation(fontid, angle); @@ -299,7 +299,7 @@ static PyObject *py_blf_shadow(PyObject *self, PyObject *args) int level, fontid; float r, g, b, a; - if (!PyArg_ParseTuple(args, "iiffff:BLF.shadow", &fontid, &level, &r, &g, &b, &a)) + if (!PyArg_ParseTuple(args, "iiffff:blf.shadow", &fontid, &level, &r, &g, &b, &a)) return NULL; if (level != 0 && level != 3 && level != 5) { @@ -328,7 +328,7 @@ static PyObject *py_blf_shadow_offset(PyObject *self, PyObject *args) { int x, y, fontid; - if (!PyArg_ParseTuple(args, "iii:BLF.shadow_offset", &fontid, &x, &y)) + if (!PyArg_ParseTuple(args, "iii:blf.shadow_offset", &fontid, &x, &y)) return NULL; BLF_shadow_offset(fontid, x, y); diff --git a/source/blender/python/generic/bpy_internal_import.c b/source/blender/python/generic/bpy_internal_import.c index 01d0f56bf1b..0b5129b79fa 100644 --- a/source/blender/python/generic/bpy_internal_import.c +++ b/source/blender/python/generic/bpy_internal_import.c @@ -237,16 +237,11 @@ static PyObject *blender_import( PyObject * self, PyObject * args, PyObject * k * our reload() module, to handle reloading in-memory scripts */ -static PyObject *blender_reload( PyObject * self, PyObject * args ) +static PyObject *blender_reload( PyObject * self, PyObject * module ) { PyObject *exception, *err, *tb; - PyObject *module = NULL; PyObject *newmodule = NULL; int found= 0; - - /* check for a module arg */ - if( !PyArg_ParseTuple( args, "O:bpy_reload_meth", &module ) ) - return NULL; /* try reimporting from file */ newmodule = PyImport_ReloadModule( module ); @@ -280,7 +275,7 @@ static PyObject *blender_reload( PyObject * self, PyObject * args ) } PyMethodDef bpy_import_meth[] = { {"bpy_import_meth", (PyCFunction)blender_import, METH_VARARGS | METH_KEYWORDS, "blenders import"} }; -PyMethodDef bpy_reload_meth[] = { {"bpy_reload_meth", (PyCFunction)blender_reload, METH_VARARGS, "blenders reload"} }; +PyMethodDef bpy_reload_meth[] = { {"bpy_reload_meth", (PyCFunction)blender_reload, METH_O, "blenders reload"} }; /* Clear user modules. diff --git a/source/blender/python/intern/bpy.c b/source/blender/python/intern/bpy.c index e94f9b517a8..4763f555937 100644 --- a/source/blender/python/intern/bpy.c +++ b/source/blender/python/intern/bpy.c @@ -147,7 +147,7 @@ void BPy_init_modules( void ) PyObject *mod; /* Needs to be first since this dir is needed for future modules */ - char *modpath= BLI_gethome_folder("scripts/modules", BLI_GETHOME_ALL); + char *modpath= BLI_get_folder(BLENDER_SCRIPTS, "modules"); if(modpath) { // printf("bpy: found module path '%s'.\n", modpath); PyObject *sys_path= PySys_GetObject("path"); /* borrow */ diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index 680c5165575..6a1495b5f65 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -177,7 +177,7 @@ static PyObject *CreateGlobalDictionary( bContext *C, const char *filename ) /* must be called before Py_Initialize */ void BPY_start_python_path(void) { - char *py_path_bundle= BLI_gethome_folder("python", BLI_GETHOME_ALL); + char *py_path_bundle= BLI_get_folder(BLENDER_PYTHON, NULL); if(py_path_bundle==NULL) return; @@ -231,6 +231,8 @@ void BPY_start_python( int argc, char **argv ) BPY_start_python_path(); /* allow to use our own included python */ + // Py_SetProgramName(); // extern char bprogname[FILE_MAXDIR+FILE_MAXFILE]; + Py_Initialize( ); // PySys_SetArgv( argc, argv); // broken in py3, not a huge deal diff --git a/source/blender/readblenfile/intern/BLO_readblenfile.c b/source/blender/readblenfile/intern/BLO_readblenfile.c index 608c8fccd18..7c876c96a86 100644 --- a/source/blender/readblenfile/intern/BLO_readblenfile.c +++ b/source/blender/readblenfile/intern/BLO_readblenfile.c @@ -36,6 +36,7 @@ #include <stdlib.h> #include <string.h> #include <fcntl.h> +#include <errno.h> #ifdef WIN32 #include <io.h> // read, open @@ -136,7 +137,7 @@ blo_read_runtime( fd= open(path, O_BINARY|O_RDONLY, 0); if (fd==-1) { - BKE_report(reports, RPT_ERROR, "Unable to open"); + BKE_reportf(reports, RPT_ERROR, "Unable to open \"%s\": %s.", path, strerror(errno)); goto cleanup; } @@ -146,13 +147,13 @@ blo_read_runtime( datastart= handle_read_msb_int(fd); if (datastart==-1) { - BKE_report(reports, RPT_ERROR, "Unable to read"); + BKE_reportf(reports, RPT_ERROR, "Unable to read \"%s\" (problem seeking)", path); goto cleanup; } else if (read(fd, buf, 8)!=8) { - BKE_report(reports, RPT_ERROR, "Unable to read"); + BKE_reportf(reports, RPT_ERROR, "Unable to read \"%s\" (truncated header)", path); goto cleanup; } else if (memcmp(buf, "BRUNTIME", 8)!=0) { - BKE_report(reports, RPT_ERROR, "File is not a Blender file"); + BKE_reportf(reports, RPT_ERROR, "Unable to read \"%s\" (not a blend file)", path); goto cleanup; } else { //printf("starting to read runtime from %s at datastart %d\n", path, datastart); diff --git a/source/blender/render/CMakeLists.txt b/source/blender/render/CMakeLists.txt index 2f029feec2f..c78e09dae10 100644 --- a/source/blender/render/CMakeLists.txt +++ b/source/blender/render/CMakeLists.txt @@ -54,10 +54,6 @@ IF(APPLE) ENDIF(CMAKE_OSX_ARCHITECTURES MATCHES "i386" OR CMAKE_OSX_ARCHITECTURES MATCHES "x86_64") ENDIF(APPLE) -IF(WITH_RAYOPTIMIZATION) - ADD_DEFINITIONS(-D__SSE__) -ENDIF(WITH_RAYOPTIMIZATION) - #TODO #if env['OURPLATFORM']=='linux2': # cflags='-pthread' diff --git a/source/blender/render/intern/include/render_types.h b/source/blender/render/intern/include/render_types.h index c24bd37defd..62a82dafbe2 100644 --- a/source/blender/render/intern/include/render_types.h +++ b/source/blender/render/intern/include/render_types.h @@ -189,7 +189,8 @@ struct Render ListBase strandsurface; /* use this instead of R.r.cfra */ - float cfra; + float cfra; + float mblur_offs, field_offs; /* render database */ int totvlak, totvert, tothalo, totstrand, totlamp; diff --git a/source/blender/render/intern/include/texture.h b/source/blender/render/intern/include/texture.h index 3e6fc8c5677..436b365b352 100644 --- a/source/blender/render/intern/include/texture.h +++ b/source/blender/render/intern/include/texture.h @@ -40,7 +40,13 @@ if(texres->tr<0.0) texres->tr= 0.0; \ texres->tg= tex->gfac*((texres->tg-0.5)*tex->contrast+tex->bright-0.5); \ if(texres->tg<0.0) texres->tg= 0.0; \ texres->tb= tex->bfac*((texres->tb-0.5)*tex->contrast+tex->bright-0.5); \ -if(texres->tb<0.0) texres->tb= 0.0; +if(texres->tb<0.0) texres->tb= 0.0; \ +if(tex->saturation != 1.0f) { \ + float _hsv[3]; \ + rgb_to_hsv(texres->tr, texres->tg, texres->tb, _hsv, _hsv+1, _hsv+2); \ + _hsv[1] *= tex->saturation; \ + hsv_to_rgb(_hsv[0], _hsv[1], _hsv[2], &texres->tr, &texres->tg, &texres->tb); \ +} \ struct HaloRen; diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index deb3d99f9ed..c3034768a4e 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -851,25 +851,23 @@ static void autosmooth(Render *re, ObjectRen *obr, float mat[][4], int degr) static float *get_object_orco(Render *re, Object *ob) { float *orco; - + if (!re->orco_hash) re->orco_hash = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "get_object_orco gh"); - + orco = BLI_ghash_lookup(re->orco_hash, ob); - + if (!orco) { if (ELEM(ob->type, OB_CURVE, OB_FONT)) { orco = make_orco_curve(re->scene, ob); } else if (ob->type==OB_SURF) { orco = make_orco_surf(ob); - } else if (ob->type==OB_MBALL) { - orco = make_orco_mball(ob); } - + if (orco) BLI_ghash_insert(re->orco_hash, ob, orco); } - + return orco; } @@ -1520,7 +1518,7 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem RNG *rng= 0; float loc[3],loc1[3],loc0[3],mat[4][4],nmat[3][3],co[3],nor[3],time; float strandlen=0.0f, curlen=0.0f; - float hasize, pa_size, r_tilt, r_length, cfra=bsystem_time(re->scene, ob, (float)re->scene->r.cfra, 0.0); + float hasize, pa_size, r_tilt, r_length, cfra= BKE_curframe(re->scene); float pa_time, pa_birthtime, pa_dietime; float random, simplify[2]; int i, a, k, max_k=0, totpart, dosimplify = 0, dosurfacecache = 0; @@ -1639,7 +1637,7 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem if(part->flag & PART_GLOB_TIME) #endif // XXX old animation system - cfra = bsystem_time(re->scene, 0, (float)re->scene->r.cfra, 0.0); + cfra = BKE_curframe(re->scene); ///* 2.4 setup reactors */ // if(part->type == PART_REACTOR){ @@ -2369,6 +2367,7 @@ static void init_render_mball(Render *re, ObjectRen *obr) Material *ma; float *data, *nors, *orco, mat[4][4], imat[3][3], xn, yn, zn; int a, need_orco, vlakindex, *index; + ListBase dispbase= {NULL, NULL}; if (ob!=find_basis_mball(re->scene, ob)) return; @@ -2383,14 +2382,22 @@ static void init_render_mball(Render *re, ObjectRen *obr) if(ma->texco & TEXCO_ORCO) { need_orco= 1; } - - makeDispListMBall(re->scene, ob); - dl= ob->disp.first; + + makeDispListMBall_forRender(re->scene, ob, &dispbase); + dl= dispbase.first; if(dl==0) return; data= dl->verts; nors= dl->nors; - orco= get_object_orco(re, ob); + if(need_orco) { + orco= get_object_orco(re, ob); + + if (!orco) { + /* orco hasn't been found in cache - create new one and add to cache */ + orco= make_orco_mball(ob, &dispbase); + set_object_orco(re, ob, orco); + } + } for(a=0; a<dl->nr; a++, data+=3, nors+=3, orco+=3) { @@ -2447,10 +2454,7 @@ static void init_render_mball(Render *re, ObjectRen *obr) } /* enforce display lists remade */ - freedisplist(&ob->disp); - - /* this enforces remake for real, orco displist is small (in scale) */ - ob->recalc |= OB_RECALC_DATA; + freedisplist(&dispbase); } /* ------------------------------------------------------------------------- */ @@ -4545,7 +4549,6 @@ static void init_render_object(Render *re, Object *ob, Object *par, DupliObject void RE_Database_Free(Render *re) { - Object *ob = NULL; LampRen *lar; /* statistics for debugging render memory usage */ @@ -4572,21 +4575,8 @@ void RE_Database_Free(Render *re) BLI_freelistN(&re->lights); free_renderdata_tables(re); - - /* free orco. check all objects because of duplis and sets */ - ob= G.main->object.first; - while(ob) { - if(ob->type==OB_MBALL) { - if(ob->disp.first && ob->disp.first!=ob->disp.last) { - DispList *dl= ob->disp.first; - BLI_remlink(&ob->disp, dl); - freedisplist(&ob->disp); - BLI_addtail(&ob->disp, dl); - } - } - ob= ob->id.next; - } + /* free orco */ free_mesh_orco_hash(re); #if 0 /* radio can be redone better */ end_radio_render(); @@ -4969,6 +4959,11 @@ void RE_Database_FromScene(Render *re, Scene *scene, unsigned int lay, int use_c /* if no camera, viewmat should have been set! */ if(use_camera_view && re->scene->camera) { + /* called before but need to call again incase of lens animation from the + * above call to scene_update_for_newframe, fixes bug. [#22702]. + * following calls dont depend on 'RE_SetCamera' */ + RE_SetCamera(re, scene->camera); + normalize_m4(re->scene->camera->obmat); invert_m4_m4(mat, re->scene->camera->obmat); RE_SetView(re, mat); diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index cea4288f03c..9033729652e 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -1307,6 +1307,8 @@ void RE_InitState(Render *re, Render *source, RenderData *rd, SceneRenderLayer * /* we clip faces with a minimum of 2 pixel boundary outside of image border. see zbuf.c */ re->clipcrop= 1.0f + 2.0f/(float)(re->winx>re->winy?re->winy:re->winx); + re->mblur_offs = re->field_offs = 0.f; + RE_init_threadcount(re); } @@ -1768,6 +1770,7 @@ static void do_render_3d(Render *re) /* internal */ // re->cfra= cfra; /* <- unused! */ + re->scene->r.subframe = re->mblur_offs + re->field_offs; /* make render verts/faces/halos/lamps */ if(render_scene_needs_vector(re)) @@ -1789,6 +1792,8 @@ static void do_render_3d(Render *re) /* free all render verts etc */ RE_Database_Free(re); + + re->scene->r.subframe = 0.f; } /* called by blur loop, accumulate RGBA key alpha */ @@ -1888,7 +1893,7 @@ static void do_render_blur_3d(Render *re) /* do the blur steps */ while(blur--) { - set_mblur_offs( re->r.blurfac*((float)(re->r.mblur_samples-blur))/(float)re->r.mblur_samples ); + re->mblur_offs = re->r.blurfac*((float)(re->r.mblur_samples-blur))/(float)re->r.mblur_samples; re->i.curblur= re->r.mblur_samples-blur; /* stats */ @@ -1906,7 +1911,7 @@ static void do_render_blur_3d(Render *re) re->result= rres; BLI_rw_mutex_unlock(&re->resultmutex); - set_mblur_offs(0.0f); + re->mblur_offs = 0.0f; re->i.curblur= 0; /* stats */ /* weak... the display callback wants an active renderlayer pointer... */ @@ -1986,15 +1991,17 @@ static void do_render_fields_3d(Render *re) re->i.curfield= 2; /* stats */ re->flag |= R_SEC_FIELD; - if((re->r.mode & R_FIELDSTILL)==0) - set_field_offs(0.5f); + if((re->r.mode & R_FIELDSTILL)==0) { + re->field_offs = 0.5f; + } RE_SetCamera(re, re->scene->camera); if(re->r.mode & R_MBLUR) do_render_blur_3d(re); else do_render_3d(re); re->flag &= ~R_SEC_FIELD; - set_field_offs(0.0f); + + re->field_offs = 0.0f; rr2= re->result; } @@ -2522,7 +2529,7 @@ static void do_render_seq(Render * re) if(recurs_depth==0) { /* otherwise sequencer animation isnt updated */ - BKE_animsys_evaluate_all_animation(G.main, (float)cfra); // XXX, was frame_to_float(re->scene, cfra) + BKE_animsys_evaluate_all_animation(G.main, (float)cfra); // XXX, was BKE_curframe(re->scene) } recurs_depth++; @@ -2822,7 +2829,7 @@ void RE_BlenderFrame(Render *re, Scene *scene, SceneRenderLayer *srl, unsigned i MEM_reset_peak_memory(); do_render_all_options(re); } - + /* UGLY WARNING */ G.rendering= 0; } @@ -3030,7 +3037,7 @@ void RE_BlenderAnim(Render *re, Scene *scene, unsigned int lay, int sfra, int ef mh->end_movie(); scene->r.cfra= cfrao; - + /* UGLY WARNING */ G.rendering= 0; } diff --git a/source/blender/render/intern/source/pointdensity.c b/source/blender/render/intern/source/pointdensity.c index 6ae9038437b..4f86f67f0e3 100644 --- a/source/blender/render/intern/source/pointdensity.c +++ b/source/blender/render/intern/source/pointdensity.c @@ -39,6 +39,7 @@ #include "BKE_main.h" #include "BKE_object.h" #include "BKE_particle.h" +#include "BKE_scene.h" #include "BKE_texture.h" #include "DNA_meshdata_types.h" @@ -95,7 +96,7 @@ static void pointdensity_cache_psys(Render *re, PointDensity *pd, Object *ob, Pa ParticleKey state; ParticleSimulationData sim = {re->scene, ob, psys, NULL}; ParticleData *pa=NULL; - float cfra = bsystem_time(re->scene, ob, (float)re->scene->r.cfra, 0.0); + float cfra = BKE_curframe(re->scene); int i, childexists; int total_particles, offset=0; int data_used = point_data_used(pd); diff --git a/source/blender/render/intern/source/rayshade.c b/source/blender/render/intern/source/rayshade.c index bdc1dcc2782..ed52f37fcfa 100644 --- a/source/blender/render/intern/source/rayshade.c +++ b/source/blender/render/intern/source/rayshade.c @@ -241,7 +241,9 @@ RayObject* makeraytree_object(Render *re, ObjectInstanceRen *obi) if(is_raytraceable_vlr(re, vlr)) faces++; } - assert( faces > 0 ); + + if (faces == 0) + return NULL; //Create Ray cast accelaration structure raytree = RE_rayobject_create( re, re->r.raytrace_structure, faces ); @@ -375,7 +377,8 @@ static void makeraytree_single(Render *re) if(test_break(re)) break; - RE_rayobject_add( re->raytree, obj ); + if (obj) + RE_rayobject_add( re->raytree, obj ); } else { diff --git a/source/blender/render/intern/source/texture.c b/source/blender/render/intern/source/texture.c index 9b087900734..e982c1a12a7 100644 --- a/source/blender/render/intern/source/texture.c +++ b/source/blender/render/intern/source/texture.c @@ -98,7 +98,7 @@ void init_render_texture(Render *re, Tex *tex) if(tex->type==TEX_PLUGIN) { if(tex->plugin && tex->plugin->doit) { if(tex->plugin->cfra) { - *(tex->plugin->cfra)= (float)cfra; //frame_to_float(re->scene, cfra); // XXX old animsys - timing stuff to be fixed + *(tex->plugin->cfra)= (float)cfra; //BKE_curframe(re->scene); // XXX old animsys - timing stuff to be fixed } } } diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index dbbe1312f0a..78ea0350667 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -234,6 +234,15 @@ void WM_operator_properties_select_all(struct wmOperatorType *ot); #define SEL_DESELECT 2 #define SEL_INVERT 3 + +/* flags for WM_operator_properties_filesel */ +#define WM_FILESEL_RELPATH (1 << 0) + +#define WM_FILESEL_DIRECTORY (1 << 1) +#define WM_FILESEL_FILENAME (1 << 2) +#define WM_FILESEL_FILEPATH (1 << 3) + + /* operator as a python command (resultuing string must be free'd) */ char *WM_operator_pystring(struct bContext *C, struct wmOperatorType *ot, struct PointerRNA *opptr, int all_args); void WM_operator_bl_idname(char *to, const char *from); @@ -316,8 +325,8 @@ void WM_jobs_callbacks(struct wmJob *, void (*endjob)(void *)); void WM_jobs_start(struct wmWindowManager *wm, struct wmJob *); -void WM_jobs_stop(struct wmWindowManager *wm, void *owner); -void WM_jobs_kill(struct wmWindowManager *wm, void *owner); +void WM_jobs_stop(struct wmWindowManager *wm, void *owner, void *startjob); +void WM_jobs_kill(struct wmWindowManager *wm, void *owner, void *startjob); void WM_jobs_stop_all(struct wmWindowManager *wm); /* clipboard */ diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h index 067df17917d..c84a5e64889 100644 --- a/source/blender/windowmanager/WM_types.h +++ b/source/blender/windowmanager/WM_types.h @@ -183,6 +183,7 @@ typedef struct wmNotifier { #define ND_KEYINGSET (12<<16) #define ND_TOOLSETTINGS (13<<16) #define ND_LAYER (14<<16) +#define ND_FRAME_RANGE (15<<16) /* NC_OBJECT Object */ #define ND_TRANSFORM (16<<16) @@ -325,6 +326,7 @@ typedef struct wmEvent { short prevval; short prevx, prevy; double prevclicktime; + short prevclickx, prevclicky; /* modifier states */ short shift, ctrl, alt, oskey; /* oskey is apple or windowskey, value denotes order of pressed */ diff --git a/source/blender/windowmanager/intern/wm_draw.c b/source/blender/windowmanager/intern/wm_draw.c index d2afef3b117..5dbbf35796f 100644 --- a/source/blender/windowmanager/intern/wm_draw.c +++ b/source/blender/windowmanager/intern/wm_draw.c @@ -682,7 +682,7 @@ static int wm_automatic_draw_method(wmWindow *win) /* Windows software driver darkens color on each redraw */ else if(GPU_type_matches(GPU_DEVICE_SOFTWARE, GPU_OS_WIN, GPU_DRIVER_SOFTWARE)) return USER_DRAW_OVERLAP_FLIP; - else if(!GPU_24bit_color_support()) + else if(GPU_color_depth() < 24) return USER_DRAW_OVERLAP; else return USER_DRAW_TRIPLE; diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 330244e910e..b01d2b27364 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -1219,7 +1219,6 @@ static int wm_handler_fileselect_call(bContext *C, ListBase *handlers, wmEventHa { /* XXX validate area and region? */ bScreen *screen= CTX_wm_screen(C); - char *path= RNA_string_get_alloc(handler->op->ptr, "filepath", NULL, 0); if(screen != handler->filescreen) ED_screen_full_prevspace(C, CTX_wm_area(C)); @@ -1238,8 +1237,11 @@ static int wm_handler_fileselect_call(bContext *C, ListBase *handlers, wmEventHa /* XXX also extension code in image-save doesnt work for this yet */ if (RNA_struct_find_property(handler->op->ptr, "check_existing") && RNA_boolean_get(handler->op->ptr, "check_existing")) { + char *path= RNA_string_get_alloc(handler->op->ptr, "filepath", NULL, 0); /* this gives ownership to pupmenu */ uiPupMenuSaveOver(C, handler->op, (path)? path: ""); + if(path) + MEM_freeN(path); } else { int retval; @@ -1299,8 +1301,6 @@ static int wm_handler_fileselect_call(bContext *C, ListBase *handlers, wmEventHa CTX_wm_area_set(C, NULL); wm_event_free_handler(handler); - if(path) - MEM_freeN(path); action= WM_HANDLER_BREAK; } @@ -1433,6 +1433,8 @@ static int wm_handlers_do(bContext *C, wmEvent *event, ListBase *handlers) /* test for double click first */ if ((PIL_check_seconds_timer() - win->eventstate->prevclicktime) * 1000 < U.dbl_click_time) { event->val = KM_DBL_CLICK; + event->x = win->eventstate->prevclickx; + event->y = win->eventstate->prevclicky; action |= wm_handlers_do(C, event, handlers); } @@ -1719,6 +1721,8 @@ void wm_event_do_handlers(bContext *C) /* set click time on first click (press -> release) */ if (win->eventstate->prevval == KM_PRESS && event->val == KM_RELEASE) { win->eventstate->prevclicktime = PIL_check_seconds_timer(); + win->eventstate->prevclickx = event->x; + win->eventstate->prevclicky = event->y; } } else { /* reset click time if event type not the same */ @@ -1731,6 +1735,8 @@ void wm_event_do_handlers(bContext *C) win->eventstate->prevtype = event->type; win->eventstate->prevval = event->val; win->eventstate->prevclicktime = PIL_check_seconds_timer(); + win->eventstate->prevclickx = event->x; + win->eventstate->prevclicky = event->y; } else { /* reset if not */ win->eventstate->prevtype = -1; win->eventstate->prevval = 0; diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index 1357b96fe70..d926bbfed80 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -30,6 +30,7 @@ */ #include <stdio.h> #include <string.h> +#include <errno.h> #ifdef WIN32 #include <windows.h> /* need to include windows.h so _WIN32_IE is defined */ @@ -102,7 +103,7 @@ #include "wm_window.h" #include "wm_event_system.h" -static void writeBlog(void); +static void write_history(void); /* To be able to read files without windows closing, opening, moving we try to prepare for worst case: @@ -220,7 +221,9 @@ static void wm_window_match_do(bContext *C, ListBase *oldwmlist) if(win->active) wm->winactive= win; - GHOST_SetWindowUserData(win->ghostwin, win); /* pointer back */ + if(!G.background) /* file loading in background mode still calls this */ + GHOST_SetWindowUserData(win->ghostwin, win); /* pointer back */ + oldwin->ghostwin= NULL; win->eventstate= oldwin->eventstate; @@ -259,6 +262,9 @@ void WM_read_file(bContext *C, char *name, ReportList *reports) { int retval; + /* so we can get the error message */ + errno = 0; + /* first try to append data from exotic file formats... */ /* it throws error box when file doesnt exist and returns -1 */ /* note; it should set some error message somewhere... (ton) */ @@ -292,7 +298,7 @@ void WM_read_file(bContext *C, char *name, ReportList *reports) if (retval!=0) { G.relbase_valid = 1; if(!G.background) /* assume automated tasks with background, dont write recent file list */ - writeBlog(); + write_history(); } // XXX undo_editmode_clear(); @@ -315,7 +321,7 @@ void WM_read_file(bContext *C, char *name, ReportList *reports) BKE_write_undo(C, "Import file"); else if(retval == -1) { if(reports) - BKE_reportf(reports, RPT_ERROR, "Can't read file \"%s\".", name); + BKE_reportf(reports, RPT_ERROR, "Can't read file: \"%s\", %s.", name, errno ? strerror(errno) : "Incompatible file format"); } } @@ -327,17 +333,23 @@ int WM_read_homefile(bContext *C, wmOperator *op) { ListBase wmbase; char tstr[FILE_MAXDIR+FILE_MAXFILE], scestr[FILE_MAXDIR]; - char *home= BLI_gethome(); int from_memory= op?RNA_boolean_get(op->ptr, "factory"):0; int success; - - BLI_clean(home); free_ttfont(); /* still weird... what does it here? */ G.relbase_valid = 0; if (!from_memory) { - BLI_make_file_string(G.sce, tstr, home, ".B25.blend"); + char *cfgdir = BLI_get_folder(BLENDER_USER_CONFIG, NULL); + if (cfgdir) { + BLI_make_file_string(G.sce, tstr, cfgdir, BLENDER_STARTUP_FILE); + } else { + tstr[0] = '\0'; + from_memory = 1; + if (op) { + BKE_report(op->reports, RPT_INFO, "Config directory with startup.blend file found."); + } + } } strcpy(scestr, G.sce); /* temporary store */ @@ -385,15 +397,19 @@ int WM_read_homefile(bContext *C, wmOperator *op) } -void read_Blog(void) +void read_history(void) { char name[FILE_MAX]; LinkNode *l, *lines; struct RecentFile *recent; char *line; int num; + char *cfgdir = BLI_get_folder(BLENDER_CONFIG, NULL); + + if (!cfgdir) return; + + BLI_make_file_string("/", name, cfgdir, BLENDER_HISTORY_FILE); - BLI_make_file_string("/", name, BLI_gethome(), ".Blog"); lines= BLI_read_file_as_lines(name); G.recent_files.first = G.recent_files.last = NULL; @@ -422,14 +438,14 @@ void read_Blog(void) } -static void writeBlog(void) +static void write_history(void) { struct RecentFile *recent, *next_recent; char name[FILE_MAXDIR+FILE_MAXFILE]; FILE *fp; int i; - BLI_make_file_string("/", name, BLI_gethome(), ".Blog"); + BLI_make_file_string("/", name, BLI_get_folder_create(BLENDER_USER_CONFIG, NULL), BLENDER_HISTORY_FILE); recent = G.recent_files.first; /* refresh .Blog of recent opened files, when current file was changed */ @@ -614,7 +630,7 @@ int WM_write_file(bContext *C, char *target, int fileflags, ReportList *reports) if(fileflags & G_FILE_AUTOPLAY) G.fileflags |= G_FILE_AUTOPLAY; else G.fileflags &= ~G_FILE_AUTOPLAY; - writeBlog(); + write_history(); /* run this function after because the file cant be written before the blend is */ if (ibuf_thumb) { @@ -646,7 +662,8 @@ int WM_write_homefile(bContext *C, wmOperator *op) if(win->screen->full == SCREENTEMP) wm_window_close(C, wm, win); - BLI_make_file_string("/", tstr, BLI_gethome(), ".B25.blend"); + BLI_make_file_string("/", tstr, BLI_get_folder_create(BLENDER_USER_CONFIG, NULL), BLENDER_STARTUP_FILE); + printf("trying to save homefile at %s \n", tstr); /* force save as regular blend file */ fileflags = G.fileflags & ~(G_FILE_COMPRESS | G_FILE_AUTOPLAY | G_FILE_LOCK | G_FILE_SIGN); diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c index 02e645ef635..acb3f5ea254 100644 --- a/source/blender/windowmanager/intern/wm_init_exit.c +++ b/source/blender/windowmanager/intern/wm_init_exit.c @@ -163,7 +163,7 @@ void WM_init(bContext *C, int argc, char **argv) G.ndofdevice = -1; /* XXX bad initializer, needs set otherwise buttons show! */ - read_Blog(); + read_history(); BLI_strncpy(G.lib, G.sce, FILE_MAX); } diff --git a/source/blender/windowmanager/intern/wm_jobs.c b/source/blender/windowmanager/intern/wm_jobs.c index c3ad8f96cb0..80f1c680931 100644 --- a/source/blender/windowmanager/intern/wm_jobs.c +++ b/source/blender/windowmanager/intern/wm_jobs.c @@ -339,28 +339,25 @@ void WM_jobs_stop_all(wmWindowManager *wm) } -/* signal job(s) from this owner to stop, timer is required to get handled */ -void WM_jobs_stop(wmWindowManager *wm, void *owner) +/* signal job(s) from this owner or callback to stop, timer is required to get handled */ +void WM_jobs_stop(wmWindowManager *wm, void *owner, void *startjob) { wmJob *steve; for(steve= wm->jobs.first; steve; steve= steve->next) - if(steve->owner==owner) + if(steve->owner==owner || steve->startjob==startjob) if(steve->running) steve->stop= 1; } /* actually terminate thread and job timer */ -void WM_jobs_kill(wmWindowManager *wm, void *owner) +void WM_jobs_kill(wmWindowManager *wm, void *owner, void *startjob) { wmJob *steve; for(steve= wm->jobs.first; steve; steve= steve->next) - if(steve->owner==owner) - break; - - if (steve) - wm_jobs_kill_job(wm, steve); + if(steve->owner==owner || steve->startjob==startjob) + wm_jobs_kill_job(wm, steve); } diff --git a/source/blender/windowmanager/intern/wm_keymap.c b/source/blender/windowmanager/intern/wm_keymap.c index ca6cabe3cce..e79d08dc2f1 100644 --- a/source/blender/windowmanager/intern/wm_keymap.c +++ b/source/blender/windowmanager/intern/wm_keymap.c @@ -708,8 +708,11 @@ void WM_keymap_restore_item_to_default(bContext *C, wmKeyMap *keymap, wmKeyMapIt WM_keymap_properties_reset(kmi); } - kmi->properties= IDP_CopyProperty(orig->properties); - kmi->ptr->data= kmi->properties; + + if (orig->properties) { + kmi->properties= IDP_CopyProperty(orig->properties); + kmi->ptr->data= kmi->properties; + } kmi->propvalue = orig->propvalue; kmi->type = orig->type; diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 058c39749a6..7c11c7ff3af 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -788,7 +788,15 @@ void WM_operator_properties_filesel(wmOperatorType *ot, int filter, short type, { PropertyRNA *prop; - RNA_def_string_file_path(ot->srna, "filepath", "", FILE_MAX, "File Path", "Path to file"); + + if(flag & WM_FILESEL_FILEPATH) + RNA_def_string_file_path(ot->srna, "filepath", "", FILE_MAX, "File Path", "Path to file"); + + if(flag & WM_FILESEL_DIRECTORY) + RNA_def_string_dir_path(ot->srna, "directory", "", FILE_MAX, "Directory", "Directory of the file"); + + if(flag & WM_FILESEL_FILENAME) + RNA_def_string_file_name(ot->srna, "filename", "", FILE_MAX, "File Name", "Name of the file"); if (action == FILE_SAVE) { prop= RNA_def_boolean(ot->srna, "check_existing", 1, "Check Existing", "Check and warn on overwriting existing files"); @@ -821,7 +829,7 @@ void WM_operator_properties_filesel(wmOperatorType *ot, int filter, short type, FILE_LOADLIB, FILE_SPECIAL); RNA_def_property_flag(prop, PROP_HIDDEN); - if(flag & FILE_RELPATH) + if(flag & WM_FILESEL_RELPATH) RNA_def_boolean(ot->srna, "relative_path", 0, "Relative Path", "Select the file relative to the blend file"); } @@ -1019,9 +1027,8 @@ int WM_operator_props_popup(bContext *C, wmOperator *op, wmEvent *event) if(op->type->exec) { retval= op->type->exec(C, op); - - if(op->type->flag & OPTYPE_UNDO) - ED_undo_push_op(C, op); + + /* ED_undo_push_op(C, op), called by wm_operator_finished now. */ } if(retval != OPERATOR_CANCELLED) @@ -1473,7 +1480,7 @@ static void WM_OT_open_mainfile(wmOperatorType *ot) ot->exec= wm_open_mainfile_exec; ot->poll= WM_operator_winactive; - WM_operator_properties_filesel(ot, FOLDERFILE|BLENDERFILE, FILE_BLENDER, FILE_OPENFILE, 0); + WM_operator_properties_filesel(ot, FOLDERFILE|BLENDERFILE, FILE_BLENDER, FILE_OPENFILE, WM_FILESEL_FILEPATH); RNA_def_boolean(ot->srna, "load_ui", 1, "Load UI", "Load user interface setup in the .blend file"); RNA_def_boolean(ot->srna, "use_scripts", 1, "Trusted Source", "Allow blend file execute scripts automatically, default available from system preferences"); @@ -1644,16 +1651,13 @@ static void WM_OT_link_append(wmOperatorType *ot) ot->flag |= OPTYPE_UNDO; - WM_operator_properties_filesel(ot, FOLDERFILE|BLENDERFILE, FILE_LOADLIB, FILE_OPENFILE, FILE_RELPATH); + WM_operator_properties_filesel(ot, FOLDERFILE|BLENDERFILE, FILE_LOADLIB, FILE_OPENFILE, WM_FILESEL_FILEPATH|WM_FILESEL_DIRECTORY|WM_FILESEL_FILENAME| WM_FILESEL_RELPATH); RNA_def_boolean(ot->srna, "link", 1, "Link", "Link the objects or datablocks rather than appending"); RNA_def_boolean(ot->srna, "autoselect", 1, "Select", "Select the linked objects"); RNA_def_boolean(ot->srna, "active_layer", 1, "Active Layer", "Put the linked objects on the active layer"); RNA_def_boolean(ot->srna, "instance_groups", 1, "Instance Groups", "Create instances for each group as a DupliGroup"); - RNA_def_string_file_name(ot->srna, "filename", "", FILE_MAX, "File Name", "Name of the file"); - RNA_def_string_dir_path(ot->srna, "directory", "", FILE_MAX, "Directory", "Directory of the file"); - RNA_def_collection_runtime(ot->srna, "files", &RNA_OperatorFileListElement, "Files", ""); } @@ -1674,7 +1678,6 @@ static int wm_recover_last_session_exec(bContext *C, wmOperator *op) WM_read_file(C, filename, op->reports); G.fileflags &= ~G_FILE_RECOVER; - return OPERATOR_FINISHED; } @@ -1731,7 +1734,7 @@ static void WM_OT_recover_auto_save(wmOperatorType *ot) ot->invoke= wm_recover_auto_save_invoke; ot->poll= WM_operator_winactive; - WM_operator_properties_filesel(ot, BLENDERFILE, FILE_BLENDER, FILE_OPENFILE, 0); + WM_operator_properties_filesel(ot, BLENDERFILE, FILE_BLENDER, FILE_OPENFILE, WM_FILESEL_FILEPATH); } /* *************** save file as **************** */ @@ -1814,7 +1817,7 @@ static void WM_OT_save_as_mainfile(wmOperatorType *ot) ot->exec= wm_save_as_mainfile_exec; ot->poll= WM_operator_winactive; - WM_operator_properties_filesel(ot, FOLDERFILE|BLENDERFILE, FILE_BLENDER, FILE_SAVE, 0); + WM_operator_properties_filesel(ot, FOLDERFILE|BLENDERFILE, FILE_BLENDER, FILE_SAVE, WM_FILESEL_FILEPATH); RNA_def_boolean(ot->srna, "compress", 0, "Compress", "Write compressed .blend file"); RNA_def_boolean(ot->srna, "relative_remap", 0, "Remap Relative", "Remap relative paths when saving in a different directory"); } @@ -1863,7 +1866,7 @@ static void WM_OT_save_mainfile(wmOperatorType *ot) ot->exec= wm_save_as_mainfile_exec; ot->poll= NULL; - WM_operator_properties_filesel(ot, FOLDERFILE|BLENDERFILE, FILE_BLENDER, FILE_SAVE, 0); + WM_operator_properties_filesel(ot, FOLDERFILE|BLENDERFILE, FILE_BLENDER, FILE_SAVE, WM_FILESEL_FILEPATH); RNA_def_boolean(ot->srna, "compress", 0, "Compress", "Write compressed .blend file"); RNA_def_boolean(ot->srna, "relative_remap", 0, "Remap Relative", "Remap relative paths when saving in a different directory"); } @@ -1912,7 +1915,7 @@ static void WM_OT_collada_export(wmOperatorType *ot) ot->exec= wm_collada_export_exec; ot->poll= WM_operator_winactive; - WM_operator_properties_filesel(ot, FOLDERFILE|COLLADAFILE, FILE_BLENDER, FILE_SAVE, 0); + WM_operator_properties_filesel(ot, FOLDERFILE|COLLADAFILE, FILE_BLENDER, FILE_SAVE, WM_FILESEL_FILEPATH); } /* function used for WM_OT_save_mainfile too */ @@ -1940,7 +1943,7 @@ static void WM_OT_collada_import(wmOperatorType *ot) ot->exec= wm_collada_import_exec; ot->poll= WM_operator_winactive; - WM_operator_properties_filesel(ot, FOLDERFILE|COLLADAFILE, FILE_BLENDER, FILE_OPENFILE, 0); + WM_operator_properties_filesel(ot, FOLDERFILE|COLLADAFILE, FILE_BLENDER, FILE_OPENFILE, WM_FILESEL_FILEPATH); } #endif @@ -2264,6 +2267,7 @@ static void tweak_gesture_modal(bContext *C, wmEvent *event) switch(event->type) { case MOUSEMOVE: + case INBETWEEN_MOUSEMOVE: wm_subwindow_getorigin(window, gesture->swinid, &sx, &sy); @@ -2394,6 +2398,7 @@ int WM_gesture_lasso_modal(bContext *C, wmOperator *op, wmEvent *event) switch(event->type) { case MOUSEMOVE: + case INBETWEEN_MOUSEMOVE: wm_gesture_tag_redraw(C); diff --git a/source/blender/windowmanager/intern/wm_subwindow.c b/source/blender/windowmanager/intern/wm_subwindow.c index f512434a141..207b6cebfe6 100644 --- a/source/blender/windowmanager/intern/wm_subwindow.c +++ b/source/blender/windowmanager/intern/wm_subwindow.c @@ -45,6 +45,8 @@ #include "BIF_gl.h" +#include "GPU_extensions.h" + #include "WM_api.h" #include "wm_subwindow.h" #include "wm_window.h" @@ -301,28 +303,6 @@ void wmOrtho2(float x1, float x2, float y1, float y2) /* *************************** Framebuffer color depth, for selection codes ********************** */ -static int wm_get_colordepth(void) -{ - static int mainwin_color_depth= 0; - - if(mainwin_color_depth==0) { - GLint r, g, b; - - glGetIntegerv(GL_RED_BITS, &r); - glGetIntegerv(GL_GREEN_BITS, &g); - glGetIntegerv(GL_BLUE_BITS, &b); - - mainwin_color_depth= r + g + b; - if(G.f & G_DEBUG) { - printf("Color depth r %d g %d b %d\n", (int)r, (int)g, (int)b); - glGetIntegerv(GL_AUX_BUFFERS, &r); - printf("Aux buffers: %d\n", (int)r); - } - } - return mainwin_color_depth; -} - - #ifdef __APPLE__ /* apple seems to round colors to below and up on some configs */ @@ -331,7 +311,7 @@ unsigned int index_to_framebuffer(int index) { unsigned int i= index; - switch(wm_get_colordepth()) { + switch(GPU_color_depth()) { case 12: i= ((i & 0xF00)<<12) + ((i & 0xF0)<<8) + ((i & 0xF)<<4); /* sometimes dithering subtracts! */ @@ -361,7 +341,7 @@ unsigned int index_to_framebuffer(int index) { unsigned int i= index; - switch(wm_get_colordepth()) { + switch(GPU_color_depth()) { case 8: i= ((i & 48)<<18) + ((i & 12)<<12) + ((i & 3)<<6); i |= 0x3F3F3F; @@ -398,7 +378,7 @@ int WM_framebuffer_to_index(unsigned int col) { if (col==0) return 0; - switch(wm_get_colordepth()) { + switch(GPU_color_depth()) { case 8: return ((col & 0xC00000)>>18) + ((col & 0xC000)>>12) + ((col & 0xC0)>>6); case 12: diff --git a/source/blender/windowmanager/wm_files.h b/source/blender/windowmanager/wm_files.h index c633ed8388e..15a38251795 100644 --- a/source/blender/windowmanager/wm_files.h +++ b/source/blender/windowmanager/wm_files.h @@ -28,7 +28,7 @@ #ifndef WM_FILES_H #define WM_FILES_H -extern void read_Blog(void); +extern void read_history(void); extern void delete_autosave(void); diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index af3a05adada..67c77ca41f4 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -211,18 +211,16 @@ IF(WITH_INSTALL) COMMAND cp -Rf ${SOURCEDIR}/Contents/PkgInfo ${TARGETDIR}/blender.app/Contents/ COMMAND cp -Rf ${SOURCEDIR}/Contents/Resources ${TARGETDIR}/blender.app/Contents/ COMMAND cat ${SOURCEINFO} | sed s/VERSION/`cat ${CMAKE_SOURCE_DIR}/release/VERSION`/ | sed s/DATE/`date +'%Y-%b-%d'`/ > ${TARGETINFO} - COMMAND rm -Rf ${TARGETDIR}/blender.app/Contents/MacOS/.blender - COMMAND mkdir ${TARGETDIR}/blender.app/Contents/MacOS/.blender/ - COMMAND cp ${CMAKE_SOURCE_DIR}/bin/.blender/.bfont.ttf ${TARGETDIR}/blender.app/Contents/MacOS/.blender/ + COMMAND rm -Rf ${TARGETDIR}/blender.app/Contents/MacOS/datafiles + COMMAND mkdir ${TARGETDIR}/blender.app/Contents/MacOS/datafiles/ + COMMAND cp ${CMAKE_SOURCE_DIR}/bin/.blender/.bfont.ttf ${TARGETDIR}/blender.app/Contents/MacOS/datafiles/ ) IF(WITH_INTERNATIONAL) ADD_CUSTOM_COMMAND( TARGET blender POST_BUILD MAIN_DEPENDENCY blender - COMMAND cp ${CMAKE_SOURCE_DIR}/bin/.blender/.Blanguages ${TARGETDIR}/blender.app/Contents/MacOS/.blender/ - COMMAND cp -Rf ${CMAKE_SOURCE_DIR}/bin/.blender/locale ${TARGETDIR}/blender.app/Contents/Resources/ - COMMAND cp -Rf ${CMAKE_SOURCE_DIR}/bin/.blender/locale ${TARGETDIR}/blender.app/Contents/MacOS/.blender/ - COMMAND cp ${CMAKE_SOURCE_DIR}/bin/.blender/.Blanguages ${TARGETDIR}/blender.app/Contents/Resources/ + COMMAND cp ${CMAKE_SOURCE_DIR}/bin/.blender/.Blanguages ${TARGETDIR}/blender.app/Contents/MacOS/datafiles/ + COMMAND cp -Rf ${CMAKE_SOURCE_DIR}/bin/.blender/locale ${TARGETDIR}/blender.app/Contents/MacOS/datafiles/ ) ENDIF(WITH_INTERNATIONAL) @@ -234,9 +232,10 @@ IF(WITH_INSTALL) ENDIF(WITH_LIBS10.5) ADD_CUSTOM_COMMAND( TARGET blender POST_BUILD MAIN_DEPENDENCY blender - COMMAND cp -Rf ${CMAKE_SOURCE_DIR}/release/scripts ${TARGETDIR}/blender.app/Contents/MacOS/.blender/ - COMMAND mkdir ${TARGETDIR}/blender.app/Contents/MacOS/.blender/python/ - COMMAND unzip -q ${LIBDIR}/release/${PYTHON_ZIP} -d ${TARGETDIR}/blender.app/Contents/MacOS/.blender/python/ + COMMAND cp -Rf ${CMAKE_SOURCE_DIR}/release/scripts ${TARGETDIR}/blender.app/Contents/MacOS/scripts/ + COMMAND rm -Rf ${TARGETDIR}/blender.app/Contents/MacOS/python/ + COMMAND mkdir ${TARGETDIR}/blender.app/Contents/MacOS/python/ + COMMAND unzip -q ${LIBDIR}/release/${PYTHON_ZIP} -d ${TARGETDIR}/blender.app/Contents/MacOS/python/ COMMAND find ${TARGETDIR}/blender.app -name "*.py?" -prune -exec rm -rf {} "\;" ) ENDIF(WITH_PYTHON) @@ -396,8 +395,6 @@ ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux") bf_freestyle blender_BSP - bf_ghost - bf_string blender_render blender_ONL bf_python @@ -408,9 +405,11 @@ ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux") bf_nodes bf_gpu bf_blenloader + bf_blenlib + bf_ghost + bf_string bf_blenpluginapi bf_imbuf - bf_blenlib bf_avi bf_cineon bf_openexr diff --git a/source/creator/creator.c b/source/creator/creator.c index 511fd423beb..4a502355579 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -236,11 +236,11 @@ static int print_help(int argc, char **argv, void *data) BLI_argsPrintArgDoc(ba, "--window-geometry"); printf("\n"); - printf ("Game Engine specific options:\n"); + printf ("Game Engine Specific Options:\n"); BLI_argsPrintArgDoc(ba, "-g"); printf("\n"); - printf ("Misc options:\n"); + printf ("Misc Options:\n"); BLI_argsPrintArgDoc(ba, "--debug"); BLI_argsPrintArgDoc(ba, "--debug-fpe"); @@ -275,10 +275,25 @@ static int print_help(int argc, char **argv, void *data) printf ("Other Options:\n"); BLI_argsPrintOtherDoc(ba); + printf ("Argument Parsing:\n"); + printf ("\targuments must be separated by white space. eg\n"); + printf ("\t\t\"blender -ba test.blend\"\n"); + printf ("\t...will ignore the 'a'\n"); + printf ("\t\t\"blender -b test.blend -f8\"\n"); + printf ("\t...will ignore 8 because there is no space between the -f and the frame value\n\n"); + + printf ("Argument Order:\n"); + printf ("Arguments are executed in the order they are given. eg\n"); + printf ("\t\t\"blender --background test.blend --render-frame 1 --render-output /tmp\"\n"); + printf ("\t...will not render to /tmp because '--render-frame 1' renders before the output path is set\n"); + printf ("\t\t\"blender --background --render-output /tmp test.blend --render-frame 1\"\n"); + printf ("\t...will not render to /tmp because loading the blend file overwrites the render output that was set\n"); + printf ("\t\t\"blender --background test.blend --render-output /tmp --render-frame 1\" works as expected.\n\n"); + printf ("\nEnvironment Variables:\n"); printf (" $HOME\t\t\tStore files such as .blender/ .B.blend .Bfs .Blog here.\n"); printf (" $BLENDERPATH System directory to use for data files and scripts.\n"); - printf (" For this build of blender the default BLENDERPATH is...\n"); + printf (" For this build of blender the default $BLENDERPATH is...\n"); printf (" \"%s\"\n", blender_path); printf (" setting the $BLENDERPATH will override this\n"); #ifdef WIN32 @@ -291,19 +306,6 @@ static int print_help(int argc, char **argv, void *data) #endif printf (" $PYTHONHOME Path to the python directory, eg. /usr/lib/python.\n\n"); - printf ("Note: Arguments must be separated by white space. eg:\n"); - printf (" \"blender -ba test.blend\"\n"); - printf (" ...will ignore the 'a'\n"); - printf (" \"blender -b test.blend -f8\"\n"); - printf (" ...will ignore 8 because there is no space between the -f and the frame value\n\n"); - - printf ("Note: Arguments are executed in the order they are given. eg:\n"); - printf (" \"blender --background test.blend --render-frame 1 --render-output /tmp\"\n"); - printf (" ...will not render to /tmp because '--render-frame 1' renders before the output path is set\n"); - printf (" \"blender --background --render-output /tmp test.blend --render-frame 1\"\n"); - printf (" ...will not render to /tmp because loading the blend file overwrites the render output that was set\n"); - printf (" \"blender --background test.blend --render-output /tmp --render-frame 1\" works as expected.\n\n"); - exit(0); return 0; @@ -737,7 +739,11 @@ static int render_animation(int argc, char **argv, void *data) static int set_scene(int argc, char **argv, void *data) { if(argc > 1) { - set_scene_name(argv[1]); + bContext *C= data; + Scene *sce= set_scene_name(argv[1]); + if(sce) { + CTX_data_scene_set(C, sce); + } return 1; } else { printf("\nError: Scene name must follow '-S / --scene'.\n"); @@ -982,7 +988,7 @@ void setupArguments(bContext *C, bArgs *ba, SYS_SystemHandle *syshandle) BLI_argsAdd(ba, 4, "-g", NULL, game_doc, set_ge_parameters, syshandle); BLI_argsAdd(ba, 4, "-f", "--render-frame", "<frame>\n\tRender frame <frame> and save it.\n\t+<frame> start frame relative, -<frame> end frame relative.", render_frame, C); BLI_argsAdd(ba, 4, "-a", "--render-anim", "\n\tRender frames from start to end (inclusive)", render_animation, C); - BLI_argsAdd(ba, 4, "-S", "--scene", "<name>\n\tSet the active scene <name> for rendering", set_scene, NULL); + BLI_argsAdd(ba, 4, "-S", "--scene", "<name>\n\tSet the active scene <name> for rendering", set_scene, C); BLI_argsAdd(ba, 4, "-s", "--frame-start", "<frame>\n\tSet start to frame <frame> (use before the -a argument)", set_start_frame, C); BLI_argsAdd(ba, 4, "-e", "--frame-end", "<frame>\n\tSet end to frame <frame> (use before the -a argument)", set_end_frame, C); BLI_argsAdd(ba, 4, "-j", "--frame-jump", "<frames>\n\tSet number of frames to step forward after each rendered frame", set_skip_frame, C); |