Further simplifying making operators with menus;
now you can add an 'invoke' callback:
WM_menu_invoke
which will automatically generate a menu with choices and assign
it to the property 'type'.
What also helps typing is the new RNA_enum_is_equal() function.
Here's a paste of the now committed 'clear parent'. Note the
undo push will become a flag too.
http://pasteall.org/3660
(Brecht; fixed small bug in RNA_enum_is_equal!)
To evaluate: solving dependencies for multipe scenes... probably
will make a more generic flush call.
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!
Commit of WIP code (what code isn't wip, these days ;)
- only drawing code as basis to work further from (and have less conflicts between different systems I work on)
Ported the following tools
* borderselect
* invert selection
Note: while porting these, I noticed a few issues with some stuff that still needs to be cleaned up.
Events handling in scrollers won't work yet, for the useful select all in frame(-range) or select all in channel(s). We should probably review ways to expose this more clearly in the UI too.
Object: converted the old horrible editobject.c, now as file:
editors/object/object_edit.c
Still lots of WIP, I've operatorified "Make Parent". Check here
the new API at work: http://pasteall.org/3650/c
IMPORTANT NOTE FOR BRECHT:
game property defines were clashing with RNA, i've renamed game
defines for now.
I did a very drastic cleanup for the different libgroups, there's now only a few left. It compiled with scons/msvc, will be testing in a bit on linux, too.
If you get any problems, please reply to this commit message on the taskforce ML.
* update for editors/animation editors/space_outliner and editors/screen
* also fix compile error when INTERNATIONAL is set (will likely be solved with new font API)
Now, selecting keyframes with mouse behaves more like before.
Note: this still mostly uses old code, since other parts of code also call this. For later, it'd be nice to store as RNA prop, method of selecting.
It is now possible to select individual keyframes again in the Action Editor.
* Temporarily disabled markers keymap in Action Editor, as it was stealing all the events. Waiting for solution from Ton...
* Fixed a crash and wrong coordinate conversion errors
* Brought back backend for editing keyframes IPO/IPO-Curves. Did some refactoring work here that will still have to be verified when operators using them are added.
* Animation channel filtering code now returns the number of channels filtered (for Action Editor to set totrect of channels - TODO still!)
* View2D - made function to check if mouse is in View2D scrollers an API function
* Renamed keyframe related files. The old names were too clumsy.
* Started porting click-select operators for Action Editor. These don't work currently, as the events are being stolen by the markers. This needs to be fixed ASAP.
* Worked out data context implementation more, now with initial context
callbacks implemented for the screen and 3d view.
* For collections, switch from iterators to simpler ListBase. Though that still
means it uses LinkData* rather than the actual Object* for example, since
those can only be part of one list. So I added a macro as well to make
iteration easier when possible.
CTX_DATA_BEGIN(C, Object*, ob, selected_objects) {
printf("object name: %s\n", ob->id.name);
}
CTX_DATA_END;
* View Pan Operator now stores area, etc. values from context in case user moves out of view
* Moved the invalid-context check for Action Editor so that mode can still be changed when there's no data to show.
Our precious outliner is back! :)
Currently no operations are active there, nor notifiers to refresh
other windows. Be patient!
You can switch to RNA with the 'view' menu.
Later we'll sort out how much of both get integrated in 1 system, or
have both options, or make designated 'data view' for rna? ALso the
old Oops... bring back?
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.
* Restored y-position translations needed for gla-stuff, as gla stuff sets viewport + matrices!
* Fixed alpha-problems with icons. The ft-font drawing was turning off GL_BLEND when it was done, which screwed up the icon drawing (previous names were drawn with 'standard' fonts only)
* Removed Context arg from drawing funcs. Passing anim-context instead.
* Properly initialised new theme settings ported over from animsys2.
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
Removed unused variables and commented out unused function.
It's very helpful for code porting work to keep commits
warning free! If you compile debug, also disable O2 to get
these warnings.
Initial commit of drawing code for Action Editor / Dopesheet. By default, the Dopesheet is now enabled (like in AnimSys2). There are still a few unresolved problems (like bad alpha blending for icons, and keyframes still not being drawn). However, these will be resolved in due course.
* Made normal 'rounded' theme use the same fake AA outline as round shaded
* Made rounded theme respect the 'button outline' theme colour - it never did before.
Alignment flags are now checked for after keeptot settings, as these flags are of even greater importance. This is necessary for the syncing of the channels region and timeline areas in Action Editor (and later NLA Editor).
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.
Enabled cool hidden feature from Brecht: "interactive" mode for buttons,
which executes button handling on each change.
Try sliding the current frame, or even: type in values there! Cooool! :)
Added 'header print' feature back.
ED_area_headerprint(ScrArea *sa, const char *str);
Give it a NULL string to disable the feature.
On each call it tags the header for redraw.
- Added default Circle 'gesture' operator callbacks.
As test, added in view3d window as Ckey, paint over object centers.
- Fixed notifier for gesture, to only cause redraws in own region.
- Bugfix: loading files should close running handlers and subwindows, gave
memory leaks that way.
- Bugfix: space image copy function didn't do curvemap
- Cleanup: moved view operators from view3d_select to view3d_view