Merging r38740 through r38764 from trunk into vgroup_modifiers.

This commit is contained in:
2011-07-27 18:57:57 +00:00
20 changed files with 74 additions and 67 deletions

View File

@@ -33,22 +33,21 @@ class TEXT_HT_header(bpy.types.Header):
row.template_header()
if context.area.show_menus:
sub = row.row(align=True)
sub.menu("TEXT_MT_view")
sub.menu("TEXT_MT_text")
row.menu("TEXT_MT_view")
row.menu("TEXT_MT_text")
if text:
sub.menu("TEXT_MT_edit")
sub.menu("TEXT_MT_format")
row.menu("TEXT_MT_edit")
row.menu("TEXT_MT_format")
sub.menu("TEXT_MT_templates")
row.menu("TEXT_MT_templates")
if text and text.is_modified:
row = layout.row()
row.alert = True
row.operator("text.resolve_conflict", text="", icon='HELP')
sub = row.row()
sub.alert = True
sub.operator("text.resolve_conflict", text="", icon='HELP')
layout.template_ID(st, "text", new="text.new", unlink="text.unlink")
row.template_ID(st, "text", new="text.new", unlink="text.unlink")
row = layout.row(align=True)
row.prop(st, "show_line_numbers", text="")

View File

@@ -79,19 +79,22 @@ class VIEW3D_HT_header(bpy.types.Header):
row.prop(toolsettings, "proportional_edit_falloff", text="", icon_only=True)
# Snap
snap_element = toolsettings.snap_element
row = layout.row(align=True)
row.prop(toolsettings, "use_snap", text="")
row.prop(toolsettings, "snap_element", text="", icon_only=True)
if toolsettings.snap_element != 'INCREMENT':
if snap_element != 'INCREMENT':
row.prop(toolsettings, "snap_target", text="")
if obj and obj.mode == 'OBJECT':
row.prop(toolsettings, "use_snap_align_rotation", text="")
if toolsettings.snap_element == 'VOLUME':
if obj:
if obj.mode == 'OBJECT':
row.prop(toolsettings, "use_snap_align_rotation", text="")
elif obj.mode == 'EDIT':
row.prop(toolsettings, "use_snap_self", text="")
if snap_element == 'VOLUME':
row.prop(toolsettings, "use_snap_peel_object", text="")
elif toolsettings.snap_element == 'FACE':
elif snap_element == 'FACE':
row.prop(toolsettings, "use_snap_project", text="")
if toolsettings.use_snap_project and obj.mode == 'EDIT':
row.prop(toolsettings, "use_snap_project_self", text="")
# OpenGL render
row = layout.row(align=True)

View File

@@ -1287,6 +1287,7 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm, int (*setMaterial)(int, vo
QUATCOPY((float *)&varray[elementsize*curface*3+offset+elementsize*2], tang);
offset += sizeof(float)*4;
}
(void)offset;
}
curface++;
if(mface->v4) {
@@ -1327,6 +1328,7 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm, int (*setMaterial)(int, vo
QUATCOPY((float *)&varray[elementsize*curface*3+offset+elementsize*2], tang);
offset += sizeof(float)*4;
}
(void)offset;
}
curface++;
i++;

View File

@@ -466,7 +466,6 @@ static void layerInterp_mdisps(void **sources, float *UNUSED(weights),
MDisps tris[2];
int vindex[4] = {0};
S = 0;
for(i = 0; i < 2; i++)
for(y = 0; y < 4; y++)
for(x = 0; x < 4; x++)

View File

@@ -2373,7 +2373,7 @@ static void RVBlurBitmap2_float ( float* map, int width,int height,
/* Blancmange (bmange@airdmhor.gen.nz) */
k = -1.0f/(2.0f*(float)M_PI*blur*blur);
fval=0;
for (ix = 0;ix< halfWidth;ix++){
weight = (float)exp(k*(ix*ix));
filter[halfWidth - ix] = weight;

View File

@@ -1423,6 +1423,8 @@ void txt_insert_buf(Text *text, const char *in_buffer)
}
undoing= u;
(void)count;
}
/******************/

View File

@@ -1478,10 +1478,8 @@ static int armature_select_linked_invoke(bContext *C, wmOperator *op, wmEvent *e
bArmature *arm;
EditBone *bone, *curBone, *next;
int extend= RNA_boolean_get(op->ptr, "extend");
ARegion *ar;
Object *obedit= CTX_data_edit_object(C);
arm= obedit->data;
ar= CTX_wm_region(C);
view3d_operator_needs_opengl(C);

View File

@@ -1879,7 +1879,6 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle
if(but->autocomplete_func || data->searchbox) {
changed= ui_textedit_autocomplete(C, but, data);
update= 1; /* do live update for tab key */
retval= WM_UI_HANDLER_BREAK;
}
/* the hotkey here is not well defined, was G.qual so we check all */
else if(event->shift || event->ctrl || event->alt || event->oskey) {
@@ -2325,8 +2324,8 @@ static float ui_numedit_apply_snapf(uiBut *but, float tempf, float softmin, floa
if(fac != 1.0f) {
/* snap in unit-space */
tempf /= fac;
softmin /= fac;
softmax /= fac;
/* softmin /= fac; */ /* UNUSED */
/* softmax /= fac; */ /* UNUSED */
softrange /= fac;
}
@@ -3469,13 +3468,13 @@ static int ui_numedit_but_CURVE(uiBut *but, uiHandleButtonData *data, int snap,
CurveMapping *cumap= (CurveMapping*)but->poin;
CurveMap *cuma= cumap->cm+cumap->cur;
CurveMapPoint *cmp= cuma->curve;
float fx, fy, zoomx, zoomy, offsx, offsy;
float fx, fy, zoomx, zoomy /*, offsx, offsy */ /* UNUSED */;
int a, changed= 0;
zoomx= (but->x2-but->x1)/(cumap->curr.xmax-cumap->curr.xmin);
zoomy= (but->y2-but->y1)/(cumap->curr.ymax-cumap->curr.ymin);
offsx= cumap->curr.xmin;
offsy= cumap->curr.ymin;
/* offsx= cumap->curr.xmin; */
/* offsy= cumap->curr.ymin; */
if(snap) {
float d[2];

View File

@@ -149,10 +149,10 @@ typedef struct uiLayoutItemBx {
uiBut *roundbox;
} uiLayoutItemBx;
typedef struct uiLayoutItemSplt {
typedef struct uiLayoutItemSplit {
uiLayout litem;
float percentage;
} uiLayoutItemSplt;
} uiLayoutItemSplit;
typedef struct uiLayoutItemRoot {
uiLayout litem;
@@ -1615,7 +1615,7 @@ static void ui_litem_layout_row(uiLayout *litem)
int x, y, w, tot, totw, neww, itemw, minw, itemh, offset;
int fixedw, freew, fixedx, freex, flag= 0, lastw= 0;
x= litem->x;
/* x= litem->x; */ /* UNUSED */
y= litem->y;
w= litem->w;
totw= 0;
@@ -2020,7 +2020,7 @@ static void ui_litem_estimate_split(uiLayout *litem)
static void ui_litem_layout_split(uiLayout *litem)
{
uiLayoutItemSplt *split= (uiLayoutItemSplt*)litem;
uiLayoutItemSplit *split= (uiLayoutItemSplit*)litem;
uiItem *item;
float percentage;
const int tot= BLI_countlist(&litem->items);
@@ -2242,9 +2242,9 @@ uiLayout *uiLayoutOverlap(uiLayout *layout)
uiLayout *uiLayoutSplit(uiLayout *layout, float percentage, int align)
{
uiLayoutItemSplt *split;
uiLayoutItemSplit *split;
split= MEM_callocN(sizeof(uiLayoutItemSplt), "uiLayoutItemSplt");
split= MEM_callocN(sizeof(uiLayoutItemSplit), "uiLayoutItemSplit");
split->litem.item.type= ITEM_LAYOUT_SPLIT;
split->litem.root= layout->root;
split->litem.align= align;

View File

@@ -575,8 +575,8 @@ void ui_draw_aligned_panel(uiStyle *style, uiBlock *block, rcti *rect)
ui_draw_tria_rect(&itemrect, 'h');
else
ui_draw_tria_rect(&itemrect, 'v');
(void)ofsx;
}
/************************** panel alignment *************************/

View File

@@ -2197,7 +2197,7 @@ void uiTemplateList(uiLayout *layout, bContext *C, PointerRNA *ptr, const char *
/* create list items */
RNA_PROP_BEGIN(ptr, itemptr, prop) {
/* create button */
if(i == 9)
if(!(i % 9))
row= uiLayoutRow(col, 0);
icon= list_item_icon_get(C, &itemptr, rnaicon, 1);
@@ -2212,7 +2212,6 @@ void uiTemplateList(uiLayout *layout, bContext *C, PointerRNA *ptr, const char *
}
else if(listtype == 'c') {
/* compact layout */
found= 0;
row= uiLayoutRow(layout, 1);

View File

@@ -781,14 +781,15 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
iconbutw, UI_UNIT_Y, NULL, 0.0, 0.0, 1.0, 0.5, "");
}
{ /* always hide/reveal unused sockets */
int shade;
// XXX re-enable
/* int shade;
if(node_has_hidden_sockets(node))
shade= -40;
else
shade= -90; */
iconofs-=iconbutw;
// XXX re-enable
/*if(node_has_hidden_sockets(node))
shade= -40;
else*/
shade= -90;
uiDefIconBut(node->block, LABEL, B_REDR, ICON_PLUS, iconofs, rct->ymax-NODE_DY,
iconbutw, UI_UNIT_Y, NULL, 0.0, 0.0, 1.0, 0.5, "");
}

View File

@@ -1101,7 +1101,7 @@ void NODE_OT_backimage_move(wmOperatorType *ot)
ot->cancel= snode_bg_viewmove_cancel;
/* flags */
ot->flag= OPTYPE_BLOCKING;
ot->flag= OPTYPE_BLOCKING|OPTYPE_GRAB_POINTER;
}
static int backimage_zoom(bContext *C, wmOperator *op)

View File

@@ -303,7 +303,7 @@ static int sequencer_add_generic_strip_exec(bContext *C, wmOperator *op, SeqLoad
Scene *scene= CTX_data_scene(C); /* only for sound */
Editing *ed= seq_give_editing(scene, TRUE);
SeqLoadInfo seq_load;
Sequence *seq;
/* Sequence *seq; */ /* UNUSED */
int tot_files;
seq_load_operator_info(&seq_load, op);
@@ -324,13 +324,13 @@ static int sequencer_add_generic_strip_exec(bContext *C, wmOperator *op, SeqLoad
RNA_string_get(&itemptr, "name", file_only);
BLI_join_dirfile(seq_load.path, sizeof(seq_load.path), dir_only, file_only);
seq= seq_load_func(C, ed->seqbasep, &seq_load);
/* seq= */ seq_load_func(C, ed->seqbasep, &seq_load);
}
RNA_END;
}
else {
/* single file */
seq= seq_load_func(C, ed->seqbasep, &seq_load);
/* seq= */ seq_load_func(C, ed->seqbasep, &seq_load);
}
if (seq_load.tot_success==0) {

View File

@@ -36,6 +36,7 @@
#include <string.h>
#include <ctype.h> /* ispunct */
#include <sys/stat.h>
#include <errno.h>
#include "MEM_guardedalloc.h"
@@ -449,15 +450,14 @@ static void txt_write_file(Text *text, ReportList *reports)
FILE *fp;
TextLine *tmp;
struct stat st;
int res;
char file[FILE_MAXDIR+FILE_MAXFILE];
char filepath[FILE_MAXDIR+FILE_MAXFILE];
BLI_strncpy(file, text->name, FILE_MAXDIR+FILE_MAXFILE);
BLI_path_abs(file, G.main->name);
BLI_strncpy(filepath, text->name, FILE_MAXDIR+FILE_MAXFILE);
BLI_path_abs(filepath, G.main->name);
fp= fopen(file, "w");
fp= fopen(filepath, "w");
if(fp==NULL) {
BKE_report(reports, RPT_ERROR, "Unable to save file.");
BKE_reportf(reports, RPT_ERROR, "Unable to save \"%s\": %s.", filepath, errno ? strerror(errno) : "Unknown error writing file");
return;
}
@@ -471,8 +471,13 @@ static void txt_write_file(Text *text, ReportList *reports)
fclose (fp);
res= stat(file, &st);
text->mtime= st.st_mtime;
if(stat(filepath, &st) == 0) {
text->mtime= st.st_mtime;
}
else {
text->mtime= 0;
BKE_reportf(reports, RPT_WARNING, "Unable to stat \"%s\": %s.", filepath, errno ? strerror(errno) : "Unknown error starrng file");
}
if(text->flags & TXT_ISDIRTY)
text->flags ^= TXT_ISDIRTY;

View File

@@ -96,7 +96,7 @@ typedef struct TransSnap {
short modeSelect;
short align;
char project;
char project_self;
char snap_self;
short peel;
short status;
float snapPoint[3]; /* snapping from this point */

View File

@@ -392,7 +392,7 @@ static void initSnappingMode(TransInfo *t)
}
else
{
t->tsnap.modeSelect = t->tsnap.project_self ? SNAP_ALL : SNAP_NOT_OBEDIT;
t->tsnap.modeSelect = t->tsnap.snap_self ? SNAP_ALL : SNAP_NOT_OBEDIT;
}
}
/* Particles edit mode*/
@@ -458,9 +458,9 @@ void initSnapping(TransInfo *t, wmOperator *op)
t->tsnap.project = RNA_boolean_get(op->ptr, "use_snap_project");
}
if (RNA_struct_find_property(op->ptr, "use_snap_project_self"))
if (RNA_struct_find_property(op->ptr, "use_snap_self"))
{
t->tsnap.project = RNA_boolean_get(op->ptr, "use_snap_project_self");
t->tsnap.snap_self = RNA_boolean_get(op->ptr, "use_snap_self");
}
}
}
@@ -473,7 +473,7 @@ void initSnapping(TransInfo *t, wmOperator *op)
t->tsnap.align = ((t->settings->snap_flag & SCE_SNAP_ROTATE) == SCE_SNAP_ROTATE);
t->tsnap.project = ((t->settings->snap_flag & SCE_SNAP_PROJECT) == SCE_SNAP_PROJECT);
t->tsnap.project_self = !((t->settings->snap_flag & SCE_SNAP_PROJECT_NO_SELF) == SCE_SNAP_PROJECT_NO_SELF);
t->tsnap.snap_self = !((t->settings->snap_flag & SCE_SNAP_NO_SELF) == SCE_SNAP_NO_SELF);
t->tsnap.peel = ((t->settings->snap_flag & SCE_SNAP_PROJECT) == SCE_SNAP_PROJECT);
}
@@ -1944,9 +1944,9 @@ static void applyGrid(TransInfo *t, float *val, int max_index, float fac[3], Gea
int i;
float asp[3] = {1.0f, 1.0f, 1.0f}; // TODO: Remove hard coded limit here (3)
if(max_index > 3) {
if(max_index > 2) {
printf("applyGrid: invalid index %d, clamping\n", max_index);
max_index= 3;
max_index= 2;
}
// Early bailing out if no need to snap

View File

@@ -671,7 +671,7 @@ static void shade_one_light(GPUShadeInput *shi, GPUShadeResult *shr, GPULamp *la
i = is;
GPU_link(mat, "shade_visifac", i, visifac, shi->refl, &i);
vn = shi->vn;
/*if(ma->mode & MA_TANGENT_VN)
GPU_link(mat, "shade_tangent_v_spec", GPU_attribute(CD_TANGENT, ""), &vn);*/

View File

@@ -1074,7 +1074,7 @@ typedef struct Scene {
#define SCE_SNAP_ROTATE 2
#define SCE_SNAP_PEEL_OBJECT 4
#define SCE_SNAP_PROJECT 8
#define SCE_SNAP_PROJECT_NO_SELF 16
#define SCE_SNAP_NO_SELF 16
/* toolsettings->snap_target */
#define SCE_SNAP_TARGET_CLOSEST 0
#define SCE_SNAP_TARGET_CENTER 1

View File

@@ -1178,9 +1178,9 @@ static void rna_def_tool_settings(BlenderRNA *brna)
RNA_def_property_ui_icon(prop, ICON_RETOPO, 0);
RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
prop= RNA_def_property(srna, "use_snap_project_self", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "snap_flag", SCE_SNAP_PROJECT_NO_SELF);
RNA_def_property_ui_text(prop, "Project to Self", "Project into its self (editmode)");
prop= RNA_def_property(srna, "use_snap_self", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "snap_flag", SCE_SNAP_NO_SELF);
RNA_def_property_ui_text(prop, "Project to Self", "Snap onto its self (editmode)");
RNA_def_property_ui_icon(prop, ICON_ORTHO, 0);
RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */