Commit Graph

624 Commits

Author SHA1 Message Date
af93ebcb50 Code Cleanup: style and redundant casts 2014-01-16 19:15:53 +11:00
50650e28ea Events: support for buttons 6 & 7 (some trackballs have these) X11 only
Patch by Marcus von Appen

Note: this patch makes ISMOUSE accept INBETWEEN_MOUSEMOVE as a mouse
event where before it didnt.
2014-01-12 00:40:23 +11:00
1a0c5eb83a Events: Use INBETWEEN_MOUSEMOVE for inactive windows too. 2014-01-12 00:30:16 +11:00
09d6ad6142 Fix T38108: blender freeze in remembering operator properties. 2014-01-08 17:54:49 +01:00
709041ed0b Threaded object update and EvaluationContext
Summary:
Made objects update happening from multiple threads. It is a task-based
scheduling system which uses current dependency graph for spawning new
tasks. This means threading happens on object level, but the system is
flexible enough for higher granularity.

Technical details:

- Uses task scheduler which was recently committed to trunk
  (that one which Brecht ported from Cycles).

- Added two utility functions to dependency graph:
  * DAG_threaded_update_begin, which is called to  initialize threaded
    objects update. It will also schedule root DAG node to the queue,
    hence starting evaluation process.

    Initialization will calculate how much parents are to be evaluation
    before current DAG node can be scheduled. This value is used by task
    threads for faster detecting which nodes might be scheduled.

  * DAG_threaded_update_handle_node_updated which is  called from task
    thread function when node was fully handled.

	This function decreases num_pending_parents of node children and
	schedules children with zero valency.

    As it might have become clear, task thread receives DAG nodes and
    decides which callback to call for it.

    Currently only BKE_object_handle_update is called for object nodes.

    In the future it'll call node->callback() from Ali's new DAG.

- This required adding some workarounds to the render pipeline.
  Mainly to stop using get_object_dm() from modifiers' apply callback.
  Such a call was only a workaround for dependency graph glitch when
  rendering scene with, say, boolean modifiers before displaying
  this scene.

  Such change moves workaround from one place to another, so overall
  hackentropy remains the same.

- Added paradigm of EvaluaitonContext. Currently it's more like just a
  more reliable replacement for G.is_rendering which fails in some
  circumstances.

  Future idea of this context is to also store all the local data needed
  for objects evaluation such as local time, Copy-on-Write data and so.

  There're two types of EvaluationContext:

  * Context used for viewport updated and owned by Main. In the future
    this context might be easily moved to Window or Screen to allo
    per-window/per-screen local time.

  * Context used by render engines to evaluate objects for render purposes.
    Render engine is an owner of this context.

  This context is passed to all object update routines.

Reviewers: brecht, campbellbarton

Reviewed By: brecht

CC: lukastoenne

Differential Revision: https://developer.blender.org/D94
2013-12-26 17:24:42 +06:00
6976866d5a User Interface: Ctrl+C over a menu copies the py command
also use bools rather then ints
2013-12-05 17:26:03 +11:00
02f90c0001 User Interface: don't show macro args in tooltips
was often making much too big strings to show in a tip.
2013-11-26 09:00:24 +11:00
63caaa2b12 Code Cleanup: rename vars for detecting change to be more consistent
rename change/is_change/is_changed/modified -> changed
also use bools over int/short/char and once accidental float.
2013-11-26 06:39:14 +11:00
ad34a5cc1b Fix [#34675] *AFTER 2.69* Info view shows duplicate operators with incorrect values of args
Refactored a bit WM api to generate operator's pystring, now it can also handle correctly macro operators. Thanks to Campbell for the review!
2013-11-06 20:56:18 +00:00
61161bf869 fix for building with some configurations 2013-09-30 09:34:13 +00:00
9d6f05edb8 fix relating to bug [#36758],
When printing operator reports, ommit unset properties.
This is needed because in some cases operators check if a value is set or not, so filling in default arguments may change behavior.
2013-09-18 01:22:28 +00:00
23626e0149 fix [#36444] view3d.viewnumpad operator should not animate
when running viewport operations with exec() rather then invoke(), perform the action immediately rather then using smoothview.
makes viewport operations usable from python scripts.
2013-09-16 04:04:44 +00:00
ec2464ac5f code cleanup: unnecessary shadowing and some minor pep8 edits. 2013-09-12 19:51:31 +00:00
83b2eefd09 Usual UI messages fixes... 2013-09-09 20:22:01 +00:00
35cd649c66 rename cursor setting functions to make modal set/restore more clearly related functions. 2013-09-06 22:34:29 +00:00
c0ca93c9b2 Add poll message when poll fails because of window missing from the context.
This means calling invoke operators from python in states that dont support will give a meaningful error message.

also reduce context lookups when polling.
2013-09-02 19:28:44 +00:00
4d2b50ad74 remove unused function. also typo 2013-08-27 23:34:16 +00:00
8ef934c73f ghash/bli-listbase edits, rename BLI_ghash_pop -> BLI_ghash_popkey (since it takes a key as an arg and isnt popping any element from the hash as you might expect).
add BLI_pophead/tail, since getting the first element from a list and removing it is a common task.
2013-08-26 23:37:08 +00:00
cdd57d4994 fix for error reading from freed memory when deleting a screen, would free then notifier then check its contents in the notifier queue loop. 2013-08-26 22:48:14 +00:00
43ab02db14 code cleanup: remove redundant NULL checks 2013-07-31 09:18:40 +00:00
02608d257a add api call for initializing events from the windows eventstate. 2013-07-29 08:29:04 +00:00
9b16b105f1 avoid calling context functions when direct access is possible. 2013-07-23 18:30:06 +00:00
7db1d6556d code cleanup: add break statements in switch ()'s, (even at the last case). 2013-07-21 08:16:37 +00:00
397da50002 style cleanup: switch statements, include break statements within braces & indent.
also indent case's within the switch (we already did both of these almost everywhere)
2013-07-19 15:23:42 +00:00
42f6136da8 Fix #35991: show warning message to when trying to edit driven values in number buttons. 2013-07-03 20:37:07 +00:00
83411dab07 fix for crash in demo-mode, caused by r51702 2013-07-02 05:54:28 +00:00
4d5fffa1a9 Fix #35809: dragging a non-active node in the node editor did not work reliably.
Disabled timer events from the properties editor were cancelling gestures.
2013-06-27 15:07:27 +00:00
6268434eee Fix part of #35859: lib linking errors were not shown when opening files through open recent. 2013-06-25 13:39:51 +00:00
02fbfa5c70 Fix unnecessary 3D viewport redraws in various cases, in particular when editing
node materials.

Area and region listener callbacks now get the screen and area pointers passed, so
they can do more fine grained checks to see if redraw is really needed, for example
depending on the 3D view drawtype.
2013-06-24 22:41:33 +00:00
c24be7ec6e Usablity:
Textbuttons: double click now selects entire words (like on file path segements)
Triple click was requested too, but that's not a WM event type yet.
2013-06-07 15:42:26 +00:00
0c004723fe fix [#35434] Segmentation fault switching screen layout from python
(take 2), only free popup handlers.
2013-06-02 20:59:00 +00:00
7e9fdd97ba fix for incorrect type casting when checking macros exec() functions.
infact this worked by accident, but didn't crash.
2013-05-25 22:07:21 +00:00
b6a4ea3d95 Bug fix #35481
Browsing screens via menu disabled screen editing (area divider drag) and made
popup menu hanging (select same editor for example).

Caused by bug fix #35434, commit gets rewinded, and report reopened.
2013-05-23 15:10:36 +00:00
5cdddb12d9 fix [#35434] Segmentation fault switching screen layout from python 2013-05-20 05:06:52 +00:00
c70a900736 More work on 3d view render:
- reverted fix for bug 32537 (error report drawing after thread job didn't show)

  This solves very bad 3d view render updates while using transform, it was
  getting into an eternal feedback loop for dependencies. (jobs sending mousemoves
  causing jobs to end, causing mousemoves, causing etc).
  
- The render-update code was not going over all windows, but over every screen to
  send signals (also the invisble ones)
2013-05-17 16:46:59 +00:00
ebda20150d fix for crash with toggle-drag on a popup (when the popup is closed while dragging). 2013-05-17 13:54:44 +00:00
2914d15241 Fix #35337: sculpt performance regression, partial redraw was not working anymore
due to paint cursor redraw problem.
2013-05-13 13:32:42 +00:00
12db4f3eae Revert fix for #34822
Allowing any-key modifiers to work is cool, but this needs more work.
My previous fix made overlapping key presses (where you release key 1
just after pressing key 2) to not register as valid shortcuts.
2013-05-02 15:10:24 +00:00
6d83322841 add support for macro redo if all operators in the macro have an exec()
this fixes [#35079]
2013-04-26 17:36:54 +00:00
feeab1ad53 Fix #34997: when starting the game engine in one window and switching to a second
window, the game would stop drawing in the first and mess up the OpenGL state of
the second.

Also fixes glPushAttrib/glPopAttrib getting out of sync in some cases.
2013-04-18 16:28:39 +00:00
58a00e7396 Bug fix #34822
Tiny tweak in "Any key modifier" code. It now refuses to accept events when you hold
any key, and then press another key - unless that has key-modifier set.

This enables Houdini style "Hold Spacebar - Leftmouse" view moves.
2013-04-18 14:55:04 +00:00
85e53317be fix for bug where notifiers could hold pointers to freed data which listeners would operate on. 2013-04-08 13:03:04 +00:00
677172fd65 code cleanup: use bools in interface handlers, dont show translation menu when right clicking on splash, use less confusing args for copy/paste function. 2013-04-04 15:16:29 +00:00
7bbaf4853a code cleanup: use bools in UI and WM code, quiet some shadow warnings, remove unused function uiEmboss() 2013-04-04 02:05:11 +00:00
1165236f69 Usablity:
In text editor, the CTRL+F find now opens property region (or keeps it) and
activates the search button for input.

That's already nice! But next step should be to do a search on exit of 
the button (or while typing). That's stuff I need Campbell to help with though.

Notes:
- Probably Py api for property buttons could get an "operator=" arg?
- The warning menu "not found" should go away
- I also suggest to make "wrap" search default for new editors
2013-03-24 13:43:40 +00:00
88cf1a2bc7 Screen: add exit callback for area and region types, this gets called when
hiding or removing an area or region.
2013-03-15 19:56:29 +00:00
aaa8a13c49 code cleanup: use const events for modal and invoke operators. 2013-03-13 09:03:46 +00:00
a02c8c4177 move toggle drag into a UI handler (was modal operator) 2013-03-03 03:29:57 +00:00
e672e7a070 Small tweak in event debug printing:
- missing print for case event gets handled AND passed on (selecting)
2013-02-12 19:08:04 +00:00
e1419a5bea Fix #34126: report list memory leak when calling operator from python and the
operator context poll failing.
2013-02-12 16:04:58 +00:00