Age | Commit message (Collapse) | Author |
|
fixed an issue where sublevel menus did not get right operator
context.
|
|
Changed some of the sequencer menus to use uiMenuItem's
|
|
missing parts and are work in progress.
Set 3D Cursor
Set Tile
Sample Color
New
Open
Replace
Reload
Save (As)
Save Sequence
Pack
Unpack
Record Composite
The file select operators have context issues still. They need
to get the image space in the context on exec() but it's not
there currently, not sure how to solve that yet.
Also added name parameter to uiMenuItemEnumO, and fixed "mute"
argument in ED_update_for_newframe calls in fluidsim bake.
|
|
Bugfix: CTRL+W "Save file" still gave a 'save over' popup when the
file didn't exist yet. It then attempted to free the operator twice.
|
|
still is mirror transform. This commits adds the remaining operators:
* UV mapping operators (U key menu): cube, sphere, cylinder, etc.
* Hide/Show operators.
And solves most XXX's, including:
* Fix bad includes and calls into space image.
* Aspect ratio correction.
* Create UVs if they don't exist yet on unwrap.
* Assign image to UVs.
* Drawing proportional edit circle.
|
|
|
|
Added CTRL+W save Blender file.
It's the first user of the uiPupMenuSaveOver() function,
which I've recoded to accept an operator pointer.
This is required because the operator property 'filename'
has to be set to work. Other 'save over' users will
require running operators too I guess.
|
|
F6 menu "redo last operation" now works, mostly :)
Try it in editmode on add-UV-Sphere, or Subdivide, those work
fine. Transform ops have some feedback issues or so.
This is a temporary commit; brecht will take this further with
nice code (event system doesn't make menus as active region
but sets the original context instead, as stored in ui handler.)
|
|
Border Select
Circle Select
Pin
Select Pinned
Unwrap
Minimize Stretch
Pack Islands
Average Islands Scale
Snap Cursor
Snap Selection
|
|
* Changed uiPupMenuOperator usage to uiPupMenuBegin/End (simpler,
no need to build a string). Also made transform orientation and
subdiv type enums instead of ints for this.
* Added an icon argument to many of the uiMenu calls, and added a
uiMenuItemIntO.
* Move auto rna button creation out of outliner code, now is
uiDefAutoButR for individual buttons and uiDefAutoButsRNA for a
whole block.
* Implemented uiPupBlock(O). Pressing F6 gives a menu with the
properties of the last operator to test. I tried to make a redo
last operator out of this but couldn't get the context correct
for the operator to repeat in. Further the popup block also has
some issues getting closed while editing buttons.
* Fix uiAfterFunc memory leak on Ctrl+Q quit.
* Fix handling of RNA number button dragging and sliding for RNA
buttons with range -inf/inf.
|
|
- removed undefined operators from view3d menu, the error prints
("undefined operator") is currently a real error; later on when
operators are more dynamically defined it can be feature.
- made uiMenuContext() work locally, only on the items as defined
after this call.
|
|
* 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.
|
|
* Automatic shortcut keys in menus now compare operator properties as well.
Implemented IDP_EqualsProperties for this.
* I imagine all these compares may be a bit slow, for this case it's not
so bad though because it only happens for one menu when it is opened.
|
|
Fix: icons didnt show for uiMenu api.
|
|
Simple toolbox-style menu system. Brecht will review it
though, and/or check on way to use it for menus.
I tried to avoid uiBlock and rna stuff all over. :)
Quick image test:
http://www.blender.org/bf/rt.jpg
Examples you can read in:
- editors/screen/screen_ops.c:testing123() (press F5)
- editors/object/object_edit.c:object_add_primitive_invoke()
(press SHIFT+A)
Concept is simple:
uiMenuBegin(): returns a handle.
uiMenuEnd(): puts it all to work.
In between you can add items like:
uiMenuItemVal(): a name, icon, retval (use uiMenuFunc())
uiMenuItemO(): an operator + icon
uiMenuItemEnumO(): an operator, property name, value
Sublevels go easy too:
uiMenuLevel(): creates item for sublevel, with function pointer.
Inside that function you can use all menu calls again.
Levels can go as deep you want.
uiMenuLevelEnumO(): creates operator sublevel for an enum
|
|
- wm draw method is now initialized correct when reading older
files, but the SDNA bug causing the problem is still unsolved.
is due to // char pad[8]; not being recognized as commented.
- triple buffer proxy texture test follows spec better now,
was disabling triple buffer unnecessarily on some drivers.
- some cmake compile fixes related to sequencer pthread usage
and removed bad level calls lib for player.
- show outliner header buttons in oops mode as well until that
can be switched in the UI.
- fix region data free issue for tooltips
- warning fixes
|
|
* Triple Buffer is now more complete:
- Proper handling of window resize, duplicate, etc.
- It now uses 3x3 textures (or less) if the power of two sizes
do not match well. That still has a worst case wast of 23.4%,
but better than 300%.
- It can also use the ARB/NV/EXT_texture_rectangle extension
now, which may be supported on hardware that does not support
ARB_texture_non_power_of_two.
- Gesture, menu and brushe redraws now require no redraws at all
from the area regions. So even on a high poly scene just moving
the paint cursor or opening a menu should be fast.
* Testing can be done by setting the "Window Draw Method" in the
User Preferences in the outliner. "Overlap" is still default,
since "Triple Buffer" has not been tested on computers other than
mine, would like to avoid crashing Blender on startup in case
there is a common bug, but it's ready for testing now.
- For reference "Full" draws the full window each time.
- "Triple Buffer" should work for both swap copy and swap exchange
systems, the latter still need the -E command line option for
"Overlap".
- Resizing and going fullscreen still gives flicker here but no
more than "Full" drawing.
* Partial Redraw was added. ED_region_tag_redraw_partial takes a
rect in window coordinates to define a subarea of the region.
On region draw it will then set glScissor to a smaller area, and
ar->drawrct will always be set to either the partial or full
window rect. The latter can then be used for clipping in the 3D
view or clipping interface drawing. Neither is implemented yet.
|
|
Added WM Jobs manager
- WM can manage threaded jobs for you; just provide a couple
of components to get it work:
- customdata, free callback for it
- timer step, notifier code
- start callback, update callback
- Once started, each job runs an own timer, and will for
every time step check necessary updates, or close the
job when ready.
- No drawing happens in jobs, that's for notifiers!
- Every job stores an owner pointer, and based on this owner
it will prevent multiple jobs to enter the stack.
Instead it will re-use a running job, signal it to stop
and allow caller to re-initialize it even.
- Check new wm_jobs.c for more explanation. Jobs API is still
under construction.
Fun: BLI_addtail(&wm->jobs, steve); :)
Put Node shader previews back using wmJobs
- Preview calculating is now fully threaded (1 thread still)
- Thanks to new event system + notifiers, you can see
previews update even while dragging sliders!
- Currently it only starts when you change a node setting.
Warning: the thread render shares Node data, so don't delete
nodes while it renders! This topic is on the todo to make safe.
Also:
- bug in region initialize (do_versions) showed channel list in
node editor wrong.
- flagged the channel list 'hidden' now, it was really in the
way! This is for later to work on anyway.
- recoded Render API callbacks so it gets handlers passed on,
no globals to use anymore, remember?
- previewrender code gets now so much nicer! Will remove a lot
of stuff from code soon.
|
|
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.
|
|
Python operator api was using WM_operator_name_call() which was confusing things too much.
Added WM_operator_call_py() which ended up being a very small function and split out operator creation into wm_operator_create()
Python operator now runs the poll() function and raises an error if it fails.
Eventually there should be error messages for poll that python can use to give the exact reason for failing (eg - library linked data, no active object...)
|
|
* View2D to region now returns ints instead of shorts.
* Use "Numpad" instead of "Pad" in automatic keymap menu info.
* Menus can now use buttons other than BUTM and SEPR, in
particular TOG and ROW are now supported instead of flipping
bits manually.
* Added a simpler uiDefMenu* api for making menus now, and it
only supports Operator and RNA buttons at the moment, will be
used in next commit. Not sure how this will evolve .. makes
menu code look cleaner anyways.
* Ensure that interface code doesn't crash when getting unknown
Operators and RNA properties, and display their buttons grayed
out in that case.
|
|
Popup menus were tagged with wrong direction, so arrow keys or
scrollwheel didn't work.
|
|
|
|
* errors in python called operators are raised as errors
* Python defined operators errors are reported as errors (not full traceback yet)
* added BKE_reports_string, same as BKE_reports_print but it returns a string rather then printing it.
* WM_operator_name_call optionally takes an initialized report struct
|
|
* Added a report list to operator, to which they can report errors and
warnings. When the operator ends, it will display them with a popup. For
python these should become exceptions when calling operators.
* Added a function to make a popup menu from a report list.
* Also added a utility function to prepend a string before the reports to
indicate what they relates to. Also made the report functions used
BLI_dynstr to simplify the code.
* Made file reading and writing report errors to the user again using this
system, also replacing the left over uncommented bad level error() calls.
|
|
Notifier system upgrade, based on Brecht's doc.
Implementation notes:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers#Implementation
In short: let's try to strictly communicate in a notifier what happened.
The listeners then can act themselves. It also means that a frame-changed
notifier doesn't send out redraws, the editors themselves can decide.
|
|
* 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.
|
|
Fix: popup menus were not freeing operators.
Made a new Popup menu call for this case:
uiPupmenuOperator(C, maxrow, op, propname, menustr);
It will set enum "propname" to the menu item and call operator,
register it optionally and free it. Use it in "invoke" calls.
Next: automatic menu generating for enum properties!
|
|
All of the view3d drawing code is now 'Context' free.
The idea is:
- ED_region_do_draw() sets and freezes drawing context
- regiontype draw() callback then can pass on other relevant
context stuff as function args.
Also cleaned up the WM opengl wrappers, to mimic opengl state;
no reason to give window pointer anymore.
|
|
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
|
|
* Changed pupmenu function name and added back some standard popups.
|
|
* Added support for defining properties for operator buttons, with
uiButGetOperatorPtrRNA. Needed to cleanup a hack that was there
for operator properties in RNA, now a separate OperatorProperties
type is used for storing operator properties, instead of being part
of the Operator type itself.
* Allow selecting menu items with mouse release instead of press again.
* Fix some cases with hanging tooltips in the UI.
|
|
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.
|
|
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.
|
|
and event handling code still, how it integrates with operators and
handlers is not worked out yet. For testing, Ctrl+Q quit now shows
a confirmation popup using the following call:
okee_operator(C, "WM_OT_exit_blender", "Quit Blender");
|
|
Removed notifier SCREEN_CHANGED from creating menus or tooltips.
This one is used to re-initialize spaces, areas, regions in screen.
|
|
* 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.
|
|
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?
|
|
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).
|
|
of the box
|
|
- Tooltips now respect view2d view (rna viewer).
- Bugfix in viewd.c UI_view2d_view_to_region() (typo)
|
|
- Made view2d manipulations redraw on area level
- simplified call to send Notifiers:
WM_event_add_notifier(bContext *C, int type, int value, void *data)
This brings back more control to WM, no context messing within
operators. :) Handlers that execute operators will be responsible
for delivering correct contextes.
In general: should lead to making context not exposed, but only
readable via some callbacks.
|
|
Part 3/3: new icons
- Icon set done by jendrzych! Great job!
- cleaned up unnecessary includes and removed commented out code
- preview icons (for materials, textures,..) don't work yet, have to be ported to new event system
|
|
|
|
This is based on the current trunk version, so these files should not need
merges. There's two things (clipboard and intptr_t) that are missing in 2.50
and commented out with XXX 2.48, these can be enabled again once trunk is
merged into this branch.
Further this is not all interface code, there are many parts commented out:
* interface.c: nearly all button types, missing: links, chartab, keyevent.
* interface_draw.c: almost all code, with some small exceptions.
* interface_ops.c: this replaces ui_do_but and uiDoBlocks with two operators,
making it non-blocking.
* interface_regions: this is a part of interface.c, split off, contains code to
create regions for tooltips, menus, pupmenu (that one is crashing currently),
color chooser, basically regions with buttons which is fairly independent of
core interface code.
* interface_panel.c and interface_icons.c: not ported over, so no panels and
icons yet. Panels should probably become (free floating) regions?
* text.c: (formerly language.c) for drawing text and translation. this works
but is using bad globals still and could be cleaned up.
Header Files:
* ED_datafiles.h now has declarations for datatoc_ files, so those extern
declarations can be #included instead of repeated.
* The user interface code is in UI_interface.h and other UI_* files.
Core:
* The API for creating blocks, buttons, etc is nearly the same still. Blocks
are now created per region instead of per area.
* The code was made non-blocking, which means that any changes and redraws
should be possible while editing a button. That means though that we need
some sort of persistence even though the blender model is to recreate buttons
for each redraw. So when a new block is created, some matching happens to
find out which buttons correspond to buttons in the previously created block,
and for activated buttons some data is then copied over to the new button.
* Added UI_init/UI_init_userdef/UI_exit functions that should initialize code
in this module, instead of multiple function calls in the windowmanager.
* Removed most static/globals from interface.c.
* Removed UIafterfunc_ I don't think it's needed anymore, and not sure how it
would integrate here?
* Currently only full window redraws are used, this should become per region
and maybe per button later.
Operators:
* Events are currently handled through two operators: button activate and menu
handle. Operators may not be the best way to implement this, since there are
currently some issues with events being missed, but they can become a special
handler type instead, this should not be a big change.
* The button activate operator runs as long as a button is active, and will
handle all interaction with that button until the button is not activated
anymore. This means clicking, text editing, number dragging, opening menu
blocks, etc.
* Since this operator has to be non-blocking, the ui_do_but code needed to made
non-blocking. That means variables that were previously on the stack, now
need to be stored away in a struct such that they can be accessed again when
the operator receives more events.
* Additionally the place in the ui_do_but code indicated the state, now that
needs to be set explicit in order to handle the right events in the right
state. So an activated button can be in one of these states: init, highlight,
wait_flash, wait_release, wait_key_event, num_editing, text_editing,
text_selecting, block_open, exit.
* For each button type an ui_apply_but_* function has also been separated out
from ui_do_but. This makes it possible to continuously apply the button as
text is being typed for example, and there is an option in the code to enable
this. Since the code non-blocking and can deal with the button being deleted
even, it should be safe to do this.
* When editing text, dragging numbers, etc, the actual data (but->poin) is not
being edited, since that would mean data is being edited without correct
updates happening, while some other part of blender may be accessing that
data in the meantime. So data values, strings, vectors are written to a
temporary location and only flush in the apply function.
Regions:
* Menus, color chooser, tooltips etc all create screen level regions. Such menu
blocks give a handle to the button that creates it, which will contain the
results of the menu block once a MESSAGE event is received from that menu
block.
* For this type of menu block the coordinates used to be in window space. They
are still created that way and ui_positionblock still works with window
coordinates, but after that the block and buttons are brought back to region
coordinates since these are now contained in a region.
* The flush/overdraw frontbuffer drawing code was removed, the windowmanager
should have enough information with these screen level regions to have full
control over what gets drawn when and to then do correct compositing.
Testing:
* The header in the time space currently has some buttons to test the UI code.
|