8 years agoAdd dynamic topology support to the PBVH
Nicholas Bishop [Sun, 30 Dec 2012 18:28:36 +0000 (18:28 +0000)]
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.

8 years agoAdd BLI_buffer, an alternative to BLI_array
Nicholas Bishop [Sun, 30 Dec 2012 18:28:10 +0000 (18:28 +0000)]
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.

8 years agoAdd DNA/RNA/BKE infrastructure for dynamic-topology sculpt mode
Nicholas Bishop [Sun, 30 Dec 2012 18:27:33 +0000 (18:27 +0000)]
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

8 years agoMove layer displacements from SculptUndoNode to PBVHNode
Nicholas Bishop [Sun, 30 Dec 2012 18:26:11 +0000 (18:26 +0000)]
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.

8 years agoCode cleanup: move PBVH/PBVHNode structs into new header file
Nicholas Bishop [Sun, 30 Dec 2012 18:25:36 +0000 (18:25 +0000)]
Code cleanup: move PBVH/PBVHNode structs into new header file

8 years agoAdd GPU_buffers support for drawing dynamic topology nodes
Nicholas Bishop [Sun, 30 Dec 2012 18:24:54 +0000 (18:24 +0000)]
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.

8 years agoAdd BMLog for efficiently storing changes to vertices and faces
Nicholas Bishop [Sun, 30 Dec 2012 18:24:08 +0000 (18:24 +0000)]
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

8 years agoDisable fall through to global undo from paint/sculpt undo
Nicholas Bishop [Sun, 30 Dec 2012 18:23:42 +0000 (18:23 +0000)]
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.

8 years agoAdd function to find closest point in triangle to another point
Nicholas Bishop [Sun, 30 Dec 2012 18:23:03 +0000 (18:23 +0000)]
Add function to find closest point in triangle to another point

New function is closest_to_tri_v3() in BLI_math_geom.

8 years agoAdd BM_edge_calc_squared_length() query function
Nicholas Bishop [Sun, 30 Dec 2012 18:22:21 +0000 (18:22 +0000)]
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.

8 years agoImport the RangeTree library into extern
Nicholas Bishop [Sun, 30 Dec 2012 18:20:52 +0000 (18:20 +0000)]
Import the RangeTree library into extern

RangeTree is a simple C++ tree set for storing non-overlapping scalar
ranges. Original source from:

Also update the build systems to include RangeTree.

8 years agoFix crash in syntax color code when drawing a text editor with no text.
Brecht Van Lommel [Sun, 30 Dec 2012 18:17:20 +0000 (18:17 +0000)]
Fix crash in syntax color code when drawing a text editor with no text.

8 years agooptimization for text drawing:
Campbell Barton [Sun, 30 Dec 2012 15:40:49 +0000 (15:40 +0000)]
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().

8 years agostyle cleanup: casts, some casts had odd formatting, but very few. Style checker...
Campbell Barton [Sun, 30 Dec 2012 15:16:08 +0000 (15:16 +0000)]
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.

8 years agoMore trackpad woes:
Ton Roosendaal [Sun, 30 Dec 2012 14:31:34 +0000 (14:31 +0000)]
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.

8 years ago16 bit PNG write support
Sergey Sharybin [Sun, 30 Dec 2012 13:01:47 +0000 (13:01 +0000)]
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).

8 years agoRevert change from Jens, wrong pointer check in the code.
Ton Roosendaal [Sun, 30 Dec 2012 10:38:56 +0000 (10:38 +0000)]
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 :)

8 years agoOSL Templates: remove unnecessary stdosl.h include.
Brecht Van Lommel [Sun, 30 Dec 2012 10:37:32 +0000 (10:37 +0000)]
OSL Templates: remove unnecessary stdosl.h include.

8 years agoOSL Templates:
Thomas Dinges [Sun, 30 Dec 2012 03:11:52 +0000 (03:11 +0000)]
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.

8 years agoOSL Syntax Highlighting:
Thomas Dinges [Sun, 30 Dec 2012 02:51:29 +0000 (02:51 +0000)]
OSL Syntax Highlighting:
* Added the remaining shader types
* Some comment and link fixes.

8 years agoadd templates menu for OSL, use preprocessor directive color for decorators in python.
Campbell Barton [Sun, 30 Dec 2012 01:39:55 +0000 (01:39 +0000)]
add templates menu for OSL, use preprocessor directive color for decorators in python.

8 years agoadd syntax highlighting color for symbols
Campbell Barton [Sun, 30 Dec 2012 01:26:31 +0000 (01:26 +0000)]
add syntax highlighting color for symbols

8 years agocode cleanup: enum for formatting char (avoid confusion when '#' is a comment for...
Campbell Barton [Sun, 30 Dec 2012 01:12:21 +0000 (01:12 +0000)]
code cleanup: enum for formatting char (avoid confusion when '#' is a comment for // in OSL)

8 years agocode cleanup: text editor formatting enums were named crypticly, also add asserts...
Campbell Barton [Sun, 30 Dec 2012 00:46:17 +0000 (00:46 +0000)]
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).

8 years agoInfinite loop caused by using an uninitialized variable in a compairison statement
Dan Eicher [Sat, 29 Dec 2012 22:06:44 +0000 (22:06 +0000)]
Infinite loop caused by using an uninitialized variable in a compairison statement

8 years agoMissing NULL check which crashes on opening the Text Editor without an active Text...
Dan Eicher [Sat, 29 Dec 2012 20:16:21 +0000 (20:16 +0000)]
Missing NULL check which crashes on opening the Text Editor without an active Text object

8 years agoOSX: fix magic mouse swipes compiling on with MAC_OS_X_VERSION_MIN_REQUIRED by checki...
Jens Verwiebe [Sat, 29 Dec 2012 19:51:44 +0000 (19:51 +0000)]
OSX: fix magic mouse swipes compiling on with MAC_OS_X_VERSION_MIN_REQUIRED by checking address not value

8 years agofix bug #33275: iTaSC ignores location of disconnected bones when they are changed...
Benoit Bolsee [Sat, 29 Dec 2012 19:43:08 +0000 (19:43 +0000)]
fix bug #33275: iTaSC ignores location of disconnected bones when they are changed in pose mode.

Disconnected bones can be translated in pose mode but this translation
cannot be applied to the iTaSC representation of the armature because
there is no joint associated with it. As a result, moving disconnected
bones had no effect. The bug fix is in two parts:
1) manual or rna change in the armature pose will cause automatic
   rebuilding of the iTaSC scene
2) the iTaSC scene is now built from the current pose instead of
   armature rest pose

8 years agopatch [#33609] Syntax highlighting for OSL in Text Editor
Campbell Barton [Sat, 29 Dec 2012 18:25:03 +0000 (18:25 +0000)]
patch [#33609] Syntax highlighting for OSL in Text Editor
from Patrick Boelens (senshi). with modifications to split it into its own function.

also added C style multi-line comment support /* ... */

I've left out the part of this patch that sets the language in the space, since I think this might be better stored in the text block.

For now it simply uses OSL syntax highlighting when the extension is '.osl'.

8 years agofix for 2 errors in python syntax highlighting, no space was allowed in decorators...
Campbell Barton [Sat, 29 Dec 2012 18:20:14 +0000 (18:20 +0000)]
fix for 2 errors in python syntax highlighting, no space was allowed in decorators and decorators where being skipped.

8 years agoLong ago we used to be able to bake physics from negative frames, feature that got...
Pablo Vazquez [Sat, 29 Dec 2012 17:49:43 +0000 (17:49 +0000)]
Long ago we used to be able to bake physics from negative frames, feature that got lost at some point. Now we can do it again.

Example is for physics like Cloth or Hair Dynamics that start on a shaky state for a few frames until they settle (for say baking subtle grass or hair movement).

Reviewed on IRC by kaito, Uncle_Entity and DingTo.

8 years agocode cleanup: text editor syntax highlighting - avoid loops using memset()
Campbell Barton [Sat, 29 Dec 2012 16:18:03 +0000 (16:18 +0000)]
code cleanup: text editor syntax highlighting - avoid loops using memset()

8 years agotext editor: replace strncmp() and hard coded size with STR_LITERAL_STARTSWITH()...
Campbell Barton [Sat, 29 Dec 2012 16:04:45 +0000 (16:04 +0000)]
text editor: replace strncmp() and hard coded size with STR_LITERAL_STARTSWITH() macro that gets the size from sizeof().

8 years agostyle cleanup
Campbell Barton [Sat, 29 Dec 2012 15:55:37 +0000 (15:55 +0000)]
style cleanup

8 years agoAnd another NDOF fix:
Ton Roosendaal [Sat, 29 Dec 2012 15:25:03 +0000 (15:25 +0000)]
And another NDOF fix:

The dolly factor (fly in/out) now correctly scales for distance to view center.
This allows working on details or huge scenes.

8 years agoFixes for NDOF device:
Ton Roosendaal [Sat, 29 Dec 2012 15:17:26 +0000 (15:17 +0000)]
Fixes for NDOF device:

User preference "Rotate around selection" now works for all input operators.
(Didnt for new default)

Note: the default will only rotate around selection, zooms remain to view center.
Our view pivot methods are not well definied at all...

8 years agoTrackpad fixes & changes:
Ton Roosendaal [Sat, 29 Dec 2012 13:21:01 +0000 (13:21 +0000)]
Trackpad fixes & changes:

- UV Image editor and other 2d views didn't zoom for CTRL+swipe yet.
  (2 finger trackpad, 1 finger mighty mouse)

- Switched defaults for 3D window swiping...
  - default rotate view
  - SHIFT for translate
  - CTRL for zooms

This makes all editors use 'swipe' like 'middle mouse', and not
like scrollwheel (as in releases).

This is nice for consistancy, but it still feels a bit weird...

Of course users can config this in keymaps. We need a sensible
default though, and to make a 2D input input device behave like
middle mouse seeems more sensible than like a 1D wheel...

Proposal therefore for defaults:

- 1D scrollwheels: zoom in 3d, zoom in 2d, but scroll for list views.

- 2D trackpads: pan for all 2d views, rotate for 3D

I'll check with frequent trackpad users about this and we can freeze it
before release. Give it a try :)

8 years agoBug fix #32806
Ton Roosendaal [Sat, 29 Dec 2012 12:33:24 +0000 (12:33 +0000)]
Bug fix #32806

In 2.64, input for using an NDOF device included all 6 DOFs - including panning.
That makes using it for many people (including beginners like me) too hard, you
very quickly lose the 3d view rotation pivot, as if you are in free fly mode.

Fredrik provided an updated patch, which restores the 2.63 method to only
dolly and rotate by default. The new "all dof" operator is hidden in the keymaps
behind modifier keys SHIFT + CTRL. Users can set this in their configs of course.

As usual, we should be careful changing accepted defaults, and provide new
options as additional choice only.

A useful todo is to make user preference "around selection" work well.
Will check on this now too.

8 years agoexample use of addon preferences.
Campbell Barton [Sat, 29 Dec 2012 11:07:31 +0000 (11:07 +0000)]
example use of addon preferences.

8 years agoadd include missing from last commit
Campbell Barton [Sat, 29 Dec 2012 11:03:03 +0000 (11:03 +0000)]
add include missing from last commit

8 years agoMac OS X 10.7 supports new trackpad (and mighty mouse) events with nice seamless
Ton Roosendaal [Sat, 29 Dec 2012 11:00:45 +0000 (11:00 +0000)]
Mac OS X 10.7 supports new trackpad (and mighty mouse) events with nice seamless
scrolling and inertia.

Now Blender uses this - if you have 10.7. Otherwise it just falls back on the
old code.

Try it, makes a huge difference :)

Next todo: how to configure this well, so you can have trackpad (or mighty mouse)
zoom as default in 3d views.

8 years agouser-preferences for addons. currently unused, example & docs still to come.
Campbell Barton [Sat, 29 Dec 2012 10:24:42 +0000 (10:24 +0000)]
user-preferences for addons. currently unused, example & docs still to come.

8 years agoBGE: Adding a jumpCount to KX_CharacterWrapper. This can be used to have different...
Mitchell Stokes [Sat, 29 Dec 2012 10:22:19 +0000 (10:22 +0000)]
BGE: Adding a jumpCount to KX_CharacterWrapper. This can be used to have different logic for a single jump versus a double jump. For example, a different animation for the second jump.

8 years agoFinally fixing the issue where the bezier curve drawn while creating a link between...
Mitchell Stokes [Sat, 29 Dec 2012 09:44:19 +0000 (09:44 +0000)]
Finally fixing the issue where the bezier curve drawn while creating a link between two logic bricks doesn't match the mouse cursor location. The issue was the last line segment for the bezier curve was not getting drawn. This is why the error increased as the curve got longer.

8 years agoFix for the NODE_OT_add_node operator. The way python classes were subclassed does...
Lukas Toenne [Sat, 29 Dec 2012 08:46:27 +0000 (08:46 +0000)]
Fix for the NODE_OT_add_node operator. The way python classes were subclassed does not work with the registration mechanism. Combined both node_add and node_add_move operators into a single general operator with a flag. When use_transform is set, the operator will start transform on the new nodes after inserting.

8 years agoBGE: An off-by-one error when setting up the viewport for 2D filters caused a blurrin...
Mitchell Stokes [Sat, 29 Dec 2012 08:36:41 +0000 (08:36 +0000)]
BGE: An off-by-one error when setting up the viewport for 2D filters caused a blurring effect when using 2D filters. This is now fixed.

8 years agoBGE: Fix for [#33685] "2D Filters Partially Offset" reported by Josiah Lane (solarlun...
Mitchell Stokes [Sat, 29 Dec 2012 04:03:25 +0000 (04:03 +0000)]
BGE: Fix for [#33685] "2D Filters Partially Offset" reported by Josiah Lane (solarlune). This bug was caused by me in a recent change to clean up the 2D filters a bit. I forgot that canvas->SetViewPort already handles some viewport calculations, and thus I ended up doubling up on calculations, which caused the offset.

8 years agoset line endings to native & mime type to text/plain for .app/Contents/MacOS/xxx...
Campbell Barton [Sat, 29 Dec 2012 03:19:30 +0000 (03:19 +0000)]
set line endings to native & mime type to text/plain for .app/Contents/MacOS/xxx files.

8 years agocode cleanup
Campbell Barton [Sat, 29 Dec 2012 02:57:52 +0000 (02:57 +0000)]
code cleanup

8 years agoCycles Hair:
Thomas Dinges [Sat, 29 Dec 2012 01:57:32 +0000 (01:57 +0000)]
Cycles Hair:
* Implemented the Hair Info Node for OSL.

8 years agostyle cleanup
Campbell Barton [Sat, 29 Dec 2012 01:54:58 +0000 (01:54 +0000)]
style cleanup

8 years agoFix for last commit, hair settings panel should also check on psys.
Thomas Dinges [Sat, 29 Dec 2012 01:14:03 +0000 (01:14 +0000)]
Fix for last commit, hair settings panel should also check on psys.

8 years agoAdd datafiles/locale/languages to for CPack
Dan Eicher [Fri, 28 Dec 2012 23:30:34 +0000 (23:30 +0000)]
Add datafiles/locale/languages to for CPack

8 years agoi18 Spell check:
Thomas Dinges [Fri, 28 Dec 2012 20:32:29 +0000 (20:32 +0000)]
i18 Spell check:
* Wrong comma sequence in

8 years agoHrm... replacing
Ton Roosendaal [Fri, 28 Dec 2012 19:26:25 +0000 (19:26 +0000)]
Hrm... replacing


8 years agoTesting commit for OS X trackpad and scroll events.
Ton Roosendaal [Fri, 28 Dec 2012 19:10:21 +0000 (19:10 +0000)]
Testing commit for OS X trackpad and scroll events.

- code is wrapped for OS X releases (10.6 and 10.7)
- It now detects scrollwheel (old mouse) and gesture strokes (mighty mouse or trackpad).

If you have 10.6, things will work as for release.

Next todo for tomorrow: make trackpad work actually smooth and not with steps.
Will also try to figure out the device type, to handle mighty mouse differently.

8 years agoFix OSL distance() of point to line segment function not being available,
Brecht Van Lommel [Fri, 28 Dec 2012 18:21:07 +0000 (18:21 +0000)]
Fix OSL distance() of point to line segment function not being available,
implemented now in stdosl.h.

8 years agoCycles Hair UI:
Thomas Dinges [Fri, 28 Dec 2012 16:25:41 +0000 (16:25 +0000)]
Cycles Hair UI:
* Code cleanup, removed some unneeded code
* Moved "Cycles Hair Rendering" panel above "Cycles Hair settings"
* "Cycles Hair settings" panel is only visible when hair rendering ("use_curves") is enabled.

8 years agoReversion of previous fix for Mac OS X scrollwheel,
Ton Roosendaal [Fri, 28 Dec 2012 16:11:04 +0000 (16:11 +0000)]
Reversion of previous fix for Mac OS X scrollwheel,
it appears I used 10.7+ options, fails for 10.6.

Back to drawing board!

8 years agoFix cycles python error in some panels, was not updated for new list template yet.
Brecht Van Lommel [Fri, 28 Dec 2012 14:46:43 +0000 (14:46 +0000)]
Fix cycles python error in some panels, was not updated for new list template yet.

8 years agoConvert alpha node: rename "key alpha" to "straight alpha" for consistency.
Brecht Van Lommel [Fri, 28 Dec 2012 14:46:32 +0000 (14:46 +0000)]
Convert alpha node: rename "key alpha" to "straight alpha" for consistency.

8 years agoNew feature
Stuart Broadfoot [Fri, 28 Dec 2012 14:21:30 +0000 (14:21 +0000)]
New feature

Patch [#33445] - Experimental Cycles Hair Rendering (CPU only)

This patch allows hair data to be exported to cycles and introduces a new line segment primitive to render with.

The UI appears under the particle tab and there is a new hair info node available.

It is only available under the experimental feature set and for cpu rendering.

8 years agostyle cleanup
Campbell Barton [Fri, 28 Dec 2012 14:19:05 +0000 (14:19 +0000)]
style cleanup

8 years agocode cleanup: move view3d buffer bones loop into a static function (was not breaking...
Campbell Barton [Fri, 28 Dec 2012 13:48:30 +0000 (13:48 +0000)]
code cleanup: move view3d buffer bones loop into a static function (was not breaking out of the loop when a bone was found).

8 years agoSmall fix: increased precision print of color sampling float images with 1 digit.
Ton Roosendaal [Fri, 28 Dec 2012 13:44:44 +0000 (13:44 +0000)]
Small fix: increased precision print of color sampling float images with 1 digit.
Now it prints 5, which shows better whether a buffer is float, or half float.

8 years agoFix [#33424] Inadequate bake action.
Bastien Montagne [Fri, 28 Dec 2012 13:34:19 +0000 (13:34 +0000)]
Fix [#33424] Inadequate bake action.

bake_action tries to make kind of a 'visual keying'... On one side, this is rather stupid when you keep constraints (in this case, keying actual loc/rot/scale transforms, i.e. matrix_basis, is enough, doing more would lead to unexpected behavior with some constraints). On the other one, making a good visual keying of bones is *really* tricky, so now using the new object's convert_space() func to compute that (when the user chooses to remove the constraints).

Incidentally, this greatly simplifies the code of bake_action!

8 years agoExpose BKE_constraint_mat_convertspace() as object's convert_space() func in RNA...
Bastien Montagne [Fri, 28 Dec 2012 13:21:57 +0000 (13:21 +0000)]
Expose BKE_constraint_mat_convertspace() as object's convert_space() func in RNA. Converting between various standard spaces (like local, pose, world, etc.) can become quite hairy (especially with bones), as we already have this code in C, let's help py devs' life.

Thanks to Campbell for the review and advices.

8 years agoBugfix #33681
Ton Roosendaal [Fri, 28 Dec 2012 12:48:45 +0000 (12:48 +0000)]
Bugfix #33681

Blender didn't detect properly whether event came from a mouse-wheel or
from a trackpad in OS X.

Now you can both, and both are handled independently.

Removed back hack from 2 years ago - which disabled mouse wheel for laptops.

8 years agopatch [#33669] SConstruct: Tell how to pass BF_PYTHON_INC to SCons is it is not found
Campbell Barton [Fri, 28 Dec 2012 12:12:04 +0000 (12:12 +0000)]
patch [#33669] SConstruct: Tell how to pass BF_PYTHON_INC to SCons is it is not found
from anatoly techtonik (techtonik)

8 years agopatch [#33687] select similar lamp
Campbell Barton [Fri, 28 Dec 2012 11:24:07 +0000 (11:24 +0000)]
patch [#33687] select similar lamp
by Saurabh Wankhade (sauraedron), with some edits.

8 years agoFix blenderplayer compilation.
Antony Riakiotakis [Fri, 28 Dec 2012 11:19:33 +0000 (11:19 +0000)]
Fix blenderplayer compilation.

8 years agofix [#33677] Lambda is un-settable for mesh.vertices_smooth_laplacian
Campbell Barton [Fri, 28 Dec 2012 11:12:46 +0000 (11:12 +0000)]
fix [#33677] Lambda is un-settable for mesh.vertices_smooth_laplacian

lambda is python keyword.

8 years agoremove type checks on drawing uiList's,
Campbell Barton [Fri, 28 Dec 2012 10:45:59 +0000 (10:45 +0000)]
remove type checks on drawing uiList's,

if the list is given the wrong item then the script needs to be fixed, better not fail silently.

left in checks as commented out asserts.

8 years agoYesterday's memory free error fix in IMB_onehalf was wrong, it should
Ton Roosendaal [Fri, 28 Dec 2012 10:38:07 +0000 (10:38 +0000)]
Yesterday's memory free error fix in IMB_onehalf was wrong, it should
be fixed in the icons code!

8 years agoadd missing free for ui lists
Campbell Barton [Fri, 28 Dec 2012 10:36:25 +0000 (10:36 +0000)]
add missing free for ui lists

8 years agostyle cleanup: var naming for ui list
Campbell Barton [Fri, 28 Dec 2012 10:32:49 +0000 (10:32 +0000)]
style cleanup: var naming for ui list

8 years agofix for memory leaks in own recent changes.
Campbell Barton [Fri, 28 Dec 2012 10:23:06 +0000 (10:23 +0000)]
fix for memory leaks in own recent changes.

8 years agorevert r53356, this stopped the leak but still wasn't working nice.
Campbell Barton [Fri, 28 Dec 2012 10:08:17 +0000 (10:08 +0000)]
revert r53356, this stopped the leak but still wasn't working nice.

Add asserts when CTX_data_pointer_get/CTX_data_collection_get are incorrectly used.

disable context inspection for now, Will enable again when its working properly.

8 years agoThe new feature printing changed properties in python history list didn't free
Ton Roosendaal [Fri, 28 Dec 2012 09:48:35 +0000 (09:48 +0000)]
The new feature printing changed properties in python history list didn't free
a list of context properties. Give lots of leaked small blocks...

8 years agoThis commit frees list ui items from their dependencies to Panel, and hence from...
Bastien Montagne [Fri, 28 Dec 2012 09:20:16 +0000 (09:20 +0000)]
This commit frees list ui items from their dependencies to Panel, and hence from all the limitations this implied (mostly, the "only one list per panel" one).

It introduces a new (py-extendable and registrable) RNA type, UIList (roughly similar to Panel one), which currently contains only "standard" list's scroll pos and size (but may be expended to include e.g. some filtering data, etc.). This now makes lists completely independent from Panels!

This UIList has a draw_item callback which allows to customize items' drawing from python, that all addons can now use. Incidentally, this also greatly simplifies the C code of this widget, as we do not code any "special case" here anymore!

To make all this work, other changes were also necessary:

* Now all buttons (uiBut struct) have a 'custom_data' void pointer, used currently to store the uiList struct associated with a given uiLayoutListBox.

* DynamicPaintSurface now exposes a new bool, use_color_preview (readonly), saying whether that surface has some 3D view preview data or not.

* UILayout class has now four new (static) functions, to get the actual icon of any RNA object (important e.g. with materials or textures), and to get an enum item's UI name, description and icon.

* UILayout's label() func now takes an optional 'icon_value' integer parameter, which if not zero will override the 'icon' one (mandatory to use "custom" icons as generated for material/texture/... previews).
  Note: not sure whether we should add that one to all UILayout's prop funcs?

Note: will update addons using template list asap.

8 years agocode cleanup:
Campbell Barton [Fri, 28 Dec 2012 09:06:48 +0000 (09:06 +0000)]
code cleanup:
- free_dverts -> BKE_defvert_array_free
- copy_dverts -> BKE_defvert_array_copy

also move the functions from BKE_mesh into BKE_deform

8 years agofix for memory leak with weight painting and ensure vertex group is created before...
Campbell Barton [Fri, 28 Dec 2012 09:00:05 +0000 (09:00 +0000)]
fix for memory leak with weight painting and ensure vertex group is created before use.

8 years agoAdd 'vertex_only' option to bevel tool.
Howard Trickey [Fri, 28 Dec 2012 02:45:10 +0000 (02:45 +0000)]
Add 'vertex_only' option to bevel tool.
Right now, changing segments to > 1 doesn't do anything,
but intend to work on making that cause rounded corners.

8 years agoremove unneeded inline lookups and fix error with wpaint_stroke_test_start returning...
Campbell Barton [Fri, 28 Dec 2012 01:36:00 +0000 (01:36 +0000)]
remove unneeded inline lookups and fix error with wpaint_stroke_test_start returning OPERATOR_PASS_THROUGH rather then a boolean.

8 years agoremove workaround for [#31555], forcing PYTHONIOENCODING was causing stdout to be...
Campbell Barton [Fri, 28 Dec 2012 00:54:22 +0000 (00:54 +0000)]
remove workaround for [#31555], forcing PYTHONIOENCODING was causing stdout to be lost on exit - no MEM_printmemlist_stats()

8 years agoBetter error report when no camera is found.
Pablo Vazquez [Thu, 27 Dec 2012 22:00:31 +0000 (22:00 +0000)]
Better error report when no camera is found.

While trying to render a RenderLayer from a linked scene, I couldnt tell why it wasnt doing anything. It just stopped rendering. Until I look on the console and see the No Camera print.

This commit replaces the simple terminal printf with an actual error report, that shows in both terminal and to the user:

I believe this commit is pretty harmless, and only adds functionality. But feel free to remove it.

8 years agoOutliner fix:
Ton Roosendaal [Thu, 27 Dec 2012 19:07:16 +0000 (19:07 +0000)]
Outliner fix:

New "Blender file" viewer now shows names of libraries better.

8 years agoFunction IMB_onehalf was not freeing memory.
Ton Roosendaal [Thu, 27 Dec 2012 17:15:45 +0000 (17:15 +0000)]
Function IMB_onehalf was not freeing memory.
(Used for icon mipmap)

8 years agoFix in previous commit: forgot to free data from file reading.
Ton Roosendaal [Thu, 27 Dec 2012 17:09:27 +0000 (17:09 +0000)]
Fix in previous commit: forgot to free data from file reading.

(Campbell: we want the memory prints back!!!)

8 years agoBug fix, own collection.
Ton Roosendaal [Thu, 27 Dec 2012 15:55:37 +0000 (15:55 +0000)]
Bug fix, own collection.

"Add Group" was excluding linked library objects.

8 years agoNew features!
Ton Roosendaal [Thu, 27 Dec 2012 15:07:19 +0000 (15:07 +0000)]
New features!

- Packing .blend files

If you work a lot with dynamic linked .blend files ("Libraries"), it's always hard to
share your work with others (or for bug reports!).
This new option packs all used external .blend files, and - on save - combines it together
in one .blend file. You can save that file on any location.

Loading a packed .blend file then loads all library data usual - not editable.

Just use unpack to save out all linked .blend files. This will only save out the files
according the directory structure as was used on linking - relative to the current .blend.
It will create new directories, so be careful with unpacking when relative paths go up.

This feature also works fine for linked compressed .blend files.

It also works for many levels deep linked .blend hierarchies.

Access is hidden for now - I need to get some people to give it serious testing first.
You can find the options via spacebar search (try pack or unpack).

- Packed data and Undo

Now all packed data is excluded from the Undo buffer storage. Keeps undo memory smaller
and makes faster redo possible.

8 years agovalidate operator names on startup (debug mode only)
Campbell Barton [Thu, 27 Dec 2012 12:40:02 +0000 (12:40 +0000)]
validate operator names on startup (debug mode only)

8 years agouse keyword args for bmesh.update_edit_mesh(...)
Campbell Barton [Thu, 27 Dec 2012 07:27:28 +0000 (07:27 +0000)]
use keyword args for bmesh.update_edit_mesh(...)

8 years agoadd option to BLI_scanfill_calc() - BLI_SCANFILL_CALC_HOLES, gives some speedup for...
Campbell Barton [Thu, 27 Dec 2012 06:39:27 +0000 (06:39 +0000)]
add option to BLI_scanfill_calc() - BLI_SCANFILL_CALC_HOLES, gives some speedup for BMesh ngons which never have holes and ensures predictable triangle count (totvert - 2), which is needed for pre-calculating array size.

8 years agocorrection for poly_to_tri_count() when given zero poly count.
Campbell Barton [Thu, 27 Dec 2012 05:08:16 +0000 (05:08 +0000)]
correction for poly_to_tri_count() when given zero poly count.

8 years agoremove realloc's during BMEdit_RecalcTessellation(), instead use poly_to_tri_count...
Campbell Barton [Thu, 27 Dec 2012 04:18:22 +0000 (04:18 +0000)]
remove realloc's during BMEdit_RecalcTessellation(), instead use poly_to_tri_count() to calculate how many triangles are needed.

8 years agodisplay the number of tri's in object mode status, often requested feature from users...
Campbell Barton [Thu, 27 Dec 2012 03:51:45 +0000 (03:51 +0000)]
display the number of tri's in object mode status, often requested feature from users who model for realtime/game-engine output,
the total number of faces wasn't so useful and could be especially misleading with ngons.

8 years agoFix: edge uv stitch mode did not average final position of uvs in
Antony Riakiotakis [Thu, 27 Dec 2012 03:14:11 +0000 (03:14 +0000)]
Fix: edge uv stitch mode did not average final position of uvs in
midpoint, non-snapping mode.

8 years agoFix: rotation of uv islands during stitch did not take uv aspect ratio
Antony Riakiotakis [Thu, 27 Dec 2012 02:52:45 +0000 (02:52 +0000)]
Fix: rotation of uv islands during stitch did not take uv aspect ratio
of image into account, distorting the islands. Now properly scale the
components before rotating the island.

8 years agofix [#33651] Spin tool destroys unselected loose vertex
Campbell Barton [Thu, 27 Dec 2012 01:02:32 +0000 (01:02 +0000)]
fix [#33651] Spin tool destroys unselected loose vertex

bmesh.ops.extrude_face_region() didn't check for isolated verts (not connected to geometry), and removed them, happened for Ctrl+LMB extrude too.