[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [39396] branches/soc-2011-salad: Merging r39392 through r39395 from trunk into soc-2011-salad
Sergey Sharybin
g.ulairi at gmail.com
Sun Aug 14 14:43:35 CEST 2011
Revision: 39396
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39396
Author: nazgul
Date: 2011-08-14 12:43:35 +0000 (Sun, 14 Aug 2011)
Log Message:
-----------
Merging r39392 through r39395 from trunk into soc-2011-salad
Revision Links:
--------------
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39392
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39395
Modified Paths:
--------------
branches/soc-2011-salad/source/blender/editors/interface/interface_intern.h
branches/soc-2011-salad/source/blender/editors/interface/interface_layout.c
branches/soc-2011-salad/source/blender/editors/mesh/editmesh.c
Property Changed:
----------------
branches/soc-2011-salad/
branches/soc-2011-salad/source/blender/editors/space_outliner/
Property changes on: branches/soc-2011-salad
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/soc-2010-jwilkins:28499-37009
/branches/soc-2010-nicolasbishop:28448-30783,30792-30793,30797-30798,30815
/branches/soc-2011-carrot:36828-39099
/branches/soc-2011-cucumber:36829-36994
/branches/soc-2011-onion:36833-38309
/branches/soc-2011-pepper:36830-39215
/branches/soc-2011-tomato:36831-39394
/trunk/blender:36834-39391
+ /branches/soc-2010-jwilkins:28499-37009
/branches/soc-2010-nicolasbishop:28448-30783,30792-30793,30797-30798,30815
/branches/soc-2011-carrot:36828-39099
/branches/soc-2011-cucumber:36829-36994
/branches/soc-2011-onion:36833-38309
/branches/soc-2011-pepper:36830-39215
/branches/soc-2011-tomato:36831-39394
/trunk/blender:36834-39395
Modified: branches/soc-2011-salad/source/blender/editors/interface/interface_intern.h
===================================================================
--- branches/soc-2011-salad/source/blender/editors/interface/interface_intern.h 2011-08-14 12:42:43 UTC (rev 39395)
+++ branches/soc-2011-salad/source/blender/editors/interface/interface_intern.h 2011-08-14 12:43:35 UTC (rev 39396)
@@ -213,7 +213,7 @@
BIFIconID icon;
char lock;
- char dt;
+ char dt; /* drawtype: UI_EMBOSS, UI_EMBOSSN ... etc, copied from the block */
char changed; /* could be made into a single flag */
unsigned char unit_type; /* so buttons can support unit systems which are not RNA */
short modifier_key;
@@ -306,7 +306,8 @@
void *drawextra_arg2;
int flag;
- char direction, dt;
+ char direction;
+ char dt; /* drawtype: UI_EMBOSS, UI_EMBOSSN ... etc, copied to buttons */
short auto_open;
double auto_open_last;
Modified: branches/soc-2011-salad/source/blender/editors/interface/interface_layout.c
===================================================================
--- branches/soc-2011-salad/source/blender/editors/interface/interface_layout.c 2011-08-14 12:42:43 UTC (rev 39395)
+++ branches/soc-2011-salad/source/blender/editors/interface/interface_layout.c 2011-08-14 12:43:35 UTC (rev 39396)
@@ -355,65 +355,46 @@
uiDefBut(block, LABEL, 0, name, 0, 0, w, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
/* create buttons */
- if(type == PROP_BOOLEAN) {
- if(ELEM(subtype, PROP_LAYER, PROP_LAYER_MEMBER)) {
- /* special check for layer layout */
- int butw, buth, unit;
- int cols= (len >= 20)? 2: 1;
- int colbuts= len/(2*cols);
- int layer_used= 0;
+ if(type == PROP_BOOLEAN && ELEM(subtype, PROP_LAYER, PROP_LAYER_MEMBER)) {
+ /* special check for layer layout */
+ int butw, buth, unit;
+ int cols= (len >= 20)? 2: 1;
+ int colbuts= len/(2*cols);
+ int layer_used= 0;
- uiBlockSetCurLayout(block, uiLayoutAbsolute(layout, 0));
+ uiBlockSetCurLayout(block, uiLayoutAbsolute(layout, 0));
- unit= UI_UNIT_X*0.75;
- butw= unit;
- buth= unit;
+ unit= UI_UNIT_X*0.75;
+ butw= unit;
+ buth= unit;
- if(ptr->type == &RNA_Armature) {
- bArmature *arm= (bArmature *)ptr->data;
- layer_used= arm->layer_used;
- }
-
- for(b=0; b<cols; b++) {
- uiBlockBeginAlign(block);
-
- for(a=0; a<colbuts; a++) {
- if(layer_used & (1<<(a+b*colbuts))) icon= ICON_LAYER_USED;
- else icon= ICON_BLANK1;
-
- but= uiDefAutoButR(block, ptr, prop, a+b*colbuts, "", icon, x + butw*a, y+buth, butw, buth);
- if(subtype == PROP_LAYER_MEMBER)
- uiButSetFunc(but, ui_layer_but_cb, but, SET_INT_IN_POINTER(a+b*colbuts));
- }
- for(a=0; a<colbuts; a++) {
- if(layer_used & (1<<(a+len/2+b*colbuts))) icon= ICON_LAYER_USED;
- else icon= ICON_BLANK1;
-
- but= uiDefAutoButR(block, ptr, prop, a+len/2+b*colbuts, "", icon, x + butw*a, y, butw, buth);
- if(subtype == PROP_LAYER_MEMBER)
- uiButSetFunc(but, ui_layer_but_cb, but, SET_INT_IN_POINTER(a+len/2+b*colbuts));
- }
- uiBlockEndAlign(block);
-
- x += colbuts*butw + style->buttonspacex;
- }
+ if(ptr->type == &RNA_Armature) {
+ bArmature *arm= (bArmature *)ptr->data;
+ layer_used= arm->layer_used;
}
- else {
- /* not common, but good to support non layer boolean arrays */
- int *tmparray= MEM_callocN(sizeof(int)*len, "ui_item_array");
- RNA_property_boolean_get_array(ptr, prop, tmparray);
+ for(b=0; b<cols; b++) {
uiBlockBeginAlign(block);
- for(a=0; a<len; a++) {
- /* always override the icon for boolean arrays */
- icon= tmparray[a] ? ICON_CHECKBOX_HLT: ICON_CHECKBOX_DEHLT;
- uiDefAutoButR(block, ptr, prop, a, NULL, icon, 0, 0, w, UI_UNIT_Y);
+ for(a=0; a<colbuts; a++) {
+ if(layer_used & (1<<(a+b*colbuts))) icon= ICON_LAYER_USED;
+ else icon= ICON_BLANK1;
+
+ but= uiDefAutoButR(block, ptr, prop, a+b*colbuts, "", icon, x + butw*a, y+buth, butw, buth);
+ if(subtype == PROP_LAYER_MEMBER)
+ uiButSetFunc(but, ui_layer_but_cb, but, SET_INT_IN_POINTER(a+b*colbuts));
}
+ for(a=0; a<colbuts; a++) {
+ if(layer_used & (1<<(a+len/2+b*colbuts))) icon= ICON_LAYER_USED;
+ else icon= ICON_BLANK1;
- MEM_freeN(tmparray);
-
+ but= uiDefAutoButR(block, ptr, prop, a+len/2+b*colbuts, "", icon, x + butw*a, y, butw, buth);
+ if(subtype == PROP_LAYER_MEMBER)
+ uiButSetFunc(but, ui_layer_but_cb, but, SET_INT_IN_POINTER(a+len/2+b*colbuts));
+ }
uiBlockEndAlign(block);
+
+ x += colbuts*butw + style->buttonspacex;
}
}
else if(subtype == PROP_MATRIX) {
@@ -441,35 +422,46 @@
uiDefButR_prop(block, BUT_NORMAL, 0, name, x, y, UI_UNIT_X*3, UI_UNIT_Y*3, ptr, prop, 0, 0, 0, -1, -1, NULL);
}
else {
- if(ELEM(subtype, PROP_COLOR, PROP_COLOR_GAMMA) && !expand)
+ /* note, this block of code is a bit arbitrary and has just been made
+ * to work with common cases, but may need to be re-worked */
+
+ /* special case, boolean array in a menu, this could be used in a more generic way too */
+ if(ELEM(subtype, PROP_COLOR, PROP_COLOR_GAMMA) && !expand) {
uiDefAutoButR(block, ptr, prop, -1, "", ICON_NONE, 0, 0, w, UI_UNIT_Y);
+ }
+ else {
+ int *boolarr= NULL;
- if(!ELEM(subtype, PROP_COLOR, PROP_COLOR_GAMMA) || expand) {
+ /* even if 'expand' is fale, expanding anyway */
+
/* layout for known array subtypes */
- char str[3];
+ char str[3]= {'\0'};
- for(a=0; a<len; a++) {
- str[0]= RNA_property_array_item_char(prop, a);
-
- if(str[0]) {
- if (icon_only) {
- str[0] = '\0';
- }
- else if(type == PROP_BOOLEAN) {
- str[1]= '\0';
- }
- else {
- str[1]= ':';
- str[2]= '\0';
- }
+ if(!icon_only) {
+ if(type != PROP_BOOLEAN) {
+ str[1]= ':';
}
+ }
+ /* show checkboxes for rna on a non-emboss block (menu for eg) */
+ if(type == PROP_BOOLEAN && ELEM(layout->root->block->dt, UI_EMBOSSN, UI_EMBOSSP)) {
+ boolarr= MEM_callocN(sizeof(int)*len, "ui_item_array");
+ RNA_property_boolean_get_array(ptr, prop, boolarr);
+ }
+
+ for(a=0; a<len; a++) {
+ if(!icon_only) str[0]= RNA_property_array_item_char(prop, a);
+ if(boolarr) icon= boolarr[a] ? ICON_CHECKBOX_HLT: ICON_CHECKBOX_DEHLT;
but= uiDefAutoButR(block, ptr, prop, a, str, icon, 0, 0, w, UI_UNIT_Y);
if(slider && but->type==NUM)
but->type= NUMSLI;
if(toggle && but->type==OPTION)
but->type= TOG;
}
+
+ if(boolarr) {
+ MEM_freeN(boolarr);
+ }
}
}
Modified: branches/soc-2011-salad/source/blender/editors/mesh/editmesh.c
===================================================================
--- branches/soc-2011-salad/source/blender/editors/mesh/editmesh.c 2011-08-14 12:42:43 UTC (rev 39395)
+++ branches/soc-2011-salad/source/blender/editors/mesh/editmesh.c 2011-08-14 12:43:35 UTC (rev 39396)
@@ -1449,9 +1449,8 @@
/* select the material */
EM_select_by_material(em, curr_mat);
/* and now separate */
- if(0==mesh_separate_selected(op, bmain, scene, editbase)) {
- BKE_mesh_end_editmesh(me, em);
- return 0;
+ if(em->totfacesel > 0) {
+ mesh_separate_selected(op, bmain, scene, editbase);
}
}
Property changes on: branches/soc-2011-salad/source/blender/editors/space_outliner
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/soc-2011-pepper/source/blender/editors/space_outliner:36831-38987
/branches/soc-2011-tomato/source/blender/editors/space_outliner:39253-39394
/trunk/blender/source/blender/editors/space_outliner:36834-39390
+ /branches/soc-2011-pepper/source/blender/editors/space_outliner:36831-38987
/branches/soc-2011-tomato/source/blender/editors/space_outliner:39253-39394
/trunk/blender/source/blender/editors/space_outliner:36834-39395
More information about the Bf-blender-cvs
mailing list