Commit Graph

11805 Commits

Author SHA1 Message Date
04428d6750 added "description" and "readonly" properties to RNA Structs (also accessible via python)
Many descriptions are not written, grep for DOC_BROKEN if you have some spare time to write struct descriptions.
2008-12-19 04:06:24 +00:00
d9de6fca6c 2.5: Change blenloader module to use the Report system for reporting errors. 2008-12-19 00:50:21 +00:00
ea81c58429 2.5: fix small memory leak when closing window with X-button rather than Ctrl+Q. 2008-12-19 00:43:37 +00:00
dfb8b21340 2.5: fix for crash reading regions of inactive spaces in an area. 2008-12-19 00:18:16 +00:00
9178dc8596 Small RNA changes
* rna_validate_identifier now checks identifiers are not python keywords such as if, and, from (builtins like max, object and sort are ok)
* rna_validate_identifier prints an error explaining why it fails
* renamed Struct's "from" to "base" - to point to the struct inherited from.
* renamed ImageUsers's "pass" and "layer" to "renderPass" and "renderLayer"
* use the identifier as the key for ENUM's (matching structs and properties)
2008-12-18 23:34:19 +00:00
1dcbafa4e4 2.5 - Assorted tweaks for anim editors before porting AnimSys2 stuff over to this branch 2008-12-18 23:23:09 +00:00
54cc5c493d 2.5
remove unnecessary include dependency.
2008-12-18 20:08:24 +00:00
93cc4629e3 2.5: fix for crashes due to access to free'd memory in joining areas,
ripping areas and duplicating windows.
2008-12-18 19:41:36 +00:00
af746acaad 2.5
Adding back internal files for file/imagebrowser.
2008-12-18 19:21:30 +00:00
a3f583ecf3 Removed ugly call to G.curscreen in derivedmesh.
Just to prevent crashing for now.
2008-12-18 18:34:37 +00:00
c7f6f25a9d 2.5
Drawing and viewing code for view3d back (no not objects :).

Quick test: converted 2250 ugly lines of code in 2.5 hours.
With about 300k lines todo, this will be 333 hours = 30 days? Whoa!
2008-12-18 17:38:21 +00:00
e8e903cd53 2.5
- WM subwindows now get freed on every ED_region_exit(). Was not
  a leak, but it's cleaner this way (and saves some kilobytes!).
- fixed debug print for operators (on blender -d) to print correct
  subwindow id.
2008-12-18 14:53:39 +00:00
9ca1760525 2.5
Missing context.h for apple compiling.
2008-12-18 11:25:17 +00:00
dae839639d View2D: More bugfixes
* Added flags to View2D to specify whether the view should have pixel offsets applied (this is able to be specified per axis, just in case the need arises). Currently, this is only used for headers, where the UI elements were not as smooth + round as they could be

* Fixed IPO/Action/NLA so that new instance will show channel lists by default and with scrollers

* Fixed Outliner zoom-in/out on changing windowsize. I didn't notice this on my previous custom .B.blend file, but the problem was apparent in the default setup.
2008-12-18 09:20:29 +00:00
ced396ce6d Use the identifier for struct property access too
struct.properties['pulse_false_level'] instead of struct.properties['Pulse False Level']
2008-12-18 07:22:28 +00:00
96bad930de Added checks so invalid struct and property identifiers while preprocessing,
Changed curve '3d' property to 'planer' and set to a negative bool.
2008-12-18 06:43:03 +00:00
a196d283ed Use the identifier rather then the struct name to access a collection of structs.
bpydoc.structs.keys() - ['Actuator', 'ActuatorSensor', 'AlwaysSensor', 'AndController'.... etc
now reads...
bpydoc.structs.keys() - ['Actuator', 'Actuator Sensor', 'Always Sensor', 'And Controller'...

This is more correct since an identifier is supposted to be unique when a name might not be.
2008-12-18 05:28:17 +00:00
ecc4e55b66 2.5
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
2008-12-18 02:56:48 +00:00
241dbe6e85 2.5: Fix crash moving area to fullscreen with tooltips. Happened
because C->window->screen and C->screen were different, now made
sure they are set at the same time.
2008-12-18 01:48:24 +00:00
7a5186c53f 2.5
Added operator for moving area to 'full screen'.
This is instable with tooltips on... fishy stuff then goes on,
which Brecht will first look at. :)
2008-12-17 19:40:19 +00:00
6634ed9a87 2.5
Added screen-set notifier. Works for arrow keys now. For those who
know the messy old code, admire the simple 2-function call method
now :) Only context setting is messy a bit, that'll be solved.

Also: removed redundant code, and move freeing window handlers up
one level; windows can keep their handlers while screen switches.
2008-12-17 17:33:45 +00:00
065155a17d UI:
* Changed pupmenu function name and added back some standard popups.
2008-12-17 16:53:56 +00:00
3051647c98 2.5
Patch from Michael Fox; adding operator + key definitions for arrow keys, 
to change frame.
2008-12-17 16:21:14 +00:00
d6b677ba42 2.5
Small commit, too much fun to not do separately:

- removed notifier restriction to go only to own window, so multiwindow
  setups redraw correctly. (when other windows show other scenes we have
  to handle still).
- fixed cursor type outside of window (got stuck to area-move cursor).
2008-12-17 15:51:32 +00:00
07d63eb679 2.5
- 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)
2008-12-17 15:38:40 +00:00
616edcca12 View2D: Cleanup of presets and fixed errors in various views
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.
2008-12-17 10:25:02 +00:00
c1379f6613 UI:
* 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.
2008-12-16 20:03:28 +00:00
962870b235 2.5
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
2008-12-16 18:42:12 +00:00
e34528e1a6 UI:
* Only open tooltip when the mouse is still over the button.
* Remove an unnecessary redraw call, though the two mentioned
  in the previous commit seem to be working OK (it's for action
  buttons when you move the mouse away from the button, holding
  the mouse button down).
* Fix missing alt key in key event strings.
2008-12-16 17:36:51 +00:00
6c2750a6fe Added "bpydoc" to the global namespace of python scripts, making documentation available no matter what data is open in the current blend file, Directory type was also missing from the subtype enum causing the test rna-dump script to fail. 2008-12-16 16:32:48 +00:00
67dfe58f8c 2.5
Test for Brecht: this line makes drawing buttons fine. 
However note:

- redraws on lines 3107 and 3024 don't do anything
- tooltip timer is messing with redraws too, if you
  have tooltips on, it continuously sends redraws.
- I would code tooltip to reset on any mouse move, 
  and only start timer when mouse is still completely.
  That would make them appear much more quietly.
2008-12-16 13:49:51 +00:00
626e5c8b42 2.5
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.
2008-12-16 13:19:02 +00:00
6fe19cfc85 2.5
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.
2008-12-16 12:28:00 +00:00
f518fa8ea7 View2D: Presets for Initialising Views
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.
2008-12-16 11:24:24 +00:00
998e682fc3 UI: added the following functions to create buttons for RNA properties and for
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..
2008-12-16 07:55:43 +00:00
99575d31ff 2.5: Fix crash in sequencer reading code. 2008-12-16 07:53:59 +00:00
1c1c89262e WM: changed WM_operator_call to take an argument, which specifies in
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.
2008-12-16 07:44:21 +00:00
d272300da9 UI: bring back function to convert keyboard event to string, and
make the key event button work again.
2008-12-16 07:32:12 +00:00
89101d51bc 2.5
Undo last commit to save screen redraws on are switching, 
seems some initialize is missing.
2008-12-15 19:41:46 +00:00
98d710bd16 Depricated Image Select window, so it doesnt crash :) 2008-12-15 19:29:53 +00:00
6283b0c8c5 UI: getting popup menus to work again, just the internal interface
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");
2008-12-15 19:19:39 +00:00
aad5e49701 2.5
Small improvements;

- switch spacedata now doesn't cause full screen refresh and draw
- cursor switching is not part of SCREEN_CHANGED notifier, this
  makes area dragging ugly.
2008-12-15 18:43:18 +00:00
628f02d574 2.5
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 :)
2008-12-15 18:09:55 +00:00
a16df53619 2.5
Mouse cursors now work again

- centralized screen-level cursor changes, no more operator
  running for it.
- spacetypes have callback to check/set individual cursor
  types. Use notifier SCREEN_CHANGED to make sure it works
  on mode changes etc.
- new calls WM_cursor_modal() and WM_cursor_restore() to
  make temporarily cursor types during modes.
- used above for view2d cursors.
2008-12-15 16:54:47 +00:00
c13bb258b1 RNA:
Added some functionality to make inspecting all RNA structs possible. Not used
yet, but can be tested by replacing this line in space_outliner.c:

RNA_main_pointer_create(G.main, &cell.ptr);

with:

RNA_blender_rna_pointer_create(&cell.ptr);
2008-12-15 13:46:50 +00:00
a1e0868018 2.5
- 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)
2008-12-15 13:23:55 +00:00
d48f4b6012 2.5: added support for setting RNA properties in keymap item,
which will then be set when the operator is called, example:

kmi= WM_keymap_add_item(keymap, "ED_SCR_OT_region_split", SKEY, KM_PRESS, 0, 0);
RNA_enum_set(kmi->ptr, "dir", 'h');

kmi= WM_keymap_add_item(keymap, "ED_SCR_OT_region_split", SKEY, KM_PRESS, KM_SHIFT, 0);
RNA_enum_set(kmi->ptr, "dir", 'v');

There is a hack I had to do here, since properties are defined
as member of wmOperator, will try to fix later, committing now
so it can be used already.
2008-12-15 13:10:29 +00:00
b4aef16733 2.5
Testing toy for space editor devs: press F5key in header or channel list
(or any 'alignment constrained' region to flip it to other side.
2008-12-15 11:59:42 +00:00
21ca594625 View2D: Simplification and documentation of settings
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...
2008-12-15 11:58:57 +00:00
f7106acde8 2.5
funtion WM_keymap_add_item() now returns keymap-item, so you can use it
to set default properties for operators with WM_keymap_property_set().

Brecht will fill in this function, requires rna magic!

Example: an operator ED_OB_OT_add_primitive can be configured with
keymap like this:

WM_keymap_property_set(keymapitem, "Primitivetype", "Sphere");

Similar conventions we can use later for button/menu calls.
This will make creating operators easier, allowing a developer to group
tools functionality nicely.
2008-12-15 11:45:17 +00:00