Commit Graph

42048 Commits

Author SHA1 Message Date
Campbell Barton
0f22eb8564 3D Text: delete selection before pasting 2013-12-08 16:39:11 +11:00
Antony Riakiotakis
6d8f76cfab Minor addition for completeness (unlikely to happen), make sure new
sculpt struct has at least dyntopo subdivision turned on.
2013-12-08 01:57:44 +02:00
Antony Riakiotakis
9f1ace2469 Add themable colors for edges in UV editor. Reuse WIRE_EDIT for outlines
and EDGE_SELECT theme colors for selected edges.
2013-12-08 01:37:19 +02:00
Brecht Van Lommel
51263c6637 Fix T37731: some window manager operators unnecessarily required a window to be active. 2013-12-08 00:00:51 +01:00
Antony Riakiotakis
8e5b02359b Fix T37326 inversion of image channels did not do an undo push. Now only do an undo if we are in image paint mode and use the paint undo stack. Also added missing GPU update.: 2013-12-08 00:29:13 +02:00
Geoffroy Krantz
9174f22b3c Particles: change material picking from index number in UI to menu with materials.
Also fix material slot index not being properly initialized to 1, this got clamped
from zero only on drawing the UI.

Reviewed By: brecht

Differential Revision: http://developer.blender.org/D55
2013-12-07 12:26:58 +01:00
Campbell Barton
1ed822202f Code Cleanup: pass rectangles as const in insterface files 2013-12-07 15:47:57 +11:00
Campbell Barton
f64b3732be Util Macros: reduce multiple access & conversion for CLAMP/CLAMPIS/ABS 2013-12-07 14:29:27 +11:00
Campbell Barton
69065b5b2c Compiler warnings: quiet warnings for gcc4.7x
patch from Sergey
2013-12-07 13:21:59 +11:00
Joshua Leung
9b932c12c8 Fix T37722 - Can't undo deleting a screen layout
Operations on screen and UI stuff is not actually saved in the undo
files/buffers. Therefore, these shouldn't have the flags set for
getting included for undo and in the last operator settings.
2013-12-07 13:23:51 +13:00
Sergey Sharybin
967b12060c Alpha channel of a plane track image works fine in MCE now 2013-12-06 20:08:37 +06:00
Campbell Barton
75212f4677 BMesh Py API: add bmesh.geometry.intersect_face_point()
patch originally by mont29 with some edits.
2013-12-06 21:15:56 +11:00
Campbell Barton
72d950ba49 Rectangle API: add single axis intersection check 2013-12-06 18:48:55 +11:00
Campbell Barton
d74d6c7c1d Fix T37710: Missing bounds check for active UI list item could crash. 2013-12-06 10:53:41 +11:00
Antony Riakiotakis
4b9fb83e67 Appease grumpy ole gcc 4.7 of MinGW64 (possibly gcc 4.6 of MinGW32 too?)
that cannot convert float to char without false warnings that are turned
into errors with strict flags. I expect that any real conversion
warnings can be caught on linux.
2013-12-05 23:32:59 +02:00
Antony Riakiotakis
39fd299498 Forgot to theme-ify color of shadow UVs (color used to draw uvs during
image painting)
2013-12-05 23:12:32 +02:00
Sergey Sharybin
3f82e829e5 Correction to fix of T37688
rB68d39a262c90 didn't check correct file for doing
versioning code. It shall check userprefs.blend not
startup.blend.
2013-12-06 01:12:13 +06:00
Campbell Barton
07ceb99213 Code Cleanup: use strict flags for math lib, add inline declarations 2013-12-06 03:57:17 +11:00
Campbell Barton
fac8e84632 Fix for own error in recent tessellation update. 2013-12-06 01:32:18 +11:00
Lukas Tönne
193dd134da Fix T37698: Crash from invalid context access when freeing custom
python nodes on Blender exit.

The nodeFreeNode function is calling a customizable freefunc callback,
which can be implemented by python. However, the context is invalid when
using this callback while the node tree data block is freed on exit.
Luckily it is also not necessary: When freeing the bNodeTree data blocks
all that is needed is freeing of the DNA data, no other side effects
should happen. So now disable the api callbacks when freeing nodes in
the ntreeFreeTree function.

Also some minor cleanup: checking node->typeinfo is not necessary, all
nodes will always have a valid typeinfo pointer - if a node type is
unknown this will be a stub bNodeType to avoid the need for such checks.
2013-12-05 15:09:42 +01:00
Sergey Sharybin
68d39a262c Fix T37688: User Preferences do not load correctly
Issue was caused by from_memory=true passing to wm_homefile_read
in case there's a configuration folder for current blender.

But the thing is, we still might fallback to reading home file
from memory (i.e. in cases there's no startup.blend in config
folder).

In this case we still need to run versioning code for userprefs.
2013-12-05 19:32:48 +06:00
Sergey Sharybin
4838a60b0c Fix T37703: Shadow pass output image is mangled.
Was a mistake in own optimization commit.
2013-12-05 17:31:53 +06:00
IRIE Shinsuke
c17266ff54 Blender Internal: Fix for rendered view crash that happens when changing screen or area type
This crash is very similar to T36936.  If changing screen or area type
buried the rendered view, popping up it again may cause the crash by
corrupted render database.
2013-12-05 16:08:10 +09:00
Campbell Barton
6976866d5a User Interface: Ctrl+C over a menu copies the py command
also use bools rather then ints
2013-12-05 17:26:03 +11:00
Campbell Barton
8003f0606d Compiler warnings: quiet float/double conversion warning 2013-12-05 10:34:30 +11:00
Sergey Sharybin
c6f425c875 Fix T37189: Inconsistent icons for Force field
There's still an issue with Curve Guide force field
which you can not so easily change type from/to.

This i would consider TODO for later.
2013-12-05 01:24:05 +06:00
Sergey Sharybin
b98754836e Fix T37680: Texture image scale is not refreshing 2013-12-04 23:17:59 +06:00
Campbell Barton
c2a518461c Add alloca include for MSVC 2013-12-05 03:45:14 +11:00
Lukas Tönne
67134a7bf6 Fix for EWA (elliptical weighted average) sampling in the compositor.
EWA sampling is designed for downsampling images, i.e. scaling down the size of
input image pixels, which happens regularly in compositing. While the standard
sampling methods (linear, cubic) work reasonably well for linear
transformations, they don't yield good results in non-linear cases like
perspective projection or arbitrary displacement. EWA sampling is comparable to
mipmapping, but avoids problems with discontinuities.

To work correctly the EWA algorithm needs partial derivatives of the mapping
functions which convert output pixel coordinates back into the input image
space (2x2 Jacobian matrix). With these derivatives the EWA algorithm
projects ellipses into the input space and accumulates colors over their
area. This calculation was not done correctly in the compositor, only the
derivatives du/dx and dv/dy were calculation, basically this means it only
worked for non-rotated input images.

The patch introduces full derivative calculations du/dx, du/dy, dv/dx, dv/dy for
the 3 nodes which use EWA sampling currently: PlaneTrackWarp, MapUV and
Displace. In addition the calculation of ellipsis area and axis-aligned
bounding boxes has been fixed.

For the MapUV and Displace nodes the derivatives have to be estimated by
evaluating the UV/displacement inputs with 1-pixel offsets, which can still have
problems on discontinuities and sub-pixel variations. These potential problems
can only be alleviated by more radical design changes in the compositor
functions, which are out of scope for now. Basically the values passed to the
UV/Displacement inputs would need to be associated with their 1st order
derivatives, which requires a general approach to derivatives in all nodes.
2013-12-04 16:05:56 +01:00
Sergey Sharybin
04e434cd81 Fix T37690: UI does not immediatelly reflect new length of effect strip 2013-12-04 20:47:23 +06:00
Lukas Tönne
45fc80153a Fix for interpolation errors on lower-left borders in compositor image
inputs.

http://wiki.blender.org/uploads/4/4c/Compo_image_interpolation_borders.png

Problem is that all image buffer reader nodes (RenderLayer, Image,
MovieClip) were clipping pixel coordinates to 0..N range (N being width
or height respectively). Bilinear interpolation works ok then on the
upper-right borders (x, N) and (N, y), since the last (N-1) pixel fades
out to N (background). But the lower-left (x, 0) and (0, y) borders are
not correctly interpolated because the nodes cut off the negative pixels
before the interpolation function can calculate their value.

To fix this, the interpolation functions are now entirely responsible
for handling "out of range" cases, i.e. setting (0,0,0,0) results for
invalid pixels, while also handling interpolation for borders.
Callers should not do pixel range checks themselves, which also makes
the code simpler. Should not have any real performance penalty,
the interpolation functions do this check anyway, so is probably even
slightly faster.
2013-12-04 12:09:13 +01:00
Sergey Sharybin
a698709d95 Code cleanup: remove unused color management functions 2013-12-04 15:57:54 +06:00
Campbell Barton
6a35b2d72a Compiler Warnings: disallow 'long' in DNA, its not reliably 64bit (gcc only) 2013-12-04 13:51:41 +11:00
Campbell Barton
a9b97dcf22 User interface: internal change, collect panels to draw before drawing.
avoids calling poll twice, in some cases
2013-12-04 11:57:19 +11:00
Bastien Montagne
4584caa133 Fix UI bug with 'socket menus' (used e.g. by cycles' Material panels).
Also tweaked a bit how nodes with more than one socket available are drawn:
* The node entry itself (a label) has no more any icon, so that it is aligned with the other single-socket nodes.
* The sub-entries (i.e. node's sockets) are more clearly indented (using a blank icon).

Details:
Another case of bad internal UI_HAS_ICON flag erasing by brutally assigning an uneeded value to but->flag.
Revealed by recent split of some button flags into but->drawflag.

Thanks to Thomas Dinge for noting the issue.
2013-12-04 00:09:12 +01:00
Campbell Barton
f3d13bec6d Code Cleanup: correct fabsf/fabs/abs use 2013-12-04 09:24:38 +11:00
Bastien Montagne
239f0dbcd2 Usual UI messages fixes & tweaks. 2013-12-03 22:42:58 +01:00
Bastien Montagne
46eef60d93 Cleanup: Internal degrees removal.
This patch changes most of the reamining degrees usage in internal code into radians.
I let a few which I know off asside, for reasons explained below - and I'm not sure to have found out all of them.

WARNING: this introduces forward incompatibility, which means files saved from this version won't open 100% correctly
         in previous versions (a few angle properties would use radians values as degrees...).

Details:
- Data:
-- Lamp.spotsize: Game engine exposed this setting in degrees, to not break the API here I kept it as such
                  (using getter/setter functions), still using radians internally.
-- Mesh.smoothresh: Didn't touch to this one, as we will hopefully replace it completely by loop normals currently in dev.

- Modifiers:
-- EdgeSplitModifierData.split_angle, BevelModifierData.bevel_angle: Done.

- Postprocessing:
-- WipeVars.angle (sequencer's effect), NodeBokehImage.angle, NodeBoxMask.rotation, NodeEllipseMask.rotation: Done.

- BGE:
-- bConstraintActuator: Orientation type done (the minloc[0] & maxloc[0] cases). Did not touch to 'limit location' type,
                        it can also limit rotation, but it exposes through RNA the same limit_min/limit_max, which hence
                        can be either distance or angle values, depending on the mode. Will leave this to BGE team.
-- bSoundActuator.cone_outer_angle_3d, bSoundActuator.cone_inner_angle_3d: Done (note I kept degrees in BGE itself,
                                                                           as it seems this is the expected value here...).
-- bRadarSensor.angle: Done.

Reviewers: brecht, campbellbarton, sergey, gaiaclary, dfelinto, moguri, jbakker, lukastoenne, howardt

Reviewed By: brecht, campbellbarton, sergey, gaiaclary, moguri, jbakker, lukastoenne, howardt
Thanks to all!

Differential Revision: http://developer.blender.org/D59
2013-12-03 20:35:45 +01:00
Sergey Sharybin
4627516884 Fix T37663: Black matcap when object located on a curve
Summary:
Issue was caused by GLSL samplers not valid anymore after
dupliobject was drawn into OpenGL displist.

Solution for now is to not use displist for active object
when matcap is used.

The same issue exists for regular GLSL viewport draw, and
this was solved by disabling diplist if draw_glsl_material
returns truth for current dupliobject.

Reviewers: brecht

Reviewed By: brecht

Maniphest Tasks: T37663

Differential Revision: http://developer.blender.org/D70
2013-12-03 22:14:16 +06:00
Sergey Sharybin
d3f3fb89cc Fix T37670: Paint mode + procedural map colours error
Summary:
Seems to be known TODO in the code, but no idea why it
was never solved, especially since tweak is so much easy.

It might be arguable that we need to support painting
color space, but it's still much better to convert to
sRGB space. It's gonna to cover 90% of cases anyway.

Reviewers: campbellbarton, brecht

Reviewed By: brecht

Maniphest Tasks: T37670

Differential Revision: http://developer.blender.org/D65
2013-12-03 22:13:15 +06:00
Campbell Barton
f91187d3c3 Code cleanup: replace rectf_scale with BLI_rctf_scale
and add area arg to ui_handler_panel_region
2013-12-03 23:53:21 +11:00
Dalai Felinto
ab49437958 View Navigation: Walk and Fly modes
This is a addtion to the dynamic fly mode.
It behaves as the first person navigation system available in most 3d world  games nowadays.

You can alternate between the old mode (Fly) and the new mode (Walk) in User Preferences > Inputs

Manual:
-------
http://wiki.blender.org/index.php/Doc:2.6/Manual/3D_interaction/Navigating/3D_View#View_Navigation
http://wiki.blender.org/index.php/Doc:2.6/Manual/3D_interaction/Navigating/3D_View/Navigation_Modes

Shortcuts:
----------
WASD (hold)  - Move forward/backward and straft left/right
QE (hold)    - Move up and down
Tab          - Alternate between Walk and Fly modes
Shift (hold) - Speed up movement
Alt (hold)   - Slow down movement
Space or MMB - Teleport
V            - Jump
+/- or mouse wheel - speed increase/decrease speed for this Blender session

User Preferences Options:
-------------------------
Navigation Mode   - fly/walk navigation systems (fly is the old, walk is the new, next options are for walk mode only)
Gravity           - alternate between free navigation and walk with gravity modes
Mouse Sensitivity - sensitivity factor to mouse influence to look around
Teleport Duration - how long the teleport lasts
Camera Height     - camera height to use in gravity mode
Jump Height       - maximum jump speed in m/s
Move Speed        - base move speed in m/s
Boost Factor      - multiplication factor when running or going slow (1/boost)

Development Notes:
------------------
* The initial code was based on view3d_fly.c.
* The NDoF code was not touched, so it most likely is not working.

Pending Issues:
---------------
* Draw in the UI the shortcut options, and current values (e.g., Mode: Fly/Walk)
  (we need a proper API for that)
* OSX seems to present issues if we re-center the mouse every time. We implemented a workaround for that, but a real fix would be welcome.

Code reviewed and with collaborations from Campbell Barton - @campbellbarton
Differential Revision: http://developer.blender.org/D30
2013-12-03 03:14:09 -02:00
Campbell Barton
2e4601c356 Code Cleanup: minor changes fly-mode edits, use copy_v3_fl3, remove comments 2013-12-03 13:37:04 +11:00
Campbell Barton
4fcd8b64da Code Cleanup: remove redundant/misleading NULL checks 2013-12-03 09:22:29 +11:00
Campbell Barton
1cee3e53fc Code Cleanup: use BLI_strncpy when copying into fixed sized buffers 2013-12-03 09:12:44 +11:00
Campbell Barton
a169a109e5 User Interface: error in own recent commit, replacing loop with memset 2013-12-03 09:10:55 +11:00
Campbell Barton
93b24b91a9 Knife Tool: incorrect sized vector args (harmless but misleading) 2013-12-03 09:10:03 +11:00
Campbell Barton
1782376d97 Laplacian Deform Modifier: fix possible NULL pointer dereference. 2013-12-03 09:06:22 +11:00
Campbell Barton
a24f83855a Fix for crash pasting text into uilist filter 2013-12-03 01:48:32 +11:00
Scott Petrovic
d8764ab39d 3D View: use proper units for viewport lens length, matching the camera property.
Reviewed By: brecht

Differential Revision: http://developer.blender.org/D63
2013-12-02 15:32:28 +01:00