9 years agosvn merge ^/trunk/blender -r46612:46629
Campbell Barton [Mon, 14 May 2012 13:55:12 +0000 (13:55 +0000)]
svn merge ^/trunk/blender -r46612:46629

9 years agowas casting to short for int args.
Campbell Barton [Mon, 14 May 2012 13:54:00 +0000 (13:54 +0000)]
was casting to short for int args.

9 years agoRefactor byte/float RGBA to grayscale conversion in tracking.c
Keir Mierle [Mon, 14 May 2012 13:46:38 +0000 (13:46 +0000)]
Refactor byte/float RGBA to grayscale conversion in tracking.c

This is the first in a series of tracking.c refactorings to
disentangle functionality that is sprinkled across unrelated

9 years agoMake blender compilable by gcc-4.7 and strict compilation flags:
Sergey Sharybin [Mon, 14 May 2012 13:31:38 +0000 (13:31 +0000)]
Make blender compilable by gcc-4.7 and strict compilation flags:

- Remove strict flags from files, which are using FFmpeg stuff
  We're still using some symbols which are marked as deprecated.
  Ideally, we shall switch to new API, but it's a bit larger challenge
  because we don't want to break compatibility withotu actual need.
- Replace MAKE_ID with BT_MAKE_ID in bullet library.
  This is needed to prevent re-definition of MAKE_ID in bullet library.
  Seems it's only used to read blender files, so should be quite safe

9 years agoFix for BLI_gzopen to work with utf filenames in windows
Sv. Lockal [Mon, 14 May 2012 13:28:36 +0000 (13:28 +0000)]
Fix for BLI_gzopen to work with utf filenames in windows

9 years agoChanges to naming tracker vs. track vs. marker to match assumptions taken in
Sergey Sharybin [Mon, 14 May 2012 12:50:36 +0000 (12:50 +0000)]
Changes to naming tracker vs. track vs. marker to match assumptions taken in

9 years agocode cleanup: add WM_gesture_lasso_path_to_array, move mouse path to array conversion...
Campbell Barton [Mon, 14 May 2012 12:41:56 +0000 (12:41 +0000)]
code cleanup: add WM_gesture_lasso_path_to_array, move mouse path to array conversion there.

9 years ago"Efficient Second-order Minimization" for the planar tracker
Keir Mierle [Mon, 14 May 2012 12:15:38 +0000 (12:15 +0000)]
"Efficient Second-order Minimization" for the planar tracker

This implements the "Efficient Second-order Minimization"
scheme, as supported by the existing translation tracker.
This increases the amount of per-iteration work, but
decreases the number of iterations required to converge and
also increases the size of the basin of attraction for the

9 years agolasso select for movie clip markers.
Campbell Barton [Mon, 14 May 2012 12:04:00 +0000 (12:04 +0000)]
lasso select for movie clip markers.

9 years agoStart migrating away from pat_min and pat_max for markers
Keir Mierle [Mon, 14 May 2012 10:47:25 +0000 (10:47 +0000)]
Start migrating away from pat_min and pat_max for markers

This starts converting markers in the movie clip editor / 2D
tracker from using pat_min and pat_max notation to using the
a more general, 4-corner representation. There is still
considerable porting work to do; in particular:

- The preview widget does not respect the new
- The corners cannot yet be edited individually.
- The clamping does not do the right thing for general
  corners; e.g. detecting a convex quad.
- The tracking code in Blender does not actually invoke the
  corner tracking version of libmv's tracking API.

Next steps:

- Convert libmv's legacy ESM tracker and brute tracker to
  work under the new TrackRegion() API.
- Make Blender use the new TrackRegion() API; this will
  allow real planar tracking tests.
- Everything else (UI, etc).

This patch is mostly the work of Sergey Sharybin.

9 years agoAdd a planar tracking implementation to libmv
Keir Mierle [Sun, 13 May 2012 23:08:56 +0000 (23:08 +0000)]
Add a planar tracking implementation to libmv

This adds a new planar tracking implementation to libmv. The
tracker is based on Ceres[1], the new nonlinear minimizer that
myself and Sameer released from Google as open source. Since
the motion model is more involved, the interface is
different than the RegionTracker interface used previously
in Blender.

The start of a C API in libmv-capi.{cpp,h} is also included.

The ESM tracker, also known as the KLT tracker in the UI, is
temporarily changed to use the new Ceres-based planar
tracker in translation-only mode. Currently it is a bit
slower than ESM and also doesn't have all the bells and
whistles implemented. Those will come soon. Longer term,
both trackers will remain since Ceres is unlikely to be as
fast as ESM for pure translation solving, due to its

The next step is to implement a new tracking UI. The current
UI assumes a translational motion model; the new one must
support arbitrary perspective transforms of the pattern


9 years agostyle cleanup: imbuf & icons
Campbell Barton [Sun, 13 May 2012 22:05:51 +0000 (22:05 +0000)]
style cleanup: imbuf & icons

9 years agostyle cleanup: comments and whitespace
Campbell Barton [Sun, 13 May 2012 21:46:18 +0000 (21:46 +0000)]
style cleanup: comments and whitespace

9 years agostyle cleanup: mask, whitespace edits, also use len_squared_v2 for comparisons.
Campbell Barton [Sun, 13 May 2012 21:36:42 +0000 (21:36 +0000)]
style cleanup: mask, whitespace edits, also use len_squared_v2 for comparisons.

9 years agosvn merge: Merging r46558 through r46612, from trunk
Campbell Barton [Sun, 13 May 2012 18:16:25 +0000 (18:16 +0000)]
svn merge: Merging r46558 through r46612, from trunk

9 years agoChange the scons configuration for MinGW-w64 to be more in-line with cmake. Also...
Antony Riakiotakis [Sun, 13 May 2012 17:26:07 +0000 (17:26 +0000)]
Change the scons configuration for MinGW-w64 to be more in-line with cmake. Also deactivate openmp as it causes crashes when rendering with subsurf or multires modifiers

9 years agofix for crash when no mask exists when entering mask transform.
Campbell Barton [Sun, 13 May 2012 16:51:17 +0000 (16:51 +0000)]
fix for crash when no mask exists when entering mask transform.

9 years agostyle cleanup: mask files
Campbell Barton [Sun, 13 May 2012 16:24:42 +0000 (16:24 +0000)]
style cleanup: mask files

9 years ago* Typo fix: rna_recursiev_attr_expand -> rna_recursive_attr_expand
Thomas Dinges [Sun, 13 May 2012 16:23:17 +0000 (16:23 +0000)]
* Typo fix: rna_recursiev_attr_expand -> rna_recursive_attr_expand

9 years agostyle cleanup: macro line breaks
Campbell Barton [Sun, 13 May 2012 16:05:10 +0000 (16:05 +0000)]
style cleanup: macro line breaks

9 years agoAdds “align” option to snap to verts/edges/faces, for bones in Pose mode.
Bastien Montagne [Sun, 13 May 2012 16:01:59 +0000 (16:01 +0000)]
Adds “align” option to snap to verts/edges/faces, for bones in Pose mode.

Have to use a ugly hack, as for pose bones, rotscale transform matrix is not always the same as translate one... :/

Adresses feature request [#30979] snapping: "align rotation with the snapping target" and pose-mode.

9 years agocode cleanup:
Campbell Barton [Sun, 13 May 2012 14:47:53 +0000 (14:47 +0000)]
code cleanup:
- use bmesh iterator macros in more places
- rename scanfill variables (were using same names as mesh faces/verts which was confusing)

9 years agoAdd support for opencollada for MinGW64 and cmake
Antony Riakiotakis [Sun, 13 May 2012 13:32:48 +0000 (13:32 +0000)]
Add support for opencollada for MinGW64 and cmake

9 years agoCycles: OpenCL image texture support, fix an attribute node issue and refactor
Brecht Van Lommel [Sun, 13 May 2012 12:32:44 +0000 (12:32 +0000)]
Cycles: OpenCL image texture support, fix an attribute node issue and refactor
feature enabling #defines a bit.

9 years agofix geometry to origin in mesh editmode - was broken since bmesh merge.
Campbell Barton [Sun, 13 May 2012 11:14:43 +0000 (11:14 +0000)]
fix geometry to origin in mesh editmode - was broken since bmesh merge.

9 years agocode cleanup: use vector math function minmax_v3v3_v3() and other minor vector functi...
Campbell Barton [Sun, 13 May 2012 11:05:52 +0000 (11:05 +0000)]
code cleanup: use vector math function minmax_v3v3_v3() and other minor vector function edits.

9 years agoSequencer / Clip Editor:
Thomas Dinges [Sun, 13 May 2012 09:26:01 +0000 (09:26 +0000)]
Sequencer / Clip Editor:
* Make it more clear that the Memory Cache Limit is used by the Clip Editor as well.

9 years agoMore work for [#31429] Curve menu polish.
Thomas Dinges [Sun, 13 May 2012 09:13:47 +0000 (09:13 +0000)]
More work for [#31429] Curve menu polish.
* Curve Extrude and Duplicate from Toolbar also moves the points now, same as for Mesh and in alignment with the menu.

* Fixed yet another tooltip.

9 years agocode cleanup: use static functions for transform operators
Campbell Barton [Sat, 12 May 2012 23:18:14 +0000 (23:18 +0000)]
code cleanup: use static functions for transform operators

9 years agoadd access to bevel weight modal operator (only available in the Shift+E edge menu...
Campbell Barton [Sat, 12 May 2012 23:07:52 +0000 (23:07 +0000)]
add access to bevel weight modal operator (only available in the Shift+E edge menu currently)

9 years agopatch [#31434] IDMaterials.pop/append() UI update from console
Campbell Barton [Sat, 12 May 2012 22:38:15 +0000 (22:38 +0000)]
patch [#31434] IDMaterials.pop/append() UI update from console
from Dan Eicher (dna)

9 years agocode cleanup: missed some min/max use of float[3], also found case of DO_MIN/MAX...
Campbell Barton [Sat, 12 May 2012 22:34:20 +0000 (22:34 +0000)]
code cleanup: missed some min/max use of float[3], also found case of DO_MIN/MAX re-reading same value from array 4 times when it can do once (use minf rather then MIN2, same for maxf)

9 years agocode cleanup: minor improvements to float/vector usage.
Campbell Barton [Sat, 12 May 2012 22:13:38 +0000 (22:13 +0000)]
code cleanup: minor improvements to float/vector usage.

9 years agoDisable sm_13 CUDA kernel building for now, as the build fails with out of memory.
Nathan Letwory [Sat, 12 May 2012 22:00:32 +0000 (22:00 +0000)]
Disable sm_13 CUDA kernel building for now, as the build fails with out of memory.

9 years agoprevious commit didnt work right, the flag is still needed, wrap access with function...
Campbell Barton [Sat, 12 May 2012 21:38:35 +0000 (21:38 +0000)]
previous commit didnt work right, the flag is still needed, wrap access with functions so the NULL check is always done.

9 years agoEnable setting of CUDA kernels to compile on command-line:
Nathan Letwory [Sat, 12 May 2012 21:37:01 +0000 (21:37 +0000)]
Enable setting of CUDA kernels to compile on command-line:

python scons/ BF_CYCLES_CUDA_BINARIES_ARCH=sm_20,sm21

9 years agoreplace GP_PAINTFLAG_STROKEADDED with a NULL check, saves worrying about keeping...
Campbell Barton [Sat, 12 May 2012 21:29:25 +0000 (21:29 +0000)]
replace GP_PAINTFLAG_STROKEADDED with a NULL check, saves worrying about keeping the flag correct after undo.

9 years agofix [#31427] Crash when undoing until no point in grease pencil poly mode
Campbell Barton [Sat, 12 May 2012 21:23:02 +0000 (21:23 +0000)]
fix [#31427] Crash when undoing until no point in grease pencil poly mode

9 years agofix [#31428] bpy.ops.wm.path_open only works once
Campbell Barton [Sat, 12 May 2012 21:11:48 +0000 (21:11 +0000)]
fix [#31428] bpy.ops.wm.path_open only works once

9 years agofix for own bad logic with polygon normal calculation, was reading one past the loop...
Campbell Barton [Sat, 12 May 2012 21:01:26 +0000 (21:01 +0000)]
fix for own bad logic with polygon normal calculation, was reading one past the loop array (reported as bug #31431).

9 years ago3D View:
Thomas Dinges [Sat, 12 May 2012 20:50:46 +0000 (20:50 +0000)]
3D View:
* Changed Duplicate and Exture Operator fpr Curves/Surfaces to Duplicate/Extrude and Move, like for Mesh objects, for consistency. This is also consistent with Shift+D and E shortcut.

This fixes [#31429] Curve menu polish.

* Fixed a wrong tooltip for metaball duplication.

9 years agocode cleanup: header cleanup and remove some duplicate defines.
Campbell Barton [Sat, 12 May 2012 20:39:39 +0000 (20:39 +0000)]
code cleanup: header cleanup and remove some duplicate defines.

9 years agostyle cleanup: blenkernel
Campbell Barton [Sat, 12 May 2012 19:18:02 +0000 (19:18 +0000)]
style cleanup: blenkernel

9 years agoFix [#31426] Unwrapping, First unwrap unwraps with LSCM, not with Angle Based
Bastien Montagne [Sat, 12 May 2012 16:42:50 +0000 (16:42 +0000)]
Fix [#31426] Unwrapping, First unwrap unwraps with LSCM, not with Angle Based

When operator method property is not set, the operator uses the one from current scene settings. We must update the operator property accordingly...

Also updated default startup.blend file, to match default AngleBased method (was on Conformal one).

9 years agocode cleanup: some style and use math defines, also small speedup for dynamicpaint...
Campbell Barton [Sat, 12 May 2012 16:42:12 +0000 (16:42 +0000)]
code cleanup: some style and use math defines, also small speedup for dynamicpaint, dont call acosf twice.

9 years agostyle cleanup: whitespace
Campbell Barton [Sat, 12 May 2012 16:11:34 +0000 (16:11 +0000)]
style cleanup: whitespace

9 years agostyle cleanup: remaining BLI files.
Campbell Barton [Sat, 12 May 2012 15:13:06 +0000 (15:13 +0000)]
style cleanup: remaining BLI files.

9 years agostyle cleanup: whitespace, bli & makesdna
Campbell Barton [Sat, 12 May 2012 15:02:10 +0000 (15:02 +0000)]
style cleanup: whitespace, bli & makesdna

9 years agooptimization for select similar
Campbell Barton [Sat, 12 May 2012 14:25:14 +0000 (14:25 +0000)]
optimization for select similar
- use angle_normalized_v3v3() where both vectors are known to be normalized.
- remove needless radian to degrees conversions.
- move checks for customdata layers outside the inner loop (for bevel and crease).

9 years agoadd bevel to select similar edges operator
Campbell Barton [Sat, 12 May 2012 14:06:35 +0000 (14:06 +0000)]
add bevel to select similar edges operator

9 years agostyle cleanup: mostly whitespace in rna
Campbell Barton [Sat, 12 May 2012 11:01:29 +0000 (11:01 +0000)]
style cleanup: mostly whitespace in rna

9 years agofix for building without libmv
Campbell Barton [Sat, 12 May 2012 09:40:23 +0000 (09:40 +0000)]
fix for building without libmv

9 years agoreworded tooltip for Tripod Motion button; fixing spelling and making more clear
Ed Halley [Sat, 12 May 2012 04:31:03 +0000 (04:31 +0000)]
reworded tooltip for Tripod Motion button; fixing spelling and making more clear

9 years agofix [#30905] Operator preset save doesn't serialize PropertyGroups
Campbell Barton [Fri, 11 May 2012 18:55:14 +0000 (18:55 +0000)]
fix [#30905] Operator preset save doesn't serialize PropertyGroups

fix based on patch by Julien Rivaud (frnchfrgg), but re-written a bit differently not to be operator specific.

9 years agodon't stat bookmark files on load, can make blender hang on slow networks (eg, the...
Campbell Barton [Fri, 11 May 2012 17:41:38 +0000 (17:41 +0000)]
don't stat bookmark files on load, can make blender hang on slow networks (eg, the blender institutes gigabit connection)... or if the server is busy.

9 years agoMerging r46495 through r46557 from trunk into soc-2011-tomato
Sergey Sharybin [Fri, 11 May 2012 17:39:57 +0000 (17:39 +0000)]
Merging r46495 through r46557 from trunk into soc-2011-tomato

9 years agoAdded verbosity command line argument. Currently used for libmv only.
Sergey Sharybin [Fri, 11 May 2012 17:33:48 +0000 (17:33 +0000)]
Added verbosity command line argument. Currently used for libmv only.
Usage: ./blender --verbose <level>

Also fixed some crashes when not passing number to --threads argument
or not passing file format to -F argument.

9 years agoEnable OpenCOLLADA support for MingW64 builds by default.
Nathan Letwory [Fri, 11 May 2012 17:29:55 +0000 (17:29 +0000)]
Enable OpenCOLLADA support for MingW64 builds by default.

Note: don't forget to update your local checkout of lib/mingw64

9 years agoFix for UI layout alignment of fixed-size items (including those with width < min...
Lukas Toenne [Fri, 11 May 2012 17:05:10 +0000 (17:05 +0000)]
Fix for UI layout alignment of fixed-size items (including those with width < min. width). Such layout items were ignoring the center and right alignment in layouts before.

9 years agostyle cleanup: whitespace
Campbell Barton [Fri, 11 May 2012 16:11:52 +0000 (16:11 +0000)]
style cleanup: whitespace

9 years agoadd missing NULL of scene->ed
Campbell Barton [Fri, 11 May 2012 14:27:55 +0000 (14:27 +0000)]
add missing NULL of scene->ed

9 years agodont use sdl include when building headless
Campbell Barton [Fri, 11 May 2012 14:17:49 +0000 (14:17 +0000)]
dont use sdl include when building headless

9 years agoedits to recent sequencer api additions not to do scene lookups, the scene is already...
Campbell Barton [Fri, 11 May 2012 11:05:48 +0000 (11:05 +0000)]
edits to recent sequencer api additions not to do scene lookups, the scene is already known.

9 years agono need to clamp python values twice when assigning.
Campbell Barton [Fri, 11 May 2012 10:25:12 +0000 (10:25 +0000)]
no need to clamp python values twice when assigning.

9 years agosequencer bug, was possible to add strips to negative channels, the channel clamping...
Campbell Barton [Fri, 11 May 2012 10:20:35 +0000 (10:20 +0000)]
sequencer bug, was possible to add strips to negative channels, the channel clamping was ignored when calling RNA_property_int_set() when setting operator int/floats.

9 years ago- dont create scene.sequence_editor on read, means data-browser or autocomplete will...
Campbell Barton [Fri, 11 May 2012 10:04:55 +0000 (10:04 +0000)]
- dont create scene.sequence_editor on read, means data-browser or autocomplete will allocate a sequencer.
... instead add scene.sequencer_editor_create / clear, these match id.animation_data_* functions.

- refactor for names, for scene level functions call them BKE_sequencer_*

9 years agoA couple more changes to the file and image nodes to improve access to layers that...
Lukas Toenne [Fri, 11 May 2012 08:06:01 +0000 (08:06 +0000)]
A couple more changes to the file and image nodes to improve access to layers that don't follow Blender's rlayer.rpass naming scheme.

--- Changes to File Output node ---
* Flat layer names in EXR multilayer files.

 For a socket with name "AAA" the previous resulting EXR layer name would be "AAA.AAA", i.e. the render layer as well as render pass would use the socket name.

 Now the "render_layer.render_pass" scheme is ignored in multilayer files, socket names are directly written to EXR layers (EXR layer name is "AAA" in this example). If sockets should have a notion of "render layer" this can still be achieved by explicitly adding a separator, e.g. "AAA.BBB". When loading such layers into a Blender Image struct, the name is interpreted as a "render_layer.render_pass" again (although the image node does not care about it, see below).

* Socket sub-paths (for singlelayer) or layer names (for multilayer) are stored in dedicated string variables in the socket storage data. This way the RNA can define precise string subtypes (PROP_FILEPATH) and length. The file/layer slots are defined as separate structs with own name properties in the RNA as well, so they can be used nicely with the list template.

* Ensure unique socket paths/layer names to prevent overwriting of files and layers respectively.

--- Changes to Image node ---
* Loading multilayer OpenEXR files has improved layer name splitting into render layer + render pass names now. This properly supports arbitrary EXR layer names now.

 OpenEXR layer name:   AAA.BBB.CCC

 is split into

 Render layer name:    AAA.BBB
 Render pass name:     CCC

 If the layer name has no '.' separators the render layer name is empty.

* Image node ignores the selected render layer in the image user data. Instead all existing layers are displayed at the same time by combining the render layer names with render pass names again, to reconstruct the original EXR layer name. This avoids the problem that render layers with empty name are not selectetable in the dropdown and allows using all image layers at the same time without duplicating the node.

9 years agostyle cleanup: mainly sculpt/whitespace
Campbell Barton [Fri, 11 May 2012 08:05:47 +0000 (08:05 +0000)]
style cleanup: mainly sculpt/whitespace

9 years agoCompilation error fix: abort() wasn't declared in BKE_ccg.h before
Sergey Sharybin [Fri, 11 May 2012 05:27:23 +0000 (05:27 +0000)]
Compilation error fix: abort() wasn't declared in BKE_ccg.h before

9 years agoTomato: fixed invalid float suffix.
Sergey Sharybin [Fri, 11 May 2012 05:21:04 +0000 (05:21 +0000)]
Tomato: fixed invalid float suffix.

9 years agoCycles: reviewed the task scheduler code and fixed (hopefully all) windows threading...
Brecht Van Lommel [Thu, 10 May 2012 22:31:16 +0000 (22:31 +0000)]
Cycles: reviewed the task scheduler code and fixed (hopefully all) windows threading problems.

9 years agoAdd mask-drawing support to GPU_Buffers.
Nicholas Bishop [Thu, 10 May 2012 20:36:34 +0000 (20:36 +0000)]
Add mask-drawing support to GPU_Buffers.

This is the last commit of the sculpt masking merge. Documentation:

Thanks to Brecht for reviewing!

* For VBO, add color to the VertexBufferFormat structure as three
  unsigned bytes. Since mask elements are scalar the three color
  components are identical to eachother, but the fixed-function OpenGL
  pipeline requires colors to be either three or four components.

* For the same reason, multires VBO drawing now copies into the
  VertexBufferFormat format as well.

* Regression: material colors will not show up correctly now, masks
  colors are overriding. Not sure how to fix this nicely (would be
  much easier to fix if drawing with vertex shaders.)

* Also, masks will only draw PBVH drawing, so only 'solid' drawing
  will work correctly with masks.

9 years agoUse VertexBufferFormat for multires VBO.
Nicholas Bishop [Thu, 10 May 2012 20:36:24 +0000 (20:36 +0000)]
Use VertexBufferFormat for multires VBO.

9 years agoAdd keymap and menu entries for masking.
Nicholas Bishop [Thu, 10 May 2012 20:36:13 +0000 (20:36 +0000)]
Add keymap and menu entries for masking.

* Add CTRL+IKEY to invert the mask.

* Add ALT+MKEY to clear the mask.

* Change the 'Hide' menu in sculpt mode to 'Hide/Mask', adds entires
  for clearing, filling, and inverting the mask, as well as hiding
  masked regions.

9 years agoAdd support for hiding masked regions.
Nicholas Bishop [Thu, 10 May 2012 20:36:01 +0000 (20:36 +0000)]
Add support for hiding masked regions.

Add a new mode, PARTIALVIS_MASKED, to the PAINT_OT_hide_show operator.

9 years agoAdd a paint mask operator to clear, fill, or invert the mask.
Nicholas Bishop [Thu, 10 May 2012 20:35:51 +0000 (20:35 +0000)]
Add a paint mask operator to clear, fill, or invert the mask.

9 years agoUpdate the keymap for the mask brush.
Nicholas Bishop [Thu, 10 May 2012 20:35:41 +0000 (20:35 +0000)]
Update the keymap for the mask brush.

* Add MKEY as a toggle for the mask brush. We could use ALT similar to
  SHIFT toggling the smooth brush, but it would conflict with MMB
  emulation (not to mention many window managers.)

* When the mask brush is active, SHIFT toggles it into smooth mode.

9 years agoAdd mask brush for sculpt mode.
Nicholas Bishop [Thu, 10 May 2012 20:35:32 +0000 (20:35 +0000)]
Add mask brush for sculpt mode.

The mask brush currently has two modes, 'draw' and 'smooth'.

9 years agoAdd new mask-brush icon from Julio Iglesias.
Nicholas Bishop [Thu, 10 May 2012 20:35:12 +0000 (20:35 +0000)]
Add new mask-brush icon from Julio Iglesias.

9 years agoUse paint mask when calculating sculpt strength.
Nicholas Bishop [Thu, 10 May 2012 20:34:54 +0000 (20:34 +0000)]
Use paint mask when calculating sculpt strength.

9 years agoAdd undo/redo support for paint masks.
Nicholas Bishop [Thu, 10 May 2012 20:34:47 +0000 (20:34 +0000)]
Add undo/redo support for paint masks.

9 years agoEnsure mask layers are always present in sculpt mode.
Nicholas Bishop [Thu, 10 May 2012 20:34:35 +0000 (20:34 +0000)]
Ensure mask layers are always present in sculpt mode.

9 years agoCopy GridPaintMask to vertex paint mask when applying multires.
Nicholas Bishop [Thu, 10 May 2012 20:34:23 +0000 (20:34 +0000)]
Copy GridPaintMask to vertex paint mask when applying multires.

Adds new subsurf_copy_grid_paint_mask() function similar to

9 years agoAdd mask support to CCGSubSurf and multires.
Nicholas Bishop [Thu, 10 May 2012 20:34:08 +0000 (20:34 +0000)]
Add mask support to CCGSubSurf and multires.

* Add new CCG function ccgSubSurf_setAllocMask(). Similar to to
  ccgSubSurf_setCalcVertexNormals(), it sets whether the CCG elements
  have a mask layer and what that layer's offset is. Unlike normals
  however, it doesn't change any behavior during CCG calculation; it's
  there only to give CCGKey information on the mask.

* Add a new flag to _getSubSurf(), CCG_ALLOC_MASK. If set, space for
  an extra layer is allocated, but the number of CCG layers is not set
  to include it. This is done because GridPaintMasks are absolute,
  rather than being relative to the subdivided output (as MDisp
  displacements are), so we skip subdividing paint masks here.

* Add a new flag to subsurf_make_derived_from_derived(),
  set for _getSubSurf(). Related, masks are never loaded in during
  ss_sync_from_derivedmesh(). After subdivision is finished, if the
  alloc mask flag is set, the number of CCG layers is increase to 4
  with ccgSubSurf_setNumLayers().

* Add a new flag to multires_make_from_derived(),
  MULTIRES_ALLOC_PAINT_MASK. Not all multires functions need paint
  mask data (e.g. multiresModifier_base_apply.) This flag is always
  set in MOD_multires.c so that subdividing a mesh with a mask updates
  properly even when not in sculpt mode.

* Update multiresModifier_disp_run() to apply, calculate, and add mask
  elements. It's almost the same as the existing operations with xyz
  coordinates, but treats masks as absolute rather than displacements
  relative to subdivided values.

* Update multires_customdata_delete to free CD_GRID_PAINT_MASK in
  addition to CD_MDISPS.

* Update multires_del_higher() to call the new function
  multires_grid_paint_mask_downsample(), which allocates a
  lower-resolution paint mask grid and copies values over from the
  high-resolution grid.

9 years agoAdd GridPaintMask accessor to paint.c.
Nicholas Bishop [Thu, 10 May 2012 20:33:55 +0000 (20:33 +0000)]
Add GridPaintMask accessor to paint.c.

9 years agoAdd paint mask access to the PBVH vertex iterator.
Nicholas Bishop [Thu, 10 May 2012 20:33:45 +0000 (20:33 +0000)]
Add paint mask access to the PBVH vertex iterator.

9 years agoAdd access to mesh vertex customdata to the PBVH.
Nicholas Bishop [Thu, 10 May 2012 20:33:36 +0000 (20:33 +0000)]
Add access to mesh vertex customdata to the PBVH.

9 years agoAdd DNA and customdata entries for paint masks.
Nicholas Bishop [Thu, 10 May 2012 20:33:24 +0000 (20:33 +0000)]
Add DNA and customdata entries for paint masks.

CD_PAINT_MASK is a layer of per-vertex floats for non-multires
meshes. Multires meshes use CD_GRID_PAINT_MASK, which is a layer of
per-loop GridPaintMask structures. GridPaintMask is similar to MDisp,
but contains an array of scalar floats.

Note: the GridPaintMask could be folded into MDisp, but this way
should be easier to add mask layers in the future (if we do fold
GridPaintMask into MDisp, the mask array should probably be an array
of arrays with a 'totmask' field so that mask layers can be easily

Includes blenload read/write support for CD_PAINT_MASK and

9 years agoReplace hardcoded DMGridData structure with CCGElem/CCGKey.
Nicholas Bishop [Thu, 10 May 2012 20:33:09 +0000 (20:33 +0000)]
Replace hardcoded DMGridData structure with CCGElem/CCGKey.

* Changes to DerivedMesh interface: DMGridData has been removed,
  getGridData() now returns an array of CCGElem pointers. Also added
  getGridKey() to initialize a CCGKey (implemented only by

* PBVH: added BLI_pbvh_get_grid_key().

* A lot of code is affected, but mainly is just replacing,, and sizeof(DMGridData) with the
  CCG_*_elem functions, removing the reliance on grid elements of
  exactly six floats.

9 years agoAdd CCGKey/CCGElem for accessing CCGSubSurf elements.
Nicholas Bishop [Thu, 10 May 2012 20:32:51 +0000 (20:32 +0000)]
Add CCGKey/CCGElem for accessing CCGSubSurf elements.

CCGKey caches information about the CCGSubSurf element layout. This
data, along with the CCG_* inline functions, allows access to
CCGSubSurf elements with an arbitrary number of layers (as opposed to
the hardcoded DMGridData structure which assumes xyz coordinates
followed by three normal components.)

The CCGElem structure is declared but not defined anywhere, just used
as a convenient type.

9 years agoModify CCGSubsurf to subdivide an arbitrary number of (float) layers.
Nicholas Bishop [Thu, 10 May 2012 20:32:41 +0000 (20:32 +0000)]
Modify CCGSubsurf to subdivide an arbitrary number of (float) layers.

The layout of vert data in CCGSubSurf is almost the same; previously
it was three floats (for xyz coordinate) optionally followed by three
floats for the normal. The only change is that the first three floats
can now be any number of floats.

* _getSubSurf takes a numLayers parameter to set the number of layers,
  stored in CCGMeshIFC.numLayers.

* All calls to _getSubSurf currently have numLayers set to 3, except
  for UV subsurf, where it is reduced to 2 (with a corresponding
  change when reading the results out to use float (*)[2] rather than
  float (*)[3].)

* The various VertData* macros in CCGSubSurf.c are now functions that
  take a CCGSubSurf pointer, which provides access to CCGMeshIFC,
  which has numLayers.

* Add ccgSubSurf_setNumLayers() to the API. Only changes the number of
  layers that get subdivided, doesn't change the amount of memory
  allocated. So if space for N layers is allocated, it's safe to set
  the number of layers to less than N, but not more.

* The rest of the changes are just adding the 'ss' parameter.

9 years agoAdd new options to PAINT_OT_brush_select, toggle and create_missing.
Nicholas Bishop [Thu, 10 May 2012 20:32:31 +0000 (20:32 +0000)]
Add new options to PAINT_OT_brush_select, toggle and create_missing.

The toggle option, if enabled, will toggle back and forth between two
brushes. (The first brush of the desired tool type will be toggled to,
running the toggle again switches back to the previously selected

If no brush of the desired type is found, and the create_missing
option is enabled, a new brush of that type will be created and set.

9 years agoAdd an RNA access function to get an enum item name from its value.
Nicholas Bishop [Thu, 10 May 2012 20:32:21 +0000 (20:32 +0000)]
Add an RNA access function to get an enum item name from its value.

New function is RNA_enum_name_from_value.

9 years agoCode cleanup for multires_dm_create_from_derived().
Nicholas Bishop [Thu, 10 May 2012 20:32:09 +0000 (20:32 +0000)]
Code cleanup for multires_dm_create_from_derived().

Changed name to multires_make_derived_from_derived() and parameter
order to be more similar to subsurf_make_derived_from_derived().

Added MultiresFlags enum with flag values to replace the local_mmd and
useRenderParams parameters.

9 years agoCode cleanup for parameters of subsurf_make_derived_from_derived.
Nicholas Bishop [Thu, 10 May 2012 20:31:55 +0000 (20:31 +0000)]
Code cleanup for parameters of subsurf_make_derived_from_derived.

This is the first commit of the sculpt masking merge. Documentation:

Thanks to Brecht for reviewing!

Replaced four boolean parameters with a single flag and a new enum,

9 years agoFix #31379: cycles not recognizing 16 bit tiff as float image.
Brecht Van Lommel [Thu, 10 May 2012 17:09:36 +0000 (17:09 +0000)]
Fix #31379: cycles not recognizing 16 bit tiff as float image.

9 years agoFix #31221: Multiple Monitors/Windows Double Click For Focus
Sergey Sharybin [Thu, 10 May 2012 15:34:23 +0000 (15:34 +0000)]
Fix #31221: Multiple Monitors/Windows Double Click For Focus

Window might be focused by mouse click in configuration of window manager
when focus is not following mouse.
Click could have been done on a button and depending on window manager settings
click would be passed to blender or not, but in any case button under cursor
should be activated. Currently the easiest way to activate button is to
generate mouse move event.

Not sure about OSX, but on windows it worked fine because OS is generating
WM_MOUSEMOVE event "automatically" so nothing special from blender side was

9 years agominor changes to sequencer api
Campbell Barton [Thu, 10 May 2012 15:32:01 +0000 (15:32 +0000)]
minor changes to sequencer api
- rename seqelements.push(file) --> filename
- rename SoundSequence.waveform --> show_waveform
- dont pass context to sequencer functions. editing any scenes sequence can be done, irrespective of context.

9 years agoFix #31393: Shape Keys on curves with hooks
Sergey Sharybin [Thu, 10 May 2012 15:28:35 +0000 (15:28 +0000)]
Fix #31393: Shape Keys on curves with hooks

Own mistake when was fixing #30561 - handles ARE included in shape keys

9 years agostyle cleanup: sequencer and scene rna
Campbell Barton [Thu, 10 May 2012 15:22:29 +0000 (15:22 +0000)]
style cleanup: sequencer and scene rna