[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [18928] branches/blender2.5/blender/source /blender: 2.5
Ton Roosendaal
ton at blender.org
Wed Feb 11 17:54:58 CET 2009
Revision: 18928
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=18928
Author: ton
Date: 2009-02-11 17:54:55 +0100 (Wed, 11 Feb 2009)
Log Message:
-----------
2.5
Smaller jobs, all in one commit!
- Moved object_do_update out of view3d drawing, into
the event system (currently after notifiers).
Depsgraph calls for setting update flags will have to
keep track of each Screen's needs, so a UI showing only
a Sequencer doesn't do objects.
- Added button in "Properties region" in 3D window to set
or disable 4-split, including the 3 options it has.
(lock, box, clip)
- Restored legacy code for UI, to make things work like
bone rename, autocomplete.
- Node editor now shows Curves widgets again
- Bugfix: composite job increased Viewer user id count
- Bugfix: Node editor, not "Enable nodes" still called
a Job, which didn't do anything
- Various code cleaning, unused vars and prototypes.
Modified Paths:
--------------
branches/blender2.5/blender/source/blender/blenkernel/intern/node.c
branches/blender2.5/blender/source/blender/editors/armature/editarmature.c
branches/blender2.5/blender/source/blender/editors/include/UI_interface.h
branches/blender2.5/blender/source/blender/editors/interface/interface.c
branches/blender2.5/blender/source/blender/editors/interface/interface_draw.c
branches/blender2.5/blender/source/blender/editors/interface/interface_intern.h
branches/blender2.5/blender/source/blender/editors/interface/interface_utils.c
branches/blender2.5/blender/source/blender/editors/object/object_edit.c
branches/blender2.5/blender/source/blender/editors/physics/ed_fluidsim.c
branches/blender2.5/blender/source/blender/editors/space_action/action_header.c
branches/blender2.5/blender/source/blender/editors/space_node/drawnode.c
branches/blender2.5/blender/source/blender/editors/space_node/space_node.c
branches/blender2.5/blender/source/blender/editors/space_view3d/view3d_buttons.c
branches/blender2.5/blender/source/blender/editors/space_view3d/view3d_draw.c
branches/blender2.5/blender/source/blender/editors/space_view3d/view3d_edit.c
branches/blender2.5/blender/source/blender/editors/space_view3d/view3d_intern.h
branches/blender2.5/blender/source/blender/makesdna/DNA_view3d_types.h
branches/blender2.5/blender/source/blender/windowmanager/intern/wm_event_system.c
Modified: branches/blender2.5/blender/source/blender/blenkernel/intern/node.c
===================================================================
--- branches/blender2.5/blender/source/blender/blenkernel/intern/node.c 2009-02-11 16:17:34 UTC (rev 18927)
+++ branches/blender2.5/blender/source/blender/blenkernel/intern/node.c 2009-02-11 16:54:55 UTC (rev 18928)
@@ -1012,8 +1012,7 @@
oldsock->new_sock= sock;
}
- if(nnode->id)
- nnode->id->us++;
+ /* don't increase node->id users, freenode doesn't decrement either */
if(node->typeinfo->copystoragefunc)
node->typeinfo->copystoragefunc(node, nnode);
Modified: branches/blender2.5/blender/source/blender/editors/armature/editarmature.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/armature/editarmature.c 2009-02-11 16:17:34 UTC (rev 18927)
+++ branches/blender2.5/blender/source/blender/editors/armature/editarmature.c 2009-02-11 16:54:55 UTC (rev 18928)
@@ -4386,7 +4386,6 @@
Object *ob= CTX_data_active_object(C);
bArmature *arm= ob->data;
bPoseChannel *pchan;
- EditBone *ebone;
int sel=1;
/* Determine if there are any selected bones
@@ -4425,7 +4424,6 @@
static int pose_select_parent_exec(bContext *C, wmOperator *op)
{
Object *ob= CTX_data_active_object(C);
- bArmature *arm= ob->data;
bPoseChannel *pchan,*parent;
/* Determine if there is an active bone */
@@ -4439,7 +4437,7 @@
}
}
- WM_event_add_notifier(C, NC_OBJECT|ND_BONE_SELECT, NULL);
+ WM_event_add_notifier(C, NC_OBJECT|ND_BONE_SELECT, ob);
return OPERATOR_FINISHED;
}
Modified: branches/blender2.5/blender/source/blender/editors/include/UI_interface.h
===================================================================
--- branches/blender2.5/blender/source/blender/editors/include/UI_interface.h 2009-02-11 16:17:34 UTC (rev 18927)
+++ branches/blender2.5/blender/source/blender/editors/include/UI_interface.h 2009-02-11 16:54:55 UTC (rev 18928)
@@ -513,6 +513,28 @@
void UI_add_area_handlers(struct ListBase *handlers);
void UI_add_popup_handlers(struct ListBase *handlers, uiPopupBlockHandle *menu);
+/* Legacy code
+ * Callbacks and utils to get 2.48 work */
+
+void test_idbutton_cb(struct bContext *C, void *namev, void *arg2);
+void test_scriptpoin_but(struct bContext *C, char *name, ID **idpp);
+void test_actionpoin_but(struct bContext *C, char *name, ID **idpp);
+void test_obpoin_but(struct bContext *C, char *name, ID **idpp);
+void test_meshobpoin_but(struct bContext *C, char *name, ID **idpp);
+void test_meshpoin_but(struct bContext *C, char *name, ID **idpp);
+void test_matpoin_but(struct bContext *C, char *name, ID **idpp);
+void test_scenepoin_but(struct bContext *C, char *name, ID **idpp);
+void test_grouppoin_but(struct bContext *C, char *name, ID **idpp);
+void test_texpoin_but(struct bContext *C, char *name, ID **idpp);
+void test_imapoin_but(struct bContext *C, char *name, ID **idpp);
+void autocomplete_bone(struct bContext *C, char *str, void *arg_v);
+void autocomplete_vgroup(struct bContext *C, char *str, void *arg_v);
+
+struct CurveMapping;
+struct rctf;
+void curvemap_buttons(uiBlock *block, struct CurveMapping *cumap, char labeltype, short event, short redraw, struct rctf *rect);
+
+
/* Module
*
* init and exit should be called before using this module. init_userdef must
Modified: branches/blender2.5/blender/source/blender/editors/interface/interface.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/interface/interface.c 2009-02-11 16:17:34 UTC (rev 18927)
+++ branches/blender2.5/blender/source/blender/editors/interface/interface.c 2009-02-11 16:54:55 UTC (rev 18928)
@@ -624,6 +624,7 @@
void uiDrawBlock(const bContext *C, uiBlock *block)
{
+ ARegion *ar= CTX_wm_region(C);
uiBut *but;
if(!block->endblock)
@@ -640,7 +641,7 @@
if(block->drawextra) block->drawextra(C, block);
for (but= block->buttons.first; but; but= but->next)
- ui_draw_but(but);
+ ui_draw_but(ar, but);
ui_draw_links(block);
}
@@ -863,11 +864,11 @@
bt= ui_get_valid_link_button(block, but, mval);
if(bt) {
bt->flag |= UI_ACTIVE;
- ui_draw_but(bt);
+ ui_draw_but(ar, bt);
}
if(bto && bto!=bt) {
bto->flag &= ~UI_ACTIVE;
- ui_draw_but(bto);
+ ui_draw_but(ar, bto);
}
bto= bt;
@@ -965,7 +966,7 @@
but->x2 += dx;
but->y2 += dy;
- ui_draw_but(but);
+ ui_draw_but(ar, but);
ui_block_flush_back(but->block);
didit= 1;
Modified: branches/blender2.5/blender/source/blender/editors/interface/interface_draw.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/interface/interface_draw.c 2009-02-11 16:17:34 UTC (rev 18927)
+++ branches/blender2.5/blender/source/blender/editors/interface/interface_draw.c 2009-02-11 16:54:55 UTC (rev 18928)
@@ -2975,7 +2975,7 @@
}
-static void ui_draw_but_CURVE(uiBut *but)
+static void ui_draw_but_CURVE(ARegion *ar, uiBut *but)
{
CurveMapping *cumap;
CurveMap *cuma;
@@ -2990,10 +2990,10 @@
/* need scissor test, curve can draw outside of boundary */
glGetIntegerv(GL_VIEWPORT, scissor);
fx= but->x1; fy= but->y1;
- /* XXX 2.50 need context: ui_graphics_to_window(but->win, &fx, &fy); */
+ ui_block_to_window_fl(ar, but->block, &fx, &fy);
dx= but->x2; dy= but->y2;
- /* XXX 2.50 need context: ui_graphics_to_window(but->win, &dx, &dy); */
- //glScissor((int)floor(fx), (int)floor(fy), (int)ceil(dx-fx), (int)ceil(dy-fy));
+ ui_block_to_window_fl(ar, but->block, &dx, &dy);
+ glScissor((int)floor(fx), (int)floor(fy), (int)ceil(dx-fx), (int)ceil(dy-fy));
/* calculate offset and zoom */
zoomx= (but->x2-but->x1-2.0*but->aspect)/(cumap->curr.xmax - cumap->curr.xmin);
@@ -3254,7 +3254,7 @@
// note: if you want aligning, adapt the call uiBlockEndAlign in interface.c
}
-void ui_draw_but(uiBut *but)
+void ui_draw_but(ARegion *ar, uiBut *but)
{
double value;
float x1, x2, y1, y2, fac;
@@ -3322,7 +3322,7 @@
ui_draw_but_NORMAL(but);
break;
case BUT_CURVE:
- ui_draw_but_CURVE(but);
+ ui_draw_but_CURVE(ar, but);
break;
default:
Modified: branches/blender2.5/blender/source/blender/editors/interface/interface_intern.h
===================================================================
--- branches/blender2.5/blender/source/blender/editors/interface/interface_intern.h 2009-02-11 16:17:34 UTC (rev 18927)
+++ branches/blender2.5/blender/source/blender/editors/interface/interface_intern.h 2009-02-11 16:54:55 UTC (rev 18928)
@@ -313,13 +313,18 @@
void ui_set_name_menu(uiBut *but, int value);
+struct AutoComplete;
+struct AutoComplete *autocomplete_begin(char *startname, int maxlen);
+void autocomplete_do_name(struct AutoComplete *autocpl, const char *name);
+void autocomplete_end(struct AutoComplete *autocpl, char *autoname);
+
/* interface_panel.c */
extern int ui_handler_panel_region(struct bContext *C, struct wmEvent *event);
extern void ui_draw_panel(struct ARegion *ar, uiBlock *block);
/* interface_draw.c */
extern void ui_set_embossfunc(uiBut *but, int drawtype);
-extern void ui_draw_but(uiBut *but);
+extern void ui_draw_but(ARegion *ar, uiBut *but);
extern void ui_rasterpos_safe(float x, float y, float aspect);
extern void ui_draw_tria_icon(float x, float y, float aspect, char dir);
extern void ui_draw_anti_x(float x1, float y1, float x2, float y2);
Modified: branches/blender2.5/blender/source/blender/editors/interface/interface_utils.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/interface/interface_utils.c 2009-02-11 16:17:34 UTC (rev 18927)
+++ branches/blender2.5/blender/source/blender/editors/interface/interface_utils.c 2009-02-11 16:54:55 UTC (rev 18928)
@@ -29,11 +29,15 @@
#include "MEM_guardedalloc.h"
+#include "DNA_action_types.h"
+#include "DNA_color_types.h"
#include "DNA_listBase.h"
#include "DNA_material_types.h"
+#include "DNA_object_types.h"
#include "DNA_screen_types.h"
#include "DNA_windowmanager_types.h"
+#include "BKE_colortools.h"
#include "BKE_context.h"
#include "BKE_idprop.h"
#include "BKE_library.h"
@@ -45,6 +49,7 @@
#include "UI_interface.h"
#include "UI_resources.h"
+#include "ED_screen.h"
#include "ED_util.h"
#include "WM_api.h"
@@ -672,3 +677,458 @@
return x;
}
+/* ****************************** default button callbacks ******************* */
+/* ************ LEGACY WARNING, only to get things work with 2.48 code! ****** */
+
+void test_idbutton_cb(struct bContext *C, void *namev, void *arg2)
+{
+ char *name= namev;
+
+ test_idbutton(name+2);
+}
+
+
+void test_scriptpoin_but(struct bContext *C, char *name, ID **idpp)
+{
+ ID *id;
+
+ id= CTX_data_main(C)->text.first;
+ while(id) {
+ if( strcmp(name, id->name+2)==0 ) {
+ *idpp= id;
+ return;
+ }
+ id= id->next;
+ }
+ *idpp= NULL;
+}
+
+void test_actionpoin_but(struct bContext *C, char *name, ID **idpp)
+{
+ ID *id;
+
+ id= CTX_data_main(C)->action.first;
+ while(id) {
+ if( strcmp(name, id->name+2)==0 ) {
+ id_us_plus(id);
+ *idpp= id;
+ return;
+ }
+ id= id->next;
+ }
+ *idpp= NULL;
+}
+
+
+void test_obpoin_but(struct bContext *C, char *name, ID **idpp)
+{
+ ID *id;
+
+// XXX if(idpp == (ID **)&(emptytex.object)) {
+// error("You must add a texture first");
+// *idpp= 0;
+// return;
+// }
+
+ id= CTX_data_main(C)->object.first;
+ while(id) {
+ if( strcmp(name, id->name+2)==0 ) {
+ *idpp= id;
+ id_lib_extern(id); /* checks lib data, sets correct flag for saving then */
+ return;
+ }
+ id= id->next;
+ }
+ *idpp= NULL;
+}
+
+/* tests for an object of type OB_MESH */
+void test_meshobpoin_but(struct bContext *C, char *name, ID **idpp)
+{
+ ID *id;
+
+ id = CTX_data_main(C)->object.first;
+ while(id) {
+ Object *ob = (Object *)id;
+ if(ob->type == OB_MESH && strcmp(name, id->name + 2) == 0) {
+ *idpp = id;
+ /* checks lib data, sets correct flag for saving then */
+ id_lib_extern(id);
+ return;
+ }
+ id = id->next;
+ }
+ *idpp = NULL;
+}
+
+void test_meshpoin_but(struct bContext *C, char *name, ID **idpp)
+{
+ ID *id;
+
+ if( *idpp ) (*idpp)->us--;
+
+ id= CTX_data_main(C)->mesh.first;
+ while(id) {
+ if( strcmp(name, id->name+2)==0 ) {
+ *idpp= id;
+ id_us_plus(id);
+ return;
+ }
+ id= id->next;
+ }
+ *idpp= NULL;
+}
+
+void test_matpoin_but(struct bContext *C, char *name, ID **idpp)
+{
+ ID *id;
+
+ if( *idpp ) (*idpp)->us--;
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list