Commit Graph

43628 Commits

Author SHA1 Message Date
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
Jens Verwiebe
eae167998a OSX: fix magic mouse swipes compiling on with MAC_OS_X_VERSION_MIN_REQUIRED by checking address not value 2012-12-29 19:51:44 +00:00
Benoit Bolsee
0028418fe8 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
2012-12-29 19:43:08 +00:00
Campbell Barton
e9c7aaaa3c 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'.
2012-12-29 18:25:03 +00:00
Campbell Barton
14ea084580 fix for 2 errors in python syntax highlighting, no space was allowed in decorators and decorators where being skipped. 2012-12-29 18:20:14 +00:00
Pablo Vazquez
abc5a6c3c8 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.
2012-12-29 17:49:43 +00:00
Campbell Barton
8c29f611e9 code cleanup: text editor syntax highlighting - avoid loops using memset() 2012-12-29 16:18:03 +00:00
Campbell Barton
4fc84b8f15 text editor: replace strncmp() and hard coded size with STR_LITERAL_STARTSWITH() macro that gets the size from sizeof(). 2012-12-29 16:04:45 +00:00
Campbell Barton
1cffa7f339 style cleanup 2012-12-29 15:55:37 +00:00
Ton Roosendaal
a7d4ea32f0 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.
2012-12-29 15:25:03 +00:00
Ton Roosendaal
1b8db64199 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...
2012-12-29 15:17:26 +00:00
Ton Roosendaal
dfc63e98bc 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 :)
2012-12-29 13:21:01 +00:00
Ton Roosendaal
31933e747f 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.
2012-12-29 12:33:24 +00:00
Campbell Barton
4ed4be1fc2 example use of addon preferences. 2012-12-29 11:07:31 +00:00
Campbell Barton
415c8ed811 add include missing from last commit 2012-12-29 11:03:03 +00:00
Ton Roosendaal
7684f2e5ac 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.
2012-12-29 11:00:45 +00:00
Campbell Barton
79c2571e56 user-preferences for addons. currently unused, example & docs still to come. 2012-12-29 10:24:42 +00:00
Mitchell Stokes
18f134304c 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. 2012-12-29 10:22:19 +00:00
Mitchell Stokes
7d6ea8cddf 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. 2012-12-29 09:44:19 +00:00
Lukas Toenne
ed713803f5 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. 2012-12-29 08:46:27 +00:00
Mitchell Stokes
0cb07bcabc 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. 2012-12-29 08:36:41 +00:00
Mitchell Stokes
7d68b37032 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. 2012-12-29 04:03:25 +00:00
Campbell Barton
bc9ad1270b set line endings to native & mime type to text/plain for .app/Contents/MacOS/xxx files. 2012-12-29 03:19:30 +00:00
Campbell Barton
c157f815a8 code cleanup 2012-12-29 02:57:52 +00:00
Thomas Dinges
6b05c887d3 Cycles Hair:
* Implemented the Hair Info Node for OSL.
2012-12-29 01:57:32 +00:00
Campbell Barton
4a427d8e0d style cleanup 2012-12-29 01:54:58 +00:00
Thomas Dinges
6b211bac15 Fix for last commit, hair settings panel should also check on psys. 2012-12-29 01:14:03 +00:00
Dan Eicher
19c4ae50e4 Add datafiles/locale/languages to blender.spec.in for CPack 2012-12-28 23:30:34 +00:00
Thomas Dinges
f098407f02 i18 Spell check:
* Wrong comma sequence in spell_check_utils.py
2012-12-28 20:32:29 +00:00
Ton Roosendaal
01fe30f50b Hrm... replacing
MAC_OS_X_VERSION_MAX_ALLOWED
with
MAC_OS_X_VERSION_MIN_REQUIRED
2012-12-28 19:26:25 +00:00
Ton Roosendaal
4e24bcf6c9 Testing commit for OS X trackpad and scroll events.
Now:
- 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.
2012-12-28 19:10:21 +00:00
Brecht Van Lommel
cfd0b3c5f2 Fix OSL distance() of point to line segment function not being available,
implemented now in stdosl.h.
2012-12-28 18:21:07 +00:00
Thomas Dinges
81b371a451 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.
2012-12-28 16:25:41 +00:00
Ton Roosendaal
357b02f65f Reversion of previous fix for Mac OS X scrollwheel,
it appears I used 10.7+ options, fails for 10.6.

Back to drawing board!
2012-12-28 16:11:04 +00:00