Commit Graph

43661 Commits

Author SHA1 Message Date
Ton Roosendaal
d4eac8189e Removed on old patch from the code, which attempted to keep the scrollers
in user preferences in place.

New scroller code made user pref scroller jump back on activating add-ons,
because that causes a full blender system refresh.
2012-12-31 14:56:07 +00:00
Campbell Barton
b754fcd6f9 code cleanup: warning 2012-12-31 14:55:16 +00:00
Bastien Montagne
44632295b3 Some minor cleanup in camera's FOV angle props (mostly use DEG2RAD macro, and remove reference to degrees in tips - user is free to use radians if he prefers!). 2012-12-31 14:52:55 +00:00
Campbell Barton
acc05db50f minor updates to text autocomplete api
- draw function wasn't lining up correctly since DPI edits
- rename text_python.c to text_autocomplete.c
2012-12-31 14:49:27 +00:00
Sergey Sharybin
334ca1d344 Correction to recent PNG commit
Need to set default depth to 8bit.
2012-12-31 14:02:33 +00:00
Sergey Sharybin
93f78ac1e1 Removed byte glow effect from sequencer in favor of float one.
Byte glow was disabled in previous commit and code is removed now
in separate commit for easier revert if that'd be needed.
2012-12-31 13:52:26 +00:00
Sergey Sharybin
08cea96ab0 Alpha premul pipeline cleanup
This assumptions are now made:
- Internally float buffers are always linear alpha-premul colors
- Readers should worry about delivering float buffers with that
  assumptions.
- There's an input image setting to say whether it's stored with
  straight/premul alpha on the disk.
- Byte buffers are now assumed have straight alpha, readers should
  deliver straight alpha.

Some implementation details:

- Removed scene's color unpremultiply setting, which was very
  much confusing and was wrong for default settings.
  Now all renderers assumes to deliver premultiplied alpha.

- IMB_buffer_byte_from_float will now linearize alpha when
  converting from buffer.

- Sequencer's effects were changed to assume bytes have got
  straight alpha. Most of effects will work with bytes still,
  however for glow it was more tricky to avoid data loss, so
  there's a commented out glow implementation which converts
  byte buffer to floats first, operates on floats and returns
  bytes back. It's slower and not sure if it should actually
  be used -- who're using glow on alpha anyway?

- Sequencer modifiers should also be working nice with straight
  bytes now.

- GLSL preview will predivide float textures to make nice shading,
  shading with byte textures worked nice (GLSL was assuming straight
  alpha).

- Blender Internal will set alpha=1 to the whole sky. The same
  happens in Cycles and there's no way to avoid this -- sky is
  neither straight nor premul and doesn't fit color pipeline well.

- Straight alpha mode for render result was also eliminated.

- Conversion to correct alpha need to be done before linearizing
  float buffer.

- TIFF will now load and save files with proper alpha mode setting
  in file meta data header.

- Remove Use Alpha from texture mapping and replaced with image
  datablock setting.

  Behaves much more predictable and clear from code point of view
  and solves possible regressions when non-premultiplied images were
  used as textures with ignoring alpha channel.
2012-12-31 13:52:13 +00:00
Brecht Van Lommel
97c6a55c39 Fix #33706: issue in cycles motion blur rendering after hair commit, my fault
for not finding it in review.

Also removed the hard limits on motion blur shutter time, soft limits are still
the same but it can be useful to set things lower/higher in some cases.
2012-12-31 13:07:06 +00:00
Ton Roosendaal
fc6784126b Usability todo:
Editmode "Shear" didn't communicate well.
- Added X and Y shortcut to set shear axis
- Added print in header to denote that.

It will still switch with MMB press too.
2012-12-31 12:26:14 +00:00
Ton Roosendaal
bec3b34d25 Bug fix - post 2.65a problem:
The keymap entries for NDOF device were moved up, so the hotkey searches for
menus didn't show the keyboard shortcuts. Special devices shouldn't list as a
shortcut.
2012-12-31 12:13:30 +00:00
Bastien Montagne
c0a697807a Add try/catch around i18n locale setter code, just in case... 2012-12-31 12:12:50 +00:00
Campbell Barton
c9d16fd22c add ".hh" as an extension for source scripts. 2012-12-31 07:06:51 +00:00
Campbell Barton
827f9aa737 rename BM_edge_calc_squared_length -> BM_edge_calc_length_squared, matching len_v3, len_squared_v3 2012-12-31 02:40:15 +00:00
Campbell Barton
1aebc0e790 style cleanup 2012-12-31 02:37:28 +00:00
Bastien Montagne
b3aa368c8f Usual UI messages-related fixes... 2012-12-30 23:21:33 +00:00
Nicholas Bishop
22c02c9d3a Code cleanup: rename BLI_pbvh to BKE_pbvh 2012-12-30 18:31:31 +00:00
Nicholas Bishop
21d79cf769 Add UI and keybindings for dynamic-topology sculpt mode
* New topology panel in 3D view toolbar with the enable/disable button
  for dynamic topology and other controls

* Ctrl+DKEY to toggle dynamic topology

* Shift+DKEY to show a radial control for detail size
2012-12-30 18:31:17 +00:00
Nicholas Bishop
ab960eea88 Add symmetrize operator for dynamic-topology sculpt mode 2012-12-30 18:31:01 +00:00
Nicholas Bishop
37ed697d5c Add simplify brush for sculpt mode 2012-12-30 18:30:40 +00:00
Nicholas Bishop
d342e3ef0f Use GPU_Buffers to draw wireframe when in dynamic-topology sculpt mode
This adds an override to the CDDM edge drawing function that switches
to GPU_Buffers drawing for PBVHes of type PBVH_BMESH.

Within the GPU_Buffers code, glPolygonMode() is used to draw lines
instead of faces.
2012-12-30 18:30:13 +00:00
Nicholas Bishop
6ded71fb62 Hiding support for dynamic topology 2012-12-30 18:29:56 +00:00
Nicholas Bishop
bbaeac3bf8 Update DerivedMesh for dynamic-topology sculpt mode
* Build bmesh PBVH in CDDM when dyntopo is enabled

* Disable all modifiers when dyntopo is enabled
2012-12-30 18:29:41 +00:00
Nicholas Bishop
ae9d6e0813 Modify info stats for dynamic-topology sculpt mode
Format is like this: "Verts:8 | Tris:12 | Cube"
2012-12-30 18:29:25 +00:00
Nicholas Bishop
67d27db4a1 Add dynamic topology support to sculpt mode
* User documentation:
  wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Dynamic_Topology_Sculpting

* Code review for this and the other dynamic-topology commits:
  https://codereview.appspot.com/6947064/
  Thanks to Sergey for doing code review!

* Add SCULPT_OT_dynamic_topology_toggle operator to enable or disable
  dynamic topology mode

* Most brushes need little modification for dynamic topology, but for
  some it won't work well and is disabled. This decision is made in
  sculpt_stroke_dynamic_topology().

* For brushes that need original data (e.g. grab brush) the topology
  is not updated during the stroke, but some changes to original
  vertex data is accessed were made since BMesh works a little
  differently from mesh/multires. This is abstracted with
  SculptOrigVertData and associated functions.

* Smooth brush gets yet another set of functions, for mesh and
  multires and dynamic topology and, separetely, masking

* For most brushes, the topology is updated during the stroke right
  before the regular brush action takes place. This is handled in
  sculpt_topology_update().

* Exiting sculpt mode also disables dynamic topology

* Sculpt undo works differently with BMesh. Since the contents of
  nodes in the PBVH do not remain static during a sculpt session, the
  SculptUndoNodes do not correspond with PBVHNodes if dynamic topology
  is enabled. Rather, each SculptUndoNode is associated with a
  BMLogEntry.

* Sculpt undo gets a few new cases: entering and exiting dynamic
  topology does an undo push of all mesh data. Symmetrize will
  similarly push a full copy of BMesh data, although it does so
  through the BMLog API.

* Undo and redo in dynamic-topology mode will do a full recalculation
  of the PBVH.

* Add some documentation to doc/sculpt.org. This could stand to be
  expanded a lot more, for now it mostly contains test cases for the
  undo system.

* Add SCULPT_OT_optimize operator to recalculate the BVH. The BVH gets
  less optimal more quickly with dynamic topology than regular
  sculpting. There is no doubt more clever stuff we can do to optimize
  it on the fly, but for now this gives the user a nicer way to
  recalculate it than toggling modes.
2012-12-30 18:29:07 +00:00
Nicholas Bishop
2e69b0cd0b Add dynamic topology support to the PBVH
* Add BLI_pbvh_build_bmesh(), similar to the other PBVH builders but
  specialized for BMesh. Whereas the PBVH leaf nodes for mesh and
  grids only store a start-index and count into the primitive indices
  array, the BMesh version uses GHashes to store the full set of faces
  and vertices in leaf nodes

* Update PBVH iterator to handle BMesh

* Make some of the pbvh.c functions non-static so they can be used by
  the new pbvh_bmesh code

* The BLI_pbvh_bmesh_update_topology() function is the main reason for
  adding BMesh support to the PBVH. This function is used during a
  sculpt stroke to dynamically collapse edges that are particular
  short and subdivide edges that are particularly long.
2012-12-30 18:28:36 +00:00
Nicholas Bishop
2c9d22fe31 Add BLI_buffer, an alternative to BLI_array
BLI_buffer is a dynamic homogeneous array similar to BLI_array, but it
allocates a structure that can be passed around making it possible to
resize the array outside the function it was declared in.
2012-12-30 18:28:10 +00:00
Nicholas Bishop
fc442dbd51 Add DNA/RNA/BKE infrastructure for dynamic-topology sculpt mode
* Add a detail_size field to the Sculpt struct, two new sculpt flags,
  and a Mesh flag for dynamic-topology mode; that's it for file-level
  changes needed by dynamic topology

* Add RNA for the new DNA field and flags

* Add a new icon for dynamic-topology created by Julio Iglesias. TODO:
  update the icon for the new SVG icon format

* Add a SculptSession function for converting from BMesh to Mesh,
  handles reordering mesh elements and setting face shading
2012-12-30 18:27:33 +00:00
Nicholas Bishop
31f978c8ef Move layer displacements from SculptUndoNode to PBVHNode
* This doesn't make much difference for regular mesh/multires
  sculpting, but for dynamic topology sculpting the undo stack isn't
  split up by PBVH nodes, so it's more convenient to store the layer
  data in PBVH nodes.

* Note that the life cycle of the layer displacement data is
  unchanged -- it's only valid during a stroke with the layer brush,
  gets free'd when the undo step ends.
2012-12-30 18:26:11 +00:00
Nicholas Bishop
ec258542e2 Code cleanup: move PBVH/PBVHNode structs into new header file 2012-12-30 18:25:36 +00:00
Nicholas Bishop
d383c32413 Add GPU_buffers support for drawing dynamic topology nodes
The GPU interface for PBVH drawing gets a new pair of build/update
buffers functions for drawing BMFaces and BMVerts.

TODO: the diffuse color is hardcoded to 0.8 gray rather than using
material color.

TODO: only VBO drawing is implemented, no immediate mode.
2012-12-30 18:24:54 +00:00
Nicholas Bishop
2e9cb31c02 Add BMLog for efficiently storing changes to vertices and faces
The BMLog is an interface for storing undo/redo steps as a BMesh is
modified. It only stores changes to the BMesh, not full copies.

Currently it supports the following types of changes:
- Adding and removing vertices
- Adding and removing faces
- Moving vertices
- Setting vertex paint-mask values
- Setting vertex hflags
2012-12-30 18:24:08 +00:00
Nicholas Bishop
1b4b5f98cb Disable fall through to global undo from paint/sculpt undo
Undoing/redoing in sculpt and other paint modes should only use the
mode-specific undo, not global undo. It is now consistent with edit
mode and avoids tricky interaction between the two systems.
2012-12-30 18:23:42 +00:00
Nicholas Bishop
66e70e6caa Add function to find closest point in triangle to another point
New function is closest_to_tri_v3() in BLI_math_geom.
2012-12-30 18:23:03 +00:00
Nicholas Bishop
2d39e46414 Add BM_edge_calc_squared_length() query function
Same as BM_edge_calc_length(), but avoids square root for cases where
only comparison is needed.
2012-12-30 18:22:21 +00:00
Nicholas Bishop
a8811094ea Import the RangeTree library into extern
RangeTree is a simple C++ tree set for storing non-overlapping scalar
ranges. Original source from:
https://github.com/nicholasbishop/RangeTree

Also update the build systems to include RangeTree.
2012-12-30 18:20:52 +00:00
Brecht Van Lommel
feb0d1d698 Fix crash in syntax color code when drawing a text editor with no text. 2012-12-30 18:17:20 +00:00
Campbell Barton
e54b95d1c9 optimization for text drawing:
- dont set the color for each character, check if it changes from the previous one.
- dont memcpy text into a null terminated string to draw, instead rely on the length argument to BLF_draw().
2012-12-30 15:40:49 +00:00
Campbell Barton
3de85a8797 style cleanup: casts, some casts had odd formatting, but very few. Style checker script detects this now so easy to detect this if new code is added that doesnt follow blenders style. 2012-12-30 15:16:08 +00:00
Ton Roosendaal
82d6b17662 More trackpad woes:
Rotate with two-finger trackpad swipes should follow same principle as
for panning. This is first commit - for clarity.

Remaining issue is that for each system preset (in your OS) blender should
work as you expect too... pan, rotate and zoom gestures might need
each an own direction preset. Might be also messy, but then things can at
least work for everyone. Thinking it over and testing more now.
2012-12-30 14:31:34 +00:00
Sergey Sharybin
f62fc79da0 16 bit PNG write support
This commit adds a support of saving 16bit PNG files.

Alpha for such files would be premultiplied, would be corrected
with an upcoming alpha premul cleanup (it's not the only format
which will output 16bit image with premul alpha).
2012-12-30 13:01:47 +00:00
Ton Roosendaal
fde101c50c Revert change from Jens, wrong pointer check in the code.
That change made all scrollwheel events be handled as if it was a swipe gesture.
Old style mouse wheel didn't work anymore.

This version should work for everyone, but we need more mac testers :)
2012-12-30 10:38:56 +00:00
Brecht Van Lommel
b3d365289f OSL Templates: remove unnecessary stdosl.h include. 2012-12-30 10:37:32 +00:00
Thomas Dinges
f7e8ffdb85 OSL Templates:
* Add 3 simple templates:
** empty_shader.osl: A basic shader declaration to start with
** wireframe.osl: Simple wireframe shader
** noise.osl: Simple noise shader, with 3 noise types.
2012-12-30 03:11:52 +00:00
Thomas Dinges
398da25b1b OSL Syntax Highlighting:
* Added the remaining shader types
* Some comment and link fixes.
2012-12-30 02:51:29 +00:00
Campbell Barton
33955940e4 add templates menu for OSL, use preprocessor directive color for decorators in python. 2012-12-30 01:39:55 +00:00
Campbell Barton
e12354c4c5 add syntax highlighting color for symbols 2012-12-30 01:26:31 +00:00
Campbell Barton
099d8c9390 code cleanup: enum for formatting char (avoid confusion when '#' is a comment for // in OSL) 2012-12-30 01:12:21 +00:00
Campbell Barton
4ed9cea8ce code cleanup: text editor formatting enums were named crypticly, also add asserts if the continuation values are wrong (which can happen with buffer overflows on formatting). 2012-12-30 00:46:17 +00:00
Dan Eicher
1fd0520725 Infinite loop caused by using an uninitialized variable in a compairison statement 2012-12-29 22:06:44 +00:00
Dan Eicher
76fd28c25d Missing NULL check which crashes on opening the Text Editor without an active Text object 2012-12-29 20:16:21 +00:00