2008-12-12 18:47:12 +00:00
/**
* $ Id $
*
* * * * * * BEGIN GPL LICENSE BLOCK * * * * *
*
* This program is free software ; you can redistribute it and / or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation ; either version 2
* of the License , or ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
* along with this program ; if not , write to the Free Software Foundation ,
* Inc . , 59 Temple Place - Suite 330 , Boston , MA 02111 - 1307 , USA .
*
2008-12-20 12:36:14 +00:00
* The Original Code is Copyright ( C ) 2004 - 2008 Blender Foundation .
2008-12-12 18:47:12 +00:00
* All rights reserved .
*
*
* Contributor ( s ) : Blender Foundation
*
* * * * * * END GPL LICENSE BLOCK * * * * *
*/
# include <string.h>
# include <stdio.h>
2008-12-20 12:36:14 +00:00
# include <stdlib.h>
2008-12-12 18:47:12 +00:00
2008-12-20 12:36:14 +00:00
# include "DNA_armature_types.h"
# include "DNA_ID.h"
# include "DNA_image_types.h"
# include "DNA_meshdata_types.h"
# include "DNA_mesh_types.h"
2008-12-19 12:14:58 +00:00
# include "DNA_object_types.h"
2008-12-12 18:47:12 +00:00
# include "DNA_space_types.h"
# include "DNA_scene_types.h"
# include "DNA_screen_types.h"
2008-12-20 12:36:14 +00:00
# include "DNA_texture_types.h"
# include "DNA_userdef_types.h" /* U.smooth_viewtx */
# include "DNA_view3d_types.h"
2008-12-12 18:47:12 +00:00
# include "DNA_windowmanager_types.h"
2009-02-07 03:21:28 +00:00
# include "RNA_access.h"
2008-12-12 18:47:12 +00:00
# include "MEM_guardedalloc.h"
2008-12-20 12:36:14 +00:00
# include "BKE_action.h"
2009-02-07 03:21:28 +00:00
# include "BKE_brush.h"
2008-12-18 02:56:48 +00:00
# include "BKE_context.h"
2008-12-20 12:36:14 +00:00
# include "BKE_curve.h"
# include "BKE_depsgraph.h"
# include "BKE_displist.h"
# include "BKE_effect.h"
# include "BKE_global.h"
# include "BKE_image.h"
# include "BKE_library.h"
# include "BKE_main.h"
# include "BKE_mesh.h"
# include "BKE_modifier.h"
2009-08-15 19:48:50 +00:00
# include "BKE_paint.h"
2008-12-20 12:36:14 +00:00
# include "BKE_particle.h"
2008-12-12 18:47:12 +00:00
# include "BKE_screen.h"
2008-12-20 12:36:14 +00:00
# include "BKE_utildefines.h" /* for VECCOPY */
2008-12-12 18:47:12 +00:00
2009-01-05 19:32:04 +00:00
# include "ED_armature.h"
2009-02-20 20:39:27 +00:00
# include "ED_particle.h"
2008-12-23 19:47:33 +00:00
# include "ED_object.h"
2009-01-01 18:05:12 +00:00
# include "ED_mesh.h"
2008-12-12 18:47:12 +00:00
# include "ED_util.h"
2009-01-05 19:32:04 +00:00
# include "ED_screen.h"
2009-07-08 16:17:47 +00:00
# include "ED_transform.h"
2008-12-19 12:48:30 +00:00
# include "ED_types.h"
2008-12-12 18:47:12 +00:00
# include "WM_api.h"
# include "WM_types.h"
2009-02-20 18:01:33 +00:00
# include "RNA_access.h"
# include "RNA_define.h"
2009-08-16 16:38:32 +00:00
# include "RNA_enum_types.h"
2009-02-20 18:01:33 +00:00
2008-12-12 18:47:12 +00:00
# include "BIF_gl.h"
# include "BIF_glutil.h"
2008-12-20 12:36:14 +00:00
# include "BLI_arithb.h"
# include "BLI_blenlib.h"
# include "BLI_editVert.h"
2008-12-12 18:47:12 +00:00
# include "UI_interface.h"
2008-12-20 12:36:14 +00:00
# include "UI_interface_icons.h"
2008-12-12 18:47:12 +00:00
# include "UI_resources.h"
# include "UI_view2d.h"
# include "view3d_intern.h"
2008-12-20 12:36:14 +00:00
/* View3d->modeselect
* This is a bit of a dodgy hack to enable a ' mode ' menu with icons + labels
* rather than those buttons .
* I know the implementation ' s not good - it ' s an experiment to see if this
* approach would work well
*
* This can be cleaned when I make some new ' mode ' icons .
*/
2008-12-31 22:43:29 +00:00
# define TEST_EDITMESH if(obedit==0) return; \
if ( ( v3d - > lay & obedit - > lay ) = = 0 ) return ;
2008-12-20 12:36:14 +00:00
2009-07-03 04:24:19 +00:00
/* XXX port over */
2008-12-23 19:47:33 +00:00
static void countall ( void ) { }
2008-12-20 18:43:21 +00:00
extern void borderselect ( ) ;
2008-12-23 19:47:33 +00:00
static int retopo_mesh_paint_check ( ) { return 0 ; }
2008-12-20 12:36:14 +00:00
/* view3d handler codes */
# define VIEW3D_HANDLER_BACKGROUND 1
# define VIEW3D_HANDLER_PROPERTIES 2
# define VIEW3D_HANDLER_OBJECT 3
# define VIEW3D_HANDLER_PREVIEW 4
# define VIEW3D_HANDLER_MULTIRES 5
# define VIEW3D_HANDLER_TRANSFORM 6
# define VIEW3D_HANDLER_GREASEPENCIL 7
2009-03-17 21:44:58 +00:00
# define VIEW3D_HANDLER_BONESKETCH 8
2008-12-20 12:36:14 +00:00
/* end XXX ************* */
2009-02-10 15:38:00 +00:00
static void do_view3d_header_buttons ( bContext * C , void * arg , int event ) ;
2008-12-20 12:36:14 +00:00
# define B_SCENELOCK 101
# define B_FULL 102
# define B_HOME 103
# define B_VIEWBUT 104
# define B_PERSP 105
# define B_VIEWRENDER 106
# define B_STARTGAME 107
# define B_MODESELECT 108
# define B_AROUND 109
# define B_SEL_VERT 110
# define B_SEL_EDGE 111
# define B_SEL_FACE 112
# define B_SEL_PATH 113
# define B_SEL_POINT 114
# define B_SEL_END 115
# define B_MAN_TRANS 116
# define B_MAN_ROT 117
# define B_MAN_SCALE 118
# define B_NDOF 119
# define B_MAN_MODE 120
# define B_VIEW_BUTSEDIT 121
# define B_REDR 122
# define B_NOP 123
# define B_ACTCOPY 124
# define B_ACTPASTE 125
# define B_ACTPASTEFLIP 126
# define B_LAY 201
2.5
View3D has been split now in a local part (RegionView3D) and a
per-area part (old View3D). Currently local is:
- view transform
- camera zoom/offset
- gpencil (todo)
- custom clipping planes
Rest is in Area still, like active camera, draw type, layers,
localview, custom centers, around-settings, transform widget,
gridlines, and so on (mostly stuff as available in header).
To see it work; also added new feature for region split,
press SHIFT+ALT+CTRL+S for four-split.
The idea is to make a preset 4-split, configured to stick
to top/right/front views for three views.
Another cool idea to explore is to then box-clip all drawing
based on these 3 views.
Note about the code:
- currently view3d still stores some depricated settings, to
convert from older files. Not all settings are copied over
though, like custom clip planes or the 'lock view to object'.
- since some view3d ops are now on area level, the operators
for it should keep track of that.
Bugfix in transform: quat initialize in operator-invoke missed
one zero.
Als brought back GE to compile for missing Ipos and channels.
2009-01-19 16:54:41 +00:00
static RegionView3D * wm_region_view3d ( const bContext * C )
2008-12-20 12:36:14 +00:00
{
2.5
View3D has been split now in a local part (RegionView3D) and a
per-area part (old View3D). Currently local is:
- view transform
- camera zoom/offset
- gpencil (todo)
- custom clipping planes
Rest is in Area still, like active camera, draw type, layers,
localview, custom centers, around-settings, transform widget,
gridlines, and so on (mostly stuff as available in header).
To see it work; also added new feature for region split,
press SHIFT+ALT+CTRL+S for four-split.
The idea is to make a preset 4-split, configured to stick
to top/right/front views for three views.
Another cool idea to explore is to then box-clip all drawing
based on these 3 views.
Note about the code:
- currently view3d still stores some depricated settings, to
convert from older files. Not all settings are copied over
though, like custom clip planes or the 'lock view to object'.
- since some view3d ops are now on area level, the operators
for it should keep track of that.
Bugfix in transform: quat initialize in operator-invoke missed
one zero.
Als brought back GE to compile for missing Ipos and channels.
2009-01-19 16:54:41 +00:00
ScrArea * sa = CTX_wm_area ( C ) ;
2008-12-20 12:36:14 +00:00
ARegion * ar ;
2.5
View3D has been split now in a local part (RegionView3D) and a
per-area part (old View3D). Currently local is:
- view transform
- camera zoom/offset
- gpencil (todo)
- custom clipping planes
Rest is in Area still, like active camera, draw type, layers,
localview, custom centers, around-settings, transform widget,
gridlines, and so on (mostly stuff as available in header).
To see it work; also added new feature for region split,
press SHIFT+ALT+CTRL+S for four-split.
The idea is to make a preset 4-split, configured to stick
to top/right/front views for three views.
Another cool idea to explore is to then box-clip all drawing
based on these 3 views.
Note about the code:
- currently view3d still stores some depricated settings, to
convert from older files. Not all settings are copied over
though, like custom clip planes or the 'lock view to object'.
- since some view3d ops are now on area level, the operators
for it should keep track of that.
Bugfix in transform: quat initialize in operator-invoke missed
one zero.
Als brought back GE to compile for missing Ipos and channels.
2009-01-19 16:54:41 +00:00
/* XXX handle foursplit? */
2008-12-20 12:36:14 +00:00
for ( ar = sa - > regionbase . first ; ar ; ar = ar - > next )
if ( ar - > regiontype = = RGN_TYPE_WINDOW )
2.5
View3D has been split now in a local part (RegionView3D) and a
per-area part (old View3D). Currently local is:
- view transform
- camera zoom/offset
- gpencil (todo)
- custom clipping planes
Rest is in Area still, like active camera, draw type, layers,
localview, custom centers, around-settings, transform widget,
gridlines, and so on (mostly stuff as available in header).
To see it work; also added new feature for region split,
press SHIFT+ALT+CTRL+S for four-split.
The idea is to make a preset 4-split, configured to stick
to top/right/front views for three views.
Another cool idea to explore is to then box-clip all drawing
based on these 3 views.
Note about the code:
- currently view3d still stores some depricated settings, to
convert from older files. Not all settings are copied over
though, like custom clip planes or the 'lock view to object'.
- since some view3d ops are now on area level, the operators
for it should keep track of that.
Bugfix in transform: quat initialize in operator-invoke missed
one zero.
Als brought back GE to compile for missing Ipos and channels.
2009-01-19 16:54:41 +00:00
return ar - > regiondata ;
2008-12-20 12:36:14 +00:00
return NULL ;
}
2009-07-03 04:24:19 +00:00
// XXX quickly ported across
static void handle_view3d_lock ( bContext * C )
{
Scene * scene = CTX_data_scene ( C ) ;
ScrArea * sa = CTX_wm_area ( C ) ;
2009-07-28 16:33:02 +00:00
View3D * v3d = CTX_wm_view3d ( C ) ;
2009-07-03 04:24:19 +00:00
if ( v3d ! = NULL & & sa ! = NULL ) {
if ( v3d - > localview = = 0 & & v3d - > scenelock & & sa - > spacetype = = SPACE_VIEW3D ) {
/* copy to scene */
scene - > lay = v3d - > lay ;
scene - > camera = v3d - > camera ;
//copy_view3d_lock(REDRAW);
}
}
}
2009-02-20 18:01:33 +00:00
static int layers_exec ( bContext * C , wmOperator * op )
{
Scene * scene = CTX_data_scene ( C ) ;
ScrArea * sa = CTX_wm_area ( C ) ;
View3D * v3d = sa - > spacedata . first ;
int nr = RNA_int_get ( op - > ptr , " nr " ) ;
if ( nr < = 0 )
return OPERATOR_CANCELLED ;
nr - - ;
if ( RNA_boolean_get ( op - > ptr , " extend " ) )
v3d - > lay | = ( 1 < < nr ) ;
else
v3d - > lay = ( 1 < < nr ) ;
2009-07-19 16:53:57 +00:00
/* set active layer, ensure to always have one */
if ( v3d - > lay & ( 1 < < nr ) )
v3d - > layact = 1 < < nr ;
else if ( ( v3d - > lay & v3d - > layact ) = = 0 ) {
int bit = 0 ;
while ( bit < 32 ) {
if ( v3d - > lay & ( 1 < < bit ) ) {
v3d - > layact = 1 < < bit ;
break ;
}
bit + + ;
}
}
2009-07-03 04:24:19 +00:00
if ( v3d - > scenelock ) handle_view3d_lock ( C ) ;
2009-02-20 18:01:33 +00:00
/* new layers might need unflushed events events */
DAG_scene_update_flags ( scene , v3d - > lay ) ; /* tags all that moves and flushes */
ED_area_tag_redraw ( sa ) ;
return OPERATOR_FINISHED ;
}
/* applies shift and alt, lazy coding or ok? :) */
/* the local per-keymap-entry keymap will solve it */
static int layers_invoke ( bContext * C , wmOperator * op , wmEvent * event )
{
if ( event - > ctrl | | event - > oskey )
return OPERATOR_PASS_THROUGH ;
if ( event - > shift )
RNA_boolean_set ( op - > ptr , " extend " , 1 ) ;
if ( event - > alt ) {
int nr = RNA_int_get ( op - > ptr , " nr " ) + 10 ;
RNA_int_set ( op - > ptr , " nr " , nr ) ;
}
layers_exec ( C , op ) ;
return OPERATOR_FINISHED ;
}
void VIEW3D_OT_layers ( wmOperatorType * ot )
{
/* identifiers */
ot - > name = " Layers " ;
2009-09-07 04:52:42 +00:00
ot - > description = " Toggle layer(s) visibility. " ;
2009-02-20 18:01:33 +00:00
ot - > idname = " VIEW3D_OT_layers " ;
/* api callbacks */
ot - > invoke = layers_invoke ;
ot - > exec = layers_exec ;
ot - > poll = ED_operator_view3d_active ;
/* flags */
ot - > flag = OPTYPE_REGISTER | OPTYPE_UNDO ;
RNA_def_int ( ot - > srna , " nr " , 1 , 0 , 20 , " Number " , " " , 0 , 20 ) ;
RNA_def_boolean ( ot - > srna , " extend " , 0 , " Extend " , " " ) ;
}
2.5
View3D has been split now in a local part (RegionView3D) and a
per-area part (old View3D). Currently local is:
- view transform
- camera zoom/offset
- gpencil (todo)
- custom clipping planes
Rest is in Area still, like active camera, draw type, layers,
localview, custom centers, around-settings, transform widget,
gridlines, and so on (mostly stuff as available in header).
To see it work; also added new feature for region split,
press SHIFT+ALT+CTRL+S for four-split.
The idea is to make a preset 4-split, configured to stick
to top/right/front views for three views.
Another cool idea to explore is to then box-clip all drawing
based on these 3 views.
Note about the code:
- currently view3d still stores some depricated settings, to
convert from older files. Not all settings are copied over
though, like custom clip planes or the 'lock view to object'.
- since some view3d ops are now on area level, the operators
for it should keep track of that.
Bugfix in transform: quat initialize in operator-invoke missed
one zero.
Als brought back GE to compile for missing Ipos and channels.
2009-01-19 16:54:41 +00:00
#if 0
2008-12-20 12:36:14 +00:00
void do_view3d_select_object_typemenu ( bContext * C , void * arg , int event )
{
2008-12-12 18:47:12 +00:00
2008-12-20 12:36:14 +00:00
extern void selectall_type ( short obtype ) ;
switch ( event ) {
case 1 : /* Mesh */
selectall_type ( OB_MESH ) ;
break ;
case 2 : /* Curve */
selectall_type ( OB_CURVE ) ;
break ;
case 3 : /* Surface */
selectall_type ( OB_SURF ) ;
break ;
case 4 : /* Meta */
selectall_type ( OB_MBALL ) ;
break ;
case 5 : /* Armature */
selectall_type ( OB_ARMATURE ) ;
break ;
case 6 : /* Lattice */
selectall_type ( OB_LATTICE ) ;
break ;
case 7 : /* Text */
selectall_type ( OB_FONT ) ;
break ;
case 8 : /* Empty */
selectall_type ( OB_EMPTY ) ;
break ;
case 9 : /* Camera */
selectall_type ( OB_CAMERA ) ;
break ;
case 10 : /* Lamp */
selectall_type ( OB_LAMP ) ;
break ;
case 20 :
do_layer_buttons ( C , - 2 ) ;
break ;
}
}
2.5: UI & Menus
* Cleaned up UI_interface.h a bit, and added some comments to
organize things a bit and indicate what should be used when.
* uiMenu* functions can now be used to create menus for headers
too, this is done with a uiDefMenuBut, which takes a pointer
to a uiMenuCreateFunc, that will then call uiMenu* functions.
* Renamed uiMenuBegin/End to uiPupMenuBegin/End, as these are
specific to making popup menus. Will convert the other
conformation popup menu functions to use this too so we can
remove some code.
* Extended uiMenu functions, now there is is also:
BooleanO, FloatO, BooleanR, EnumR, LevelEnumR, Separator.
* Converted image window headers to use uiMenu functions, simplifies
menu code further here. Did not remove the uiDefMenu functions as
they are used in sequencer/view3d in some places now (will fix).
* Also tried to simplify and fix bounds computation a bit better
for popup menus. It tried to find out in advance what the size
of the menu was but this is difficult with keymap strings in
there, now uiPopupBoundsBlock can figure this out afterwards and
ensure the popup is within the window bounds. Will convert some
other functions to use this too.
2009-01-30 12:18:08 +00:00
static uiBlock * view3d_select_object_typemenu ( bContext * C , ARegion * ar , void * arg_unused )
2008-12-12 18:47:12 +00:00
{
2008-12-20 12:36:14 +00:00
uiBlock * block ;
short yco = 20 , menuwidth = 120 ;
2.5
More cleanup!
- removed old UI font completely, including from uiBeginBlock
- emboss hints for uiBlock only have three types now;
Regular, Pulldown, or "Nothing" (only icon/text)
- removed old font path from Userdef
- removed all old button theme hinting
- removed old "auto block" to merge buttons in groups
(was only in use for radiosity buttons)
And went over all warnings. One hooray for make giving clean output :)
Well, we need uniform definitions for warnings, so people at least fix
them... here's the real bad bugs I found:
- in mesh code, a call to editmesh mixed *em and *me
- in armature, ED_util.h was not included, so no warnings for wrong call
to ED_undo_push()
- The extern Py api .h was not included in the bpy_interface.c, showing
a several calls using different args.
Further just added the missing includes, and removed unused vars.
2009-04-14 15:59:52 +00:00
block = uiBeginBlock ( C , ar , " view3d_select_object_typemenu " , UI_EMBOSSP ) ;
2008-12-20 12:36:14 +00:00
uiBlockSetButmFunc ( block , do_view3d_select_object_typemenu , NULL ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Mesh " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 1 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Curve " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 2 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Surface " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 3 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Meta " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 4 , " " ) ;
uiDefBut ( block , SEPR , 0 , " " , 0 , yco - = 6 , menuwidth , 6 , NULL , 0.0 , 0.0 , 0 , 0 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Armature " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 5 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Lattice " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 6 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Text " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 7 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Empty " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 8 , " " ) ;
uiDefBut ( block , SEPR , 0 , " " , 0 , yco - = 6 , menuwidth , 6 , NULL , 0.0 , 0.0 , 0 , 0 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Camera " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 9 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Lamp " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 10 , " " ) ;
uiBlockSetDirection ( block , UI_RIGHT ) ;
uiTextBoundsBlock ( block , 60 ) ;
return block ;
}
2.5
View3D has been split now in a local part (RegionView3D) and a
per-area part (old View3D). Currently local is:
- view transform
- camera zoom/offset
- gpencil (todo)
- custom clipping planes
Rest is in Area still, like active camera, draw type, layers,
localview, custom centers, around-settings, transform widget,
gridlines, and so on (mostly stuff as available in header).
To see it work; also added new feature for region split,
press SHIFT+ALT+CTRL+S for four-split.
The idea is to make a preset 4-split, configured to stick
to top/right/front views for three views.
Another cool idea to explore is to then box-clip all drawing
based on these 3 views.
Note about the code:
- currently view3d still stores some depricated settings, to
convert from older files. Not all settings are copied over
though, like custom clip planes or the 'lock view to object'.
- since some view3d ops are now on area level, the operators
for it should keep track of that.
Bugfix in transform: quat initialize in operator-invoke missed
one zero.
Als brought back GE to compile for missing Ipos and channels.
2009-01-19 16:54:41 +00:00
2008-12-20 12:36:14 +00:00
void do_view3d_select_object_layermenu ( bContext * C , void * arg , int event )
{
// XXX extern void selectall_layer(unsigned int layernum);
2008-12-12 18:47:12 +00:00
switch ( event ) {
2008-12-20 12:36:14 +00:00
case 0 :
case 1 :
case 2 :
case 3 :
case 4 :
case 5 :
case 6 :
case 7 :
case 8 :
case 9 :
case 10 :
case 11 :
case 12 :
case 13 :
case 14 :
case 15 :
case 16 :
case 17 :
case 18 :
case 19 :
case 20 :
// XXX selectall_layer(event);
break ;
2008-12-14 12:16:55 +00:00
}
2008-12-12 18:47:12 +00:00
}
2.5: UI & Menus
* Cleaned up UI_interface.h a bit, and added some comments to
organize things a bit and indicate what should be used when.
* uiMenu* functions can now be used to create menus for headers
too, this is done with a uiDefMenuBut, which takes a pointer
to a uiMenuCreateFunc, that will then call uiMenu* functions.
* Renamed uiMenuBegin/End to uiPupMenuBegin/End, as these are
specific to making popup menus. Will convert the other
conformation popup menu functions to use this too so we can
remove some code.
* Extended uiMenu functions, now there is is also:
BooleanO, FloatO, BooleanR, EnumR, LevelEnumR, Separator.
* Converted image window headers to use uiMenu functions, simplifies
menu code further here. Did not remove the uiDefMenu functions as
they are used in sequencer/view3d in some places now (will fix).
* Also tried to simplify and fix bounds computation a bit better
for popup menus. It tried to find out in advance what the size
of the menu was but this is difficult with keymap strings in
there, now uiPopupBoundsBlock can figure this out afterwards and
ensure the popup is within the window bounds. Will convert some
other functions to use this too.
2009-01-30 12:18:08 +00:00
static uiBlock * view3d_select_object_layermenu ( bContext * C , ARegion * ar , void * arg_unused )
2008-12-20 12:36:14 +00:00
{
uiBlock * block ;
short xco = 0 , yco = 20 , menuwidth = 22 ;
2008-12-12 18:47:12 +00:00
2.5
More cleanup!
- removed old UI font completely, including from uiBeginBlock
- emboss hints for uiBlock only have three types now;
Regular, Pulldown, or "Nothing" (only icon/text)
- removed old font path from Userdef
- removed all old button theme hinting
- removed old "auto block" to merge buttons in groups
(was only in use for radiosity buttons)
And went over all warnings. One hooray for make giving clean output :)
Well, we need uniform definitions for warnings, so people at least fix
them... here's the real bad bugs I found:
- in mesh code, a call to editmesh mixed *em and *me
- in armature, ED_util.h was not included, so no warnings for wrong call
to ED_undo_push()
- The extern Py api .h was not included in the bpy_interface.c, showing
a several calls using different args.
Further just added the missing includes, and removed unused vars.
2009-04-14 15:59:52 +00:00
block = uiBeginBlock ( C , ar , " view3d_select_object_layermenu " , UI_EMBOSSP ) ;
2008-12-20 12:36:14 +00:00
uiBlockSetButmFunc ( block , do_view3d_select_object_layermenu , NULL ) ;
uiDefBut ( block , BUTM , 1 , " 1 " , xco , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 1 , " " ) ;
uiDefBut ( block , BUTM , 1 , " 2 " , xco + = ( menuwidth + 1 ) , yco , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 2 , " " ) ;
uiDefBut ( block , BUTM , 1 , " 3 " , xco + = ( menuwidth + 1 ) , yco , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 3 , " " ) ;
uiDefBut ( block , BUTM , 1 , " 4 " , xco + = ( menuwidth + 1 ) , yco , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 4 , " " ) ;
uiDefBut ( block , BUTM , 1 , " 5 " , xco + = ( menuwidth + 1 ) , yco , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 5 , " " ) ;
xco + = 6 ;
uiDefBut ( block , BUTM , 1 , " 6 " , xco + = ( menuwidth + 1 ) , yco , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 6 , " " ) ;
uiDefBut ( block , BUTM , 1 , " 7 " , xco + = ( menuwidth + 1 ) , yco , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 7 , " " ) ;
uiDefBut ( block , BUTM , 1 , " 8 " , xco + = ( menuwidth + 1 ) , yco , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 8 , " " ) ;
uiDefBut ( block , BUTM , 1 , " 9 " , xco + = ( menuwidth + 1 ) , yco , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 9 , " " ) ;
uiDefBut ( block , BUTM , 1 , " 10 " , xco + = ( menuwidth + 1 ) , yco , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 10 , " " ) ;
xco = 0 ;
uiDefBut ( block , BUTM , 1 , " 11 " , xco , yco - = 24 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 11 , " " ) ;
uiDefBut ( block , BUTM , 1 , " 12 " , xco + = ( menuwidth + 1 ) , yco , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 12 , " " ) ;
uiDefBut ( block , BUTM , 1 , " 13 " , xco + = ( menuwidth + 1 ) , yco , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 13 , " " ) ;
uiDefBut ( block , BUTM , 1 , " 14 " , xco + = ( menuwidth + 1 ) , yco , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 14 , " " ) ;
uiDefBut ( block , BUTM , 1 , " 15 " , xco + = ( menuwidth + 1 ) , yco , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 15 , " " ) ;
xco + = 6 ;
uiDefBut ( block , BUTM , 1 , " 16 " , xco + = ( menuwidth + 1 ) , yco , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 16 , " " ) ;
uiDefBut ( block , BUTM , 1 , " 17 " , xco + = ( menuwidth + 1 ) , yco , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 17 , " " ) ;
uiDefBut ( block , BUTM , 1 , " 18 " , xco + = ( menuwidth + 1 ) , yco , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 18 , " " ) ;
uiDefBut ( block , BUTM , 1 , " 19 " , xco + = ( menuwidth + 1 ) , yco , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 19 , " " ) ;
uiDefBut ( block , BUTM , 1 , " 20 " , xco + = ( menuwidth + 1 ) , yco , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 20 , " " ) ;
uiBlockSetDirection ( block , UI_RIGHT ) ;
/*uiTextBoundsBlock(block, 100);*/
return block ;
}
void do_view3d_select_object_linkedmenu ( bContext * C , void * arg , int event )
{
switch ( event ) {
case 1 : /* Object Ipo */
case 2 : /* ObData */
case 3 : /* Current Material */
case 4 : /* Current Texture */
selectlinks ( event ) ;
break ;
}
countall ( ) ;
}
2.5: UI & Menus
* Cleaned up UI_interface.h a bit, and added some comments to
organize things a bit and indicate what should be used when.
* uiMenu* functions can now be used to create menus for headers
too, this is done with a uiDefMenuBut, which takes a pointer
to a uiMenuCreateFunc, that will then call uiMenu* functions.
* Renamed uiMenuBegin/End to uiPupMenuBegin/End, as these are
specific to making popup menus. Will convert the other
conformation popup menu functions to use this too so we can
remove some code.
* Extended uiMenu functions, now there is is also:
BooleanO, FloatO, BooleanR, EnumR, LevelEnumR, Separator.
* Converted image window headers to use uiMenu functions, simplifies
menu code further here. Did not remove the uiDefMenu functions as
they are used in sequencer/view3d in some places now (will fix).
* Also tried to simplify and fix bounds computation a bit better
for popup menus. It tried to find out in advance what the size
of the menu was but this is difficult with keymap strings in
there, now uiPopupBoundsBlock can figure this out afterwards and
ensure the popup is within the window bounds. Will convert some
other functions to use this too.
2009-01-30 12:18:08 +00:00
static uiBlock * view3d_select_object_linkedmenu ( bContext * C , ARegion * ar , void * arg_unused )
2008-12-12 18:47:12 +00:00
{
uiBlock * block ;
2008-12-20 12:36:14 +00:00
short yco = 20 , menuwidth = 120 ;
2.5
More cleanup!
- removed old UI font completely, including from uiBeginBlock
- emboss hints for uiBlock only have three types now;
Regular, Pulldown, or "Nothing" (only icon/text)
- removed old font path from Userdef
- removed all old button theme hinting
- removed old "auto block" to merge buttons in groups
(was only in use for radiosity buttons)
And went over all warnings. One hooray for make giving clean output :)
Well, we need uniform definitions for warnings, so people at least fix
them... here's the real bad bugs I found:
- in mesh code, a call to editmesh mixed *em and *me
- in armature, ED_util.h was not included, so no warnings for wrong call
to ED_undo_push()
- The extern Py api .h was not included in the bpy_interface.c, showing
a several calls using different args.
Further just added the missing includes, and removed unused vars.
2009-04-14 15:59:52 +00:00
block = uiBeginBlock ( C , ar , " view3d_select_object_linkedmenu " , UI_EMBOSSP ) ;
2008-12-20 12:36:14 +00:00
uiBlockSetButmFunc ( block , do_view3d_select_object_linkedmenu , NULL ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Object Ipo|Shift L, 1 " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 1 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " ObData|Shift L, 2 " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 2 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Material|Shift L, 3 " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 3 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Texture|Shift L, 4 " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 4 , " " ) ;
2008-12-12 18:47:12 +00:00
2008-12-20 12:36:14 +00:00
uiBlockSetDirection ( block , UI_RIGHT ) ;
uiTextBoundsBlock ( block , 60 ) ;
return block ;
}
void do_view3d_select_object_groupedmenu ( bContext * C , void * arg , int event )
{
2.5
View3D has been split now in a local part (RegionView3D) and a
per-area part (old View3D). Currently local is:
- view transform
- camera zoom/offset
- gpencil (todo)
- custom clipping planes
Rest is in Area still, like active camera, draw type, layers,
localview, custom centers, around-settings, transform widget,
gridlines, and so on (mostly stuff as available in header).
To see it work; also added new feature for region split,
press SHIFT+ALT+CTRL+S for four-split.
The idea is to make a preset 4-split, configured to stick
to top/right/front views for three views.
Another cool idea to explore is to then box-clip all drawing
based on these 3 views.
Note about the code:
- currently view3d still stores some depricated settings, to
convert from older files. Not all settings are copied over
though, like custom clip planes or the 'lock view to object'.
- since some view3d ops are now on area level, the operators
for it should keep track of that.
Bugfix in transform: quat initialize in operator-invoke missed
one zero.
Als brought back GE to compile for missing Ipos and channels.
2009-01-19 16:54:41 +00:00
2008-12-20 12:36:14 +00:00
switch ( event ) {
case 1 : /* Children */
case 2 : /* Immediate Children */
case 3 : /* Parent */
case 4 : /* Siblings */
case 5 : /* Type */
case 6 : /* Objects on Shared Layers */
case 7 : /* Objects in Same Group */
case 8 : /* Object Hooks*/
case 9 : /* Object PassIndex*/
case 10 : /* Object Color*/
case 11 : /* Game Properties*/
select_object_grouped ( ( short ) event ) ;
break ;
}
}
2.5: UI & Menus
* Cleaned up UI_interface.h a bit, and added some comments to
organize things a bit and indicate what should be used when.
* uiMenu* functions can now be used to create menus for headers
too, this is done with a uiDefMenuBut, which takes a pointer
to a uiMenuCreateFunc, that will then call uiMenu* functions.
* Renamed uiMenuBegin/End to uiPupMenuBegin/End, as these are
specific to making popup menus. Will convert the other
conformation popup menu functions to use this too so we can
remove some code.
* Extended uiMenu functions, now there is is also:
BooleanO, FloatO, BooleanR, EnumR, LevelEnumR, Separator.
* Converted image window headers to use uiMenu functions, simplifies
menu code further here. Did not remove the uiDefMenu functions as
they are used in sequencer/view3d in some places now (will fix).
* Also tried to simplify and fix bounds computation a bit better
for popup menus. It tried to find out in advance what the size
of the menu was but this is difficult with keymap strings in
there, now uiPopupBoundsBlock can figure this out afterwards and
ensure the popup is within the window bounds. Will convert some
other functions to use this too.
2009-01-30 12:18:08 +00:00
static uiBlock * view3d_select_object_groupedmenu ( bContext * C , ARegion * ar , void * arg_unused )
2008-12-20 12:36:14 +00:00
{
uiBlock * block ;
short yco = 20 , menuwidth = 120 ;
2.5
More cleanup!
- removed old UI font completely, including from uiBeginBlock
- emboss hints for uiBlock only have three types now;
Regular, Pulldown, or "Nothing" (only icon/text)
- removed old font path from Userdef
- removed all old button theme hinting
- removed old "auto block" to merge buttons in groups
(was only in use for radiosity buttons)
And went over all warnings. One hooray for make giving clean output :)
Well, we need uniform definitions for warnings, so people at least fix
them... here's the real bad bugs I found:
- in mesh code, a call to editmesh mixed *em and *me
- in armature, ED_util.h was not included, so no warnings for wrong call
to ED_undo_push()
- The extern Py api .h was not included in the bpy_interface.c, showing
a several calls using different args.
Further just added the missing includes, and removed unused vars.
2009-04-14 15:59:52 +00:00
block = uiBeginBlock ( C , ar , " view3d_select_object_groupedmenu " , UI_EMBOSSP ) ;
2008-12-20 12:36:14 +00:00
uiBlockSetButmFunc ( block , do_view3d_select_object_groupedmenu , NULL ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Children|Shift G, 1 " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 1 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Immediate Children|Shift G, 2 " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 2 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Parent|Shift G, 3 " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 3 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Siblings (Shared Parent)|Shift G, 4 " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 4 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Objects of Same Type|Shift G, 5 " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 5 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Objects on Shared Layers|Shift G, 6 " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 6 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Objects in Same Group|Shift G, 7 " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 7 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Object Hooks|Shift G, 8 " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 8 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Object PassIndex|Shift G, 9 " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 9 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Object Color|Shift G, 0 " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 10 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Game Properties|Shift G, Alt+1 " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 11 , " " ) ;
uiBlockSetDirection ( block , UI_RIGHT ) ;
uiTextBoundsBlock ( block , 60 ) ;
return block ;
}
2.5
View3D has been split now in a local part (RegionView3D) and a
per-area part (old View3D). Currently local is:
- view transform
- camera zoom/offset
- gpencil (todo)
- custom clipping planes
Rest is in Area still, like active camera, draw type, layers,
localview, custom centers, around-settings, transform widget,
gridlines, and so on (mostly stuff as available in header).
To see it work; also added new feature for region split,
press SHIFT+ALT+CTRL+S for four-split.
The idea is to make a preset 4-split, configured to stick
to top/right/front views for three views.
Another cool idea to explore is to then box-clip all drawing
based on these 3 views.
Note about the code:
- currently view3d still stores some depricated settings, to
convert from older files. Not all settings are copied over
though, like custom clip planes or the 'lock view to object'.
- since some view3d ops are now on area level, the operators
for it should keep track of that.
Bugfix in transform: quat initialize in operator-invoke missed
one zero.
Als brought back GE to compile for missing Ipos and channels.
2009-01-19 16:54:41 +00:00
# endif
2008-12-20 12:36:14 +00:00
void do_view3d_select_faceselmenu ( bContext * C , void * arg , int event )
{
#if 0
/* events >= 6 are registered bpython scripts */
# ifndef DISABLE_PYTHON
if ( event > = 6 ) BPY_menu_do_python ( PYMENU_FACESELECT , event - 6 ) ;
# endif
switch ( event ) {
case 0 : /* border select */
borderselect ( ) ;
break ;
case 2 : /* Select/Deselect all */
deselectall_tface ( ) ;
break ;
case 3 : /* Select Inverse */
selectswap_tface ( ) ;
break ;
case 4 : /* Select Linked */
select_linked_tfaces ( 2 ) ;
break ;
}
# endif
}
2.5: UI & Menus
* Cleaned up UI_interface.h a bit, and added some comments to
organize things a bit and indicate what should be used when.
* uiMenu* functions can now be used to create menus for headers
too, this is done with a uiDefMenuBut, which takes a pointer
to a uiMenuCreateFunc, that will then call uiMenu* functions.
* Renamed uiMenuBegin/End to uiPupMenuBegin/End, as these are
specific to making popup menus. Will convert the other
conformation popup menu functions to use this too so we can
remove some code.
* Extended uiMenu functions, now there is is also:
BooleanO, FloatO, BooleanR, EnumR, LevelEnumR, Separator.
* Converted image window headers to use uiMenu functions, simplifies
menu code further here. Did not remove the uiDefMenu functions as
they are used in sequencer/view3d in some places now (will fix).
* Also tried to simplify and fix bounds computation a bit better
for popup menus. It tried to find out in advance what the size
of the menu was but this is difficult with keymap strings in
there, now uiPopupBoundsBlock can figure this out afterwards and
ensure the popup is within the window bounds. Will convert some
other functions to use this too.
2009-01-30 12:18:08 +00:00
static uiBlock * view3d_select_faceselmenu ( bContext * C , ARegion * ar , void * arg_unused )
2008-12-20 12:36:14 +00:00
{
uiBlock * block ;
short yco = 0 , menuwidth = 120 ;
# ifndef DISABLE_PYTHON
// XXX BPyMenu *pym;
// int i = 0;
# endif
2.5
More cleanup!
- removed old UI font completely, including from uiBeginBlock
- emboss hints for uiBlock only have three types now;
Regular, Pulldown, or "Nothing" (only icon/text)
- removed old font path from Userdef
- removed all old button theme hinting
- removed old "auto block" to merge buttons in groups
(was only in use for radiosity buttons)
And went over all warnings. One hooray for make giving clean output :)
Well, we need uniform definitions for warnings, so people at least fix
them... here's the real bad bugs I found:
- in mesh code, a call to editmesh mixed *em and *me
- in armature, ED_util.h was not included, so no warnings for wrong call
to ED_undo_push()
- The extern Py api .h was not included in the bpy_interface.c, showing
a several calls using different args.
Further just added the missing includes, and removed unused vars.
2009-04-14 15:59:52 +00:00
block = uiBeginBlock ( C , ar , " view3d_select_faceselmenu " , UI_EMBOSSP ) ;
2008-12-20 12:36:14 +00:00
uiBlockSetButmFunc ( block , do_view3d_select_faceselmenu , NULL ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Border Select|B " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 0 , " " ) ;
uiDefBut ( block , SEPR , 0 , " " , 0 , yco - = 6 , menuwidth , 6 , NULL , 0.0 , 0.0 , 0 , 0 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Select/Deselect All|A " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 2 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Inverse " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 3 , " " ) ;
uiDefBut ( block , SEPR , 0 , " " , 0 , yco - = 6 , menuwidth , 6 , NULL , 0.0 , 0.0 , 0 , 0 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Linked Faces|Ctrl L " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 4 , " " ) ;
# ifndef DISABLE_PYTHON
// uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
/* note that we account for the 6 previous entries with i+6: */
// for (pym = BPyMenuTable[PYMENU_FACESELECT]; pym; pym = pym->next, i++) {
// uiDefIconTextBut(block, BUTM, 1, ICON_PYTHON, pym->name, 0, yco-=20,
// menuwidth, 19, NULL, 0.0, 0.0, 1, i+6,
// pym->tooltip?pym->tooltip:pym->filename);
// }
# endif
2.5: UI & Menus
* Cleaned up UI_interface.h a bit, and added some comments to
organize things a bit and indicate what should be used when.
* uiMenu* functions can now be used to create menus for headers
too, this is done with a uiDefMenuBut, which takes a pointer
to a uiMenuCreateFunc, that will then call uiMenu* functions.
* Renamed uiMenuBegin/End to uiPupMenuBegin/End, as these are
specific to making popup menus. Will convert the other
conformation popup menu functions to use this too so we can
remove some code.
* Extended uiMenu functions, now there is is also:
BooleanO, FloatO, BooleanR, EnumR, LevelEnumR, Separator.
* Converted image window headers to use uiMenu functions, simplifies
menu code further here. Did not remove the uiDefMenu functions as
they are used in sequencer/view3d in some places now (will fix).
* Also tried to simplify and fix bounds computation a bit better
for popup menus. It tried to find out in advance what the size
of the menu was but this is difficult with keymap strings in
there, now uiPopupBoundsBlock can figure this out afterwards and
ensure the popup is within the window bounds. Will convert some
other functions to use this too.
2009-01-30 12:18:08 +00:00
if ( ar - > alignment = = RGN_ALIGN_TOP ) {
2008-12-20 12:36:14 +00:00
uiBlockSetDirection ( block , UI_DOWN ) ;
}
else {
uiBlockSetDirection ( block , UI_TOP ) ;
uiBlockFlipOrder ( block ) ;
}
uiTextBoundsBlock ( block , 50 ) ;
return block ;
}
2009-08-15 19:40:09 +00:00
/* wrapper for python layouts */
void uiTemplate_view3d_select_faceselmenu ( uiLayout * layout , bContext * C )
{
void * arg_unused = NULL ;
ARegion * ar = CTX_wm_region ( C ) ;
view3d_select_faceselmenu ( C , ar , arg_unused ) ;
}
2009-08-15 16:36:25 +00:00
#if 0
2008-12-20 12:36:14 +00:00
void do_view3d_transform_moveaxismenu ( bContext * C , void * arg , int event )
{
#if 0
float mat [ 3 ] [ 3 ] ;
Mat3One ( mat ) ;
switch ( event )
{
case 0 : /* X Global */
initTransform ( TFM_TRANSLATION , CTX_NONE ) ;
BIF_setSingleAxisConstraint ( mat [ 0 ] , " X " ) ;
Transform ( ) ;
break ;
case 1 : /* Y Global */
initTransform ( TFM_TRANSLATION , CTX_NONE ) ;
BIF_setSingleAxisConstraint ( mat [ 1 ] , " Y " ) ;
Transform ( ) ;
break ;
case 2 : /* Z Global */
initTransform ( TFM_TRANSLATION , CTX_NONE ) ;
BIF_setSingleAxisConstraint ( mat [ 2 ] , " Z " ) ;
Transform ( ) ;
break ;
case 3 : /* X Local */
initTransform ( TFM_TRANSLATION , CTX_NONE ) ;
BIF_setLocalAxisConstraint ( ' X ' , " X " ) ;
Transform ( ) ;
break ;
case 4 : /* Y Local */
initTransform ( TFM_TRANSLATION , CTX_NONE ) ;
BIF_setLocalAxisConstraint ( ' Y ' , " Y " ) ;
Transform ( ) ;
break ;
case 5 : /* Z Local */
initTransform ( TFM_TRANSLATION , CTX_NONE ) ;
BIF_setLocalAxisConstraint ( ' Z ' , " Z " ) ;
Transform ( ) ;
break ;
}
# endif
}
2.5: UI & Menus
* Cleaned up UI_interface.h a bit, and added some comments to
organize things a bit and indicate what should be used when.
* uiMenu* functions can now be used to create menus for headers
too, this is done with a uiDefMenuBut, which takes a pointer
to a uiMenuCreateFunc, that will then call uiMenu* functions.
* Renamed uiMenuBegin/End to uiPupMenuBegin/End, as these are
specific to making popup menus. Will convert the other
conformation popup menu functions to use this too so we can
remove some code.
* Extended uiMenu functions, now there is is also:
BooleanO, FloatO, BooleanR, EnumR, LevelEnumR, Separator.
* Converted image window headers to use uiMenu functions, simplifies
menu code further here. Did not remove the uiDefMenu functions as
they are used in sequencer/view3d in some places now (will fix).
* Also tried to simplify and fix bounds computation a bit better
for popup menus. It tried to find out in advance what the size
of the menu was but this is difficult with keymap strings in
there, now uiPopupBoundsBlock can figure this out afterwards and
ensure the popup is within the window bounds. Will convert some
other functions to use this too.
2009-01-30 12:18:08 +00:00
static uiBlock * view3d_transform_moveaxismenu ( bContext * C , ARegion * ar , void * arg_unused )
2008-12-20 12:36:14 +00:00
{
uiBlock * block ;
short yco = 20 , menuwidth = 120 ;
2.5
More cleanup!
- removed old UI font completely, including from uiBeginBlock
- emboss hints for uiBlock only have three types now;
Regular, Pulldown, or "Nothing" (only icon/text)
- removed old font path from Userdef
- removed all old button theme hinting
- removed old "auto block" to merge buttons in groups
(was only in use for radiosity buttons)
And went over all warnings. One hooray for make giving clean output :)
Well, we need uniform definitions for warnings, so people at least fix
them... here's the real bad bugs I found:
- in mesh code, a call to editmesh mixed *em and *me
- in armature, ED_util.h was not included, so no warnings for wrong call
to ED_undo_push()
- The extern Py api .h was not included in the bpy_interface.c, showing
a several calls using different args.
Further just added the missing includes, and removed unused vars.
2009-04-14 15:59:52 +00:00
block = uiBeginBlock ( C , ar , " view3d_transform_moveaxismenu " , UI_EMBOSSP ) ;
2008-12-20 12:36:14 +00:00
uiBlockSetButmFunc ( block , do_view3d_transform_moveaxismenu , NULL ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " X Global|G, X " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 0 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Y Global|G, Y " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 1 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Z Global|G, Z " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 2 , " " ) ;
uiDefBut ( block , SEPR , 0 , " " , 0 , yco - = 6 , menuwidth , 6 , NULL , 0.0 , 0.0 , 0 , 0 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " X Local|G, X, X " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 3 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Y Local|G, Y, Y " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 4 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Z Local|G, Z, Z " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 5 , " " ) ;
uiBlockSetDirection ( block , UI_RIGHT ) ;
uiTextBoundsBlock ( block , 60 ) ;
return block ;
}
void do_view3d_transform_rotateaxismenu ( bContext * C , void * arg , int event )
{
#if 0
float mat [ 3 ] [ 3 ] ;
Mat3One ( mat ) ;
switch ( event )
{
case 0 : /* X Global */
initTransform ( TFM_ROTATION , CTX_NONE ) ;
BIF_setSingleAxisConstraint ( mat [ 0 ] , " X " ) ;
Transform ( ) ;
break ;
case 1 : /* Y Global */
initTransform ( TFM_ROTATION , CTX_NONE ) ;
BIF_setSingleAxisConstraint ( mat [ 1 ] , " Y " ) ;
Transform ( ) ;
break ;
case 2 : /* Z Global */
initTransform ( TFM_ROTATION , CTX_NONE ) ;
BIF_setSingleAxisConstraint ( mat [ 2 ] , " Z " ) ;
Transform ( ) ;
break ;
case 3 : /* X Local */
initTransform ( TFM_ROTATION , CTX_NONE ) ;
BIF_setLocalAxisConstraint ( ' X ' , " X " ) ;
Transform ( ) ;
break ;
case 4 : /* Y Local */
initTransform ( TFM_ROTATION , CTX_NONE ) ;
BIF_setLocalAxisConstraint ( ' Y ' , " Y " ) ;
Transform ( ) ;
break ;
case 5 : /* Z Local */
initTransform ( TFM_ROTATION , CTX_NONE ) ;
BIF_setLocalAxisConstraint ( ' Z ' , " Z " ) ;
Transform ( ) ;
break ;
}
# endif
}
2.5: UI & Menus
* Cleaned up UI_interface.h a bit, and added some comments to
organize things a bit and indicate what should be used when.
* uiMenu* functions can now be used to create menus for headers
too, this is done with a uiDefMenuBut, which takes a pointer
to a uiMenuCreateFunc, that will then call uiMenu* functions.
* Renamed uiMenuBegin/End to uiPupMenuBegin/End, as these are
specific to making popup menus. Will convert the other
conformation popup menu functions to use this too so we can
remove some code.
* Extended uiMenu functions, now there is is also:
BooleanO, FloatO, BooleanR, EnumR, LevelEnumR, Separator.
* Converted image window headers to use uiMenu functions, simplifies
menu code further here. Did not remove the uiDefMenu functions as
they are used in sequencer/view3d in some places now (will fix).
* Also tried to simplify and fix bounds computation a bit better
for popup menus. It tried to find out in advance what the size
of the menu was but this is difficult with keymap strings in
there, now uiPopupBoundsBlock can figure this out afterwards and
ensure the popup is within the window bounds. Will convert some
other functions to use this too.
2009-01-30 12:18:08 +00:00
static uiBlock * view3d_transform_rotateaxismenu ( bContext * C , ARegion * ar , void * arg_unused )
2008-12-20 12:36:14 +00:00
{
uiBlock * block ;
short yco = 20 , menuwidth = 120 ;
2.5
More cleanup!
- removed old UI font completely, including from uiBeginBlock
- emboss hints for uiBlock only have three types now;
Regular, Pulldown, or "Nothing" (only icon/text)
- removed old font path from Userdef
- removed all old button theme hinting
- removed old "auto block" to merge buttons in groups
(was only in use for radiosity buttons)
And went over all warnings. One hooray for make giving clean output :)
Well, we need uniform definitions for warnings, so people at least fix
them... here's the real bad bugs I found:
- in mesh code, a call to editmesh mixed *em and *me
- in armature, ED_util.h was not included, so no warnings for wrong call
to ED_undo_push()
- The extern Py api .h was not included in the bpy_interface.c, showing
a several calls using different args.
Further just added the missing includes, and removed unused vars.
2009-04-14 15:59:52 +00:00
block = uiBeginBlock ( C , ar , " view3d_transform_rotateaxismenu " , UI_EMBOSSP ) ;
2008-12-20 12:36:14 +00:00
uiBlockSetButmFunc ( block , do_view3d_transform_rotateaxismenu , NULL ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " X Global|R, X " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 0 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Y Global|R, Y " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 1 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Z Global|R, Z " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 2 , " " ) ;
uiDefBut ( block , SEPR , 0 , " " , 0 , yco - = 6 , menuwidth , 6 , NULL , 0.0 , 0.0 , 0 , 0 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " X Local|R, X, X " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 3 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Y Local|R, Y, Y " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 4 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Z Local|R, Z, Z " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 5 , " " ) ;
uiBlockSetDirection ( block , UI_RIGHT ) ;
uiTextBoundsBlock ( block , 60 ) ;
return block ;
}
void do_view3d_transform_scaleaxismenu ( bContext * C , void * arg , int event )
{
#if 0
float mat [ 3 ] [ 3 ] ;
Mat3One ( mat ) ;
switch ( event )
{
case 0 : /* X Global */
initTransform ( TFM_RESIZE , CTX_NONE ) ;
BIF_setSingleAxisConstraint ( mat [ 0 ] , " X " ) ;
Transform ( ) ;
break ;
case 1 : /* Y Global */
initTransform ( TFM_RESIZE , CTX_NONE ) ;
BIF_setSingleAxisConstraint ( mat [ 1 ] , " Y " ) ;
Transform ( ) ;
break ;
case 2 : /* Z Global */
initTransform ( TFM_RESIZE , CTX_NONE ) ;
BIF_setSingleAxisConstraint ( mat [ 2 ] , " Z " ) ;
Transform ( ) ;
break ;
case 3 : /* X Local */
initTransform ( TFM_RESIZE , CTX_NONE ) ;
BIF_setLocalAxisConstraint ( ' X ' , " X " ) ;
Transform ( ) ;
break ;
case 4 : /* Y Local */
initTransform ( TFM_RESIZE , CTX_NONE ) ;
BIF_setLocalAxisConstraint ( ' X ' , " X " ) ;
Transform ( ) ;
break ;
case 5 : /* Z Local */
initTransform ( TFM_RESIZE , CTX_NONE ) ;
BIF_setLocalAxisConstraint ( ' X ' , " X " ) ;
Transform ( ) ;
break ;
}
# endif
}
2.5: UI & Menus
* Cleaned up UI_interface.h a bit, and added some comments to
organize things a bit and indicate what should be used when.
* uiMenu* functions can now be used to create menus for headers
too, this is done with a uiDefMenuBut, which takes a pointer
to a uiMenuCreateFunc, that will then call uiMenu* functions.
* Renamed uiMenuBegin/End to uiPupMenuBegin/End, as these are
specific to making popup menus. Will convert the other
conformation popup menu functions to use this too so we can
remove some code.
* Extended uiMenu functions, now there is is also:
BooleanO, FloatO, BooleanR, EnumR, LevelEnumR, Separator.
* Converted image window headers to use uiMenu functions, simplifies
menu code further here. Did not remove the uiDefMenu functions as
they are used in sequencer/view3d in some places now (will fix).
* Also tried to simplify and fix bounds computation a bit better
for popup menus. It tried to find out in advance what the size
of the menu was but this is difficult with keymap strings in
there, now uiPopupBoundsBlock can figure this out afterwards and
ensure the popup is within the window bounds. Will convert some
other functions to use this too.
2009-01-30 12:18:08 +00:00
static uiBlock * view3d_transform_scaleaxismenu ( bContext * C , ARegion * ar , void * arg_unused )
2008-12-20 12:36:14 +00:00
{
uiBlock * block ;
short yco = 20 , menuwidth = 120 ;
2.5
More cleanup!
- removed old UI font completely, including from uiBeginBlock
- emboss hints for uiBlock only have three types now;
Regular, Pulldown, or "Nothing" (only icon/text)
- removed old font path from Userdef
- removed all old button theme hinting
- removed old "auto block" to merge buttons in groups
(was only in use for radiosity buttons)
And went over all warnings. One hooray for make giving clean output :)
Well, we need uniform definitions for warnings, so people at least fix
them... here's the real bad bugs I found:
- in mesh code, a call to editmesh mixed *em and *me
- in armature, ED_util.h was not included, so no warnings for wrong call
to ED_undo_push()
- The extern Py api .h was not included in the bpy_interface.c, showing
a several calls using different args.
Further just added the missing includes, and removed unused vars.
2009-04-14 15:59:52 +00:00
block = uiBeginBlock ( C , ar , " view3d_transform_scaleaxismenu " , UI_EMBOSSP ) ;
2008-12-20 12:36:14 +00:00
uiBlockSetButmFunc ( block , do_view3d_transform_scaleaxismenu , NULL ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " X Global|S, X " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 0 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Y Global|S, Y " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 1 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Z Global|S, Z " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 2 , " " ) ;
uiDefBut ( block , SEPR , 0 , " " , 0 , yco - = 6 , menuwidth , 6 , NULL , 0.0 , 0.0 , 0 , 0 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " X Local|S, X, X " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 3 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Y Local|S, Y, Y " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 4 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Z Local|S, Z, Z " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 5 , " " ) ;
uiBlockSetDirection ( block , UI_RIGHT ) ;
uiTextBoundsBlock ( block , 60 ) ;
return block ;
}
2009-08-15 16:36:25 +00:00
# endif
2008-12-20 12:36:14 +00:00
2009-08-15 16:36:25 +00:00
#if 0
2008-12-20 12:36:14 +00:00
static void do_view3d_transformmenu ( bContext * C , void * arg , int event )
{
#if 0
Scene * scene = CTX_data_scene ( C ) ;
2009-06-23 00:41:55 +00:00
ToolSettings * ts = CTX_data_tool_settings ( C ) ;
2008-12-20 12:36:14 +00:00
switch ( event ) {
case 1 :
initTransform ( TFM_TRANSLATION , CTX_NONE ) ;
Transform ( ) ;
break ;
case 2 :
initTransform ( TFM_ROTATION , CTX_NONE ) ;
Transform ( ) ;
break ;
case 3 :
initTransform ( TFM_RESIZE , CTX_NONE ) ;
Transform ( ) ;
break ;
case 4 :
image_aspect ( ) ;
break ;
case 5 :
initTransform ( TFM_TOSPHERE , CTX_NONE ) ;
Transform ( ) ;
break ;
case 6 :
initTransform ( TFM_SHEAR , CTX_NONE ) ;
Transform ( ) ;
break ;
case 7 :
initTransform ( TFM_WARP , CTX_NONE ) ;
Transform ( ) ;
break ;
case 8 :
initTransform ( TFM_PUSHPULL , CTX_NONE ) ;
Transform ( ) ;
break ;
case 9 :
2008-12-31 22:43:29 +00:00
if ( obedit ) {
if ( obedit - > type = = OB_MESH )
2008-12-20 12:36:14 +00:00
initTransform ( TFM_SHRINKFATTEN , CTX_NONE ) ;
Transform ( ) ;
} else error ( " Only meshes can be shrinked/fattened " ) ;
break ;
case 10 :
docenter ( 0 ) ;
break ;
case 11 :
docenter_new ( ) ;
break ;
case 12 :
docenter_cursor ( ) ;
break ;
case 13 :
initTransform ( TFM_TILT , CTX_NONE ) ;
Transform ( ) ;
break ;
case 14 :
initTransform ( TFM_CURVE_SHRINKFATTEN , CTX_NONE ) ;
Transform ( ) ;
break ;
case 15 :
2009-06-23 00:41:55 +00:00
ts - > snap_flag & = ~ SCE_SNAP ;
2008-12-20 12:36:14 +00:00
break ;
case 16 :
2009-06-23 00:41:55 +00:00
ts - > snap_flag | = SCE_SNAP ;
2008-12-20 12:36:14 +00:00
break ;
case 17 :
2009-06-23 00:41:55 +00:00
ts - > snap_target = SCE_SNAP_TARGET_CLOSEST ;
2008-12-20 12:36:14 +00:00
break ;
case 18 :
2009-06-23 00:41:55 +00:00
ts - > snap_target = SCE_SNAP_TARGET_CENTER ;
2008-12-20 12:36:14 +00:00
break ;
case 19 :
2009-06-23 00:41:55 +00:00
ts - > snap_target = SCE_SNAP_TARGET_MEDIAN ;
2008-12-20 12:36:14 +00:00
break ;
case 20 :
2009-06-23 00:41:55 +00:00
ts - > snap_target = SCE_SNAP_TARGET_ACTIVE ;
2008-12-20 12:36:14 +00:00
break ;
case 21 :
alignmenu ( ) ;
break ;
}
# endif
}
2.5: UI & Menus
* Cleaned up UI_interface.h a bit, and added some comments to
organize things a bit and indicate what should be used when.
* uiMenu* functions can now be used to create menus for headers
too, this is done with a uiDefMenuBut, which takes a pointer
to a uiMenuCreateFunc, that will then call uiMenu* functions.
* Renamed uiMenuBegin/End to uiPupMenuBegin/End, as these are
specific to making popup menus. Will convert the other
conformation popup menu functions to use this too so we can
remove some code.
* Extended uiMenu functions, now there is is also:
BooleanO, FloatO, BooleanR, EnumR, LevelEnumR, Separator.
* Converted image window headers to use uiMenu functions, simplifies
menu code further here. Did not remove the uiDefMenu functions as
they are used in sequencer/view3d in some places now (will fix).
* Also tried to simplify and fix bounds computation a bit better
for popup menus. It tried to find out in advance what the size
of the menu was but this is difficult with keymap strings in
there, now uiPopupBoundsBlock can figure this out afterwards and
ensure the popup is within the window bounds. Will convert some
other functions to use this too.
2009-01-30 12:18:08 +00:00
static uiBlock * view3d_transformmenu ( bContext * C , ARegion * ar , void * arg_unused )
2008-12-20 12:36:14 +00:00
{
2009-06-23 00:41:55 +00:00
ToolSettings * ts = CTX_data_tool_settings ( C ) ;
2008-12-31 22:43:29 +00:00
Object * obedit = CTX_data_edit_object ( C ) ;
2008-12-20 12:36:14 +00:00
uiBlock * block ;
short yco = 20 , menuwidth = 120 ;
2.5
More cleanup!
- removed old UI font completely, including from uiBeginBlock
- emboss hints for uiBlock only have three types now;
Regular, Pulldown, or "Nothing" (only icon/text)
- removed old font path from Userdef
- removed all old button theme hinting
- removed old "auto block" to merge buttons in groups
(was only in use for radiosity buttons)
And went over all warnings. One hooray for make giving clean output :)
Well, we need uniform definitions for warnings, so people at least fix
them... here's the real bad bugs I found:
- in mesh code, a call to editmesh mixed *em and *me
- in armature, ED_util.h was not included, so no warnings for wrong call
to ED_undo_push()
- The extern Py api .h was not included in the bpy_interface.c, showing
a several calls using different args.
Further just added the missing includes, and removed unused vars.
2009-04-14 15:59:52 +00:00
block = uiBeginBlock ( C , ar , " view3d_transformmenu " , UI_EMBOSSP ) ;
2008-12-20 12:36:14 +00:00
uiBlockSetButmFunc ( block , do_view3d_transformmenu , NULL ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Grab/Move|G " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 1 , " " ) ;
uiDefIconTextBlockBut ( block , view3d_transform_moveaxismenu , NULL , ICON_RIGHTARROW_THIN , " Grab/Move on Axis " , 0 , yco - = 20 , 120 , 19 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Rotate|R " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 2 , " " ) ;
uiDefIconTextBlockBut ( block , view3d_transform_rotateaxismenu , NULL , ICON_RIGHTARROW_THIN , " Rotate on Axis " , 0 , yco - = 20 , 120 , 19 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Scale|S " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 3 , " " ) ;
uiDefIconTextBlockBut ( block , view3d_transform_scaleaxismenu , NULL , ICON_RIGHTARROW_THIN , " Scale on Axis " , 0 , yco - = 20 , 120 , 19 , " " ) ;
uiDefBut ( block , SEPR , 0 , " " , 0 , yco - = 6 , menuwidth , 6 , NULL , 0.0 , 0.0 , 0 , 0 , " " ) ;
2008-12-31 22:43:29 +00:00
if ( obedit ) {
if ( obedit - > type = = OB_MESH )
2008-12-20 12:36:14 +00:00
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Shrink/Fatten Along Normals|Alt S " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 9 , " " ) ;
2008-12-31 22:43:29 +00:00
else if ( obedit - > type = = OB_CURVE ) {
2008-12-20 12:36:14 +00:00
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Tilt|T " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 13 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Shrink/Fatten Radius|Alt S " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 14 , " " ) ;
}
}
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " To Sphere|Ctrl Shift S " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 5 , " " ) ;
2008-12-31 22:43:29 +00:00
if ( obedit ) uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Shear|Ctrl S " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 6 , " " ) ;
2008-12-20 12:36:14 +00:00
else uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Shear|Ctrl Shift Alt S " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 6 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Warp|Shift W " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 7 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Push/Pull|Shift P " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 8 , " " ) ;
2008-12-31 22:43:29 +00:00
if ( ! obedit ) {
2008-12-20 12:36:14 +00:00
uiDefBut ( block , SEPR , 0 , " " , 0 , yco - = 6 , menuwidth , 6 , NULL , 0.0 , 0.0 , 0 , 0 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Scale to Image Aspect Ratio|Alt V " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 4 , " " ) ;
}
uiDefBut ( block , SEPR , 0 , " " , 0 , yco - = 6 , menuwidth , 6 , NULL , 0.0 , 0.0 , 0 , 0 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " ObData to Center " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 10 , " " ) ;
2008-12-31 22:43:29 +00:00
if ( ! obedit ) {
2008-12-20 12:36:14 +00:00
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Center New " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 11 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Center Cursor " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 12 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Align to Transform Orientation|Ctrl Alt A " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 21 , " " ) ;
}
2008-12-31 22:43:29 +00:00
if ( BIF_snappingSupported ( obedit ) )
2008-12-20 12:36:14 +00:00
{
uiDefBut ( block , SEPR , 0 , " " , 0 , yco - = 6 , menuwidth , 6 , NULL , 0.0 , 0.0 , 0 , 0 , " " ) ;
2009-06-23 00:41:55 +00:00
if ( ts - > snap_flag & SCE_SNAP )
2008-12-20 12:36:14 +00:00
{
uiDefIconTextBut ( block , BUTM , 1 , ICON_CHECKBOX_DEHLT , " Grid " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 15 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_CHECKBOX_HLT , " Snap " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 16 , " " ) ;
}
else
{
uiDefIconTextBut ( block , BUTM , 1 , ICON_CHECKBOX_HLT , " Grid " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 15 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_CHECKBOX_DEHLT , " Snap " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 16 , " " ) ;
}
uiDefBut ( block , SEPR , 0 , " " , 0 , yco - = 6 , menuwidth , 6 , NULL , 0.0 , 0.0 , 0 , 0 , " " ) ;
2009-06-23 00:41:55 +00:00
switch ( ts - > snap_target )
2008-12-20 12:36:14 +00:00
{
case SCE_SNAP_TARGET_CLOSEST :
uiDefIconTextBut ( block , BUTM , 1 , ICON_CHECKBOX_HLT , " Snap Closest " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 17 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_CHECKBOX_DEHLT , " Snap Center " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 18 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_CHECKBOX_DEHLT , " Snap Median " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 19 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_CHECKBOX_DEHLT , " Snap Active " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 20 , " " ) ;
break ;
case SCE_SNAP_TARGET_CENTER :
uiDefIconTextBut ( block , BUTM , 1 , ICON_CHECKBOX_DEHLT , " Snap Closest " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 17 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_CHECKBOX_HLT , " Snap Center " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 18 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_CHECKBOX_DEHLT , " Snap Median " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 19 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_CHECKBOX_DEHLT , " Snap Active " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 20 , " " ) ;
break ;
case SCE_SNAP_TARGET_MEDIAN :
uiDefIconTextBut ( block , BUTM , 1 , ICON_CHECKBOX_DEHLT , " Snap Closest " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 17 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_CHECKBOX_DEHLT , " Snap Center " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 18 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_CHECKBOX_HLT , " Snap Median " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 19 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_CHECKBOX_DEHLT , " Snap Active " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 20 , " " ) ;
break ;
case SCE_SNAP_TARGET_ACTIVE :
uiDefIconTextBut ( block , BUTM , 1 , ICON_CHECKBOX_DEHLT , " Snap Closest " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 17 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_CHECKBOX_DEHLT , " Snap Center " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 18 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_CHECKBOX_DEHLT , " Snap Median " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 19 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_CHECKBOX_HLT , " Snap Active " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 20 , " " ) ;
break ;
}
}
uiBlockSetDirection ( block , UI_RIGHT ) ;
uiTextBoundsBlock ( block , 60 ) ;
return block ;
}
2009-07-10 13:56:29 +00:00
#if 0
2008-12-20 12:36:14 +00:00
void do_view3d_object_mirrormenu ( bContext * C , void * arg , int event )
{
#if 0
switch ( event ) {
case 0 :
initTransform ( TFM_MIRROR , CTX_NO_PET ) ;
Transform ( ) ;
break ;
case 1 :
initTransform ( TFM_MIRROR , CTX_NO_PET | CTX_AUTOCONFIRM ) ;
BIF_setLocalAxisConstraint ( ' X ' , " on X axis " ) ;
Transform ( ) ;
break ;
case 2 :
initTransform ( TFM_MIRROR , CTX_NO_PET | CTX_AUTOCONFIRM ) ;
BIF_setLocalAxisConstraint ( ' Y ' , " on Y axis " ) ;
Transform ( ) ;
break ;
case 3 :
initTransform ( TFM_MIRROR , CTX_NO_PET | CTX_AUTOCONFIRM ) ;
BIF_setLocalAxisConstraint ( ' Z ' , " on Z axis " ) ;
Transform ( ) ;
break ;
}
# endif
}
2.5: UI & Menus
* Cleaned up UI_interface.h a bit, and added some comments to
organize things a bit and indicate what should be used when.
* uiMenu* functions can now be used to create menus for headers
too, this is done with a uiDefMenuBut, which takes a pointer
to a uiMenuCreateFunc, that will then call uiMenu* functions.
* Renamed uiMenuBegin/End to uiPupMenuBegin/End, as these are
specific to making popup menus. Will convert the other
conformation popup menu functions to use this too so we can
remove some code.
* Extended uiMenu functions, now there is is also:
BooleanO, FloatO, BooleanR, EnumR, LevelEnumR, Separator.
* Converted image window headers to use uiMenu functions, simplifies
menu code further here. Did not remove the uiDefMenu functions as
they are used in sequencer/view3d in some places now (will fix).
* Also tried to simplify and fix bounds computation a bit better
for popup menus. It tried to find out in advance what the size
of the menu was but this is difficult with keymap strings in
there, now uiPopupBoundsBlock can figure this out afterwards and
ensure the popup is within the window bounds. Will convert some
other functions to use this too.
2009-01-30 12:18:08 +00:00
static uiBlock * view3d_object_mirrormenu ( bContext * C , ARegion * ar , void * arg_unused )
2008-12-20 12:36:14 +00:00
{
uiBlock * block ;
short yco = 20 , menuwidth = 120 ;
2.5
More cleanup!
- removed old UI font completely, including from uiBeginBlock
- emboss hints for uiBlock only have three types now;
Regular, Pulldown, or "Nothing" (only icon/text)
- removed old font path from Userdef
- removed all old button theme hinting
- removed old "auto block" to merge buttons in groups
(was only in use for radiosity buttons)
And went over all warnings. One hooray for make giving clean output :)
Well, we need uniform definitions for warnings, so people at least fix
them... here's the real bad bugs I found:
- in mesh code, a call to editmesh mixed *em and *me
- in armature, ED_util.h was not included, so no warnings for wrong call
to ED_undo_push()
- The extern Py api .h was not included in the bpy_interface.c, showing
a several calls using different args.
Further just added the missing includes, and removed unused vars.
2009-04-14 15:59:52 +00:00
block = uiBeginBlock ( C , ar , " view3d_object_mirrormenu " , UI_EMBOSSP ) ;
2008-12-20 12:36:14 +00:00
uiBlockSetButmFunc ( block , do_view3d_object_mirrormenu , NULL ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Interactive Mirror|Ctrl M " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 0 , " " ) ;
uiDefBut ( block , SEPR , 0 , " " , 0 , yco - = 6 , menuwidth , 6 , NULL , 0.0 , 0.0 , 0 , 0 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " X Local|Ctrl M, X " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 1 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Y Local|Ctrl M, Y " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 2 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Z Local|Ctrl M, Z " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 3 , " " ) ;
uiBlockSetDirection ( block , UI_RIGHT ) ;
uiTextBoundsBlock ( block , 60 ) ;
return block ;
}
# endif
2009-08-15 16:36:25 +00:00
# endif
2008-12-20 12:36:14 +00:00
2009-08-26 00:38:43 +00:00
#if 0
2009-07-10 13:56:29 +00:00
static void view3d_edit_object_transformmenu ( bContext * C , uiLayout * layout , void * arg_unused )
2008-12-20 12:36:14 +00:00
{
2009-08-26 00:38:43 +00:00
#if 0 // XXX not used anymore
2008-12-20 12:36:14 +00:00
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Apply Scale/Rotation to ObData|Ctrl A, 1 " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 6 , " " ) ;
2009-07-10 13:56:29 +00:00
apply_objects_locrot ( ) ;
2008-12-20 12:36:14 +00:00
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Apply Visual Transform|Ctrl A, 2 " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 7 , " " ) ;
2009-07-10 13:56:29 +00:00
apply_objects_visual_tx ( ) ;
2008-12-20 12:36:14 +00:00
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Apply Deformation|Ctrl Shift A " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 4 , " " ) ;
2009-07-10 13:56:29 +00:00
if ( OBACT ) object_apply_deform ( OBACT ) ;
# endif
uiItemO ( layout , NULL , 0 , " OBJECT_OT_duplicates_make_real " ) ;
uiItemS ( layout ) ;
uiItemO ( layout , NULL , 0 , " OBJECT_OT_location_clear " ) ;
uiItemO ( layout , NULL , 0 , " OBJECT_OT_rotation_clear " ) ;
uiItemO ( layout , NULL , 0 , " OBJECT_OT_scale_clear " ) ;
uiItemO ( layout , NULL , 0 , " OBJECT_OT_origin_clear " ) ;
2008-12-20 12:36:14 +00:00
}
2009-08-26 00:38:43 +00:00
# endif
2008-12-20 12:36:14 +00:00
2009-07-10 13:56:29 +00:00
#if 0
2008-12-20 12:36:14 +00:00
static void do_view3d_edit_object_makelocalmenu ( bContext * C , void * arg , int event )
{
#if 0
switch ( event ) {
case 1 :
case 2 :
case 3 :
make_local ( event ) ;
break ;
}
# endif
}
2.5: UI & Menus
* Cleaned up UI_interface.h a bit, and added some comments to
organize things a bit and indicate what should be used when.
* uiMenu* functions can now be used to create menus for headers
too, this is done with a uiDefMenuBut, which takes a pointer
to a uiMenuCreateFunc, that will then call uiMenu* functions.
* Renamed uiMenuBegin/End to uiPupMenuBegin/End, as these are
specific to making popup menus. Will convert the other
conformation popup menu functions to use this too so we can
remove some code.
* Extended uiMenu functions, now there is is also:
BooleanO, FloatO, BooleanR, EnumR, LevelEnumR, Separator.
* Converted image window headers to use uiMenu functions, simplifies
menu code further here. Did not remove the uiDefMenu functions as
they are used in sequencer/view3d in some places now (will fix).
* Also tried to simplify and fix bounds computation a bit better
for popup menus. It tried to find out in advance what the size
of the menu was but this is difficult with keymap strings in
there, now uiPopupBoundsBlock can figure this out afterwards and
ensure the popup is within the window bounds. Will convert some
other functions to use this too.
2009-01-30 12:18:08 +00:00
static uiBlock * view3d_edit_object_makelocalmenu ( bContext * C , ARegion * ar , void * arg_unused )
2008-12-20 12:36:14 +00:00
{
uiBlock * block ;
short yco = 20 , menuwidth = 120 ;
2.5
More cleanup!
- removed old UI font completely, including from uiBeginBlock
- emboss hints for uiBlock only have three types now;
Regular, Pulldown, or "Nothing" (only icon/text)
- removed old font path from Userdef
- removed all old button theme hinting
- removed old "auto block" to merge buttons in groups
(was only in use for radiosity buttons)
And went over all warnings. One hooray for make giving clean output :)
Well, we need uniform definitions for warnings, so people at least fix
them... here's the real bad bugs I found:
- in mesh code, a call to editmesh mixed *em and *me
- in armature, ED_util.h was not included, so no warnings for wrong call
to ED_undo_push()
- The extern Py api .h was not included in the bpy_interface.c, showing
a several calls using different args.
Further just added the missing includes, and removed unused vars.
2009-04-14 15:59:52 +00:00
block = uiBeginBlock ( C , ar , " view3d_edit_object_makelocalmenu " , UI_EMBOSSP ) ;
2008-12-20 12:36:14 +00:00
uiBlockSetButmFunc ( block , do_view3d_edit_object_makelocalmenu , NULL ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Selected Objects|L, 1 " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 1 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Selected Objects and Data|L, 2 " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 2 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " All|L, 3 " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 3 , " " ) ;
uiBlockSetDirection ( block , UI_RIGHT ) ;
uiTextBoundsBlock ( block , 60 ) ;
return block ;
}
static void do_view3d_edit_object_makelinksmenu ( bContext * C , void * arg , int event )
{
#if 0
switch ( event ) {
case 1 :
case 2 :
case 3 :
case 4 :
make_links ( ( short ) event ) ;
break ;
}
# endif
}
2.5: UI & Menus
* Cleaned up UI_interface.h a bit, and added some comments to
organize things a bit and indicate what should be used when.
* uiMenu* functions can now be used to create menus for headers
too, this is done with a uiDefMenuBut, which takes a pointer
to a uiMenuCreateFunc, that will then call uiMenu* functions.
* Renamed uiMenuBegin/End to uiPupMenuBegin/End, as these are
specific to making popup menus. Will convert the other
conformation popup menu functions to use this too so we can
remove some code.
* Extended uiMenu functions, now there is is also:
BooleanO, FloatO, BooleanR, EnumR, LevelEnumR, Separator.
* Converted image window headers to use uiMenu functions, simplifies
menu code further here. Did not remove the uiDefMenu functions as
they are used in sequencer/view3d in some places now (will fix).
* Also tried to simplify and fix bounds computation a bit better
for popup menus. It tried to find out in advance what the size
of the menu was but this is difficult with keymap strings in
there, now uiPopupBoundsBlock can figure this out afterwards and
ensure the popup is within the window bounds. Will convert some
other functions to use this too.
2009-01-30 12:18:08 +00:00
static uiBlock * view3d_edit_object_makelinksmenu ( bContext * C , ARegion * ar , void * arg_unused )
2008-12-20 12:36:14 +00:00
{
Scene * scene = CTX_data_scene ( C ) ;
Object * ob = NULL ;
uiBlock * block ;
short yco = 20 , menuwidth = 120 ;
2.5
More cleanup!
- removed old UI font completely, including from uiBeginBlock
- emboss hints for uiBlock only have three types now;
Regular, Pulldown, or "Nothing" (only icon/text)
- removed old font path from Userdef
- removed all old button theme hinting
- removed old "auto block" to merge buttons in groups
(was only in use for radiosity buttons)
And went over all warnings. One hooray for make giving clean output :)
Well, we need uniform definitions for warnings, so people at least fix
them... here's the real bad bugs I found:
- in mesh code, a call to editmesh mixed *em and *me
- in armature, ED_util.h was not included, so no warnings for wrong call
to ED_undo_push()
- The extern Py api .h was not included in the bpy_interface.c, showing
a several calls using different args.
Further just added the missing includes, and removed unused vars.
2009-04-14 15:59:52 +00:00
block = uiBeginBlock ( C , ar , " view3d_edit_object_makelinksmenu " , UI_EMBOSSP ) ;
2008-12-20 12:36:14 +00:00
uiBlockSetButmFunc ( block , do_view3d_edit_object_makelinksmenu , NULL ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " To Scene...|Ctrl L, 1 " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 1 , " " ) ;
uiDefBut ( block , SEPR , 0 , " " , 0 , yco - = 6 , menuwidth , 6 , NULL , 0.0 , 0.0 , 0 , 0 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Object Ipo|Ctrl L, 2 " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 4 , " " ) ;
if ( ( ob = OBACT ) ) {
if ( ob - > type = = OB_MESH ) {
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Mesh Data|Ctrl L, 3 " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 2 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Materials|Ctrl L, 4 " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 3 , " " ) ;
} else if ( ob - > type = = OB_CURVE ) {
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Curve Data|Ctrl L, 3 " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 2 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Materials|Ctrl L, 4 " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 3 , " " ) ;
} else if ( ob - > type = = OB_FONT ) {
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Text Data|Ctrl L, 3 " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 2 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Materials|Ctrl L, 4 " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 3 , " " ) ;
} else if ( ob - > type = = OB_SURF ) {
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Surface Data|Ctrl L, 3 " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 2 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Materials|Ctrl L, 4 " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 3 , " " ) ;
} else if ( ob - > type = = OB_MBALL ) {
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Materials|Ctrl L, 3 " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 3 , " " ) ;
} else if ( ob - > type = = OB_CAMERA ) {
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Camera Data|Ctrl L, 3 " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 2 , " " ) ;
} else if ( ob - > type = = OB_LAMP ) {
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Lamp Data|Ctrl L, 3 " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 2 , " " ) ;
} else if ( ob - > type = = OB_LATTICE ) {
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Lattice Data|Ctrl L, 3 " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 2 , " " ) ;
} else if ( ob - > type = = OB_ARMATURE ) {
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Armature Data|Ctrl L, 3 " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 2 , " " ) ;
}
}
uiBlockSetDirection ( block , UI_RIGHT ) ;
uiTextBoundsBlock ( block , 60 ) ;
return block ;
}
static void do_view3d_edit_object_singleusermenu ( bContext * C , void * arg , int event )
{
#if 0
switch ( event ) {
case 1 : /* Object */
single_object_users ( 1 ) ;
break ;
case 2 : /* Object & ObData */
single_object_users ( 1 ) ;
single_obdata_users ( 1 ) ;
break ;
case 3 : /* Object & ObData & Materials+Tex */
single_object_users ( 1 ) ;
single_obdata_users ( 1 ) ;
single_mat_users ( 1 ) ; /* also tex */
break ;
case 4 : /* Materials+Tex */
single_mat_users ( 1 ) ;
break ;
case 5 : /* Ipo */
single_ipo_users ( 1 ) ;
break ;
}
clear_id_newpoins ( ) ;
countall ( ) ;
# endif
}
2.5: UI & Menus
* Cleaned up UI_interface.h a bit, and added some comments to
organize things a bit and indicate what should be used when.
* uiMenu* functions can now be used to create menus for headers
too, this is done with a uiDefMenuBut, which takes a pointer
to a uiMenuCreateFunc, that will then call uiMenu* functions.
* Renamed uiMenuBegin/End to uiPupMenuBegin/End, as these are
specific to making popup menus. Will convert the other
conformation popup menu functions to use this too so we can
remove some code.
* Extended uiMenu functions, now there is is also:
BooleanO, FloatO, BooleanR, EnumR, LevelEnumR, Separator.
* Converted image window headers to use uiMenu functions, simplifies
menu code further here. Did not remove the uiDefMenu functions as
they are used in sequencer/view3d in some places now (will fix).
* Also tried to simplify and fix bounds computation a bit better
for popup menus. It tried to find out in advance what the size
of the menu was but this is difficult with keymap strings in
there, now uiPopupBoundsBlock can figure this out afterwards and
ensure the popup is within the window bounds. Will convert some
other functions to use this too.
2009-01-30 12:18:08 +00:00
static uiBlock * view3d_edit_object_singleusermenu ( bContext * C , ARegion * ar , void * arg_unused )
2008-12-20 12:36:14 +00:00
{
uiBlock * block ;
short yco = 20 , menuwidth = 120 ;
2.5
More cleanup!
- removed old UI font completely, including from uiBeginBlock
- emboss hints for uiBlock only have three types now;
Regular, Pulldown, or "Nothing" (only icon/text)
- removed old font path from Userdef
- removed all old button theme hinting
- removed old "auto block" to merge buttons in groups
(was only in use for radiosity buttons)
And went over all warnings. One hooray for make giving clean output :)
Well, we need uniform definitions for warnings, so people at least fix
them... here's the real bad bugs I found:
- in mesh code, a call to editmesh mixed *em and *me
- in armature, ED_util.h was not included, so no warnings for wrong call
to ED_undo_push()
- The extern Py api .h was not included in the bpy_interface.c, showing
a several calls using different args.
Further just added the missing includes, and removed unused vars.
2009-04-14 15:59:52 +00:00
block = uiBeginBlock ( C , ar , " view3d_edit_object_singleusermenu " , UI_EMBOSSP ) ;
2008-12-20 12:36:14 +00:00
uiBlockSetButmFunc ( block , do_view3d_edit_object_singleusermenu , NULL ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Object|U, 1 " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 1 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Object & ObData|U, 2 " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 2 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Object & ObData & Materials+Tex|U, 3 " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 3 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Materials+Tex|U, 4 " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 4 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Ipos|U, 5 " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 5 , " " ) ;
uiBlockSetDirection ( block , UI_RIGHT ) ;
uiTextBoundsBlock ( block , 60 ) ;
return block ;
}
static void do_view3d_edit_object_copyattrmenu ( bContext * C , void * arg , int event )
{
switch ( event ) {
case 1 :
case 2 :
case 3 :
case 4 :
case 5 :
case 6 :
case 7 :
case 8 :
case 9 :
case 10 :
case 11 :
case 17 :
case 18 :
case 19 :
case 20 :
case 21 :
case 22 :
case 23 :
case 24 :
case 25 :
case 26 :
case 29 :
case 30 :
// XXX copy_attr((short)event);
break ;
}
}
2.5: UI & Menus
* Cleaned up UI_interface.h a bit, and added some comments to
organize things a bit and indicate what should be used when.
* uiMenu* functions can now be used to create menus for headers
too, this is done with a uiDefMenuBut, which takes a pointer
to a uiMenuCreateFunc, that will then call uiMenu* functions.
* Renamed uiMenuBegin/End to uiPupMenuBegin/End, as these are
specific to making popup menus. Will convert the other
conformation popup menu functions to use this too so we can
remove some code.
* Extended uiMenu functions, now there is is also:
BooleanO, FloatO, BooleanR, EnumR, LevelEnumR, Separator.
* Converted image window headers to use uiMenu functions, simplifies
menu code further here. Did not remove the uiDefMenu functions as
they are used in sequencer/view3d in some places now (will fix).
* Also tried to simplify and fix bounds computation a bit better
for popup menus. It tried to find out in advance what the size
of the menu was but this is difficult with keymap strings in
there, now uiPopupBoundsBlock can figure this out afterwards and
ensure the popup is within the window bounds. Will convert some
other functions to use this too.
2009-01-30 12:18:08 +00:00
static uiBlock * view3d_edit_object_copyattrmenu ( bContext * C , ARegion * ar , void * arg_unused )
2008-12-20 12:36:14 +00:00
{
Scene * scene = CTX_data_scene ( C ) ;
Object * ob = NULL ;
uiBlock * block ;
short yco = 20 , menuwidth = 120 ;
2.5
More cleanup!
- removed old UI font completely, including from uiBeginBlock
- emboss hints for uiBlock only have three types now;
Regular, Pulldown, or "Nothing" (only icon/text)
- removed old font path from Userdef
- removed all old button theme hinting
- removed old "auto block" to merge buttons in groups
(was only in use for radiosity buttons)
And went over all warnings. One hooray for make giving clean output :)
Well, we need uniform definitions for warnings, so people at least fix
them... here's the real bad bugs I found:
- in mesh code, a call to editmesh mixed *em and *me
- in armature, ED_util.h was not included, so no warnings for wrong call
to ED_undo_push()
- The extern Py api .h was not included in the bpy_interface.c, showing
a several calls using different args.
Further just added the missing includes, and removed unused vars.
2009-04-14 15:59:52 +00:00
block = uiBeginBlock ( C , ar , " view3d_edit_object_copyattrmenu " , UI_EMBOSSP ) ;
2008-12-20 12:36:14 +00:00
uiBlockSetButmFunc ( block , do_view3d_edit_object_copyattrmenu , NULL ) ;
ob = OBACT ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Location|Ctrl C, 1 " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 1 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Rotation|Ctrl C, 2 " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 2 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Size|Ctrl C, 3 " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 3 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Drawtype|Ctrl C, 4 " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 4 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Time Offset|Ctrl C, 5 " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 5 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Dupli|Ctrl C, 6 " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 6 , " " ) ;
uiDefBut ( block , SEPR , 0 , " " , 0 , yco - = 6 , menuwidth , 6 , NULL , 0.0 , 0.0 , 0 , 0 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Mass|Ctrl C, 7 " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 7 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Damping|Ctrl C, 8 " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 8 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " All Physical Attributes|Ctrl C, 11 " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 11 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Properties|Ctrl C, 9 " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 9 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Logic Bricks|Ctrl C, 10 " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 10 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Protected Transform |Ctrl C " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 29 , " " ) ;
uiDefBut ( block , SEPR , 0 , " " , 0 , yco - = 6 , menuwidth , 6 , NULL , 0.0 , 0.0 , 0 , 0 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Object Constraints|Ctrl C " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 22 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " NLA Strips|Ctrl C " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 26 , " " ) ;
if ( ob ) {
if ( ( ob - > type = = OB_MESH ) | | ( ob - > type = = OB_CURVE ) | | ( ob - > type = = OB_SURF ) | |
( ob - > type = = OB_FONT ) | | ( ob - > type = = OB_MBALL ) ) {
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Texture Space|Ctrl C " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 17 , " " ) ;
}
if ( ob - > type = = OB_FONT ) {
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Font Settings|Ctrl C " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 18 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Bevel Settings|Ctrl C " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 19 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Curve Resolution|Ctrl C " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 25 , " " ) ;
}
if ( ob - > type = = OB_CURVE ) {
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Bevel Settings|Ctrl C " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 19 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Curve Resolution|Ctrl C " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 25 , " " ) ;
}
if ( ob - > type = = OB_MESH ) {
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Subsurf Settings|Ctrl C " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 21 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Modifiers ...|Ctrl C " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 24 , " " ) ;
}
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Object Pass Index|Ctrl C " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 30 , " " ) ;
}
uiBlockSetDirection ( block , UI_RIGHT ) ;
uiTextBoundsBlock ( block , 60 ) ;
return block ;
}
# endif
2009-07-10 13:56:29 +00:00
#if 0
2008-12-20 12:36:14 +00:00
# ifndef DISABLE_PYTHON
static void do_view3d_edit_object_scriptsmenu ( bContext * C , void * arg , int event )
{
#if 0
BPY_menu_do_python ( PYMENU_OBJECT , event ) ;
# endif
}
2.5: UI & Menus
* Cleaned up UI_interface.h a bit, and added some comments to
organize things a bit and indicate what should be used when.
* uiMenu* functions can now be used to create menus for headers
too, this is done with a uiDefMenuBut, which takes a pointer
to a uiMenuCreateFunc, that will then call uiMenu* functions.
* Renamed uiMenuBegin/End to uiPupMenuBegin/End, as these are
specific to making popup menus. Will convert the other
conformation popup menu functions to use this too so we can
remove some code.
* Extended uiMenu functions, now there is is also:
BooleanO, FloatO, BooleanR, EnumR, LevelEnumR, Separator.
* Converted image window headers to use uiMenu functions, simplifies
menu code further here. Did not remove the uiDefMenu functions as
they are used in sequencer/view3d in some places now (will fix).
* Also tried to simplify and fix bounds computation a bit better
for popup menus. It tried to find out in advance what the size
of the menu was but this is difficult with keymap strings in
there, now uiPopupBoundsBlock can figure this out afterwards and
ensure the popup is within the window bounds. Will convert some
other functions to use this too.
2009-01-30 12:18:08 +00:00
static uiBlock * view3d_edit_object_scriptsmenu ( bContext * C , ARegion * ar , void * arg_unused )
2008-12-20 12:36:14 +00:00
{
uiBlock * block ;
// short yco = 20, menuwidth = 120;
// XXX BPyMenu *pym;
// int i = 0;
2.5
More cleanup!
- removed old UI font completely, including from uiBeginBlock
- emboss hints for uiBlock only have three types now;
Regular, Pulldown, or "Nothing" (only icon/text)
- removed old font path from Userdef
- removed all old button theme hinting
- removed old "auto block" to merge buttons in groups
(was only in use for radiosity buttons)
And went over all warnings. One hooray for make giving clean output :)
Well, we need uniform definitions for warnings, so people at least fix
them... here's the real bad bugs I found:
- in mesh code, a call to editmesh mixed *em and *me
- in armature, ED_util.h was not included, so no warnings for wrong call
to ED_undo_push()
- The extern Py api .h was not included in the bpy_interface.c, showing
a several calls using different args.
Further just added the missing includes, and removed unused vars.
2009-04-14 15:59:52 +00:00
block = uiBeginBlock ( C , ar , " v3d_eobject_pymenu " , UI_EMBOSSP ) ;
2008-12-20 12:36:14 +00:00
uiBlockSetButmFunc ( block , do_view3d_edit_object_scriptsmenu , NULL ) ;
// for (pym = BPyMenuTable[PYMENU_OBJECT]; pym; pym = pym->next, i++) {
// uiDefIconTextBut(block, BUTM, 1, ICON_PYTHON, pym->name, 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, i, pym->tooltip?pym->tooltip:pym->filename);
// }
uiBlockSetDirection ( block , UI_RIGHT ) ;
uiTextBoundsBlock ( block , 60 ) ;
return block ;
}
# endif /* DISABLE_PYTHON */
2009-07-10 13:56:29 +00:00
# endif
2008-12-20 12:36:14 +00:00
2009-07-10 13:56:29 +00:00
#if 0
2008-12-20 12:36:14 +00:00
static void do_view3d_edit_objectmenu ( bContext * C , void * arg , int event )
{
Scene * scene = CTX_data_scene ( C ) ;
ScrArea * sa = CTX_wm_area ( C ) ;
View3D * v3d = sa - > spacedata . first ;
switch ( event ) {
case 0 : /* transform properties*/
// XXX mainqenter(NKEY, 1);
break ;
case 5 : /* make single user */
single_user ( ) ;
break ;
case 7 : /* boolean operation */
special_editmenu ( ) ;
break ;
case 8 : /* join objects */
join_menu ( ) ;
break ;
case 9 : /* convert object type */
convertmenu ( ) ;
break ;
case 10 : /* move to layer */
movetolayer ( ) ;
break ;
case 11 : /* insert keyframe */
common_insertkey ( ) ;
break ;
case 16 : /* make proxy object*/
make_proxy ( ) ;
break ;
case 18 : /* delete keyframe */
common_deletekey ( ) ;
break ;
}
}
2009-07-10 13:56:29 +00:00
# endif
2008-12-20 12:36:14 +00:00
2009-08-23 22:13:56 +00:00
/* texture paint menu (placeholder, no items yet??) */
static void do_view3d_tpaintmenu ( bContext * C , void * arg , int event )
{
2008-12-20 12:36:14 +00:00
#if 0
2009-08-23 22:13:56 +00:00
switch ( event ) {
case 0 : /* undo image painting */
undo_imagepaint_step ( 1 ) ;
break ;
}
2008-12-20 12:36:14 +00:00
2009-07-08 21:31:28 +00:00
# endif
2008-12-20 12:36:14 +00:00
}
2009-08-23 22:13:56 +00:00
static uiBlock * view3d_tpaintmenu ( bContext * C , ARegion * ar , void * arg_unused )
2008-12-20 12:36:14 +00:00
{
2009-08-23 22:13:56 +00:00
uiBlock * block ;
short yco = 0 , menuwidth = 120 ;
block = uiBeginBlock ( C , ar , " view3d_paintmenu " , UI_EMBOSSP ) ;
uiBlockSetButmFunc ( block , do_view3d_tpaintmenu , NULL ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Undo Texture Painting|U " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 0 , " " ) ;
uiDefBut ( block , SEPR , 0 , " " , 0 , yco - = 6 , menuwidth , 6 , NULL , 0.0 , 0.0 , 0 , 0 , " " ) ;
if ( ar - > alignment = = RGN_ALIGN_TOP ) {
uiBlockSetDirection ( block , UI_DOWN ) ;
}
else {
uiBlockSetDirection ( block , UI_TOP ) ;
uiBlockFlipOrder ( block ) ;
}
2008-12-20 12:36:14 +00:00
2009-08-23 22:13:56 +00:00
uiTextBoundsBlock ( block , 50 ) ;
return block ;
}
2008-12-20 12:36:14 +00:00
static void do_view3d_wpaintmenu ( bContext * C , void * arg , int event )
{
#if 0
Object * ob = OBACT ;
/* events >= 3 are registered bpython scripts */
# ifndef DISABLE_PYTHON
if ( event > = 4 ) BPY_menu_do_python ( PYMENU_WEIGHTPAINT , event - 4 ) ;
# endif
switch ( event ) {
case 0 : /* undo weight painting */
BIF_undo ( ) ;
break ;
case 1 : /* set vertex colors/weight */
clear_wpaint_selectedfaces ( ) ;
break ;
case 2 : /* vgroups from envelopes */
pose_adds_vgroups ( ob , 0 ) ;
break ;
case 3 : /* vgroups from bone heat */
pose_adds_vgroups ( ob , 1 ) ;
break ;
}
# endif
}
2.5: UI & Menus
* Cleaned up UI_interface.h a bit, and added some comments to
organize things a bit and indicate what should be used when.
* uiMenu* functions can now be used to create menus for headers
too, this is done with a uiDefMenuBut, which takes a pointer
to a uiMenuCreateFunc, that will then call uiMenu* functions.
* Renamed uiMenuBegin/End to uiPupMenuBegin/End, as these are
specific to making popup menus. Will convert the other
conformation popup menu functions to use this too so we can
remove some code.
* Extended uiMenu functions, now there is is also:
BooleanO, FloatO, BooleanR, EnumR, LevelEnumR, Separator.
* Converted image window headers to use uiMenu functions, simplifies
menu code further here. Did not remove the uiDefMenu functions as
they are used in sequencer/view3d in some places now (will fix).
* Also tried to simplify and fix bounds computation a bit better
for popup menus. It tried to find out in advance what the size
of the menu was but this is difficult with keymap strings in
there, now uiPopupBoundsBlock can figure this out afterwards and
ensure the popup is within the window bounds. Will convert some
other functions to use this too.
2009-01-30 12:18:08 +00:00
static uiBlock * view3d_wpaintmenu ( bContext * C , ARegion * ar , void * arg_unused )
2008-12-20 12:36:14 +00:00
{
uiBlock * block ;
short yco = 0 , menuwidth = 120 , menunr = 1 ;
# ifndef DISABLE_PYTHON
// XXX BPyMenu *pym;
// int i=0;
# endif
2.5
More cleanup!
- removed old UI font completely, including from uiBeginBlock
- emboss hints for uiBlock only have three types now;
Regular, Pulldown, or "Nothing" (only icon/text)
- removed old font path from Userdef
- removed all old button theme hinting
- removed old "auto block" to merge buttons in groups
(was only in use for radiosity buttons)
And went over all warnings. One hooray for make giving clean output :)
Well, we need uniform definitions for warnings, so people at least fix
them... here's the real bad bugs I found:
- in mesh code, a call to editmesh mixed *em and *me
- in armature, ED_util.h was not included, so no warnings for wrong call
to ED_undo_push()
- The extern Py api .h was not included in the bpy_interface.c, showing
a several calls using different args.
Further just added the missing includes, and removed unused vars.
2009-04-14 15:59:52 +00:00
block = uiBeginBlock ( C , ar , " view3d_paintmenu " , UI_EMBOSSP ) ;
2008-12-20 12:36:14 +00:00
uiBlockSetButmFunc ( block , do_view3d_wpaintmenu , NULL ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Undo Weight Painting|U " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 0 , " " ) ;
uiDefBut ( block , SEPR , 0 , " " , 0 , yco - = 6 , menuwidth , 6 , NULL , 0.0 , 0.0 , 0 , 0 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Apply Bone Heat Weights to Vertex Groups|W, 2 " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 3 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Apply Bone Envelopes to Vertex Groups|W, 1 " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 2 , " " ) ;
uiDefBut ( block , SEPR , 0 , " " , 0 , yco - = 6 , menuwidth , 6 , NULL , 0.0 , 0.0 , 0 , 0 , " " ) ;
2009-08-15 19:48:50 +00:00
if ( paint_facesel_test ( CTX_data_active_object ( C ) ) ) {
2008-12-20 12:36:14 +00:00
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Set Weight|Shift K " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 1 , " " ) ;
uiDefBut ( block , SEPR , 0 , " " , 0 , yco - = 6 , menuwidth , 6 , NULL , 0.0 , 0.0 , 0 , 0 , " " ) ;
menunr + + ;
}
# ifndef DISABLE_PYTHON
/* note that we account for the 4 previous entries with i+4:
even if the last item isnt displayed , it dosent matter */
// for (pym = BPyMenuTable[PYMENU_WEIGHTPAINT]; pym; pym = pym->next, i++) {
// uiDefIconTextBut(block, BUTM, 1, ICON_PYTHON, pym->name, 0, yco-=20,
// menuwidth, 19, NULL, 0.0, 0.0, 1, i+4,
// pym->tooltip?pym->tooltip:pym->filename);
// }
# endif
2.5: UI & Menus
* Cleaned up UI_interface.h a bit, and added some comments to
organize things a bit and indicate what should be used when.
* uiMenu* functions can now be used to create menus for headers
too, this is done with a uiDefMenuBut, which takes a pointer
to a uiMenuCreateFunc, that will then call uiMenu* functions.
* Renamed uiMenuBegin/End to uiPupMenuBegin/End, as these are
specific to making popup menus. Will convert the other
conformation popup menu functions to use this too so we can
remove some code.
* Extended uiMenu functions, now there is is also:
BooleanO, FloatO, BooleanR, EnumR, LevelEnumR, Separator.
* Converted image window headers to use uiMenu functions, simplifies
menu code further here. Did not remove the uiDefMenu functions as
they are used in sequencer/view3d in some places now (will fix).
* Also tried to simplify and fix bounds computation a bit better
for popup menus. It tried to find out in advance what the size
of the menu was but this is difficult with keymap strings in
there, now uiPopupBoundsBlock can figure this out afterwards and
ensure the popup is within the window bounds. Will convert some
other functions to use this too.
2009-01-30 12:18:08 +00:00
if ( ar - > alignment = = RGN_ALIGN_TOP ) {
2008-12-20 12:36:14 +00:00
uiBlockSetDirection ( block , UI_DOWN ) ;
}
else {
uiBlockSetDirection ( block , UI_TOP ) ;
uiBlockFlipOrder ( block ) ;
}
uiTextBoundsBlock ( block , 50 ) ;
return block ;
}
static void do_view3d_facesel_showhidemenu ( bContext * C , void * arg , int event )
{
#if 0
switch ( event ) {
case 4 : /* show hidden faces */
reveal_tface ( ) ;
break ;
case 5 : /* hide selected faces */
hide_tface ( ) ;
break ;
case 6 : /* XXX hide deselected faces */
// G.qual |= LR_SHIFTKEY;
hide_tface ( ) ;
// G.qual &= ~LR_SHIFTKEY;
break ;
}
# endif
}
2.5: UI & Menus
* Cleaned up UI_interface.h a bit, and added some comments to
organize things a bit and indicate what should be used when.
* uiMenu* functions can now be used to create menus for headers
too, this is done with a uiDefMenuBut, which takes a pointer
to a uiMenuCreateFunc, that will then call uiMenu* functions.
* Renamed uiMenuBegin/End to uiPupMenuBegin/End, as these are
specific to making popup menus. Will convert the other
conformation popup menu functions to use this too so we can
remove some code.
* Extended uiMenu functions, now there is is also:
BooleanO, FloatO, BooleanR, EnumR, LevelEnumR, Separator.
* Converted image window headers to use uiMenu functions, simplifies
menu code further here. Did not remove the uiDefMenu functions as
they are used in sequencer/view3d in some places now (will fix).
* Also tried to simplify and fix bounds computation a bit better
for popup menus. It tried to find out in advance what the size
of the menu was but this is difficult with keymap strings in
there, now uiPopupBoundsBlock can figure this out afterwards and
ensure the popup is within the window bounds. Will convert some
other functions to use this too.
2009-01-30 12:18:08 +00:00
static uiBlock * view3d_facesel_showhidemenu ( bContext * C , ARegion * ar , void * arg_unused )
2008-12-20 12:36:14 +00:00
{
uiBlock * block ;
short yco = 20 , menuwidth = 120 ;
2.5
More cleanup!
- removed old UI font completely, including from uiBeginBlock
- emboss hints for uiBlock only have three types now;
Regular, Pulldown, or "Nothing" (only icon/text)
- removed old font path from Userdef
- removed all old button theme hinting
- removed old "auto block" to merge buttons in groups
(was only in use for radiosity buttons)
And went over all warnings. One hooray for make giving clean output :)
Well, we need uniform definitions for warnings, so people at least fix
them... here's the real bad bugs I found:
- in mesh code, a call to editmesh mixed *em and *me
- in armature, ED_util.h was not included, so no warnings for wrong call
to ED_undo_push()
- The extern Py api .h was not included in the bpy_interface.c, showing
a several calls using different args.
Further just added the missing includes, and removed unused vars.
2009-04-14 15:59:52 +00:00
block = uiBeginBlock ( C , ar , " view3d_facesel_showhidemenu " , UI_EMBOSSP ) ;
2008-12-20 12:36:14 +00:00
uiBlockSetButmFunc ( block , do_view3d_facesel_showhidemenu , NULL ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Show Hidden Faces|Alt H " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 4 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Hide Selected Faces|H " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 5 , " " ) ;
2009-02-20 20:39:27 +00:00
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Hide Unselected Faces|Shift H " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 6 , " " ) ;
2008-12-20 12:36:14 +00:00
uiBlockSetDirection ( block , UI_RIGHT ) ;
uiTextBoundsBlock ( block , 60 ) ;
return block ;
}
static void do_view3d_faceselmenu ( bContext * C , void * arg , int event )
{
#if 0
switch ( event ) {
case 0 : /* set vertex colors */
clear_vpaint_selectedfaces ( ) ;
break ;
case 1 : /* mark border seam */
seam_mark_clear_tface ( 1 ) ;
break ;
case 2 : /* clear seam */
seam_mark_clear_tface ( 2 ) ;
break ;
}
# endif
}
2.5: UI & Menus
* Cleaned up UI_interface.h a bit, and added some comments to
organize things a bit and indicate what should be used when.
* uiMenu* functions can now be used to create menus for headers
too, this is done with a uiDefMenuBut, which takes a pointer
to a uiMenuCreateFunc, that will then call uiMenu* functions.
* Renamed uiMenuBegin/End to uiPupMenuBegin/End, as these are
specific to making popup menus. Will convert the other
conformation popup menu functions to use this too so we can
remove some code.
* Extended uiMenu functions, now there is is also:
BooleanO, FloatO, BooleanR, EnumR, LevelEnumR, Separator.
* Converted image window headers to use uiMenu functions, simplifies
menu code further here. Did not remove the uiDefMenu functions as
they are used in sequencer/view3d in some places now (will fix).
* Also tried to simplify and fix bounds computation a bit better
for popup menus. It tried to find out in advance what the size
of the menu was but this is difficult with keymap strings in
there, now uiPopupBoundsBlock can figure this out afterwards and
ensure the popup is within the window bounds. Will convert some
other functions to use this too.
2009-01-30 12:18:08 +00:00
static uiBlock * view3d_faceselmenu ( bContext * C , ARegion * ar , void * arg_unused )
2008-12-20 12:36:14 +00:00
{
uiBlock * block ;
short yco = 0 , menuwidth = 120 ;
2.5
More cleanup!
- removed old UI font completely, including from uiBeginBlock
- emboss hints for uiBlock only have three types now;
Regular, Pulldown, or "Nothing" (only icon/text)
- removed old font path from Userdef
- removed all old button theme hinting
- removed old "auto block" to merge buttons in groups
(was only in use for radiosity buttons)
And went over all warnings. One hooray for make giving clean output :)
Well, we need uniform definitions for warnings, so people at least fix
them... here's the real bad bugs I found:
- in mesh code, a call to editmesh mixed *em and *me
- in armature, ED_util.h was not included, so no warnings for wrong call
to ED_undo_push()
- The extern Py api .h was not included in the bpy_interface.c, showing
a several calls using different args.
Further just added the missing includes, and removed unused vars.
2009-04-14 15:59:52 +00:00
block = uiBeginBlock ( C , ar , " view3d_faceselmenu " , UI_EMBOSSP ) ;
2008-12-20 12:36:14 +00:00
uiBlockSetButmFunc ( block , do_view3d_faceselmenu , NULL ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Set Vertex Colors|Shift K " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 0 , " " ) ;
uiDefBut ( block , SEPR , 0 , " " , 0 , yco - = 6 , menuwidth , 6 , NULL , 0.0 , 0.0 , 0 , 0 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Clear Seam|Ctrl E " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 2 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 , " Mark Border Seam|Ctrl E " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 1 , " " ) ;
uiDefBut ( block , SEPR , 0 , " " , 0 , yco - = 6 , menuwidth , 6 , NULL , 0.0 , 0.0 , 0 , 0 , " " ) ;
uiDefIconTextBlockBut ( block , view3d_facesel_showhidemenu , NULL , ICON_RIGHTARROW_THIN , " Show/Hide Faces " , 0 , yco - = 20 , 120 , 19 , " " ) ;
2.5: UI & Menus
* Cleaned up UI_interface.h a bit, and added some comments to
organize things a bit and indicate what should be used when.
* uiMenu* functions can now be used to create menus for headers
too, this is done with a uiDefMenuBut, which takes a pointer
to a uiMenuCreateFunc, that will then call uiMenu* functions.
* Renamed uiMenuBegin/End to uiPupMenuBegin/End, as these are
specific to making popup menus. Will convert the other
conformation popup menu functions to use this too so we can
remove some code.
* Extended uiMenu functions, now there is is also:
BooleanO, FloatO, BooleanR, EnumR, LevelEnumR, Separator.
* Converted image window headers to use uiMenu functions, simplifies
menu code further here. Did not remove the uiDefMenu functions as
they are used in sequencer/view3d in some places now (will fix).
* Also tried to simplify and fix bounds computation a bit better
for popup menus. It tried to find out in advance what the size
of the menu was but this is difficult with keymap strings in
there, now uiPopupBoundsBlock can figure this out afterwards and
ensure the popup is within the window bounds. Will convert some
other functions to use this too.
2009-01-30 12:18:08 +00:00
if ( ar - > alignment = = RGN_ALIGN_TOP ) {
2008-12-20 12:36:14 +00:00
uiBlockSetDirection ( block , UI_DOWN ) ;
}
else {
uiBlockSetDirection ( block , UI_TOP ) ;
uiBlockFlipOrder ( block ) ;
}
uiTextBoundsBlock ( block , 50 ) ;
return block ;
}
static char * view3d_modeselect_pup ( Scene * scene )
{
Object * ob = OBACT ;
static char string [ 1024 ] ;
static char formatstr [ ] = " |%s %%x%d %%i%d " ;
char * str = string ;
str + = sprintf ( str , " Mode: %%t " ) ;
2009-08-16 16:38:32 +00:00
str + = sprintf ( str , formatstr , " Object Mode " , OB_MODE_OBJECT , ICON_OBJECT_DATA ) ;
2008-12-20 12:36:14 +00:00
if ( ob = = NULL ) return string ;
/* if active object is editable */
2009-09-08 02:09:14 +00:00
if ( ( ( ob - > type = = OB_MESH )
2008-12-20 12:36:14 +00:00
| | ( ob - > type = = OB_CURVE ) | | ( ob - > type = = OB_SURF ) | | ( ob - > type = = OB_FONT )
| | ( ob - > type = = OB_MBALL ) | | ( ob - > type = = OB_LATTICE ) ) ) {
2009-08-16 16:38:32 +00:00
str + = sprintf ( str , formatstr , " Edit Mode " , OB_MODE_EDIT , ICON_EDITMODE_HLT ) ;
2008-12-20 12:36:14 +00:00
}
2009-09-08 02:09:14 +00:00
else if ( ob - > type = = OB_ARMATURE ) {
if ( ob - > mode & OB_MODE_POSE )
str + = sprintf ( str , formatstr , " Edit Mode " , OB_MODE_EDIT | OB_MODE_POSE , ICON_EDITMODE_HLT ) ;
else
str + = sprintf ( str , formatstr , " Edit Mode " , OB_MODE_EDIT , ICON_EDITMODE_HLT ) ;
}
2008-12-20 12:36:14 +00:00
if ( ob - > type = = OB_MESH ) {
2009-08-16 16:38:32 +00:00
str + = sprintf ( str , formatstr , " Sculpt Mode " , OB_MODE_SCULPT , ICON_SCULPTMODE_HLT ) ;
str + = sprintf ( str , formatstr , " Vertex Paint " , OB_MODE_VERTEX_PAINT , ICON_VPAINT_HLT ) ;
str + = sprintf ( str , formatstr , " Texture Paint " , OB_MODE_TEXTURE_PAINT , ICON_TPAINT_HLT ) ;
str + = sprintf ( str , formatstr , " Weight Paint " , OB_MODE_WEIGHT_PAINT , ICON_WPAINT_HLT ) ;
2008-12-20 12:36:14 +00:00
}
/* if active object is an armature */
if ( ob - > type = = OB_ARMATURE ) {
2009-08-16 16:38:32 +00:00
str + = sprintf ( str , formatstr , " Pose Mode " , OB_MODE_POSE , ICON_POSE_HLT ) ;
2008-12-20 12:36:14 +00:00
}
2009-08-29 15:20:36 +00:00
if ( ob - > particlesystem . first | | modifiers_findByType ( ob , eModifierType_Cloth ) | | modifiers_findByType ( ob , eModifierType_Softbody ) ) {
2009-08-16 16:38:32 +00:00
str + = sprintf ( str , formatstr , " Particle Mode " , OB_MODE_PARTICLE_EDIT , ICON_PARTICLEMODE ) ;
2008-12-20 12:36:14 +00:00
}
return ( string ) ;
}
static char * drawtype_pup ( void )
{
static char string [ 512 ] ;
char * str = string ;
str + = sprintf ( str , " %s " , " Draw type: %t " ) ;
str + = sprintf ( str , " %s " , " |Bounding Box %x1 " ) ;
str + = sprintf ( str , " %s " , " |Wireframe %x2 " ) ;
str + = sprintf ( str , " %s " , " |Solid %x3 " ) ;
str + = sprintf ( str , " %s " , " |Shaded %x4 " ) ;
str + = sprintf ( str , " %s " , " |Textured %x5 " ) ;
return string ;
}
2008-12-31 22:43:29 +00:00
static char * around_pup ( const bContext * C )
2008-12-20 12:36:14 +00:00
{
2008-12-31 22:43:29 +00:00
Object * obedit = CTX_data_edit_object ( C ) ;
2008-12-20 12:36:14 +00:00
static char string [ 512 ] ;
char * str = string ;
str + = sprintf ( str , " %s " , " Pivot: %t " ) ;
str + = sprintf ( str , " %s " , " |Bounding Box Center %x0 " ) ;
str + = sprintf ( str , " %s " , " |Median Point %x3 " ) ;
str + = sprintf ( str , " %s " , " |3D Cursor %x1 " ) ;
str + = sprintf ( str , " %s " , " |Individual Centers %x2 " ) ;
2008-12-31 22:43:29 +00:00
if ( ( obedit ) & & ( obedit - > type = = OB_MESH ) )
2008-12-20 12:36:14 +00:00
str + = sprintf ( str , " %s " , " |Active Vert/Edge/Face %x4 " ) ;
else
str + = sprintf ( str , " %s " , " |Active Object %x4 " ) ;
return string ;
}
static char * ndof_pup ( void )
{
static char string [ 512 ] ;
char * str = string ;
str + = sprintf ( str , " %s " , " ndof mode: %t " ) ;
str + = sprintf ( str , " %s " , " |turntable %x0 " ) ;
str + = sprintf ( str , " %s " , " |fly %x1 " ) ;
str + = sprintf ( str , " %s " , " |transform %x2 " ) ;
return string ;
}
static char * snapmode_pup ( void )
{
static char string [ 512 ] ;
char * str = string ;
str + = sprintf ( str , " %s " , " Snap Element: %t " ) ;
str + = sprintf ( str , " %s " , " |Vertex%x0 " ) ;
str + = sprintf ( str , " %s " , " |Edge%x1 " ) ;
str + = sprintf ( str , " %s " , " |Face%x2 " ) ;
2009-02-24 00:45:40 +00:00
str + = sprintf ( str , " %s " , " |Volume%x3 " ) ;
2008-12-20 12:36:14 +00:00
return string ;
}
static char * propfalloff_pup ( void )
{
static char string [ 512 ] ;
char * str = string ;
str + = sprintf ( str , " %s " , " Falloff: %t " ) ;
str + = sprintf ( str , " %s " , " |Smooth Falloff%x0 " ) ;
str + = sprintf ( str , " %s " , " |Sphere Falloff%x1 " ) ;
str + = sprintf ( str , " %s " , " |Root Falloff%x2 " ) ;
str + = sprintf ( str , " %s " , " |Sharp Falloff%x3 " ) ;
str + = sprintf ( str , " %s " , " |Linear Falloff%x4 " ) ;
str + = sprintf ( str , " %s " , " |Random Falloff%x6 " ) ;
str + = sprintf ( str , " %s " , " |Constant, No Falloff%x5 " ) ;
return string ;
}
2009-02-10 15:38:00 +00:00
static void do_view3d_header_buttons ( bContext * C , void * arg , int event )
2008-12-20 12:36:14 +00:00
{
2009-02-20 18:01:33 +00:00
wmWindow * win = CTX_wm_window ( C ) ;
2008-12-20 12:36:14 +00:00
Scene * scene = CTX_data_scene ( C ) ;
2009-06-23 00:41:55 +00:00
ToolSettings * ts = CTX_data_tool_settings ( C ) ;
2008-12-20 12:36:14 +00:00
ScrArea * sa = CTX_wm_area ( C ) ;
View3D * v3d = sa - > spacedata . first ;
2008-12-31 22:43:29 +00:00
Object * obedit = CTX_data_edit_object ( C ) ;
2009-08-29 15:20:36 +00:00
Object * ob = CTX_data_active_object ( C ) ;
2009-01-01 18:05:12 +00:00
EditMesh * em = NULL ;
2009-02-20 18:01:33 +00:00
int bit , ctrl = win - > eventstate - > ctrl , shift = win - > eventstate - > shift ;
2009-08-16 16:38:32 +00:00
PointerRNA props_ptr ;
2009-01-01 18:05:12 +00:00
if ( obedit & & obedit - > type = = OB_MESH ) {
2009-04-11 08:26:51 +00:00
em = BKE_mesh_get_editmesh ( ( Mesh * ) obedit - > data ) ;
2009-01-01 18:05:12 +00:00
}
2008-12-20 12:36:14 +00:00
/* watch it: if sa->win does not exist, check that when calling direct drawing routines */
switch ( event ) {
case B_HOME :
2009-07-09 08:39:58 +00:00
WM_operator_name_call ( C , " VIEW3D_OT_view_all " , WM_OP_EXEC_REGION_WIN , NULL ) ;
2008-12-20 12:36:14 +00:00
break ;
2009-01-12 09:04:53 +00:00
case B_REDR :
ED_area_tag_redraw ( sa ) ;
break ;
2008-12-20 12:36:14 +00:00
case B_SCENELOCK :
if ( v3d - > scenelock ) {
v3d - > lay = scene - > lay ;
/* seek for layact */
bit = 0 ;
while ( bit < 32 ) {
if ( v3d - > lay & ( 1 < < bit ) ) {
v3d - > layact = 1 < < bit ;
break ;
}
bit + + ;
}
v3d - > camera = scene - > camera ;
ED_area_tag_redraw ( sa ) ;
}
break ;
case B_VIEWBUT :
case B_PERSP :
break ;
case B_VIEWRENDER :
if ( sa - > spacetype = = SPACE_VIEW3D ) {
// XXX BIF_do_ogl_render(v3d, shift);
}
break ;
case B_STARTGAME :
// XXX start_game();
break ;
case B_MODESELECT :
2009-08-16 16:38:32 +00:00
WM_operator_properties_create ( & props_ptr , " OBJECT_OT_mode_set " ) ;
RNA_enum_set ( & props_ptr , " mode " , v3d - > modeselect ) ;
WM_operator_name_call ( C , " OBJECT_OT_mode_set " , WM_OP_EXEC_REGION_WIN , & props_ptr ) ;
2009-09-08 02:09:14 +00:00
WM_operator_properties_free ( & props_ptr ) ;
2009-08-16 16:38:32 +00:00
break ;
2008-12-20 12:36:14 +00:00
case B_AROUND :
// XXX handle_view3d_around(); /* copies to other 3d windows */
break ;
case B_SEL_VERT :
2009-01-01 18:05:12 +00:00
if ( em ) {
if ( shift = = 0 | | em - > selectmode = = 0 )
em - > selectmode = SCE_SELECT_VERTEX ;
2009-06-23 00:41:55 +00:00
ts - > selectmode = em - > selectmode ;
2009-01-01 18:05:12 +00:00
EM_selectmode_set ( em ) ;
2.5
Notifiers
---------
Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:
* Geometry changes are now done with NC_GEOM, rather than
NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
should only be used for notifying about changes in space data,
we don't want to go back to allqueue(REDRAW..).
Depsgraph
---------
The dependency graph now has a different flush call:
DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)
It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.
Docs
----
I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
2009-09-04 20:51:09 +00:00
WM_event_add_notifier ( C , NC_GEOM | ND_SELECT , obedit - > data ) ;
2009-01-01 18:05:12 +00:00
ED_undo_push ( C , " Selectmode Set: Vertex " ) ;
}
2008-12-20 12:36:14 +00:00
break ;
case B_SEL_EDGE :
2009-01-01 18:05:12 +00:00
if ( em ) {
if ( shift = = 0 | | em - > selectmode = = 0 ) {
if ( ( em - > selectmode ^ SCE_SELECT_EDGE ) = = SCE_SELECT_VERTEX ) {
if ( ctrl ) EM_convertsel ( em , SCE_SELECT_VERTEX , SCE_SELECT_EDGE ) ;
}
em - > selectmode = SCE_SELECT_EDGE ;
2008-12-20 12:36:14 +00:00
}
2009-06-23 00:41:55 +00:00
ts - > selectmode = em - > selectmode ;
2009-01-01 18:05:12 +00:00
EM_selectmode_set ( em ) ;
2.5
Notifiers
---------
Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:
* Geometry changes are now done with NC_GEOM, rather than
NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
should only be used for notifying about changes in space data,
we don't want to go back to allqueue(REDRAW..).
Depsgraph
---------
The dependency graph now has a different flush call:
DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)
It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.
Docs
----
I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
2009-09-04 20:51:09 +00:00
WM_event_add_notifier ( C , NC_GEOM | ND_SELECT , obedit - > data ) ;
2009-01-01 18:05:12 +00:00
ED_undo_push ( C , " Selectmode Set: Edge " ) ;
2008-12-20 12:36:14 +00:00
}
break ;
case B_SEL_FACE :
2009-01-01 18:05:12 +00:00
if ( em ) {
if ( shift = = 0 | | em - > selectmode = = 0 ) {
2009-06-23 00:41:55 +00:00
if ( ( ( ts - > selectmode ^ SCE_SELECT_FACE ) = = SCE_SELECT_VERTEX ) | | ( ( ts - > selectmode ^ SCE_SELECT_FACE ) = = SCE_SELECT_EDGE ) ) {
if ( ctrl ) EM_convertsel ( em , ( ts - > selectmode ^ SCE_SELECT_FACE ) , SCE_SELECT_FACE ) ;
2009-01-01 18:05:12 +00:00
}
em - > selectmode = SCE_SELECT_FACE ;
2008-12-20 12:36:14 +00:00
}
2009-06-23 00:41:55 +00:00
ts - > selectmode = em - > selectmode ;
2009-01-01 18:05:12 +00:00
EM_selectmode_set ( em ) ;
2.5
Notifiers
---------
Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:
* Geometry changes are now done with NC_GEOM, rather than
NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
should only be used for notifying about changes in space data,
we don't want to go back to allqueue(REDRAW..).
Depsgraph
---------
The dependency graph now has a different flush call:
DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)
It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.
Docs
----
I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
2009-09-04 20:51:09 +00:00
WM_event_add_notifier ( C , NC_GEOM | ND_SELECT , obedit - > data ) ;
2009-01-01 18:05:12 +00:00
ED_undo_push ( C , " Selectmode Set: Face " ) ;
2008-12-20 12:36:14 +00:00
}
break ;
case B_SEL_PATH :
2009-06-23 00:41:55 +00:00
ts - > particle . selectmode = SCE_SELECT_PATH ;
2009-09-05 20:12:08 +00:00
WM_event_add_notifier ( C , NC_OBJECT | ND_DRAW , ob ) ;
2008-12-30 19:01:12 +00:00
ED_undo_push ( C , " Selectmode Set: Path " ) ;
2008-12-20 12:36:14 +00:00
break ;
case B_SEL_POINT :
2009-06-23 00:41:55 +00:00
ts - > particle . selectmode = SCE_SELECT_POINT ;
2009-09-05 20:12:08 +00:00
WM_event_add_notifier ( C , NC_OBJECT | ND_DRAW , ob ) ;
2008-12-30 19:01:12 +00:00
ED_undo_push ( C , " Selectmode Set: Point " ) ;
2008-12-20 12:36:14 +00:00
break ;
case B_SEL_END :
2009-06-23 00:41:55 +00:00
ts - > particle . selectmode = SCE_SELECT_END ;
2009-09-05 20:12:08 +00:00
WM_event_add_notifier ( C , NC_OBJECT | ND_DRAW , ob ) ;
2008-12-30 19:01:12 +00:00
ED_undo_push ( C , " Selectmode Set: End point " ) ;
2008-12-20 12:36:14 +00:00
break ;
case B_MAN_TRANS :
2009-07-08 15:01:28 +00:00
if ( shift = = 0 | | v3d - > twtype = = 0 ) {
2008-12-20 12:36:14 +00:00
v3d - > twtype = V3D_MANIP_TRANSLATE ;
2009-07-08 15:01:28 +00:00
}
2009-08-15 12:47:59 +00:00
ED_area_tag_redraw ( sa ) ;
break ;
2008-12-20 12:36:14 +00:00
case B_MAN_ROT :
2009-07-08 15:01:28 +00:00
if ( shift = = 0 | | v3d - > twtype = = 0 ) {
2009-08-15 12:47:59 +00:00
v3d - > twtype = V3D_MANIP_ROTATE ;
2009-07-08 15:01:28 +00:00
}
2009-08-15 12:47:59 +00:00
ED_area_tag_redraw ( sa ) ;
2008-12-20 12:36:14 +00:00
break ;
case B_MAN_SCALE :
2009-07-08 15:01:28 +00:00
if ( shift = = 0 | | v3d - > twtype = = 0 ) {
2009-08-15 12:47:59 +00:00
v3d - > twtype = V3D_MANIP_SCALE ;
2009-07-08 15:01:28 +00:00
}
2009-08-15 12:47:59 +00:00
ED_area_tag_redraw ( sa ) ;
2008-12-20 12:36:14 +00:00
break ;
case B_NDOF :
2009-09-21 17:00:22 +00:00
ED_area_tag_redraw ( sa ) ;
2008-12-20 12:36:14 +00:00
break ;
case B_MAN_MODE :
2009-09-21 17:00:22 +00:00
ED_area_tag_redraw ( sa ) ;
2008-12-20 12:36:14 +00:00
break ;
case B_VIEW_BUTSEDIT :
break ;
default :
if ( event > = B_LAY & & event < B_LAY + 31 ) {
if ( v3d - > lay ! = 0 & & shift ) {
/* but do find active layer */
bit = event - B_LAY ;
if ( v3d - > lay & ( 1 < < bit ) ) v3d - > layact = 1 < < bit ;
else {
if ( ( v3d - > lay & v3d - > layact ) = = 0 ) {
bit = 0 ;
while ( bit < 32 ) {
if ( v3d - > lay & ( 1 < < bit ) ) {
v3d - > layact = 1 < < bit ;
break ;
}
bit + + ;
}
}
}
}
else {
bit = event - B_LAY ;
v3d - > lay = 1 < < bit ;
v3d - > layact = v3d - > lay ;
}
2009-07-03 04:24:19 +00:00
if ( v3d - > scenelock ) handle_view3d_lock ( C ) ;
2008-12-20 12:36:14 +00:00
ED_area_tag_redraw ( sa ) ;
countall ( ) ;
/* new layers might need unflushed events events */
DAG_scene_update_flags ( scene , v3d - > lay ) ; /* tags all that moves and flushes */
}
break ;
}
2009-03-30 07:28:37 +00:00
2009-03-30 13:53:48 +00:00
if ( obedit & & obedit - > type = = OB_MESH )
2009-04-11 08:26:51 +00:00
BKE_mesh_end_editmesh ( obedit - > data , em ) ;
2008-12-20 12:36:14 +00:00
}
2.5
View3D has been split now in a local part (RegionView3D) and a
per-area part (old View3D). Currently local is:
- view transform
- camera zoom/offset
- gpencil (todo)
- custom clipping planes
Rest is in Area still, like active camera, draw type, layers,
localview, custom centers, around-settings, transform widget,
gridlines, and so on (mostly stuff as available in header).
To see it work; also added new feature for region split,
press SHIFT+ALT+CTRL+S for four-split.
The idea is to make a preset 4-split, configured to stick
to top/right/front views for three views.
Another cool idea to explore is to then box-clip all drawing
based on these 3 views.
Note about the code:
- currently view3d still stores some depricated settings, to
convert from older files. Not all settings are copied over
though, like custom clip planes or the 'lock view to object'.
- since some view3d ops are now on area level, the operators
for it should keep track of that.
Bugfix in transform: quat initialize in operator-invoke missed
one zero.
Als brought back GE to compile for missing Ipos and channels.
2009-01-19 16:54:41 +00:00
static void view3d_header_pulldowns ( const bContext * C , uiBlock * block , Object * ob , int * xcoord , int yco )
2008-12-20 12:36:14 +00:00
{
2008-12-31 22:43:29 +00:00
Object * obedit = CTX_data_edit_object ( C ) ;
2.5
View3D has been split now in a local part (RegionView3D) and a
per-area part (old View3D). Currently local is:
- view transform
- camera zoom/offset
- gpencil (todo)
- custom clipping planes
Rest is in Area still, like active camera, draw type, layers,
localview, custom centers, around-settings, transform widget,
gridlines, and so on (mostly stuff as available in header).
To see it work; also added new feature for region split,
press SHIFT+ALT+CTRL+S for four-split.
The idea is to make a preset 4-split, configured to stick
to top/right/front views for three views.
Another cool idea to explore is to then box-clip all drawing
based on these 3 views.
Note about the code:
- currently view3d still stores some depricated settings, to
convert from older files. Not all settings are copied over
though, like custom clip planes or the 'lock view to object'.
- since some view3d ops are now on area level, the operators
for it should keep track of that.
Bugfix in transform: quat initialize in operator-invoke missed
one zero.
Als brought back GE to compile for missing Ipos and channels.
2009-01-19 16:54:41 +00:00
RegionView3D * rv3d = wm_region_view3d ( C ) ;
2008-12-20 12:36:14 +00:00
short xmax , xco = * xcoord ;
/* compensate for local mode when setting up the viewing menu/iconrow values */
2.5
View3D has been split now in a local part (RegionView3D) and a
per-area part (old View3D). Currently local is:
- view transform
- camera zoom/offset
- gpencil (todo)
- custom clipping planes
Rest is in Area still, like active camera, draw type, layers,
localview, custom centers, around-settings, transform widget,
gridlines, and so on (mostly stuff as available in header).
To see it work; also added new feature for region split,
press SHIFT+ALT+CTRL+S for four-split.
The idea is to make a preset 4-split, configured to stick
to top/right/front views for three views.
Another cool idea to explore is to then box-clip all drawing
based on these 3 views.
Note about the code:
- currently view3d still stores some depricated settings, to
convert from older files. Not all settings are copied over
though, like custom clip planes or the 'lock view to object'.
- since some view3d ops are now on area level, the operators
for it should keep track of that.
Bugfix in transform: quat initialize in operator-invoke missed
one zero.
Als brought back GE to compile for missing Ipos and channels.
2009-01-19 16:54:41 +00:00
if ( rv3d - > view = = 7 ) rv3d - > viewbut = 1 ;
else if ( rv3d - > view = = 1 ) rv3d - > viewbut = 2 ;
else if ( rv3d - > view = = 3 ) rv3d - > viewbut = 3 ;
else rv3d - > viewbut = 0 ;
2008-12-20 12:36:14 +00:00
/* the 'xmax - 3' rather than xmax is to prevent some weird flickering where the highlighted
* menu is drawn wider than it should be . The ypos of - 2 is to make it properly fill the
* height of the header */
xmax = GetButStringLength ( " Select " ) ;
2009-08-15 19:40:09 +00:00
2008-12-20 12:36:14 +00:00
xco + = xmax ;
2008-12-31 22:43:29 +00:00
if ( obedit ) {
2008-12-20 12:36:14 +00:00
}
2009-08-15 21:46:25 +00:00
else if ( ob & & ob - > mode & OB_MODE_WEIGHT_PAINT ) {
2008-12-20 12:36:14 +00:00
xmax = GetButStringLength ( " Paint " ) ;
2009-04-12 13:40:29 +00:00
uiDefPulldownBut ( block , view3d_wpaintmenu , NULL , " Paint " , xco , yco , xmax - 3 , 20 , " " ) ;
2008-12-20 12:36:14 +00:00
xco + = xmax ;
}
2009-08-16 01:25:53 +00:00
else if ( ob & & ob - > mode & OB_MODE_TEXTURE_PAINT ) {
2008-12-20 12:36:14 +00:00
xmax = GetButStringLength ( " Paint " ) ;
2009-04-12 13:40:29 +00:00
uiDefPulldownBut ( block , view3d_tpaintmenu , NULL , " Paint " , xco , yco , xmax - 3 , 20 , " " ) ;
2008-12-20 12:36:14 +00:00
xco + = xmax ;
}
2009-08-15 19:48:50 +00:00
else if ( paint_facesel_test ( ob ) ) {
2008-12-20 12:36:14 +00:00
if ( ob & & ob - > type = = OB_MESH ) {
xmax = GetButStringLength ( " Face " ) ;
2009-04-12 13:40:29 +00:00
uiDefPulldownBut ( block , view3d_faceselmenu , NULL , " Face " , xco , yco , xmax - 3 , 20 , " " ) ;
2008-12-20 12:36:14 +00:00
xco + = xmax ;
}
}
2009-08-16 02:35:44 +00:00
else if ( ob & & ob - > mode & OB_MODE_PARTICLE_EDIT ) {
2009-08-23 22:13:56 +00:00
/* ported to python */
2008-12-20 12:36:14 +00:00
}
else {
2009-08-16 03:24:23 +00:00
if ( ob & & ( ob - > mode & OB_MODE_POSE ) ) {
2009-08-23 22:13:56 +00:00
/* ported to python */
2008-12-20 12:36:14 +00:00
}
}
* xcoord = xco ;
}
static int view3d_layer_icon ( int but_lay , int ob_lay , int used_lay )
{
if ( but_lay & ob_lay )
return ICON_LAYER_ACTIVE ;
else if ( but_lay & used_lay )
return ICON_LAYER_USED ;
else
return ICON_BLANK1 ;
}
2.5
First version of region-scaling. WIP commit, so bear with me a while!
- All fixed sized regions have a small 'drag' widget, on the left or top.
(not yet for free-sized regions, like 4-split).
- Mouse-over on widget changes cursor and allows drag.
- Click on widget hides/reveals.
- Fun for test; 3d view header, if high enough, draws more rows of
buttons when width is too small.
The WIP stuff;
- It doesn't save yet in files, using the "minsize" variable of region
definitions, also means other similar areas show same sizes now.
- Definitions for pref size, min/max will be added.
- Properties panel in Fcurve window draws widget on wrong place when
hidden (subdiv system needs tweak)
- Widgets don't draw perfect yet, also needs further tweaks.
But, in general it's quite fun and usable. :) Many variatians are possible,
like for real tabs, or little icons, or just click-drag on edge.
The reason to first try the widget/tab variation:
- it re-uses the "Area Action Zone" code, widgets for layouting Screens
- it's visible, hotkey-only options for screen layouts are not preferred.
- distinguish clearly area-edges from region-edges this way. Having the
cursor change shape on every edge (and block input) is probably annoying
too... but that can be tested.
Later more!
2009-05-24 13:29:29 +00:00
static void header_xco_step ( ARegion * ar , int * xco , int * yco , int * maxco , int step )
{
* xco + = step ;
if ( * maxco < * xco ) * maxco = * xco ;
if ( ar - > winy > * yco + 44 ) {
if ( * xco > ar - > winrct . xmax ) {
* xco = 8 ;
* yco + = 22 ;
}
}
}
2009-08-16 16:38:32 +00:00
/* Returns the icon associated with an object mode */
static int object_mode_icon ( int mode )
{
EnumPropertyItem * item = object_mode_items ;
while ( item - > name ! = NULL ) {
if ( item - > value = = mode )
return item - > icon ;
+ + item ;
}
return ICON_OBJECT_DATAMODE ;
}
2009-07-11 13:32:20 +00:00
void uiTemplateHeader3D ( uiLayout * layout , struct bContext * C )
2008-12-20 12:36:14 +00:00
{
2009-07-11 13:32:20 +00:00
ARegion * ar = CTX_wm_region ( C ) ;
2008-12-20 12:36:14 +00:00
ScrArea * sa = CTX_wm_area ( C ) ;
View3D * v3d = sa - > spacedata . first ;
Scene * scene = CTX_data_scene ( C ) ;
2009-06-23 00:41:55 +00:00
ToolSettings * ts = CTX_data_tool_settings ( C ) ;
2008-12-20 12:36:14 +00:00
Object * ob = OBACT ;
2008-12-31 22:43:29 +00:00
Object * obedit = CTX_data_edit_object ( C ) ;
2008-12-20 12:36:14 +00:00
uiBlock * block ;
2009-07-15 23:24:51 +00:00
int a , xco = 0 , maxco = 0 , yco = 0 ;
2008-12-20 12:36:14 +00:00
2009-07-11 13:32:20 +00:00
block = uiLayoutFreeBlock ( layout ) ;
2009-02-10 15:38:00 +00:00
uiBlockSetHandleFunc ( block , do_view3d_header_buttons , NULL ) ;
2008-12-20 12:36:14 +00:00
if ( ( sa - > flag & HEADER_NO_PULLDOWN ) = = 0 )
2.5
View3D has been split now in a local part (RegionView3D) and a
per-area part (old View3D). Currently local is:
- view transform
- camera zoom/offset
- gpencil (todo)
- custom clipping planes
Rest is in Area still, like active camera, draw type, layers,
localview, custom centers, around-settings, transform widget,
gridlines, and so on (mostly stuff as available in header).
To see it work; also added new feature for region split,
press SHIFT+ALT+CTRL+S for four-split.
The idea is to make a preset 4-split, configured to stick
to top/right/front views for three views.
Another cool idea to explore is to then box-clip all drawing
based on these 3 views.
Note about the code:
- currently view3d still stores some depricated settings, to
convert from older files. Not all settings are copied over
though, like custom clip planes or the 'lock view to object'.
- since some view3d ops are now on area level, the operators
for it should keep track of that.
Bugfix in transform: quat initialize in operator-invoke missed
one zero.
Als brought back GE to compile for missing Ipos and channels.
2009-01-19 16:54:41 +00:00
view3d_header_pulldowns ( C , block , ob , & xco , yco ) ;
2008-12-20 12:36:14 +00:00
/* other buttons: */
uiBlockSetEmboss ( block , UI_EMBOSS ) ;
/* mode */
2009-08-16 16:38:32 +00:00
if ( ob )
v3d - > modeselect = ob - > mode ;
else
v3d - > modeselect = OB_MODE_OBJECT ;
2008-12-20 12:36:14 +00:00
v3d - > flag & = ~ V3D_MODE ;
/* not sure what the v3d->flag is useful for now... modeselect is confusing */
2008-12-31 22:43:29 +00:00
if ( obedit ) v3d - > flag | = V3D_EDITMODE ;
2009-08-16 03:24:23 +00:00
if ( ob & & ( ob - > mode & OB_MODE_POSE ) ) v3d - > flag | = V3D_POSEMODE ;
2009-08-15 20:36:15 +00:00
if ( ob & & ( ob - > mode & OB_MODE_VERTEX_PAINT ) ) v3d - > flag | = V3D_VERTEXPAINT ;
2009-08-15 21:46:25 +00:00
if ( ob & & ( ob - > mode & OB_MODE_WEIGHT_PAINT ) ) v3d - > flag | = V3D_WEIGHTPAINT ;
2009-08-16 01:25:53 +00:00
if ( ob & & ( ob - > mode & OB_MODE_TEXTURE_PAINT ) ) v3d - > flag | = V3D_TEXTUREPAINT ;
2009-08-15 19:48:50 +00:00
if ( paint_facesel_test ( ob ) ) v3d - > flag | = V3D_FACESELECT ;
2009-08-16 16:38:32 +00:00
uiDefIconTextButS ( block , MENU , B_MODESELECT , object_mode_icon ( v3d - > modeselect ) , view3d_modeselect_pup ( scene ) ,
xco , yco , 126 , 20 , & ( v3d - > modeselect ) , 0 , 0 , 0 , 0 , " Mode (Hotkeys: Tab, V, Ctrl Tab) " ) ;
2.5
First version of region-scaling. WIP commit, so bear with me a while!
- All fixed sized regions have a small 'drag' widget, on the left or top.
(not yet for free-sized regions, like 4-split).
- Mouse-over on widget changes cursor and allows drag.
- Click on widget hides/reveals.
- Fun for test; 3d view header, if high enough, draws more rows of
buttons when width is too small.
The WIP stuff;
- It doesn't save yet in files, using the "minsize" variable of region
definitions, also means other similar areas show same sizes now.
- Definitions for pref size, min/max will be added.
- Properties panel in Fcurve window draws widget on wrong place when
hidden (subdiv system needs tweak)
- Widgets don't draw perfect yet, also needs further tweaks.
But, in general it's quite fun and usable. :) Many variatians are possible,
like for real tabs, or little icons, or just click-drag on edge.
The reason to first try the widget/tab variation:
- it re-uses the "Area Action Zone" code, widgets for layouting Screens
- it's visible, hotkey-only options for screen layouts are not preferred.
- distinguish clearly area-edges from region-edges this way. Having the
cursor change shape on every edge (and block input) is probably annoying
too... but that can be tested.
Later more!
2009-05-24 13:29:29 +00:00
header_xco_step ( ar , & xco , & yco , & maxco , 126 + 8 ) ;
2008-12-20 12:36:14 +00:00
/* DRAWTYPE */
uiDefIconTextButS ( block , ICONTEXTROW , B_REDR , ICON_BBOX , drawtype_pup ( ) , xco , yco , XIC + 10 , YIC , & ( v3d - > drawtype ) , 1.0 , 5.0 , 0 , 0 , " Viewport Shading (Hotkeys: Z, Shift Z, Alt Z) " ) ;
2.5
First version of region-scaling. WIP commit, so bear with me a while!
- All fixed sized regions have a small 'drag' widget, on the left or top.
(not yet for free-sized regions, like 4-split).
- Mouse-over on widget changes cursor and allows drag.
- Click on widget hides/reveals.
- Fun for test; 3d view header, if high enough, draws more rows of
buttons when width is too small.
The WIP stuff;
- It doesn't save yet in files, using the "minsize" variable of region
definitions, also means other similar areas show same sizes now.
- Definitions for pref size, min/max will be added.
- Properties panel in Fcurve window draws widget on wrong place when
hidden (subdiv system needs tweak)
- Widgets don't draw perfect yet, also needs further tweaks.
But, in general it's quite fun and usable. :) Many variatians are possible,
like for real tabs, or little icons, or just click-drag on edge.
The reason to first try the widget/tab variation:
- it re-uses the "Area Action Zone" code, widgets for layouting Screens
- it's visible, hotkey-only options for screen layouts are not preferred.
- distinguish clearly area-edges from region-edges this way. Having the
cursor change shape on every edge (and block input) is probably annoying
too... but that can be tested.
Later more!
2009-05-24 13:29:29 +00:00
header_xco_step ( ar , & xco , & yco , & maxco , XIC + 18 ) ;
2008-12-20 12:36:14 +00:00
uiBlockBeginAlign ( block ) ;
if ( retopo_mesh_paint_check ( ) ) {
void * rpd = NULL ; // XXX RetopoPaintData *rpd= get_retopo_paint_data();
if ( rpd ) {
ToolSettings * ts = scene - > toolsettings ;
uiDefButC ( block , ROW , B_REDR , " Pen " , xco , yco , 40 , 20 , & ts - > retopo_paint_tool , 6.0 , RETOPO_PEN , 0 , 0 , " " ) ;
2.5
First version of region-scaling. WIP commit, so bear with me a while!
- All fixed sized regions have a small 'drag' widget, on the left or top.
(not yet for free-sized regions, like 4-split).
- Mouse-over on widget changes cursor and allows drag.
- Click on widget hides/reveals.
- Fun for test; 3d view header, if high enough, draws more rows of
buttons when width is too small.
The WIP stuff;
- It doesn't save yet in files, using the "minsize" variable of region
definitions, also means other similar areas show same sizes now.
- Definitions for pref size, min/max will be added.
- Properties panel in Fcurve window draws widget on wrong place when
hidden (subdiv system needs tweak)
- Widgets don't draw perfect yet, also needs further tweaks.
But, in general it's quite fun and usable. :) Many variatians are possible,
like for real tabs, or little icons, or just click-drag on edge.
The reason to first try the widget/tab variation:
- it re-uses the "Area Action Zone" code, widgets for layouting Screens
- it's visible, hotkey-only options for screen layouts are not preferred.
- distinguish clearly area-edges from region-edges this way. Having the
cursor change shape on every edge (and block input) is probably annoying
too... but that can be tested.
Later more!
2009-05-24 13:29:29 +00:00
xco + = 40 ;
2008-12-20 12:36:14 +00:00
uiDefButC ( block , ROW , B_REDR , " Line " , xco , yco , 40 , 20 , & ts - > retopo_paint_tool , 6.0 , RETOPO_LINE , 0 , 0 , " " ) ;
2.5
First version of region-scaling. WIP commit, so bear with me a while!
- All fixed sized regions have a small 'drag' widget, on the left or top.
(not yet for free-sized regions, like 4-split).
- Mouse-over on widget changes cursor and allows drag.
- Click on widget hides/reveals.
- Fun for test; 3d view header, if high enough, draws more rows of
buttons when width is too small.
The WIP stuff;
- It doesn't save yet in files, using the "minsize" variable of region
definitions, also means other similar areas show same sizes now.
- Definitions for pref size, min/max will be added.
- Properties panel in Fcurve window draws widget on wrong place when
hidden (subdiv system needs tweak)
- Widgets don't draw perfect yet, also needs further tweaks.
But, in general it's quite fun and usable. :) Many variatians are possible,
like for real tabs, or little icons, or just click-drag on edge.
The reason to first try the widget/tab variation:
- it re-uses the "Area Action Zone" code, widgets for layouting Screens
- it's visible, hotkey-only options for screen layouts are not preferred.
- distinguish clearly area-edges from region-edges this way. Having the
cursor change shape on every edge (and block input) is probably annoying
too... but that can be tested.
Later more!
2009-05-24 13:29:29 +00:00
xco + = 40 ;
2008-12-20 12:36:14 +00:00
uiDefButC ( block , ROW , B_REDR , " Ellipse " , xco , yco , 60 , 20 , & ts - > retopo_paint_tool , 6.0 , RETOPO_ELLIPSE , 0 , 0 , " " ) ;
2.5
First version of region-scaling. WIP commit, so bear with me a while!
- All fixed sized regions have a small 'drag' widget, on the left or top.
(not yet for free-sized regions, like 4-split).
- Mouse-over on widget changes cursor and allows drag.
- Click on widget hides/reveals.
- Fun for test; 3d view header, if high enough, draws more rows of
buttons when width is too small.
The WIP stuff;
- It doesn't save yet in files, using the "minsize" variable of region
definitions, also means other similar areas show same sizes now.
- Definitions for pref size, min/max will be added.
- Properties panel in Fcurve window draws widget on wrong place when
hidden (subdiv system needs tweak)
- Widgets don't draw perfect yet, also needs further tweaks.
But, in general it's quite fun and usable. :) Many variatians are possible,
like for real tabs, or little icons, or just click-drag on edge.
The reason to first try the widget/tab variation:
- it re-uses the "Area Action Zone" code, widgets for layouting Screens
- it's visible, hotkey-only options for screen layouts are not preferred.
- distinguish clearly area-edges from region-edges this way. Having the
cursor change shape on every edge (and block input) is probably annoying
too... but that can be tested.
Later more!
2009-05-24 13:29:29 +00:00
xco + = 65 ;
2008-12-20 12:36:14 +00:00
uiBlockBeginAlign ( block ) ;
if ( ts - > retopo_paint_tool = = RETOPO_PEN ) {
uiDefButC ( block , TOG , B_NOP , " Hotspot " , xco , yco , 60 , 20 , & ts - > retopo_hotspot , 0 , 0 , 0 , 0 , " Show hotspots at line ends to allow line continuation " ) ;
2.5
First version of region-scaling. WIP commit, so bear with me a while!
- All fixed sized regions have a small 'drag' widget, on the left or top.
(not yet for free-sized regions, like 4-split).
- Mouse-over on widget changes cursor and allows drag.
- Click on widget hides/reveals.
- Fun for test; 3d view header, if high enough, draws more rows of
buttons when width is too small.
The WIP stuff;
- It doesn't save yet in files, using the "minsize" variable of region
definitions, also means other similar areas show same sizes now.
- Definitions for pref size, min/max will be added.
- Properties panel in Fcurve window draws widget on wrong place when
hidden (subdiv system needs tweak)
- Widgets don't draw perfect yet, also needs further tweaks.
But, in general it's quite fun and usable. :) Many variatians are possible,
like for real tabs, or little icons, or just click-drag on edge.
The reason to first try the widget/tab variation:
- it re-uses the "Area Action Zone" code, widgets for layouting Screens
- it's visible, hotkey-only options for screen layouts are not preferred.
- distinguish clearly area-edges from region-edges this way. Having the
cursor change shape on every edge (and block input) is probably annoying
too... but that can be tested.
Later more!
2009-05-24 13:29:29 +00:00
xco + = 80 ;
2008-12-20 12:36:14 +00:00
}
else if ( ts - > retopo_paint_tool = = RETOPO_LINE ) {
uiDefButC ( block , NUM , B_NOP , " LineDiv " , xco , yco , 80 , 20 , & ts - > line_div , 1 , 50 , 0 , 0 , " Subdivisions per retopo line " ) ;
2.5
First version of region-scaling. WIP commit, so bear with me a while!
- All fixed sized regions have a small 'drag' widget, on the left or top.
(not yet for free-sized regions, like 4-split).
- Mouse-over on widget changes cursor and allows drag.
- Click on widget hides/reveals.
- Fun for test; 3d view header, if high enough, draws more rows of
buttons when width is too small.
The WIP stuff;
- It doesn't save yet in files, using the "minsize" variable of region
definitions, also means other similar areas show same sizes now.
- Definitions for pref size, min/max will be added.
- Properties panel in Fcurve window draws widget on wrong place when
hidden (subdiv system needs tweak)
- Widgets don't draw perfect yet, also needs further tweaks.
But, in general it's quite fun and usable. :) Many variatians are possible,
like for real tabs, or little icons, or just click-drag on edge.
The reason to first try the widget/tab variation:
- it re-uses the "Area Action Zone" code, widgets for layouting Screens
- it's visible, hotkey-only options for screen layouts are not preferred.
- distinguish clearly area-edges from region-edges this way. Having the
cursor change shape on every edge (and block input) is probably annoying
too... but that can be tested.
Later more!
2009-05-24 13:29:29 +00:00
xco + = 80 ;
2008-12-20 12:36:14 +00:00
}
else if ( ts - > retopo_paint_tool = = RETOPO_ELLIPSE ) {
uiDefButC ( block , NUM , B_NOP , " EllDiv " , xco , yco , 80 , 20 , & ts - > ellipse_div , 3 , 50 , 0 , 0 , " Subdivisions per retopo ellipse " ) ;
2.5
First version of region-scaling. WIP commit, so bear with me a while!
- All fixed sized regions have a small 'drag' widget, on the left or top.
(not yet for free-sized regions, like 4-split).
- Mouse-over on widget changes cursor and allows drag.
- Click on widget hides/reveals.
- Fun for test; 3d view header, if high enough, draws more rows of
buttons when width is too small.
The WIP stuff;
- It doesn't save yet in files, using the "minsize" variable of region
definitions, also means other similar areas show same sizes now.
- Definitions for pref size, min/max will be added.
- Properties panel in Fcurve window draws widget on wrong place when
hidden (subdiv system needs tweak)
- Widgets don't draw perfect yet, also needs further tweaks.
But, in general it's quite fun and usable. :) Many variatians are possible,
like for real tabs, or little icons, or just click-drag on edge.
The reason to first try the widget/tab variation:
- it re-uses the "Area Action Zone" code, widgets for layouting Screens
- it's visible, hotkey-only options for screen layouts are not preferred.
- distinguish clearly area-edges from region-edges this way. Having the
cursor change shape on every edge (and block input) is probably annoying
too... but that can be tested.
Later more!
2009-05-24 13:29:29 +00:00
xco + = 80 ;
2008-12-20 12:36:14 +00:00
}
2.5
First version of region-scaling. WIP commit, so bear with me a while!
- All fixed sized regions have a small 'drag' widget, on the left or top.
(not yet for free-sized regions, like 4-split).
- Mouse-over on widget changes cursor and allows drag.
- Click on widget hides/reveals.
- Fun for test; 3d view header, if high enough, draws more rows of
buttons when width is too small.
The WIP stuff;
- It doesn't save yet in files, using the "minsize" variable of region
definitions, also means other similar areas show same sizes now.
- Definitions for pref size, min/max will be added.
- Properties panel in Fcurve window draws widget on wrong place when
hidden (subdiv system needs tweak)
- Widgets don't draw perfect yet, also needs further tweaks.
But, in general it's quite fun and usable. :) Many variatians are possible,
like for real tabs, or little icons, or just click-drag on edge.
The reason to first try the widget/tab variation:
- it re-uses the "Area Action Zone" code, widgets for layouting Screens
- it's visible, hotkey-only options for screen layouts are not preferred.
- distinguish clearly area-edges from region-edges this way. Having the
cursor change shape on every edge (and block input) is probably annoying
too... but that can be tested.
Later more!
2009-05-24 13:29:29 +00:00
header_xco_step ( ar , & xco , & yco , & maxco , 5 ) ;
2008-12-20 12:36:14 +00:00
uiBlockEndAlign ( block ) ;
}
} else {
2009-08-16 01:25:53 +00:00
if ( obedit = = NULL & & ( ( ob & & ob - > mode & ( OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT | OB_MODE_TEXTURE_PAINT ) ) ) ) {
2008-12-20 12:36:14 +00:00
uiDefIconButBitI ( block , TOG , G_FACESELECT , B_VIEW_BUTSEDIT , ICON_FACESEL_HLT , xco , yco , XIC , YIC , & G . f , 0 , 0 , 0 , 0 , " Painting Mask (FKey) " ) ;
2.5
First version of region-scaling. WIP commit, so bear with me a while!
- All fixed sized regions have a small 'drag' widget, on the left or top.
(not yet for free-sized regions, like 4-split).
- Mouse-over on widget changes cursor and allows drag.
- Click on widget hides/reveals.
- Fun for test; 3d view header, if high enough, draws more rows of
buttons when width is too small.
The WIP stuff;
- It doesn't save yet in files, using the "minsize" variable of region
definitions, also means other similar areas show same sizes now.
- Definitions for pref size, min/max will be added.
- Properties panel in Fcurve window draws widget on wrong place when
hidden (subdiv system needs tweak)
- Widgets don't draw perfect yet, also needs further tweaks.
But, in general it's quite fun and usable. :) Many variatians are possible,
like for real tabs, or little icons, or just click-drag on edge.
The reason to first try the widget/tab variation:
- it re-uses the "Area Action Zone" code, widgets for layouting Screens
- it's visible, hotkey-only options for screen layouts are not preferred.
- distinguish clearly area-edges from region-edges this way. Having the
cursor change shape on every edge (and block input) is probably annoying
too... but that can be tested.
Later more!
2009-05-24 13:29:29 +00:00
header_xco_step ( ar , & xco , & yco , & maxco , XIC + 10 ) ;
2008-12-20 12:36:14 +00:00
} else {
2.5
First version of region-scaling. WIP commit, so bear with me a while!
- All fixed sized regions have a small 'drag' widget, on the left or top.
(not yet for free-sized regions, like 4-split).
- Mouse-over on widget changes cursor and allows drag.
- Click on widget hides/reveals.
- Fun for test; 3d view header, if high enough, draws more rows of
buttons when width is too small.
The WIP stuff;
- It doesn't save yet in files, using the "minsize" variable of region
definitions, also means other similar areas show same sizes now.
- Definitions for pref size, min/max will be added.
- Properties panel in Fcurve window draws widget on wrong place when
hidden (subdiv system needs tweak)
- Widgets don't draw perfect yet, also needs further tweaks.
But, in general it's quite fun and usable. :) Many variatians are possible,
like for real tabs, or little icons, or just click-drag on edge.
The reason to first try the widget/tab variation:
- it re-uses the "Area Action Zone" code, widgets for layouting Screens
- it's visible, hotkey-only options for screen layouts are not preferred.
- distinguish clearly area-edges from region-edges this way. Having the
cursor change shape on every edge (and block input) is probably annoying
too... but that can be tested.
Later more!
2009-05-24 13:29:29 +00:00
/* Manipulators aren't used in weight paint mode */
2009-01-18 21:36:38 +00:00
char * str_menu ;
2008-12-31 22:43:29 +00:00
uiDefIconTextButS ( block , ICONTEXTROW , B_AROUND , ICON_ROTATE , around_pup ( C ) , xco , yco , XIC + 10 , YIC , & ( v3d - > around ) , 0 , 3.0 , 0 , 0 , " Rotation/Scaling Pivot (Hotkeys: Comma, Shift Comma, Period, Ctrl Period, Alt Period) " ) ;
2008-12-20 12:36:14 +00:00
xco + = XIC + 10 ;
uiDefIconButBitS ( block , TOG , V3D_ALIGN , B_AROUND , ICON_ALIGN ,
xco , yco , XIC , YIC ,
& v3d - > flag , 0 , 0 , 0 , 0 , " Move object centers only " ) ;
uiBlockEndAlign ( block ) ;
2.5
First version of region-scaling. WIP commit, so bear with me a while!
- All fixed sized regions have a small 'drag' widget, on the left or top.
(not yet for free-sized regions, like 4-split).
- Mouse-over on widget changes cursor and allows drag.
- Click on widget hides/reveals.
- Fun for test; 3d view header, if high enough, draws more rows of
buttons when width is too small.
The WIP stuff;
- It doesn't save yet in files, using the "minsize" variable of region
definitions, also means other similar areas show same sizes now.
- Definitions for pref size, min/max will be added.
- Properties panel in Fcurve window draws widget on wrong place when
hidden (subdiv system needs tweak)
- Widgets don't draw perfect yet, also needs further tweaks.
But, in general it's quite fun and usable. :) Many variatians are possible,
like for real tabs, or little icons, or just click-drag on edge.
The reason to first try the widget/tab variation:
- it re-uses the "Area Action Zone" code, widgets for layouting Screens
- it's visible, hotkey-only options for screen layouts are not preferred.
- distinguish clearly area-edges from region-edges this way. Having the
cursor change shape on every edge (and block input) is probably annoying
too... but that can be tested.
Later more!
2009-05-24 13:29:29 +00:00
header_xco_step ( ar , & xco , & yco , & maxco , XIC + 8 ) ;
2008-12-20 12:36:14 +00:00
uiBlockBeginAlign ( block ) ;
/* NDOF */
if ( G . ndofdevice = = 0 ) {
uiDefIconTextButC ( block , ICONTEXTROW , B_NDOF , ICON_NDOF_TURN , ndof_pup ( ) , xco , yco , XIC + 10 , YIC , & ( v3d - > ndofmode ) , 0 , 3.0 , 0 , 0 , " Ndof mode " ) ;
xco + = XIC + 10 ;
uiDefIconButC ( block , TOG , B_NDOF , ICON_NDOF_DOM ,
xco , yco , XIC , YIC ,
& v3d - > ndoffilter , 0 , 1 , 0 , 0 , " dominant axis " ) ;
uiBlockEndAlign ( block ) ;
2.5
First version of region-scaling. WIP commit, so bear with me a while!
- All fixed sized regions have a small 'drag' widget, on the left or top.
(not yet for free-sized regions, like 4-split).
- Mouse-over on widget changes cursor and allows drag.
- Click on widget hides/reveals.
- Fun for test; 3d view header, if high enough, draws more rows of
buttons when width is too small.
The WIP stuff;
- It doesn't save yet in files, using the "minsize" variable of region
definitions, also means other similar areas show same sizes now.
- Definitions for pref size, min/max will be added.
- Properties panel in Fcurve window draws widget on wrong place when
hidden (subdiv system needs tweak)
- Widgets don't draw perfect yet, also needs further tweaks.
But, in general it's quite fun and usable. :) Many variatians are possible,
like for real tabs, or little icons, or just click-drag on edge.
The reason to first try the widget/tab variation:
- it re-uses the "Area Action Zone" code, widgets for layouting Screens
- it's visible, hotkey-only options for screen layouts are not preferred.
- distinguish clearly area-edges from region-edges this way. Having the
cursor change shape on every edge (and block input) is probably annoying
too... but that can be tested.
Later more!
2009-05-24 13:29:29 +00:00
header_xco_step ( ar , & xco , & yco , & maxco , XIC + 8 ) ;
2008-12-20 12:36:14 +00:00
}
uiBlockEndAlign ( block ) ;
/* Transform widget / manipulators */
uiBlockBeginAlign ( block ) ;
uiDefIconButBitS ( block , TOG , V3D_USE_MANIPULATOR , B_REDR , ICON_MANIPUL , xco , yco , XIC , YIC , & v3d - > twflag , 0 , 0 , 0 , 0 , " Use 3d transform manipulator (Ctrl Space) " ) ;
xco + = XIC ;
if ( v3d - > twflag & V3D_USE_MANIPULATOR ) {
uiDefIconButBitS ( block , TOG , V3D_MANIP_TRANSLATE , B_MAN_TRANS , ICON_MAN_TRANS , xco , yco , XIC , YIC , & v3d - > twtype , 1.0 , 0.0 , 0 , 0 , " Translate manipulator mode (Ctrl Alt G) " ) ;
xco + = XIC ;
uiDefIconButBitS ( block , TOG , V3D_MANIP_ROTATE , B_MAN_ROT , ICON_MAN_ROT , xco , yco , XIC , YIC , & v3d - > twtype , 1.0 , 0.0 , 0 , 0 , " Rotate manipulator mode (Ctrl Alt R) " ) ;
xco + = XIC ;
uiDefIconButBitS ( block , TOG , V3D_MANIP_SCALE , B_MAN_SCALE , ICON_MAN_SCALE , xco , yco , XIC , YIC , & v3d - > twtype , 1.0 , 0.0 , 0 , 0 , " Scale manipulator mode (Ctrl Alt S) " ) ;
xco + = XIC ;
}
2009-01-18 21:36:38 +00:00
if ( v3d - > twmode > ( BIF_countTransformOrientation ( C ) - 1 ) + V3D_MANIP_CUSTOM ) {
v3d - > twmode = 0 ;
}
2008-12-20 12:36:14 +00:00
2009-01-18 21:36:38 +00:00
str_menu = BIF_menustringTransformOrientation ( C , " Orientation " ) ;
uiDefButS ( block , MENU , B_MAN_MODE , str_menu , xco , yco , 70 , YIC , & v3d - > twmode , 0 , 0 , 0 , 0 , " Transform Orientation (ALT+Space) " ) ;
MEM_freeN ( str_menu ) ;
2008-12-20 12:36:14 +00:00
2.5
First version of region-scaling. WIP commit, so bear with me a while!
- All fixed sized regions have a small 'drag' widget, on the left or top.
(not yet for free-sized regions, like 4-split).
- Mouse-over on widget changes cursor and allows drag.
- Click on widget hides/reveals.
- Fun for test; 3d view header, if high enough, draws more rows of
buttons when width is too small.
The WIP stuff;
- It doesn't save yet in files, using the "minsize" variable of region
definitions, also means other similar areas show same sizes now.
- Definitions for pref size, min/max will be added.
- Properties panel in Fcurve window draws widget on wrong place when
hidden (subdiv system needs tweak)
- Widgets don't draw perfect yet, also needs further tweaks.
But, in general it's quite fun and usable. :) Many variatians are possible,
like for real tabs, or little icons, or just click-drag on edge.
The reason to first try the widget/tab variation:
- it re-uses the "Area Action Zone" code, widgets for layouting Screens
- it's visible, hotkey-only options for screen layouts are not preferred.
- distinguish clearly area-edges from region-edges this way. Having the
cursor change shape on every edge (and block input) is probably annoying
too... but that can be tested.
Later more!
2009-05-24 13:29:29 +00:00
header_xco_step ( ar , & xco , & yco , & maxco , 78 ) ;
2008-12-20 12:36:14 +00:00
uiBlockEndAlign ( block ) ;
}
/* LAYERS */
2008-12-31 22:43:29 +00:00
if ( obedit = = NULL & & v3d - > localview = = 0 ) {
2008-12-20 12:36:14 +00:00
int ob_lay = ob ? ob - > lay : 0 ;
uiBlockBeginAlign ( block ) ;
for ( a = 0 ; a < 5 ; a + + ) {
uiDefIconButBitI ( block , TOG , 1 < < a , B_LAY + a , view3d_layer_icon ( 1 < < a , ob_lay , v3d - > lay_used ) , ( short ) ( xco + a * ( XIC / 2 ) ) , yco + ( short ) ( YIC / 2 ) , ( short ) ( XIC / 2 ) , ( short ) ( YIC / 2 ) , & ( v3d - > lay ) , 0 , 0 , 0 , 0 , " Toggles Layer visibility (Alt Num, Alt Shift Num) " ) ;
}
for ( a = 0 ; a < 5 ; a + + ) {
uiDefIconButBitI ( block , TOG , 1 < < ( a + 10 ) , B_LAY + 10 + a , view3d_layer_icon ( 1 < < ( a + 10 ) , ob_lay , v3d - > lay_used ) , ( short ) ( xco + a * ( XIC / 2 ) ) , yco , XIC / 2 , ( YIC ) / 2 , & ( v3d - > lay ) , 0 , 0 , 0 , 0 , " Toggles Layer visibility (Alt Num, Alt Shift Num) " ) ;
}
xco + = 5 ;
uiBlockBeginAlign ( block ) ;
for ( a = 5 ; a < 10 ; a + + ) {
uiDefIconButBitI ( block , TOG , 1 < < a , B_LAY + a , view3d_layer_icon ( 1 < < a , ob_lay , v3d - > lay_used ) , ( short ) ( xco + a * ( XIC / 2 ) ) , yco + ( short ) ( YIC / 2 ) , ( short ) ( XIC / 2 ) , ( short ) ( YIC / 2 ) , & ( v3d - > lay ) , 0 , 0 , 0 , 0 , " Toggles Layer visibility (Alt Num, Alt Shift Num) " ) ;
}
for ( a = 5 ; a < 10 ; a + + ) {
uiDefIconButBitI ( block , TOG , 1 < < ( a + 10 ) , B_LAY + 10 + a , view3d_layer_icon ( 1 < < ( a + 10 ) , ob_lay , v3d - > lay_used ) , ( short ) ( xco + a * ( XIC / 2 ) ) , yco , XIC / 2 , ( YIC ) / 2 , & ( v3d - > lay ) , 0 , 0 , 0 , 0 , " Toggles Layer visibility (Alt Num, Alt Shift Num) " ) ;
}
uiBlockEndAlign ( block ) ;
xco + = ( a - 2 ) * ( XIC / 2 ) + 3 ;
/* LOCK */
2.5 - Reworked the icon system a bit
* After several hours of manual dragging and typing the icon file is now
enlarged and completely reorganised logically, rather than scattered
throughout. This should provide a lot more room for growth, and is a
lot easier to work with (also allowing more space for toggle buttons
that require two icon slots next to each other). The icon grid has now
25 x 24 icons - hopefully this might last us for a couple more years :)
Some of the naming of icon defines is a bit ancient and can be cleaned
up a bit further. Other devs, if when bringing spaces back, it's
finding the wrong icon, or missing a define, try and look to see if
it's already existing in the new icon file, or drop me a note and I'll
fix it up.
Note: after these changes, older custom blender 2.4 icon
files won't work and will need to be updated to the new layout.
* Enlarged the icons themselves from 15x16 pixels to 16x16 pixels (icon
designer request). This is a more standard size, and is easier to fit
stuff in proportionally.
* Added a bunch more of jendrzych's icons that weren't added previously
since there wasn't space in the icon file (including a few more
modifier icons)
* Tweaked the outliner somewhat, so that instead of just showing a
generic 'object' icon for all objects, it shows 'object type' icons,
per object type. This makes the outliner a lot more useful for browsing
at a glance - a huge row of identical 'object' icons doesn't really
give much useful information. See here:
http://mke3.net/blender/devel/2.5/outliner_obtypes.png
2008-12-28 07:39:23 +00:00
uiDefIconButS ( block , ICONTOG , B_SCENELOCK , ICON_LOCKVIEW_OFF , xco + = XIC , yco , XIC , YIC , & ( v3d - > scenelock ) , 0 , 0 , 0 , 0 , " Locks Active Camera and layers to Scene (Ctrl `) " ) ;
2.5
First version of region-scaling. WIP commit, so bear with me a while!
- All fixed sized regions have a small 'drag' widget, on the left or top.
(not yet for free-sized regions, like 4-split).
- Mouse-over on widget changes cursor and allows drag.
- Click on widget hides/reveals.
- Fun for test; 3d view header, if high enough, draws more rows of
buttons when width is too small.
The WIP stuff;
- It doesn't save yet in files, using the "minsize" variable of region
definitions, also means other similar areas show same sizes now.
- Definitions for pref size, min/max will be added.
- Properties panel in Fcurve window draws widget on wrong place when
hidden (subdiv system needs tweak)
- Widgets don't draw perfect yet, also needs further tweaks.
But, in general it's quite fun and usable. :) Many variatians are possible,
like for real tabs, or little icons, or just click-drag on edge.
The reason to first try the widget/tab variation:
- it re-uses the "Area Action Zone" code, widgets for layouting Screens
- it's visible, hotkey-only options for screen layouts are not preferred.
- distinguish clearly area-edges from region-edges this way. Having the
cursor change shape on every edge (and block input) is probably annoying
too... but that can be tested.
Later more!
2009-05-24 13:29:29 +00:00
header_xco_step ( ar , & xco , & yco , & maxco , XIC + 10 ) ;
2008-12-20 12:36:14 +00:00
}
/* proportional falloff */
2009-08-16 02:35:44 +00:00
if ( ( obedit & & ( obedit - > type = = OB_MESH | | obedit - > type = = OB_CURVE | | obedit - > type = = OB_SURF | | obedit - > type = = OB_LATTICE ) ) | | ( ob & & ob - > mode & OB_MODE_PARTICLE_EDIT ) ) {
2008-12-20 12:36:14 +00:00
uiBlockBeginAlign ( block ) ;
2009-06-23 00:41:55 +00:00
uiDefIconTextButS ( block , ICONTEXTROW , B_REDR , ICON_PROP_OFF , " Proportional %t|Off %x0|On %x1|Connected %x2 " , xco , yco , XIC + 10 , YIC , & ( ts - > proportional ) , 0 , 1.0 , 0 , 0 , " Proportional Edit Falloff (Hotkeys: O, Alt O) " ) ;
2008-12-20 12:36:14 +00:00
xco + = XIC + 10 ;
2009-06-23 00:41:55 +00:00
if ( ts - > proportional ) {
uiDefIconTextButS ( block , ICONTEXTROW , B_REDR , ICON_SMOOTHCURVE , propfalloff_pup ( ) , xco , yco , XIC + 10 , YIC , & ( ts - > prop_mode ) , 0.0 , 0.0 , 0 , 0 , " Proportional Edit Falloff (Hotkey: Shift O) " ) ;
2008-12-20 12:36:14 +00:00
xco + = XIC + 10 ;
}
uiBlockEndAlign ( block ) ;
2.5
First version of region-scaling. WIP commit, so bear with me a while!
- All fixed sized regions have a small 'drag' widget, on the left or top.
(not yet for free-sized regions, like 4-split).
- Mouse-over on widget changes cursor and allows drag.
- Click on widget hides/reveals.
- Fun for test; 3d view header, if high enough, draws more rows of
buttons when width is too small.
The WIP stuff;
- It doesn't save yet in files, using the "minsize" variable of region
definitions, also means other similar areas show same sizes now.
- Definitions for pref size, min/max will be added.
- Properties panel in Fcurve window draws widget on wrong place when
hidden (subdiv system needs tweak)
- Widgets don't draw perfect yet, also needs further tweaks.
But, in general it's quite fun and usable. :) Many variatians are possible,
like for real tabs, or little icons, or just click-drag on edge.
The reason to first try the widget/tab variation:
- it re-uses the "Area Action Zone" code, widgets for layouting Screens
- it's visible, hotkey-only options for screen layouts are not preferred.
- distinguish clearly area-edges from region-edges this way. Having the
cursor change shape on every edge (and block input) is probably annoying
too... but that can be tested.
Later more!
2009-05-24 13:29:29 +00:00
header_xco_step ( ar , & xco , & yco , & maxco , XIC + 10 ) ;
2008-12-20 12:36:14 +00:00
}
/* Snap */
2008-12-31 22:43:29 +00:00
if ( BIF_snappingSupported ( obedit ) ) {
2008-12-20 12:36:14 +00:00
uiBlockBeginAlign ( block ) ;
2009-06-23 00:41:55 +00:00
if ( ts - > snap_flag & SCE_SNAP ) {
uiDefIconButBitS ( block , TOG , SCE_SNAP , B_REDR , ICON_SNAP_GEO , xco , yco , XIC , YIC , & ts - > snap_flag , 0 , 0 , 0 , 0 , " Snap while Ctrl is held during transform (Shift Tab) " ) ;
2008-12-20 12:36:14 +00:00
xco + = XIC ;
2009-06-23 00:41:55 +00:00
uiDefIconButBitS ( block , TOG , SCE_SNAP_ROTATE , B_REDR , ICON_SNAP_NORMAL , xco , yco , XIC , YIC , & ts - > snap_flag , 0 , 0 , 0 , 0 , " Align rotation with the snapping target " ) ;
2008-12-20 12:36:14 +00:00
xco + = XIC ;
2009-06-23 00:41:55 +00:00
if ( ts - > snap_mode = = SCE_SNAP_MODE_VOLUME ) {
uiDefIconButBitS ( block , TOG , SCE_SNAP_PEEL_OBJECT , B_REDR , ICON_SNAP_PEEL_OBJECT , xco , yco , XIC , YIC , & ts - > snap_flag , 0 , 0 , 0 , 0 , " Consider objects as whole when finding volume center " ) ;
2009-03-17 21:26:09 +00:00
xco + = XIC ;
}
2009-06-23 00:41:55 +00:00
uiDefIconTextButS ( block , ICONTEXTROW , B_REDR , ICON_SNAP_VERTEX , snapmode_pup ( ) , xco , yco , XIC + 10 , YIC , & ( ts - > snap_mode ) , 0.0 , 0.0 , 0 , 0 , " Snapping mode " ) ;
2008-12-20 12:36:14 +00:00
xco + = XIC ;
2009-06-23 00:41:55 +00:00
uiDefButS ( block , MENU , B_NOP , " Snap Mode%t|Closest%x0|Center%x1|Median%x2|Active%x3 " , xco , yco , 70 , YIC , & ts - > snap_target , 0 , 0 , 0 , 0 , " Snap Target Mode " ) ;
2.5
First version of region-scaling. WIP commit, so bear with me a while!
- All fixed sized regions have a small 'drag' widget, on the left or top.
(not yet for free-sized regions, like 4-split).
- Mouse-over on widget changes cursor and allows drag.
- Click on widget hides/reveals.
- Fun for test; 3d view header, if high enough, draws more rows of
buttons when width is too small.
The WIP stuff;
- It doesn't save yet in files, using the "minsize" variable of region
definitions, also means other similar areas show same sizes now.
- Definitions for pref size, min/max will be added.
- Properties panel in Fcurve window draws widget on wrong place when
hidden (subdiv system needs tweak)
- Widgets don't draw perfect yet, also needs further tweaks.
But, in general it's quite fun and usable. :) Many variatians are possible,
like for real tabs, or little icons, or just click-drag on edge.
The reason to first try the widget/tab variation:
- it re-uses the "Area Action Zone" code, widgets for layouting Screens
- it's visible, hotkey-only options for screen layouts are not preferred.
- distinguish clearly area-edges from region-edges this way. Having the
cursor change shape on every edge (and block input) is probably annoying
too... but that can be tested.
Later more!
2009-05-24 13:29:29 +00:00
xco + = XIC + 70 ;
2008-12-20 12:36:14 +00:00
} else {
2009-06-23 00:41:55 +00:00
uiDefIconButBitS ( block , TOG , SCE_SNAP , B_REDR , ICON_SNAP_GEAR , xco , yco , XIC , YIC , & ts - > snap_flag , 0 , 0 , 0 , 0 , " Snap while Ctrl is held during transform (Shift Tab) " ) ;
2008-12-20 12:36:14 +00:00
xco + = XIC ;
}
uiBlockEndAlign ( block ) ;
2.5
First version of region-scaling. WIP commit, so bear with me a while!
- All fixed sized regions have a small 'drag' widget, on the left or top.
(not yet for free-sized regions, like 4-split).
- Mouse-over on widget changes cursor and allows drag.
- Click on widget hides/reveals.
- Fun for test; 3d view header, if high enough, draws more rows of
buttons when width is too small.
The WIP stuff;
- It doesn't save yet in files, using the "minsize" variable of region
definitions, also means other similar areas show same sizes now.
- Definitions for pref size, min/max will be added.
- Properties panel in Fcurve window draws widget on wrong place when
hidden (subdiv system needs tweak)
- Widgets don't draw perfect yet, also needs further tweaks.
But, in general it's quite fun and usable. :) Many variatians are possible,
like for real tabs, or little icons, or just click-drag on edge.
The reason to first try the widget/tab variation:
- it re-uses the "Area Action Zone" code, widgets for layouting Screens
- it's visible, hotkey-only options for screen layouts are not preferred.
- distinguish clearly area-edges from region-edges this way. Having the
cursor change shape on every edge (and block input) is probably annoying
too... but that can be tested.
Later more!
2009-05-24 13:29:29 +00:00
header_xco_step ( ar , & xco , & yco , & maxco , 10 ) ;
2008-12-20 12:36:14 +00:00
}
/* selection modus */
2008-12-31 22:43:29 +00:00
if ( obedit & & ( obedit - > type = = OB_MESH ) ) {
2009-04-11 08:26:51 +00:00
EditMesh * em = BKE_mesh_get_editmesh ( ( Mesh * ) obedit - > data ) ;
2009-01-01 18:05:12 +00:00
2008-12-20 12:36:14 +00:00
uiBlockBeginAlign ( block ) ;
2009-01-01 18:05:12 +00:00
uiDefIconButBitS ( block , TOG , SCE_SELECT_VERTEX , B_SEL_VERT , ICON_VERTEXSEL , xco , yco , XIC , YIC , & em - > selectmode , 1.0 , 0.0 , 0 , 0 , " Vertex select mode (Ctrl Tab 1) " ) ;
2008-12-20 12:36:14 +00:00
xco + = XIC ;
2009-01-01 18:05:12 +00:00
uiDefIconButBitS ( block , TOG , SCE_SELECT_EDGE , B_SEL_EDGE , ICON_EDGESEL , xco , yco , XIC , YIC , & em - > selectmode , 1.0 , 0.0 , 0 , 0 , " Edge select mode (Ctrl Tab 2) " ) ;
2008-12-20 12:36:14 +00:00
xco + = XIC ;
2009-01-01 18:05:12 +00:00
uiDefIconButBitS ( block , TOG , SCE_SELECT_FACE , B_SEL_FACE , ICON_FACESEL , xco , yco , XIC , YIC , & em - > selectmode , 1.0 , 0.0 , 0 , 0 , " Face select mode (Ctrl Tab 3) " ) ;
2008-12-20 12:36:14 +00:00
xco + = XIC ;
uiBlockEndAlign ( block ) ;
if ( v3d - > drawtype > OB_WIRE ) {
uiDefIconButBitS ( block , TOG , V3D_ZBUF_SELECT , B_REDR , ICON_ORTHO , xco , yco , XIC , YIC , & v3d - > flag , 1.0 , 0.0 , 0 , 0 , " Occlude background geometry " ) ;
xco + = XIC ;
}
uiBlockEndAlign ( block ) ;
2.5
First version of region-scaling. WIP commit, so bear with me a while!
- All fixed sized regions have a small 'drag' widget, on the left or top.
(not yet for free-sized regions, like 4-split).
- Mouse-over on widget changes cursor and allows drag.
- Click on widget hides/reveals.
- Fun for test; 3d view header, if high enough, draws more rows of
buttons when width is too small.
The WIP stuff;
- It doesn't save yet in files, using the "minsize" variable of region
definitions, also means other similar areas show same sizes now.
- Definitions for pref size, min/max will be added.
- Properties panel in Fcurve window draws widget on wrong place when
hidden (subdiv system needs tweak)
- Widgets don't draw perfect yet, also needs further tweaks.
But, in general it's quite fun and usable. :) Many variatians are possible,
like for real tabs, or little icons, or just click-drag on edge.
The reason to first try the widget/tab variation:
- it re-uses the "Area Action Zone" code, widgets for layouting Screens
- it's visible, hotkey-only options for screen layouts are not preferred.
- distinguish clearly area-edges from region-edges this way. Having the
cursor change shape on every edge (and block input) is probably annoying
too... but that can be tested.
Later more!
2009-05-24 13:29:29 +00:00
header_xco_step ( ar , & xco , & yco , & maxco , XIC ) ;
2009-03-30 07:28:37 +00:00
2009-04-11 08:26:51 +00:00
BKE_mesh_end_editmesh ( obedit - > data , em ) ;
2008-12-20 12:36:14 +00:00
}
2009-08-16 02:35:44 +00:00
else if ( ob & & ob - > mode & OB_MODE_PARTICLE_EDIT ) {
2008-12-20 12:36:14 +00:00
uiBlockBeginAlign ( block ) ;
2009-06-24 17:22:22 +00:00
uiDefIconButBitI ( block , TOG , SCE_SELECT_PATH , B_SEL_PATH , ICON_EDGESEL , xco , yco , XIC , YIC , & ts - > particle . selectmode , 1.0 , 0.0 , 0 , 0 , " Path edit mode " ) ;
2008-12-20 12:36:14 +00:00
xco + = XIC ;
2009-06-24 17:22:22 +00:00
uiDefIconButBitI ( block , TOG , SCE_SELECT_POINT , B_SEL_POINT , ICON_VERTEXSEL , xco , yco , XIC , YIC , & ts - > particle . selectmode , 1.0 , 0.0 , 0 , 0 , " Point select mode " ) ;
2008-12-20 12:36:14 +00:00
xco + = XIC ;
2009-06-24 17:22:22 +00:00
uiDefIconButBitI ( block , TOG , SCE_SELECT_END , B_SEL_END , ICON_FACESEL , xco , yco , XIC , YIC , & ts - > particle . selectmode , 1.0 , 0.0 , 0 , 0 , " Tip select mode " ) ;
2008-12-20 12:36:14 +00:00
xco + = XIC ;
uiBlockEndAlign ( block ) ;
2.5
First version of region-scaling. WIP commit, so bear with me a while!
- All fixed sized regions have a small 'drag' widget, on the left or top.
(not yet for free-sized regions, like 4-split).
- Mouse-over on widget changes cursor and allows drag.
- Click on widget hides/reveals.
- Fun for test; 3d view header, if high enough, draws more rows of
buttons when width is too small.
The WIP stuff;
- It doesn't save yet in files, using the "minsize" variable of region
definitions, also means other similar areas show same sizes now.
- Definitions for pref size, min/max will be added.
- Properties panel in Fcurve window draws widget on wrong place when
hidden (subdiv system needs tweak)
- Widgets don't draw perfect yet, also needs further tweaks.
But, in general it's quite fun and usable. :) Many variatians are possible,
like for real tabs, or little icons, or just click-drag on edge.
The reason to first try the widget/tab variation:
- it re-uses the "Area Action Zone" code, widgets for layouting Screens
- it's visible, hotkey-only options for screen layouts are not preferred.
- distinguish clearly area-edges from region-edges this way. Having the
cursor change shape on every edge (and block input) is probably annoying
too... but that can be tested.
Later more!
2009-05-24 13:29:29 +00:00
2008-12-20 12:36:14 +00:00
if ( v3d - > drawtype > OB_WIRE ) {
uiDefIconButBitS ( block , TOG , V3D_ZBUF_SELECT , B_REDR , ICON_ORTHO , xco , yco , XIC , YIC , & v3d - > flag , 1.0 , 0.0 , 0 , 0 , " Limit selection to visible (clipped with depth buffer) " ) ;
xco + = XIC ;
}
uiBlockEndAlign ( block ) ;
2.5
First version of region-scaling. WIP commit, so bear with me a while!
- All fixed sized regions have a small 'drag' widget, on the left or top.
(not yet for free-sized regions, like 4-split).
- Mouse-over on widget changes cursor and allows drag.
- Click on widget hides/reveals.
- Fun for test; 3d view header, if high enough, draws more rows of
buttons when width is too small.
The WIP stuff;
- It doesn't save yet in files, using the "minsize" variable of region
definitions, also means other similar areas show same sizes now.
- Definitions for pref size, min/max will be added.
- Properties panel in Fcurve window draws widget on wrong place when
hidden (subdiv system needs tweak)
- Widgets don't draw perfect yet, also needs further tweaks.
But, in general it's quite fun and usable. :) Many variatians are possible,
like for real tabs, or little icons, or just click-drag on edge.
The reason to first try the widget/tab variation:
- it re-uses the "Area Action Zone" code, widgets for layouting Screens
- it's visible, hotkey-only options for screen layouts are not preferred.
- distinguish clearly area-edges from region-edges this way. Having the
cursor change shape on every edge (and block input) is probably annoying
too... but that can be tested.
Later more!
2009-05-24 13:29:29 +00:00
header_xco_step ( ar , & xco , & yco , & maxco , XIC ) ;
2008-12-20 12:36:14 +00:00
}
2009-02-18 04:36:07 +00:00
uiDefIconBut ( block , BUT , B_VIEWRENDER , ICON_SCENE , xco , yco , XIC , YIC , NULL , 0 , 1.0 , 0 , 0 , " Render this window (Ctrl Click for anim) " ) ;
2008-12-20 12:36:14 +00:00
2009-08-16 03:24:23 +00:00
if ( ob & & ( ob - > mode & OB_MODE_POSE ) ) {
2009-09-08 02:09:14 +00:00
xco + = XIC * 2 ;
2008-12-20 12:36:14 +00:00
uiBlockBeginAlign ( block ) ;
2.5 - Reworked the icon system a bit
* After several hours of manual dragging and typing the icon file is now
enlarged and completely reorganised logically, rather than scattered
throughout. This should provide a lot more room for growth, and is a
lot easier to work with (also allowing more space for toggle buttons
that require two icon slots next to each other). The icon grid has now
25 x 24 icons - hopefully this might last us for a couple more years :)
Some of the naming of icon defines is a bit ancient and can be cleaned
up a bit further. Other devs, if when bringing spaces back, it's
finding the wrong icon, or missing a define, try and look to see if
it's already existing in the new icon file, or drop me a note and I'll
fix it up.
Note: after these changes, older custom blender 2.4 icon
files won't work and will need to be updated to the new layout.
* Enlarged the icons themselves from 15x16 pixels to 16x16 pixels (icon
designer request). This is a more standard size, and is easier to fit
stuff in proportionally.
* Added a bunch more of jendrzych's icons that weren't added previously
since there wasn't space in the icon file (including a few more
modifier icons)
* Tweaked the outliner somewhat, so that instead of just showing a
generic 'object' icon for all objects, it shows 'object type' icons,
per object type. This makes the outliner a lot more useful for browsing
at a glance - a huge row of identical 'object' icons doesn't really
give much useful information. See here:
http://mke3.net/blender/devel/2.5/outliner_obtypes.png
2008-12-28 07:39:23 +00:00
2009-07-21 13:12:40 +00:00
uiDefIconButO ( block , BUT , " POSE_OT_copy " , WM_OP_INVOKE_REGION_WIN , ICON_COPYDOWN , xco , yco , XIC , YIC , NULL ) ;
2.5 - Reworked the icon system a bit
* After several hours of manual dragging and typing the icon file is now
enlarged and completely reorganised logically, rather than scattered
throughout. This should provide a lot more room for growth, and is a
lot easier to work with (also allowing more space for toggle buttons
that require two icon slots next to each other). The icon grid has now
25 x 24 icons - hopefully this might last us for a couple more years :)
Some of the naming of icon defines is a bit ancient and can be cleaned
up a bit further. Other devs, if when bringing spaces back, it's
finding the wrong icon, or missing a define, try and look to see if
it's already existing in the new icon file, or drop me a note and I'll
fix it up.
Note: after these changes, older custom blender 2.4 icon
files won't work and will need to be updated to the new layout.
* Enlarged the icons themselves from 15x16 pixels to 16x16 pixels (icon
designer request). This is a more standard size, and is easier to fit
stuff in proportionally.
* Added a bunch more of jendrzych's icons that weren't added previously
since there wasn't space in the icon file (including a few more
modifier icons)
* Tweaked the outliner somewhat, so that instead of just showing a
generic 'object' icon for all objects, it shows 'object type' icons,
per object type. This makes the outliner a lot more useful for browsing
at a glance - a huge row of identical 'object' icons doesn't really
give much useful information. See here:
http://mke3.net/blender/devel/2.5/outliner_obtypes.png
2008-12-28 07:39:23 +00:00
uiBlockSetButLock ( block , object_data_is_libdata ( ob ) , " Can't edit external libdata " ) ;
2.5
First version of region-scaling. WIP commit, so bear with me a while!
- All fixed sized regions have a small 'drag' widget, on the left or top.
(not yet for free-sized regions, like 4-split).
- Mouse-over on widget changes cursor and allows drag.
- Click on widget hides/reveals.
- Fun for test; 3d view header, if high enough, draws more rows of
buttons when width is too small.
The WIP stuff;
- It doesn't save yet in files, using the "minsize" variable of region
definitions, also means other similar areas show same sizes now.
- Definitions for pref size, min/max will be added.
- Properties panel in Fcurve window draws widget on wrong place when
hidden (subdiv system needs tweak)
- Widgets don't draw perfect yet, also needs further tweaks.
But, in general it's quite fun and usable. :) Many variatians are possible,
like for real tabs, or little icons, or just click-drag on edge.
The reason to first try the widget/tab variation:
- it re-uses the "Area Action Zone" code, widgets for layouting Screens
- it's visible, hotkey-only options for screen layouts are not preferred.
- distinguish clearly area-edges from region-edges this way. Having the
cursor change shape on every edge (and block input) is probably annoying
too... but that can be tested.
Later more!
2009-05-24 13:29:29 +00:00
xco + = XIC ;
2009-07-21 13:12:40 +00:00
uiDefIconButO ( block , BUT , " POSE_OT_paste " , WM_OP_INVOKE_REGION_WIN , ICON_PASTEDOWN , xco , yco , XIC , YIC , NULL ) ;
2.5
First version of region-scaling. WIP commit, so bear with me a while!
- All fixed sized regions have a small 'drag' widget, on the left or top.
(not yet for free-sized regions, like 4-split).
- Mouse-over on widget changes cursor and allows drag.
- Click on widget hides/reveals.
- Fun for test; 3d view header, if high enough, draws more rows of
buttons when width is too small.
The WIP stuff;
- It doesn't save yet in files, using the "minsize" variable of region
definitions, also means other similar areas show same sizes now.
- Definitions for pref size, min/max will be added.
- Properties panel in Fcurve window draws widget on wrong place when
hidden (subdiv system needs tweak)
- Widgets don't draw perfect yet, also needs further tweaks.
But, in general it's quite fun and usable. :) Many variatians are possible,
like for real tabs, or little icons, or just click-drag on edge.
The reason to first try the widget/tab variation:
- it re-uses the "Area Action Zone" code, widgets for layouting Screens
- it's visible, hotkey-only options for screen layouts are not preferred.
- distinguish clearly area-edges from region-edges this way. Having the
cursor change shape on every edge (and block input) is probably annoying
too... but that can be tested.
Later more!
2009-05-24 13:29:29 +00:00
xco + = XIC ;
2009-07-21 13:12:40 +00:00
// FIXME: this needs an extra arg...
uiDefIconButO ( block , BUT , " POSE_OT_paste " , WM_OP_INVOKE_REGION_WIN , ICON_PASTEFLIPDOWN , xco , yco , XIC , YIC , NULL ) ;
2008-12-20 12:36:14 +00:00
uiBlockEndAlign ( block ) ;
2.5
First version of region-scaling. WIP commit, so bear with me a while!
- All fixed sized regions have a small 'drag' widget, on the left or top.
(not yet for free-sized regions, like 4-split).
- Mouse-over on widget changes cursor and allows drag.
- Click on widget hides/reveals.
- Fun for test; 3d view header, if high enough, draws more rows of
buttons when width is too small.
The WIP stuff;
- It doesn't save yet in files, using the "minsize" variable of region
definitions, also means other similar areas show same sizes now.
- Definitions for pref size, min/max will be added.
- Properties panel in Fcurve window draws widget on wrong place when
hidden (subdiv system needs tweak)
- Widgets don't draw perfect yet, also needs further tweaks.
But, in general it's quite fun and usable. :) Many variatians are possible,
like for real tabs, or little icons, or just click-drag on edge.
The reason to first try the widget/tab variation:
- it re-uses the "Area Action Zone" code, widgets for layouting Screens
- it's visible, hotkey-only options for screen layouts are not preferred.
- distinguish clearly area-edges from region-edges this way. Having the
cursor change shape on every edge (and block input) is probably annoying
too... but that can be tested.
Later more!
2009-05-24 13:29:29 +00:00
header_xco_step ( ar , & xco , & yco , & maxco , XIC ) ;
2008-12-20 12:36:14 +00:00
}
}
2008-12-12 18:47:12 +00:00
}