Commit Graph

47594 Commits

Author SHA1 Message Date
Campbell Barton
ce3f42e16a BLF API: Add BLF_width_to_strlen,rstrlen gives a byte offset from a string width 2013-12-16 22:00:30 +11:00
Sergey Sharybin
c193dbe30b Fix T37826: Opening a new image in the image editor
Cast dimensions to size_t before multiplication.
Also made add_ibuf_size survive cases when image
buffer allocation failed.
2013-12-16 16:51:27 +06:00
Sergey Sharybin
a2543ee43d Make compression in IMB_allocImBuf match other places 2013-12-16 16:41:15 +06:00
Sergey Sharybin
17604cded9 Missing NULL-pointer check in BKE_image_free_anim_ibufs 2013-12-16 16:30:28 +06:00
Campbell Barton
6ea13cf217 Editmesh: skip allocating a face array for recalc-normals 2013-12-16 01:28:07 +11:00
Sv. Lockal
2b0ba65c51 Minor optimization for strlen and memcpy calls for reading blend files
Summary:
This commit removes ~10000 strlen calls and ~100000 memcpy calls in blender (profiled with blender --background), ~10000 memcpy calls in makesdna.

There is no need to create null-terminated strings for atoi, because it converts only the initial portion of the string anyway.
Also it was noticed that DNA_elem_array_size and arraysize functions work only with full strings, so there is no point to calculate strlen.

Reviewers: campbellbarton

Reviewed By: campbellbarton

Differential Revision: http://developer.blender.org/D105
2013-12-15 18:06:04 +04:00
Campbell Barton
d833aab887 correct error in recent commit 2013-12-15 03:59:51 +11:00
Antony Riakiotakis
df2537d09d Revert "Hide the 3D cursor in a few cases where it is unneeded (active object is"
This reverts commit 85eaa98980.

Conflicts:
	source/blender/editors/space_view3d/view3d_draw.c
2013-12-14 15:23:57 +02:00
Campbell Barton
37720364d5 Curves: Skip 3dtext & 2d-curve filling when fill is set to 'None'
Otherwise was impossible to have unfilled curves unless extrude was set
2013-12-15 01:49:12 +11:00
Brecht Van Lommel
f00728c19b Fix bmesh compiler warning with OS X / clang. 2013-12-14 15:24:53 +01:00
Campbell Barton
60a6b2422d Modeling: add optional angle limit for beauty fill
Makes this tool more useful on an entire mesh by only applying
beautify to planar surfaces.
2013-12-14 23:25:29 +11:00
Campbell Barton
ab9fabdfc6 BMesh API: optionally pass fallback to BM_edge_calc_face_angle functions 2013-12-14 23:25:28 +11:00
Thomas Dinges
01fc7a687a Code cleanup: Remove "TexFace to Material Convert", from the file menu. This was used for conversion from older 2.5x files. The do_version() code is still there and functioning though. 2013-12-14 10:48:12 +01:00
Thomas Dinges
3517cde0fb Code cleanup: Remove Blender 2.4x animation player preset, since we have the internal one. 2013-12-14 09:24:22 +01:00
Joshua Leung
ff6bf133ad Fix T37811: Delete key shortcut missing for deleting markers
The keymap here used WM_keymap_verify_item(), which only allows for a
single hotkey to be bound to an operator. In most cases, this really
isn't justified.
2013-12-14 13:42:42 +13:00
Thomas Dinges
f372758257 Interface / Modifiers: Don't show cage placeholder in modifier header, if the current modifier does not support it or the cage is disabled (like Subsurf 0).
This way we save some space but still avoid the jumping around while changing settings in the header itself.

Thanks to Brecht for help on this. :)
2013-12-13 20:57:54 +01:00
Geoffroy Krantz
3ec7bc05b7 UI: color ramp buttons were redesigned and get a button to pick the n-th color stop.
The add, delete and (f)lip buttons now use icons, and some button locations moved.

Reviewed By: brecht, dingto, billrey

Differential Revision: http://developer.blender.org/D97
2013-12-13 17:49:13 +01:00
Campbell Barton
242217f8a3 Code cleanup: float<>double promotion 2013-12-14 03:21:23 +11:00
Scott Petrovic
105a97a7ed UI/RNA: added pixel and percentage units to some properties
Reviewed By: brecht

Differential Revision: http://developer.blender.org/D99
2013-12-13 17:06:14 +01:00
Campbell Barton
c456cd94b2 Curve Handle Recalculate (Ctrl+N)
T37799 Patch from Simon Repp
with added option to recalculate handle lengths.
2013-12-14 02:53:19 +11:00
Sergey Sharybin
ce893552c3 Image cache rewrite to using generic movie cache
Summary:
Behaves very much the same as cache for Movie Clip datablock:

- Image now have `MovieCache *cache` field which replaced
  legacy `ListBase ibufs`.

  This allows image datablock to easily keep of image
  buffers which are owned by itself. This field isn't
  saved to the file and getting restored on undo steps.

  However, cache limit is global for movies, sequences
  and image datablocks now. So overall cached image buffers
  size will not go above cache limit size in user
  preferences.

- Image buffers which are marked as BITMAPDIRTY will never
  be freed from the cache.

- Added utility function to iterate over image buffers
  saved in movie cache.

- Movie cache cleanup check callback now have ImBuf argument
  which can be used in a condition of cleanup.

- Added some utility functions which replaces legacy ibufs
  iterations with image cache iteration which happens from
  inside a lock.

- Fixed `image_mem_size()` which was only counting one of
  the buffers if both float and byte buffer present.

Additional notes:

- `BKE_image_get_first_ibuf()` is rather stupid, but direct
  access to ibufs->first was also the same stupid idea.

  Would consider avoid this function is another project.

- There are some places which doesn't look threadsafe, but
  they already were not so much threadsafe anyway before.

  So think not a big deal with solving this later.

Finally solves infinite memory usage by image sequences! :)

Reviewers: brecht, campbellbarton

Reviewed By: brecht

CC: sebastian_k

Differential Revision: http://developer.blender.org/D95
2013-12-13 16:30:00 +06:00
Sergey Sharybin
5a91df3271 Implement GPU-side dither
Summary:
Uses some magic pseudo-random which is actually a
texture coordinate hashing function.

TODOs:
- Dither noise is the same for all the frames.
- It's different from Floyd's dither we've been
  using before.
- Currently CPU and GPU dithering used different
  implementation. Ideally we need to use the same
  dither in CPU.

Reviewers: brecht

Reviewed By: brecht

Differential Revision: http://developer.blender.org/D58
2013-12-13 12:36:45 +06:00
Antony Riakiotakis
669b590229 minor style and comment fix. 2013-12-12 23:32:07 +02:00
Antony Riakiotakis
85eaa98980 Hide the 3D cursor in a few cases where it is unneeded (active object is
in sculpt mode or image paint mode and no clone tool is active)
2013-12-12 23:25:06 +02:00
Brecht Van Lommel
a53e864cf4 Fix T37572: text editor scrolling not working well with Mac trackpad panning.
The trackpad would give isolated mouse pan events with a distance smaller than
one line or character. For other 2D views this is all accumulated in floats,
but in the text editor it only keeps track of integers, and the small mouse pan
events got lost due to rounding.

Now it keeps track of sub-line or sub-character scroll offsets to avoid this.
2013-12-13 00:04:05 +01:00
Campbell Barton
51b9d85b09 UI: remove text margin when a slider is aligned to another button
Paint sliders had too much space on right (aligned with pressure icons)
2013-12-13 05:29:54 +11:00
Antony Riakiotakis
e45a9a3aaa Radial control operator support for pixel properties 2013-12-12 20:07:40 +02:00
Scott Petrovic
c701082a92 RNA: Add pixels property type 2013-12-13 04:40:30 +11:00
Antony Riakiotakis
b0a3f32ed3 improvements and simplification to gravity code:
* world to object matrix is calculated for view vector as well, reuse
that.
* if no orientation exists use world negative axis instead of object
negative axis for gravity.

there's also the issue of mirroring, it may be wise to invert the
gravity effect there but it may be better to have artist feedback on
that.
2013-12-12 19:35:33 +02:00
Antony Riakiotakis
c740f1a792 Sculpt mode Gravity feature from GSOC 2010 by Jason Wilkins.
Reviewers: sergey, brecht, campbellbarton, jwilkins

Differential Revision: http://developer.blender.org/D89
2013-12-12 19:01:11 +02:00
Campbell Barton
9ad88fbe6d Fix for error exposed by right-align number buttons
When the entire label was clipped, the right aligned number component
could be clipped on its left hand side too.
So "Foo: 1.00" could be clipped to ".00"
2013-12-13 02:47:00 +11:00
Campbell Barton
2195dd32cc Fix T37595: Switching modal transform broke with trackball rotation.
Id properties may have different sized "values" array depending on the
transform operator
2013-12-13 00:35:12 +11:00
Campbell Barton
8a7f2b24c1 Code Cleanup: use const's and bools for idprops 2013-12-13 00:35:11 +11:00
Campbell Barton
afffa9bc39 RNA: Add assert to ensure the idprop is correct size on array get/set 2013-12-12 21:01:20 +11:00
Sergey Sharybin
a0a09d1423 Fix T37757: MCE - Mask Pivot Point individual origins doesnt work
Simple wasn't implemented.
2013-12-12 14:37:01 +06:00
Campbell Barton
7658f7acff Fix for off by one error noted by Anthony Edlin 2013-12-12 19:02:51 +11:00
Sergey Sharybin
460a96dc5a Use factor subtype for plane track opacity 2013-12-12 13:51:04 +06:00
Sergey Sharybin
61616b0b88 Code cleanup: indent preprocessor directives inside #ifdef 2013-12-12 13:10:03 +06:00
Campbell Barton
ab127c12d4 Mesh API: Add BKE_mesh_origindex_map_create
This API function lets original data loop over its derived data,
Use for vertex paint, replacing custom function.
2013-12-12 17:37:16 +11:00
Campbell Barton
e23f77b935 Code Cleanup: move mesh mapping functions into their own file/header 2013-12-12 16:28:52 +11:00
Brecht Van Lommel
653d645587 Fix T37769: inconsistent behavior of Remove Selected From Active Group.
Add Selected to Active Group presented a menu with groups to choose from, while
this seemingly inverse operation did not and used all groups of the active
object.

Now both operators present a menu, with as first option "All Groups".
2013-12-12 06:13:35 +01:00
Campbell Barton
ec4ed2e3df Code Cleanup: replace global debug checks in raycast with DEBUG ifdef 2013-12-12 15:30:50 +11:00
Bastien Montagne
41e70cfb39 Add meaningful default for SimpleDeform modifier's angle prop. 2013-12-11 22:12:10 +01:00
Brecht Van Lommel
9c6fc9f15e Fix T37777: layout.column_flow() not working correct with retina / DPI. 2013-12-11 17:06:49 +01:00
Campbell Barton
09b859d03f UI: change how number button strings are concatenated (to easy add new suffix) 2013-12-12 00:33:41 +11:00
Benoit Bolsee
c35fb528c5 Fix intersect_line_plane bug causing crash on Motion trail and other
similar potential bugs in mathutils_geometry

marking no_flip as TODO
2013-12-11 10:28:30 -02:00
Sergey Sharybin
3a370ec6ec Move curve's boundbox and texspace calculation out of modifier stack
There were several issues with how bounding box and texture space
are calculated:

- This was done at the same time as applying modifiers, meaning if
  several objects are sharing the same curve datablock, bounding
  box and texture space will be calculated multiple times.

  Further, allocating bounding box wasn't safe for threading.

- Bounding box and texture space were evaluated after pre-tessellation
  modifiers are applied. This means Curve-level data is actually
  depends on object data, and it's really bad because different
  objects could have different modifiers and this leads to
  conflicts (curve's data depends on object evaluation order)
  and doesn't behave in a predictable way.

  This commit moves bounding box and texture space evaluation from
  modifier stack to own utility functions, just like it's was done
  for meshes.

  This makes curve objects update thread-safe, but gives some
  limitations as well. Namely, with such approach it's not so
  clear how to preserve the same behavior of texture space:
  before this change texture space and bounding box would match
  beveled curve as accurate as possible.

  Old behavior was nice for quick texturing -- in most cases you
  didn't need to modify texture space at all. But texture space
  was depending on render/preview settings which could easily lead
  to situations, when final result would be far different from
  preview one.

  Now we're using CV points coordinates and their radius to approximate
  the bounding box. This doesn't give the same exact texture space,
  but it helps a lot keeping texture space in a nice predictable way.

  We could make approximation smarter in the future, but fir now
  added operator to match texture space to fully tessellated curve
  called "Match Texture Space".

Review link:

  https://codereview.appspot.com/15410043/

Brief description:

  http://wiki.blender.org/index.php/User:Nazg-gul/GSoC-2013/Results#Curve_Texture_Space
2013-12-11 16:32:41 +06:00
Campbell Barton
dde5e5ce25 User Interface: Align number buttons labels to the left, number right 2013-12-11 21:27:13 +11:00
Campbell Barton
7d2652ad7c User Interface: add colon separator for number buttons 2013-12-11 21:06:00 +11:00
Campbell Barton
8e94d3685a Interface: avoid setting \0 to drawstr in widget_draw_text 2013-12-11 20:35:28 +11:00