Commit Graph

49420 Commits

Author SHA1 Message Date
Campbell Barton
b4ae05e4db BMesh: optimize lookups for triangle fill 2014-02-02 17:09:38 +11:00
Campbell Barton
c4345a808c Smallhash: add reserve option to avoid resizing when size is known 2014-02-02 17:08:26 +11:00
Campbell Barton
dcd90d67c8 Smallhash: fixes/improvements
- use magic numbers based on uintptr max, not uint max, to avoid possible collisions with real pointer values on 64bit systems.
- comment BLI_smallhash_remove for now, its not used.
- added smallhash_val_is_used replacing ELEM() checks
- updated docs
2014-02-02 16:24:33 +11:00
Campbell Barton
7c9b106589 Smallhash: optimizations
- remove static array used only for copying (use alloca on resize)
- set SMSTACKSIZE to one of the values in 'hashsizes' since the full available size was never used.
- ensure ~1.5x as many buckets as entries, was 3x which caused malloc's quite early on.
2014-02-02 02:24:48 +11:00
Campbell Barton
a1a0ebbf49 Code cleanup: use length squared where possible 2014-02-02 02:24:48 +11:00
Campbell Barton
798e684c7c Math lib: simplify size_to_mat4 and use in b_bone_spline_setup 2014-02-02 02:24:47 +11:00
Campbell Barton
5fce3457b7 Math lib: add axis_angle_normalized_to_quat, use when length is known 2014-02-02 02:24:47 +11:00
Bastien Montagne
a9e7c7b848 Fix T38432, Fix 38432: more stupid error in view3d ray code, sorry about that. 2014-02-01 15:06:13 +01:00
Jens Verwiebe
62a3fe2323 Fix player stub after type change 2014-01-31 20:56:51 +01:00
Campbell Barton
70f2389f5a Code cleanup: be less vague checking invalid index values 2014-02-01 02:01:00 +11:00
Campbell Barton
1af6e656ec Fix for error setting unique names for tracks 2014-02-01 02:01:00 +11:00
Campbell Barton
34a0532584 Code cleanup: comments and warnings 2014-02-01 02:01:00 +11:00
gaiaclary
d291d15c19 Fix for T32843
Exported angles for spot size animation is in radians , however Collada expects it to be in degrees.
This patch is for fixing import and export, and also renaming a variable

Reviewers: gaiaclary

Reviewed By: gaiaclary

Differential Revision: https://developer.blender.org/D273
2014-01-31 09:35:00 +01:00
Campbell Barton
a7b1349ce4 Events: fix for wmEvent prevx, prevy not updating 2014-01-31 07:42:34 +11:00
Bastien Montagne
1e096ee816 More snapping fixes (this is ridiculous).
I hope this time we are done!
2014-01-30 18:50:12 +01:00
Campbell Barton
0e1c1b6196 Code cleanup: remove BLI_has_parent 2014-01-31 03:30:05 +11:00
Campbell Barton
3c86a1932f Code cleanup: add BLI_testextensie_n, replacing multuple calls to BLI_testextensie
also use attributes for BLI path functions
2014-01-31 03:30:05 +11:00
Bastien Montagne
0cb49286ce Fix T38409: Snapping Bug
Issue partially caused by own errors (glicth in new BKE_boundbox_ray_hit_check() code causing segfault in volume snapping,
and we have to treat ortho and persp differently in case of face snapping, because in persp our ray_start might very well
already be *inside* the boundbox of the checked object), and partly due to the fact that ED_view3d_win_to_vector()
was returning wrong vector (negated one) for ortho views (see previous commit).
2014-01-30 17:16:07 +01:00
Bastien Montagne
f54ed9f5e0 Fix a nice bug in ED_view3d_win_to_vector() - vector returned for an ortho view was negated compared to vector returned for the same view in perspective...
Found while working on snapping issues, confirmed using bisect tool: previous to this commit, inner/outer parts were swapped when switching from otho to persp!
2014-01-30 16:51:44 +01:00
Campbell Barton
2011156eec Fix for crash linking node groups through bpy.data.library
Defer creating the Python objects until after appending is finished
because NodeTree's types are not initialized until then.
2014-01-31 00:56:19 +11:00
Lukas Tönne
2b55d7895c Fix T38403: Laplacian smooth on instanced objects leads to crash.
The laplacian modifiers (smooth and deform) use the OpenNL library,
which is not threadsafe due to the use of a global context variable.
Ideally this would be changed so that an explicit context can be
created for every caller of the OpenNL functions, but since OpenNL's
most recent version is from 2010 this is unlikely to happen.

As a workaround for now just use a mutex to prevent conflicting OpenNL
calls. Eventually OpenNL can be replaced by eigen or ceres.
2014-01-30 13:09:32 +01:00
Bastien Montagne
810c6d1880 Fix T38358: typo in own rB77089a3bf203.
Also allowed me to fine another potential issue, hit.dist was no more initialized correctly - and I had forgotten to take into account Brecht's remark about normalize_v3() also returning the vector's previous length.
2014-01-30 11:54:55 +01:00
Campbell Barton
1f64371ec0 Smallhash: refactor and fixes
- BLI_smallhash_remove didnt decrement total entries.
- rename vars to match closer to ghash.
- smallhash_lookup returns NULL when no entry found.
- using a zero value key wasn't supported.
- no need to memset or calloc bucket arrays
- add asserts for unsupported conditions.
- added BLI_smallhash_lookup_p
2014-01-30 21:10:55 +11:00
Campbell Barton
ab6157a06a PyAPI: noise.seed_set(), note that zero is a special case. 2014-01-30 17:56:07 +11:00
Campbell Barton
bd697dd4d7 Fix T38402: invalid message for bad type assignments (Quat, Vector) 2014-01-30 16:45:20 +11:00
Campbell Barton
5f47f1370e UI: move toggle icons out of layout checks into rna 2014-01-30 16:24:51 +11:00
Campbell Barton
9598990b9b UI API: don't use a text label when icon_only is set 2014-01-30 15:28:39 +11:00
Brecht Van Lommel
dd684f5a04 Fix T38400: crash in image_listener accessing deleted object.
Listeners should never dereference this pointer because the object may have
been deleted, it can only be used for comparisons.
2014-01-29 20:29:30 +01:00
Bastien Montagne
77089a3bf2 Fix T38358: Face snapping fails on Orthographic view
Issue is caused by start point of ray used to detect faces under the mouse is set rather far away in ortho 3dviews.
The loss of precision on the ray location induced by this can lead to face snapping failures.

Solution is to do the raycasting with a temp start point, much closer to the object we check, and add back
to the found distance the diff to the real start point once detection is done (as we need all hit distances
from all tested objects to be relative to a common point!).

Note this commit only addresses the "face snapping on mesh" case, other kind of snapping do not seem to suffer
from this issue.

Reviewers: brecht, campbellbarton

Differential Revision: https://developer.blender.org/D268
2014-01-29 20:10:03 +01:00
Brecht Van Lommel
95e153a319 Fix T37661: color ramps and curve mapping editing not disabled for linked data. 2014-01-29 19:02:32 +01:00
Lawrence D'Oliveiro
8ba9702284 Code cleanup: remove redundant makesrna call with platform "linuxcross".
Reviewed By: brecht

Differential Revision: https://developer.blender.org/D235
2014-01-29 18:29:20 +01:00
Brecht Van Lommel
fa0d65d512 Fix accidental description change in recent commit. 2014-01-29 18:28:09 +01:00
Brecht Van Lommel
6c329304c1 Fix bone transform issue where the bone roll depends on intermediate mouse positions.
It computed the roll compatible with the previous mouse position roll value,
now it uses the initial roll value.
2014-01-29 17:03:16 +01:00
Brecht Van Lommel
289c5de7d8 Fix T38359: incorrect display of material slot with pinned particle settings.
Just hide it in this case, the material slot is not really valid without an
object in the context.
2014-01-29 16:50:37 +01:00
Brecht Van Lommel
299180f3c6 Fix T36955: API docs referred to sys.maxint which does not exist in Python 3. 2014-01-29 16:49:12 +01:00
Brecht Van Lommel
1e0654f162 Fix T38393: bone roll not restored properly after cancelling rotation of bones. 2014-01-29 16:14:21 +01:00
gaiaclary
41ee052a45 renamed unclear API parameter 2014-01-29 15:37:02 +01:00
Sergej Reich
f17a1bd58b Fix T38388: Creating a new scene with full copy sets rigidbody collision shapes to box.
Tweak world rebuilding logic, so it's not done before object data was
updated.
2014-01-29 15:03:41 +01:00
Campbell Barton
9612433884 UI: minor optimization for button lookup, break early when button found
also reduce int/float conversion
2014-01-29 23:05:32 +11:00
Sergey Sharybin
5c750b76f2 Move depsgraph debug print under --debug-depsgraph command line argument 2014-01-29 17:48:07 +06:00
Sergey Sharybin
a68ceb0af8 Option to lock the interface while rendering
Added function called WM_set_locked_interface which does
two things:

- Prevents event queue from being handled, so no operators
  (see below) or values are even possible to run or change.
  This prevents any kind of "destructive" action performed
  from user while rendering.

- Locks interface refresh for regions which does have lock
  set to truth in their template. Currently it's just a 3D
  viewport, but in the future more regions could be considered
  unsafe, or we could want to lock different parts of
  interface when doing different jobs.

  This is needed because 3D viewport could be using or changing
  the same data as renderer currently uses, leading to threading
  conflict.

  Notifiers are still allowed to handle, so render progress is
  seen on the screen, but would need to doublecheck on this, in
  terms some notifiers could be changing the data.

  For now interface locking happens for render job only in case
  "Lock Interface" checkbox is enabled.

  Other tools like backing would also benefit of this option.

  It is possible to mark operator as safe to be used in locked
  interface mode by adding OPTYPE_ALLOW_LOCKED bit to operator
  template flags.

  This bit is completely handled by wm_evem_system, not
  with operator run routines, so it's still possible to
  run operators from drivers and handlers.

  Currently allowed image editor navigation and zooming.

Reviewers: brecht, campbellbarton

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D142
2014-01-29 16:07:14 +06:00
Campbell Barton
39eb314cb9 UI: Refactor timecode functions into BLI_timecode
- deduplicate timecode_simple_string from image.c
- replace V2D_UNIT_SECONDSSEQ with V2D_UNIT_SECONDS
- avoid possible buffer overflow bugs (sprintf -> BLI_snprintf)
- remove option not to use timecode and split into 2 functions

Patch D227 by Andrew Buttery with own refactoring.
2014-01-29 20:44:01 +11:00
Campbell Barton
ae46e8a698 RNA: add rna_space_api.c for space functions 2014-01-29 07:31:54 +11:00
Campbell Barton
5643c29fbe File Reading: add revert operator
Patch D247 by Evans Jahja with edits
2014-01-29 05:34:57 +11:00
Campbell Barton
8c688a052c File Reading: add wrapper function for WM_file_read
also return cancelled when an operator fails to load a file
2014-01-29 05:33:05 +11:00
Howard Trickey
39202a53b5 Bevel: fix glitch in "pipe" case with square profile.
The "pipe" case -- where two beveled edges are in line
and there is at least one more beveled edge -- needed better
handling when profile parameter = 1.0 (square outward).
2014-01-28 13:20:42 -05:00
Campbell Barton
abf18033f3 Fix T38383: glitch drawing inactive slider 2014-01-29 04:10:39 +11:00
Campbell Barton
d34d7451a9 Viewport Drawing: apply matcaps to all objects 2014-01-29 03:39:19 +11:00
Campbell Barton
90ff9d7dca Code cleanup: remove check for painting non-mesh objects (its impossible) 2014-01-29 03:38:07 +11:00
Sergey Sharybin
aa51f499b3 Fix unused variable in the right way
It IS to be used :)
2014-01-28 22:14:50 +06:00