blender.git
4 years agoMerge branch 'master' into blender2.8
Sybren A. Stüvel [Wed, 8 Feb 2017 12:10:16 +0000 (13:10 +0100)]
Merge branch 'master' into blender2.8

# Conflicts:
# source/blender/blenloader/intern/writefile.c

4 years agoFix T49249: Alembic export with multiple hair systems crash blender
Sybren A. Stüvel [Wed, 8 Feb 2017 10:47:16 +0000 (11:47 +0100)]
Fix T49249: Alembic export with multiple hair systems crash blender

Removed unnecessary call to DM_update_tessface_data(). This call is
already performed by DM_ensure_tessface(dm). The call being performed
twice caused a failing BLI_assert().

Reviewed by: Kévin Dietrich

4 years agoAlembic export: avoid infinite loops trying to find parent objects.
Sybren A. Stüvel [Wed, 8 Feb 2017 10:50:21 +0000 (11:50 +0100)]
Alembic export: avoid infinite loops trying to find parent objects.

Also added some assertions for debugging purposes

Reviewed by: Kévin Dietrich

4 years agoAlembic export: only create transform writer if the object should be exported
Sybren A. Stüvel [Wed, 8 Feb 2017 10:48:59 +0000 (11:48 +0100)]
Alembic export: only create transform writer if the object should be exported

Reviewed by: Kévin Dietrich

4 years agoAlembic: #undef'ed the correct macro
Sybren A. Stüvel [Tue, 7 Feb 2017 13:53:09 +0000 (14:53 +0100)]
Alembic: #undef'ed the correct macro

TEST_RET is not defined anywhere in Blender's sources, and LAYER_CMP
is no longer used after this function ends.

4 years agoAlembic: Use getXForm() in check, because it's used in rest of the function too
Sybren A. Stüvel [Tue, 7 Feb 2017 11:20:42 +0000 (12:20 +0100)]
Alembic: Use getXForm() in check, because it's used in rest of the function too

This makes the code within the function consistent.

4 years agoAlembic: Renamed copy_zup_yup to copy_yup_from_zup (and same for zup_from_yup)
Sybren A. Stüvel [Fri, 3 Feb 2017 14:54:59 +0000 (15:54 +0100)]
Alembic: Renamed copy_zup_yup to copy_yup_from_zup (and same for zup_from_yup)

With the new names the arguments (yup, zup) are in the same order as
they appear in the function name. The old names used copy_src_dst(dst,
src), which I found very confusing. Furthermore, now it is clear from
where to where the copy is made.

This makes the function names a little bit longer, though. If that is
a real issue, we can just name them zup_from_yup(zup, yup).

Reviewed by: Kévin Dietrich

4 years agoPartial "fix" for objects not being selected
Dalai Felinto [Tue, 7 Feb 2017 18:11:17 +0000 (19:11 +0100)]
Partial "fix" for objects not being selected

To bring this fix a step further we need to address all the BA_WAS_SEL instances, and make sure they follow the new design.

This commit allow you to see the object selected (its center anyways) when you do select all.

Note: in the clay engine selection (a) was already working fine.

4 years agoCleanup: Use const qualifier in some of color management code
Sergey Sharybin [Tue, 7 Feb 2017 16:49:35 +0000 (17:49 +0100)]
Cleanup: Use const qualifier in some of color management code

4 years agoSequencer: Some extra speedup in color space conversion
Sergey Sharybin [Tue, 7 Feb 2017 16:45:28 +0000 (17:45 +0100)]
Sequencer: Some extra speedup in color space conversion

Use the new utility from coloranagement which multi-threads byte to
float conversion.

Gives extra 10% speedup from quick tests.

4 years agoColor management: Add utility function to convert byte to float with processor applied
Sergey Sharybin [Tue, 7 Feb 2017 16:45:02 +0000 (17:45 +0100)]
Color management: Add utility function to convert byte to float with processor applied

4 years agoSequencer: Speedup conversion to sequencer space
Sergey Sharybin [Tue, 7 Feb 2017 16:30:51 +0000 (17:30 +0100)]
Sequencer: Speedup conversion to sequencer space

Speedup is mainly gained by multi-threading. Gives about 3x
fps gain on an edit shot file.

There is still some room for improvements, will happen in one
of the upcoming commits.

4 years agoColor management: Implement threaded byte buffer conversion
Sergey Sharybin [Tue, 7 Feb 2017 15:59:17 +0000 (16:59 +0100)]
Color management: Implement threaded byte buffer conversion

The title says it all actually: now we can convert byte buffer
directly, without need of temporary float buffer.

4 years agoLayers: get/update CollectionEngineSettings (depsgraph placeholder)
Dalai Felinto [Tue, 7 Feb 2017 15:54:09 +0000 (16:54 +0100)]
Layers: get/update CollectionEngineSettings (depsgraph placeholder)

Every time:
  * A collection settings is set
  * A collection visibility changes
  * An object is added/removed/ ...

We need to recalculate the "accumulated" CollectionEngineSettings that
the render engine should use for an object.

This is to be handled by the depsgraph. Meanwhile this code should allow
us to start using those settings in the render engines.

Note: We are storing this in the objects, which means we can only have
one active calculated option every time.

This is intended to get the conversation with the Depsgraph department
going.

4 years agoParam `is_cached` not being used in` bvhtree_from_mesh_edges_setup_data`
Germano Cavalcante [Tue, 7 Feb 2017 14:03:10 +0000 (11:03 -0300)]
Param `is_cached` not being used in` bvhtree_from_mesh_edges_setup_data`

This could cause bugs in the memory release

4 years agoFix missing hair after rendering with different viewport/render settings
Sergey Sharybin [Tue, 7 Feb 2017 13:21:29 +0000 (14:21 +0100)]
Fix missing hair after rendering with different viewport/render settings

Derived mesh for particles did not include tessellated faces when it
was expected to. Now added explicit function to copy CDDM with tess
faces without need to re-tessellate the result.

4 years agoFix T49253: Cycles blackbody is wrong on AVX2 CPU on Windows
Sergey Sharybin [Tue, 7 Feb 2017 12:05:19 +0000 (13:05 +0100)]
Fix T49253: Cycles blackbody is wrong on AVX2 CPU on Windows

Seems to be bug in optimizer, but managed to reshuffle in a way
which should also give some speedup.

4 years agoFix broken COLLADA building.
Bastien Montagne [Tue, 7 Feb 2017 11:05:23 +0000 (12:05 +0100)]
Fix broken COLLADA building.

4 years agoClay-Engine (merge clay-engine)
Clément Foucault [Tue, 7 Feb 2017 10:20:15 +0000 (11:20 +0100)]
Clay-Engine (merge clay-engine)

Initial work by Clément Foucault with contributions from Dalai Felinto
(mainly per-collection engine settings logic, and depsgraph iterator placeholder).

This makes Blender require OpenGL 3.3. Which means Intel graphic card
and OSX will break. Disable CLAY_ENGINE in CMake in those cases.

This is a prototype render engine intended to help the design of real
render engines. This is mainly an engine with enphasis in matcap and
ambient occlusion.

Implemented Features
--------------------

* Clay Render Engine, following the new API, to be used as reference for
future engines

* A more complete Matcap customization with more options

* Per-Collection render engine settings

* New Ground Truth AO - not enabled

Missing Features
----------------

* Finish object edit mode
  - Fix shaders to use new matrix
  - Fix artifacts when edge does off screen
  - Fix depth issue
  - Selection sillhouette
  - Mesh wires
  - Use mesh normals (for higher quality matcap)
  - Non-Mesh objects drawing
  - Widget drawing
  - Performance issues

* Finish mesh edit mode
  - Derived-Mesh-less edit mode API (mesh_rende.c)

* General edit mode
  - Per-collection edit mode settings

* General engines
  - Per-collection engine settings
    (they are their, but they still need to be flushed by depsgraph, and
    used by the drawing code)

4 years agoRender Layers and Collections (merge from render-layers)
Dalai Felinto [Tue, 7 Feb 2017 09:18:38 +0000 (10:18 +0100)]
Render Layers and Collections (merge from render-layers)

Design Documents
----------------

* https://wiki.blender.org/index.php/Dev:2.8/Source/Layers

* https://wiki.blender.org/index.php/Dev:2.8/Source/DataDesignRevised

User Commit Log
---------------

* New Layer and Collection system to replace render layers and viewport layers.

* A layer is a set of collections of objects (and their drawing options) required for specific tasks.

* A collection is a set of objects, equivalent of the old layers in Blender. A collection can be shared across multiple layers.

* All Scenes have a master collection that all other collections are children of.

* New collection "context" tab (in Properties Editor)

* New temporary viewport "collections" panel to control per-collection
visibility

Missing User Features
---------------------

* Collection "Filter"
  Option to add objects based on their names

* Collection Manager operators
  The existing buttons  are placeholders

* Collection Manager drawing
  The editor main region is empty

* Collection Override

* Per-Collection engine settings
  This will come as a separate commit, as part of the clay-engine branch

Dev Commit Log
--------------

* New DNA file (DNA_layer_types.h) with the new structs
  We are replacing Base by a new extended Base while keeping it backward
  compatible with some legacy settings (i.e., lay, flag_legacy).

  Renamed all Base to BaseLegacy to make it clear the areas of code that
  still need to be converted

  Note: manual changes were required on - deg_builder_nodes.h, rna_object.c, KX_Light.cpp

* Unittesting for main syncronization requirements
  - read, write, add/copy/remove objects, copy scene, collection
  link/unlinking, context)

* New Editor: Collection Manager
  Based on patch by Julian Eisel
  This is extracted from the layer-manager branch. With the following changes:

    - Renamed references of layer manager to collections manager

    - I doesn't include the editors/space_collections/ draw and util files

    - The drawing code itself will be implemented separately by Julian

* Base / Object:
  A little note about them. Original Blender code would try to keep them
  in sync through the code, juggling flags back and forth. This will now
  be handled by Depsgraph, keeping Object and Bases more separated
  throughout the non-rendering code.

  Scene.base is being cleared in doversion, and the old viewport drawing
  code was poorly converted to use the new bases while the new viewport
  code doesn't get merged and replace the old one.

Python API Changes
------------------

```
- scene.layers
+ # no longer exists

- scene.objects
+ scene.scene_layers.active.objects

- scene.objects.active
+ scene.render_layers.active.objects.active

- bpy.context.scene.objects.link()
+ bpy.context.scene_collection.objects.link()

- bpy_extras.object_utils.object_data_add(context, obdata, operator=None, use_active_layer=True, name=None)
+ bpy_extras.object_utils.object_data_add(context, obdata, operator=None, name=None)

- bpy.context.object.select
+ bpy.context.object.select = True
+ bpy.context.object.select = False
+ bpy.context.object.select_get()
+ bpy.context.object.select_set(action='SELECT')
+ bpy.context.object.select_set(action='DESELECT')

-AddObjectHelper.layers
+ # no longer exists
```

4 years agoPIL_time_utildefines: also show total time in TIMEIT_AVERAGED.
Bastien Montagne [Tue, 7 Feb 2017 09:14:46 +0000 (10:14 +0100)]
PIL_time_utildefines: also show total time in TIMEIT_AVERAGED.

4 years agoOpenGL: add gpuMatrixUpdate_legacy function
Mike Erwin [Tue, 7 Feb 2017 04:23:36 +0000 (23:23 -0500)]
OpenGL: add gpuMatrixUpdate_legacy function

Marks matrix state as dirty so shader will use the latest values from glScale, glTranslate, etc.

We'll remove this after transitioning 100% to the new matrix API, which handles this sort of thing automatically.

Part of T49450

4 years agofix unused var warnings
Mike Erwin [Tue, 7 Feb 2017 04:19:52 +0000 (23:19 -0500)]
fix unused var warnings

follow-up to earlier patch

4 years agoOpenGL: convert clip_dopesheet_draw to new imm mode
Mike Erwin [Thu, 2 Feb 2017 03:42:50 +0000 (22:42 -0500)]
OpenGL: convert clip_dopesheet_draw to new imm mode

D2486 by @TCMBoby, part of T49043

4 years agoOpenGL immediate mode: interface_draw.c (cont)
Clément Foucault [Mon, 6 Feb 2017 23:24:44 +0000 (00:24 +0100)]
OpenGL immediate mode: interface_draw.c (cont)

ui_draw_but_WAVEFORM
ui_draw_but_VECTORSCOPE

4 years agoFix (unreported) Object previews being written even for skipped objects.
Bastien Montagne [Mon, 6 Feb 2017 19:58:18 +0000 (20:58 +0100)]
Fix (unreported) Object previews being written even for skipped objects.

4 years agoCleanup writefile code a bit.
Bastien Montagne [Mon, 6 Feb 2017 19:42:00 +0000 (20:42 +0100)]
Cleanup writefile code a bit.

Modernize some of it a bit, saves quite some lines of blabla (using
shile instead of for loops... tsssts...).

4 years agoCMake: Remove MOTO library dependency when it is not needed
Jorge Bernal [Mon, 6 Feb 2017 18:29:42 +0000 (19:29 +0100)]
CMake: Remove MOTO library dependency when it is not needed

It is not necessary to add MOTO library dependency when we use
WITH_IK_SOLVER (now it uses Eigen) or we use WITH_MOD_BOOLEAN (it was
used by bsp intern library some time ago but it is not present in the
code anymore).

Reviewers: mont29, sergey

Subscribers: mont29, sergey

Differential Revision: https://developer.blender.org/D2477

4 years agoSpecify the correct size of the BVHTree of edges
Germano Cavalcante [Mon, 6 Feb 2017 17:59:31 +0000 (14:59 -0300)]
Specify the correct size of the BVHTree of edges

~edge_num~ edges_num_active
Not always all the edges enter in the build

4 years agoStandardization and style for BKE_bvhutils
Germano Cavalcante [Mon, 6 Feb 2017 17:11:06 +0000 (14:11 -0300)]
Standardization and style for BKE_bvhutils

Add `bvhtree_from_mesh_edges_ex` and callbacks to nearest_to_ray (Similar to the other functions of this code)

4 years agoFix 'public' global 'g_atexit' var in Blender.
Bastien Montagne [Mon, 6 Feb 2017 16:42:30 +0000 (17:42 +0100)]
Fix 'public' global 'g_atexit' var in Blender.

No reason to not make this private to this file, and it gave conflict
when using bpy as module and loading it in a GLib application (which
also has a g_atexit var).

4 years agoOpenGL immediate mode: interface_draw.c (cont)
Clément Foucault [Mon, 6 Feb 2017 15:54:26 +0000 (16:54 +0100)]
OpenGL immediate mode: interface_draw.c (cont)

ui_draw_but_HISTOGRAM
UI_draw_text_underline (untested)

4 years agoFix compilation error after recent change
Sergey Sharybin [Mon, 6 Feb 2017 14:29:13 +0000 (15:29 +0100)]
Fix compilation error after recent change

4 years agoOpenGL immediate mode: interface_draw.c (cont)
Clément Foucault [Mon, 6 Feb 2017 14:19:45 +0000 (15:19 +0100)]
OpenGL immediate mode: interface_draw.c (cont)

Replaced GL_POLYGON in various places.
Ported UI_draw_roundbox_unfilled

4 years agoAdd shortcuts for unsigned int, short, long and char
Sergey Sharybin [Mon, 6 Feb 2017 14:04:13 +0000 (15:04 +0100)]
Add shortcuts for unsigned int, short, long and char

Feel free to use those in the new code.

And stay away from simple "unsigned".

4 years agoUse hash instead of linear lookup in armature deform
Sergey Sharybin [Mon, 6 Feb 2017 10:12:35 +0000 (11:12 +0100)]
Use hash instead of linear lookup in armature deform

This avoids calling linear lookup 100s of time when dealing with
real-life character.

Still some tweaks possible.

4 years agoMulti-thread displace modifier
Sergey Sharybin [Mon, 6 Feb 2017 13:21:29 +0000 (14:21 +0100)]
Multi-thread displace modifier

The title says it all actually. Use BLI task to loop over vertices
and distort their locations. Gives 2x FPS increase in a file with
just time-dependent displace modifier on my desktop.

4 years agoOpenGL immediate mode: interface_draw.c
Clément Foucault [Mon, 6 Feb 2017 13:06:13 +0000 (14:06 +0100)]
OpenGL immediate mode: interface_draw.c

4 years agoImmediate mode: edit_curve_paint 1/2
Dalai Felinto [Mon, 6 Feb 2017 11:40:02 +0000 (12:40 +0100)]
Immediate mode: edit_curve_paint 1/2

Part of T49043

4 years agoDisplace modifier: Use special version of texture sampling
Sergey Sharybin [Mon, 6 Feb 2017 11:33:37 +0000 (12:33 +0100)]
Displace modifier: Use special version of texture sampling

This version will give less spin locks and now well-tested by render engines.

This should reduce amount of threading overhead when having multiple objects
with displace modifier enabled.

In the future this will also help us threading the modifier.

There are more modifiers which could benefit from this, but let's first
investigate the new behavior with one of them.

4 years agoAdd special texture sampling function which takes image pool argument
Sergey Sharybin [Mon, 6 Feb 2017 11:23:03 +0000 (12:23 +0100)]
Add special texture sampling function which takes image pool argument

Using image pool will reduce number of thread locks when acquiring image.
Useful when it's needed to sample texture fewzillion times a second.

4 years agoFix memory leak when building without audaspace
Sergey Sharybin [Mon, 6 Feb 2017 10:18:20 +0000 (11:18 +0100)]
Fix memory leak when building without audaspace

4 years agoC++ conformance fixes (MSVC /permissive-)
Phil Christensen [Mon, 6 Feb 2017 09:44:25 +0000 (10:44 +0100)]
C++ conformance fixes (MSVC /permissive-)

We (the Microsoft C++ team) use the Blender project as part of our "Real world code" tests.
I noticed a place in WIN32 specific code (dvpapi.cpp:85) where a string literal is losing
its const-ness when being passed to BLI_dynlib_open().  This is not permitted when using the
/permissive- conformance compiler switch (see our blog
https://blogs.msdn.microsoft.com/vcblog/2016/11/16/permissive-switch/)

My suggested fix is to add const and propagate it where needed.  Another possible fix would be
to explicitly cast away the const.

Reviewers: mont29, sergey, LazyDodo

Subscribers: Blendify, sergey, mont29, LazyDodo

Tags: #platform:_windows

Differential Revision: https://developer.blender.org/D2495

4 years agofix T50602: Avoid crash when executing `transform_snap_context_project_view3d_mixed...
Germano Cavalcante [Mon, 6 Feb 2017 04:01:39 +0000 (01:01 -0300)]
fix T50602: Avoid crash when executing `transform_snap_context_project_view3d_mixed` with `dist_px` NULL

4 years agoBLF: simplify API for default font
Mike Erwin [Sun, 5 Feb 2017 06:01:41 +0000 (01:01 -0500)]
BLF: simplify API for default font

We had two versions of several BLF functions -- one for a specific font ID & another for the default font.

New BLF_default function lets us simplify this API & delete the redundant code.

4 years agofix most UI text color
Mike Erwin [Sun, 5 Feb 2017 05:54:21 +0000 (00:54 -0500)]
fix most UI text color

There are still many places to fix. I'll miss the bright yellow!

This commit also uses the new BLF_default function where possible.

Part of T49043 since we call glColor less often.

4 years agoadd BLF_default function
Mike Erwin [Sun, 5 Feb 2017 04:12:53 +0000 (23:12 -0500)]
add BLF_default function

So we don't need two versions of all other BLF functions -- one for specific font ID & another for the default font.

4 years agoOpenGL: use GL4 on Linux when available
Mike Erwin [Sun, 5 Feb 2017 00:35:54 +0000 (19:35 -0500)]
OpenGL: use GL4 on Linux when available

Minimum target is still 3.3

On AMD pro driver, asking for a 3.3 context gives us *exactly* 3.3, not 3.3+ as desired.

Have not tested proprietary NV or Intel drivers, but this fix should work on all vendors.

4 years agoCleaning of the last commit: lack of attention with the debug of time X(
Germano Cavalcante [Sat, 4 Feb 2017 22:06:41 +0000 (19:06 -0300)]
Cleaning of the last commit: lack of attention with the debug of time X(

This was a stupid mistake

4 years agoOptimize BVHTree creation of vertices that have BLI_bitmap test
Germano Cavalcante [Sat, 4 Feb 2017 22:01:29 +0000 (19:01 -0300)]
Optimize BVHTree creation of vertices that have BLI_bitmap test

Instead of reference the vertex first and test the bitmap afterwards. Test the bitmap first and reference the vertex after.

In a mesh with 31146 vertices and the entire bitmap disabled, the loop time is 243% faster
With all bitmap enabled, the time becomes 463473% faster!!!

One possible reason for this huge difference in peformance is that maybe the compiler is not putting the function "BM_vert_at_index" inline (I dont know if buildbot do this, but it's good to investigate).

4 years agofix T50592: Scene.raycast not working
Germano Cavalcante [Sat, 4 Feb 2017 21:17:15 +0000 (18:17 -0300)]
fix T50592: Scene.raycast not working

Ray_start and ray_normal values were being ignored

4 years agoFix (unreported) crash in new snap code.
Bastien Montagne [Sat, 4 Feb 2017 20:51:27 +0000 (21:51 +0100)]
Fix (unreported) crash in new snap code.

Looks like `object_map` and `mem_arena` may be NULL sometimes...

Also, cleaned up function pointers declaration of Nearest2dUserData,
those were warning out in gcc. Please, *always* use typdef defined
prototypes for function pointers, it is sooooo much cleaner and clearer
that way. And easy to convert from compatible functions too.

4 years agoFix T50590: BI lamp doesn't hold a texture in this case.
Bastien Montagne [Sat, 4 Feb 2017 20:29:51 +0000 (21:29 +0100)]
Fix T50590: BI lamp doesn't hold a texture in this case.

BKE_lamp_free was somehow missing the refactor of datablocks handling
(which, among other things, completely separated ID refcounting and
linking management from ID freeing itself).

Either forgot during development, or lost during merge...

4 years agoSnap System: Use callbaks to differentiate how referenced vertives of DerivedMeshs...
Germano Cavalcante [Fri, 3 Feb 2017 23:08:57 +0000 (20:08 -0300)]
Snap System: Use callbaks to differentiate how referenced vertives of DerivedMeshs and Bmeshs

Before it was informed the type of object in the `userdata`, and a same function ran between the types to obtain the coordinates of the vertices

4 years agoRemove flag: `SNAP_OBJECT_USE_CACHE` from snap_context
Germano Cavalcante [Fri, 3 Feb 2017 22:03:31 +0000 (19:03 -0300)]
Remove flag: `SNAP_OBJECT_USE_CACHE` from snap_context

Since the cache is created in one way or another, this flag is not really making a difference
More details here: D2496

4 years agofix T46892: snap to closest point now works with Individual Origins
Germano Cavalcante [Fri, 3 Feb 2017 16:15:44 +0000 (13:15 -0300)]
fix T46892: snap to closest point now works with Individual Origins

The code looks for the closest element between its centers. In the case of islands, the center of each vertex is the center of the island.
The solution here is to skip the search for islands when the operation is translation

4 years agoForgotten in committee ddf99214dc06
Germano Cavalcante [Fri, 3 Feb 2017 15:57:02 +0000 (12:57 -0300)]
Forgotten in committee ddf99214dc06
In obect mode, the rotation matrix need to be restored to the initial value if a snap point is not found

4 years agoBuildbot: Re-enable cuda support for OSX
Sergey Sharybin [Fri, 3 Feb 2017 15:09:53 +0000 (16:09 +0100)]
Buildbot: Re-enable cuda support for OSX

4 years agoFix T50125: Shortcut keys missing in menus for Clear Location, Rotation, and Scale.
Bastien Montagne [Fri, 3 Feb 2017 15:10:00 +0000 (16:10 +0100)]
Fix T50125: Shortcut keys missing in menus for Clear Location, Rotation, and Scale.

Menu entries and shortcuts did not have exact same behavior, now they do
(using shortcuts' behavior).

4 years agoModifications to GPU_texture:
Clément Foucault [Fri, 3 Feb 2017 15:01:32 +0000 (16:01 +0100)]
Modifications to GPU_texture:

-Remove NPOT check as it should be supported by default with OGL 3.3
-All custom texture creation follow the same path now
-Now explicit texture format is required when creating a custom texture (Non RGBA8)
-Support for arrays of textures

Reviewers: dfelinto, merwin

Differential Revision: https://developer.blender.org/D2452

4 years agoFix T49860: Copying vgroups between objects sharing the same obdata was not possible.
Bastien Montagne [Fri, 3 Feb 2017 14:47:44 +0000 (15:47 +0100)]
Fix T49860: Copying vgroups between objects sharing the same obdata was not possible.

Pretty straight forward actually, just do not bother about obdata part
of vgroups in that case, only copy object part of it.

And let's curse once again those stuff spread accross several types of
data-blocks...

4 years agoDepsgraph: Add some extra debug prints on eval
Sergey Sharybin [Fri, 3 Feb 2017 13:05:59 +0000 (14:05 +0100)]
Depsgraph: Add some extra debug prints on eval

4 years agoTests: Use proper order for EXPECT_EQ()
Sergey Sharybin [Fri, 3 Feb 2017 11:03:59 +0000 (12:03 +0100)]
Tests: Use proper order for EXPECT_EQ()

4 years agoTests: Use EXPECT_FALSE() instead of EXPECT_EQ(foo, false)
Sergey Sharybin [Fri, 3 Feb 2017 10:52:47 +0000 (11:52 +0100)]
Tests: Use EXPECT_FALSE() instead of EXPECT_EQ(foo, false)

4 years agoTests: Use EXPECT_TRUE() instead of EXPECT_EQ(foo, true)
Sergey Sharybin [Fri, 3 Feb 2017 10:51:01 +0000 (11:51 +0100)]
Tests: Use EXPECT_TRUE() instead of EXPECT_EQ(foo, true)

4 years agoCycles: Cleanup, order of arguments to EXPECT_EQ
Sergey Sharybin [Fri, 3 Feb 2017 10:35:34 +0000 (11:35 +0100)]
Cycles: Cleanup, order of arguments to EXPECT_EQ

The order was wrong from the semantic point of view, caused
by some legacy workarounds in Libmv. Didn't realize it's was
not how things were expected to be used.

4 years agoExplode modifier: Don't tessellate DM if we are not going to apply modifier
Sergey Sharybin [Fri, 3 Feb 2017 10:03:47 +0000 (11:03 +0100)]
Explode modifier: Don't tessellate DM if we are not going to apply modifier

4 years agofix T49494: snap_align_rotation should use a local pivot to make the transformation
Germano Cavalcante [Fri, 3 Feb 2017 05:27:57 +0000 (02:27 -0300)]
fix T49494: snap_align_rotation should use a local pivot to make the transformation

The problem was simple, just transform the global coordinates of t->tsnap.snapTarget to local coordinates.
(Some comments were added to the code)

4 years agoFix shaders in some immBindBuiltinProgram calls
Luca Rood [Fri, 3 Feb 2017 01:17:22 +0000 (23:17 -0200)]
Fix shaders in some immBindBuiltinProgram calls

Had mistakenly used 3D shaders for some 2D drawings...
Replaced those now.

Part of T49043

4 years agoMerge branch 'master' into blender2.8
Bastien Montagne [Thu, 2 Feb 2017 20:50:12 +0000 (21:50 +0100)]
Merge branch 'master' into blender2.8

4 years agoFix T50084: Adding torus re-orders UV layers.
Bastien Montagne [Thu, 2 Feb 2017 20:37:53 +0000 (21:37 +0100)]
Fix T50084: Adding torus re-orders UV layers.

Issue was indeed in join operation, mesh in which we join all others
could be re-added to final data after others, leading to undesired
re-ordering of CD layers, and existing vertices etc. being shifted away
from their original indices, etc.

All kind of more or less bad and undesired changes, fixed by always
re-inserting destination mesh first.

Also cleaned up a bit that code, it was doing some rather
non-recommanded things (like allocating zero-sized mem, doing own
coocking to remove a data-block from main, etc.).

4 years agoinstall_deps.sh: don't use backticks
Sybren A. Stüvel [Thu, 2 Feb 2017 15:04:49 +0000 (16:04 +0100)]
install_deps.sh: don't use backticks

The script complained that it could not find the executable "--build-all".

4 years agoOpenGL immediate mode: transform_snap.c and part of drawnode.c
Luca Rood [Thu, 2 Feb 2017 05:14:52 +0000 (03:14 -0200)]
OpenGL immediate mode: transform_snap.c and part of drawnode.c

Also converted ED_node_draw_snap from drawnode.c
Committing these together, as they are inter-dependent.

Part of T49043

4 years agoMake imm_drawcircball public
Luca Rood [Thu, 2 Feb 2017 05:13:41 +0000 (03:13 -0200)]
Make imm_drawcircball public

(Approved by merwin in IRC)

Required by part of T49043

4 years agoOpenGL immediate mode: space_graph.c
Luca Rood [Thu, 2 Feb 2017 01:00:39 +0000 (23:00 -0200)]
OpenGL immediate mode: space_graph.c

Part of T49043

4 years agoFix T50524: Basis shapekey editing while rendering bug.
Bastien Montagne [Thu, 2 Feb 2017 16:00:52 +0000 (17:00 +0100)]
Fix T50524: Basis shapekey editing while rendering bug.

Root of the issue was BM_mesh_bm_to_me() breaking application of basis
offset to 'child' shapekeys, when called more than once from same BMesh.

4 years agoinstall_deps.sh: don't use backticks
Sybren A. Stüvel [Thu, 2 Feb 2017 15:04:49 +0000 (16:04 +0100)]
install_deps.sh: don't use backticks

The script complained that it could not find the executable "--build-all".

4 years agoFix T50497: prop_search not correctly drew in UI (D2473)
raa [Thu, 2 Feb 2017 14:30:50 +0000 (17:30 +0300)]
Fix T50497: prop_search not correctly drew in UI (D2473)

4 years agoFix T50535: Cycles render segfault when Explode modifier before hair particle modifie...
Sergey Sharybin [Thu, 2 Feb 2017 13:32:05 +0000 (14:32 +0100)]
Fix T50535: Cycles render segfault when Explode modifier before hair particle modifier + UV material

Tricky issue caused by CDDM_copy() coying MFACE array but not MTFACE which
confused logic later on.

Now we don't copy ANY tessellation unless it is requested to.

Thanks Bastien for help and review!

4 years agoRevert the change of a default in a recent commit
Aaron Carlisle [Thu, 2 Feb 2017 04:46:53 +0000 (23:46 -0500)]
Revert the change of a default in a recent commit

This was my own mistake

4 years agoFix incorrect spot lamp blend in python GPU uniform export.
Michael Stahre [Thu, 2 Feb 2017 02:59:11 +0000 (03:59 +0100)]
Fix incorrect spot lamp blend in python GPU uniform export.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D2378

4 years agoFix missing uniform type for python GPU uniform export.
Michael Stahre [Thu, 2 Feb 2017 02:59:21 +0000 (03:59 +0100)]
Fix missing uniform type for python GPU uniform export.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D2379

4 years agoOpenGL immediate mode: view3d_ruler.c
Luca Rood [Fri, 27 Jan 2017 04:36:29 +0000 (02:36 -0200)]
OpenGL immediate mode: view3d_ruler.c

Differential Revision: https://developer.blender.org/D2485

Part of T49043

4 years agofix build: BLF Theme color
Mike Erwin [Thu, 2 Feb 2017 00:00:30 +0000 (19:00 -0500)]
fix build: BLF Theme color

blenderplayer uses BLF but not Editor UI, so we got a link error for the missing UI_GetThemeColor function.

Moved the new function from BLF to UI.

@Blendify reported problem in IRC

4 years agoOpenGL immediate mode: drawanimviz.c
Luca Rood [Wed, 1 Feb 2017 22:46:33 +0000 (20:46 -0200)]
OpenGL immediate mode: drawanimviz.c

Differential Revision: https://developer.blender.org/D2484

Part of T49043

4 years agoAdd GetThemeColorBlendShade3ubv function
Luca Rood [Wed, 1 Feb 2017 22:40:49 +0000 (20:40 -0200)]
Add GetThemeColorBlendShade3ubv function

Differential Revision: https://developer.blender.org/D2484

Used by part of T49043

4 years agoBLF can use Theme colors
Mike Erwin [Wed, 1 Feb 2017 21:44:00 +0000 (16:44 -0500)]
BLF can use Theme colors

For anything fancier than regular Theme colors (shading, alpha, etc.) do this:

unsigned char color[4]
UI_GetThemeColor[Fancy]4ubv(... color)
BLF_color4ubv(fontid, color)

That way the BLF color API stays simple.

4 years agoset default color for BLF fonts
Mike Erwin [Wed, 1 Feb 2017 21:20:40 +0000 (16:20 -0500)]
set default color for BLF fonts

Set to an annoying bright color so we can see where to add BLF_color calls.

4 years agoadd BLF_color functions
Mike Erwin [Wed, 1 Feb 2017 21:01:25 +0000 (16:01 -0500)]
add BLF_color functions

Needed a way to pass main font color to BLF without using obsolete glColor. Could not use immUniform since BLF binds its shader internally.

4 years agoOpenGL immediate mode: editmesh_knife.c
Luca Rood [Thu, 26 Jan 2017 00:14:13 +0000 (22:14 -0200)]
OpenGL immediate mode: editmesh_knife.c

Differential Revision: https://developer.blender.org/D2481

Part of T49043

4 years agoUI: Add missing colon
Aaron [Wed, 1 Feb 2017 19:56:11 +0000 (14:56 -0500)]
UI: Add missing colon

4 years agoOpenGL immediate mode: transform_constraints.c
Luca Rood [Thu, 26 Jan 2017 14:39:36 +0000 (12:39 -0200)]
OpenGL immediate mode: transform_constraints.c

Differential Revision: https://developer.blender.org/D2483

Part of T49043

4 years agoOpenGL immediate mode: transform_generics.c
Luca Rood [Thu, 26 Jan 2017 14:13:50 +0000 (12:13 -0200)]
OpenGL immediate mode: transform_generics.c

Differential Revision: https://developer.blender.org/D2482

Part of T49043

4 years agoFix T50570: pressing pgup or pgdn in any scrollable area irreversably alters scrollin...
Bastien Montagne [Wed, 1 Feb 2017 11:52:26 +0000 (12:52 +0100)]
Fix T50570: pressing pgup or pgdn in any scrollable area irreversably alters scrolling speed.

'page' prop of scroll up/down operators would get stuck once set once by
pageup/down keys... Now only take this prop into account if explicitely
set, not when its value is inherited from previous run.

4 years agoCycles tests: Allow python auto-exec
Sergey Sharybin [Wed, 1 Feb 2017 09:13:40 +0000 (10:13 +0100)]
Cycles tests: Allow python auto-exec

4 years agoCycles: Fix rng_state initialization when using resumable rendering
Lukas Stockner [Wed, 1 Feb 2017 04:43:17 +0000 (05:43 +0100)]
Cycles: Fix rng_state initialization when using resumable rendering

4 years agoSnap System: BVH: Ignore calculations, in parent nodes, used only in perspective...
Germano Cavalcante [Wed, 1 Feb 2017 00:43:44 +0000 (21:43 -0300)]
Snap System: BVH: Ignore calculations, in parent nodes, used only in perspective view

Strangely this change does not affect the performance very much.
Suzanne subdividide 6x (ortho view):
Before:0.00013983
After :0.00013920

But it makes it easier to read the code

4 years agoOpenGL: use new matrix API for Loop Cut
Mike Erwin [Tue, 31 Jan 2017 22:06:36 +0000 (17:06 -0500)]
OpenGL: use new matrix API for Loop Cut

Follow-up to rB85174329d9f5
Part of T49450

4 years agoOpenGL: fix MultMatrix order
Mike Erwin [Tue, 31 Jan 2017 22:03:07 +0000 (17:03 -0500)]
OpenGL: fix MultMatrix order

Partial revert of rB06d4aca87956

Problem found while converting old GL matrix calls to new API (T49450)

4 years agoSnap System: Invert the test order of the elements to snap (useful for ruler)
Germano Cavalcante [Tue, 31 Jan 2017 20:10:34 +0000 (17:10 -0300)]
Snap System: Invert the test order of the elements to snap (useful for ruler)

When the function that tests snap on multiple elements starts from the face and ends at the vertex, the transition between elements becomes much smoother.