Commit Graph

49420 Commits

Author SHA1 Message Date
Campbell Barton
a80278a191 Code Cleanup: comment unused functions 2013-12-18 05:07:49 +11:00
Sv. Lockal
f034e69f0c UI: Theme Colors for Info space 2013-12-18 05:03:30 +11:00
Sergey Sharybin
c5d7ea091f Changes to partial update during rendering
Summary:
Mainly addressed to solve old TODO with color managed fallback
to CPU mode when displaying render result during rendering.

That fallback was caused by the fact that partial image update
was always acquiring image buffer for composite output and was
only modifying display buffer directly.

This was a big issue for Cycles rendering which renders layers
one by one and wanted to display progress of each individual
layer. This lead to situations when display buffer was based on
what Cycles passes via RenderResult and didn't take layer/pass
from image editor header into account.

Now made it so image buffer which partial update is operating
with always corresponds to what is set in image editor header.

To make Cycles displaying progress of all the layers one by one
made it so image_rect_update switches image editor user to
newly rendering render layer. It happens only once when render
engine starts rendering next render layer, so should not be
annoying for navigation during rendering.

Additional change to render engines was done to make it so
they're able to merge composite output to final result
without marking tile as done. This is done via do_merge_result
argument to end_result() callback. This argument is optional
so should not break script compatibility.

Additional changes:

- Partial display update for Blender Internal now happens from
  the same thread as tile rendering. This makes it so display
  conversion (which could be pretty heavy actually) is done in
  separate threads. Also gives better UI feedback when rendering
  easy scene with small tiles.

- Avoid freeing/allocating byte buffer for render result
  if it's owned by the image buffer. Only mark it as invalid
  for color management.

  Saves loads of buffer re-allocations in cases when having
  several image editors opened with render result. This change
  in conjunction with the rest of the patch gave around
  50%-100% speedup of render time when displaying non-combined
  pass during rendering on my laptop.

- Partial display buffer update was wrong for buffers with number
  of channels different from 4.

- Remove unused window from RenderJob.

- Made image_buffer_rect_update static since it's only used
  in single file.

Reviewers: brecht

Reviewed By: brecht

CC: dingto

Differential Revision: http://developer.blender.org/D98
2013-12-17 23:42:38 +06:00
Sergey Sharybin
04eb24a337 Fix T37718: Texture compression missing
Make sure image will saved as (not over) after changing
it's type to Generated by clearing image's path in signal
handler.
2013-12-17 22:16:53 +06:00
Campbell Barton
8e59beb815 Code Cleanup: comment unused define 2013-12-18 00:20:18 +11:00
Jens Verwiebe
6e88e3eda4 Fix compile after last commit, casting to (bArmature *), kudos to JesterKing 2013-12-17 14:14:03 +01:00
Campbell Barton
f5076d54cb 'Transform' Python Function for armature, curve and lattice.
patch by Paolo Acampora with some edits.
2013-12-17 23:04:36 +11:00
Bastien Montagne
db795b66fa Fix bplayer broken in own rB51f5c994e9f0. 2013-12-17 10:47:32 +01:00
Bastien Montagne
51f5c994e9 Fix T37103: Keyframing custom properties issue (FCurve would not reflect Custom props type changes).
Add an helper func to re-compute integer-only fcurve flags, and call it when editing custom props.

Reviewed by aligorith, thanks!

Summary: Proposal fix for "keyframing custom properties issue" (T37103).

Reviewers: aligorith

Maniphest Tasks: T37103

Differential Revision: http://developer.blender.org/D111
2013-12-17 09:51:27 +01:00
Campbell Barton
e68144aed7 Fix for crash in toolbar tabs with only one tab defined 2013-12-17 19:16:44 +11:00
IRIE Shinsuke
5036ac6903 Partial fix for T37604: Deadlock when stopping rendered viewport (Blender Internal)
- Py_BEGIN_ALLOW_THREADS and Py_END_ALLOW_THREADS macros cannot be used here, because the Py_BEGIN_ALLOW_THREADS causes a crash when quitting Blender.
- The low level function PyEval_ReleaseLock() is used assuming the Python library was built with multi-threads support.
2013-12-17 18:44:56 +11:00
Campbell Barton
f1a989f9c3 Fix crash in freestyle vector parsing (hard to believe nobody noticed)
Vectors were being assigned as an array of classes in Vec2f_ptr_from_PyObject and similar functions,
rather then assigning a number to each axis.
2013-12-17 18:01:15 +11:00
Campbell Barton
61fb34a622 Fix for obscure freestyle crash when attempting to negate INT_MIN
This gives undefined behavior - in my case stays the same value and crashes.

Check for finite input resolves the issue.
2013-12-17 18:00:22 +11:00
Campbell Barton
b3ea4ec90c Py API: use direct access to list/tuple size when type is known 2013-12-17 16:40:06 +11:00
Campbell Barton
cda89813df Fix for possible NULL pointer use in brush image sampling 2013-12-17 13:19:54 +11:00
Campbell Barton
305fc82541 UI: don't attempt to draw with the menu-key when only drawing right aligned 2013-12-17 13:11:31 +11:00
Campbell Barton
b78b3f2ac8 Fix for out-of-bounds memcpy() when adding a material 2013-12-17 05:47:22 +11:00
Campbell Barton
9a623daf9c UserDefaults: disable orbit around object center and region-overlap
both have bad side-effects with strange behavior and viewport performance
2013-12-17 04:04:35 +11:00
Campbell Barton
a621d1e488 UI: Tabs categories for panels (D75)
- works by defining panel categories, currently restricted to the toolbar.
- no panels define bl_categories yet, so no user visible changes since tabs only show when there are multiple.
- panel pinning is available in rmb menu or alt+lmb.
2013-12-17 03:55:45 +11:00
Sergey Sharybin
2231b565f0 Better fix for previous commit
Cache iterator might return unused keys as well.
Now unused keys are being removed before cleanup
and iteration.
2013-12-16 22:05:27 +06:00
Sergey Sharybin
28d873f038 Fix possible crash when cleaning cache with some ibufs removed by the memory limit 2013-12-16 20:38:53 +06:00
Sergey Sharybin
3f0bae965b Color management: use fallback mode if there're no displays/views
Before this it was a runtime check for number of displays/views
which is rather really annoying.

This simplifies code a bit and allows to do some more tricks
in other patches.
2013-12-16 18:38:13 +06:00
Dalai Felinto
63eb863d8d Add optional 'frame' argument to scene.timeline_markers.new(name)
Differential Revision: http://developer.blender.org/D101
2013-12-16 10:13:59 -02:00
Sergey Sharybin
0f934ee3b7 Motion tracking: use PROP_PIXEL for pixel RNA values 2013-12-16 17:53:15 +06:00
Sergey Sharybin
cacd7c725b Disable region overlap in movie clip editor
Before it was giving weird behavior with timeline in MCE
and track preview widgets. But there's also no much benefit
of having transparent toolbox there.

Requested by our motrack guru Sebastian ages ago.
2013-12-16 17:17:59 +06:00
Campbell Barton
09b4954d2d UI: use BLF_width_to_strlen for efficient text clipping 2013-12-16 22:00:30 +11:00
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