Commit Graph

66005 Commits

Author SHA1 Message Date
Campbell Barton
994dd5c7c1 Cleanup: rename curve align-x flags 2016-06-21 12:45:25 +10:00
Dalai Felinto
cb5a77253a Text Object: Vertical Alignment
A new option for Font/Text objects vertical alignment:

* Top Base-Line (current mode)
* Top
* Center
* Bottom

The Top is the equivalent as the Top-Baseline with an empty line at the begin of the
text. It's nice to have this option too though, since if we are driving
the alignment via Python we don't want to add extra lines to the text
only to accomodate to the desired vertical alignment.

The Center and Bottom are as intuitive as their name suggest.

When working with text boxes, the vertical alignment only work for
paragraphs that are not vertically full.

Many thanks to Campbell Barton (ideasman42 / @campbellbarton) for the
code review, code comments, and overall suggestions and changes :)

Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D2061
2016-06-20 23:21:24 -03:00
Campbell Barton
48c58bd913 Merge branch 'master' into blender2.8 2016-06-21 12:14:49 +10:00
Campbell Barton
1c19940198 Fix T48688: Crash loading particle effector weights 2016-06-21 09:44:35 +10:00
Lukas Stockner
29ce3dfeb6 Fix T48691: Cycles - OpenCL - HDR Image mapping does not match CUDA rendering
The OpenCL texture code didn't offset the coordinates by half a pixel like the CPU code does.
2016-06-21 00:49:25 +02:00
Lukas Stockner
93c6cf496e Cycles: Deduplicate Vector and RGB Curve nodes
Since most of the code for these two nodes was identical, this commit
now instead uses a common base class that implements all the functionality.
2016-06-21 00:19:51 +02:00
Campbell Barton
a170607578 Fix T48683: Knife cut creates hole
BM_face_split_edgenet wasn't correctly detecting boundary vertices to walk over,
since vertices may be attached to boundary edges not part of the newly created face.
2016-06-21 08:10:56 +10:00
Campbell Barton
ed225d4517 BMesh: avoid verts-of-edge iterator
Since this function is called a lot, loop over data directly.
2016-06-21 08:10:51 +10:00
Lukas Stockner
dfa7ddd4a8 Cycles: Add svm_util_color.h file to CMake
The file wasn't included in CMake and therefore not installed into the addon folder.
2016-06-20 19:07:22 +02:00
Dalai Felinto
72273b08cc Fix building for Windows after 57cff46v (booleans unitialized) 2016-06-20 13:02:53 -03:00
Bastien Montagne
61b49de449 Fix once more time particle distribution.
rB046adde64f16 was actually pretty useless (and broken), since issue ends up not being
in binary search code, but in generation of the 'summed weights' array used to distribute
particles over mesh items - looks like very small weights could lead to null accumulated
weights, wich was breaking binary search.

Fixed simply by adding a minimal, non-zero weight for mesh items to be allowed to emit particles.

Hopefully we are done with this distribution mess!
2016-06-20 11:12:33 +02:00
Thomas Dinges
2e553f77b8 Cleanup: Remove todo comment, this is fine as is. 2016-06-19 21:09:54 +02:00
Alexander Gavrilov
f7bada00a7 Cycles: add constant folding for more color operation nodes.
Invert, brightness & constrast, separate/combine and Mix RGB blend modes
and clamping.
2016-06-19 20:17:28 +02:00
Alexander Gavrilov
81e391a727 Fix issues with node deduplication in Cycles shader graph.
It is not possible to use a set split by name as valid input to
check_node_input_traversed - it needs a complete set of all nodes visited so
far. On the other hand, the merge comparison loop should only check nodes that
were not just visited, but found unique. This means that there should really be
two separate data structures.

Without the fix, check_node_input_traversed actually never returns true, so
only nodes without any inputs are processed.
2016-06-19 20:17:27 +02:00
Alexander Gavrilov
98547e8817 Fix Cycles RGB and Vector Curves node Fac handling. 2016-06-19 20:17:27 +02:00
Brecht Van Lommel
34a42788e7 Code refactor: small code simplification for Cycles constant folding. 2016-06-19 20:17:27 +02:00
Brecht Van Lommel
c87f7865b2 Fix Cycles OSL image texture issue after recent refactor. 2016-06-19 20:17:26 +02:00
Brecht Van Lommel
e26eb9c93b Cycles: reduce CUDA stack memory access for Maxwell and up, increasing max registers.
For non-branched path tracing with a GTX 960 and CUDA 7.5, this gives a small reduction
in stack usage but mainly: 8% faster render on BMW, 5% on pabellon, 13% on classroom.
2016-06-19 20:17:26 +02:00
Brecht Van Lommel
9b618c1a5a Cycles tests: raise failure threshold, copy failed image for comparison. 2016-06-19 20:17:26 +02:00
Brecht Van Lommel
48caadfdd5 Fix Cycles assert after recent half changes. 2016-06-19 20:17:25 +02:00
Thomas Dinges
600f7df71b Fix return type in case of single channel half. 2016-06-19 17:38:39 +02:00
Thomas Dinges
6311a9ff23 Cycles: Support half and half4 textures.
This is an initial commit for half texture support in Cycles.
It adds the basic infrastructure inside of the ImageManager and support for these textures on CPU.

Supported:
* Half Float OpenEXR images (can be used for e.g HDRs or Normalmaps) now use 1/2 the memory, when loaded via disk (OIIO).

ToDo:
Various things like support for inbuilt half textures, GPU... will come later, step by step.

Part of my GSoC 2016.
2016-06-19 17:31:16 +02:00
Brecht Van Lommel
7da189b4e8 Fix broken combine XYZ node after recent refactoring. 2016-06-18 22:37:18 +02:00
Campbell Barton
2465bd90d5 Cleanup: style, whitespace, doxy filepaths 2016-06-19 06:33:29 +10:00
Brecht Van Lommel
d67c07ea49 Fix T48671: Cycles crash with OSL nodes and bump after recent refactoring. 2016-06-18 12:32:40 +02:00
Sergey Sharybin
7ac126e728 Fix T46492: GGX distribution produces black pixels
The issue was caused by some numerical instability.
2016-06-17 16:30:29 +02:00
Campbell Barton
bcde045b32 Fix T48667: Bisect-fill crash
BMO iterator would loop over removed faces.

Recent changes to mempool FREEWORD size exposed this bug.
2016-06-17 21:45:56 +10:00
Sergey Sharybin
ca01fe58e1 Fix T48662: Blender crash using node groups connected with displacement output in some situations 2016-06-17 12:14:36 +02:00
Lukas Stockner
f0c7a2a25c Fix T48657: Incorrect render with Cycles (CPU) using texture
The sockets of the RGB to BW node were set to the wrong type after the recent node refactor.
2016-06-17 05:20:47 +02:00
Bastien Montagne
d747bfbe29 Fix/cleanup BKE libquery's ID looper.
Some area were still not in sync with readfile.c, now should be better.

Note that readfile.c has been used as référence here re us refcounting,
not sure how accurate it is, time will say :|
2016-06-16 21:12:12 +02:00
Bastien Montagne
503315111e readfile.c: fix some wrong usages of newlibadr_us.
There are most likely some more still, but think this should now be inline with
libquery looper...
2016-06-16 20:31:11 +02:00
Bastien Montagne
d05014f844 Readfile cleanup: add new newlibadr_real_us helper. 2016-06-16 19:23:09 +02:00
Campbell Barton
42e2398ae3 Vertex paint color operations
D2050 by @metaraptor with edits

Adds levels, brightness/contrast, hsv & invert operations.
2016-06-17 01:56:59 +10:00
Campbell Barton
3f744a16c4 Correct error in recent commit 2016-06-16 22:18:59 +10:00
Bastien Montagne
046adde64f Fix some rare asserts with new simple/random particle distribution code.
Optimization in binary search could lead to equality instead of expected strictly greater than value.
Harmless but noisy, and better be strict here.

reported by sergey on irc (with koro cycles benchmark file), thanks.
2016-06-16 14:08:44 +02:00
Campbell Barton
5ea27bec1f BMesh Decimate: use doubles to calculate optimized position
This allows the error threshold for calculating the optimized location to be much lower.

Resolves visible artifacts w/ 1m-tri happy-buddha example.
2016-06-16 19:25:02 +10:00
Campbell Barton
47a5d7d1bc BLI_math: Add double versions of functions
- mul_v3_m3v3_db
- mul_m3_v3_db
- negate_v3_db
2016-06-16 19:20:08 +10:00
Campbell Barton
ef515822ce Fix ruler crash using stale snap-context
Since ruler allows other operators to run (such as mode-switching).
Only cache snap-context while dragging.
2016-06-16 18:49:39 +10:00
Campbell Barton
57cff46cec BMesh Decimate: support ngons 2016-06-16 04:30:59 +10:00
Campbell Barton
9285bbe484 Fix error splitting convex faces
Created double faces, leaked memory.
2016-06-16 03:43:22 +10:00
Campbell Barton
3c64696972 Fix T48654: outline text visible while renaming
Both button and rename text would draw while renaming,
caused issues with some themes.
2016-06-15 21:46:32 +10:00
Campbell Barton
2cfff95ba3 Merge branch 'master' into blender2.8 2016-06-15 17:41:22 +10:00
Campbell Barton
eedcc4a6a0 Merge branch 'master' into blender2.8 2016-06-15 17:29:11 +10:00
Dalai Felinto
e0db647d35 Fix region_2d_to_origin_3d not working with ortho view
In some cases when:
* the viewport was in the camera mode
* the camera was ortho
* the view was not fitting (as oppose to use HOME)

region_2d_to_origin_3d would misbehave (and consequently region_2d_to_location_3d).

Sample addon to test it:
```
import bpy

from bpy_extras.view3d_utils import (
    region_2d_to_location_3d,
    )

from mathutils import (
    Vector,
    )

class MoveXYOperator(bpy.types.Operator):
    """Translate the view using mouse events"""
    bl_idname = "view3d.move_xy"
    bl_label = "Move XY"

    @classmethod
    def poll(cls, context):
        return context.object

    def modal(self, context, event):
        if event.type == 'MOUSEMOVE':
            self.move(context, event)

        elif event.type in {'LEFTMOUSE', 'RIGHTMOUSE', 'ESC'}:
            return {'FINISHED'}

        return {'RUNNING_MODAL'}

    def invoke(self, context, event):
        if context.space_data.type == 'VIEW_3D':
            self.ob = context.object
            context.window_manager.modal_handler_add(self)
            return {'RUNNING_MODAL'}
        else:
            self.report({'WARNING'}, "Active space must be a View3d")
            return {'CANCELLED'}

    def move(self, context, event):
        xy = region_2d_to_location_3d(
                context.region,
                context.space_data.region_3d,
                (event.mouse_region_x, event.mouse_region_y),
                Vector(),
                ).xy

        self.ob.location.xy = xy

def register():
    bpy.utils.register_class(MoveXYOperator)

def unregister():
    bpy.utils.unregister_class(MoveXYOperator)

if __name__ == "__main__":
    register()
```
2016-06-14 18:03:07 -03:00
Campbell Barton
09da51e603 Text Editor: auto-complete removed entire word on undo 2016-06-15 04:28:13 +10:00
Campbell Barton
81f435202a VSE: minor drawing glitch with meta's
Meta contents could obscure meta selection outline, draw after.
2016-06-15 04:08:03 +10:00
Campbell Barton
28398f654d Correct update issue caused by recent commit
VSE effects within a meta-strip could fail to update on cancel.
2016-06-15 04:08:03 +10:00
Campbell Barton
eaf894db6d Fix VSE updating effects within metas
Missing update caused internal lengths to be wrong.
2016-06-15 02:44:34 +10:00
Thomas Dinges
a3a7e46318 Cleanup: Remove outdated comment, visibility layers in kernel have been removed. 2016-06-14 16:46:44 +02:00
Bastien Montagne
9182e07c0e FileSpace cleanup: make ED_path_extension_type public.
Maybe we should move it to BLI, but not sure how, and where (and its defines
are SpaceFile's ones, meh :| ).
2016-06-14 16:30:16 +02:00