Age | Commit message (Collapse) | Author |
|
Timers: added extra 'event type' argument to call to add a timer:
WM_event_add_window_timer(win, event_type, interval)
This way other timer systems don't generate overhead on the queues.
(button timers were creating unused animation-playback operators)
|
|
* API and usage is basically the same still.
* Panels were moved to region level. I first thought of keeping them at area
level, but having them at region level it's simpler to handle events and do
drawing, and also to integrate with view2d. They can still become area level
overlapping regions, if we make a floating (or docked) region that can
contain panels.
* Added back a few panels from the scene buttons for testing.
Issues still:
* The view2d handling and alignment refresh of panels is not correct yet in the
buttons window.
* I did not yet bring back the block handlers system. It was basically a system
that stored which panel was open and where the events for that panel would go.
Just a few functions, but not sure how it fits in 2.5.
* There was a case where dragging panels would not properly remove the window
level handler, but could not redo anymore even though I don't think I fixed
it.
* Some text in the panels goes past the end of the button, that is due to the
checkmark button drawing, not related to this commit.
Other UI code changes:
* Renamed interface.h to interface_intern.h for consistency.
* Fixed some issues with freeing of blocks when they changed due to context.
* uiDrawBlock now takes a context pointer (mostly for block drawextra).
|
|
Operator calls: extended WM_operator_name_call() with options whether to
call the exec() (operate immediate) or invoke() (check user input) entry.
This will allow python to use it more efficiently, but also solves the
dreaded pulldown case that showed another menu for confirmation.
New names to learn: :)
WM_OP_EXEC_DEFAULT
WM_OP_INVOKE_DEFAULT
on todo still: allow hotkey definitions to do same.
|
|
New priorities for most libs, at least core. This is still for Blender proper, BGE and such still to come.
|
|
Blender builds and links on Linux. For now without BGE and its player,
but that will come. Priorities are still a mess, so expect more commits
soon.
|
|
Better implementation of own window timers, not using ghost.
That makes blender's WM nice in control, and gives callers
of timers the opportunitie to evaluate time passed since
previous step. This system also only generates one timer
event per main loop (events - handlers - notifiers - draw)
Small fix: allow keymap modifier to give KM_ANY to ignore
modifier keys, this to have TIMER keymap work.
|
|
Brought back basics for Action Editor header. The contents of the menus have yet to come, but at least now the Action Editor 'looks' functional.
Fixed mistake in previous commit for TimeLine header (button collision).
|
|
* Action Editor - IPO curve names are shown properly again. Added anim_ipo_utils.c (old editipo_lib.c) file back. This will need to be removed when I port IPO system to RNA.
* Keyframing code - uncommented more of the code that's now working
* Made the 'preview range' button on timeline header draw more clearly
|
|
Small area/space api fix: space->new() callbacks now require
Context pointer. Too many cases you want to initialize stuff...
Also: added dummy draw function for NLA channel region, was
too ugly.
|
|
Cleanup
- for portablity we can keep the old ugly defines for retrieving
active object, cfra and so on. But, they will use 'scene' not
G.scene.
- fixed code that uses those defines.
- some unused variables/functions removed
|
|
Also, added note in playback code that it needs to use preview-range settings not global frame range (I'm leaving this as-is for now, since it's still likely to change).
|
|
Animated screen! (unfinished, now only draws, no animation code yet).
Fun though to see it all work. :)
NOTE: Mac ghost has timer bug, the GHOST_ProcessEvents() doesnt wake
up for timers.
NOTE2: Added while loop in wm_window_process_events() to force Ghost
giving all events to Blender. Timers otherwise don't accumulate...
might be needed to fix in ghost too.
I tend to think to code own timer, this ghost stuff is totally different
per platform.
|
|
with the relevant keyframes...
I still need to work out how to get this to work correctly as soon as an Action Editor instance is created.
|
|
Moved time_ops.c contents to anim_ops.c, as the operators there are applicable to all other Animation Editors too. anim_ops.c will therefore contain all operators which will apply to all Animation Editors (i.e. change frame, frames/seconds display toggle, and soon Preview Range tools).
As such, added new global 'Animation' keymap like for View2D and Markers, which will ensure that these tools can be accessed in an uniform way across editors.
Note that the order that these things are added is important, as the Animation ones will often 'steal' events from the View2D and Markers ones if placed before the others. To prevent that, we'd need to be able to set boundboxes here...
|
|
* Added new 'Animation' submodule under Editors. This will be used to house all code + features that are used by many different Animation Editors (Action/Dopesheet and IPO) as well as other parts of Blender.
* Added back some of the core code need by the Action/Dopesheet editor, which will also be used by IPO Editor.
* Brought back file for keyframing management code (i.e. keyframing.c), but there's still quite a lot of missing stuff that I'll need to restore, so in the meantime, it's #if 0'd out.
* Moved markers code to this new module (I'm not sure whether SVN will recognise this change, as TortoiseSVN doesn't seem to have any obvious copy/move commands)
|
|
Compile fix; MAXFLOAT is not defined uniformly on platforms.
Note for the coders:
ED_types.h: has editor wide defines and structs
ED_util.h: has editor wide functions
Both includes also are containing old cruft to get things
to compile (and work), for later cleanup.
|
|
Context API
This adds the context API as described here. The main practical change
now is that C is not longer directly accessible but has to be accessed
through accessor functions. This basically adds the implementation of
the API and adaption of existing code with some minor changes. The next
task of course is to actually use this design to cleanup of bad level
calls and global access, in blenkernel, blenloader.
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/Context
Error, Warning and Debug Info Reporting
This adds the error reporting API as described here. It should help
clean up error() calls in non-ui code, but eventually can become used
for gathering messages for a console window, and throwing exceptions
in python scripts when an error happens executing something.
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/Reports
|
|
- Made a nice generic 'OK confirm' implementation for operators.
Just use in operator type definition this line:
ot->invoke= WM_operator_confirm;
It will autmatically use operator name for asking OK. It will
also use properties (if set before).
Note for Brecht: the test okee_operator() you coded could better not
be used in operators themselves.
In future we can also add menus that get automatically generated
based on operator properties. Like 'add constraint' showing the
constraint types.
- Added this confirm call for most of the keys you'd expect it for.
(user settings, delete marker, rip area, split region, etc).
- Cleanup: moved ed_markers.c to the util/ directory, it doesnt belong
in space_time. Also made separate function for the marker keymap
definition.
- removed ancient redraw notifier from ghost event level (every key
press gave full screen draw)
|
|
Now, preset view configurations are only to be used if they define all (scrollers not included) relevant settings for the view they are set for. This should be less confusing than in the previous situation with V2D_COMMONVIEW_TIMELINE stuff.
One implication of this though, is that all Animation Editors (for example), will have to define their own version of the relatively commonly shared info. However, given the great diversity in the range of settings each have, this should not be too much of an issue.
Also, added a 'standard' view config for main 'window' regions. At this stage, it is recommended that this view config should be used only as a placeholder template on which a set of custom settings could be based. I've put it into use for the buttons window/scripts window/info window so far.
|
|
More notifier and redraw cleanup
- notifiers are not filtered anymore, apart from window/screen notifiers,
they get to all regions.
- fixed drawing of 'action zones' in areas.
- added support for basic multilayer draw, like for action zones now,
and future other area decorations (tabs, region handlers)
check: ED_area_overdraw_flush()
ED_area_overdraw()
- bugfix in UI redraw tags, it was calling region pointer in free'd
data
- added notifier for marker-changed
- added keymap for markers to ipo window
|
|
More notifier cleanup;
- removed view2d sync notifier, its data operations are too complex
for UI hints/notes, direct calls work too :)
- updated missing gpl header in region file
Noticed weird delay on menu refreshing now... will check.
|
|
Work on getting notifiers in shape.
- Most important: local (to own region or area) redraw notifiers
have been depricated. This is not a good or correct notifier anyway.
Notifiers should be signals to other areas.
- Instead use these 2 functions:
ED_area_tag_redraw(area);
ED_region_tag_redraw(region);
It seems to me good convention to keep the area/region redraw tag
itself protected everywhere, for future improvements.
- Also added a basic WM function that checks overlapping regions,
and flushes redraws to underlying regions. This makes menus and
buttons allow to only send local region redraws.
(Brought back two "swapbuffer indicators" to test this.
- Todo: area 'action zone' redraws, and fixing other notifiers...
sending data pointers in a notifier seems to be bad idea.
|
|
Improved the View2D API so that initialising View2D data in init() callbacks (called on new regions and also on resizing regions) for regions is easier.
Added a few preset view configurations for use when initialising new views. Views with the V2D_IS_INITIALISED flag set will not be reinitialised in the init() callbacks. Currently, some of these configurations will set/override all settings (like V2D_COMMONVIEW_LIST and V2D_COMMONVIEW_HEADER), while other ones serve a more supplimentary role (i.e. V2D_COMMONVIEW_TIMELINE only sets the x-axis settings, relying on the region to have already set the relevant y-axis settings).
The future of such supplimentary configurations is yet to be seen, as I'm currently not sure whether they will cause the code to become too confusing, as you'd have to keep track of which settings belong/are set where. So far, only a few areas have been ported to use this. Tomorrow I'll check on a few more.
As this commit touches a lot of files, hopefully there aren't any critical bugs I've missed here.
|
|
operators. RNA property buttons will automatically fill in the label, min/max,
etc if they are not specified. Operator menu buttons will look up the key
combination in the handlers and add it automatically.
uiDefButR, uiDefIconButR, uiDefIconTextButR
uiDefButO, uiDefIconButO, uiDefIconTextButO
uiDefButO takes a context pointer to do the key lookup, don't really like this..
|
|
which context to run the operator: WM_OP_DEFAULT, WM_OP_REGION_WIN,
WM_OP_AREA or WM_OP_SCREEN. This also replaces WM_operator_call_rwin
since it is more general.
This is useful for buttons and popup menus to run operators, and also
used by a new function to lookup the keymap item for that operator in
the right context.
|
|
Added notifiers for timeline syncing. Works for Timeline window
only now.
Note that I've removed the malloc-free in a Notifier... notifier
system is still under probabtion :)
|
|
- depricated area "headbutofs" and "headbutlen", which is now fully
replaced with view2d handling.
- needed to add header default V2D_ALIGN_NO_NEG_Y, V2D_LOCKOFS_Y seems
to not do anything atm :)
- new: running blender in debug (blender -d) will print the current
handler and operator in use (not mousemove)
|
|
I've gone through and simplified some of the redundant options while documenting the various settings (in the code and also in the Wiki Doc), to make it clearer how to use each option.
'Preset' view-types have yet to be fully implemented, but started groundwork for this. Only some commonly used view configurations will be defined using this method. For all others, they still need to define all relavent view settings themselves (as there's too much variation in terms of the various editor's use of View2D).
IPO Editor now draws with channels on the left, like all other anim editors. Now, how to make this wider...
|
|
- Added file space (too) :) Andrea was first, this is more
complete.
- Suggestion from Joshua: move all standard header buttons to
1 function, makes it all easier, less code, and less area/space
stuff needs to be exposed.
|
|
* Headers were twitching when moved again due to a hack I had made for the TimeLine
* Properly fixed TimeLine init so that grid will start in the right place.
|
|
* Scrollers now draw using nice rounded+shaded style everywhere
* When scrollers 'bubble' completely fills a scroller or is completely out of view, the view zooming using the handles is now only activated if the mouse is within a quarter of the total length of the scroller on either end of the scroller. Otherwise, pan is activated. This should make the scrollers more usable in anim editors.
* Fixed drawing of gridlines in TimeLine - needed to adjust ymin value of cur and tot rects to accomodate for the new mask/cur adjustments as old TimeLines didn't draw with 'real' scrollbars. Also, adjusted min/max values to fit these new tot/cur rect y-sizes.
* Tidying up vars and fixing errors in declaring new View2D types in preparation for simpler method of initialising views...
|
|
* Grid calculation now takes separate args for x/y units and clamping
* Timeline now gets V2D_LOCKZOOM_Y flag to prevent zooming in y-axis
|
|
- Added rudimentary support for Ipo window
(Joshua can check on view2d issues for this? :)
- removed ED_area.h, added ED_space_api.h
|
|
- found fix for time-space view2d when increasing height of area, it has min/max Y zoom stored based on size of area... needs
smarter way.
- outliner: header file added, area switch menu + dummy pulldown.
this will become template for other space types...
|
|
Fixes in view2d:
- mask/slider rects were calculated wrong 1 pixel (was overlapping)
- found bug with outliner stretching on area-edge-dragging. It required
an extra mapping of the 'cur view' via mask to actual region.
- added v2d sanity check for uninitialized v2d's
- removed cruft in do_versions for headers (gets catched with above)
- added header-view2d-initialize function, for new-space calls
Fixes in areamanager:
- fixes in 'new space' for time/outliner/view2d
(unfinished)
For Joshua:
- Making time window higher shows it doesn't update 'cur'. Not sure
what kind of v2d flag should be checked or set?
|
|
Resolved cyclic calls for editors.
Now there's a space_api/ module, here you can use functions calling
other editor modules. The functions in the module are only used by
the WindowManager module to initialize space types.
Note for sconzers and MSVC and cmake: the proper linking order for
editors is:
- space_api
- space_xxx
- object / mesh / transform / etc
- interface
- util / datafiles
- screen
|
|
|
|
Today's progress; half working, but i better commit to prevent
conflicts tomorrow :)
- added storage for regions in spacedata
- added space switching (unfinished, gives mem-free errors)
- bugfix: icon of timewindow gave error on split-area
- cleaned interface_icons.c a bit, no warnings
- first work on space new() callbacks, they have to make regions too
NOTE: probably files saved with 2.5 crash now. Have to look at
patching this.
NOTE2: the Makefiles required libeditor screen twice... scons too?
|
|
TimeLine window pulldowns work sorta (for the options that were coded :)
Still trying to bring back code without recoding uiDefButs. In future these
will get directly operator stuff linked. For time being made a simple
operator call function, like:
WM_operator_call(C, "ED_MARKER_OT_add");
and for forcing operator to run in the main region-window:
WM_operator_call_rwin(C, "ED_MARKER_OT_add");
These calls also work for modal operators, like marker grab in this case.
|
|
Added support for panning headers using View2D of the header regions (only done for TimeLine, as only that one has buttons on it).
Currently, this uses some do_versions magic to initialise the View2D rects required, however, I'm not sure if all the information was safely ported over yet (notably height and position of rects due to alignment issues).
In the process, I noticed a few bugs with the current View2D code:
* UI_view2d_curRect_validate() is now called after UI_view2d_size_update(), as the size of the 'mask' rect is closely related to the size of the 'cur' rect (especially when zooming is locked).
* Fixed a bug in UI_view2d_curRect_validate() which meant that if the 'cur' rect was slightly larger than the 'tot' rect, and keeptot was set, the view would flicker between the two closely related positions.
|
|
* Added context pointer to function callbacks for buttons and blocks.
* Added a uiBlockSetHandleFunc, which will be called with the button
return value. This seems kind of redundant with uiBlockSetButmFunc,
but the latter uses a2 to pass the value.
|
|
- Brought back (most of) buttons in TimeLine window.
They don't work yet though! Waiting for Brecht to commit callbacks
for menus and ui-blocks
- Area headers hilite again when mouse is inside.
|
|
Cleanup in area/region management
- more intelligence in area management for adding handlers and setting
data correct. Space/Region type callbacks only have to do own things.
- added option for adding default handlers to areas/regions. (flag in
type definition)
- ensured that region-types store the minsizes for regions.
- added boundbox check for handlers; note that it accepts pointer to
boundbox, because handlers don't get reset on area-resizing or
view changes. Example: view2d handlers use mask rect.
- handlers get now added on correct context levels (example frame change
also worked in header)
- removed ->refresh() callback. Context refreshing is Listener.
- the ->init() is being called on all WM level actions, also after a
file read, moving areas, re-opening areas etc.
- fixed bug: crash on exit was caused by cleaning up Screen too late.
- UI_view2d_size_update() removed from draw callback, is init()
- regions now store (winx, winy) subwindow size.
|
|
a special UI handler which makes the code clearer. This UI handler is attached
to the region along with other handlers, and also gets a callback when all
handlers for the region are removed to ensure things are properly cleaned up.
This should fix XXX's in the UI code related to events and context switching.
Most of the changes are in interface_handlers.c, which was renamed from
interface_ops.c, to convert operators to the UI handler. UI code notes:
* uiBeginBlock/uiEndBlock/uiFreeBlocks now takes a context argument, this is
required to properly cancel things like timers or tooltips when the region
gets removed.
* UI_add_region_handlers will add the region level UI handlers, to be used
when adding keymap handlers etc. This replaces the UI keymap.
* When the UI code starts a modal interaction (number sliding, text editing,
opening a menu, ..), it will add an UI handler at the window level which
will block events.
Windowmanager changes:
* Added an UI handler next to the existing keymap and operator modal handlers.
It has an event handling and remove callback, and like operator modal handlers
will remember the area and region if it is registered at the window level.
* Removed the MESSAGE event.
* Operator cancel and UI handler remove callbacks now get the
window/area/region restored in the context, like the operator modal and UI
handler event callbacks.
* Regions now receive MOUSEMOVE events for the mouse going outside of the
region. This was already happening for areas, but UI buttons are at the region
level so we need it there.
Issues:
* Tooltips and menus stay open when switching to another window, and button
highlight doesn't work without moving the mouse first when Blender starts up.
I tried using some events like Q_FIRSTTIME, WINTHAW, but those don't seem to
arrive..
* Timeline header buttons seem to be moving one pixel or so sometimes when
interacting with them.
* Seems not due to this commit, but UI and keymap handlers are leaking. It
seems that handlers are being added to regions in all screens, also in regions
of areas that are not visible, but these handlers are not removed. Probably
there should only be handlers in visible regions?
|
|
Area Manager: revised how an area subdivision gets managed. Originally
the 'spacedata' would store regiondata too, but this already became
impractical (like having view2d data in region is useful). So I left
that part how it is. See new diagram:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/AreaManager
This means that regions in an Area define location/size or constraints
for how they get arranged. The "RegionType" which is linked to this
defines its functionality.
For fun, test, and code validation: two temporary hotkeys added.
SKEY: splits current region horizontally
SHIFT+S: splits vertically
Note - in outliner - that "context" sticks to the Area as whole, the region
here only defines view. That's the purpose. :) For two outliners with different
context you open 2 areas.
Also note that dragging screen-edges shows the region-alignment type (split
with percentage).
|
|
still work.
|
|
Part one of wrapping up area/region management.
Read design doc here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/AreaManager
This commit:
- brings keymap storage to WM, based on names/types. This structure
allows rna-ifying it too, so you can browse keymaps etc.
- creating areas and regions works slightly different now, wich
regiontypes stored in areatype.
Todo:
- better callbacks and structure for defining which handlers need to
be added.
- using region types to validate regions
- proper implementation of local region data
- code method for customizing keymaps. Current idea is that you have
to indicate an entire keymap to be custom, to prevent too complicated
merging problems of default and custom maps (like order, multiple keys
for same operator, disabling options, etc).
|
|
added define to use when an argument to these methods is irrelevant.
|
|
* Cleaned up flags defined for View2D, and added some for defining the alignment of the view's data in the 'tot' rect (i.e. which quadrant(s) the view data is allowed to reside in).
* These flags are used in the new UI_view2d_totRect_set() function, which sets the new size of the 'tot' rect (i.e. the maximum viewable area). Currently, is only used for Outliner, but channel-lists also require this.
* Added API method to reset 'cur' (current viewing region) to 'default' viewing region - UI_view2d_curRect_reset(). Currently, 'keepzoom' is not respected. I'll check on whether this is needed when I recode UI_view2d_status_enforce(), which is badly in need of a cleanup.
|
|
* Added back vertical scale markings for vertical scrollbars. Currently untested (until IPO Editor can be put back in). Also, there was a special exception for the Sequencer, which will need to be checked when the time comes too.
* Fixed the display of frame numbers in scrollbars. Was caused by error in using an int, where a float was required (this is one place MSVC gives better warnings than GCC).
* Outliner horizontal scrollbar now displays a more useful range. The previous range was based on screen width, not width of content.
* Outliner horizontal scrollbar now draws with bevel-highlight line again. Was missed out in a previous commit.
* Added simple toggle Frames/Seconds operator to TimeLine to test if the View2D code is working right for this. This uses the same hotkey (TKEY) as it's counterpart (with a menu for input) did in previous incarnations of Blender.
|