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 .
*
* The Original Code is Copyright ( C ) 2008 Blender Foundation .
* All rights reserved .
*
*
* Contributor ( s ) : Blender Foundation
*
* * * * * * END GPL LICENSE BLOCK * * * * *
*/
# include <string.h>
# include <stdio.h>
Animato/2.5 - Graph Editor (i.e. the new 'IPO Editor')
This commit brings back the drawing code for the 'Graph Editor'. I've decided to call it this, as currently it can show either F-Curves for Animation stored in Actions, or F-Curves for Drivers.
Currently, it shows all curves, since some of the necessary filtering code (i.e. for limiting curve visibility) hasn't been put in place yet. At least this serves as good proof that we can have F-Curves from multiple sources at least.
It should be noted that the code still has to be modified to work with some of the new Animato features, such as F-Curve Modifiers (cycles are an example of one of the features that use this). Also, a nicer way to set the colours of the curves needs to be investigated.
Notes:
* Fixed a few bugs in RNA User-Preferences wrapping
* The keyframe drawing uses the new-style drawing for handles from AnimSys2. There's a minor bug that sometimes occurs, where a distorted handle gets drawn at the origin of the grid on the first run. Hints anyone?
* Removed most of the old data from SpaceIpo struct, as the new code uses that. Maybe later, the directories/files at least should get renamed.
* Removed ancient hack for NVidia/TNT drivers. It is probably no longer needed, but could be restored if someone needs it.
2009-01-26 11:33:16 +00:00
# include "DNA_anim_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"
# include "DNA_windowmanager_types.h"
# include "MEM_guardedalloc.h"
# include "BLI_blenlib.h"
2008-12-18 02:56:48 +00:00
# include "BKE_context.h"
2008-12-12 18:47:12 +00:00
# include "BKE_screen.h"
Animato/2.5 - Graph Editor (i.e. the new 'IPO Editor')
This commit brings back the drawing code for the 'Graph Editor'. I've decided to call it this, as currently it can show either F-Curves for Animation stored in Actions, or F-Curves for Drivers.
Currently, it shows all curves, since some of the necessary filtering code (i.e. for limiting curve visibility) hasn't been put in place yet. At least this serves as good proof that we can have F-Curves from multiple sources at least.
It should be noted that the code still has to be modified to work with some of the new Animato features, such as F-Curve Modifiers (cycles are an example of one of the features that use this). Also, a nicer way to set the colours of the curves needs to be investigated.
Notes:
* Fixed a few bugs in RNA User-Preferences wrapping
* The keyframe drawing uses the new-style drawing for handles from AnimSys2. There's a minor bug that sometimes occurs, where a distorted handle gets drawn at the origin of the grid on the first run. Hints anyone?
* Removed most of the old data from SpaceIpo struct, as the new code uses that. Maybe later, the directories/files at least should get renamed.
* Removed ancient hack for NVidia/TNT drivers. It is probably no longer needed, but could be restored if someone needs it.
2009-01-26 11:33:16 +00:00
# include "ED_anim_api.h"
2008-12-12 18:47:12 +00:00
# include "ED_screen.h"
2008-12-19 12:48:30 +00:00
# include "ED_types.h"
2008-12-12 18:47:12 +00:00
# include "ED_util.h"
# include "WM_api.h"
# include "WM_types.h"
# include "BIF_gl.h"
# include "BIF_glutil.h"
# include "UI_interface.h"
# include "UI_resources.h"
# include "UI_view2d.h"
2009-02-03 12:04:05 +00:00
# include "graph_intern.h"
2008-12-12 18:47:12 +00:00
Animato/2.5 - Graph Editor (i.e. the new 'IPO Editor')
This commit brings back the drawing code for the 'Graph Editor'. I've decided to call it this, as currently it can show either F-Curves for Animation stored in Actions, or F-Curves for Drivers.
Currently, it shows all curves, since some of the necessary filtering code (i.e. for limiting curve visibility) hasn't been put in place yet. At least this serves as good proof that we can have F-Curves from multiple sources at least.
It should be noted that the code still has to be modified to work with some of the new Animato features, such as F-Curve Modifiers (cycles are an example of one of the features that use this). Also, a nicer way to set the colours of the curves needs to be investigated.
Notes:
* Fixed a few bugs in RNA User-Preferences wrapping
* The keyframe drawing uses the new-style drawing for handles from AnimSys2. There's a minor bug that sometimes occurs, where a distorted handle gets drawn at the origin of the grid on the first run. Hints anyone?
* Removed most of the old data from SpaceIpo struct, as the new code uses that. Maybe later, the directories/files at least should get renamed.
* Removed ancient hack for NVidia/TNT drivers. It is probably no longer needed, but could be restored if someone needs it.
2009-01-26 11:33:16 +00:00
/* ********************************************************* */
/* Menu Defines... */
/* button events */
enum {
B_REDR = 0 ,
2009-02-22 09:30:18 +00:00
B_MODECHANGE ,
Animato/2.5 - Graph Editor (i.e. the new 'IPO Editor')
This commit brings back the drawing code for the 'Graph Editor'. I've decided to call it this, as currently it can show either F-Curves for Animation stored in Actions, or F-Curves for Drivers.
Currently, it shows all curves, since some of the necessary filtering code (i.e. for limiting curve visibility) hasn't been put in place yet. At least this serves as good proof that we can have F-Curves from multiple sources at least.
It should be noted that the code still has to be modified to work with some of the new Animato features, such as F-Curve Modifiers (cycles are an example of one of the features that use this). Also, a nicer way to set the colours of the curves needs to be investigated.
Notes:
* Fixed a few bugs in RNA User-Preferences wrapping
* The keyframe drawing uses the new-style drawing for handles from AnimSys2. There's a minor bug that sometimes occurs, where a distorted handle gets drawn at the origin of the grid on the first run. Hints anyone?
* Removed most of the old data from SpaceIpo struct, as the new code uses that. Maybe later, the directories/files at least should get renamed.
* Removed ancient hack for NVidia/TNT drivers. It is probably no longer needed, but could be restored if someone needs it.
2009-01-26 11:33:16 +00:00
B_GRAPHCOPYKEYS ,
B_GRAPHPASTEKEYS ,
} eActHeader_ButEvents ;
2008-12-12 18:47:12 +00:00
/* ************************ header area region *********************** */
static void do_viewmenu ( bContext * C , void * arg , int event )
{
2009-01-28 03:22:37 +00:00
SpaceIpo * sipo = ( SpaceIpo * ) CTX_wm_space_data ( C ) ;
2008-12-12 18:47:12 +00:00
2009-01-28 03:22:37 +00:00
switch ( event ) {
case 1 : /* Show time/frames */
sipo - > flag ^ = SIPO_DRAWTIME ;
break ;
case 2 : /* AutoMerge Keyframes */
sipo - > flag ^ = SIPO_NOTRANSKEYCULL ;
break ;
case 3 : /* Show/Hide handles */
sipo - > flag ^ = SIPO_NOHANDLES ;
break ;
case 4 : /* Show current frame number beside indicator */
sipo - > flag ^ = SIPO_NODRAWCFRANUM ;
break ;
}
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 * graph_viewmenu ( bContext * C , ARegion * ar , void * arg_unused )
2008-12-12 18:47:12 +00:00
{
2008-12-18 02:56:48 +00:00
ScrArea * curarea = CTX_wm_area ( C ) ;
2009-01-28 03:22:37 +00:00
SpaceIpo * sipo = ( SpaceIpo * ) CTX_wm_space_data ( C ) ;
2008-12-12 18:47:12 +00:00
uiBlock * block ;
short yco = 0 , menuwidth = 120 ;
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
block = uiBeginBlock ( C , ar , " graph_viewmenu " , UI_EMBOSSP , UI_HELV ) ;
2008-12-12 18:47:12 +00:00
uiBlockSetButmFunc ( block , do_viewmenu , NULL ) ;
2009-01-28 03:22:37 +00:00
// XXX these options should use new menu-options
if ( sipo - > flag & SIPO_DRAWTIME ) {
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 ,
" Show Frames|Ctrl T " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 1 , " " ) ;
}
else {
uiDefIconTextBut ( block , BUTM , 1 , ICON_BLANK1 ,
" Show Seconds|Ctrl T " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 1 , " " ) ;
}
uiDefIconTextBut ( block , BUTM , 1 , ( sipo - > flag & SIPO_NOTRANSKEYCULL ) ? ICON_CHECKBOX_DEHLT : ICON_CHECKBOX_HLT ,
" AutoMerge Keyframes| " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 2 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ( sipo - > flag & SIPO_NOHANDLES ) ? ICON_CHECKBOX_DEHLT : ICON_CHECKBOX_HLT ,
" Show Handles|Ctrl H " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 3 , " " ) ;
uiDefIconTextBut ( block , BUTM , 1 , ( sipo - > flag & SIPO_NODRAWCFRANUM ) ? ICON_CHECKBOX_DEHLT : ICON_CHECKBOX_HLT ,
" Show Current Frame Number| " , 0 , yco - = 20 , menuwidth , 19 , NULL , 0.0 , 0.0 , 1 , 4 , " " ) ;
2008-12-12 18:47:12 +00:00
2009-01-28 03:22:37 +00:00
if ( curarea - > headertype = = HEADERTOP ) {
2008-12-12 18:47:12 +00:00
uiBlockSetDirection ( block , UI_DOWN ) ;
}
else {
uiBlockSetDirection ( block , UI_TOP ) ;
uiBlockFlipOrder ( block ) ;
}
uiTextBoundsBlock ( block , 50 ) ;
uiEndBlock ( C , block ) ;
return block ;
}
Animato/2.5 - Graph Editor (i.e. the new 'IPO Editor')
This commit brings back the drawing code for the 'Graph Editor'. I've decided to call it this, as currently it can show either F-Curves for Animation stored in Actions, or F-Curves for Drivers.
Currently, it shows all curves, since some of the necessary filtering code (i.e. for limiting curve visibility) hasn't been put in place yet. At least this serves as good proof that we can have F-Curves from multiple sources at least.
It should be noted that the code still has to be modified to work with some of the new Animato features, such as F-Curve Modifiers (cycles are an example of one of the features that use this). Also, a nicer way to set the colours of the curves needs to be investigated.
Notes:
* Fixed a few bugs in RNA User-Preferences wrapping
* The keyframe drawing uses the new-style drawing for handles from AnimSys2. There's a minor bug that sometimes occurs, where a distorted handle gets drawn at the origin of the grid on the first run. Hints anyone?
* Removed most of the old data from SpaceIpo struct, as the new code uses that. Maybe later, the directories/files at least should get renamed.
* Removed ancient hack for NVidia/TNT drivers. It is probably no longer needed, but could be restored if someone needs it.
2009-01-26 11:33:16 +00:00
static void do_graph_buttons ( bContext * C , void * arg , int event )
2008-12-12 18:47:12 +00:00
{
Animato/2.5 - Graph Editor (i.e. the new 'IPO Editor')
This commit brings back the drawing code for the 'Graph Editor'. I've decided to call it this, as currently it can show either F-Curves for Animation stored in Actions, or F-Curves for Drivers.
Currently, it shows all curves, since some of the necessary filtering code (i.e. for limiting curve visibility) hasn't been put in place yet. At least this serves as good proof that we can have F-Curves from multiple sources at least.
It should be noted that the code still has to be modified to work with some of the new Animato features, such as F-Curve Modifiers (cycles are an example of one of the features that use this). Also, a nicer way to set the colours of the curves needs to be investigated.
Notes:
* Fixed a few bugs in RNA User-Preferences wrapping
* The keyframe drawing uses the new-style drawing for handles from AnimSys2. There's a minor bug that sometimes occurs, where a distorted handle gets drawn at the origin of the grid on the first run. Hints anyone?
* Removed most of the old data from SpaceIpo struct, as the new code uses that. Maybe later, the directories/files at least should get renamed.
* Removed ancient hack for NVidia/TNT drivers. It is probably no longer needed, but could be restored if someone needs it.
2009-01-26 11:33:16 +00:00
switch ( event ) {
2009-02-22 09:30:18 +00:00
case B_MODECHANGE : /* change mode with mode selector */
ED_area_tag_refresh ( CTX_wm_area ( C ) ) ;
/* no break, as we need redraw flush too... */
Animato/2.5 - Graph Editor (i.e. the new 'IPO Editor')
This commit brings back the drawing code for the 'Graph Editor'. I've decided to call it this, as currently it can show either F-Curves for Animation stored in Actions, or F-Curves for Drivers.
Currently, it shows all curves, since some of the necessary filtering code (i.e. for limiting curve visibility) hasn't been put in place yet. At least this serves as good proof that we can have F-Curves from multiple sources at least.
It should be noted that the code still has to be modified to work with some of the new Animato features, such as F-Curve Modifiers (cycles are an example of one of the features that use this). Also, a nicer way to set the colours of the curves needs to be investigated.
Notes:
* Fixed a few bugs in RNA User-Preferences wrapping
* The keyframe drawing uses the new-style drawing for handles from AnimSys2. There's a minor bug that sometimes occurs, where a distorted handle gets drawn at the origin of the grid on the first run. Hints anyone?
* Removed most of the old data from SpaceIpo struct, as the new code uses that. Maybe later, the directories/files at least should get renamed.
* Removed ancient hack for NVidia/TNT drivers. It is probably no longer needed, but could be restored if someone needs it.
2009-01-26 11:33:16 +00:00
case B_REDR :
ED_area_tag_redraw ( CTX_wm_area ( C ) ) ;
break ;
2008-12-14 12:16:55 +00:00
}
2008-12-12 18:47:12 +00:00
}
Animato/2.5 - Graph Editor (i.e. the new 'IPO Editor')
This commit brings back the drawing code for the 'Graph Editor'. I've decided to call it this, as currently it can show either F-Curves for Animation stored in Actions, or F-Curves for Drivers.
Currently, it shows all curves, since some of the necessary filtering code (i.e. for limiting curve visibility) hasn't been put in place yet. At least this serves as good proof that we can have F-Curves from multiple sources at least.
It should be noted that the code still has to be modified to work with some of the new Animato features, such as F-Curve Modifiers (cycles are an example of one of the features that use this). Also, a nicer way to set the colours of the curves needs to be investigated.
Notes:
* Fixed a few bugs in RNA User-Preferences wrapping
* The keyframe drawing uses the new-style drawing for handles from AnimSys2. There's a minor bug that sometimes occurs, where a distorted handle gets drawn at the origin of the grid on the first run. Hints anyone?
* Removed most of the old data from SpaceIpo struct, as the new code uses that. Maybe later, the directories/files at least should get renamed.
* Removed ancient hack for NVidia/TNT drivers. It is probably no longer needed, but could be restored if someone needs it.
2009-01-26 11:33:16 +00:00
void graph_header_buttons ( const bContext * C , ARegion * ar )
2008-12-12 18:47:12 +00:00
{
2008-12-18 02:56:48 +00:00
ScrArea * sa = CTX_wm_area ( C ) ;
Animato/2.5 - Graph Editor (i.e. the new 'IPO Editor')
This commit brings back the drawing code for the 'Graph Editor'. I've decided to call it this, as currently it can show either F-Curves for Animation stored in Actions, or F-Curves for Drivers.
Currently, it shows all curves, since some of the necessary filtering code (i.e. for limiting curve visibility) hasn't been put in place yet. At least this serves as good proof that we can have F-Curves from multiple sources at least.
It should be noted that the code still has to be modified to work with some of the new Animato features, such as F-Curve Modifiers (cycles are an example of one of the features that use this). Also, a nicer way to set the colours of the curves needs to be investigated.
Notes:
* Fixed a few bugs in RNA User-Preferences wrapping
* The keyframe drawing uses the new-style drawing for handles from AnimSys2. There's a minor bug that sometimes occurs, where a distorted handle gets drawn at the origin of the grid on the first run. Hints anyone?
* Removed most of the old data from SpaceIpo struct, as the new code uses that. Maybe later, the directories/files at least should get renamed.
* Removed ancient hack for NVidia/TNT drivers. It is probably no longer needed, but could be restored if someone needs it.
2009-01-26 11:33:16 +00:00
SpaceIpo * sipo = ( SpaceIpo * ) CTX_wm_space_data ( C ) ;
2008-12-12 18:47:12 +00:00
uiBlock * block ;
int xco , yco = 3 ;
block = uiBeginBlock ( C , ar , " header buttons " , UI_EMBOSS , UI_HELV ) ;
Animato/2.5 - Graph Editor (i.e. the new 'IPO Editor')
This commit brings back the drawing code for the 'Graph Editor'. I've decided to call it this, as currently it can show either F-Curves for Animation stored in Actions, or F-Curves for Drivers.
Currently, it shows all curves, since some of the necessary filtering code (i.e. for limiting curve visibility) hasn't been put in place yet. At least this serves as good proof that we can have F-Curves from multiple sources at least.
It should be noted that the code still has to be modified to work with some of the new Animato features, such as F-Curve Modifiers (cycles are an example of one of the features that use this). Also, a nicer way to set the colours of the curves needs to be investigated.
Notes:
* Fixed a few bugs in RNA User-Preferences wrapping
* The keyframe drawing uses the new-style drawing for handles from AnimSys2. There's a minor bug that sometimes occurs, where a distorted handle gets drawn at the origin of the grid on the first run. Hints anyone?
* Removed most of the old data from SpaceIpo struct, as the new code uses that. Maybe later, the directories/files at least should get renamed.
* Removed ancient hack for NVidia/TNT drivers. It is probably no longer needed, but could be restored if someone needs it.
2009-01-26 11:33:16 +00:00
uiBlockSetHandleFunc ( block , do_graph_buttons , NULL ) ;
2008-12-12 18:47:12 +00:00
2008-12-14 12:16:55 +00:00
xco = ED_area_header_standardbuttons ( C , block , yco ) ;
2008-12-12 18:47:12 +00:00
Animato/2.5 - Graph Editor (i.e. the new 'IPO Editor')
This commit brings back the drawing code for the 'Graph Editor'. I've decided to call it this, as currently it can show either F-Curves for Animation stored in Actions, or F-Curves for Drivers.
Currently, it shows all curves, since some of the necessary filtering code (i.e. for limiting curve visibility) hasn't been put in place yet. At least this serves as good proof that we can have F-Curves from multiple sources at least.
It should be noted that the code still has to be modified to work with some of the new Animato features, such as F-Curve Modifiers (cycles are an example of one of the features that use this). Also, a nicer way to set the colours of the curves needs to be investigated.
Notes:
* Fixed a few bugs in RNA User-Preferences wrapping
* The keyframe drawing uses the new-style drawing for handles from AnimSys2. There's a minor bug that sometimes occurs, where a distorted handle gets drawn at the origin of the grid on the first run. Hints anyone?
* Removed most of the old data from SpaceIpo struct, as the new code uses that. Maybe later, the directories/files at least should get renamed.
* Removed ancient hack for NVidia/TNT drivers. It is probably no longer needed, but could be restored if someone needs it.
2009-01-26 11:33:16 +00:00
if ( ( sa - > flag & HEADER_NO_PULLDOWN ) = = 0 ) {
2008-12-12 18:47:12 +00:00
int xmax ;
/* pull down menus */
uiBlockSetEmboss ( block , UI_EMBOSSP ) ;
xmax = GetButStringLength ( " View " ) ;
2009-01-28 03:22:37 +00:00
uiDefPulldownBut ( block , graph_viewmenu , CTX_wm_area ( C ) ,
2008-12-12 18:47:12 +00:00
" View " , xco , yco - 2 , xmax - 3 , 24 , " " ) ;
Animato/2.5 - Graph Editor (i.e. the new 'IPO Editor')
This commit brings back the drawing code for the 'Graph Editor'. I've decided to call it this, as currently it can show either F-Curves for Animation stored in Actions, or F-Curves for Drivers.
Currently, it shows all curves, since some of the necessary filtering code (i.e. for limiting curve visibility) hasn't been put in place yet. At least this serves as good proof that we can have F-Curves from multiple sources at least.
It should be noted that the code still has to be modified to work with some of the new Animato features, such as F-Curve Modifiers (cycles are an example of one of the features that use this). Also, a nicer way to set the colours of the curves needs to be investigated.
Notes:
* Fixed a few bugs in RNA User-Preferences wrapping
* The keyframe drawing uses the new-style drawing for handles from AnimSys2. There's a minor bug that sometimes occurs, where a distorted handle gets drawn at the origin of the grid on the first run. Hints anyone?
* Removed most of the old data from SpaceIpo struct, as the new code uses that. Maybe later, the directories/files at least should get renamed.
* Removed ancient hack for NVidia/TNT drivers. It is probably no longer needed, but could be restored if someone needs it.
2009-01-26 11:33:16 +00:00
xco + = xmax ;
2008-12-12 18:47:12 +00:00
}
uiBlockSetEmboss ( block , UI_EMBOSS ) ;
Animato/2.5 - Graph Editor (i.e. the new 'IPO Editor')
This commit brings back the drawing code for the 'Graph Editor'. I've decided to call it this, as currently it can show either F-Curves for Animation stored in Actions, or F-Curves for Drivers.
Currently, it shows all curves, since some of the necessary filtering code (i.e. for limiting curve visibility) hasn't been put in place yet. At least this serves as good proof that we can have F-Curves from multiple sources at least.
It should be noted that the code still has to be modified to work with some of the new Animato features, such as F-Curve Modifiers (cycles are an example of one of the features that use this). Also, a nicer way to set the colours of the curves needs to be investigated.
Notes:
* Fixed a few bugs in RNA User-Preferences wrapping
* The keyframe drawing uses the new-style drawing for handles from AnimSys2. There's a minor bug that sometimes occurs, where a distorted handle gets drawn at the origin of the grid on the first run. Hints anyone?
* Removed most of the old data from SpaceIpo struct, as the new code uses that. Maybe later, the directories/files at least should get renamed.
* Removed ancient hack for NVidia/TNT drivers. It is probably no longer needed, but could be restored if someone needs it.
2009-01-26 11:33:16 +00:00
/* mode selector */
2009-02-22 09:30:18 +00:00
uiDefButS ( block , MENU , B_MODECHANGE ,
Animato/2.5 - Graph Editor (i.e. the new 'IPO Editor')
This commit brings back the drawing code for the 'Graph Editor'. I've decided to call it this, as currently it can show either F-Curves for Animation stored in Actions, or F-Curves for Drivers.
Currently, it shows all curves, since some of the necessary filtering code (i.e. for limiting curve visibility) hasn't been put in place yet. At least this serves as good proof that we can have F-Curves from multiple sources at least.
It should be noted that the code still has to be modified to work with some of the new Animato features, such as F-Curve Modifiers (cycles are an example of one of the features that use this). Also, a nicer way to set the colours of the curves needs to be investigated.
Notes:
* Fixed a few bugs in RNA User-Preferences wrapping
* The keyframe drawing uses the new-style drawing for handles from AnimSys2. There's a minor bug that sometimes occurs, where a distorted handle gets drawn at the origin of the grid on the first run. Hints anyone?
* Removed most of the old data from SpaceIpo struct, as the new code uses that. Maybe later, the directories/files at least should get renamed.
* Removed ancient hack for NVidia/TNT drivers. It is probably no longer needed, but could be restored if someone needs it.
2009-01-26 11:33:16 +00:00
" Editor Mode %t|F-Curve Editor %x0|Drivers %x1 " ,
2009-01-28 03:22:37 +00:00
xco , yco , 110 , YIC , & sipo - > mode , 0 , 1 , 0 , 0 ,
Animato/2.5 - Graph Editor (i.e. the new 'IPO Editor')
This commit brings back the drawing code for the 'Graph Editor'. I've decided to call it this, as currently it can show either F-Curves for Animation stored in Actions, or F-Curves for Drivers.
Currently, it shows all curves, since some of the necessary filtering code (i.e. for limiting curve visibility) hasn't been put in place yet. At least this serves as good proof that we can have F-Curves from multiple sources at least.
It should be noted that the code still has to be modified to work with some of the new Animato features, such as F-Curve Modifiers (cycles are an example of one of the features that use this). Also, a nicer way to set the colours of the curves needs to be investigated.
Notes:
* Fixed a few bugs in RNA User-Preferences wrapping
* The keyframe drawing uses the new-style drawing for handles from AnimSys2. There's a minor bug that sometimes occurs, where a distorted handle gets drawn at the origin of the grid on the first run. Hints anyone?
* Removed most of the old data from SpaceIpo struct, as the new code uses that. Maybe later, the directories/files at least should get renamed.
* Removed ancient hack for NVidia/TNT drivers. It is probably no longer needed, but could be restored if someone needs it.
2009-01-26 11:33:16 +00:00
" Editing modes for this editor " ) ;
2009-01-26 23:18:27 +00:00
xco + = 120 ;
Animato/2.5 - Graph Editor (i.e. the new 'IPO Editor')
This commit brings back the drawing code for the 'Graph Editor'. I've decided to call it this, as currently it can show either F-Curves for Animation stored in Actions, or F-Curves for Drivers.
Currently, it shows all curves, since some of the necessary filtering code (i.e. for limiting curve visibility) hasn't been put in place yet. At least this serves as good proof that we can have F-Curves from multiple sources at least.
It should be noted that the code still has to be modified to work with some of the new Animato features, such as F-Curve Modifiers (cycles are an example of one of the features that use this). Also, a nicer way to set the colours of the curves needs to be investigated.
Notes:
* Fixed a few bugs in RNA User-Preferences wrapping
* The keyframe drawing uses the new-style drawing for handles from AnimSys2. There's a minor bug that sometimes occurs, where a distorted handle gets drawn at the origin of the grid on the first run. Hints anyone?
* Removed most of the old data from SpaceIpo struct, as the new code uses that. Maybe later, the directories/files at least should get renamed.
* Removed ancient hack for NVidia/TNT drivers. It is probably no longer needed, but could be restored if someone needs it.
2009-01-26 11:33:16 +00:00
2009-01-28 03:22:37 +00:00
/* filtering buttons */
if ( sipo - > ads ) {
//uiBlockBeginAlign(block);
uiDefIconButBitI ( block , TOG , ADS_FILTER_ONLYSEL , B_REDR , ICON_RESTRICT_SELECT_OFF , ( short ) ( xco + = XIC ) , yco , XIC , YIC , & ( sipo - > ads - > filterflag ) , 0 , 0 , 0 , 0 , " Only display selected Objects " ) ;
//uiBlockEndAlign(block);
xco + = 5 ;
uiBlockBeginAlign ( block ) ;
2009-02-18 05:54:37 +00:00
uiDefIconButBitI ( block , TOGN , ADS_FILTER_NOSCE , B_REDR , ICON_SCENE_DATA , ( short ) ( xco + = XIC ) , yco , XIC , YIC , & ( sipo - > ads - > filterflag ) , 0 , 0 , 0 , 0 , " Display Scene Animation " ) ;
uiDefIconButBitI ( block , TOGN , ADS_FILTER_NOWOR , B_REDR , ICON_WORLD_DATA , ( short ) ( xco + = XIC ) , yco , XIC , YIC , & ( sipo - > ads - > filterflag ) , 0 , 0 , 0 , 0 , " Display World Animation " ) ;
uiDefIconButBitI ( block , TOGN , ADS_FILTER_NOSHAPEKEYS , B_REDR , ICON_SHAPEKEY_DATA , ( short ) ( xco + = XIC ) , yco , XIC , YIC , & ( sipo - > ads - > filterflag ) , 0 , 0 , 0 , 0 , " Display ShapeKeys " ) ;
uiDefIconButBitI ( block , TOGN , ADS_FILTER_NOMAT , B_REDR , ICON_MATERIAL_DATA , ( short ) ( xco + = XIC ) , yco , XIC , YIC , & ( sipo - > ads - > filterflag ) , 0 , 0 , 0 , 0 , " Display Materials " ) ;
uiDefIconButBitI ( block , TOGN , ADS_FILTER_NOLAM , B_REDR , ICON_LAMP_DATA , ( short ) ( xco + = XIC ) , yco , XIC , YIC , & ( sipo - > ads - > filterflag ) , 0 , 0 , 0 , 0 , " Display Lamps " ) ;
uiDefIconButBitI ( block , TOGN , ADS_FILTER_NOCAM , B_REDR , ICON_CAMERA_DATA , ( short ) ( xco + = XIC ) , yco , XIC , YIC , & ( sipo - > ads - > filterflag ) , 0 , 0 , 0 , 0 , " Display Cameras " ) ;
uiDefIconButBitI ( block , TOGN , ADS_FILTER_NOCUR , B_REDR , ICON_CURVE_DATA , ( short ) ( xco + = XIC ) , yco , XIC , YIC , & ( sipo - > ads - > filterflag ) , 0 , 0 , 0 , 0 , " Display Curves " ) ;
2009-01-28 03:22:37 +00:00
uiBlockEndAlign ( block ) ;
xco + = 30 ;
}
else {
// XXX this case shouldn't happen at all... for now, just pad out same amount of space
xco + = 6 * XIC + 35 ;
}
/* copy + paste */
uiBlockBeginAlign ( block ) ;
uiDefIconBut ( block , BUT , B_GRAPHCOPYKEYS , ICON_COPYDOWN , xco , yco , XIC , YIC , 0 , 0 , 0 , 0 , 0 , " Copies the selected keyframes from the selected channel(s) to the buffer " ) ;
uiDefIconBut ( block , BUT , B_GRAPHPASTEKEYS , ICON_PASTEDOWN , xco + = XIC , yco , XIC , YIC , 0 , 0 , 0 , 0 , 0 , " Pastes the keyframes from the buffer " ) ;
uiBlockEndAlign ( block ) ;
xco + = ( XIC + 8 ) ;
/* auto-snap selector */
if ( sipo - > flag & SIPO_DRAWTIME ) {
uiDefButS ( block , MENU , B_REDR ,
" Auto-Snap Keyframes %t|No Time-Snap %x0|Nearest Second %x2|Nearest Marker %x3 " ,
xco , yco , 90 , YIC , & sipo - > autosnap , 0 , 1 , 0 , 0 ,
" Auto-snapping mode for keyframe times when transforming " ) ;
}
else {
uiDefButS ( block , MENU , B_REDR ,
" Auto-Snap Keyframes %t|No Time-Snap %x0|Nearest Frame %x2|Nearest Marker %x3 " ,
xco , yco , 90 , YIC , & sipo - > autosnap , 0 , 1 , 0 , 0 ,
" Auto-snapping mode for keyframe times when transforming " ) ;
}
2008-12-12 18:47:12 +00:00
/* always as last */
2009-01-29 10:19:43 +00:00
UI_view2d_totRect_set ( & ar - > v2d , xco + XIC + 80 , ( int ) ( ar - > v2d . tot . ymax - ar - > v2d . tot . ymin ) ) ;
2008-12-12 18:47:12 +00:00
uiEndBlock ( C , block ) ;
2008-12-26 13:11:04 +00:00
uiDrawBlock ( C , block ) ;
2008-12-12 18:47:12 +00:00
}