Commit Graph

15037 Commits

Author SHA1 Message Date
Ton Roosendaal
5d8cfef713 2.5
Mainwindow had wrong subwindow rect definition.
2008-12-06 16:22:21 +00:00
Joshua Leung
45cc5197e3 View2D - Bugfix for grid calculation for 'frames'
Grid calculations for frames and seconds were mixed up, meaning that grid was often off.
2008-12-06 10:25:51 +00:00
Joshua Leung
afb45ae7cf View2D: Code cleanup - UI_view2d_status_enforce()
This commit *should* bring UI_view2d_status_enforce() (formerly known in pre 2.5 as test_view2d) under control again. 
I've attempted to reduce the amount of duplicated code here, so hopefully there won't be any nasty bugs that will show up in some of the other views when they are ported.

Summary of changes:
* Restored V2D_KEEPZOOM flag which I had previously removed, having misunderstood its function.
* Fixed bugs with resizing Outliner window
* Outliner width is now columns + 1 again. Documented reasons for this (otherwise, stuff gets covered by scrollbars, but we cannot see it)
2008-12-06 09:25:42 +00:00
Nathan Letwory
8a04f039ad * seems like cur and tot were mixed up, thus preventing panning from working 2008-12-05 18:41:28 +00:00
Joshua Leung
5e60414961 View2D API: Cleaning up API + New Methods
* 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.
2008-12-05 02:03:37 +00:00
Nathan Letwory
e4a8a39f9d * silence a warning 2008-12-04 20:34:37 +00:00
Nathan Letwory
b087c8adf2 * rename some view2d defines to be clearer and more in line with the rest of view2d defines. 2008-12-04 20:28:59 +00:00
Ton Roosendaal
2e517db96a Small fix for repeat-last-operator:
- Context in WM wasn't set for regions yet, done now. So repeat works on
  per-region ops too.
- Debug print was printing the wrong repeated op.
  (repeat-op could show menu naming the op to repeat)
2008-12-04 09:37:42 +00:00
Joshua Leung
cb92e781f4 View2D: Scrollbars will now pan the view when MMB-dragged on 2008-12-04 09:33:12 +00:00
Joshua Leung
6fe9a03456 View2D: Scrollbar tweaks
* 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.
2008-12-04 05:37:55 +00:00
Joshua Leung
efe8ad86e3 View2D: Units on Scrollers (XAxis only)
Added back units on scrollbars for anim editors (i.e. Timeline). Vertical scrollbars have yet to be done, but there's no way to test yet.

Using markers and current frame indicator (and value) as guides, it is clear that there is still some inaccuracy with the drawing of the grid or the frames/markers are drawn wrong! Will investigate further.
2008-12-04 02:01:42 +00:00
Brecht Van Lommel
2a1d37ddc2 RNA:
* DNA_key_types.h: wrapped KeyBlock.data, and added back position
  and current value, now done.
2008-12-04 01:58:14 +00:00
Brecht Van Lommel
8fc5d6e7de RNA
* Remove some unnecessary defining of struct types for pointers.
* Review of DNA_key_types.h and added Key for Mesh and Curve.
2008-12-04 00:07:47 +00:00
Joshua Leung
853f2b0647 Tweaked tooltip box drawing so that ends of tooltips don't fall of the end of the box 2008-12-03 23:21:01 +00:00
Joshua Leung
48cd47ab58 2.5 - compile fixes for Elubie's commit 2008-12-03 22:35:38 +00:00
Andrea Weikert
6241b8a57f RNA
* rna for DNA_key_types.h, also linked to key member of Lattice, others need to be checked.
2008-12-03 21:18:10 +00:00
Brecht Van Lommel
10232f2c86 Forgot this file in my last commit. 2008-12-03 21:13:47 +00:00
Nathan Letwory
e58fab0d49 * make function to map mouse into region coords 2008-12-03 20:57:23 +00:00
Nathan Letwory
d141a485b0 * check mouse coords in right space. 2008-12-03 20:45:26 +00:00
Brecht Van Lommel
8360dc066c RNA
* Added a function to define booleans negative, to turn negative
  properties into positive ones gettin rid of the no_ prefix, and
  also got rid of the use_ prefix for two booleans.
* Also made the function for enum bitflags separate, this is quite
  rare so don't need to bother with this in most cases.
* Removed svn:executable flags from some files.
2008-12-03 20:17:12 +00:00
Ton Roosendaal
a9374c5941 2.5
Fun commit for test: the Repeat Last option.
Only the split-area Operator is now added on stack, so that's the only 
one that works. Just split an area, and press F4 to repeat it anywhere.
2008-12-03 19:33:42 +00:00
Ton Roosendaal
757fe56314 2.5
Another view2d fix: buttons now get clipped for region and mask, so
sliders will work fine, but also buttons overlapping region edges.
2008-12-03 18:14:52 +00:00
Kent Mein
edc06b0b5b A couple of small fixes to clear up some warnings.
BOP_Merge2.cpp 
	had same variable name at different scopes so I renamed a couple.
resources.c 
	added include that was missing.  (This maybe was going to move? the old one
	was commented out)
ed_markers.c
	initalized a var that needed it.

Kent
2008-12-03 17:36:30 +00:00
Ton Roosendaal
4e6b6dd3f9 2.5
- Tooltips now respect view2d view (rna viewer).
- Bugfix in viewd.c UI_view2d_view_to_region() (typo)
2008-12-03 17:11:50 +00:00
Ton Roosendaal
880710cfb0 2.5
Fix crashing in pop-up menus when click.
There's something wrong still in handling menu itself, need Brecht
too look at that... probably a wrong return value somewhere.
2008-12-03 15:49:41 +00:00
Ton Roosendaal
1c81b97481 2.5
Error in commit that made notifier calls easier; forgot to add the
check for global vs local notifiers.
2008-12-03 15:05:06 +00:00
Ton Roosendaal
444e1d198e 2.5
Fix: the main button handler was swallowing all events. Now every button
type returns 'handled' only if it did something, so other events get nicely
processed.

This will enable MMB pan in dataviewer.
2008-12-03 14:22:42 +00:00
Ton Roosendaal
167ac3606b 2.5
- 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.
2008-12-03 13:44:16 +00:00
Ton Roosendaal
d8ed4c389c 2.5 fixes
- View2d bug: it was taking sliders into account for setting the 
  window matrix, which it shouldn't (glViewport does). This caused
  error offset in drawing, like for current-frame scrolling.

- Current frame scrolling in TimeWindow back on window level.
  (used to crash, but that was fixed in WM)

- Made UI_view2d_region_to_view accept ints, no shorts

- removed debug function in interface_ops.c
2008-12-03 13:14:01 +00:00
Joshua Leung
92cbb4b033 View2D - assorted wip changes (nothing to see here) 2008-12-03 09:06:30 +00:00
Brecht Van Lommel
8f1847e4c3 RNA: review of commits in the past days, check the diffs for the
many small changes, but the two bigger ones are:

* Sensors and controllers now use inheritance, rather than pointing
  to the data in a separate struct. Had to add some new RNA define
  functionality to support this better.
* DNA_meta_types.h was marked as done but still missing many things,
  now completed.
2008-12-02 23:45:11 +00:00
Ton Roosendaal
d27c9f9d76 2.5
- after closing button (having used it), it sends empty mousemove for 
  invoking new modal handler on same button. Don't know better solution
  for now, at least this way WM handles everything. :)

- experiment: moved button handlers to area level, that way it respects
  handlers on higher hierarchical level, like moving area edges.
  Als interesting is that you can have a button active (texteditor) and
  use a similar button in other area.
  This can also be done on region level even.

On todo: proper notifier events for redraw! Don't want all areas to draw
on simple refreshes
2008-12-02 18:49:58 +00:00
Campbell Barton
6a6b386832 Made PyRNA props iterable, so you can do things like...
for ob in bpy.objects:
	print(ob.name)

for i, lay in bpy.scenes["Scene"].layer:
	print('%d %d' % i, lay)
2008-12-02 15:27:10 +00:00
Campbell Barton
9f27be3b2d Added RNA functions from PyRNA
* RNA_property_enum_value
* RNA_property_enum_identifier
To get an enum string from a value and a value from an enum.

BPy_StructRNA types (objects, meshes, images etc) can now be used as dictionary keys.
2008-12-02 14:36:35 +00:00
Ton Roosendaal
54908979c5 Lots of stuff; couldn't commit in parts because of refactor work.
* Changes in interface/ module

This commit brings back the way how buttons/menus work under control
of WM event system. The previous implementation extended usage of
handlers and operators in an interesting but confusing way. Better to
try it first according the design specs. :)

Most obviously:
- modal-handler operators are not stored anymore in regions/areas/windows.
  such modal handlers own their operator, and should remove it themselves.
- removed code to move handlers from one queue to another.
  (needs review with brecht!)
- WM fix: the API call to remove a modal handler got removed. This was a
  dangerous thing anyway, and you should leave that to the event system.
  Now, if a handler modal() call gets a cancel/finish return, it frees 
  itself in event system. WM_event_remove_modal_handler was a confusing 
  call anyway!

Todo:

- allow button-activate to refresh after using button 
- re-enable arrow keys for menus
  (do both after commit)

- review return values of operator callbacks in interface_ops.c

* Fixes in WM system

- Freeing areas/regions/windows, also on quit, now correctly closes 
  running modal handlers
- On starting a modal handler, the handler now stores previous area
  and region context, so they send proper notifiers etc.

* Other fixes

- Area-split operator had bug, wrong minimal size checking. This
  solves error when trying to split a very narrow area.
- removed DNA_USHORT_FIX from screen_types.h, gave warning
- operators didn't get ID name copied when activated, needed for
  later re-use or saving.
2008-12-02 14:22:52 +00:00
Joshua Leung
c4fe6d0f00 RNA - Wrapped a few more simple Object transforms.
Note: Rotations are still exposed directly in radians. We should probably do some wrapping around this, perhaps at UI-level?
2008-12-02 10:10:07 +00:00
Joshua Leung
628d7013e2 View2D - Some more tweaks...
* Improved scrollbar drawing a bit more - only cosmetic lines
* Added new view2d view-matrix api method to only use 'cur' coordinates on one axis, for use when drawing markers, etc. that need to be glued to a certain time but stay fixed in space in another dimension. This should improve the sitation for drawing markers
* To aid testing, adding markers now sets the marker to have frame number as it's "name". This will need to be removed later...
2008-12-02 09:43:23 +00:00
Campbell Barton
f8d5883a5b mingw was giving errors...
source\blender\python\intern\bpy_rna.c:1018: error: initializer element is not constant
source\blender\python\intern\bpy_rna.c:1018: error: (near initialization for `pyrna_prop_Type.tp_get

Assign get generic get/sets before PyType_Ready runs
2008-12-02 09:35:29 +00:00
Hamed Zaghaghi
6780c0b12a * rna_property completed
CAUTION: some defines like PROP_INT in DNA_property_types.h are the same 
as enums in RNA_types.h, and may be encounter hidden errors in future.
2008-12-02 01:05:23 +00:00
Nathan Letwory
accfa06ede * after discussion with cambo on IRC, change the #ifndef's to #undefs instead:
Pre-Python 3.0 has strings default non-unicode, so checks and handling should be done so too.
2008-12-01 23:38:22 +00:00
Nathan Letwory
d1e75c215b * make sure there are no redefinitions (I'm using py2.5 and ie PyUnicode_Check define exists 2008-12-01 22:20:18 +00:00
Andrea Weikert
23a77e7688 RNA
* DNA_packedFile_types: added rna definitions for packed files
* also experimentally filled in correct struct 'PackedFile' in image rna for testing.
* updated MSVC projectfiles (also for rna_curve.c and rna_vfont.c)

Note:
I removed PackedFile->flags, I did grep through source and a complete recompile of blender trunk svn without them too, so they obviously aren't needed anymore. A bit of cleaning up :)
2008-12-01 21:23:58 +00:00
Juho Vepsalainen
31ffe5b65e RNA: Added missing *srna's to curve functions. 2008-12-01 21:19:36 +00:00
Nathan Letwory
d18f26f679 * add debug symbols when building BF_DEBUG=True 2008-12-01 21:13:49 +00:00
Andrea Weikert
a821b7e5d1 == MSVC9 projectfiles ==
- update for several new rna files.
2008-12-01 20:53:01 +00:00
Juho Vepsalainen
1ebf257bf4 RNA: Curves and VFont
Implemented RNA wrappers for curves and VFont. Only issue I could
not yet solve is related to struct CharInfo curinfo; . This particular
line proved to be hard to wrap and I therefore marked it as a TODO
should someone want to fix this issue.

I also cleaned up makesrna.c a bit by unifying brush/meta parts
under one call just the way it is done in the case of other
wrappers.
2008-12-01 19:02:27 +00:00
Campbell Barton
6a73a27d81 PyRNA structs and properties can now be subtyped to add functionality in python.
rna_actuator.c was missing an enum
2008-12-01 16:59:18 +00:00
Nathan Letwory
7c94f5314b * ray_mirror naming for property grouping 2008-12-01 14:36:14 +00:00
Juho Vepsalainen
5a8e8906bb RNA:
Implemented RNA wrapper for ModifierData.

Note that actual interface to access data of any specific modifier is
still missing. I also marked a couple of parts as TODO that should be
reviewed to decide whether or not to expose those specific parts
via RNA.
2008-12-01 13:01:48 +00:00
Joshua Leung
1a354bd310 View2D - Zoom + More Scrollbar work
* Added basic (non-modal) zoom operators that use a uniform scale factor, with zoom centered using the view center as scaling point. Use Scrollwheel up/down and Pad +/- to use this.

* Added back the 'button'/bubble for the scrollbars. I've added dark lines on either end of it for some later work on zooming widgets.
This is not the final form they'll take. I still need to decide how to handle those scrollbars which act as grid-markers too (showing timescale, etc.), before trying to integrate that with some fancy scrollbar drawing (rounded, etc.)

Assorted changes:
* Moved vertical scrollbar for Outliner to right hand side
* Made Timeline use standard scrollbars, and turned on various clamping options
* Fixed ortho-matrix corrections for scrollbars, and added pixel offsets
* Made Timeline markers sit more snugly on the scrollbar. They were a bit far out...
* Fixed memory leak with view2d keymaps not being freed when Blender exited
2008-12-01 11:37:05 +00:00