diff options
author | Xiao Xiangquan <xiaoxiangquan@gmail.com> | 2011-06-11 22:15:46 +0400 |
---|---|---|
committer | Xiao Xiangquan <xiaoxiangquan@gmail.com> | 2011-06-11 22:15:46 +0400 |
commit | 12f0795d498d4143af5a3203efad07589312300d (patch) | |
tree | 1638bd9c509270db9f1e4d54aac469fbb35d5e69 /source | |
parent | 2d3795ab3c5b107702012b21354174da2ca00e33 (diff) | |
parent | 81946b9138201800e495eb28addf254958feb1a4 (diff) |
accident when merge. revert to r37405
Diffstat (limited to 'source')
30 files changed, 224 insertions, 408 deletions
diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c index 2bce508b4f4..2fce1175fe1 100644 --- a/source/blender/blenkernel/intern/blender.c +++ b/source/blender/blenkernel/intern/blender.c @@ -180,6 +180,7 @@ static void clean_paths(Main *main) BLI_bpathIterator_free(bpi); for(scene= main->scene.first; scene; scene= scene->id.next) { + BLI_clean(scene->r.backbuf); BLI_clean(scene->r.pic); } } diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 23ba3fc0852..791d572d385 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -475,7 +475,8 @@ Scene *add_scene(const char *name) sce->audio.doppler_factor = 1.0; sce->audio.speed_of_sound = 343.3; - BLI_strncpy(sce->r.pic, U.renderdir, sizeof(sce->r.pic)); + strcpy(sce->r.backbuf, "//backbuf"); + strcpy(sce->r.pic, U.renderdir); BLI_init_rctf(&sce->r.safety, 0.1f, 0.9f, 0.1f, 0.9f); sce->r.osa= 8; diff --git a/source/blender/editors/include/ED_particle.h b/source/blender/editors/include/ED_particle.h index f2973d0d070..23997e06aef 100644 --- a/source/blender/editors/include/ED_particle.h +++ b/source/blender/editors/include/ED_particle.h @@ -71,9 +71,8 @@ void PE_undo_push(struct Scene *scene, const char *str); void PE_undo_step(struct Scene *scene, int step); void PE_undo(struct Scene *scene); void PE_redo(struct Scene *scene); +void PE_undo_menu(struct Scene *scene, struct Object *ob); int PE_undo_valid(struct Scene *scene); -void PE_undo_number(struct Scene *scene, int nr); -char *PE_undo_get_name(struct Scene *scene, int nr, int *active); #endif /* ED_PARTICLE_H */ diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index 8475090b468..6cca689d115 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -45,7 +45,6 @@ struct uiHandleButtonData; struct wmEvent; struct wmOperatorType; struct wmWindow; -struct wmTimer; struct uiStyle; struct uiWidgetColors; struct uiLayout; @@ -108,8 +107,8 @@ typedef enum { #define UI_PANEL_MINY 70 /* uiBut->flag */ -#define UI_SELECT 1 /* use when the button is pressed */ -#define UI_SCROLLED 2 /* temp hidden, scrolled away */ +#define UI_SELECT 1 /* use when the button is pressed */ +/*#define UI_MOUSE_OVER 2*/ /*UNUSED, free flag*/ #define UI_ACTIVE 4 #define UI_HAS_ICON 8 #define UI_TEXTINPUT 16 @@ -117,8 +116,8 @@ typedef enum { /* warn: rest of uiBut->flag in UI_interface.h */ /* internal panel drawing defines */ -#define PNL_GRID (UI_UNIT_Y / 5) /* 4 default */ -#define PNL_HEADER UI_UNIT_Y /* 20 default */ +#define PNL_GRID 4 +#define PNL_HEADER 20 /* panel->flag */ #define PNL_SELECT 1 @@ -370,7 +369,7 @@ extern void ui_convert_to_unit_alt_name(uiBut *but, char *str, int maxlen); extern int ui_set_but_string(struct bContext *C, uiBut *but, const char *str); extern int ui_get_but_string_max_length(uiBut *but); -extern void ui_set_but_default(struct bContext *C, short all); +extern void ui_set_but_default(struct bContext *C, uiBut *but, short all); extern void ui_set_but_soft_range(uiBut *but, double value); @@ -396,8 +395,6 @@ struct uiPopupBlockHandle { void (*popup_func)(struct bContext *C, void *arg, int event); void (*cancel_func)(void *arg); void *popup_arg; - - struct wmTimer *scrolltimer; /* for operator popups */ struct wmOperatorType *optype; @@ -419,11 +416,9 @@ void ui_block_func_ICONTEXTROW(struct bContext *C, uiLayout *layout, void *arg_b struct ARegion *ui_tooltip_create(struct bContext *C, struct ARegion *butregion, uiBut *but); void ui_tooltip_free(struct bContext *C, struct ARegion *ar); -uiBut *ui_popup_menu_memory(struct uiBlock *block, struct uiBut *but); - -float *ui_block_hsv_get(struct uiBlock *block); -void ui_popup_block_scrolltest(struct uiBlock *block); +uiBut *ui_popup_menu_memory(uiBlock *block, uiBut *but); +float *ui_block_hsv_get(uiBlock *block); /* searchbox for string button */ ARegion *ui_searchbox_create(struct bContext *C, struct ARegion *butregion, uiBut *but); @@ -486,11 +481,6 @@ void ui_widget_color_init(struct ThemeUI *tui); void ui_draw_menu_item(struct uiFontStyle *fstyle, rcti *rect, const char *name, int iconid, int state); void ui_draw_preview_item(struct uiFontStyle *fstyle, rcti *rect, const char *name, int iconid, int state); -extern unsigned char checker_stipple_sml[]; -/* used for transp checkers */ -#define UI_TRANSP_DARK 100 -#define UI_TRANSP_LIGHT 160 - /* interface_style.c */ void uiStyleInit(void); diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index c5236a38970..c425ef5a36a 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -174,14 +174,14 @@ void ED_object_add_generic_props(wmOperatorType *ot, int do_editmode) PropertyRNA *prop; /* note: this property gets hidden for add-camera operator */ - RNA_def_boolean(ot->srna, "view_align", 0, "Align to View", "Align the new object to the view"); + RNA_def_boolean(ot->srna, "view_align", 0, "Align to View", "Align the new object to the view."); if(do_editmode) { - prop= RNA_def_boolean(ot->srna, "enter_editmode", 0, "Enter Editmode", "Enter editmode when adding this object"); + prop= RNA_def_boolean(ot->srna, "enter_editmode", 0, "Enter Editmode", "Enter editmode when adding this object."); RNA_def_property_flag(prop, PROP_HIDDEN); } - RNA_def_float_vector_xyz(ot->srna, "location", 3, NULL, -FLT_MAX, FLT_MAX, "Location", "Location for the newly added object", -FLT_MAX, FLT_MAX); + RNA_def_float_vector_xyz(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, "layers", 20, NULL, "Layer", ""); @@ -637,7 +637,7 @@ static int object_armature_add_exec(bContext *C, wmOperator *op) else DAG_id_tag_update(&obedit->id, OB_RECALC_DATA); if(obedit==NULL) { - BKE_report(op->reports, RPT_ERROR, "Cannot create editmode armature"); + BKE_report(op->reports, RPT_ERROR, "Cannot create editmode armature."); return OPERATOR_CANCELLED; } @@ -1382,7 +1382,7 @@ static int convert_exec(bContext *C, wmOperator *op) void OBJECT_OT_convert(wmOperatorType *ot) { /* identifiers */ - ot->name= "Convert to"; + ot->name= "Convert"; ot->description = "Convert selected objects to another type"; ot->idname= "OBJECT_OT_convert"; @@ -1395,8 +1395,8 @@ void OBJECT_OT_convert(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - ot->prop= RNA_def_enum(ot->srna, "target", convert_target_items, OB_MESH, "Target", "Type of object to convert to"); - RNA_def_boolean(ot->srna, "keep_original", 0, "Keep Original", "Keep original objects instead of replacing them"); + ot->prop= RNA_def_enum(ot->srna, "target", convert_target_items, OB_MESH, "Target", "Type of object to convert to."); + RNA_def_boolean(ot->srna, "keep_original", 0, "Keep Original", "Keep original objects instead of replacing them."); } /**************************** Duplicate ************************/ @@ -1716,7 +1716,7 @@ void OBJECT_OT_duplicate(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* to give to transform */ - RNA_def_boolean(ot->srna, "linked", 0, "Linked", "Duplicate object but not object data, linking to the original data"); + RNA_def_boolean(ot->srna, "linked", 0, "Linked", "Duplicate object but not object data, linking to the original data."); prop= RNA_def_enum(ot->srna, "mode", transform_mode_types, TFM_TRANSLATION, "Mode", ""); RNA_def_property_flag(prop, PROP_HIDDEN); } @@ -1786,8 +1786,8 @@ void OBJECT_OT_add_named(wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - RNA_def_boolean(ot->srna, "linked", 0, "Linked", "Duplicate object but not object data, linking to the original data"); - RNA_def_string(ot->srna, "name", "Cube", 24, "Name", "Object name to add"); + RNA_def_boolean(ot->srna, "linked", 0, "Linked", "Duplicate object but not object data, linking to the original data."); + RNA_def_string(ot->srna, "name", "Cube", 24, "Name", "Object name to add."); } @@ -1812,11 +1812,11 @@ static int join_exec(bContext *C, wmOperator *op) Object *ob= CTX_data_active_object(C); if(scene->obedit) { - BKE_report(op->reports, RPT_ERROR, "This data does not support joining in editmode"); + BKE_report(op->reports, RPT_ERROR, "This data does not support joining in editmode."); return OPERATOR_CANCELLED; } else if(object_data_is_libdata(ob)) { - BKE_report(op->reports, RPT_ERROR, "Can't edit external libdata"); + BKE_report(op->reports, RPT_ERROR, "Can't edit external libdata."); return OPERATOR_CANCELLED; } @@ -1865,11 +1865,11 @@ static int join_shapes_exec(bContext *C, wmOperator *op) Object *ob= CTX_data_active_object(C); if(scene->obedit) { - BKE_report(op->reports, RPT_ERROR, "This data does not support joining in editmode"); + BKE_report(op->reports, RPT_ERROR, "This data does not support joining in editmode."); return OPERATOR_CANCELLED; } else if(object_data_is_libdata(ob)) { - BKE_report(op->reports, RPT_ERROR, "Can't edit external libdata"); + BKE_report(op->reports, RPT_ERROR, "Can't edit external libdata."); return OPERATOR_CANCELLED; } diff --git a/source/blender/editors/object/object_shapekey.c b/source/blender/editors/object/object_shapekey.c index fd2e7fd7c99..7c59278dcf5 100644 --- a/source/blender/editors/object/object_shapekey.c +++ b/source/blender/editors/object/object_shapekey.c @@ -203,9 +203,9 @@ static int object_shape_key_mirror(bContext *C, Object *ob) fp1= ((float *)kb->data) + i1*3; fp2= ((float *)kb->data) + i2*3; - copy_v3_v3(tvec, fp1); - copy_v3_v3(fp1, fp2); - copy_v3_v3(fp2, tvec); + VECCOPY(tvec, fp1); + VECCOPY(fp1, fp2); + VECCOPY(fp2, tvec); /* flip x axis */ fp1[0] = -fp1[0]; @@ -217,46 +217,7 @@ static int object_shape_key_mirror(bContext *C, Object *ob) mesh_octree_table(ob, NULL, NULL, 'e'); } - else if (ob->type == OB_LATTICE) { - Lattice *lt= ob->data; - int i1, i2; - float *fp1, *fp2; - int u, v, w; - /* half but found up odd value */ - const int pntsu_half = (((lt->pntsu / 2) + (lt->pntsu % 2))) ; - - /* currently editmode isnt supported by mesh so - * ignore here for now too */ - - /* if(lt->editlatt) lt= lt->editlatt->latt; */ - - for(w=0; w<lt->pntsw; w++) { - for(v=0; v<lt->pntsv; v++) { - for(u=0; u<pntsu_half; u++) { - int u_inv= (lt->pntsu - 1) - u; - float tvec[3]; - if(u == u_inv) { - i1= LT_INDEX(lt, u, v, w); - fp1= ((float *)kb->data) + i1*3; - fp1[0]= -fp1[0]; - } - else { - i1= LT_INDEX(lt, u, v, w); - i2= LT_INDEX(lt, u_inv, v, w); - - fp1= ((float *)kb->data) + i1*3; - fp2= ((float *)kb->data) + i2*3; - - copy_v3_v3(tvec, fp1); - copy_v3_v3(fp1, fp2); - copy_v3_v3(fp2, tvec); - fp1[0]= -fp1[0]; - fp2[0]= -fp2[0]; - } - } - } - } - } + /* todo, other types? */ MEM_freeN(tag_elem); } diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c index 52ba9460818..43448198ae1 100644 --- a/source/blender/editors/object/object_vgroup.c +++ b/source/blender/editors/object/object_vgroup.c @@ -77,7 +77,6 @@ static void vgroup_remap_update_users(Object *ob, int *map); static void vgroup_delete_edit_mode(Object *ob, bDeformGroup *defgroup); static void vgroup_delete_object_mode(Object *ob, bDeformGroup *dg); -static void vgroup_delete_all(Object *ob); static Lattice *vgroup_edit_lattice(Object *ob) { @@ -139,30 +138,22 @@ void ED_vgroup_delete(Object *ob, bDeformGroup *defgroup) vgroup_delete_object_mode(ob, dg); } -int ED_vgroup_data_create(ID *id) +void ED_vgroup_data_create(ID *id) { /* create deform verts */ if(GS(id->name)==ID_ME) { Mesh *me= (Mesh *)id; me->dvert= CustomData_add_layer(&me->vdata, CD_MDEFORMVERT, CD_CALLOC, NULL, me->totvert); - return TRUE; } else if(GS(id->name)==ID_LT) { Lattice *lt= (Lattice *)id; lt->dvert= MEM_callocN(sizeof(MDeformVert)*lt->pntsu*lt->pntsv*lt->pntsw, "lattice deformVert"); - return TRUE; - } - else { - return FALSE; } } static int ED_vgroup_give_parray(ID *id, MDeformVert ***dvert_arr, int *dvert_tot) { - *dvert_tot = 0; - *dvert_arr = NULL; - if(id) { switch(GS(id->name)) { case ID_ME: @@ -175,6 +166,8 @@ static int ED_vgroup_give_parray(ID *id, MDeformVert ***dvert_arr, int *dvert_to int i; if (!CustomData_has_layer(&em->vdata, CD_MDEFORMVERT)) { + *dvert_tot = 0; + *dvert_arr = NULL; return 0; } @@ -202,9 +195,8 @@ static int ED_vgroup_give_parray(ID *id, MDeformVert ***dvert_arr, int *dvert_to return 1; } - else { + else return 0; - } } case ID_LT: { @@ -230,6 +222,8 @@ static int ED_vgroup_give_parray(ID *id, MDeformVert ***dvert_arr, int *dvert_to } } + *dvert_arr= NULL; + *dvert_tot= 0; return 0; } @@ -271,24 +265,13 @@ int ED_vgroup_copy_array(Object *ob, Object *ob_from) int i; int totdef_from= BLI_countlist(&ob_from->defbase); int totdef= BLI_countlist(&ob->defbase); - short new_vgroup= FALSE; ED_vgroup_give_parray(ob_from->data, &dvert_array_from, &dvert_tot_from); ED_vgroup_give_parray(ob->data, &dvert_array, &dvert_tot); - if((dvert_array == NULL) && (dvert_array_from != NULL) && ED_vgroup_data_create(ob->data)) { - ED_vgroup_give_parray(ob->data, &dvert_array, &dvert_tot); - new_vgroup= TRUE; - } - if(ob==ob_from || dvert_tot==0 || (dvert_tot != dvert_tot_from) || dvert_array_from==NULL || dvert_array==NULL) { if (dvert_array) MEM_freeN(dvert_array); if (dvert_array_from) MEM_freeN(dvert_array_from); - - if(new_vgroup == TRUE) { - /* free the newly added vgroup since it wasn't compatible */ - vgroup_delete_all(ob); - } return 0; } @@ -1032,75 +1015,55 @@ static void vgroup_clean_all(Object *ob, float eul, int keep_single) if (dvert_array) MEM_freeN(dvert_array); } - -static void dvert_mirror_op(MDeformVert *dvert, MDeformVert *dvert_mirr, - const char sel, const char sel_mirr, - const int *flip_map, - const short mirror_weights, const short flip_vgroups) -{ - BLI_assert(sel || sel_mirr); - - if(sel_mirr && sel) { - /* swap */ - if(mirror_weights) - SWAP(MDeformVert, *dvert, *dvert_mirr); - if(flip_vgroups) { - defvert_flip(dvert, flip_map); - defvert_flip(dvert_mirr, flip_map); - } - } - else { - /* dvert should always be the target */ - if(sel_mirr) { - SWAP(MDeformVert *, dvert, dvert_mirr); - } - - if(mirror_weights) - defvert_copy(dvert, dvert_mirr); - if(flip_vgroups) { - defvert_flip(dvert, flip_map); - } - } -} - -void ED_vgroup_mirror(Object *ob, const short mirror_weights, const short flip_vgroups) +void ED_vgroup_mirror(Object *ob, int mirror_weights, int flip_vgroups) { -#define VGROUP_MIRR_OP dvert_mirror_op(dvert, dvert_mirr, sel, sel_mirr, flip_map, mirror_weights, flip_vgroups) - EditVert *eve, *eve_mirr; MDeformVert *dvert, *dvert_mirr; - short sel, sel_mirr; int *flip_map; if(mirror_weights==0 && flip_vgroups==0) return; - flip_map= defgroup_flip_map(ob, 0); - /* only the active group */ if(ob->type == OB_MESH) { Mesh *me= ob->data; EditMesh *em = BKE_mesh_get_editmesh(me); + EM_cache_x_mirror_vert(ob, em); - if(!CustomData_has_layer(&em->vdata, CD_MDEFORMVERT)) { - MEM_freeN(flip_map); + if(!CustomData_has_layer(&em->vdata, CD_MDEFORMVERT)) return; - } - EM_cache_x_mirror_vert(ob, em); + flip_map= defgroup_flip_map(ob, 0); /* Go through the list of editverts and assign them */ for(eve=em->verts.first; eve; eve=eve->next){ if((eve_mirr=eve->tmp.v)) { - sel= eve->f & SELECT; - sel_mirr= eve_mirr->f & SELECT; - - if((sel || sel_mirr) && (eve != eve_mirr)) { + if((eve_mirr->f & SELECT || eve->f & SELECT) && (eve != eve_mirr)) { dvert= CustomData_em_get(&em->vdata, eve->data, CD_MDEFORMVERT); dvert_mirr= CustomData_em_get(&em->vdata, eve_mirr->data, CD_MDEFORMVERT); if(dvert && dvert_mirr) { - VGROUP_MIRR_OP; + if(eve_mirr->f & SELECT && eve->f & SELECT) { + /* swap */ + if(mirror_weights) + SWAP(MDeformVert, *dvert, *dvert_mirr); + if(flip_vgroups) { + defvert_flip(dvert, flip_map); + defvert_flip(dvert_mirr, flip_map); + } + } + else { + /* dvert should always be the target */ + if(eve_mirr->f & SELECT) { + SWAP(MDeformVert *, dvert, dvert_mirr); + } + + if(mirror_weights) + defvert_copy(dvert, dvert_mirr); + if(flip_vgroups) { + defvert_flip(dvert, flip_map); + } + } } } @@ -1108,58 +1071,10 @@ void ED_vgroup_mirror(Object *ob, const short mirror_weights, const short flip_v } } - BKE_mesh_end_editmesh(me, em); - } - else if (ob->type == OB_LATTICE) { - Lattice *lt= ob->data; - int i1, i2; - int u, v, w; - int pntsu_half; - /* half but found up odd value */ - - if(lt->editlatt) lt= lt->editlatt->latt; - - if(lt->pntsu == 1 || lt->dvert == NULL) { - MEM_freeN(flip_map); - return; - } - - /* unlike editmesh we know that by only looping over the first hald of - * the 'u' indicies it will cover all points except the middle which is - * ok in this case */ - pntsu_half= lt->pntsu / 2; - - for(w=0; w<lt->pntsw; w++) { - for(v=0; v<lt->pntsv; v++) { - for(u=0; u<pntsu_half; u++) { - int u_inv= (lt->pntsu - 1) - u; - if(u != u_inv) { - BPoint *bp, *bp_mirr; + MEM_freeN(flip_map); - i1= LT_INDEX(lt, u, v, w); - i2= LT_INDEX(lt, u_inv, v, w); - - bp= <->def[i1]; - bp_mirr= <->def[i2]; - - sel= bp->f1 & SELECT; - sel_mirr= bp_mirr->f1 & SELECT; - - if(sel || sel_mirr) { - dvert= <->dvert[i1]; - dvert_mirr= <->dvert[i2]; - - VGROUP_MIRR_OP; - } - } - } - } - } + BKE_mesh_end_editmesh(me, em); } - - MEM_freeN(flip_map); - -#undef VGROUP_MIRR_OP } static void vgroup_remap_update_users(Object *ob, int *map) @@ -2005,25 +1920,17 @@ void OBJECT_OT_vertex_group_copy_to_linked(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -static int vertex_group_copy_to_selected_exec(bContext *C, wmOperator *op) +static int vertex_group_copy_to_selected_exec(bContext *C, wmOperator *UNUSED(op)) { Object *obact= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; - int change= 0; - int fail= 0; CTX_DATA_BEGIN(C, Object*, ob, selected_editable_objects) { - if(obact != ob) { - if(ED_vgroup_copy_array(ob, obact)) change++; - else fail++; - } + if(obact != ob) + ED_vgroup_copy_array(ob, obact); } CTX_DATA_END; - if((change == 0 && fail == 0) || fail) { - BKE_reportf(op->reports, RPT_ERROR, "Copy to VGroups to Selected warning done %d, failed %d, object data must have matching indicies", change, fail); - } - return OPERATOR_FINISHED; } diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c index 6155929243b..c5ab840914e 100644 --- a/source/blender/editors/physics/particle_edit.c +++ b/source/blender/editors/physics/particle_edit.c @@ -3970,6 +3970,18 @@ int PE_undo_valid(Scene *scene) return 0; } +static void PTCacheUndo_number(Scene *scene, PTCacheEdit *edit, int nr) +{ + PTCacheUndo *undo; + int a=1; + + for(undo= edit->undo.first; undo; undo= undo->next, a++) { + if(a==nr) break; + } + edit->curundo= undo; + PE_undo_step(scene, 0); +} + static void PTCacheUndo_clear(PTCacheEdit *edit) { PTCacheUndo *undo; @@ -3995,38 +4007,32 @@ void PE_redo(Scene *scene) PE_undo_step(scene, -1); } -void PE_undo_number(Scene *scene, int nr) +void PE_undo_menu(Scene *scene, Object *ob) { - PTCacheEdit *edit= PE_get_current(scene, OBACT); + PTCacheEdit *edit= PE_get_current(scene, ob); PTCacheUndo *undo; - int a=0; - - for(undo= edit->undo.first; undo; undo= undo->next, a++) { - if(a==nr) break; - } - edit->curundo= undo; - PE_undo_step(scene, 0); -} + DynStr *ds; + short event=0; + char *menu; - -/* get name of undo item, return null if no item with this index */ -/* if active pointer, set it to 1 if true */ -char *PE_undo_get_name(Scene *scene, int nr, int *active) -{ - PTCacheEdit *edit= PE_get_current(scene, OBACT); - PTCacheUndo *undo; + if(!edit) return; - if(active) *active= 0; + ds= BLI_dynstr_new(); + + BLI_dynstr_append(ds, "Particlemode Undo History %t"); - if(edit) { - undo= BLI_findlink(&edit->undo, nr); - if(undo) { - if(active && undo==edit->curundo) - *active= 1; - return undo->name; - } + for(undo= edit->undo.first; undo; undo= undo->next) { + BLI_dynstr_append(ds, "|"); + BLI_dynstr_append(ds, undo->name); } - return NULL; + + menu= BLI_dynstr_get_cstring(ds); + BLI_dynstr_free(ds); + +// XXX event= pupmenu_col(menu, 20); + MEM_freeN(menu); + + if(event>0) PTCacheUndo_number(scene, edit, event); } /************************ utilities ******************************/ diff --git a/source/blender/editors/render/render_view.c b/source/blender/editors/render/render_view.c index 9dfcde6ed0d..64a4d47cddc 100644 --- a/source/blender/editors/render/render_view.c +++ b/source/blender/editors/render/render_view.c @@ -184,7 +184,8 @@ void render_view_open(bContext *C, int mx, int my) area_was_image = 1; /* this function returns with changed context */ - sa= ED_screen_full_newspace(C, CTX_wm_area(C), SPACE_IMAGE); + ED_screen_full_newspace(C, CTX_wm_area(C), SPACE_IMAGE); + sa= CTX_wm_area(C); } if(!sa) { diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index cae5c14aa97..db0d2314ad0 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -3692,26 +3692,14 @@ static void do_projectpaint_draw(ProjPaintState *ps, ProjPixel *projPixel, float } } -static void do_projectpaint_draw_f(ProjPaintState *ps, ProjPixel *projPixel, float *rgba, float alpha, float mask, int use_color_correction) { +static void do_projectpaint_draw_f(ProjPaintState *ps, ProjPixel *projPixel, float *rgba, float alpha, float mask) { if (ps->is_texbrush) { - /* rgba already holds a texture result here from higher level function */ - float rgba_br[3]; - if(use_color_correction){ - srgb_to_linearrgb_v3_v3(rgba_br, ps->brush->rgb); - mul_v3_v3(rgba, rgba_br); - } - else{ - mul_v3_v3(rgba, ps->brush->rgb); - } + rgba[0] *= ps->brush->rgb[0]; + rgba[1] *= ps->brush->rgb[1]; + rgba[2] *= ps->brush->rgb[2]; } else { - if(use_color_correction){ - srgb_to_linearrgb_v3_v3(rgba, ps->brush->rgb); - } - else { - VECCOPY(rgba, ps->brush->rgb); - } - rgba[3] = 1.0; + VECCOPY(rgba, ps->brush->rgb); } if (ps->is_airbrush==0 && mask < 1.0f) { @@ -3748,7 +3736,6 @@ static void *do_projectpaint_thread(void *ph_v) float falloff; int bucket_index; int is_floatbuf = 0; - int use_color_correction = 0; const short tool = ps->tool; rctf bucket_bounds; @@ -3854,7 +3841,6 @@ static void *do_projectpaint_thread(void *ph_v) last_projIma->touch = 1; is_floatbuf = last_projIma->ibuf->rect_float ? 1 : 0; - use_color_correction = (last_projIma->ibuf->profile == IB_PROFILE_LINEAR_RGB) ? 1 : 0; } last_partial_redraw_cell = last_projIma->partRedrawRect + projPixel->bb_cell_index; @@ -3885,7 +3871,7 @@ static void *do_projectpaint_thread(void *ph_v) else do_projectpaint_smear(ps, projPixel, alpha, mask, smearArena, &smearPixels, co); break; default: - if (is_floatbuf) do_projectpaint_draw_f(ps, projPixel, rgba, alpha, mask, use_color_correction); + if (is_floatbuf) do_projectpaint_draw_f(ps, projPixel, rgba, alpha, mask); else do_projectpaint_draw(ps, projPixel, rgba, alpha, mask); break; } @@ -4001,7 +3987,7 @@ static int project_paint_sub_stroke(ProjPaintState *ps, BrushPainter *painter, c // we may want to use this later // brush_painter_require_imbuf(painter, ((ibuf->rect_float)? 1: 0), 0, 0); - if (brush_painter_paint(painter, project_paint_op, pos, time, pressure, ps, 0)) { + if (brush_painter_paint(painter, project_paint_op, pos, time, pressure, ps)) { return 1; } else return 0; @@ -4072,6 +4058,7 @@ static void imapaint_dirty_region(Image *ima, ImBuf *ibuf, int x, int y, int w, static void imapaint_image_update(SpaceImage *sima, Image *image, ImBuf *ibuf, short texpaint) { if(ibuf->rect_float) + /* TODO - should just update a portion from imapaintpartial! */ ibuf->userflags |= IB_RECT_INVALID; /* force recreate of char rect */ if(ibuf->mipmap[0]) @@ -4268,8 +4255,8 @@ static ImBuf *imapaint_lift_clone(ImBuf *ibuf, ImBuf *ibufb, int *pos) static void imapaint_convert_brushco(ImBuf *ibufb, float *pos, int *ipos) { - ipos[0]= (int)floorf((pos[0] - ibufb->x/2) + 1.0f); - ipos[1]= (int)floorf((pos[1] - ibufb->y/2) + 1.0f); + ipos[0]= (int)(pos[0] - ibufb->x/2); + ipos[1]= (int)(pos[1] - ibufb->y/2); } /* dosnt run for projection painting @@ -4422,7 +4409,7 @@ static int imapaint_paint_sub_stroke(ImagePaintState *s, BrushPainter *painter, brush_painter_require_imbuf(painter, ((ibuf->rect_float)? 1: 0), 0, 0); - if (brush_painter_paint(painter, imapaint_paint_op, pos, time, pressure, s, ibuf->profile == IB_PROFILE_LINEAR_RGB)) { + if (brush_painter_paint(painter, imapaint_paint_op, pos, time, pressure, s)) { if (update) imapaint_image_update(s->sima, image, ibuf, texpaint); return 1; @@ -4876,7 +4863,12 @@ static void paint_apply_event(bContext *C, wmOperator *op, wmEvent *event) PointerRNA itemptr; float pressure, mousef[2]; double time; - int tablet; + int tablet, mouse[2]; + + // XXX +1 matches brush location better but + // still not exact, find out why and fix .. + mouse[0]= event->mval[0] + 1; + mouse[1]= event->mval[1] + 1; time= PIL_check_seconds_timer(); @@ -4896,8 +4888,8 @@ static void paint_apply_event(bContext *C, wmOperator *op, wmEvent *event) pressure= pop->prev_pressure ? pop->prev_pressure : 1.0f; if(pop->first) { - pop->prevmouse[0]= event->mval[0]; - pop->prevmouse[1]= event->mval[1]; + pop->prevmouse[0]= mouse[0]; + pop->prevmouse[1]= mouse[1]; pop->starttime= time; /* special exception here for too high pressure values on first touch in @@ -4916,8 +4908,8 @@ static void paint_apply_event(bContext *C, wmOperator *op, wmEvent *event) /* fill in stroke */ RNA_collection_add(op->ptr, "stroke", &itemptr); - mousef[0] = (float)(event->mval[0]); - mousef[1] = (float)(event->mval[1]); + mousef[0] = (float)(mouse[0]); + mousef[1] = (float)(mouse[1]); RNA_float_set_array(&itemptr, "mouse", mousef); RNA_float_set(&itemptr, "time", (float)(time - pop->starttime)); RNA_float_set(&itemptr, "pressure", pressure); @@ -5020,45 +5012,31 @@ static int get_imapaint_zoom(bContext *C, float *zoomx, float *zoomy) static void brush_drawcursor(bContext *C, int x, int y, void *UNUSED(customdata)) { -#define PX_SIZE_FADE_MAX 12.0f -#define PX_SIZE_FADE_MIN 4.0f - Brush *brush= image_paint_brush(C); Paint *paint= paint_get_active(CTX_data_scene(C)); - if(paint && brush && paint->flags & PAINT_SHOW_BRUSH) { + if(paint && brush) { float zoomx, zoomy; - const float size= (float)brush_size(brush); - const short use_zoom= get_imapaint_zoom(C, &zoomx, &zoomy); - const float pixel_size= MAX2(size * zoomx, size * zoomy); - float alpha= 0.5f; - /* fade out the brush (cheap trick to work around brush interfearing with sampling [#])*/ - if(pixel_size < PX_SIZE_FADE_MIN) { + if(!(paint->flags & PAINT_SHOW_BRUSH)) return; - } - else if (pixel_size < PX_SIZE_FADE_MAX) { - alpha *= (pixel_size - PX_SIZE_FADE_MIN) / (PX_SIZE_FADE_MAX - PX_SIZE_FADE_MIN); - } glPushMatrix(); glTranslatef((float)x, (float)y, 0.0f); - if(use_zoom) + if(get_imapaint_zoom(C, &zoomx, &zoomy)) glScalef(zoomx, zoomy, 1.0f); - glColor4f(brush->add_col[0], brush->add_col[1], brush->add_col[2], alpha); + glColor4f(brush->add_col[0], brush->add_col[1], brush->add_col[2], 0.5f); glEnable( GL_LINE_SMOOTH ); glEnable(GL_BLEND); - glutil_draw_lined_arc(0, (float)(M_PI*2.0), size, 40); + glutil_draw_lined_arc(0, (float)(M_PI*2.0), (float)brush_size(brush), 40); glDisable(GL_BLEND); glDisable( GL_LINE_SMOOTH ); glPopMatrix(); } -#undef PX_SIZE_FADE_MAX -#undef PX_SIZE_FADE_MIN } static void toggle_paint_cursor(bContext *C, int enable) diff --git a/source/blender/editors/sculpt_paint/paint_intern.h b/source/blender/editors/sculpt_paint/paint_intern.h index 5a0ee19d6c9..bb877e4b1ee 100644 --- a/source/blender/editors/sculpt_paint/paint_intern.h +++ b/source/blender/editors/sculpt_paint/paint_intern.h @@ -65,7 +65,6 @@ int paint_space_stroke_enabled(struct Brush *br); int paint_stroke_modal(struct bContext *C, struct wmOperator *op, struct wmEvent *event); int paint_stroke_exec(struct bContext *C, struct wmOperator *op); -int paint_stroke_cancel(struct bContext *C, struct wmOperator *op); struct ViewContext *paint_stroke_view_context(struct PaintStroke *stroke); void *paint_stroke_mode_data(struct PaintStroke *stroke); void paint_stroke_set_mode_data(struct PaintStroke *stroke, void *mode_data); diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c index 7ddf5dff000..58c3446673c 100644 --- a/source/blender/editors/sculpt_paint/paint_stroke.c +++ b/source/blender/editors/sculpt_paint/paint_stroke.c @@ -916,19 +916,6 @@ int paint_stroke_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -int paint_stroke_cancel(bContext *C, wmOperator *op) -{ - PaintStroke *stroke = op->customdata; - - if(stroke->done) - stroke->done(C, stroke); - - MEM_freeN(stroke); - op->customdata = NULL; - - return OPERATOR_CANCELLED; -} - ViewContext *paint_stroke_view_context(PaintStroke *stroke) { return &stroke->vc; diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index 3da19ba7346..0d79fcc2c58 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -301,7 +301,7 @@ static void wpaint_mirror_vgroup_ensure(Object *ob, int *vgroup_mirror) flip_side_name(name, defgroup->name, FALSE); if(strcmp(name, defgroup->name) != 0) { - for (curdef= ob->defbase.first, mirrdef= 0; curdef; curdef=curdef->next, mirrdef++) { + for (curdef= ob->defbase.first, mirrdef; curdef; curdef=curdef->next, mirrdef++) { if (!strcmp(curdef->name, name)) { break; } @@ -1600,13 +1600,6 @@ static int wpaint_invoke(bContext *C, wmOperator *op, wmEvent *event) return OPERATOR_RUNNING_MODAL; } -static int wpaint_cancel(bContext *C, wmOperator *op) -{ - paint_stroke_cancel(C, op); - - return OPERATOR_CANCELLED; -} - void PAINT_OT_weight_paint(wmOperatorType *ot) { @@ -1619,7 +1612,6 @@ void PAINT_OT_weight_paint(wmOperatorType *ot) ot->modal= paint_stroke_modal; /* ot->exec= vpaint_exec; <-- needs stroke property */ ot->poll= weight_paint_poll; - ot->cancel= wpaint_cancel; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; @@ -1900,13 +1892,6 @@ static int vpaint_invoke(bContext *C, wmOperator *op, wmEvent *event) return OPERATOR_RUNNING_MODAL; } -static int vpaint_cancel(bContext *C, wmOperator *op) -{ - paint_stroke_cancel(C, op); - - return OPERATOR_CANCELLED; -} - void PAINT_OT_vertex_paint(wmOperatorType *ot) { /* identifiers */ @@ -1918,7 +1903,6 @@ void PAINT_OT_vertex_paint(wmOperatorType *ot) ot->modal= paint_stroke_modal; /* ot->exec= vpaint_exec; <-- needs stroke property */ ot->poll= vertex_paint_poll; - ot->cancel= vpaint_cancel; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index be985342ea8..20e74702067 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -3559,24 +3559,6 @@ static int sculpt_brush_stroke_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int sculpt_brush_stroke_cancel(bContext *C, wmOperator *op) -{ - Object *ob= CTX_data_active_object(C); - SculptSession *ss = ob->sculpt; - Sculpt *sd = CTX_data_tool_settings(C)->sculpt; - - paint_stroke_cancel(C, op); - - if(ss->cache) { - sculpt_cache_free(ss->cache); - ss->cache = NULL; - } - - sculpt_brush_exit_tex(sd); - - return OPERATOR_CANCELLED; -} - static void SCULPT_OT_brush_stroke(wmOperatorType *ot) { static EnumPropertyItem stroke_mode_items[] = { @@ -3595,7 +3577,6 @@ static void SCULPT_OT_brush_stroke(wmOperatorType *ot) ot->modal= paint_stroke_modal; ot->exec= sculpt_brush_stroke_exec; ot->poll= sculpt_poll; - ot->cancel= sculpt_brush_stroke_cancel; /* flags (sculpt does own undo? (ton) */ ot->flag= OPTYPE_BLOCKING; diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c index adce540cee4..7e881e7e62f 100644 --- a/source/blender/editors/space_image/image_buttons.c +++ b/source/blender/editors/space_image/image_buttons.c @@ -556,20 +556,20 @@ static void uiblock_layer_pass_buttons(uiLayout *layout, RenderResult *rr, Image /* menu buts */ if(render_slot) { strp= slot_menu(); - but= uiDefButS(block, MENU, 0, strp, 0, 0, wmenu1, UI_UNIT_Y, render_slot, 0,0,0,0, "Select Slot"); + but= uiDefButS(block, MENU, 0, strp, 0, 0, wmenu1, 20, render_slot, 0,0,0,0, "Select Slot"); uiButSetFunc(but, image_multi_cb, rr, iuser); MEM_freeN(strp); } if(rr) { strp= layer_menu(rr, &iuser->layer); - but= uiDefButS(block, MENU, 0, strp, 0, 0, wmenu2, UI_UNIT_Y, &iuser->layer, 0,0,0,0, "Select Layer"); + but= uiDefButS(block, MENU, 0, strp, 0, 0, wmenu2, 20, &iuser->layer, 0,0,0,0, "Select Layer"); uiButSetFunc(but, image_multi_cb, rr, iuser); MEM_freeN(strp); rl= BLI_findlink(&rr->layers, iuser->layer - (rr->rectf?1:0)); /* fake compo layer, return NULL is meant to be */ strp= pass_menu(rl, &iuser->pass); - but= uiDefButS(block, MENU, 0, strp, 0, 0, wmenu3, UI_UNIT_Y, &iuser->pass, 0,0,0,0, "Select Pass"); + but= uiDefButS(block, MENU, 0, strp, 0, 0, wmenu3, 20, &iuser->pass, 0,0,0,0, "Select Pass"); uiButSetFunc(but, image_multi_cb, rr, iuser); MEM_freeN(strp); } diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index 99f2ea99efc..d967e2240e6 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -1086,13 +1086,6 @@ static int snode_bg_viewmove_invoke(bContext *C, wmOperator *op, wmEvent *event) return OPERATOR_RUNNING_MODAL; } -static int snode_bg_viewmove_cancel(bContext *UNUSED(C), wmOperator *op) -{ - MEM_freeN(op->customdata); - op->customdata= NULL; - - return OPERATOR_CANCELLED; -} void NODE_OT_backimage_move(wmOperatorType *ot) { @@ -1105,7 +1098,6 @@ void NODE_OT_backimage_move(wmOperatorType *ot) ot->invoke= snode_bg_viewmove_invoke; ot->modal= snode_bg_viewmove_modal; ot->poll= composite_node_active; - ot->cancel= snode_bg_viewmove_cancel; /* flags */ ot->flag= OPTYPE_BLOCKING; @@ -1392,14 +1384,6 @@ static int node_resize_invoke(bContext *C, wmOperator *op, wmEvent *event) return OPERATOR_CANCELLED|OPERATOR_PASS_THROUGH; } -static int node_resize_cancel(bContext *UNUSED(C), wmOperator *op) -{ - MEM_freeN(op->customdata); - op->customdata= NULL; - - return OPERATOR_CANCELLED; -} - void NODE_OT_resize(wmOperatorType *ot) { /* identifiers */ @@ -1410,7 +1394,6 @@ void NODE_OT_resize(wmOperatorType *ot) ot->invoke= node_resize_invoke; ot->modal= node_resize_modal; ot->poll= ED_operator_node_active; - ot->cancel= node_resize_cancel; /* flags */ ot->flag= OPTYPE_BLOCKING; @@ -2296,18 +2279,6 @@ static int node_link_invoke(bContext *C, wmOperator *op, wmEvent *event) } } -static int node_link_cancel(bContext *C, wmOperator *op) -{ - SpaceNode *snode= CTX_wm_space_node(C); - bNodeLinkDrag *nldrag= op->customdata; - - nodeRemLink(snode->edittree, nldrag->link); - BLI_remlink(&snode->linkdrag, nldrag); - MEM_freeN(nldrag); - - return OPERATOR_CANCELLED; -} - void NODE_OT_link(wmOperatorType *ot) { /* identifiers */ @@ -2319,7 +2290,6 @@ void NODE_OT_link(wmOperatorType *ot) ot->modal= node_link_modal; // ot->exec= node_link_exec; ot->poll= ED_operator_node_active; - ot->cancel= node_link_cancel; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; @@ -2432,7 +2402,6 @@ void NODE_OT_links_cut(wmOperatorType *ot) ot->invoke= WM_gesture_lines_invoke; ot->modal= WM_gesture_lines_modal; ot->exec= cut_links_exec; - ot->cancel= WM_gesture_lines_cancel; ot->poll= ED_operator_node_active; diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index 6c2c4cfad13..32e8ae81f90 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -1557,7 +1557,7 @@ static void restore_localviewdata(ScrArea *sa, int free) } } -static void endlocalview(Main *bmain, Scene *scene, ScrArea *sa) +static void endlocalview(Scene *scene, ScrArea *sa) { View3D *v3d= sa->spacedata.first; struct Base *base; @@ -1583,8 +1583,6 @@ static void endlocalview(Main *bmain, Scene *scene, ScrArea *sa) base->object->lay= base->lay; } } - - DAG_on_visible_update(bmain, FALSE); } } @@ -1593,7 +1591,7 @@ static int localview_exec(bContext *C, wmOperator *UNUSED(unused)) View3D *v3d= CTX_wm_view3d(C); if(v3d->localvd) - endlocalview(CTX_data_main(C), CTX_data_scene(C), CTX_wm_area(C)); + endlocalview(CTX_data_scene(C), CTX_wm_area(C)); else initlocalview(CTX_data_main(C), CTX_data_scene(C), CTX_wm_area(C)); diff --git a/source/blender/editors/uvedit/uvedit_parametrizer.c b/source/blender/editors/uvedit/uvedit_parametrizer.c index dd7c336c98e..a9ee65b027b 100644 --- a/source/blender/editors/uvedit/uvedit_parametrizer.c +++ b/source/blender/editors/uvedit/uvedit_parametrizer.c @@ -4140,7 +4140,7 @@ void param_construct_end(ParamHandle *handle, ParamBool fill, ParamBool impl) param_assert(phandle->state == PHANDLE_STATE_ALLOCATED); - phandle->ncharts = p_connect_pairs(phandle, (PBool)impl); + phandle->ncharts = p_connect_pairs(phandle, impl); phandle->charts = p_split_charts(phandle, chart, phandle->ncharts); p_chart_delete(phandle->construction_chart); @@ -4189,7 +4189,7 @@ void param_lscm_begin(ParamHandle *handle, ParamBool live, ParamBool abf) for (i = 0; i < phandle->ncharts; i++) { for (f=phandle->charts[i]->faces; f; f=f->nextlink) p_face_backup_uvs(f); - p_chart_lscm_begin(phandle->charts[i], (PBool)live, (PBool)abf); + p_chart_lscm_begin(phandle->charts[i], live, abf); } } diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index c9440fad6c7..657bfb1c884 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -253,12 +253,19 @@ typedef struct RenderData { */ short yparts; - short planes, imtype, subimtype, quality; + short winpos, planes, imtype, subimtype; + + /** Mode bits: */ + /* 0: Enable backbuffering for images */ + short bufflag; + short quality; /** * Render to image editor, fullscreen or to new window. */ short displaymode; + + short rpad1, rpad2; /** * Flags for render settings. Use bit-masking to access the settings. @@ -315,7 +322,11 @@ typedef struct RenderData { /** * Adjustment factors for the aspect ratio in the x direction, was a short in 2.45 */ - float xasp, yasp; + float xasp; + /** + * Adjustment factors for the aspect ratio in the x direction, was a short in 2.45 + */ + float yasp; float frs_sec_base; @@ -338,8 +349,8 @@ typedef struct RenderData { short bake_normal_space, bake_quad_split; float bake_maxdist, bake_biasdist, bake_pad; - /* path to render output */ - char pic[240]; + /* paths to backbufffer, output */ + char backbuf[160], pic[160]; /* stamps flags. */ int stamp; diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index 3e968647a7a..1057eeae40f 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -305,7 +305,7 @@ typedef struct UserDef { int savetime; char tempdir[160]; // FILE_MAXDIR length char fontdir[160]; - char renderdir[240]; // FILE_MAX length + char renderdir[160]; char textudir[160]; char plugtexdir[160]; char plugseqdir[160]; diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 41d125370bf..4e0027acfe5 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -238,13 +238,6 @@ static void rna_UserDef_weight_color_update(Main *bmain, Scene *scene, PointerRN static void rna_UserDef_viewport_lights_update(Main *bmain, Scene *scene, PointerRNA *ptr) { - /* if all lights are off gpu_draw resets them all, [#27627] - * so disallow them all to be disabled */ - if(U.light[0].flag==0 && U.light[1].flag==0 && U.light[2].flag==0) { - SolidLight *light= ptr->data; - light->flag |= 1; - } - WM_main_add_notifier(NC_SPACE|ND_SPACE_VIEW3D|NS_VIEW3D_GPU, NULL); rna_userdef_update(bmain, scene, ptr); } diff --git a/source/blender/render/intern/include/render_types.h b/source/blender/render/intern/include/render_types.h index b2535ebc9ea..cf16211b6d1 100644 --- a/source/blender/render/intern/include/render_types.h +++ b/source/blender/render/intern/include/render_types.h @@ -214,7 +214,7 @@ struct Render ListBase instancetable; int totinstance; - struct Image *bakebuf; + struct Image *backbuf, *bakebuf; struct GHash *orco_hash; diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index 15fc9d38c01..c1c2fb60abd 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -4665,6 +4665,7 @@ void RE_Database_Free(Render *re) re->totvlak=re->totvert=re->totstrand=re->totlamp=re->tothalo= 0; re->i.convertdone= 0; + re->backbuf= NULL; re->bakebuf= NULL; if(re->scene) diff --git a/source/blender/render/intern/source/envmap.c b/source/blender/render/intern/source/envmap.c index e2ab21ef877..1e40ab886ae 100644 --- a/source/blender/render/intern/source/envmap.c +++ b/source/blender/render/intern/source/envmap.c @@ -149,6 +149,7 @@ static Render *envmap_render_copy(Render *re, EnvMap *env) envre->r.layers.first= envre->r.layers.last= NULL; envre->r.filtertype= 0; envre->r.xparts= envre->r.yparts= 2; + envre->r.bufflag= 0; envre->r.size= 100; envre->r.yasp= envre->r.xasp= 1; diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index 9c66f7f65ae..436f0ecd997 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -2065,6 +2065,36 @@ static void do_render_fields_3d(Render *re) re->display_draw(re->ddh, re->result, NULL); } +static void load_backbuffer(Render *re) +{ + if(re->r.alphamode == R_ADDSKY) { + ImBuf *ibuf; + char name[256]; + + BLI_strncpy(name, re->r.backbuf, sizeof(name)); + BLI_path_abs(name, re->main->name); + BLI_path_frame(name, re->r.cfra, 0); + + if(re->backbuf) { + re->backbuf->id.us--; + if(re->backbuf->id.us<1) + BKE_image_signal(re->backbuf, NULL, IMA_SIGNAL_RELOAD); + } + + re->backbuf= BKE_add_image_file(name); + ibuf= BKE_image_get_ibuf(re->backbuf, NULL); + if(ibuf==NULL) { + // error() doesnt work with render window open + //error("No backbuf there!"); + printf("Error: No backbuf %s\n", name); + } + else { + if (re->r.mode & R_FIELDS) + image_de_interlace(re->backbuf, re->r.mode & R_ODDFIELD); + } + } +} + /* main render routine, no compositing */ static void do_render_fields_blur_3d(Render *re) { @@ -2075,6 +2105,10 @@ static void do_render_fields_blur_3d(Render *re) G.afbreek= 1; return; } + + /* backbuffer initialize */ + if(re->r.bufflag & 1) + load_backbuffer(re); /* now use renderdata and camera to set viewplane */ RE_SetCamera(re, camera); diff --git a/source/blender/render/intern/source/pixelshading.c b/source/blender/render/intern/source/pixelshading.c index 56a1c870904..2d42938f6ac 100644 --- a/source/blender/render/intern/source/pixelshading.c +++ b/source/blender/render/intern/source/pixelshading.c @@ -502,6 +502,21 @@ int shadeHaloFloat(HaloRen *har, float *col, int zz, /* ------------------------------------------------------------------------- */ +static void fillBackgroundImage(float *collector, float fx, float fy) +{ + collector[0] = 0.0; + collector[1] = 0.0; + collector[2] = 0.0; + collector[3] = 0.0; + + if(R.backbuf) { + float dx= 1.0f/(float)R.winx; + float dy= 1.0f/(float)R.winy; + + image_sample(R.backbuf, fx*dx, fy*dy, dx, dy, collector); + } +} + /* Only view vector is important here. Result goes to colf[3] */ void shadeSkyView(float *colf, float *rco, float *view, float *dxyview, short thread) { @@ -611,14 +626,18 @@ void shadeSkyPixel(float *collector, float fx, float fy, short thread) float fac; - if((R.wrld.skytype & (WO_SKYBLEND+WO_SKYTEX))==0) { - /* 1. solid color */ + /* 1. Do a backbuffer image: */ + if(R.r.bufflag & 1) { + fillBackgroundImage(collector, fx, fy); + } + else if((R.wrld.skytype & (WO_SKYBLEND+WO_SKYTEX))==0) { + /* 2. solid color */ VECCOPY(collector, &R.wrld.horr); collector[3] = 0.0f; } else { - /* 2. */ + /* 3. */ /* This one true because of the context of this routine */ if(R.wrld.skytype & WO_SKYPAPER) { diff --git a/source/blender/windowmanager/CMakeLists.txt b/source/blender/windowmanager/CMakeLists.txt index 6f03928e1fc..0cf59a9b598 100644 --- a/source/blender/windowmanager/CMakeLists.txt +++ b/source/blender/windowmanager/CMakeLists.txt @@ -43,6 +43,9 @@ set(INC ../../../intern/ghost ../../../intern/opennl/extern ../../../source/gameengine/BlenderRoutines +) + +set(INC_SYS ${ZLIB_INCLUDE_DIRS} ${OPENGL_INCLUDE_DIR} ${GLEW_INCLUDE_PATH} @@ -50,7 +53,6 @@ set(INC set(SRC intern/wm.c - intern/wm_apple.c intern/wm_cursors.c intern/wm_dragdrop.c intern/wm_draw.c @@ -87,17 +89,18 @@ if(WITH_OPENCOLLADA) endif() if(WITH_CODEC_QUICKTIME) - list(APPEND INC ../quicktime ${QUICKTIME_INC}) + list(APPEND INC ../quicktime) + list(APPEND INC_SYS ${QUICKTIME_INC}) add_definitions(-DWITH_QUICKTIME) endif() if(WITH_CODEC_FFMPEG) - list(APPEND INC ${FFMPEG_INC}) + list(APPEND INC_SYS ${FFMPEG_INC}) add_definitions(-DWITH_FFMPEG) endif() if(WITH_PYTHON) - list(APPEND INC ../python ${PYTHON_INCLUDE_DIRS}) + list(APPEND INC ../python) add_definitions(-DWITH_PYTHON) if(WITH_PYTHON_SECURITY) @@ -109,12 +112,16 @@ if(WITH_GAMEENGINE) add_definitions(-DWITH_GAMEENGINE) endif() -if(WITH_COCOA) - list(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/wm_apple.c") +if(APPLE) + if(NOT WITH_COCOA) + list(APPEND SRC + intern/wm_apple.c + ) + endif() endif() if(WITH_BUILDINFO) add_definitions(-DNAN_BUILDINFO) endif() -blender_add_lib_nolist(bf_windowmanager "${SRC}" "${INC}") +blender_add_lib_nolist(bf_windowmanager "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/blenderplayer/CMakeLists.txt b/source/blenderplayer/CMakeLists.txt index 5fe045fda10..901aaea3eca 100644 --- a/source/blenderplayer/CMakeLists.txt +++ b/source/blenderplayer/CMakeLists.txt @@ -183,12 +183,6 @@ endif() message(STATUS "Player Skipping: (${REM_MSG})") endif() target_link_libraries(blenderplayer ${BLENDER_SORTED_LIBS}) - - unset(SEARCHLIB) - unset(SORTLIB) - unset(REMLIB) - unset(REM_MSG) - # else() # target_link_libraries(blenderplayer ${BLENDER_LINK_LIBS}) # endif() diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index d089e7e98ba..4bb0437ed6f 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -876,12 +876,6 @@ endif() message(STATUS "Blender Skipping: (${REM_MSG})") endif() target_link_libraries(blender ${BLENDER_SORTED_LIBS}) - - unset(SEARCHLIB) - unset(SORTLIB) - unset(REMLIB) - unset(REM_MSG) - #else() # target_link_libraries(blender ${BLENDER_LINK_LIBS}) #endif() diff --git a/source/creator/creator.c b/source/creator/creator.c index 2a963db1746..6e9ecf234fc 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -538,7 +538,7 @@ static int set_output(int argc, const char **argv, void *data) if (argc >= 1){ if (CTX_data_scene(C)) { Scene *scene= CTX_data_scene(C); - BLI_strncpy(scene->r.pic, argv[1], sizeof(scene->r.pic)); + BLI_strncpy(scene->r.pic, argv[1], FILE_MAXDIR); } else { printf("\nError: no blend loaded. cannot use '-o / --render-output'.\n"); } |