Commit Graph

303 Commits

Author SHA1 Message Date
5fa7d1c1b4 2.5: code changes to reduce the usage of G.main and pass it along
or get it from the context instead.
2010-08-01 12:47:49 +00:00
f7298287b3 Bugger... msvc didn't bail out on these... 2010-07-19 11:47:46 +00:00
5f1246f62a Small feature for the Durian guys:
Playback Jog Keys:
ALT+LEFTARROW: play backward (hit again for double speed)
ALT+RIGHTARROW: play fordward (hit again for double speed)
ALT+DOWNARROW: start/stop animation
2010-07-18 14:46:52 +00:00
82e7d6d332 Merging revision 30461 from my GSoC branch, log: Fix for msvc which not has the round function. 2010-07-18 08:19:44 +00:00
fd31436897 spelling correction: alredy --> already 2010-07-17 18:08:14 +00:00
e86b78c47c Merging revision 30264:30270 from my GSoC branch to trunk, logs:
Bugfix for [#22284] Blender cursor gets stuck in the timeline when scrubbing (jack transport).

Dirty hack fix for:
* [#22366] Cutting audio and meta strips with audio does not actually cut audio
* [#22639] Audio not clipped to meta bounds

Also fixed a seemingly symptomless bug in sequencer_edit.c
2010-07-13 15:19:15 +00:00
59b8f8d18c Fix #21201: double click didn't use the original mouse position, now
it stores it and sets it later when the double click event is handled.

Decided to not reuse prevx but made prevclickx, because there may be
multiple mousemoves between the two clicks, and prevx is already used
for some other tricky things.
2010-07-05 16:42:42 +00:00
15be7b215f - changes to the sequencer so new strips use the data name.
- removed the name option for the sequence operators.
2010-07-02 20:09:42 +00:00
f507428d11 Fix #22553: dragging number buttons would run update functions more often than
necessary due to the more accurate mouse move events that are useful for
sculpting and painting (at least on Linux/X11, not sure about other platforms).
If the update function takes a while to run, this in turn causes more mouse
move events to be accumulated, making things even slower, .. going into a spiral
of slower and slower redraws.

As a solution I've added a INBETWEEN_MOUSEMOVE event next to MOUSEMOVE. A
MOUSEMOVE event is automatically changed to INBETWEEN_MOUSEMOVE when a
MOUSEMOVE event is added after it. This new event type is only handled by
painting/sculpting operators, everything else can happily ignore it.
2010-06-23 18:47:56 +00:00
08c4725a13 workaround for crash when notifiers cause a scene update at the same time rendering starts.
happens when changing frame and pressing render quickly on a slow scene.

for now ignore animation updates while rendering.
2010-06-14 15:02:16 +00:00
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
d57ebc4ecc Fix [#22413] drag & drop images don't work untile you move the object 2010-06-07 07:47:27 +00:00
b4f12db4ec Don't report the python code for operators type which don't have the
'REGISTER' flag set.
2010-06-06 08:52:33 +00:00
21d112c36f Reworked the non-blocking reports display in the info header:
* Now it displays the last report from the global list, not just from operators
* Rather than disappearing when a new operator is run, it stays until it times 
out or a new report is added
* Fun animated transitions ;)
http://mke3.net/blender/devel/2.5/reports_header.mov

Now need to investigate report usage with popups. Ideally we can have most
 reports non-blocking, so they're less intrusive, only popping up for dire errors.
Problem is many things in Blender right now are marked as RPT_ERROR 
when probably RPT_WARNING is more appropriate. Should probably keep 
RPT_ERROR for things that demand immediate attention.
2010-06-03 07:27:55 +00:00
716e9c5f47 Fix case of accessing freed windowmanager memory after reading a file. 2010-04-20 14:58:46 +00:00
3a04262c4c Added ability to use up to F19 on the keyboard (previous max was F12).
GHOST is already collecting up to F24, but I've only got up to F19 on this 
keyboard so I've just committed what I could test here.
2010-04-20 00:08:27 +00:00
42db34b126 three things:
- ALT+Scrollwheel zooms backdrop in node editor
- Blender -d debug print will also print every event except mouse moves
  (needed to debug WM, some events are catched by OS)
- Changed order of keymaps... the default maps now are evaluated *after*
  the own custom maps, so you can make overrides or defaults.
2010-04-08 16:36:50 +00:00
eedce6b322 Bringing back code style to how WM was made.
Check this diff to see difference... mixed styles in 1 file are not OK!
2010-04-08 13:12:53 +00:00
23e6ada74f bugfix [#21929] linking in groups into a linked in scene is possible and those groups can't be deleted
- Disallow this and report a warning in the console when it happens.
 - File selector operators now report in the global report console.
 - Cleared some warnings.
2010-04-08 11:46:52 +00:00
50726e7eb3 Fix [#21677] mouse dragging the translated object doesn't release the object
after a while

Drag code was inadvertently changing the eventstate->type, which isn't 
necessary. Patch #21723 by Anthony Edlin fixes this. Thanks!
2010-04-07 05:39:24 +00:00
824be96dc0 More work on Drag Immediate:
- Rename option and flag to something more sane
- Add property to manipulator operator and set true by default

Confirm on Release can now be forced true or false per operator, in which case it won't use the default value (the user preference).
2010-04-03 17:38:43 +00:00
df827a6400 move operator reports into a global list so they display in the console. 2010-04-01 13:54:53 +00:00
93c7b8a2d0 remove unused includes UI_*.h, WM_*.h, ED_*.h 2010-03-24 10:56:37 +00:00
09b1c681e1 Sculpt Mode Bugfixes:
* #20833: layer brush doesn't work with multires.
* #20946: sculpt mode partially removes parts of the mesh in the viewport.
* #20420: grab brush stops after moving some distance.
* #20906: sculpt grab tool moves in wrong direction.
* #21132 and #21272: undo on object with subdivision surface modifier crashes.
* #21115: subsurf + multires + sculpting + undo causes crash.
* #20683: sculpt + multires apply + undo crash.
* #19094: wrong outline in solid mode.
2010-03-22 11:59:36 +00:00
42ac4a3e7d Fix syntax for ID keyword. 2010-03-21 01:14:04 +00:00
64078786cc Fix #20486: blender hangs upon import attempt of an .obj with >40k polys.
Added automatic generation of lookup_int callbacks for collections, for
quicker lookup by index instead of looping over the whole thing. Import
is still quite slow, though now it only takes a few seconds.

The next bottleneck seems to be running update (depsgraph, notifiers, ..)
on setting every property. I fixed part of that by avoiding a notifier
to be added each time, now it checks for duplicates.
2010-03-14 22:30:57 +00:00
1337867378 Fix #21183: info stats not updated immediately on undo. 2010-03-12 12:09:06 +00:00
4ef1fd1078 game engine support for recording animation back & some other minor changes. 2010-02-22 12:25:58 +00:00
e722806cf7 - Jack transport update: Moving the playhead in another jack app when not playing back now triggers an update in blender.
- Missing stub fix from last commit by nazg-gul, blenderplayer works now atm.
2010-02-22 09:01:49 +00:00
38ef2df8f7 2.5 Audio:
* Jack Transport support!
* Minor sequencer audio corrections.
2010-02-21 18:01:41 +00:00
b9da824821 [#21197] change layer of just linked in objects lets them vanish
missing undo push in file selector.
2010-02-17 12:21:38 +00:00
081c1205a3 correct fsf address 2010-02-12 13:34:04 +00:00
586acf21a7 Cocoa : use Cocoa NSWindow tag for identifying the window where a mouse/tablet/key event happened => enables some actions in inactive windows as per OSX standard
Previous code was assuming an event can only be sent from the active window.
On OSX, Right, Middle mouse buttons, mouse wheel and trackpad events are sent to inactive windows too.

For example, this allows to zoom, pan the view without changing the window order.
2010-02-10 14:16:02 +00:00
2f72b91a54 Operator Execution Contexts Bugfix:
This commit adds a few more execution contexts for operators, given the increasing tendency for some special regiontypes to exist within areas that must have their own set of special operators. 

Examples of these include the "channel" operators in the Animation Editors (i.e. those in the 'Channels' menu), and the "Fit to Preview Window" operator for the Sequencer.

Previously, operators such as these would not function when clicked on from the menus, and they would not show the hotkeys they were mapped to.


Also, fixed a few operator definitions in the Animation Editors which were missing ot->prop defines. This meant that some hotkeys (mainly selection) were shown incorrectly in the menus.
2010-02-07 23:39:44 +00:00
bfdf6d139e Remove NO_CONTEXT flag from enum when copying operator properties to the operator itself. 2010-02-01 18:26:45 +00:00
1d4778ee90 Fix #19888: tooltip would stay visible when starting e.g. panning the
view, and be stuck there permantenly when leaving the region. Now the
button interaction is cancelled when starting a modal operator, not too
happy about this, but couldn't think of another way to detect this well.
2010-01-31 23:33:04 +00:00
8d513efdb0 Fix snap to grid not taking the current grid resolution into
account in quad split 3d view. Now WM_OP_EXEC/INVOKE_REGION_WIN
context stays in the current region if it is already a region
of type window, so the operator gets executed in the right context.
2010-01-31 16:59:21 +00:00
e803c03308 Two fixes, errors caused by drag n drop commit:
- Icons for brushes disabled List Box to work (paint buttons)
- Mouse-release in secondary Blender windows didn't get registered
  in window where mouse-press initiated.

And fixed annoyance: adding image strip makes it 25 frames long, so
you can drag and extend it easily.
2010-01-29 16:25:31 +00:00
01ea2175db Fix #20327: uv smart project options can't be tweaked.
Python operators calling C operators would get too many undo pushes,
causing redo of the python operator not to work. Now the depth of
operator callbacks is counted to detected nested calls, and in that
case skip the undo/register here, and only do a single undo/register
for the mother operator.
2010-01-29 13:06:50 +00:00
883518d782 Bug fix: the new code that allows button highlights in other windows, should
not do this while modal handlers are running
2010-01-28 16:57:37 +00:00
74b2d3681e missing parenthesis broke os x compile. 2010-01-27 19:46:12 +00:00
a46f36b19c [#20792] MMB emulation, release broken
Store last mmb event value to make emulation work when modifier keys are released first.

This is done in a not so nice way for now. Eventually, I'd like for emulation keys to have their own data structures (user creatable and all that)
2010-01-27 17:01:41 +00:00
b9cad87243 missing check for NULL poll for wmPaintCursorDraw which is allowed.
would crash when in transform and moving the mouse over another window.
2010-01-27 09:36:28 +00:00
904665f15b [#20728] "Export UV Layout" overwrites existing files (without feedback)
The 'save over' popup was only appearing based on a string comparison of the operator name ("Save"). Changed this to use a hidden operator property: "check_existing". Python operators must 
have this property for the file selector confirmation too.

This property can also be set to false, to prevent checking for existing files, useful in the File->Save menu item to prevent the dangerously missable confirmation popup.
2010-01-27 02:20:24 +00:00
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
b400703403 Macro operator properties using property groups in groups (initial code by brecht).
Works correctly with menu, keymap definitions and keymap export/import.

Properties set in the macro definition overwrite those set by the user (there's no way to see that in the UI at this point).

MISSING: Python operator calling code to fill in the properties hierarchy.

Also contains some keymap export changes by Imran Syed (freakabcd on irc): the exported configuration will use the name of the file and the exported script will select the added configuration when ran.
2010-01-21 21:58:40 +00:00
bd6ce45ef4 Fix [#20129] emulate numpad
Converted Command+LMB to send a RMB click event on Mac OS X, if Emulate 3 Button Mouse is switched on.


Also fixes for previous commit, didn't all go through.
2010-01-15 06:17:28 +00:00
e9e89ecfc3 [#20672] TimeLine (arrows will not proceed animation)
RNA notifiers don't have a window and didn't get picked up correctly by the animation redraw system. If there's no window defined in a scene notifier, handle it anyway if the scene matches (or if there aren't any).
2010-01-14 19:53:26 +00:00
9e79f2d92a [#19978] Can not switch view with keymaps while emulate numpad is activated; in modes other than object and edit
Was caused by event emulation (numpad and mmb) happening separately at each level of the keymap, so brush selection was latching on the event before it had time to test emulated values with view navigation entries (at a lower level in the hierarchy).

After discussion with Matt, decided that event emulation should be done at the root of the event loop, replacing the event with the emulated values. This is much more predictable and more logical as far as event emulation goes.
2010-01-14 18:15:12 +00:00
b886f7ada0 Fix for previous properties editor crash, only remove ui handlers
on new screens. Was preventing openGL render and possibly other 
things from working
2010-01-14 05:21:20 +00:00