Commit Graph

38 Commits

Author SHA1 Message Date
Campbell Barton f743b583bf more lint includes
Only source/blender/editors/ dir, should not give errors on different platforms
Only removing:  UI_*.h, ED_*.h, WM_*.h, DNA_*.h, IMB_*.h, RNA_*.h, PIL_*.h
2010-03-23 14:09:09 +00:00
Campbell Barton 1e9bf0cfdb spaces -> tabs, (4 spaces == 1 tab, only for white space preceding text) 2010-03-22 09:30:00 +00:00
Guillermo S. Romero 42ac4a3e7d Fix syntax for ID keyword. 2010-03-21 01:14:04 +00:00
Campbell Barton d4756d395b remove for bad-level-call & some minor changes to make camera switching neater. 2010-03-09 07:41:04 +00:00
Elia Sarti 5658ef4501 Bugfix for #21452, Crashdown in Video Sequence Editor
Added some NULL checks
2010-03-05 19:35:17 +00:00
Campbell Barton 081c1205a3 correct fsf address 2010-02-12 13:34:04 +00:00
Joshua Leung 7dee0e2540 Bugfix #21032: sound strips could not be drag-n-dropped from filebrowser to sequencer 2010-02-09 09:31:45 +00:00
Andrea Weikert 064345ad8c Partial fix for [#20567] SEQUENCER: Image Preview completely unusable
* Zoom and Pan should work now (thanks Aligorith for reviewing)
* mostly removed ancient drawing code
* Fit preview in Window still has issue, HOME key in preview area should be working though
2010-02-07 19:07:56 +00:00
Ton Roosendaal b119ce5fcc Drag and drop 2.5 integration! Finally, slashdot regulars can use
Blender too now! :)

** Drag works as follows:

- drag-able items are defined by the standard interface ui toolkit
- each button can get this feature, via uiButSetDragXXX(but, ...).
  There are calls to define drag-able images, ID blocks, RNA paths, 
  file paths, and so on. By default you drag an icon, exceptionally 
  an ImBuf
- Drag items are registered centrally in the WM, it allows more drag 
  items simultaneous too, but not implemented

** Drop works as follows:

- On mouse release, and if drag items exist in the WM, it converts 
  the mouse event to an EVT_DROP type. This event then gets the full 
  drag info as customdata

- drop regions are defined with WM_dropbox_add(), similar to keymaps 
  you can make a "drop map" this way, which become 'drop map handlers' 
  in the queues.
- next to that the UI kit handles some common button types (like 
  accepting ID or names) to be catching a drop event too.

- Every "drop box" has two callbacks:
  - poll() = check if the event drag data is relevant for this box
  - copy() = fill in custom properties in the dropbox to initialize 
    an operator
- The dropbox handler then calls its standard Operator with its 
  dropbox properties.

** Currently implemented

Drag items:
- ID icons in browse buttons
- ID icons in context menu of properties region
- ID icons in outliner and rna viewer
- FileBrowser icons
- FileBrowser preview images

Drag-able icons are subtly visualized by making them brighter a bit 
on mouse-over. In case the icon is a button or UI element too (most 
cases), the drag-able feature will make the item react to 
mouse-release instead of mouse-press. 

Drop options:

- UI buttons: ID and text buttons (paste name)
- View3d: Object ID drop copies object
- View3d: Material ID drop assigns to object under cursor
- View3d: Image ID drop assigns to object UV texture under cursor
- Sequencer: Path drop will add either Image or Movie strip
- Image window: Path drop will open image


** Drag and drop Notes:

- Dropping into another Blender window (from same application) works 
too. I've added code that passes on mousemoves and clicks to other 
windows, without activating them though. This does make using multi-window
Blender a bit friendler.

- Dropping a file path to an image, is not the same as dropping an 
Image ID... keep this in mind. Sequencer for example wants paths to 
be dropped,  textures in 3d window wants an Image ID.

- Although drop boxes could be defined via Python, I suggest they're 
part of the UI and editor design (= how we want an editor to work), and 
not default offered configurable like keymaps. 

- At the moment only one item can be dragged at a time. This is for 
several reasons.... For one, Blender doesn't have a well defined 
uniform way to define "what is selected" (files, outliner items, etc). 
Secondly there's potential conflicts on what todo when you drop mixed 
drag sets on spots. All undefined stuff... nice for later.

- Example to bypass the above: a collection of images that form a strip, 
should be represented in filewindow as a single sequence anyway. 
This then will fit well and gets handled neatly by design.

- Another option to check is to allow multiple options per drop... it 
could show the operator as a sort of menu, allowing arrow or scrollwheel 
to choose. For time being I'd prefer to try to design a singular drop 
though, just offer only one drop action per data type on given spots.

- What does work already, but a tad slow, is to use a function that 
detects an object (type) under cursor, so a drag item's option can be 
further refined (like drop object on object = parent). (disabled)


** More notes

- Added saving for Region layouts (like split points for toolbar)

- Label buttons now handle mouse over

- File list: added full path entry for drop feature.

- Filesel bugfix: wm_operator_exec() got called there and fully handled, 
while WM event code tried same. Added new OPERATOR_HANDLED flag for this. 
Maybe python needs it too?

- Cocoa: added window move event, so multi-win setups work OK (didnt save).

- Interface_handlers.c: removed win->active

- Severe area copy bug: area handlers were not set to NULL

- Filesel bugfix: next/prev folder list was not copied on area copies

** Leftover todos

- Cocoa windows seem to hang on cases still... needs check
- Cocoa 'draw overlap' swap doesn't work
- Cocoa window loses focus permanently on using Spotlight
  (for these reasons, makefile building has Carbon as default atm)

- ListView templates in UI cannot become dragged yet, needs review... 
it consists of two overlapping UI elements, preventing handling icon clicks.

- There's already Ghost library code to handle dropping from OS 
into Blender window. I've noticed this code is unfinished for Macs, but 
seems to be complete for Windows. Needs test... currently, an external 
drop event will print in console when succesfully delivered to Blender's WM.
2010-01-26 18:18:21 +00:00
Martin Poirier ff038161f6 Add missing names to SpaceTypes 2009-12-19 22:37:51 +00:00
Campbell Barton 8aa8efb327 * rna attributes for sequence strips - seq.start_frame_final & seq.end_frame_final
these expose the final start and end after offsets are applied. when set this is like grabbing the handle and moving it.
* made swapping strips shuffle effects and check for overlap.
2009-12-15 11:27:46 +00:00
Andrea Weikert 18cc2b76c2 Sequencer drawing cleanup (Part 1)
Separated preview drawing into own ARegion, this should make using View2D possible
The Sequencer now has three view types: Sequencer, Preview and split Sequencer/Preview.

Changing the preview can be done either by the combobox in the header or toggling through those types with CTRL+TAB.

Notes:
* Icon for split Sequencer/Preview view missing still. 
* Naming items in the comboboxes can be improved (just Preview instead of Image Preview?)

Next steps:
* bringing back View2D handling (zoom/pan) for image preview
* experimenting with splitting the Preview ARegion for In/Out editing
2009-12-14 21:42:25 +00:00
Matt Ebb a4d52bd0fd patch [#20342] Notifier patch for modifier rename and particle system rename
by 'ThatHaze'. thanks!
2009-12-13 23:51:41 +00:00
Campbell Barton abe8c09b8a * renamed BKE_sequence.h and sequence.c --> sequencer
* renamed util.c --> path_util.c since there are more then 1 of these files which makes setting breakpoints annoying.
2009-12-13 14:56:45 +00:00
Matt Ebb 9c5019a9a9 Notifier related fixes:
[#20319] 3D View - need 3D cursor notifier
[#20321] Views not receiving the NC_ID notifier
2009-12-10 09:58:10 +00:00
Brecht Van Lommel f2452c1fd6 Sequencer:
* Sound strips now respect metastrips for muting. That means they
  are muted if the metastrip is muted, and don't play when located
  outside of the current metastrip.
* Operators now use notifiers instead of redraw tagging, added a
  separate notifier for selection as well, but that is not used to
  do less redraws yet.
2009-12-08 13:57:51 +00:00
Joshua Leung 993da72d06 Added RMB-menu to Headers:
This contains two entries - one which calls the region flip operator, and one which calls the maxmize area operator. 

Unfortunately, there seem to be some context issues which are causing the wrong region to get activated for use by the region flipping, meaning that nothing happens.


Also, fixed own typo in 3d-view header/menu code...
2009-11-27 06:24:09 +00:00
Joshua Leung 0eb70a4ca9 Sequencer Drawing Code - Refactoring Part 1:
- Started cleaning up the sequencer drawing code by firstly decoupling the different draw modes from each other (i.e. timeline view doesn't call image view). 

- Also separated out a few distinct few phases in sequencer-timeline drawing into different functions instead of being lumped in the single one. Recoded part of this to make it less ugly too...

- Made markers get drawn again in the sequencer timeline view
2009-11-26 12:22:43 +00:00
Joshua Leung 10e1780cf9 Assorted bugfixes - Sequencer/Preview Range:
* Snapping strips now works with the hotkey  Shift-S   as in the rest of Blender
* Preview Range works in Sequencer now (the operators for setting, clearing, and also drawing)
* Related to the Preview Range for Sequencer, toggling the time-display mode also works
* Preview Range Set operator now works again, after the modal keymaps change for borderselect broke it. Also sends correct notifiers now after bein called.
2009-11-17 10:12:35 +00:00
Brecht Van Lommel 37e4a311b0 Math Lib
* Convert all code to use new functions.
* Branch maintainers may want to skip this commit, and run this
  conversion script instead, if they use a lot of math functions
  in new code:
  http://www.pasteall.org/9052/python
2009-11-10 20:43:45 +00:00
Campbell Barton 2c985dee97 - listener for sequencer space panels added for frame changes, now redraws during transform
- invalid pointer was used for getting the sequencer length crashing blender or setting the length to negative values.
- printf_strip(seq) for debugging sequence strip locations
- Spelling: Cheet Sheet -> Cheat Sheet
2009-10-19 10:07:19 +00:00
Brecht Van Lommel 3ebd58673f Key Configuration
Keymaps are now saveable and configurable from the user preferences, note
that editing one item in a keymap means the whole keymap is now defined by
the user and will not be updated by Blender, an option for syncing might be
added later. The outliner interface is still there, but I will probably
remove it.

There's actually 3 levels now:

* Default builtin key configuration.
* Key configuration loaded from .py file, for configs like Blender 2.4x
  or other 3D applications.
* Keymaps edited by the user and saved in .B.blend. These can be saved
  to .py files as well to make creating distributable configurations
  easier.

Also, user preferences sections were reorganized a bit, now there is:
Interface, Editing, Input, Files and System.


Implementation notes:
* wmKeyConfig was added which represents a key configuration containing
  keymaps.
* wmKeymapItem was renamed to wmKeyMapItem for consistency with wmKeyMap.
* Modal maps are not wrapped yet.
* User preferences DNA file reading did not support newdataadr() yet,
  added this now for reading keymaps.
* Key configuration related settings are now RNA wrapped.
* is_property_set and is_property_hidden python methods were added.
2009-10-08 18:40:03 +00:00
Brecht Van Lommel 69e919530e Keymaps now have a poll() function, rather than adding/removing
their handlers based on notifiers, which is simpler and more
reliable.

This fixes for example editmode or uv edit keymaps not working
when creating a new 3dview or image space.
2009-09-17 21:36:02 +00:00
Brecht Van Lommel 7df35db1b1 2.5
Notifiers
---------

Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:

* Geometry changes are now done with NC_GEOM, rather than
  NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
  notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
  should only be used for notifying about changes in space data,
  we don't want to go back to allqueue(REDRAW..).

Depsgraph
---------

The dependency graph now has a different flush call:

DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)

It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.

Docs
----

I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:

http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
2009-09-04 20:51:09 +00:00
Brecht Van Lommel 408ba429e6 2.5: Buttons View
* When resizing the window, the top position is now preserved,
  instead of the center position.
* Fix zoom level not being preserved in various cases, when
  changing both with and height. This replaces some earlier code
  which did this at screen level but wasn't very reliable.
* Different tabs now each preserve their own scroll.
* When switching between tabs, it now scrolls to show as many
  buttons as possible, instead of possibly showing empty space.
  There is a trade-off here between doing that keeping the
  buttons in the same place, no ideal solution exists I think.
* Change zooming in/out to be symmetric, for example doing
  numpad + then - did not give the original zoom level back.
* Added some calls to avoid hanging tooltips when manipulating
  the view.

Internals:
* Added V2D_KEEPOFS_X and V2D_KEEPOFS_Y to keep the top/bottom
  rather than the center.
* Renamed V2D_KEEPZOOM to V2D_LIMITZOOM (seems more appropriate),
  and make V2D_KEEPZOOM preserve the zoom level.
2009-07-29 22:57:53 +00:00
Campbell Barton 62160cef8a Sequencer WIP
- Move buttons into the sequencer Nkey region
- Made the header and menu items use the python api, still need to get more buttons working.
- Fixed some minor problems
2009-06-08 16:48:12 +00:00
Ton Roosendaal 559ab6a835 2.5
Sequencer: added Nkey + UI region, with two empty panels to fill!
2009-06-08 10:38:28 +00:00
Ton Roosendaal 66437a62a7 2.5
Font object + editing back.

Was quite some work due to a myriad of globals all over!
Works nicely 100% local now.

To enable a single textedit operator, I've added a new
keymap entry KM_TEXTEDIT, which gives all keyboard events
to the handler. Also had to add a new keymap-add function
to force a keymap handler in beginning of region handlers.
In future this can be used to prioritize handlers.

Also: split off the arrow keys (frame change) to a separate
region level handler. Can be set with default flag in
regiontype->keymapflag ED_KEYMAP_FRAMES
2009-01-23 14:43:25 +00:00
Campbell Barton 88e244ebb9 basic transform for sequencer strips
can transform the strips or move their handles
Still todo, click-drag transform, metastrips support, snapping, markers overlap checks and constrain to valid channels.
2009-01-21 07:01:20 +00:00
Campbell Barton 999d9d146e Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
Joshua Leung ae25863d6c 2.5
* Tweaked a few incorrect comments in Constraints code
* Made Sequencer use View2D system correctly (only looked at the 'time-grid' thing so far).
2009-01-12 22:54:30 +00:00
Ton Roosendaal 03fc5696dc 2.5
12k lines of sequencer back! Only seqaudio.c skipped for now.
Notes:

- it only draws now, nothing refreshes or edits.
- fixed bug in view2d.c with vertical grid step being 0.0f
- render code and fileselect code is #ifdeffed out
- sequence evaluation code moved to blenkernel, so it can
  be used for render without bad level calls

General note; sequencer code is very untidy, mixing styles too
much. Tried to clean it some, but it would be nice if formatting
is kept consistant from now on.
2009-01-12 19:02:08 +00:00
Ton Roosendaal bac4d10174 2.5
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.
2008-12-22 10:09:56 +00:00
Brecht Van Lommel 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
Joshua Leung 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
Joshua Leung 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
Joshua Leung 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
Ton Roosendaal 8be23f9490 2.5
Basics for the remaining 6 spacetypes. 

Note: Andrea prefers to merge SpaceImaSel with SpaceFile
for that I'll provide a good readfile.c patch later
2008-12-14 14:43:08 +00:00