Commit Graph

63 Commits

Author SHA1 Message Date
Campbell Barton 2f348d8b5d style cleanup: mainly for mesh code, also some WM function use. 2012-03-24 02:51:46 +00:00
Campbell Barton 541d239cdc fix for error in r44711, needed to update sequencer callback.
also quiet some warnings.
2012-03-07 19:19:56 +00:00
Campbell Barton a2c182e923 style cleanup - use aligned * prefixed blocks for descriptive comments (was already used a lot and part of proposed style guide). 2012-03-03 16:31:46 +00:00
Campbell Barton cbd5b492b1 remove use of deprecated struct members
- editmesh smooth & subdivide were using old mirror axis flag still.
- removed colbits from outliner and object code.
- commented some other parts of the code which access deprecated members and aren't called anywhere.
2011-12-04 06:39:35 +00:00
Campbell Barton 4a04f72069 remove $Id: tags after discussion on the mailign list: http://markmail.org/message/fp7ozcywxum3ar7n 2011-10-23 17:52:20 +00:00
Campbell Barton 74017cb020 header cleanup and typo's 2011-10-22 01:53:35 +00:00
Campbell Barton 317b649bb2 fix for buffer overrun with BLI_split_dirfile(...), was simple to do since many places don't check for filename lengyj of 79 chars which is the limit for the file selector.
Add max dir and file length args.
2011-10-15 03:56:05 +00:00
Sergey Sharybin 1d48c8db7f Sequencer: switching to preview mode works fine again 2011-09-19 13:12:54 +00:00
Brecht Van Lommel 59a823c48a Code cleanup: remove context from RNA update functions, only one left. 2011-09-05 19:34:27 +00:00
Joerg Mueller a672ab5e73 3D Audio GSoC:
Improved waveform drawing in the sequencer.

* Drawing the waveform of a sequencer strip is now independent from whether the sound is cached or not.
* Improved drawing of the waveform in the sequencer (especially speed!).
* Making it possible to vertically zoom more in the sequencer to better see the waveform for lipsync.
* Fixed a bug which crashed blender on loading a sound file via ffmpeg.
2011-08-09 14:10:32 +00:00
Campbell Barton 170716ca53 use BKE_area_find_region_type in place of inline loops (no functional changes). 2011-05-20 05:27:31 +00:00
Nathan Letwory 95100afc12 doxygen: blender/editors tagged. 2011-02-27 20:29:51 +00:00
Nathan Letwory 5b607701a7 doxygen: prevent GPL license block from being parsed as doxygen comment. 2011-02-23 10:52:22 +00:00
Campbell Barton 8b7482892b made most variables which are only used in a single file and not defined in header static for blenlib, blenkernel and editors. 2011-02-14 17:55:27 +00:00
Campbell Barton 8f21a43535 split BKE_utildefines.h, now it only has blender specific defines like GS() MAKE_ID, FILE_MAXDIR, moved the generic defines to BLI_utildefines.h.
no functional changes.
2011-01-07 18:36:47 +00:00
Joshua Leung f233f63d97 == Long-Standing 2.5 Todo - Markers fully working again in all
animation editors (DopeSheet, Graph Editor, NLA, Sequencer) ==

=== Usage Notes ===
In animation editors, marker operators will only be considered while
the mouse is hovering near/over the horizontal scrollbar (i.e. where
the markers usually appear). That means, in order to do something to
the markers, just position your cursor in line with the row of
markers, and then use the same hotkeys you'd use in the TimeLine (so,
unlike in 2.4x, no more need to hold down extra modifier keys for this
case). In the TimeLine, nothing changes, so you don't need to worry
about mouse placement there :)

=== Technical Details ===
Since early 2.5 versions, this functionality has been disabled, as the
markers were always getting evaluated first, and hence "swallowing"
all the events before the editor's own keymaps could access them.

In order to get this working again, I've had to give every marker
operator a "wrapper" invoke callback which performs some checking to
ensure that the mouse is close to the markers (vertically) before the
operator will try to be run. This wrapper also makes sure that once
the operator has finished running, that if it didn't manage to do
anything, then the editor's own keymaps get to have a go.

The vertical tolerance used is currently 30 pixels (as was used for
the borderselect operator).

=== Other Assorted Changes ===
* Gave marker operators dependent on having selected markers to
operate on suitable poll() callbacks. These new poll callbacks ensure
that there are selected markers for the operator to operate on,
further cutting down the number of places where markers may override
standard hotkeys (and avoiding calls to the wrappers too)
* Simplified some of the selection code
* Made some formatting tweaks for consistency, and in one case so that
my text editor's function-list display doesn't get confused
2011-01-06 02:35:12 +00:00
Ton Roosendaal 194449d038 Sequencer:
Dropping in image/movie/sound strips was broken; it dropped
things in wrong location (frame 0), and without giving images proper
length.

The file path setting code for the operators here is complex...
2010-12-11 20:01:34 +00:00
Campbell Barton e5fbd93cec editors/space_* build without unused args warnings 2010-10-16 08:03:28 +00:00
Nathan Letwory 7c133760bb Sequencer timeline didn't update on FPS or FPS Base changes in render settings. Missed notifier handling. 2010-09-27 22:01:06 +00:00
Brecht Van Lommel 969c0fd718 Fix #22894: sequencer drag & drop wasn't working anymore. 2010-07-21 17:37:40 +00:00
Campbell Barton b511fbea6d Sequencer display overlay option, this can show a border area from another time to help compare for color grading.
- Okey sets the border in the display.
- Okey resets the frame offset in the sequencer timeline.
- ghost icon in the header can enable/disable.
- frame offset can be relative or absolute (lock icon)

Not very happy that this commit adds a call to BKE_animsys_evaluate_animdata(scene, ...) in do_build_seq_array_recursively()
without this the offset frames dont have fcurves applied.
Though we will need something like this for prefetch frames to work too.
2010-07-08 10:03:29 +00:00
Campbell Barton ebde8a7ccc new notifier for FRAME_RANGE, use to recalculate the timeline scrollbar range. 2010-06-26 19:17:48 +00:00
Matt Ebb bfd0810beb Notifier cleanup - replaced ND_*_EDIT and ND_*_SELECT data notifiers
with the generic action equivalents (NA_EDITED and new NA_SELECTED)
2010-06-18 04:39:32 +00:00
Campbell Barton c2f36a4d6a naming changes
path -> filepath (for rna and operators, as agreed on with elubie)
 path -> data_path (for windowmanager context functions, this was alredy used in many places)
2010-06-14 03:52:10 +00:00
William Reynish 95bb364bda ***Drag and drop fun!***
Added ability to drag images and movies directly onto objects to assign them as textures.

You can drag them from the file browser, directly from the OS or even from other apps. Here's a video to demonstrate:

http://www.youtube.com/watch?v=fGe2U8F_JvE

Ton wanted to show me how to add it, but he ended up doing almost all of the coding himself ;)

Ton/Matt: Dropping a text file in the Text Editor fails for some reason. It aught to work - probably a keymap conflict of some sorts?
2010-05-09 18:07:17 +00:00
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