Commit Graph

42296 Commits

Author SHA1 Message Date
Lukas Tönne
fa9b5d5449 Fix T37939, concern raised in rBd9e0a94: Avoid access to linked node
tree ID data when freeing bNodeTree data blocks, while also making sure
localized node group copies get freed properly.
2013-12-28 14:54:53 +01:00
Campbell Barton
2654b28f04 Text3d: avoid calculating the font boundbox scale for every character 2013-12-28 19:45:54 +11:00
Campbell Barton
1aa62605cd Fix for text3d issue, \n was attempting to find a character too 2013-12-28 19:34:50 +11:00
Campbell Barton
1a91b8bd5d Fix for 3d fonts loading the character of the string terminator.
also remove redundant call to wcslen and ensure FT_Init_FreeType runs
once the font loads.
2013-12-28 19:06:45 +11:00
Campbell Barton
961d0409c8 3D Text: use ghash for character lookups 2013-12-28 17:40:13 +11:00
Campbell Barton
2b3fc4dea7 Fix for BKE_nurb_handles_autocalc using 2d tests on 3d data 2013-12-28 17:29:58 +11:00
Campbell Barton
6f5ced4a30 Math Lib: add dist_squared_to_line_v2, avoids sqrt in scanfill and 3d-text 2013-12-28 17:23:59 +11:00
Sergey Sharybin
602dcb47b0 Fix T36474: Blender 2.68a crashes upon rendering
Summary:
Original issue was caused by wring detection of whether
SS modifier is being applied for render/viewport. After
recent dependency graph commit this was no longer an
issue.

But it still might have happen conflict between viewport
draw and scene_update_for_newframe() invoked from render
thread when using external engines like Cycles.

Solved by adding viewport lock while scene is being
updated and objects being exported to the render engine.

Same lock was already used for Blender Internal.

Reviewers: brecht

Reviewed By: brecht

Maniphest Tasks: T36474

Differential Revision: https://developer.blender.org/D138
2013-12-27 18:52:41 +06:00
Sergey Sharybin
8632aab88d Remove TODO. Those args could be useful in the future. 2013-12-27 18:34:36 +06:00
Sergey Sharybin
8870af6d37 Typo fix in a comment 2013-12-27 17:09:19 +06:00
Campbell Barton
d09a8ea9e7 Code Cleanup: style 2013-12-27 14:21:03 +11:00
Sergej Reich
4841acbecd Rigidbody: Code cleanup
Make some functions private.
Remove unneeded nested if statements.
Avoid mixing short and bool.
2013-12-26 21:33:58 +01:00
Sergey Sharybin
79d8f1e4a5 Fix T37955: Freestyle render misalignment
Issue was caused by missing objects update for temporary
freestyle objects. This happened because of the fact that
such objects doesn't have any relations, as in they're
corresponding to root nodes in the DAG.

This situation wasn't handled by DAG_threaded_update_begin()
which considered there's only one root node in the DAG.
2013-12-27 02:32:56 +06:00
Sergey Sharybin
feac8ee090 Fix out-of-date comment which came from DAG-MT branch 2013-12-27 02:32:56 +06:00
Sergej Reich
ceb2430dd7 Rigidbody: Allow triangle mesh shapes to deform during simulation
Only supported when using the "Deform" mesh source.
2013-12-26 18:38:06 +01:00
Sergej Reich
c96601138d Rigidbody: Use own structure to store mesh data for collision shapes
This gives us better access to the data and should also be faster to
create.
2013-12-26 18:38:06 +01:00
Sergej Reich
2260a7dbc0 Rigidbody: Add option to choose mesh source for collision shapes
The options are:
Base: Base mesh
Deform: shape keys and deform modifiers
Final: All deformations and modifiers

It would be nice to have a way of specifying where exactly in the
modifier stack the collision shape is generated. However this is not
staight forward since the rigid body simulation is not part of the
modifier system and would require hacks to make it work.
2013-12-26 18:38:05 +01:00
Bastien Montagne
55397c690d Usual minor UI messages fixes... 2013-12-26 17:16:11 +01:00
Sergey Sharybin
6727bf3a21 Avoid temporary change of animation data flags for nodes filter
Use temporary runtime flag of filter_mode argument instead.

This commit also fixes some weirdo mix of filter_mode with
filterflag bits.
2013-12-26 18:50:22 +06:00
Sergey Sharybin
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
Sergey Sharybin
7025a1bd78 Fix T37945: Crash after undo
Issue was caused by some typos in readfile.c made in
original commit of image cache rewrite.
2013-12-26 16:34:57 +06:00
Campbell Barton
bc1eb0bf0a Simplify isect_point_poly_v2 functions using angle_signed_v2v2 2013-12-26 20:07:44 +11:00
Campbell Barton
db8293d456 Polyfill: minor changes to which fix rare errors with float precision 2013-12-26 12:21:40 +11:00
Campbell Barton
af32c1c77b Fix T37946: Error filling ngons 2013-12-26 12:06:52 +11:00
Campbell Barton
ef9a9428a5 correction to last commit 2013-12-26 09:46:25 +11:00
Campbell Barton
282b99353c Correct alloc string and comment in makesdna 2013-12-26 09:29:25 +11:00
Campbell Barton
d9e0a94675 Fix T37939: Crash on exit (reading from freed node trees) 2013-12-26 08:57:44 +11:00
Campbell Barton
ca36091266 correction to last commit 2013-12-26 08:37:28 +11:00
Campbell Barton
7a3594dbd7 BGE: Add missing NULL check from recent LOD updates 2013-12-26 08:28:00 +11:00
Campbell Barton
a5606fadbb Code Cleanup: remove object arg to CDDM_from_mesh mesh_create_derived 2013-12-26 08:27:08 +11:00
Sergej Reich
07ebe89364 Missed this in last commit 2013-12-25 19:25:46 +01:00
Sergej Reich
1fef90695e 3D View: Draw rigid body collision shapes. 2013-12-25 19:17:00 +01:00
Sergej Reich
c15062015c 3D View: Fix drawing bounds for game engine
Needs to be drawn around the origin to accurately represent collision
shapes.
2013-12-25 19:17:00 +01:00
Sergey Sharybin
e5aaa9d387 Code cleanup: no need to switch to threaded alloc, it's done by task pool 2013-12-25 20:35:20 +06:00
Sergey Sharybin
64aef25b83 Use generic task scheduler for threaded image processor
It allows to schedule tasks of smaller size without having
threads overhead or extra worry about splitting tasks into
smaller pieces.

This simplifies code in color management which was manually
splitting task into smaller chunks to keep memory usage low.

Further optimization is possible by avoid malloc called from
threads, but that's how it used to work for ages already
and would be optimized as a separate patch.
2013-12-25 20:32:13 +06:00
Sergey Sharybin
cdd95e354e Motion tracking curves: correct some operator's poll functions
Curve selection and transform were allowed in cases track's motion
curve wasn't visible.
2013-12-25 19:36:54 +06:00
Sergey Sharybin
28b671d98f Implement per-frame track reprojection error visualization
It is now possible to display per-frame track reprojection
error in curve view of clip editor. Simply enable corresponding
option in filter buttons.

Currently displayed using blue color which might confuse with
average reprojection error, further color tweaks are possible
and easy.

Also changed icon track x/y curves. Better icons here are
really appreciated.
2013-12-25 19:24:04 +06:00
Sergey Sharybin
122e2b4bfa Fix T37709: Memory corruption when freeing custom bone shape objects
Summary:
Issue was caused by access to pchan->custom object from channel free
function when freeing all objects from main. Order of objects free
is not defined and such an access might easily end up with access
to freed memory.

We don't need to do user counter stuff when freeing main, so added
an _ex functions with do_id_user flag which is used when freeing main.

We had the same issue with other datablocks, so now it should be
easier to support relevant user counter.

This issue was caused by the fix for T36391, so perhaps that's indeed
high time to do real user counter.

Reviewers: brecht, campbellbarton

Reviewed By: campbellbarton

Maniphest Tasks: T37709

Differential Revision: https://developer.blender.org/D137
2013-12-25 16:43:26 +06:00
Campbell Barton
7f4533fa49 String API: BLI_ascii_strtolower/upper now check NULL terminator
This wasn't needed before now, but since recent change to bUnit_ReplaceString,
it uses in a context where NULL terminator is expected - best add.
(spotted by Sergey)
2013-12-25 01:20:46 +11:00
Campbell Barton
3ffba79ac6 Fix for own recent commit 2013-12-24 18:56:07 +11:00
Campbell Barton
8901701808 UI: Display alpha checkers in image info's color swatch. 2013-12-24 17:20:37 +11:00
Campbell Barton
8a3d3de3ae UI: fix for slight glitch drawing image info
Using sub-pixel position made the text clip badly sometimes.
2013-12-24 15:06:38 +11:00
Campbell Barton
d064968c27 Fix T37914: Mask modifier behaves differently until painted 2013-12-24 14:39:14 +11:00
Campbell Barton
04a902965e BMesh optimize face splitting by taking loops rather then verts
- add BM_vert_pair_share_face
- add BM_loop_is_adjacent
- remove BM_verts_connect
2013-12-24 11:13:58 +11:00
HG1
d94db03ac8 Style cleanup: BGE 2013-12-24 05:44:54 +11:00
Campbell Barton
0a5e00e8e8 Code Cleanup: style 2013-12-24 05:04:29 +11:00
Simon Repp
632c29fef3 UI: communicate external data autopack better in the UI.
Previously there was no way to see if autopack was enabled. Now the external
data menu has 3 entries instead of 2:

* Automatically Pack Into .blend (with checkbox to indicate autopack on/off)
* Pack All Into .blend
* Unpack All Into Files

Fixes T37608, includes modifications by Brecht from the original patch.

Reviewed By: brecht

Differential Revision: http://developer.blender.org/D118
2013-12-23 18:55:48 +01:00
Sergey Sharybin
3cc7978f19 Move python threading stuff to own file in bf_python_ext
This way blender player can easily use BPY_thread_save/restore.
Not so much important for master branch, but crucial to solve
linking issues in threaded depsgraph branch.
2013-12-23 23:14:10 +06:00
Sergey Sharybin
890be761f5 Make makesdna capable of detecting 32bit alignment issues on 64bit platform
Summary: Just some extra comparison between native and 32bit structure length was needed.

Reviewers: brecht, campbellbarton

Reviewed By: brecht

Differential Revision: http://developer.blender.org/D131
2013-12-23 21:37:39 +06:00
6c1525c99f Fix compile error on 32 bits linux / windows, wireframe modifier needs padding.
Thanks to Scott Petrovic and Jia Wang for submitting fixes.

Differential Revision: http://developer.blender.org/D126
Differential Revision: http://developer.blender.org/D130
2013-12-23 15:50:30 +01:00